Package marauroa.common.net.message
Class MessageC2SLoginWithToken
java.lang.Object
marauroa.common.net.message.Message
marauroa.common.net.message.MessageC2SLoginWithToken
- All Implemented Interfaces:
Serializable
This message indicate the server that the client wants to login and send the
needed info: username, password and seed to the server. The password is
protected by Crypt(xor(xor(client nonce, server nonce), password))
- See Also:
Message
-
Nested Class Summary
Nested classes/interfaces inherited from class marauroa.common.net.message.Message
Message.MessageType
-
Field Summary
Fields inherited from class marauroa.common.net.message.Message
channel, clientid, CLIENTID_INVALID, protocolVersion, timestampMessage, type
-
Constructor Summary
ConstructorDescriptionConstructor for allowing creation of an empty messageMessageC2SLoginWithToken(Channel source, byte[] nonce, byte[] encryptedSessionKey, byte[] initVector, String username, String tokenType, byte[] encryptedToken)
Constructor with a TCP/IP source/destination of the message and the name of the choosen character. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
byte[]
This method returns the encoded tokenbyte[]
byte[]
getNonce()
This method returns the tokenTypeThis method returns the usernamevoid
Serialize the object from an ObjectInputtoString()
This method returns a String that represent the objectvoid
writeObject(OutputSerializer out)
Serialize the object into an ObjectOutputMethods inherited from class marauroa.common.net.message.Message
getAddress, getChannel, getClientID, getMessageTimestamp, getProtocolVersion, getType, internalToString, isPerception, isSkippable, readFromMap, requiresPerception, setChannel, setClientID, setProtocolVersion, writeToJson
-
Constructor Details
-
MessageC2SLoginWithToken
public MessageC2SLoginWithToken()Constructor for allowing creation of an empty message -
MessageC2SLoginWithToken
public MessageC2SLoginWithToken(Channel source, byte[] nonce, byte[] encryptedSessionKey, byte[] initVector, String username, String tokenType, byte[] encryptedToken)Constructor with a TCP/IP source/destination of the message and the name of the choosen character.- Parameters:
source
- The TCP/IP address associated to this messagenonce
- random number to prevent replay attacksusername
- the username of the user that wants to logininitVector
-encryptedSessionKey
-tokenType
- type of tokentoken
- authentication token
-
-
Method Details
-
getNonce
public byte[] getNonce() -
getEncryptedSessionKey
public byte[] getEncryptedSessionKey() -
getInitVector
public byte[] getInitVector() -
getUsername
This method returns the username- Returns:
- the username
-
getTokenType
This method returns the tokenType- Returns:
- the tokenType
-
getEncryptedToken
public byte[] getEncryptedToken()This method returns the encoded token- Returns:
- the token
-
toString
This method returns a String that represent the object -
writeObject
Description copied from class:Message
Serialize the object into an ObjectOutput- Specified by:
writeObject
in interfaceSerializable
- Overrides:
writeObject
in classMessage
- Parameters:
out
- the output serializer.- Throws:
IOException
- if the serializations fails
-
readObject
Description copied from class:Message
Serialize the object from an ObjectInput- Specified by:
readObject
in interfaceSerializable
- Overrides:
readObject
in classMessage
- Parameters:
in
- the input serializer- Throws:
IOException
- if the serializations fails
-