Package zombie.iso

Class ObjectsSyncRequests

java.lang.Object
zombie.iso.ObjectsSyncRequests

public final class ObjectsSyncRequests extends Object
Created by krotos139 on 11/6/2017.

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 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

      public ArrayList<zombie.iso.ObjectsSyncRequests.SyncIsoChunk> requestsSyncIsoChunk
    • requestsSyncIsoGridSquare

      public ArrayList<zombie.iso.ObjectsSyncRequests.SyncIsoGridSquare> requestsSyncIsoGridSquare
    • requestsSyncIsoObject

      public ArrayList<zombie.iso.ObjectsSyncRequests.SyncIsoObject> requestsSyncIsoObject
    • timeout

      public long timeout
  • Constructor Details

    • ObjectsSyncRequests

      public ObjectsSyncRequests(boolean isClient)
  • Method Details

    • putRequestSyncIsoChunk

      public void putRequestSyncIsoChunk(IsoChunk ch)
    • putRequestSyncItemContainer

      public void putRequestSyncItemContainer(ItemContainer container)
    • putRequestSyncIsoGridSquare

      public void putRequestSyncIsoGridSquare(IsoGridSquare sq)
    • sendRequests

      public void sendRequests(UdpConnection connection)
    • 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

      public void receiveGridSquareHashes(ByteBuffer bb)
    • receiveGridSquareObjectHashes

      public void receiveGridSquareObjectHashes(ByteBuffer bb)
    • receiveObject

      public void receiveObject(ByteBuffer bb)
    • serverSendRequests

      public void serverSendRequests(UdpEngine udpEngine)
    • serverSendRequests

      public void serverSendRequests(UdpConnection connection)