Class NetIdData


public final class NetIdData extends NetIdSeparate
  • Constructor Details

  • Method Details

    • setReceiver

      public NetIdData setReceiver(NetIdData.IMsgDataReceiver receiver)
    • setReadWrite

      public NetIdData setReadWrite(NetIdData.IMsgDataReceiver receiver, NetIdData.IMsgDataWriter writer)
    • send

      public void send(ActiveConnection connection)
      Sends this signal over the specified connection
    • send

      public void send(ActiveConnection connection, NetIdData.IMsgDataWriter writer)
    • withoutBuffering

      public NetIdData withoutBuffering()
      Description copied from class: NetIdBase
      Changes the flags for this packet to indicate that it should never be buffered by a BufferedConnection. This means that it will case ActiveConnection.flushQueue() to be called after this is sent. Please note that this does keep packet ordering - any previously written packets (which were buffered) will be read before this one is read. Sending a lot of these "queue-flushing packets" will generally have a large impact on performance.

      Unlike all of the other flag modification methods this may be called at any time, in particular before and after sending this.

      This method should be preferred over NetIdBase.notBuffered() because it returns itself.

      Specified by:
      withoutBuffering in class NetIdBase
      Returns:
      This.
    • withTinySize

      public NetIdData withTinySize()
      Description copied from class: NetIdBase
      Changes the size flags of this net ID to indicate that it should use a single byte for the packet's total length (including the header). In other words the maximum packet length is 256 bytes, and the minimum is 1 byte. Has no effect if the packet's length is not fixed.

      This method should be preferred over NetIdBase.setTinySize() because it returns itself.

      Specified by:
      withTinySize in class NetIdBase
      See Also:
    • withNormalSize

      public NetIdData withNormalSize()
      Description copied from class: NetIdBase
      Changes the size flags of this net ID to indicate that it should use two bytes for the packet's total length (including the header). In other words the maximum packet length is 65,536 bytes, and the minimum is 1 byte. Has no effect if the packet's length is not fixed.

      This method should be preferred over NetIdBase.setNormalSize() because it returns itself.

      Specified by:
      withNormalSize in class NetIdBase
      See Also:
    • withLargeSize

      public NetIdData withLargeSize()
      Description copied from class: NetIdBase
      Changes the size flags of this net ID to indicate that it should use three bytes for the packet's total length (including the header). In other words the maximum packet length is 16,777,216 bytes, and the minimum is 1 byte. Has no effect if the packet's length is not fixed.

      Unlike all of the other flag modification methods this may be called at any time, in particular before and after sending this.

      This method should be preferred over NetIdBase.setLargeSize() because it returns itself.

      Specified by:
      withLargeSize in class NetIdBase
      See Also:
    • toClientOnly

      public NetIdData toClientOnly()
      Description copied from class: NetIdBase
      Changes the flags for this packet to indicate that it should only be sent from the server to the client. This will make sending this packet from the client throw an unchecked exception, and make the server refuse to bind this packet to an integer ID for receiving.
      Specified by:
      toClientOnly in class NetIdBase
      See Also:
    • toServerOnly

      public NetIdData toServerOnly()
      Description copied from class: NetIdBase
      Changes the flags for this packet to indicate that it should only be sent from the client to the server. This will make sending this packet from the server throw an unchecked exception, and make the client refuse to bind this packet to an integer ID for receiving.
      Specified by:
      toServerOnly in class NetIdBase
      See Also:
    • toEitherSide

      public NetIdData toEitherSide()
      Description copied from class: NetIdBase
      This clears the NetIdBase.toClientOnly() and NetIdBase.toServerOnly() flag states, and will make sending packets not throw exceptions.

      This is the default state for every NetIdBase.

      Specified by:
      toEitherSide in class NetIdBase