8 type TVariableType = (vtCommand, vtLongInt, vthwFloat, vtBoolean); |
8 type TVariableType = (vtCommand, vtLongInt, vthwFloat, vtBoolean); |
9 TCommandHandler = procedure (var params: shortstring); |
9 TCommandHandler = procedure (var params: shortstring); |
10 |
10 |
11 procedure initModule; |
11 procedure initModule; |
12 procedure freeModule; |
12 procedure freeModule; |
|
13 procedure RegisterVariable(Name: shortstring; VType: TVariableType; p: pointer; Trusted: boolean); |
13 procedure ParseCommand(CmdStr: shortstring; TrustedSource: boolean); |
14 procedure ParseCommand(CmdStr: shortstring; TrustedSource: boolean); |
14 procedure StopMessages(Message: Longword); |
15 procedure StopMessages(Message: Longword); |
15 procedure doPut(putX, putY: LongInt; fromAI: boolean); |
16 procedure doPut(putX, putY: LongInt; fromAI: boolean); |
16 |
17 |
17 implementation |
18 implementation |
18 uses uStore, Types, uConsts, uGears, uTeams, uIO, uKeys, uMobile, |
19 uses Types, uConsts, uIO, uKeys, uMobile, |
19 uRandom, uAmmos, uStats, uChat, SDLh, uSound, uVisualGears, uScript, uTypes, |
20 uRandom, uAmmos, uChat, SDLh, uScript, uTypes, |
20 uVariables, uConsole, uFloat, uUtils, Adler32; |
21 uVariables, uConsole, uUtils; |
21 |
22 |
22 type PVariable = ^TVariable; |
23 type PVariable = ^TVariable; |
23 TVariable = record |
24 TVariable = record |
24 Next: PVariable; |
25 Next: PVariable; |
25 Name: string[15]; |
26 Name: string[15]; |
123 begin |
122 begin |
124 Variables:= nil; |
123 Variables:= nil; |
125 isDeveloperMode:= true; |
124 isDeveloperMode:= true; |
126 |
125 |
127 // NOTE: please, keep most frequently used commands on bottom |
126 // NOTE: please, keep most frequently used commands on bottom |
128 RegisterVariable('landcheck',vtCommand, @chLandCheck , false); |
|
129 RegisterVariable('sendlanddigest',vtCommand, @chSendLandDigest, false); |
|
130 RegisterVariable('flag' , vtCommand, @chFlag , false); |
127 RegisterVariable('flag' , vtCommand, @chFlag , false); |
131 RegisterVariable('script' , vtCommand, @chScript , false); |
128 RegisterVariable('script' , vtCommand, @chScript , false); |
132 RegisterVariable('proto' , vtCommand, @chCheckProto , true ); |
129 RegisterVariable('proto' , vtCommand, @chCheckProto , true ); |
133 RegisterVariable('spectate', vtBoolean, @fastUntilLag , false); |
130 RegisterVariable('spectate', vtBoolean, @fastUntilLag , false); |
134 RegisterVariable('capture' , vtCommand, @chCapture , true ); |
131 RegisterVariable('capture' , vtCommand, @chCapture , true ); |
135 RegisterVariable('rotmask' , vtCommand, @chRotateMask , true ); |
132 RegisterVariable('rotmask' , vtCommand, @chRotateMask , true ); |
136 RegisterVariable('addteam' , vtCommand, @chAddTeam , false); |
|
137 RegisterVariable('rdriven' , vtCommand, @chTeamLocal , false); |
133 RegisterVariable('rdriven' , vtCommand, @chTeamLocal , false); |
138 RegisterVariable('map' , vtCommand, @chSetMap , false); |
134 RegisterVariable('map' , vtCommand, @chSetMap , false); |
139 RegisterVariable('theme' , vtCommand, @chSetTheme , false); |
135 RegisterVariable('theme' , vtCommand, @chSetTheme , false); |
140 RegisterVariable('seed' , vtCommand, @chSetSeed , false); |
136 RegisterVariable('seed' , vtCommand, @chSetSeed , false); |
141 RegisterVariable('template_filter', vtLongInt, @cTemplateFilter, false); |
137 RegisterVariable('template_filter', vtLongInt, @cTemplateFilter, false); |
157 RegisterVariable('gmflags' , vtLongInt, @GameFlags , false); |
153 RegisterVariable('gmflags' , vtLongInt, @GameFlags , false); |
158 RegisterVariable('trflags' , vtLongInt, @TrainingFlags , false); |
154 RegisterVariable('trflags' , vtLongInt, @TrainingFlags , false); |
159 RegisterVariable('turntime', vtLongInt, @cHedgehogTurnTime, false); |
155 RegisterVariable('turntime', vtLongInt, @cHedgehogTurnTime, false); |
160 RegisterVariable('minestime',vtLongInt, @cMinesTime , false); |
156 RegisterVariable('minestime',vtLongInt, @cMinesTime , false); |
161 RegisterVariable('fort' , vtCommand, @chFort , false); |
157 RegisterVariable('fort' , vtCommand, @chFort , false); |
162 RegisterVariable('voicepack',vtCommand, @chVoicepack , false); |
|
163 RegisterVariable('grave' , vtCommand, @chGrave , false); |
158 RegisterVariable('grave' , vtCommand, @chGrave , false); |
164 RegisterVariable('bind' , vtCommand, @chBind , true ); |
159 RegisterVariable('bind' , vtCommand, @chBind , true ); |
165 RegisterVariable('addhh' , vtCommand, @chAddHH , false); |
|
166 RegisterVariable('hat' , vtCommand, @chSetHat , false); |
160 RegisterVariable('hat' , vtCommand, @chSetHat , false); |
167 RegisterVariable('hhcoords', vtCommand, @chSetHHCoords , false); |
|
168 RegisterVariable('ammloadt', vtCommand, @chSetAmmoLoadout, false); |
161 RegisterVariable('ammloadt', vtCommand, @chSetAmmoLoadout, false); |
169 RegisterVariable('ammdelay', vtCommand, @chSetAmmoDelay, false); |
162 RegisterVariable('ammdelay', vtCommand, @chSetAmmoDelay, false); |
170 RegisterVariable('ammprob', vtCommand, @chSetAmmoProbability, false); |
163 RegisterVariable('ammprob', vtCommand, @chSetAmmoProbability, false); |
171 RegisterVariable('ammreinf', vtCommand, @chSetAmmoReinforcement, false); |
164 RegisterVariable('ammreinf', vtCommand, @chSetAmmoReinforcement, false); |
172 RegisterVariable('ammstore', vtCommand, @chAddAmmoStore , false); |
165 RegisterVariable('ammstore', vtCommand, @chAddAmmoStore , false); |
175 RegisterVariable('+speedup', vtCommand, @chSpeedup_p , true ); |
168 RegisterVariable('+speedup', vtCommand, @chSpeedup_p , true ); |
176 RegisterVariable('-speedup', vtCommand, @chSpeedup_m , true ); |
169 RegisterVariable('-speedup', vtCommand, @chSpeedup_m , true ); |
177 RegisterVariable('zoomin' , vtCommand, @chZoomIn , true ); |
170 RegisterVariable('zoomin' , vtCommand, @chZoomIn , true ); |
178 RegisterVariable('zoomout' , vtCommand, @chZoomOut , true ); |
171 RegisterVariable('zoomout' , vtCommand, @chZoomOut , true ); |
179 RegisterVariable('zoomreset',vtCommand, @chZoomReset , true ); |
172 RegisterVariable('zoomreset',vtCommand, @chZoomReset , true ); |
180 RegisterVariable('skip' , vtCommand, @chSkip , false); |
|
181 RegisterVariable('history' , vtCommand, @chHistory , true ); |
173 RegisterVariable('history' , vtCommand, @chHistory , true ); |
182 RegisterVariable('chat' , vtCommand, @chChat , true ); |
174 RegisterVariable('chat' , vtCommand, @chChat , true ); |
183 RegisterVariable('say' , vtCommand, @chSay , true ); |
175 RegisterVariable('say' , vtCommand, @chSay , true ); |
184 RegisterVariable('hogsay' , vtCommand, @chHogSay , true ); |
|
185 RegisterVariable('team' , vtCommand, @chTeamSay , true ); |
176 RegisterVariable('team' , vtCommand, @chTeamSay , true ); |
186 RegisterVariable('ammomenu', vtCommand, @chAmmoMenu , true); |
177 RegisterVariable('ammomenu', vtCommand, @chAmmoMenu , true); |
187 RegisterVariable('+precise', vtCommand, @chPrecise_p , false); |
178 RegisterVariable('+precise', vtCommand, @chPrecise_p , false); |
188 RegisterVariable('-precise', vtCommand, @chPrecise_m , false); |
179 RegisterVariable('-precise', vtCommand, @chPrecise_m , false); |
189 RegisterVariable('+left' , vtCommand, @chLeft_p , false); |
180 RegisterVariable('+left' , vtCommand, @chLeft_p , false); |
203 RegisterVariable('setweap' , vtCommand, @chSetWeapon , false); |
194 RegisterVariable('setweap' , vtCommand, @chSetWeapon , false); |
204 RegisterVariable('slot' , vtCommand, @chSlot , false); |
195 RegisterVariable('slot' , vtCommand, @chSlot , false); |
205 RegisterVariable('put' , vtCommand, @chPut , false); |
196 RegisterVariable('put' , vtCommand, @chPut , false); |
206 RegisterVariable('ljump' , vtCommand, @chLJump , false); |
197 RegisterVariable('ljump' , vtCommand, @chLJump , false); |
207 RegisterVariable('hjump' , vtCommand, @chHJump , false); |
198 RegisterVariable('hjump' , vtCommand, @chHJump , false); |
208 RegisterVariable('fullscr' , vtCommand, @chFullScr , true ); |
|
209 RegisterVariable('+volup' , vtCommand, @chVol_p , true ); |
199 RegisterVariable('+volup' , vtCommand, @chVol_p , true ); |
210 RegisterVariable('-volup' , vtCommand, @chVol_m , true ); |
200 RegisterVariable('-volup' , vtCommand, @chVol_m , true ); |
211 RegisterVariable('+voldown', vtCommand, @chVol_m , true ); |
201 RegisterVariable('+voldown', vtCommand, @chVol_m , true ); |
212 RegisterVariable('-voldown', vtCommand, @chVol_p , true ); |
202 RegisterVariable('-voldown', vtCommand, @chVol_p , true ); |
213 RegisterVariable('findhh' , vtCommand, @chFindhh , true ); |
203 RegisterVariable('findhh' , vtCommand, @chFindhh , true ); |