|
|
|
@ -10,8 +10,10 @@
@@ -10,8 +10,10 @@
|
|
|
|
|
package engine.net.client.msg; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import engine.Enum; |
|
|
|
|
import engine.exception.SerializationException; |
|
|
|
|
import engine.gameManager.ConfigManager; |
|
|
|
|
import engine.gameManager.DbManager; |
|
|
|
|
import engine.gameManager.ZoneManager; |
|
|
|
|
import engine.net.AbstractConnection; |
|
|
|
|
import engine.net.AbstractNetMsg; |
|
|
|
@ -44,14 +46,9 @@ public class WorldDataMsg extends ClientNetMsg {
@@ -44,14 +46,9 @@ public class WorldDataMsg extends ClientNetMsg {
|
|
|
|
|
super(Protocol.NEWWORLD, origin, reader); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static int getTotalMapSize(Zone root) { |
|
|
|
|
if (root.getNodes().isEmpty()) |
|
|
|
|
return 0; |
|
|
|
|
private static int getTotalMapSize() { |
|
|
|
|
|
|
|
|
|
int size = root.getNodes().size(); |
|
|
|
|
for (Zone child : root.getNodes()) |
|
|
|
|
size += getTotalMapSize(child); |
|
|
|
|
return size; |
|
|
|
|
return DbManager.getList(Enum.GameObjectType.Zone).size(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -86,7 +83,7 @@ public class WorldDataMsg extends ClientNetMsg {
@@ -86,7 +83,7 @@ public class WorldDataMsg extends ClientNetMsg {
|
|
|
|
|
writer.putInt(WorldServer.worldMapID); |
|
|
|
|
writer.putInt(0x00000000); |
|
|
|
|
|
|
|
|
|
writer.putInt(getTotalMapSize(root) + 1); |
|
|
|
|
writer.putInt(getTotalMapSize() + 1); |
|
|
|
|
Zone.serializeForClientMsg(root, writer); |
|
|
|
|
|
|
|
|
|
Zone hotzone = ZoneManager.hotZone; |
|
|
|
|