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