cz.cuni.amis.pogamut.ut2004.communication.messages.gbcommands
Class SetPassword

java.lang.Object
  extended by cz.cuni.amis.pogamut.base.communication.messages.CommandMessage
      extended by cz.cuni.amis.pogamut.ut2004.communication.messages.gbcommands.SetPassword

public class SetPassword
extends CommandMessage

Representation of the GameBots2004 command SETPASS. Sets the password for Bot and control connections. If the password is set the initiation of GB communication is changed to this: 1) A ---> GB sends HELLO message 2) B <--- user sends READY 3) C ... if the server is protected by pass: 3.a) C1 ---> GB sends PASSWORD {BlockedByIP="ip adress with port of the blocker (195.113.12.3:3001)"} 3.b) C2 <--- user sends password ( PASSWORD {Password pass}) ... if correct 3.c) C3 ---> GB sends PASSWDOK and info batch messages, user can continue normally .... if the password is wrong 3.d) C4 ---> PASSWDWRONG and connection ends Note: If the user knows that server is passworded he can use PASSWORD {Password pass} command instead of READY, and will be checked and sent info batch messages immediately


Field Summary
protected  java.lang.String Password
          Holds the password.
static java.lang.String PROTOTYPE
          Example how the message looks like - used during parser tests.
 
Constructor Summary
SetPassword()
          Creates new instance of command SetPassword.
SetPassword(SetPassword original)
          Cloning constructor.
SetPassword(java.lang.String Password)
          Creates new instance of command SetPassword.
 
Method Summary
 java.lang.String getPassword()
          Holds the password.
 SetPassword setPassword(java.lang.String Password)
          Holds the password.
 java.lang.String toHtmlString()
           
 java.lang.String toMessage()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROTOTYPE

public static final java.lang.String PROTOTYPE
Example how the message looks like - used during parser tests.

See Also:
Constant Field Values

Password

protected java.lang.String Password
Holds the password.

Constructor Detail

SetPassword

public SetPassword(java.lang.String Password)
Creates new instance of command SetPassword. Sets the password for Bot and control connections. If the password is set the initiation of GB communication is changed to this: 1) A ---> GB sends HELLO message 2) B <--- user sends READY 3) C ... if the server is protected by pass: 3.a) C1 ---> GB sends PASSWORD {BlockedByIP="ip adress with port of the blocker (195.113.12.3:3001)"} 3.b) C2 <--- user sends password ( PASSWORD {Password pass}) ... if correct 3.c) C3 ---> GB sends PASSWDOK and info batch messages, user can continue normally .... if the password is wrong 3.d) C4 ---> PASSWDWRONG and connection ends Note: If the user knows that server is passworded he can use PASSWORD {Password pass} command instead of READY, and will be checked and sent info batch messages immediately Corresponding GameBots message for this command is SETPASS.

Parameters:
Password - Holds the password.

SetPassword

public SetPassword()
Creates new instance of command SetPassword. Sets the password for Bot and control connections. If the password is set the initiation of GB communication is changed to this: 1) A ---> GB sends HELLO message 2) B <--- user sends READY 3) C ... if the server is protected by pass: 3.a) C1 ---> GB sends PASSWORD {BlockedByIP="ip adress with port of the blocker (195.113.12.3:3001)"} 3.b) C2 <--- user sends password ( PASSWORD {Password pass}) ... if correct 3.c) C3 ---> GB sends PASSWDOK and info batch messages, user can continue normally .... if the password is wrong 3.d) C4 ---> PASSWDWRONG and connection ends Note: If the user knows that server is passworded he can use PASSWORD {Password pass} command instead of READY, and will be checked and sent info batch messages immediately Corresponding GameBots message for this command is SETPASS.

WARNING: this is empty-command constructor, you have to use setters to fill it up with data that should be sent to GameBots2004!


SetPassword

public SetPassword(SetPassword original)
Cloning constructor.

Parameters:
original -
Method Detail

getPassword

public java.lang.String getPassword()
Holds the password.


setPassword

public SetPassword setPassword(java.lang.String Password)
Holds the password.


toString

public java.lang.String toString()
Overrides:
toString in class CommandMessage

toHtmlString

public java.lang.String toHtmlString()

toMessage

public java.lang.String toMessage()