1 | /* |
1 | /* |
2 | * static char *rcsid_commands_c = |
2 | * static char *rcsid_commands_c = |
3 | * "$Id: commands.C,v 1.4 2006/08/29 05:03:55 root Exp $"; |
3 | * "$Id: commands.C,v 1.5 2006/08/29 08:01:37 root Exp $"; |
4 | */ |
4 | */ |
5 | |
5 | |
6 | /* |
6 | /* |
7 | CrossFire, A Multiplayer game for X-windows |
7 | CrossFire, A Multiplayer game for X-windows |
8 | |
8 | |
… | |
… | |
114 | {"wimpy", command_wimpy, 0.0}, |
114 | {"wimpy", command_wimpy, 0.0}, |
115 | {"who", command_who, 0.0}, |
115 | {"who", command_who, 0.0}, |
116 | {"afk", command_afk, 0.0}, |
116 | {"afk", command_afk, 0.0}, |
117 | |
117 | |
118 | {"stay", command_stay, 1.0}, /* 1.0 because it is used when using a |
118 | {"stay", command_stay, 1.0}, /* 1.0 because it is used when using a |
119 | * skill on yourself */ |
119 | * skill on yourself */ |
120 | {"north", command_north, 1.0}, |
120 | {"north", command_north, 1.0}, |
121 | {"east", command_east, 1.0}, |
121 | {"east", command_east, 1.0}, |
122 | {"south", command_south, 1.0}, |
122 | {"south", command_south, 1.0}, |
123 | {"west", command_west, 1.0}, |
123 | {"west", command_west, 1.0}, |
124 | {"northeast", command_northeast, 1.0}, |
124 | {"northeast", command_northeast, 1.0}, |
… | |
… | |
318 | *cp =tolower(*cp); |
318 | *cp =tolower(*cp); |
319 | } |
319 | } |
320 | |
320 | |
321 | dummy.name =cmd; |
321 | dummy.name =cmd; |
322 | asp =(CommArray_s *)bsearch((void *)&dummy, |
322 | asp =(CommArray_s *)bsearch((void *)&dummy, |
323 | (void *)Socket_Commands, Socket_CommandsSize, |
323 | (void *)Socket_Commands, Socket_CommandsSize, |
324 | sizeof(CommArray_s), compare_A); |
324 | sizeof(CommArray_s), compare_A); |
325 | if (asp) |
325 | if (asp) |
326 | return asp->func; |
326 | return asp->func; |
327 | return NULL; |
327 | return NULL; |
328 | } |
328 | } |
329 | |
329 | |
… | |
… | |
336 | *cp =tolower(*cp); |
336 | *cp =tolower(*cp); |
337 | } |
337 | } |
338 | |
338 | |
339 | dummy.name =cmd; |
339 | dummy.name =cmd; |
340 | asp =(CommArray_s *)bsearch((void *)&dummy, |
340 | asp =(CommArray_s *)bsearch((void *)&dummy, |
341 | (void *)Socket2_Commands, Socket2_CommandsSize, |
341 | (void *)Socket2_Commands, Socket2_CommandsSize, |
342 | sizeof(CommArray_s), compare_A); |
342 | sizeof(CommArray_s), compare_A); |
343 | if (asp) |
343 | if (asp) |
344 | return asp->func; |
344 | return asp->func; |
345 | return NULL; |
345 | return NULL; |
346 | } |
346 | } |