Class ClientRegistrationMessage

java.lang.Object
com.jme3.network.AbstractMessage
com.jme3.network.message.ClientRegistrationMessage
All Implemented Interfaces:
Message

public class ClientRegistrationMessage extends AbstractMessage
Client registration is a message that contains a unique ID. This ID is simply the current time in milliseconds, providing multiple clients will not connect to the same server within one millisecond. This is used to couple the TCP and UDP connections together into one 'Client' on the server.
Author:
Lars Wesselius, Paul Speed
  • Field Details

    • SERIALIZER_ID

      public static final short SERIALIZER_ID
      Serializer id reserved for backwards-compatible client registration messages.
      See Also:
  • Constructor Details

    • ClientRegistrationMessage

      public ClientRegistrationMessage()
      Creates an empty registration message for serialization.
  • Method Details

    • getId

      public long getId()
      Returns the client identifier that couples reliable and unreliable channels.
      Returns:
      the client identifier
    • setId

      public void setId(long id)
      Sets the client identifier that couples reliable and unreliable channels.
      Parameters:
      id - the client identifier
    • setGameName

      public void setGameName(String name)
      Sets the game name expected by the server.
      Parameters:
      name - the game name
    • getGameName

      public String getGameName()
      Returns the game name expected by the server.
      Returns:
      the game name
    • setVersion

      public void setVersion(int version)
      Sets the protocol or game version expected by the server.
      Parameters:
      version - the game version
    • getVersion

      public int getVersion()
      Returns the protocol or game version expected by the server.
      Returns:
      the game version
    • toString

      public String toString()
      Overrides:
      toString in class Object