Class TimesyncResponse

java.lang.Object
com.marswars.proxy_server.TimesyncResponse
All Implemented Interfaces:
Packet

public abstract class TimesyncResponse extends Object implements Packet
Packet handler for time synchronization responses. Provides functionality to create and serialize timesync response packets containing server timing information for precision time coordination.
  • Field Details

  • Constructor Details

    • TimesyncResponse

      public TimesyncResponse()
  • Method Details

    • serialize

      public static byte[] serialize(TimesyncResponse.TimesyncResponseData response)
      Serializes a TimesyncResponseData into a byte array for transmission.
      Parameters:
      response - the response data to serialize
      Returns:
      byte array representing the serialized response packet
    • deserialize

      public static TimesyncResponse.TimesyncResponseData deserialize(byte[] data)
      Deserializes a byte array into a TimesyncResponseData object.
      Parameters:
      data - the byte array to deserialize
      Returns:
      TimesyncResponseData object with parsed information
      Throws:
      IllegalArgumentException - if data length is invalid
    • createResponse

      Creates a timesync response for the given request with current server timestamps.
      Parameters:
      request - the original timesync request data
      Returns:
      TimesyncResponseData with current server timestamps