Fix group refresh packet spam when entering a rogue map

This commit is contained in:
Melledy
2023-10-25 10:13:55 -07:00
parent 8c2434af5f
commit 1a0e64863f
3 changed files with 8 additions and 4 deletions

View File

@@ -89,7 +89,7 @@ public class RogueEntityLoader extends SceneEntityLoader {
prop.setPropInfo(propInfo); prop.setPropInfo(propInfo);
prop.setGroupId(group.getId()); prop.setGroupId(group.getId());
prop.setInstId(propInfo.getID()); prop.setInstId(propInfo.getID());
prop.setState(state); prop.setState(state, false);
// Overrides // Overrides
if (propExtra != null) { if (propExtra != null) {

View File

@@ -49,14 +49,14 @@ public class SceneEntityLoader {
prop.setPropInfo(propInfo); prop.setPropInfo(propInfo);
prop.setGroupId(group.getId()); prop.setGroupId(group.getId());
prop.setInstId(propInfo.getID()); prop.setInstId(propInfo.getID());
prop.setState(propInfo.getState()); prop.setState(propInfo.getState(), false);
// Cache // Cache
if (prop.getPropId() == 1003) { if (prop.getPropId() == 1003) {
// Hacky fix to open simulated universe // Hacky fix to open simulated universe
if (propInfo.getMappingInfoID() == 2220) { if (propInfo.getMappingInfoID() == 2220) {
// Regular simulated universe is locked behind a mission requirement by default // Regular simulated universe is locked behind a mission requirement by default
prop.setState(PropState.Open); prop.setState(PropState.Open, false);
} else { } else {
// Skip tutorial simulated universe // Skip tutorial simulated universe
return null; return null;

View File

@@ -42,10 +42,14 @@ public class EntityProp implements GameEntity {
} }
public void setState(PropState state) { public void setState(PropState state) {
this.setState(state, this.getScene().isLoaded());
}
public void setState(PropState state, boolean sendPacket) {
// Set state // Set state
this.state = state; this.state = state;
// Sync state update to client // Sync state update to client
if (this.getScene().isLoaded()) { if (sendPacket) {
this.getScene().getPlayer().sendPacket(new PacketSceneGroupRefreshScNotify(this, null)); this.getScene().getPlayer().sendPacket(new PacketSceneGroupRefreshScNotify(this, null));
} }
} }