Class ObjectsSyncRequests
Step 1: When the player moves, the player sends hashes of "IsoChunk" to the server. Step 2: The server compares hashes from client and hashes in server map, and if they differ - send a set of hashes to the client for each "IsoGridSquare" in "IsoChunk". Step 3: The client receives this list of hashes and compares it with local hashes for each "IsoGridSquare". If the hash from the server and the local differ, then the client requests objects, the hashs differ. Step 4: The server sends all requested objects and objects in this container to the client. Step 5: The client receives all the objects. Compares hashes of objects in a container with local ones. Calculates what needs to be changed to match the objects. New objects will be created. Objects that are missing will be deleted. Changed objects will be overwritten or deleted and added.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final short
static final short
static final short
ArrayList<zombie.iso.ObjectsSyncRequests.SyncIsoChunk>
ArrayList<zombie.iso.ObjectsSyncRequests.SyncIsoGridSquare>
ArrayList<zombie.iso.ObjectsSyncRequests.SyncIsoObject>
static final short
static final short
static final short
long
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
putRequestSyncItemContainer
(ItemContainer container) void
void
void
void
receiveSyncIsoChunk
(int x, int y) void
receiveSyncIsoGridSquare
(int x, int y, int z) void
receiveSyncIsoObject
(int x, int y, int z, long hash) void
sendRequests
(UdpConnection connection) void
serverSendRequests
(UdpConnection connection) void
serverSendRequests
(UdpEngine udpEngine)
-
Field Details
-
ClientSendChunkHashes
public static final short ClientSendChunkHashes- See Also:
-
ServerSendGridSquareHashes
public static final short ServerSendGridSquareHashes- See Also:
-
ClientSendGridSquareRequest
public static final short ClientSendGridSquareRequest- See Also:
-
ServerSendGridSquareObjectsHashes
public static final short ServerSendGridSquareObjectsHashes- See Also:
-
ClientSendObjectRequests
public static final short ClientSendObjectRequests- See Also:
-
ServerSendObject
public static final short ServerSendObject- See Also:
-
requestsSyncIsoChunk
-
requestsSyncIsoGridSquare
-
requestsSyncIsoObject
-
timeout
public long timeout
-
-
Constructor Details
-
ObjectsSyncRequests
public ObjectsSyncRequests(boolean isClient)
-
-
Method Details
-
putRequestSyncIsoChunk
-
putRequestSyncItemContainer
-
putRequestSyncIsoGridSquare
-
sendRequests
-
receiveSyncIsoChunk
public void receiveSyncIsoChunk(int x, int y) -
receiveSyncIsoGridSquare
public void receiveSyncIsoGridSquare(int x, int y, int z) -
receiveSyncIsoObject
public void receiveSyncIsoObject(int x, int y, int z, long hash) -
receiveGridSquareHashes
-
receiveGridSquareObjectHashes
-
receiveObject
-
serverSendRequests
-
serverSendRequests
-