Class ClientRegistrationMessage
java.lang.Object
com.jme3.network.AbstractMessage
com.jme3.network.message.ClientRegistrationMessage
- All Implemented Interfaces:
Message
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA message-specific serializer to avoid compatibility issues between versions. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final shortSerializer id reserved for backwards-compatible client registration messages. -
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty registration message for serialization. -
Method Summary
Modifier and TypeMethodDescriptionReturns the game name expected by the server.longgetId()Returns the client identifier that couples reliable and unreliable channels.intReturns the protocol or game version expected by the server.voidsetGameName(String name) Sets the game name expected by the server.voidsetId(long id) Sets the client identifier that couples reliable and unreliable channels.voidsetVersion(int version) Sets the protocol or game version expected by the server.toString()Methods inherited from class AbstractMessage
isReliable, setReliable
-
Field Details
-
SERIALIZER_ID
public static final short SERIALIZER_IDSerializer 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
Sets the game name expected by the server.- Parameters:
name- the game name
-
getGameName
-
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
-