1 | /* |
1 | /* |
2 | * static char *rcsid_commands_c = |
2 | * static char *rcsid_commands_c = |
3 | * "$Id: commands.C,v 1.2 2006/08/24 13:13:49 root Exp $"; |
3 | * "$Id: commands.C,v 1.6 2006/08/31 17:54:15 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 | |
… | |
… | |
58 | {"apply", command_apply, 1.0}, /* should be variable */ |
58 | {"apply", command_apply, 1.0}, /* should be variable */ |
59 | {"applymode", command_applymode, 1.0}, /* should be variable */ |
59 | {"applymode", command_applymode, 1.0}, /* should be variable */ |
60 | {"archs", command_archs, 0.0}, |
60 | {"archs", command_archs, 0.0}, |
61 | {"body", command_body, 0.0}, |
61 | {"body", command_body, 0.0}, |
62 | {"brace", command_brace, 0.0}, |
62 | {"brace", command_brace, 0.0}, |
63 | {"build", command_build, 0.0}, |
|
|
64 | {"cast", command_cast, 0.2}, /* Is this right? */ |
63 | {"cast", command_cast, 0.2}, /* Is this right? */ |
65 | {"disarm", command_disarm, 1.0}, |
64 | {"disarm", command_disarm, 1.0}, |
66 | {"dm", command_dm, 0.0}, |
65 | {"dm", command_dm, 0.0}, |
67 | {"dmhide", command_dmhide, 0.0}, /* Like dm, but don't tell a dm arrived, hide player */ |
66 | {"dmhide", command_dmhide, 0.0}, /* Like dm, but don't tell a dm arrived, hide player */ |
68 | {"drop", command_drop, 1.0}, |
67 | {"drop", command_drop, 1.0}, |
… | |
… | |
115 | {"wimpy", command_wimpy, 0.0}, |
114 | {"wimpy", command_wimpy, 0.0}, |
116 | {"who", command_who, 0.0}, |
115 | {"who", command_who, 0.0}, |
117 | {"afk", command_afk, 0.0}, |
116 | {"afk", command_afk, 0.0}, |
118 | |
117 | |
119 | {"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 |
120 | * skill on yourself */ |
119 | * skill on yourself */ |
121 | {"north", command_north, 1.0}, |
120 | {"north", command_north, 1.0}, |
122 | {"east", command_east, 1.0}, |
121 | {"east", command_east, 1.0}, |
123 | {"south", command_south, 1.0}, |
122 | {"south", command_south, 1.0}, |
124 | {"west", command_west, 1.0}, |
123 | {"west", command_west, 1.0}, |
125 | {"northeast", command_northeast, 1.0}, |
124 | {"northeast", command_northeast, 1.0}, |
… | |
… | |
130 | |
129 | |
131 | const int CommandsSize =sizeof(Commands) / sizeof(CommArray_s); |
130 | const int CommandsSize =sizeof(Commands) / sizeof(CommArray_s); |
132 | |
131 | |
133 | CommArray_s CommunicationCommands [] = { |
132 | CommArray_s CommunicationCommands [] = { |
134 | /* begin emotions */ |
133 | /* begin emotions */ |
135 | {"tell", command_tell, 0.1}, |
|
|
136 | {"reply", command_reply, 0.0}, |
|
|
137 | {"say", command_say, 0.1}, |
|
|
138 | {"shout", command_shout, 0.1}, |
|
|
139 | {"chat", command_chat, 0.1}, |
|
|
140 | {"me", command_me, 0.1}, |
134 | {"me", command_me, 0.1}, |
141 | {"nod", command_nod, 0.0}, |
135 | {"nod", command_nod, 0.0}, |
142 | {"dance", command_dance, 0.0}, |
136 | {"dance", command_dance, 0.0}, |
143 | {"kiss", command_kiss, 0.0}, |
137 | {"kiss", command_kiss, 0.0}, |
144 | {"bounce", command_bounce, 0.0}, |
138 | {"bounce", command_bounce, 0.0}, |
… | |
… | |
216 | {"addexp", command_addexp,0.0}, |
210 | {"addexp", command_addexp,0.0}, |
217 | {"arrest", command_arrest,0.0}, |
211 | {"arrest", command_arrest,0.0}, |
218 | {"banish", command_banish,0.0}, |
212 | {"banish", command_banish,0.0}, |
219 | {"create", command_create,0.0}, |
213 | {"create", command_create,0.0}, |
220 | {"debug", command_debug,0.0}, |
214 | {"debug", command_debug,0.0}, |
221 | {"diff", command_diff, 0.0 }, |
|
|
222 | {"dump", command_dump,0.0}, |
215 | {"dump", command_dump,0.0}, |
223 | {"dumpbelow", command_dumpbelow,0.0}, |
216 | {"dumpbelow", command_dumpbelow,0.0}, |
224 | {"dumpfriendlyobjects", command_dumpfriendlyobjects,0.0}, |
217 | {"dumpfriendlyobjects", command_dumpfriendlyobjects,0.0}, |
225 | {"dumpallarchetypes", command_dumpallarchetypes,0.0}, |
218 | {"dumpallarchetypes", command_dumpallarchetypes,0.0}, |
226 | {"dumpallmaps", command_dumpallmaps,0.0}, |
219 | {"dumpallmaps", command_dumpallmaps,0.0}, |
… | |
… | |
258 | {"stack_push", command_stack_push, 0.0 }, |
251 | {"stack_push", command_stack_push, 0.0 }, |
259 | {"stats", command_stats,0.0}, |
252 | {"stats", command_stats,0.0}, |
260 | {"style_info", command_style_map_info, 0.0}, /* Costly command, so make it wiz only */ |
253 | {"style_info", command_style_map_info, 0.0}, /* Costly command, so make it wiz only */ |
261 | {"summon", command_summon,0.0}, |
254 | {"summon", command_summon,0.0}, |
262 | {"teleport", command_teleport,0.0}, |
255 | {"teleport", command_teleport,0.0}, |
263 | {"toggle_shout", command_toggle_shout,0.0}, |
|
|
264 | {"wizpass", command_wizpass,0.0}, |
256 | {"wizpass", command_wizpass,0.0}, |
265 | {"wizcast", command_wizcast,0.0}, |
257 | {"wizcast", command_wizcast,0.0}, |
266 | {"overlay_save", command_save_overlay, 0.0}, |
258 | {"overlay_save", command_save_overlay, 0.0}, |
267 | /* {"possess", command_possess, 0.0}, */ |
259 | /* {"possess", command_possess, 0.0}, */ |
268 | {"mon_aggr", command_mon_aggr, 0.0}, |
260 | {"mon_aggr", command_mon_aggr, 0.0}, |
… | |
… | |
288 | |
280 | |
289 | /* Socket commands - these should really do nothing more than output things |
281 | /* Socket commands - these should really do nothing more than output things |
290 | * to the various players/sockets. |
282 | * to the various players/sockets. |
291 | */ |
283 | */ |
292 | CommArray_s Socket2_Commands[] = { |
284 | CommArray_s Socket2_Commands[] = { |
293 | {"shout", command_shout, 0.1}, |
|
|
294 | {"chat", command_chat, 0.1}, |
|
|
295 | {"tell", command_tell, 0.1}, |
|
|
296 | }; |
285 | }; |
297 | |
286 | |
298 | const int Socket2_CommandsSize =sizeof(Socket2_Commands) / sizeof(CommArray_s); |
287 | const int Socket2_CommandsSize =sizeof(Socket2_Commands) / sizeof(CommArray_s); |
299 | |
288 | |
300 | |
289 | |
… | |
… | |
328 | *cp =tolower(*cp); |
317 | *cp =tolower(*cp); |
329 | } |
318 | } |
330 | |
319 | |
331 | dummy.name =cmd; |
320 | dummy.name =cmd; |
332 | asp =(CommArray_s *)bsearch((void *)&dummy, |
321 | asp =(CommArray_s *)bsearch((void *)&dummy, |
333 | (void *)Socket_Commands, Socket_CommandsSize, |
322 | (void *)Socket_Commands, Socket_CommandsSize, |
334 | sizeof(CommArray_s), compare_A); |
323 | sizeof(CommArray_s), compare_A); |
335 | if (asp) |
324 | if (asp) |
336 | return asp->func; |
325 | return asp->func; |
337 | return NULL; |
326 | return NULL; |
338 | } |
327 | } |
339 | |
328 | |
… | |
… | |
346 | *cp =tolower(*cp); |
335 | *cp =tolower(*cp); |
347 | } |
336 | } |
348 | |
337 | |
349 | dummy.name =cmd; |
338 | dummy.name =cmd; |
350 | asp =(CommArray_s *)bsearch((void *)&dummy, |
339 | asp =(CommArray_s *)bsearch((void *)&dummy, |
351 | (void *)Socket2_Commands, Socket2_CommandsSize, |
340 | (void *)Socket2_Commands, Socket2_CommandsSize, |
352 | sizeof(CommArray_s), compare_A); |
341 | sizeof(CommArray_s), compare_A); |
353 | if (asp) |
342 | if (asp) |
354 | return asp->func; |
343 | return asp->func; |
355 | return NULL; |
344 | return NULL; |
356 | } |
345 | } |