ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/commands.C
(Generate patch)

Comparing deliantra/server/server/commands.C (file contents):
Revision 1.15 by root, Mon Oct 2 00:22:01 2006 UTC vs.
Revision 1.17 by root, Mon Dec 11 02:54:57 2006 UTC

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 {"hide", command_hide, 0.0}, 211 {"hide", command_hide, 0.0},
285 qsort (WizCommands, WizCommandsSize, sizeof (CommArray_s), compare_A); 283 qsort (WizCommands, WizCommandsSize, sizeof (CommArray_s), compare_A);
286 qsort (Socket_Commands, Socket_CommandsSize, sizeof (CommArray_s), compare_A); 284 qsort (Socket_Commands, Socket_CommandsSize, sizeof (CommArray_s), compare_A);
287 qsort (Socket2_Commands, Socket2_CommandsSize, sizeof (CommArray_s), compare_A); 285 qsort (Socket2_Commands, Socket2_CommandsSize, sizeof (CommArray_s), compare_A);
288} 286}
289 287
290#ifndef tolower
291# define tolower(C) (((C) >= 'A' && (C) <= 'Z')? (C) - 'A' + 'a': (C))
292#endif
293
294
295CommFunc
296find_oldsocket_command (char *cmd)
297{
298 CommArray_s *asp, dummy;
299 char *cp;
300
301 for (cp = cmd; *cp; cp++)
302 {
303 *cp = tolower (*cp);
304 }
305
306 dummy.name = cmd;
307 asp = (CommArray_s *) bsearch ((void *) &dummy, (void *) Socket_Commands, Socket_CommandsSize, sizeof (CommArray_s), compare_A);
308 if (asp)
309 return asp->func;
310 return NULL;
311}
312
313CommFunc
314find_oldsocket_command2 (char *cmd)
315{
316 CommArray_s *asp, dummy;
317 char *cp;
318
319 for (cp = cmd; *cp; cp++)
320 {
321 *cp = tolower (*cp);
322 }
323
324 dummy.name = cmd;
325 asp = (CommArray_s *) bsearch ((void *) &dummy, (void *) Socket2_Commands, Socket2_CommandsSize, sizeof (CommArray_s), compare_A);
326 if (asp)
327 return asp->func;
328 return NULL;
329}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines