mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-25 03:09:39 +00:00
fix: login too slow (#2380)
This commit is contained in:
parent
ec2bfffdd1
commit
5ee4812ac5
@ -25,7 +25,6 @@ public class HomeWorld extends World {
|
|||||||
|
|
||||||
this.home = owner.isOnline() ? owner.getHome() : GameHome.getByUid(owner.getUid());
|
this.home = owner.isOnline() ? owner.getHome() : GameHome.getByUid(owner.getUid());
|
||||||
this.refreshModuleManager();
|
this.refreshModuleManager();
|
||||||
server.registerHomeWorld(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -72,6 +72,8 @@ public class World implements Iterable<Player> {
|
|||||||
this.scenes = Int2ObjectMaps.synchronize(new Int2ObjectOpenHashMap<>());
|
this.scenes = Int2ObjectMaps.synchronize(new Int2ObjectOpenHashMap<>());
|
||||||
this.entity = new EntityWorld(this);
|
this.entity = new EntityWorld(this);
|
||||||
this.lastUpdateTime = System.currentTimeMillis();
|
this.lastUpdateTime = System.currentTimeMillis();
|
||||||
|
|
||||||
|
server.registerWorld(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getLevelEntityId() {
|
public int getLevelEntityId() {
|
||||||
|
@ -311,11 +311,6 @@ public final class GameServer extends KcpServer implements Iterable<Player> {
|
|||||||
world.save(); // Save the player's world
|
world.save(); // Save the player's world
|
||||||
}
|
}
|
||||||
|
|
||||||
public void registerHomeWorld(HomeWorld homeWorld) {
|
|
||||||
this.getHomeWorlds().put(homeWorld.getOwnerUid(), homeWorld);
|
|
||||||
this.registerWorld(homeWorld);
|
|
||||||
}
|
|
||||||
|
|
||||||
public HomeWorld getHomeWorldOrCreate(Player owner) {
|
public HomeWorld getHomeWorldOrCreate(Player owner) {
|
||||||
return this.getHomeWorlds()
|
return this.getHomeWorlds()
|
||||||
.computeIfAbsent(owner.getUid(), (uid) -> new HomeWorld(this, owner));
|
.computeIfAbsent(owner.getUid(), (uid) -> new HomeWorld(this, owner));
|
||||||
|
Loading…
Reference in New Issue
Block a user