1 2 /** 3 IMPORTANT !!! 4 5 DO NOT EDIT THIS FILE. IT IS GENERATED FROM approriate xml file in xmlresources/gbcommands BY 6 THE JavaClassesGenerator.xslt. MODIFY THAT FILE INSTEAD OF THIS ONE. 7 8 Use Ant task process-gb-messages after that to generate .java files again. 9 10 IMPORTANT END !!! 11 */ 12 package cz.cuni.amis.pogamut.ut2004.communication.messages.gbcommands;import java.util.*;import javax.vecmath.*;import cz.cuni.amis.pogamut.base.communication.messages.*;import cz.cuni.amis.pogamut.base.communication.worldview.*;import cz.cuni.amis.pogamut.base.communication.worldview.event.*;import cz.cuni.amis.pogamut.base.communication.worldview.object.*;import cz.cuni.amis.pogamut.multi.communication.worldview.object.*;import cz.cuni.amis.pogamut.base.communication.translator.event.*;import cz.cuni.amis.pogamut.multi.communication.translator.event.*;import cz.cuni.amis.pogamut.base3d.worldview.object.*;import cz.cuni.amis.pogamut.base3d.worldview.object.event.*;import cz.cuni.amis.pogamut.ut2004.communication.messages.*;import cz.cuni.amis.pogamut.ut2004.communication.worldview.objects.*;import cz.cuni.amis.pogamut.ut2004multi.communication.worldview.objects.*;import cz.cuni.amis.pogamut.ut2004.communication.translator.itemdescriptor.*;import cz.cuni.amis.pogamut.ut2004.communication.messages.ItemType.Category;import cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId;import cz.cuni.amis.utils.exception.*;import cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdateResult.Result;import cz.cuni.amis.utils.SafeEquals;import cz.cuni.amis.pogamut.base.agent.*;import cz.cuni.amis.pogamut.multi.agent.*;import cz.cuni.amis.pogamut.multi.communication.worldview.property.*;import cz.cuni.amis.pogamut.ut2004multi.communication.worldview.property.*;import cz.cuni.amis.utils.token.*;import cz.cuni.amis.utils.*; 13 /** 14 * Representation of the GameBots2004 command SETPASS. 15 * 16 * 17 Sets the password for Bot and control connections. If the 18 password is set the initiation of GB communication is changed to 19 this: 1) A ---> GB sends HELLO message 2) B <--- user 20 sends READY 3) C ... if the server is protected by pass: 3.a) C1 21 ---> GB sends PASSWORD {BlockedByIP="ip adress with port of 22 the blocker (195.113.12.3:3001)"} 3.b) C2 <--- user sends 23 password ( PASSWORD {Password pass}) ... if correct 3.c) C3 24 ---> GB sends PASSWDOK and info batch messages, user can 25 continue normally .... if the password is wrong 3.d) C4 ---> 26 PASSWDWRONG and connection ends Note: If the user knows that 27 server is passworded he can use PASSWORD {Password pass} command 28 instead of READY, and will be checked and sent info batch 29 messages immediately 30 31 */ 32 public class SetPassword 33 extends CommandMessage 34 { 35 36 37 /** Example how the message looks like - used during parser tests. */ 38 public static final String PROTOTYPE = 39 " {Password text} "; 40 41 /** 42 * Creates new instance of command SetPassword. 43 * 44 Sets the password for Bot and control connections. If the 45 password is set the initiation of GB communication is changed to 46 this: 1) A ---> GB sends HELLO message 2) B <--- user 47 sends READY 3) C ... if the server is protected by pass: 3.a) C1 48 ---> GB sends PASSWORD {BlockedByIP="ip adress with port of 49 the blocker (195.113.12.3:3001)"} 3.b) C2 <--- user sends 50 password ( PASSWORD {Password pass}) ... if correct 3.c) C3 51 ---> GB sends PASSWDOK and info batch messages, user can 52 continue normally .... if the password is wrong 3.d) C4 ---> 53 PASSWDWRONG and connection ends Note: If the user knows that 54 server is passworded he can use PASSWORD {Password pass} command 55 instead of READY, and will be checked and sent info batch 56 messages immediately 57 58 * Corresponding GameBots message for this command is 59 * SETPASS. 60 * 61 * 62 * @param Password Holds the password. 63 */ 64 public SetPassword( 65 String Password 66 ) { 67 68 this.Password = Password; 69 70 } 71 72 73 /** 74 * Creates new instance of command SetPassword. 75 * 76 Sets the password for Bot and control connections. If the 77 password is set the initiation of GB communication is changed to 78 this: 1) A ---> GB sends HELLO message 2) B <--- user 79 sends READY 3) C ... if the server is protected by pass: 3.a) C1 80 ---> GB sends PASSWORD {BlockedByIP="ip adress with port of 81 the blocker (195.113.12.3:3001)"} 3.b) C2 <--- user sends 82 password ( PASSWORD {Password pass}) ... if correct 3.c) C3 83 ---> GB sends PASSWDOK and info batch messages, user can 84 continue normally .... if the password is wrong 3.d) C4 ---> 85 PASSWDWRONG and connection ends Note: If the user knows that 86 server is passworded he can use PASSWORD {Password pass} command 87 instead of READY, and will be checked and sent info batch 88 messages immediately 89 90 * Corresponding GameBots message for this command is 91 * SETPASS. 92 * <p></p> 93 * WARNING: this is empty-command constructor, you have to use setters to fill it up with data that should be sent to GameBots2004! 94 */ 95 public SetPassword() { 96 } 97 98 99 /** 100 * Cloning constructor. 101 * 102 * @param original 103 */ 104 public SetPassword(SetPassword original) { 105 106 this.Password = original.Password; 107 108 } 109 110 /** 111 Holds the password. 112 */ 113 protected 114 String Password = 115 116 null 117 ; 118 119 120 121 /** 122 * Holds the password. 123 */ 124 public String getPassword() 125 126 { 127 return 128 Password; 129 } 130 131 132 133 134 /** 135 * Holds the password. 136 */ 137 public SetPassword 138 setPassword(String Password) 139 140 { 141 this.Password = Password; 142 return this; 143 } 144 145 public String toString() { 146 return toMessage(); 147 } 148 149 public String toHtmlString() { 150 return super.toString() + "[<br/>" + 151 152 "<b>Password</b> = " + 153 String.valueOf(getPassword() 154 ) + 155 " <br/> " + 156 157 "<br/>]" 158 ; 159 } 160 161 public String toMessage() { 162 StringBuffer buf = new StringBuffer(); 163 buf.append("SETPASS"); 164 165 if (Password != null) { 166 buf.append(" {Password " + Password + "}"); 167 } 168 169 return buf.toString(); 170 } 171 172 // --- Extra Java from XML BEGIN (extra/code/java) 173 174 // --- Extra Java from XML END (extra/code/java) 175 176 } 177