… | |
… | |
201 | {"create", command_create, 0.0}, |
201 | {"create", command_create, 0.0}, |
202 | {"debug", command_debug, 0.0}, |
202 | {"debug", command_debug, 0.0}, |
203 | {"dump", command_dump, 0.0}, |
203 | {"dump", command_dump, 0.0}, |
204 | {"dumpbelow", command_dumpbelow, 0.0}, |
204 | {"dumpbelow", command_dumpbelow, 0.0}, |
205 | {"dumpfriendlyobjects", command_dumpfriendlyobjects, 0.0}, |
205 | {"dumpfriendlyobjects", command_dumpfriendlyobjects, 0.0}, |
206 | {"dumpallarchetypes", command_dumpallarchetypes, 0.0}, |
|
|
207 | {"dumpallmaps", command_dumpallmaps, 0.0}, |
206 | {"dumpallmaps", command_dumpallmaps, 0.0}, |
208 | {"dumpallobjects", command_dumpallobjects, 0.0}, |
|
|
209 | {"dumpmap", command_dumpmap, 0.0}, |
207 | {"dumpmap", command_dumpmap, 0.0}, |
210 | {"forget_spell", command_forget_spell, 0.0}, |
208 | {"forget_spell", command_forget_spell, 0.0}, |
211 | {"free", command_free, 0.0}, |
209 | {"free", command_free, 0.0}, |
212 | {"freeze", command_freeze, 0.0}, |
210 | {"freeze", command_freeze, 0.0}, |
213 | {"goto", command_goto, 0.0}, |
|
|
214 | {"hide", command_hide, 0.0}, |
211 | {"hide", command_hide, 0.0}, |
215 | {"insert_into", command_insert_into, 0.0}, |
212 | {"insert_into", command_insert_into, 0.0}, |
216 | {"invisible", command_invisible, 0.0}, |
213 | {"invisible", command_invisible, 0.0}, |
217 | {"kick", command_kick, 0.0}, |
214 | {"kick", command_kick, 0.0}, |
218 | {"learn_special_prayer", command_learn_special_prayer, 0.0}, |
215 | {"learn_special_prayer", command_learn_special_prayer, 0.0}, |
… | |
… | |
237 | {"stack_push", command_stack_push, 0.0}, |
234 | {"stack_push", command_stack_push, 0.0}, |
238 | {"stats", command_stats, 0.0}, |
235 | {"stats", command_stats, 0.0}, |
239 | {"style_info", command_style_map_info, 0.0}, /* Costly command, so make it wiz only */ |
236 | {"style_info", command_style_map_info, 0.0}, /* Costly command, so make it wiz only */ |
240 | {"summon", command_summon, 0.0}, |
237 | {"summon", command_summon, 0.0}, |
241 | {"teleport", command_teleport, 0.0}, |
238 | {"teleport", command_teleport, 0.0}, |
242 | {"wizpass", command_wizpass, 0.0}, |
|
|
243 | {"wizcast", command_wizcast, 0.0}, |
|
|
244 | {"overlay_save", command_save_overlay, 0.0}, |
239 | {"overlay_save", command_save_overlay, 0.0}, |
245 | |
240 | |
246 | /* {"possess", command_possess, 0.0}, */ |
241 | /* {"possess", command_possess, 0.0}, */ |
247 | {"mon_aggr", command_mon_aggr, 0.0}, |
242 | {"mon_aggr", command_mon_aggr, 0.0}, |
248 | {"loadtest", command_loadtest, 0.0}, |
|
|
249 | }; |
243 | }; |
250 | const int WizCommandsSize = sizeof (WizCommands) / sizeof (CommArray_s); |
244 | const int WizCommandsSize = sizeof (WizCommands) / sizeof (CommArray_s); |
251 | |
245 | |
252 | /* Socket commands - these should really do nothing more than output things |
246 | /* Socket commands - these should really do nothing more than output things |
253 | * to the various players/sockets. |
247 | * to the various players/sockets. |
… | |
… | |
289 | qsort (WizCommands, WizCommandsSize, sizeof (CommArray_s), compare_A); |
283 | qsort (WizCommands, WizCommandsSize, sizeof (CommArray_s), compare_A); |
290 | qsort (Socket_Commands, Socket_CommandsSize, sizeof (CommArray_s), compare_A); |
284 | qsort (Socket_Commands, Socket_CommandsSize, sizeof (CommArray_s), compare_A); |
291 | qsort (Socket2_Commands, Socket2_CommandsSize, sizeof (CommArray_s), compare_A); |
285 | qsort (Socket2_Commands, Socket2_CommandsSize, sizeof (CommArray_s), compare_A); |
292 | } |
286 | } |
293 | |
287 | |
294 | #ifndef tolower |
|
|
295 | # define tolower(C) (((C) >= 'A' && (C) <= 'Z')? (C) - 'A' + 'a': (C)) |
|
|
296 | #endif |
|
|
297 | |
|
|
298 | |
|
|
299 | CommFunc |
|
|
300 | find_oldsocket_command (char *cmd) |
|
|
301 | { |
|
|
302 | CommArray_s *asp, dummy; |
|
|
303 | char *cp; |
|
|
304 | |
|
|
305 | for (cp = cmd; *cp; cp++) |
|
|
306 | { |
|
|
307 | *cp = tolower (*cp); |
|
|
308 | } |
|
|
309 | |
|
|
310 | dummy.name = cmd; |
|
|
311 | asp = (CommArray_s *) bsearch ((void *) &dummy, (void *) Socket_Commands, Socket_CommandsSize, sizeof (CommArray_s), compare_A); |
|
|
312 | if (asp) |
|
|
313 | return asp->func; |
|
|
314 | return NULL; |
|
|
315 | } |
|
|
316 | |
|
|
317 | CommFunc |
|
|
318 | find_oldsocket_command2 (char *cmd) |
|
|
319 | { |
|
|
320 | CommArray_s *asp, dummy; |
|
|
321 | char *cp; |
|
|
322 | |
|
|
323 | for (cp = cmd; *cp; cp++) |
|
|
324 | { |
|
|
325 | *cp = tolower (*cp); |
|
|
326 | } |
|
|
327 | |
|
|
328 | dummy.name = cmd; |
|
|
329 | asp = (CommArray_s *) bsearch ((void *) &dummy, (void *) Socket2_Commands, Socket2_CommandsSize, sizeof (CommArray_s), compare_A); |
|
|
330 | if (asp) |
|
|
331 | return asp->func; |
|
|
332 | return NULL; |
|
|
333 | } |
|
|