Skip to content

Commit

Permalink
fix: login too slow (#2380)
Browse files Browse the repository at this point in the history
  • Loading branch information
hamusuke0323 authored Sep 21, 2023
1 parent ec2bfff commit 5ee4812
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/main/java/emu/grasscutter/game/home/HomeWorld.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ public HomeWorld(GameServer server, Player owner) {

this.home = owner.isOnline() ? owner.getHome() : GameHome.getByUid(owner.getUid());
this.refreshModuleManager();
server.registerHomeWorld(this);
}

@Override
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/emu/grasscutter/game/world/World.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ public World(GameServer server, Player owner) {
this.scenes = Int2ObjectMaps.synchronize(new Int2ObjectOpenHashMap<>());
this.entity = new EntityWorld(this);
this.lastUpdateTime = System.currentTimeMillis();

server.registerWorld(this);
}

public int getLevelEntityId() {
Expand Down
5 changes: 0 additions & 5 deletions src/main/java/emu/grasscutter/server/game/GameServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -311,11 +311,6 @@ public void deregisterWorld(World 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) {
return this.getHomeWorlds()
.computeIfAbsent(owner.getUid(), (uid) -> new HomeWorld(this, owner));
Expand Down

0 comments on commit 5ee4812

Please sign in to comment.