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.1 by elmex, Sun Aug 13 17:16:04 2006 UTC vs.
Revision 1.8 by root, Mon Sep 4 11:08:00 2006 UTC

1/* 1/*
2 * static char *rcsid_commands_c = 2 * static char *rcsid_commands_c =
3 * "$Id: commands.C,v 1.1 2006/08/13 17:16:04 elmex Exp $"; 3 * "$Id: commands.C,v 1.8 2006/09/04 11:08:00 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
50 50
51 {"sound", command_sound, 0.0}, 51 {"sound", command_sound, 0.0},
52 {"party", command_party, 0.0}, 52 {"party", command_party, 0.0},
53 {"gsay", command_gsay, 1.0}, 53 {"gsay", command_gsay, 1.0},
54 54
55#ifdef DEBUG
56 {"sstable", command_sstable, 0.0},
57#endif
58 {"apply", command_apply, 1.0}, /* should be variable */ 55 {"apply", command_apply, 1.0}, /* should be variable */
59 {"applymode", command_applymode, 1.0}, /* should be variable */ 56 {"applymode", command_applymode, 1.0}, /* should be variable */
60 {"archs", command_archs, 0.0}, 57 {"archs", command_archs, 0.0},
61 {"body", command_body, 0.0}, 58 {"body", command_body, 0.0},
62 {"brace", command_brace, 0.0}, 59 {"brace", command_brace, 0.0},
63 {"build", command_build, 0.0},
64 {"cast", command_cast, 0.2}, /* Is this right? */ 60 {"cast", command_cast, 0.2}, /* Is this right? */
65 {"disarm", command_disarm, 1.0}, 61 {"disarm", command_disarm, 1.0},
66 {"dm", command_dm, 0.0}, 62 {"dm", command_dm, 0.0},
67 {"dmhide", command_dmhide, 0.0}, /* Like dm, but don't tell a dm arrived, hide player */ 63 {"dmhide", command_dmhide, 0.0}, /* Like dm, but don't tell a dm arrived, hide player */
68 {"drop", command_drop, 1.0}, 64 {"drop", command_drop, 1.0},
92 {"rename", command_rename_item, 0.0}, 88 {"rename", command_rename_item, 0.0},
93 {"resistances", command_resistances, 0.0}, 89 {"resistances", command_resistances, 0.0},
94 {"rotateshoottype", command_rotateshoottype, 0.0}, 90 {"rotateshoottype", command_rotateshoottype, 0.0},
95 {"skills", command_skills, 0.0}, /* shows player list of skills */ 91 {"skills", command_skills, 0.0}, /* shows player list of skills */
96 {"use_skill", command_uskill, 1.0}, 92 {"use_skill", command_uskill, 1.0},
97 {"quests", command_quests, 0.0},
98 {"ready_skill", command_rskill, 1.0}, 93 {"ready_skill", command_rskill, 1.0},
99 {"search",command_search, 1.0}, 94 {"search",command_search, 1.0},
100 {"search-items", command_search_items, 0.0}, 95 {"search-items", command_search_items, 0.0},
101 {"showpets", command_showpets, 1.0}, 96 {"showpets", command_showpets, 1.0},
102 {"statistics", command_statistics, 0.0}, 97 {"statistics", command_statistics, 0.0},
103 {"strings", command_strings, 0.0},
104 {"take", command_take, 1.0}, 98 {"take", command_take, 1.0},
105 {"throw", command_throw, 1.0}, 99 {"throw", command_throw, 1.0},
106 {"time", command_time, 0.0}, 100 {"time", command_time, 0.0},
107 {"weather", command_weather, 0.0}, 101 {"weather", command_weather, 0.0},
108 {"whereabouts", command_whereabouts, 0.0}, 102 {"whereabouts", command_whereabouts, 0.0},
115 {"wimpy", command_wimpy, 0.0}, 109 {"wimpy", command_wimpy, 0.0},
116 {"who", command_who, 0.0}, 110 {"who", command_who, 0.0},
117 {"afk", command_afk, 0.0}, 111 {"afk", command_afk, 0.0},
118 112
119 {"stay", command_stay, 1.0}, /* 1.0 because it is used when using a 113 {"stay", command_stay, 1.0}, /* 1.0 because it is used when using a
120 * skill on yourself */ 114 * skill on yourself */
121 {"north", command_north, 1.0}, 115 {"north", command_north, 1.0},
122 {"east", command_east, 1.0}, 116 {"east", command_east, 1.0},
123 {"south", command_south, 1.0}, 117 {"south", command_south, 1.0},
124 {"west", command_west, 1.0}, 118 {"west", command_west, 1.0},
125 {"northeast", command_northeast, 1.0}, 119 {"northeast", command_northeast, 1.0},
130 124
131const int CommandsSize =sizeof(Commands) / sizeof(CommArray_s); 125const int CommandsSize =sizeof(Commands) / sizeof(CommArray_s);
132 126
133CommArray_s CommunicationCommands [] = { 127CommArray_s CommunicationCommands [] = {
134 /* begin emotions */ 128 /* 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}, 129 {"me", command_me, 0.1},
141 {"nod", command_nod, 0.0}, 130 {"nod", command_nod, 0.0},
142 {"dance", command_dance, 0.0}, 131 {"dance", command_dance, 0.0},
143 {"kiss", command_kiss, 0.0}, 132 {"kiss", command_kiss, 0.0},
144 {"bounce", command_bounce, 0.0}, 133 {"bounce", command_bounce, 0.0},
216 {"addexp", command_addexp,0.0}, 205 {"addexp", command_addexp,0.0},
217 {"arrest", command_arrest,0.0}, 206 {"arrest", command_arrest,0.0},
218 {"banish", command_banish,0.0}, 207 {"banish", command_banish,0.0},
219 {"create", command_create,0.0}, 208 {"create", command_create,0.0},
220 {"debug", command_debug,0.0}, 209 {"debug", command_debug,0.0},
221 {"diff", command_diff, 0.0 },
222 {"dump", command_dump,0.0}, 210 {"dump", command_dump,0.0},
223 {"dumpbelow", command_dumpbelow,0.0}, 211 {"dumpbelow", command_dumpbelow,0.0},
224 {"dumpfriendlyobjects", command_dumpfriendlyobjects,0.0}, 212 {"dumpfriendlyobjects", command_dumpfriendlyobjects,0.0},
225 {"dumpallarchetypes", command_dumpallarchetypes,0.0}, 213 {"dumpallarchetypes", command_dumpallarchetypes,0.0},
226 {"dumpallmaps", command_dumpallmaps,0.0}, 214 {"dumpallmaps", command_dumpallmaps,0.0},
237 {"learn_special_prayer", command_learn_special_prayer, 0.0}, 225 {"learn_special_prayer", command_learn_special_prayer, 0.0},
238 {"learn_spell", command_learn_spell, 0.0}, 226 {"learn_spell", command_learn_spell, 0.0},
239#ifdef DEBUG_MALLOC_LEVEL 227#ifdef DEBUG_MALLOC_LEVEL
240 {"verify", command_malloc_verify,0.0}, 228 {"verify", command_malloc_verify,0.0},
241#endif 229#endif
242 {"malloc", command_malloc,0.0},
243 {"players", command_players, 0.0}, 230 {"players", command_players, 0.0},
244 {"plugin",command_loadplugin,0.0}, 231 {"plugin",command_loadplugin,0.0},
245 {"pluglist",command_listplugins,0.0}, 232 {"pluglist",command_listplugins,0.0},
246 {"plugout",command_unloadplugin,0.0}, 233 {"plugout",command_unloadplugin,0.0},
247 {"nodm", command_nowiz,0.0}, 234 {"nodm", command_nowiz,0.0},
248 {"nowiz", command_nowiz,0.0}, 235 {"nowiz", command_nowiz,0.0},
249 {"patch", command_patch,0.0}, 236 {"patch", command_patch,0.0},
250 {"remove", command_remove,0.0}, 237 {"remove", command_remove,0.0},
251 {"reset", command_reset,0.0}, 238 {"reset", command_reset,0.0},
252 {"set_god", command_setgod, 0.0}, 239 {"set_god", command_setgod, 0.0},
253 {"server_speed", command_speed,0.0},
254 {"shutdown", command_shutdown, 0.0}, 240 {"shutdown", command_shutdown, 0.0},
255 {"ssdumptable", command_ssdumptable,0.0},
256 {"stack_clear", command_stack_clear, 0.0 }, 241 {"stack_clear", command_stack_clear, 0.0 },
257 {"stack_list", command_stack_list, 0.0}, 242 {"stack_list", command_stack_list, 0.0},
258 {"stack_pop", command_stack_pop, 0.0 }, 243 {"stack_pop", command_stack_pop, 0.0 },
259 {"stack_push", command_stack_push, 0.0 }, 244 {"stack_push", command_stack_push, 0.0 },
260 {"stats", command_stats,0.0}, 245 {"stats", command_stats,0.0},
261 {"style_info", command_style_map_info, 0.0}, /* Costly command, so make it wiz only */ 246 {"style_info", command_style_map_info, 0.0}, /* Costly command, so make it wiz only */
262 {"summon", command_summon,0.0}, 247 {"summon", command_summon,0.0},
263 {"teleport", command_teleport,0.0}, 248 {"teleport", command_teleport,0.0},
264 {"toggle_shout", command_toggle_shout,0.0},
265 {"wizpass", command_wizpass,0.0}, 249 {"wizpass", command_wizpass,0.0},
266 {"wizcast", command_wizcast,0.0}, 250 {"wizcast", command_wizcast,0.0},
267 {"overlay_save", command_save_overlay, 0.0}, 251 {"overlay_save", command_save_overlay, 0.0},
268/* {"possess", command_possess, 0.0}, */ 252/* {"possess", command_possess, 0.0}, */
269 {"mon_aggr", command_mon_aggr, 0.0}, 253 {"mon_aggr", command_mon_aggr, 0.0},
289 273
290/* Socket commands - these should really do nothing more than output things 274/* Socket commands - these should really do nothing more than output things
291 * to the various players/sockets. 275 * to the various players/sockets.
292 */ 276 */
293CommArray_s Socket2_Commands[] = { 277CommArray_s Socket2_Commands[] = {
294 {"shout", command_shout, 0.1},
295 {"chat", command_chat, 0.1},
296 {"tell", command_tell, 0.1},
297}; 278};
298 279
299const int Socket2_CommandsSize =sizeof(Socket2_Commands) / sizeof(CommArray_s); 280const int Socket2_CommandsSize =sizeof(Socket2_Commands) / sizeof(CommArray_s);
300 281
301 282
329 *cp =tolower(*cp); 310 *cp =tolower(*cp);
330 } 311 }
331 312
332 dummy.name =cmd; 313 dummy.name =cmd;
333 asp =(CommArray_s *)bsearch((void *)&dummy, 314 asp =(CommArray_s *)bsearch((void *)&dummy,
334 (void *)Socket_Commands, Socket_CommandsSize, 315 (void *)Socket_Commands, Socket_CommandsSize,
335 sizeof(CommArray_s), compare_A); 316 sizeof(CommArray_s), compare_A);
336 if (asp) 317 if (asp)
337 return asp->func; 318 return asp->func;
338 return NULL; 319 return NULL;
339} 320}
340 321
347 *cp =tolower(*cp); 328 *cp =tolower(*cp);
348 } 329 }
349 330
350 dummy.name =cmd; 331 dummy.name =cmd;
351 asp =(CommArray_s *)bsearch((void *)&dummy, 332 asp =(CommArray_s *)bsearch((void *)&dummy,
352 (void *)Socket2_Commands, Socket2_CommandsSize, 333 (void *)Socket2_Commands, Socket2_CommandsSize,
353 sizeof(CommArray_s), compare_A); 334 sizeof(CommArray_s), compare_A);
354 if (asp) 335 if (asp)
355 return asp->func; 336 return asp->func;
356 return NULL; 337 return NULL;
357} 338}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines