OregonCore  revision 71a6c59-git
Your Favourite TBC server
Chat.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of the OregonCore Project. See AUTHORS file for Copyright information
3  *
4  * This program is free software; you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License as published by the
6  * Free Software Foundation; either version 2 of the License, or (at your
7  * option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12  * more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #include "Common.h"
19 #include "ObjectMgr.h"
20 #include "World.h"
21 #include "WorldPacket.h"
22 #include "WorldSession.h"
23 #include "Database/DatabaseEnv.h"
24 
25 #include "CellImpl.h"
26 #include "Chat.h"
27 #include "GridNotifiersImpl.h"
28 #include "Language.h"
29 #include "Log.h"
30 #include "Opcodes.h"
31 #include "Player.h"
32 #include "UpdateMask.h"
33 #include "MapManager.h"
34 #include "SpellMgr.h"
35 
37 
39 {
40  static ChatCommand accountSetCommandTable[] =
41  {
42  { "addon", SEC_ADMINISTRATOR, true, &ChatHandler::HandleAccountSetAddonCommand, "", NULL },
43  { "gmlevel", SEC_CONSOLE, true, &ChatHandler::HandleAccountSetGmLevelCommand, "", NULL },
44  { "password", SEC_CONSOLE, true, &ChatHandler::HandleAccountSetPasswordCommand, "", NULL },
45  { NULL, 0, false, NULL, "", NULL }
46  };
47 
48  static ChatCommand accountCommandTable[] =
49  {
50  { "create", SEC_CONSOLE, true, &ChatHandler::HandleAccountCreateCommand, "", NULL },
51  { "delete", SEC_CONSOLE, true, &ChatHandler::HandleAccountDeleteCommand, "", NULL },
52  { "onlinelist", SEC_CONSOLE, true, &ChatHandler::HandleAccountOnlineListCommand, "", NULL },
53  { "lock", SEC_PLAYER, false, &ChatHandler::HandleAccountLockCommand, "", NULL },
54  { "set", SEC_ADMINISTRATOR, true, NULL, "", accountSetCommandTable },
55  { "password", SEC_PLAYER, false, &ChatHandler::HandleAccountPasswordCommand, "", NULL },
56  { "", SEC_PLAYER, false, &ChatHandler::HandleAccountCommand, "", NULL },
57  { NULL, 0, false, NULL, "", NULL }
58  };
59 
60  static ChatCommand serverSetCommandTable[] =
61  {
62  { "logmask", SEC_ADMINISTRATOR, true, &ChatHandler::HandleServerSetLogMaskCommand, "", NULL },
63  { "difftime", SEC_CONSOLE, true, &ChatHandler::HandleServerSetDiffTimeCommand, "", NULL },
64  { "motd", SEC_ADMINISTRATOR, true, &ChatHandler::HandleServerSetMotdCommand, "", NULL },
65  { NULL, 0, false, NULL, "", NULL }
66  };
67 
68  static ChatCommand serverIdleRestartCommandTable[] =
69  {
72  { NULL, 0, false, NULL, "", NULL }
73  };
74 
75  static ChatCommand serverIdleShutdownCommandTable[] =
76  {
79  { NULL, 0, false, NULL, "", NULL }
80  };
81 
82  static ChatCommand serverRestartCommandTable[] =
83  {
86  { NULL, 0, false, NULL, "", NULL }
87  };
88 
89  static ChatCommand serverShutdownCommandTable[] =
90  {
93  { NULL, 0, false, NULL, "", NULL }
94  };
95 
96  static ChatCommand serverCommandTable[] =
97  {
98  { "corpses", SEC_GAMEMASTER, true, &ChatHandler::HandleServerCorpsesCommand, "", NULL },
99  { "exit", SEC_CONSOLE, true, &ChatHandler::HandleServerExitCommand, "", NULL },
100  { "idlerestart", SEC_ADMINISTRATOR, true, NULL, "", serverIdleRestartCommandTable },
101  { "idleshutdown", SEC_ADMINISTRATOR, true, NULL, "", serverIdleShutdownCommandTable },
102  { "info", SEC_PLAYER, true, &ChatHandler::HandleServerInfoCommand, "", NULL },
103  { "motd", SEC_PLAYER, true, &ChatHandler::HandleServerMotdCommand, "", NULL },
104  { "plimit", SEC_ADMINISTRATOR, true, &ChatHandler::HandleServerPLimitCommand, "", NULL },
105  { "restart", SEC_ADMINISTRATOR, true, NULL, "", serverRestartCommandTable },
106  { "shutdown", SEC_ADMINISTRATOR, true, NULL, "", serverShutdownCommandTable },
107  { "set", SEC_ADMINISTRATOR, true, NULL, "", serverSetCommandTable },
108  { NULL, 0, false, NULL, "", NULL }
109  };
110 
111  static ChatCommand modifyCommandTable[] =
112  {
113  { "hp", SEC_MODERATOR, false, &ChatHandler::HandleModifyHPCommand, "", NULL },
114  { "mana", SEC_MODERATOR, false, &ChatHandler::HandleModifyManaCommand, "", NULL },
115  { "rage", SEC_MODERATOR, false, &ChatHandler::HandleModifyRageCommand, "", NULL },
116  { "energy", SEC_MODERATOR, false, &ChatHandler::HandleModifyEnergyCommand, "", NULL },
117  { "money", SEC_MODERATOR, false, &ChatHandler::HandleModifyMoneyCommand, "", NULL },
118  { "speed", SEC_MODERATOR, false, &ChatHandler::HandleModifySpeedCommand, "", NULL },
119  { "swim", SEC_MODERATOR, false, &ChatHandler::HandleModifySwimCommand, "", NULL },
120  { "scale", SEC_MODERATOR, false, &ChatHandler::HandleModifyScaleCommand, "", NULL },
121  { "bit", SEC_MODERATOR, false, &ChatHandler::HandleModifyBitCommand, "", NULL },
122  { "bwalk", SEC_MODERATOR, false, &ChatHandler::HandleModifyBWalkCommand, "", NULL },
123  { "fly", SEC_MODERATOR, false, &ChatHandler::HandleModifyFlyCommand, "", NULL },
124  { "aspeed", SEC_MODERATOR, false, &ChatHandler::HandleModifyASpeedCommand, "", NULL },
125  { "faction", SEC_MODERATOR, false, &ChatHandler::HandleModifyFactionCommand, "", NULL },
126  { "spell", SEC_MODERATOR, false, &ChatHandler::HandleModifySpellCommand, "", NULL },
127  { "tp", SEC_MODERATOR, false, &ChatHandler::HandleModifyTalentCommand, "", NULL },
128  { "mount", SEC_MODERATOR, false, &ChatHandler::HandleModifyMountCommand, "", NULL },
129  { "honor", SEC_MODERATOR, false, &ChatHandler::HandleModifyHonorCommand, "", NULL },
130  { "rep", SEC_MODERATOR, false, &ChatHandler::HandleModifyRepCommand, "", NULL },
131  { "arena", SEC_MODERATOR, false, &ChatHandler::HandleModifyArenaCommand, "", NULL },
132  { "drunk", SEC_MODERATOR, false, &ChatHandler::HandleDrunkCommand, "", NULL },
133  { "standstate", SEC_GAMEMASTER, false, &ChatHandler::HandleStandStateCommand, "", NULL },
134  { "morph", SEC_GAMEMASTER, false, &ChatHandler::HandleMorphCommand, "", NULL },
135  { "phase", SEC_GAMEMASTER, false, &ChatHandler::HandleModifyPhaseCommand, "", NULL },
136  { "gender", SEC_ADMINISTRATOR, false, &ChatHandler::HandleModifyGenderCommand, "", NULL },
137  { NULL, 0, false, NULL, "", NULL }
138  };
139 
140  static ChatCommand wpCommandTable[] =
141  {
142  { "show", SEC_GAMEMASTER, false, &ChatHandler::HandleWpShowCommand, "", NULL },
143  { "addwp", SEC_GAMEMASTER, false, &ChatHandler::HandleWpAddCommand, "", NULL },
144  { "load", SEC_GAMEMASTER, false, &ChatHandler::HandleWpLoadPathCommand, "", NULL },
145  { "modify", SEC_GAMEMASTER, false, &ChatHandler::HandleWpModifyCommand, "", NULL },
146  { "event", SEC_GAMEMASTER, false, &ChatHandler::HandleWpEventCommand, "", NULL },
147  { "unload", SEC_GAMEMASTER, false, &ChatHandler::HandleWpUnLoadPathCommand, "", NULL },
148 
149  { NULL, 0, false, NULL, "", NULL }
150  };
151 
152 
153  static ChatCommand banCommandTable[] =
154  {
155  { "account", SEC_ADMINISTRATOR, true, &ChatHandler::HandleBanAccountCommand, "", NULL },
156  { "character", SEC_ADMINISTRATOR, true, &ChatHandler::HandleBanCharacterCommand, "", NULL },
157  { "ip", SEC_ADMINISTRATOR, true, &ChatHandler::HandleBanIPCommand, "", NULL },
158  { NULL, 0, false, NULL, "", NULL }
159  };
160 
161  static ChatCommand baninfoCommandTable[] =
162  {
163  { "account", SEC_ADMINISTRATOR, true, &ChatHandler::HandleBanInfoAccountCommand, "", NULL },
164  { "character", SEC_ADMINISTRATOR, true, &ChatHandler::HandleBanInfoCharacterCommand, "", NULL },
165  { "ip", SEC_ADMINISTRATOR, true, &ChatHandler::HandleBanInfoIPCommand, "", NULL },
166  { NULL, 0, false, NULL, "", NULL }
167  };
168 
169  static ChatCommand banlistCommandTable[] =
170  {
171  { "account", SEC_ADMINISTRATOR, true, &ChatHandler::HandleBanListAccountCommand, "", NULL },
172  { "character", SEC_ADMINISTRATOR, true, &ChatHandler::HandleBanListCharacterCommand, "", NULL },
173  { "ip", SEC_ADMINISTRATOR, true, &ChatHandler::HandleBanListIPCommand, "", NULL },
174  { NULL, 0, false, NULL, "", NULL }
175  };
176 
177  static ChatCommand titlesCommandTable[] =
178  {
179  { "add", SEC_GAMEMASTER, false, &ChatHandler::HandleTitlesAddCommand, "", NULL },
180  { "current", SEC_GAMEMASTER, false, &ChatHandler::HandleTitlesCurrentCommand, "", NULL },
181  { "remove", SEC_GAMEMASTER, false, &ChatHandler::HandleTitlesRemoveCommand, "", NULL },
182  { "setmask", SEC_GAMEMASTER, false, &ChatHandler::HandleTitlesSetMaskCommand, "", NULL },
183  { NULL, 0, false, NULL, "", NULL }
184  };
185 
186  static ChatCommand unbanCommandTable[] =
187  {
188  { "account", SEC_ADMINISTRATOR, true, &ChatHandler::HandleUnBanAccountCommand, "", NULL },
189  { "character", SEC_ADMINISTRATOR, true, &ChatHandler::HandleUnBanCharacterCommand, "", NULL },
190  { "ip", SEC_ADMINISTRATOR, true, &ChatHandler::HandleUnBanIPCommand, "", NULL },
191  { NULL, 0, false, NULL, "", NULL }
192  };
193 
194  static ChatCommand characterDeletedCommandTable[] =
195  {
196  { "delete", SEC_CONSOLE, true, &ChatHandler::HandleCharacterDeletedDeleteCommand, "", NULL },
199  { "old", SEC_CONSOLE, true, &ChatHandler::HandleCharacterDeletedOldCommand, "", NULL },
200  { NULL, 0, false, NULL, "", NULL }
201  };
202 
203  static ChatCommand characterCommandTable[] =
204  {
205  { "deleted", SEC_GAMEMASTER, true, NULL, "", characterDeletedCommandTable},
206  { "erase", SEC_CONSOLE, true, &ChatHandler::HandleCharacterEraseCommand, "", NULL },
207  { "rename", SEC_GAMEMASTER, true, &ChatHandler::HandleCharacterRenameCommand, "", NULL },
208  { "titles", SEC_GAMEMASTER, true, &ChatHandler::HandleCharacterTitlesCommand, "", NULL },
209  { NULL, 0, false, NULL, "", NULL }
210  };
211 
212  static ChatCommand debugPlayCommandTable[] =
213  {
214  { "cinematic", SEC_MODERATOR, false, &ChatHandler::HandleDebugPlayCinematicCommand, "", NULL },
215  { "sound", SEC_MODERATOR, false, &ChatHandler::HandleDebugPlaySoundCommand, "", NULL },
216  { NULL, 0, false, NULL, "", NULL }
217  };
218 
219  static ChatCommand debugCommandTable[] =
220  {
221  { "inarc", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugInArcCommand, "", NULL },
222  { "spellfail", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSpellFailCommand, "", NULL },
223  { "raferror", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugRAFError, "", NULL },
224  { "setpoi", SEC_ADMINISTRATOR, false, &ChatHandler::HandleSetPoiCommand, "", NULL },
225  { "qpartymsg", SEC_ADMINISTRATOR, false, &ChatHandler::HandleSendQuestPartyMsgCommand, "", NULL },
226  { "qinvalidmsg", SEC_ADMINISTRATOR, false, &ChatHandler::HandleSendQuestInvalidMsgCommand, "", NULL },
227  { "equiperr", SEC_ADMINISTRATOR, false, &ChatHandler::HandleEquipErrorCommand, "", NULL },
228  { "sellerr", SEC_ADMINISTRATOR, false, &ChatHandler::HandleSellErrorCommand, "", NULL },
229  { "buyerr", SEC_ADMINISTRATOR, false, &ChatHandler::HandleBuyErrorCommand, "", NULL },
230  { "sendopcode", SEC_ADMINISTRATOR, false, &ChatHandler::HandleSendOpcodeCommand, "", NULL },
233  { "scm", SEC_ADMINISTRATOR, false, &ChatHandler::HandleSendChatMsgCommand, "", NULL },
234  { "getitemstate", SEC_ADMINISTRATOR, false, &ChatHandler::HandleGetItemState, "", NULL },
235  { "play", SEC_MODERATOR, false, NULL, "", debugPlayCommandTable },
236  { "update", SEC_ADMINISTRATOR, false, &ChatHandler::HandleUpdate, "", NULL },
237  { "setvalue", SEC_ADMINISTRATOR, false, &ChatHandler::HandleSetValue, "", NULL },
238  { "getvalue", SEC_ADMINISTRATOR, false, &ChatHandler::HandleGetValue, "", NULL },
239  { "Mod32Value", SEC_ADMINISTRATOR, false, &ChatHandler::HandleMod32Value, "", NULL },
240  { "anim", SEC_GAMEMASTER, false, &ChatHandler::HandleAnimCommand, "", NULL },
241  { "lootrecipient", SEC_GAMEMASTER, false, &ChatHandler::HandleGetLootRecipient, "", NULL },
242  { "arena", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugArenaCommand, "", NULL },
244  { "threatlist", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugThreatList, "", NULL },
245  { "setinstdata", SEC_ADMINISTRATOR, false, &ChatHandler::HandleSetInstanceDataCommand, "", NULL },
246  { "getinstdata", SEC_ADMINISTRATOR, false, &ChatHandler::HandleGetInstanceDataCommand, "", NULL },
247  { "spellcrashtest", SEC_ADMINISTRATOR, false, &ChatHandler::HandleSpellCrashTestCommand, "", NULL },
248  { "partyresult", SEC_ADMINISTRATOR, false, &ChatHandler::HandlePartyResultCommand, "", NULL },
249  { "animate", SEC_GAMEMASTER, false, &ChatHandler::HandleDebugAnimationCommand, "", NULL },
250  { NULL, 0, false, NULL, "", NULL }
251  };
252 
253  static ChatCommand eventCommandTable[] =
254  {
255  { "activelist", SEC_GAMEMASTER, true, &ChatHandler::HandleEventActiveListCommand, "", NULL },
256  { "start", SEC_GAMEMASTER, true, &ChatHandler::HandleEventStartCommand, "", NULL },
257  { "stop", SEC_GAMEMASTER, true, &ChatHandler::HandleEventStopCommand, "", NULL },
258  { "", SEC_GAMEMASTER, true, &ChatHandler::HandleEventInfoCommand, "", NULL },
259  { NULL, 0, false, NULL, "", NULL }
260  };
261 
262  static ChatCommand learnCommandTable[] =
263  {
264  { "all", SEC_ADMINISTRATOR, false, &ChatHandler::HandleLearnAllCommand, "", NULL },
265  { "all_gm", SEC_GAMEMASTER, false, &ChatHandler::HandleLearnAllGMCommand, "", NULL },
266  { "all_crafts", SEC_GAMEMASTER, false, &ChatHandler::HandleLearnAllCraftsCommand, "", NULL },
267  { "all_default", SEC_MODERATOR, false, &ChatHandler::HandleLearnAllDefaultCommand, "", NULL },
268  { "all_lang", SEC_MODERATOR, false, &ChatHandler::HandleLearnAllLangCommand, "", NULL },
269  { "all_myclass", SEC_ADMINISTRATOR, false, &ChatHandler::HandleLearnAllMyClassCommand, "", NULL },
270  { "all_myspells", SEC_ADMINISTRATOR, false, &ChatHandler::HandleLearnAllMySpellsCommand, "", NULL },
271  { "all_mytalents", SEC_ADMINISTRATOR, false, &ChatHandler::HandleLearnAllMyTalentsCommand, "", NULL },
272  { "all_recipes", SEC_GAMEMASTER, false, &ChatHandler::HandleLearnAllRecipesCommand, "", NULL },
273  { "", SEC_ADMINISTRATOR, false, &ChatHandler::HandleLearnCommand, "", NULL },
274  { NULL, 0, false, NULL, "", NULL }
275  };
276 
277  static ChatCommand reloadCommandTable[] =
278  {
279  { "all", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadAllCommand, "", NULL },
280  { "all_loot", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadAllLootCommand, "", NULL },
281  { "all_npc", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadAllNpcCommand, "", NULL },
282  { "all_quest", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadAllQuestCommand, "", NULL },
283  { "all_scripts", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadAllScriptsCommand, "", NULL },
284  { "all_spell", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadAllSpellCommand, "", NULL },
285  { "all_item", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadAllItemCommand, "", NULL },
286  { "all_locales", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadAllLocalesCommand, "", NULL },
287 
288  { "config", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadConfigCommand, "", NULL },
289 
290  { "areatrigger_tavern", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadAreaTriggerTavernCommand, "", NULL },
291  { "areatrigger_teleport", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadAreaTriggerTeleportCommand, "", NULL },
292  { "access_requirement", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadAccessRequirementCommand, "", NULL },
293  { "areatrigger_involvedrelation", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadQuestAreaTriggersCommand, "", NULL },
294  { "autobroadcast", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadAutobroadcastCommand, "", NULL },
295  { "event_scripts", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadEventScriptsCommand, "", NULL },
296  { "command", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadCommandCommand, "", NULL },
297  { "conditions", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadConditions, "", NULL },
298  { "creature_ai_scripts", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadEventAIScriptsCommand, "", NULL },
299  { "creature_ai_summons", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadEventAISummonsCommand, "", NULL },
300  { "creature_ai_texts", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadEventAITextsCommand, "", NULL },
301  { "creature_questender", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadCreatureQuestEnderCommand, "", NULL },
302  { "creature_linked_respawn", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadCreatureLinkedRespawnCommand, "", NULL },
303  { "creature_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesCreatureCommand, "", NULL },
304  { "creature_queststarter", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadCreatureQuestStarterCommand, "", NULL },
305  //{ "db_script_string", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadDbScriptStringCommand, "", NULL },
306  { "disables", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadDisablesCommand, "", NULL },
307  { "disenchant_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesDisenchantCommand, "", NULL },
308  { "fishing_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesFishingCommand, "", NULL },
309  { "graveyard_zone", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadGameGraveyardZoneCommand, "", NULL },
310  { "game_tele", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadGameTeleCommand, "", NULL },
311  { "gameobject_questender", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadGOQuestEnderCommand, "", NULL },
312  { "gameobject_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesGameobjectCommand, "", NULL },
313  { "gameobject_queststarter", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadGOQuestStarterCommand, "", NULL },
314  { "gameobject_scripts", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadGameObjectScriptsCommand, "", NULL },
315  { "gossip_menu", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadGossipMenuCommand, "", NULL },
316  { "gossip_menu_option", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadGossipMenuOptionCommand, "", NULL },
317  { "item_enchantment_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadItemEnchantementsCommand, "", NULL },
318  { "item_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesItemCommand, "", NULL },
319  { "mail_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesMailCommand, "", NULL },
320  { "oregon_string", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadOregonStringCommand, "", NULL },
321  { "npc_gossip", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadNpcGossipCommand, "", NULL },
322  { "npc_trainer", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadNpcTrainerCommand, "", NULL },
323  { "npc_vendor", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadNpcVendorCommand, "", NULL },
324  { "page_text", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadPageTextsCommand, "", NULL },
325  { "pickpocketing_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesPickpocketingCommand, "", NULL},
326  { "prospecting_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesProspectingCommand, "", NULL },
327  { "quest_end_scripts", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadQuestEndScriptsCommand, "", NULL },
328  { "quest_start_scripts", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadQuestStartScriptsCommand, "", NULL },
329  { "quest_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadQuestTemplateCommand, "", NULL },
330  { "reference_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesReferenceCommand, "", NULL },
331  { "reserved_name", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadReservedNameCommand, "", NULL },
332  { "reputation_spillover_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadReputationSpilloverTemplateCommand, "", NULL },
333  { "skill_discovery_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSkillDiscoveryTemplateCommand, "", NULL },
334  { "skill_extra_item_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSkillExtraItemTemplateCommand, "", NULL },
335  { "skill_fishing_base_level", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSkillFishingBaseLevelCommand, "", NULL },
336  { "skinning_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesSkinningCommand, "", NULL },
337  { "spell_affect", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellAffectCommand, "", NULL },
338  { "spell_required", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellRequiredCommand, "", NULL },
339  { "spell_groups", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellGroupsCommand, "", NULL },
340  { "spell_group_stack_rules", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellGroupStackRulesCommand, "", NULL },
341  { "spell_learn_spell", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellLearnSpellCommand, "", NULL },
342  { "spell_linked_spell", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellLinkedSpellCommand, "", NULL },
343  { "spell_pet_auras", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellPetAurasCommand, "", NULL },
344  { "spell_proc_event", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellProcEventCommand, "", NULL },
345  { "spell_scripts", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellScriptsCommand, "", NULL },
346  { "spell_target_position", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellTargetPositionCommand, "", NULL },
347  { "spell_threats", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellThreatsCommand, "", NULL },
348  { "locales_creature", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesCreatureCommand, "", NULL },
349  { "locales_gameobject", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesGameobjectCommand, "", NULL },
350  { "locales_item", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesItemCommand, "", NULL },
351  { "locales_npc_text", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesNpcTextCommand, "", NULL },
352  { "locales_page_text", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesPageTextCommand, "", NULL },
353  { "locales_quest", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLocalesQuestCommand, "", NULL },
354  { "auctions", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadAuctionsCommand, "", NULL },
355  { "waypoint_scripts", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadWpScriptsCommand, "", NULL },
356  { "gm_tickets", SEC_ADMINISTRATOR, true, &ChatHandler::HandleGMTicketReloadCommand, "", NULL },
357  { "account_referred", SEC_ADMINISTRATOR, true, &ChatHandler::HandleRAFReloadCommand, "", NULL },
358 
359  { "", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadCommand, "", NULL },
360  { NULL, 0, false, NULL, "", NULL }
361  };
362 
363  static ChatCommand honorCommandTable[] =
364  {
365  { "add", SEC_GAMEMASTER, false, &ChatHandler::HandleAddHonorCommand, "", NULL },
366  { "addkill", SEC_GAMEMASTER, false, &ChatHandler::HandleHonorAddKillCommand, "", NULL },
367  { "update", SEC_GAMEMASTER, false, &ChatHandler::HandleUpdateHonorFieldsCommand, "", NULL },
368  { NULL, 0, false, NULL, "", NULL }
369  };
370 
371  static ChatCommand guildCommandTable[] =
372  {
373  { "create", SEC_GAMEMASTER, true, &ChatHandler::HandleGuildCreateCommand, "", NULL },
374  { "delete", SEC_GAMEMASTER, true, &ChatHandler::HandleGuildDeleteCommand, "", NULL },
375  { "invite", SEC_GAMEMASTER, true, &ChatHandler::HandleGuildInviteCommand, "", NULL },
376  { "uninvite", SEC_GAMEMASTER, true, &ChatHandler::HandleGuildUninviteCommand, "", NULL },
377  { "rank", SEC_GAMEMASTER, true, &ChatHandler::HandleGuildRankCommand, "", NULL },
378  { NULL, 0, false, NULL, "", NULL }
379  };
380 
381  static ChatCommand petCommandTable[] =
382  {
383  { "create", SEC_GAMEMASTER, false, &ChatHandler::HandleCreatePetCommand, "", NULL },
384  { "learn", SEC_GAMEMASTER, false, &ChatHandler::HandlePetLearnCommand, "", NULL },
385  { "unlearn", SEC_GAMEMASTER, false, &ChatHandler::HandlePetUnlearnCommand, "", NULL },
386  { "tp", SEC_GAMEMASTER, false, &ChatHandler::HandlePetTpCommand, "", NULL },
387  { NULL, 0, false, NULL, "", NULL }
388  };
389 
390 
391  static ChatCommand groupCommandTable[] =
392  {
393  { "leader", SEC_ADMINISTRATOR, false, &ChatHandler::HandleGroupLeaderCommand, "", NULL },
394  { "disband", SEC_ADMINISTRATOR, false, &ChatHandler::HandleGroupDisbandCommand, "", NULL },
395  { "remove", SEC_ADMINISTRATOR, false, &ChatHandler::HandleGroupRemoveCommand, "", NULL },
396  { "join", SEC_ADMINISTRATOR, false, &ChatHandler::HandleGroupJoinCommand, "", NULL },
397  { NULL, 0, false, NULL, "", NULL }
398  };
399 
400  static ChatCommand lookupPlayerCommandTable[] =
401  {
402  { "ip", SEC_GAMEMASTER, true, &ChatHandler::HandleLookupPlayerIpCommand, "", NULL },
403  { "account", SEC_GAMEMASTER, true, &ChatHandler::HandleLookupPlayerAccountCommand, "", NULL },
404  { "email", SEC_GAMEMASTER, true, &ChatHandler::HandleLookupPlayerEmailCommand, "", NULL },
405  { NULL, 0, false, NULL, "", NULL }
406  };
407 
408  static ChatCommand lookupCommandTable[] =
409  {
410  { "area", SEC_MODERATOR, true, &ChatHandler::HandleLookupAreaCommand, "", NULL },
411  { "creature", SEC_ADMINISTRATOR, true, &ChatHandler::HandleLookupCreatureCommand, "", NULL },
412  { "event", SEC_GAMEMASTER, true, &ChatHandler::HandleLookupEventCommand, "", NULL },
413  { "faction", SEC_ADMINISTRATOR, true, &ChatHandler::HandleLookupFactionCommand, "", NULL },
414  { "item", SEC_ADMINISTRATOR, true, &ChatHandler::HandleLookupItemCommand, "", NULL },
415  { "itemset", SEC_ADMINISTRATOR, true, &ChatHandler::HandleLookupItemSetCommand, "", NULL },
416  { "object", SEC_ADMINISTRATOR, true, &ChatHandler::HandleLookupObjectCommand, "", NULL },
417  { "quest", SEC_ADMINISTRATOR, true, &ChatHandler::HandleLookupQuestCommand, "", NULL },
418  { "player", SEC_GAMEMASTER, true, NULL, "", lookupPlayerCommandTable },
419  { "skill", SEC_ADMINISTRATOR, true, &ChatHandler::HandleLookupSkillCommand, "", NULL },
420  { "spell", SEC_ADMINISTRATOR, true, &ChatHandler::HandleLookupSpellCommand, "", NULL },
421  { "tele", SEC_MODERATOR, true, &ChatHandler::HandleLookupTeleCommand, "", NULL },
422  { "title", SEC_GAMEMASTER, true, &ChatHandler::HandleLookupTitleCommand, "", NULL },
423  { NULL, 0, false, NULL, "", NULL }
424  };
425 
426  static ChatCommand resetCommandTable[] =
427  {
428  { "honor", SEC_ADMINISTRATOR, false, &ChatHandler::HandleResetHonorCommand, "", NULL },
429  { "level", SEC_ADMINISTRATOR, false, &ChatHandler::HandleResetLevelCommand, "", NULL },
430  { "spells", SEC_ADMINISTRATOR, false, &ChatHandler::HandleResetSpellsCommand, "", NULL },
431  { "stats", SEC_ADMINISTRATOR, false, &ChatHandler::HandleResetStatsCommand, "", NULL },
432  { "talents", SEC_ADMINISTRATOR, false, &ChatHandler::HandleResetTalentsCommand, "", NULL },
433  { "all", SEC_ADMINISTRATOR, false, &ChatHandler::HandleResetAllCommand, "", NULL },
434  { NULL, 0, false, NULL, "", NULL }
435  };
436 
437  static ChatCommand castCommandTable[] =
438  {
439  { "back", SEC_ADMINISTRATOR, false, &ChatHandler::HandleCastBackCommand, "", NULL },
440  { "dist", SEC_ADMINISTRATOR, false, &ChatHandler::HandleCastDistCommand, "", NULL },
441  { "self", SEC_ADMINISTRATOR, false, &ChatHandler::HandleCastSelfCommand, "", NULL },
442  { "target", SEC_ADMINISTRATOR, false, &ChatHandler::HandleCastTargetCommand, "", NULL },
443  { "", SEC_ADMINISTRATOR, false, &ChatHandler::HandleCastCommand, "", NULL },
444  { NULL, 0, false, NULL, "", NULL }
445  };
446 
447  static ChatCommand pdumpCommandTable[] =
448  {
449  { "load", SEC_ADMINISTRATOR, true, &ChatHandler::HandleLoadPDumpCommand, "", NULL },
450  { "write", SEC_ADMINISTRATOR, true, &ChatHandler::HandleWritePDumpCommand, "", NULL },
451  { NULL, 0, false, NULL, "", NULL }
452  };
453 
454  static ChatCommand listCommandTable[] =
455  {
456  { "creature", SEC_ADMINISTRATOR, true, &ChatHandler::HandleListCreatureCommand, "", NULL },
457  { "item", SEC_ADMINISTRATOR, true, &ChatHandler::HandleListItemCommand, "", NULL },
458  { "object", SEC_ADMINISTRATOR, true, &ChatHandler::HandleListObjectCommand, "", NULL },
459  { "auras", SEC_ADMINISTRATOR, false, &ChatHandler::HandleListAurasCommand, "", NULL },
460  { NULL, 0, false, NULL, "", NULL }
461  };
462 
463  static ChatCommand teleCommandTable[] =
464  {
465  { "add", SEC_ADMINISTRATOR, false, &ChatHandler::HandleAddTeleCommand, "", NULL },
466  { "del", SEC_ADMINISTRATOR, true, &ChatHandler::HandleDelTeleCommand, "", NULL },
467  { "name", SEC_MODERATOR, true, &ChatHandler::HandleNameTeleCommand, "", NULL },
468  { "group", SEC_MODERATOR, false, &ChatHandler::HandleGroupTeleCommand, "", NULL },
469  { "", SEC_MODERATOR, false, &ChatHandler::HandleTeleCommand, "", NULL },
470  { NULL, 0, false, NULL, "", NULL }
471  };
472 
473  static ChatCommand npcCommandTable[] =
474  {
475  { "say", SEC_MODERATOR, false, &ChatHandler::HandleNpcSayCommand, "", NULL },
476  { "textemote", SEC_MODERATOR, false, &ChatHandler::HandleNpcTextEmoteCommand, "", NULL },
477  { "add", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcAddCommand, "", NULL },
478  { "delete", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcDeleteCommand, "", NULL },
479  { "spawndist", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcSpawnDistCommand, "", NULL },
480  { "spawntime", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcSpawnTimeCommand, "", NULL },
481  { "factionid", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcFactionIdCommand, "", NULL },
482  { "setmovetype", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcSetMoveTypeCommand, "", NULL },
483  { "move", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcMoveCommand, "", NULL },
484  { "changelevel", SEC_GAMEMASTER, false, &ChatHandler::HandleChangeLevelCommand, "", NULL },
485  { "setmodel", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcSetModelCommand, "", NULL },
486  { "additem", SEC_GAMEMASTER, false, &ChatHandler::HandleAddVendorItemCommand, "", NULL },
487  { "delitem", SEC_GAMEMASTER, false, &ChatHandler::HandleDelVendorItemCommand, "", NULL },
488  { "flag", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcFlagCommand, "", NULL },
489  { "changeentry", SEC_ADMINISTRATOR, false, &ChatHandler::HandleNpcChangeEntryCommand, "", NULL },
490  { "info", SEC_ADMINISTRATOR, false, &ChatHandler::HandleNpcInfoCommand, "", NULL },
491  { "playemote", SEC_ADMINISTRATOR, false, &ChatHandler::HandleNpcPlayEmoteCommand, "", NULL },
492  { "follow", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcFollowCommand, "", NULL },
493  { "setphase", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcSetPhaseCommand, "", NULL },
494  { "unfollow", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcUnFollowCommand, "", NULL },
495  { "whisper", SEC_MODERATOR, false, &ChatHandler::HandleNpcWhisperCommand, "", NULL },
496  { "yell", SEC_MODERATOR, false, &ChatHandler::HandleNpcYellCommand, "", NULL },
497  { "addtemp", SEC_GAMEMASTER, false, &ChatHandler::HandleTempAddSpwCommand, "", NULL },
498  { "setlink", SEC_MODERATOR, false, &ChatHandler::HandleNpcSetLinkCommand, "", NULL },
499 
500  //{ @todo fix or remove this commands
501  { "name", SEC_GAMEMASTER, false, &ChatHandler::HandleNameCommand, "", NULL },
502  { "subname", SEC_GAMEMASTER, false, &ChatHandler::HandleSubNameCommand, "", NULL },
503  { "addweapon", SEC_ADMINISTRATOR, false, &ChatHandler::HandleAddWeaponCommand, "", NULL },
504  //}
505 
506  { NULL, 0, false, NULL, "", NULL }
507  };
508 
509  static ChatCommand goCommandTable[] =
510  {
511  { "grid", SEC_MODERATOR, false, &ChatHandler::HandleGoGridCommand, "", NULL },
512  { "creature", SEC_GAMEMASTER, false, &ChatHandler::HandleGoCreatureCommand, "", NULL },
513  { "object", SEC_GAMEMASTER, false, &ChatHandler::HandleGoObjectCommand, "", NULL },
514  { "ticket", SEC_MODERATOR, false, &ChatHandler::HandleGoTicketCommand, "", NULL },
515  { "trigger", SEC_GAMEMASTER, false, &ChatHandler::HandleGoTriggerCommand, "", NULL },
516  { "graveyard", SEC_GAMEMASTER, false, &ChatHandler::HandleGoGraveyardCommand, "", NULL },
517  { "zonexy", SEC_MODERATOR, false, &ChatHandler::HandleGoZoneXYCommand, "", NULL },
518  { "xy", SEC_MODERATOR, false, &ChatHandler::HandleGoXYCommand, "", NULL },
519  { "xyz", SEC_MODERATOR, false, &ChatHandler::HandleGoXYZCommand, "", NULL },
520  { "", SEC_MODERATOR, false, &ChatHandler::HandleGoXYZCommand, "", NULL },
521  { NULL, 0, false, NULL, "", NULL }
522  };
523 
524  static ChatCommand gobjectCommandTable[] =
525  {
526  { "add", SEC_GAMEMASTER, false, &ChatHandler::HandleGameObjectCommand, "", NULL },
527  { "delete", SEC_GAMEMASTER, false, &ChatHandler::HandleDelObjectCommand, "", NULL },
528  { "target", SEC_GAMEMASTER, false, &ChatHandler::HandleTargetObjectCommand, "", NULL },
529  { "turn", SEC_GAMEMASTER, false, &ChatHandler::HandleTurnObjectCommand, "", NULL },
530  { "move", SEC_GAMEMASTER, false, &ChatHandler::HandleMoveObjectCommand, "", NULL },
531  { "near", SEC_ADMINISTRATOR, false, &ChatHandler::HandleNearObjectCommand, "", NULL },
532  { "activate", SEC_GAMEMASTER, false, &ChatHandler::HandleActivateObjectCommand, "", NULL },
533  { "addtemp", SEC_GAMEMASTER, false, &ChatHandler::HandleTempGameObjectCommand, "", NULL },
534  { "setphase", SEC_GAMEMASTER, false, &ChatHandler::HandleGOPhaseCommand, "", NULL },
535  { NULL, 0, false, NULL, "", NULL }
536  };
537 
538  static ChatCommand questCommandTable[] =
539  {
540  { "add", SEC_ADMINISTRATOR, false, &ChatHandler::HandleAddQuest, "", NULL },
541  { "complete", SEC_ADMINISTRATOR, false, &ChatHandler::HandleCompleteQuest, "", NULL },
542  { "remove", SEC_ADMINISTRATOR, false, &ChatHandler::HandleRemoveQuest, "", NULL },
543  { NULL, 0, false, NULL, "", NULL }
544  };
545 
546  static ChatCommand gmCommandTable[] =
547  {
548  { "chat", SEC_MODERATOR, false, &ChatHandler::HandleGMChatCommand, "", NULL },
549  { "ingame", SEC_PLAYER, true, &ChatHandler::HandleGMListIngameCommand, "", NULL },
550  { "list", SEC_ADMINISTRATOR, true, &ChatHandler::HandleGMListFullCommand, "", NULL },
551  { "visible", SEC_MODERATOR, false, &ChatHandler::HandleVisibleCommand, "", NULL },
552  { "fly", SEC_ADMINISTRATOR, false, &ChatHandler::HandleFlyModeCommand, "", NULL },
553  { "", SEC_MODERATOR, false, &ChatHandler::HandleGMmodeCommand, "", NULL },
554  { NULL, 0, false, NULL, "", NULL }
555  };
556 
557  static ChatCommand instanceCommandTable[] =
558  {
559  { "listbinds", SEC_MODERATOR, false, &ChatHandler::HandleInstanceListBindsCommand, "", NULL },
560  { "unbind", SEC_MODERATOR, false, &ChatHandler::HandleInstanceUnbindCommand, "", NULL },
561  { "stats", SEC_MODERATOR, true, &ChatHandler::HandleInstanceStatsCommand, "", NULL },
562  { "savedata", SEC_MODERATOR, false, &ChatHandler::HandleInstanceSaveDataCommand, "", NULL },
563  { NULL, 0, false, NULL, "", NULL }
564  };
565 
566  static ChatCommand ticketCommandTable[] =
567  {
568  { "list", SEC_MODERATOR, false, &ChatHandler::HandleGMTicketListCommand, "", NULL },
569  { "onlinelist", SEC_MODERATOR, false, &ChatHandler::HandleGMTicketListOnlineCommand, "", NULL },
570  { "viewname", SEC_MODERATOR, false, &ChatHandler::HandleGMTicketGetByNameCommand, "", NULL },
571  { "viewid", SEC_MODERATOR, false, &ChatHandler::HandleGMTicketGetByIdCommand, "", NULL },
572  { "close", SEC_MODERATOR, false, &ChatHandler::HandleGMTicketCloseByIdCommand, "", NULL },
573  { "closedlist", SEC_MODERATOR, false, &ChatHandler::HandleGMTicketListClosedCommand, "", NULL },
574  { "delete", SEC_ADMINISTRATOR, false, &ChatHandler::HandleGMTicketDeleteByIdCommand, "", NULL },
575  { "assign", SEC_MODERATOR, false, &ChatHandler::HandleGMTicketAssignToCommand, "", NULL },
576  { "unassign", SEC_MODERATOR, false, &ChatHandler::HandleGMTicketUnAssignCommand, "", NULL },
577  { "comment", SEC_MODERATOR, false, &ChatHandler::HandleGMTicketCommentCommand, "", NULL },
578  { NULL, 0, false, NULL, "", NULL }
579  };
580 
581  static ChatCommand referFriendCommandTable[] =
582  {
583  { "info", SEC_GAMEMASTER, true, &ChatHandler::HandleRAFInfoCommand, "", NULL },
584  { "link", SEC_GAMEMASTER, true, &ChatHandler::HandleRAFLinkCommand, "", NULL },
585  { "unlink", SEC_GAMEMASTER, true, &ChatHandler::HandleRAFUnlinkCommand, "", NULL },
586  { "summon", SEC_PLAYER, false, &ChatHandler::HandleRAFSummonCommand, "", NULL },
587  { "grantlevel", SEC_PLAYER, false, &ChatHandler::HandleRAFGrantLevelCommand, "", NULL },
588  { NULL, 0, false, NULL, "", NULL }
589  };
590 
591  static ChatCommand cheatCommandTable[] =
592  {
593  { "god", SEC_GAMEMASTER, false, &ChatHandler::HandleGodModeCheatCommand, "", NULL },
594  { "casttime", SEC_GAMEMASTER, false, &ChatHandler::HandleCasttimeCheatCommand, "", NULL },
595  { "cooldown", SEC_GAMEMASTER, false, &ChatHandler::HandleCoolDownCheatCommand, "", NULL },
596  { "power", SEC_GAMEMASTER, false, &ChatHandler::HandlePowerCheatCommand, "", NULL },
597  { "taxicheat", SEC_GAMEMASTER, false, &ChatHandler::HandleTaxiCheatCommand, "", NULL },
598  { "explorecheat", SEC_GAMEMASTER, false, &ChatHandler::HandleExploreCheatCommand, "", NULL },
599  { "waterwalk", SEC_GAMEMASTER, false, &ChatHandler::HandleWaterwalkCheatCommand, "", NULL },
600  { NULL, 0, false, NULL, "", NULL }
601  };
602 
603  static ChatCommand commandTable[] =
604  {
605  { "account", SEC_PLAYER, true, NULL, "", accountCommandTable },
606  { "gm", SEC_MODERATOR, true, NULL, "", gmCommandTable },
607  { "ticket", SEC_MODERATOR, false, NULL, "", ticketCommandTable },
608  { "npc", SEC_MODERATOR, false, NULL, "", npcCommandTable },
609  { "go", SEC_MODERATOR, false, NULL, "", goCommandTable },
610  { "learn", SEC_MODERATOR, false, NULL, "", learnCommandTable },
611  { "modify", SEC_MODERATOR, false, NULL, "", modifyCommandTable },
612  { "debug", SEC_MODERATOR, false, NULL, "", debugCommandTable },
613  { "tele", SEC_MODERATOR, true, NULL, "", teleCommandTable },
614  { "character", SEC_GAMEMASTER, true, NULL, "", characterCommandTable},
615  { "event", SEC_GAMEMASTER, false, NULL, "", eventCommandTable },
616  { "gobject", SEC_GAMEMASTER, false, NULL, "", gobjectCommandTable },
617  { "honor", SEC_GAMEMASTER, false, NULL, "", honorCommandTable },
618  { "group", SEC_GAMEMASTER, false, NULL, "", groupCommandTable },
619 
620  //wp commands
621  { "wp", SEC_GAMEMASTER, false, NULL, "", wpCommandTable },
622  { "loadpath", SEC_ADMINISTRATOR, false, &ChatHandler::HandleReloadAllPaths, "", NULL },
623 
624  { "quest", SEC_ADMINISTRATOR, false, NULL, "", questCommandTable },
625  { "titles", SEC_GAMEMASTER, false, NULL, "", titlesCommandTable },
626  { "reload", SEC_ADMINISTRATOR, true, NULL, "", reloadCommandTable },
627  { "list", SEC_ADMINISTRATOR, true, NULL, "", listCommandTable },
628  { "lookup", SEC_ADMINISTRATOR, true, NULL, "", lookupCommandTable },
629  { "pdump", SEC_ADMINISTRATOR, true, NULL, "", pdumpCommandTable },
630  { "guild", SEC_ADMINISTRATOR, true, NULL, "", guildCommandTable },
631  { "cast", SEC_ADMINISTRATOR, false, NULL, "", castCommandTable },
632  { "reset", SEC_ADMINISTRATOR, false, NULL, "", resetCommandTable },
633  { "instance", SEC_ADMINISTRATOR, true, NULL, "", instanceCommandTable },
634  { "server", SEC_ADMINISTRATOR, true, NULL, "", serverCommandTable },
635  { "pet", SEC_GAMEMASTER, false, NULL, "", petCommandTable },
636  { "cheat", SEC_GAMEMASTER, false, NULL, "", cheatCommandTable },
637 
638  { "aura", SEC_ADMINISTRATOR, false, &ChatHandler::HandleAuraCommand, "", NULL },
639  { "unaura", SEC_ADMINISTRATOR, false, &ChatHandler::HandleUnAuraCommand, "", NULL },
640  { "nameannounce", SEC_MODERATOR, false, &ChatHandler::HandleNameAnnounceCommand, "", NULL },
641  { "gmnameannounce", SEC_MODERATOR, false, &ChatHandler::HandleGMNameAnnounceCommand, "", NULL },
642  { "announce", SEC_MODERATOR, true, &ChatHandler::HandleAnnounceCommand, "", NULL },
643  { "gmannounce", SEC_MODERATOR, true, &ChatHandler::HandleGMAnnounceCommand, "", NULL },
644  { "notify", SEC_MODERATOR, true, &ChatHandler::HandleNotifyCommand, "", NULL },
645  { "gmnotify", SEC_MODERATOR, true, &ChatHandler::HandleGMNotifyCommand, "", NULL },
646  { "appear", SEC_MODERATOR, false, &ChatHandler::HandleAppearCommand, "", NULL },
647  { "summon", SEC_MODERATOR, false, &ChatHandler::HandleSummonCommand, "", NULL },
648  { "groupsummon", SEC_MODERATOR, false, &ChatHandler::HandleGroupSummonCommand, "", NULL },
649  { "commands", SEC_PLAYER, true, &ChatHandler::HandleCommandsCommand, "", NULL },
650  { "demorph", SEC_GAMEMASTER, false, &ChatHandler::HandleDeMorphCommand, "", NULL },
651  { "die", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDieCommand, "", NULL },
652  { "revive", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReviveCommand, "", NULL },
653  { "dismount", SEC_PLAYER, false, &ChatHandler::HandleDismountCommand, "", NULL },
654  { "gps", SEC_MODERATOR, false, &ChatHandler::HandleGPSCommand, "", NULL },
655  { "guid", SEC_GAMEMASTER, false, &ChatHandler::HandleGUIDCommand, "", NULL },
656  { "help", SEC_PLAYER, true, &ChatHandler::HandleHelpCommand, "", NULL },
657  { "itemmove", SEC_GAMEMASTER, false, &ChatHandler::HandleItemMoveCommand, "", NULL },
658  { "cooldown", SEC_ADMINISTRATOR, false, &ChatHandler::HandleCooldownCommand, "", NULL },
659  { "unlearn", SEC_ADMINISTRATOR, false, &ChatHandler::HandleUnLearnCommand, "", NULL },
660  { "distance", SEC_ADMINISTRATOR, false, &ChatHandler::HandleGetDistanceCommand, "", NULL },
661  { "recall", SEC_MODERATOR, false, &ChatHandler::HandleRecallCommand, "", NULL },
662  { "save", SEC_PLAYER, false, &ChatHandler::HandleSaveCommand, "", NULL },
663  { "saveall", SEC_MODERATOR, true, &ChatHandler::HandleSaveAllCommand, "", NULL },
664  { "kick", SEC_GAMEMASTER, true, &ChatHandler::HandleKickPlayerCommand, "", NULL },
665  { "ban", SEC_ADMINISTRATOR, true, NULL, "", banCommandTable },
666  { "unban", SEC_ADMINISTRATOR, true, NULL, "", unbanCommandTable },
667  { "baninfo", SEC_ADMINISTRATOR, false, NULL, "", baninfoCommandTable },
668  { "banlist", SEC_ADMINISTRATOR, true, NULL, "", banlistCommandTable },
669  { "start", SEC_PLAYER, false, &ChatHandler::HandleStartCommand, "", NULL },
670  { "allowmove", SEC_ADMINISTRATOR, false, &ChatHandler::HandleAllowMovementCommand, "", NULL },
671  { "linkgrave", SEC_ADMINISTRATOR, false, &ChatHandler::HandleLinkGraveCommand, "", NULL },
672  { "neargrave", SEC_ADMINISTRATOR, false, &ChatHandler::HandleNearGraveCommand, "", NULL },
673  { "hover", SEC_ADMINISTRATOR, false, &ChatHandler::HandleHoverCommand, "", NULL },
674  { "levelup", SEC_ADMINISTRATOR, false, &ChatHandler::HandleLevelUpCommand, "", NULL },
675  { "showarea", SEC_ADMINISTRATOR, false, &ChatHandler::HandleShowAreaCommand, "", NULL },
676  { "hidearea", SEC_ADMINISTRATOR, false, &ChatHandler::HandleHideAreaCommand, "", NULL },
677  { "additem", SEC_ADMINISTRATOR, false, &ChatHandler::HandleAddItemCommand, "", NULL },
678  { "additemset", SEC_ADMINISTRATOR, false, &ChatHandler::HandleAddItemSetCommand, "", NULL },
679  { "bank", SEC_ADMINISTRATOR, false, &ChatHandler::HandleBankCommand, "", NULL },
680  { "wchange", SEC_ADMINISTRATOR, false, &ChatHandler::HandleChangeWeather, "", NULL },
681  { "maxskill", SEC_ADMINISTRATOR, false, &ChatHandler::HandleMaxSkillCommand, "", NULL },
682  { "setskill", SEC_ADMINISTRATOR, false, &ChatHandler::HandleSetSkillCommand, "", NULL },
683  { "whispers", SEC_MODERATOR, false, &ChatHandler::HandleWhispersCommand, "", NULL },
684  { "pinfo", SEC_GAMEMASTER, true, &ChatHandler::HandlePInfoCommand, "", NULL },
685  { "respawn", SEC_ADMINISTRATOR, false, &ChatHandler::HandleRespawnCommand, "", NULL },
686  { "senditems", SEC_ADMINISTRATOR, true, &ChatHandler::HandleSendItemsCommand, "", NULL },
687  { "sendmail", SEC_MODERATOR, true, &ChatHandler::HandleSendMailCommand, "", NULL },
688  { "sendmoney", SEC_ADMINISTRATOR, true, &ChatHandler::HandleSendMoneyCommand, "", NULL },
689  { "mute", SEC_GAMEMASTER, true, &ChatHandler::HandleMuteCommand, "", NULL },
690  { "unmute", SEC_GAMEMASTER, true, &ChatHandler::HandleUnmuteCommand, "", NULL },
691  { "movegens", SEC_ADMINISTRATOR, false, &ChatHandler::HandleMovegensCommand, "", NULL },
692  { "cometome", SEC_ADMINISTRATOR, false, &ChatHandler::HandleComeToMeCommand, "", NULL },
693  { "damage", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDamageCommand, "", NULL },
694  { "combatstop", SEC_GAMEMASTER, false, &ChatHandler::HandleCombatStopCommand, "", NULL },
695  { "ahbotoptions", SEC_ADMINISTRATOR, true, &ChatHandler::HandleAHBotOptionsCommand, "", NULL },
696  { "flusharenapoints", SEC_ADMINISTRATOR, true, &ChatHandler::HandleFlushArenaPointsCommand, "", NULL },
697  { "sendmessage", SEC_ADMINISTRATOR, true, &ChatHandler::HandleSendMessageCommand, "", NULL },
698  { "playall", SEC_ADMINISTRATOR, false, &ChatHandler::HandlePlayAllCommand, "", NULL },
699  { "repairitems", SEC_GAMEMASTER, false, &ChatHandler::HandleRepairitemsCommand, "", NULL },
700  { "freeze", SEC_ADMINISTRATOR, false, &ChatHandler::HandleFreezeCommand, "", NULL },
701  { "unfreeze", SEC_ADMINISTRATOR, false, &ChatHandler::HandleUnFreezeCommand, "", NULL },
702  { "listfreeze", SEC_ADMINISTRATOR, false, &ChatHandler::HandleListFreezeCommand, "", NULL },
703  { "possess", SEC_ADMINISTRATOR, false, &ChatHandler::HandlePossessCommand, "", NULL },
704  { "unpossess", SEC_ADMINISTRATOR, false, &ChatHandler::HandleUnPossessCommand, "", NULL },
705  { "bindsight", SEC_ADMINISTRATOR, false, &ChatHandler::HandleBindSightCommand, "", NULL },
706  { "unbindsight", SEC_ADMINISTRATOR, false, &ChatHandler::HandleUnbindSightCommand, "", NULL },
707  { "raf", SEC_ADMINISTRATOR, true, NULL, "", referFriendCommandTable },
708 
709  { NULL, 0, false, NULL, "", NULL }
710  };
711 
712  if (load_command_table)
713  {
714  load_command_table = false;
715 
716  QueryResult_AutoPtr result = WorldDatabase.Query("SELECT name,security,help FROM command");
717  if (result)
718  {
719  do
720  {
721  Field* fields = result->Fetch();
722  std::string name = fields[0].GetCppString();
723  for (uint32 i = 0; commandTable[i].Name != NULL; i++)
724  {
725  if (name == commandTable[i].Name)
726  {
727  commandTable[i].SecurityLevel = (uint16)fields[1].GetUInt16();
728  commandTable[i].Help = fields[2].GetCppString();
729  }
730  if (commandTable[i].ChildCommands != NULL)
731  {
732  ChatCommand* ptable = commandTable[i].ChildCommands;
733  for (uint32 j = 0; ptable[j].Name != NULL; j++)
734  {
735  // first case for "" named subcommand
736  if ((ptable[j].Name[0] == '\0' && name == commandTable[i].Name) ||
737  (name == fmtstring("%s %s", commandTable[i].Name, ptable[j].Name)))
738  {
739  ptable[j].SecurityLevel = (uint16)fields[1].GetUInt16();
740  ptable[j].Help = fields[2].GetCppString();
741  }
742  }
743  }
744  }
745  }
746  while (result->NextRow());
747  }
748  }
749 
750  return commandTable;
751 }
752 
753 const char* ChatHandler::GetOregonString(int32 entry) const
754 {
755  return m_session->GetOregonString(entry);
756 }
757 
758 bool ChatHandler::isAvailable(ChatCommand const& cmd) const
759 {
760  // check security level only for simple command (without child commands)
761  return m_session->GetSecurity() >= cmd.SecurityLevel;
762 }
763 
764 bool ChatHandler::hasStringAbbr(const char* name, const char* part)
765 {
766  // non "" command
767  if (*name)
768  {
769  // "" part from non-"" command
770  if (!*part)
771  return false;
772 
773  for (;;)
774  {
775  if (!*part)
776  return true;
777  else if (!*name)
778  return false;
779  else if (tolower(*name) != tolower(*part))
780  return false;
781  ++name;
782  ++part;
783  }
784  }
785  // allow with any for ""
786 
787  return true;
788 }
789 
790 void ChatHandler::SendSysMessage(const char* str)
791 {
792  WorldPacket data;
793 
794  // need copy to prevent corruption by strtok call in LineFromMessage original string
795  char* buf = strdup(str);
796  char* pos = buf;
797 
798  while (char* line = LineFromMessage(pos))
799  {
800  FillSystemMessageData(&data, line);
801  m_session->SendPacket(&data);
802  }
803 
804  free(buf);
805 }
806 
808 {
809  // Chat output
810  WorldPacket data;
811 
812  // need copy to prevent corruption by strtok call in LineFromMessage original string
813  char* buf = strdup(str);
814  char* pos = buf;
815 
816  while (char* line = LineFromMessage(pos))
817  {
818  FillSystemMessageData(&data, line);
819  sWorld.SendGlobalMessage(&data);
820  }
821 
822  free(buf);
823 }
824 
826 {
827  // Chat output
828  WorldPacket data;
829 
830  // need copy to prevent corruption by strtok call in LineFromMessage original string
831  char* buf = strdup(str);
832  char* pos = buf;
833 
834  while (char* line = LineFromMessage(pos))
835  {
836  FillSystemMessageData(&data, line);
837  sWorld.SendGlobalGMMessage(&data);
838  }
839  free(buf);
840 }
841 
843 {
845 }
846 
848 {
849  const char* format = GetOregonString(entry);
850  va_list ap;
851  char str [1024];
852  va_start(ap, entry);
853  vsnprintf(str, 1024, format, ap);
854  va_end(ap);
855  SendSysMessage(str);
856 }
857 
858 void ChatHandler::PSendSysMessage(const char* format, ...)
859 {
860  va_list ap;
861  char str [1024];
862  va_start(ap, format);
863  vsnprintf(str, 1024, format, ap);
864  va_end(ap);
865  SendSysMessage(str);
866 }
867 
868 bool ChatHandler::ExecuteCommandInTable(ChatCommand* table, const char* text, const std::string& fullcmd)
869 {
870  char const* oldtext = text;
871  std::string cmd = "";
872 
873  while (*text != ' ' && *text != '\0')
874  {
875  cmd += *text;
876  ++text;
877  }
878 
879  while (*text == ' ') ++text;
880 
881  for (uint32 i = 0; table[i].Name != NULL; ++i)
882  {
883  if (!hasStringAbbr(table[i].Name, cmd.c_str()))
884  continue;
885 
886  // select subcommand from child commands list
887  if (table[i].ChildCommands != NULL)
888  {
889  if (!ExecuteCommandInTable(table[i].ChildCommands, text, fullcmd))
890  {
891  if (text && text[0] != '\0')
893  else
895 
896  ShowHelpForCommand(table[i].ChildCommands, text);
897  }
898 
899  return true;
900  }
901 
902  // must be available and have handler
903  if (!table[i].Handler || !isAvailable(table[i]))
904  continue;
905 
906  SetSentErrorMessage(false);
907  // table[i].Name == "" is special case: send original command to handler
908  if ((this->*(table[i].Handler))(strlen(table[i].Name) != 0 ? text : oldtext))
909  {
910  if (table[i].SecurityLevel > SEC_PLAYER)
911  {
912  // chat case
913  if (m_session)
914  {
915  Player* p = m_session->GetPlayer();
916  ObjectGuid sel_guid = p->GetSelection();
917  sLog.outCommand(m_session->GetAccountId(), "Command: %s [Player: %s (Account: %u) X: %f Y: %f Z: %f Map: %u Selected: %s]",
918  fullcmd.c_str(), p->GetName(), m_session->GetAccountId(), p->GetPositionX(), p->GetPositionY(), p->GetPositionZ(), p->GetMapId(),
919  sel_guid.GetString().c_str());
920  }
921  }
922  }
923  // some commands have custom error messages. Don't send the default one in these cases.
924  else if (!sentErrorMessage)
925  {
926  if (!table[i].Help.empty())
927  SendSysMessage(table[i].Help.c_str());
928  else
930  }
931 
932  return true;
933  }
934 
935  return false;
936 }
937 
938 int ChatHandler::ParseCommands(const char* text)
939 {
940  ASSERT(text);
941  ASSERT(*text);
942 
943  std::string fullcmd = text;
944 
945  // chat case (.command or !command format)
946  if (m_session)
947  {
948  if (text[0] != '!' && text[0] != '.')
949  return 0;
950  }
951 
952  // ignore single . and ! in line
953  if (strlen(text) < 2)
954  return 0;
955  // original `text` can't be used. It content destroyed in command code processing.
956 
957  // ignore messages staring from many dots.
958  if ((text[0] == '.' && text[1] == '.') || (text[0] == '!' && text[1] == '!'))
959  return 0;
960 
961  // skip first . or ! (in console allowed use command with . and ! and without its)
962  if (text[0] == '!' || text[0] == '.')
963  ++text;
964 
965  if (!ExecuteCommandInTable(getCommandTable(), text, fullcmd))
966  {
968  return 0;
970  }
971  return 1;
972 }
973 
974 bool ChatHandler::isValidChatMessage(const char* message)
975 {
976  /*
977 
978  valid examples:
979  |cffa335ee|Hitem:812:0:0:0:0:0:0:0:70|h[Glowing Brightwood Staff]|h|r
980  |cff808080|Hquest:2278:47|h[The Platinum Discs]|h|r
981  |cff4e96f7|Htalent:2232:-1|h[Taste for Blood]|h|r
982  |cff71d5ff|Hspell:21563|h[Command]|h|r
983  |cffffd000|Henchant:3919|h[Engineering: Rough Dynamite]|h|r
984 
985  | will be escaped to ||
986  */
987 
988  if (strlen(message) > 255)
989  return false;
990 
991  const char validSequence[6] = "cHhhr";
992  const char* validSequenceIterator = validSequence;
993 
994  // more simple checks
996  {
997  const std::string validCommands = "cHhr|";
998 
999  while (*message)
1000  {
1001  // find next pipe command
1002  message = strchr(message, '|');
1003 
1004  if (!message)
1005  return true;
1006 
1007  ++message;
1008  char commandChar = *message;
1009  if (validCommands.find(commandChar) == std::string::npos)
1010  return false;
1011 
1012  ++message;
1013  // validate sequence
1015  {
1016  if (commandChar == *validSequenceIterator)
1017  {
1018  if (validSequenceIterator == validSequence + 4)
1019  validSequenceIterator = validSequence;
1020  else
1021  ++validSequenceIterator;
1022  }
1023  else
1024  return false;
1025  }
1026  }
1027  return true;
1028  }
1029 
1030  std::istringstream reader(message);
1031  char buffer[256];
1032 
1033  uint32 color = 0;
1034 
1035  ItemTemplate const* linkedItem;
1036  Quest const* linkedQuest;
1037  SpellEntry const* linkedSpell = NULL;
1038 
1039  while (!reader.eof())
1040  {
1041  if (validSequence == validSequenceIterator)
1042  {
1043  linkedItem = NULL;
1044  linkedQuest = NULL;
1045  linkedSpell = NULL;
1046 
1047  reader.ignore(255, '|');
1048  }
1049  else if (reader.get() != '|')
1050  {
1051  #ifdef OREGON_DEBUG
1052  sLog.outBasic("ChatHandler::isValidChatMessage sequence aborted unexpectedly");
1053  #endif
1054  return false;
1055  }
1056 
1057  // pipe has always to be followed by at least one char
1058  if (reader.peek() == '\0')
1059  {
1060  #ifdef OREGON_DEBUG
1061  sLog.outBasic("ChatHandler::isValidChatMessage pipe followed by \\0");
1062  #endif
1063  return false;
1064  }
1065 
1066  // no further pipe commands
1067  if (reader.eof())
1068  break;
1069 
1070  char commandChar;
1071  reader >> commandChar;
1072 
1073  // | in normal messages is escaped by ||
1074  if (commandChar != '|')
1075  {
1076  if (commandChar == *validSequenceIterator)
1077  {
1078  if (validSequenceIterator == validSequence + 4)
1079  validSequenceIterator = validSequence;
1080  else
1081  ++validSequenceIterator;
1082  }
1083  else
1084  {
1085  #ifdef OREGON_DEBUG
1086  sLog.outBasic("ChatHandler::isValidChatMessage invalid sequence, expected %c but got %c", *validSequenceIterator, commandChar);
1087  #endif
1088  return false;
1089  }
1090  }
1091  else if (validSequence != validSequenceIterator)
1092  {
1093  // no escaped pipes in sequences
1094  #ifdef OREGON_DEBUG
1095  sLog.outBasic("ChatHandler::isValidChatMessage got escaped pipe in sequence");
1096  #endif
1097  return false;
1098  }
1099 
1100  switch (commandChar)
1101  {
1102  case 'c':
1103  color = 0;
1104  // validate color, expect 8 hex chars
1105  for (int i = 0; i < 8; i++)
1106  {
1107  char c;
1108  reader >> c;
1109  if (!c)
1110  {
1111  #ifdef OREGON_DEBUG
1112  sLog.outBasic("ChatHandler::isValidChatMessage got \\0 while reading color in |c command");
1113  #endif
1114  return false;
1115  }
1116 
1117  color <<= 4;
1118  // check for hex char
1119  if (c >= '0' && c <= '9')
1120  {
1121  color |= c - '0';
1122  continue;
1123  }
1124  if (c >= 'a' && c <= 'f')
1125  {
1126  color |= 10 + c - 'a';
1127  continue;
1128  }
1129  #ifdef OREGON_DEBUG
1130  sLog.outBasic("ChatHandler::isValidChatMessage got non hex char '%c' while reading color", c);
1131  #endif
1132  return false;
1133  }
1134  break;
1135  case 'H':
1136  // read chars up to colon = link type
1137  reader.getline(buffer, 256, ':');
1138 
1139  if (strcmp(buffer, "item") == 0)
1140  {
1141  // read item entry
1142  reader.getline(buffer, 256, ':');
1143 
1144  linkedItem = sObjectMgr.GetItemTemplate(atoi(buffer));
1145  if (!linkedItem)
1146  {
1147  #ifdef OREGON_DEBUG
1148  sLog.outBasic("ChatHandler::isValidChatMessage got invalid itemID %u in |item command", atoi(buffer));
1149  #endif
1150  return false;
1151  }
1152 
1153  if (color != ItemQualityColors[linkedItem->Quality])
1154  {
1155  #ifdef OREGON_DEBUG
1156  sLog.outBasic("ChatHandler::isValidChatMessage linked item has color %u, but user claims %u", ItemQualityColors[linkedItem->Quality],
1157  color);
1158  #endif
1159  return false;
1160  }
1161 
1162  char c = reader.peek();
1163 
1164  // ignore enchants etc.
1165  while ((c >= '0' && c <= '9') || c == ':')
1166  {
1167  reader.ignore(1);
1168  c = reader.peek();
1169  }
1170  }
1171  else if (strcmp(buffer, "quest") == 0)
1172  {
1173  // no color check for questlinks, each client will adapt it anyway
1174  uint32 questid = 0;
1175  // read questid
1176  char c = reader.peek();
1177  while (c >= '0' && c <= '9')
1178  {
1179  reader.ignore(1);
1180  questid *= 10;
1181  questid += c - '0';
1182  c = reader.peek();
1183  }
1184 
1185  linkedQuest = sObjectMgr.GetQuestTemplate(questid);
1186 
1187  if (!linkedQuest)
1188  {
1189  #ifdef OREGON_DEBUG
1190  sLog.outBasic("ChatHandler::isValidChatMessage Questtemplate %u not found", questid);
1191  #endif
1192  return false;
1193  }
1194  c = reader.peek();
1195  // level
1196  while (c != '|' && c != '\0')
1197  {
1198  reader.ignore(1);
1199  c = reader.peek();
1200  }
1201  }
1202  else if (strcmp(buffer, "talent") == 0)
1203  {
1204  // talent links are always supposed to be blue
1205  if (color != CHAT_LINK_COLOR_TALENT)
1206  return false;
1207 
1208  // read talent entry
1209  reader.getline(buffer, 256, ':');
1210  TalentEntry const* talentInfo = sTalentStore.LookupEntry(atoi(buffer));
1211  if (!talentInfo)
1212  return false;
1213 
1214  linkedSpell = sSpellStore.LookupEntry(talentInfo->RankID[0]);
1215  if (!linkedSpell)
1216  return false;
1217 
1218  char c = reader.peek();
1219  // skillpoints? whatever, drop it
1220  while (c != '|' && c != '\0')
1221  {
1222  reader.ignore(1);
1223  c = reader.peek();
1224  }
1225  }
1226  else if (strcmp(buffer, "spell") == 0)
1227  {
1228  if (color != CHAT_LINK_COLOR_SPELL)
1229  return false;
1230 
1231  uint32 spellid = 0;
1232  // read spell entry
1233  char c = reader.peek();
1234  while (c >= '0' && c <= '9')
1235  {
1236  reader.ignore(1);
1237  spellid *= 10;
1238  spellid += c - '0';
1239  c = reader.peek();
1240  }
1241  linkedSpell = sSpellStore.LookupEntry(spellid);
1242  if (!linkedSpell)
1243  return false;
1244  }
1245  else if (strcmp(buffer, "enchant") == 0)
1246  {
1247  if (color != CHAT_LINK_COLOR_ENCHANT)
1248  return false;
1249 
1250  uint32 spellid = 0;
1251  // read spell entry
1252  char c = reader.peek();
1253  while (c >= '0' && c <= '9')
1254  {
1255  reader.ignore(1);
1256  spellid *= 10;
1257  spellid += c - '0';
1258  c = reader.peek();
1259  }
1260  linkedSpell = sSpellStore.LookupEntry(spellid);
1261  if (!linkedSpell)
1262  return false;
1263  }
1264  else
1265  {
1266  #ifdef OREGON_DEBUG
1267  sLog.outBasic("ChatHandler::isValidChatMessage user sent unsupported link type '%s'", buffer);
1268  #endif
1269  return false;
1270  }
1271  break;
1272  case 'h':
1273  // if h is next element in sequence, this one must contain the linked text :)
1274  if (*validSequenceIterator == 'h')
1275  {
1276  // links start with '['
1277  if (reader.get() != '[')
1278  {
1279  #ifdef OREGON_DEBUG
1280  sLog.outBasic("ChatHandler::isValidChatMessage link caption doesn't start with '['");
1281  #endif
1282  return false;
1283  }
1284  reader.getline(buffer, 256, ']');
1285 
1286  // verify the link name
1287  if (linkedSpell)
1288  {
1289  // spells with that flag have a prefix of "$PROFESSION: "
1290  if (linkedSpell->Attributes & SPELL_ATTR0_TRADESPELL)
1291  {
1292  // lookup skillid
1293  SkillLineAbilityMap::const_iterator lower = sSpellMgr.GetBeginSkillLineAbilityMap(linkedSpell->Id);
1294  SkillLineAbilityMap::const_iterator upper = sSpellMgr.GetEndSkillLineAbilityMap(linkedSpell->Id);
1295 
1296  if (lower == upper)
1297  return false;
1298 
1299  SkillLineAbilityEntry const* skillInfo = lower->second;
1300 
1301  if (!skillInfo)
1302  return false;
1303 
1304  SkillLineEntry const* skillLine = sSkillLineStore.LookupEntry(skillInfo->skillId);
1305  if (!skillLine)
1306  return false;
1307 
1308  for (uint8 i = 0; i < MAX_LOCALE; ++i)
1309  {
1310  uint32 skillLineNameLength = strlen(skillLine->name[i]);
1311  if (skillLineNameLength > 0 && strncmp(skillLine->name[i], buffer, skillLineNameLength) == 0)
1312  {
1313  // found the prefix, remove it to perform spellname validation below
1314  // -2 = strlen(": ")
1315  uint32 spellNameLength = strlen(buffer) - skillLineNameLength - 2;
1316  memmove(buffer, buffer + skillLineNameLength + 2, spellNameLength + 1);
1317  }
1318  }
1319  }
1320  bool foundName = false;
1321  for (uint8 i = 0; i < MAX_LOCALE; ++i)
1322  {
1323  if (*linkedSpell->SpellName[i] && strcmp(linkedSpell->SpellName[i], buffer) == 0)
1324  {
1325  foundName = true;
1326  break;
1327  }
1328  }
1329  if (!foundName)
1330  return false;
1331  }
1332  else if (linkedQuest)
1333  {
1334  if (linkedQuest->GetTitle() != buffer)
1335  {
1336  QuestLocale const* ql = sObjectMgr.GetQuestLocale(linkedQuest->GetQuestId());
1337 
1338  if (!ql)
1339  {
1340  #ifdef OREGON_DEBUG
1341  sLog.outBasic("ChatHandler::isValidChatMessage default questname didn't match and there is no locale");
1342  #endif
1343  return false;
1344  }
1345 
1346  bool foundName = false;
1347  for (uint8 i = 0; i < ql->Title.size(); i++)
1348  {
1349  if (ql->Title[i] == buffer)
1350  {
1351  foundName = true;
1352  break;
1353  }
1354  }
1355  if (!foundName)
1356  {
1357  #ifdef OREGON_DEBUG
1358  sLog.outBasic("ChatHandler::isValidChatMessage no quest locale title matched");
1359  #endif
1360  return false;
1361  }
1362  }
1363  }
1364  else if (linkedItem)
1365  {
1366  if (strcmp(linkedItem->Name1, buffer) != 0)
1367  {
1368  ItemLocale const* il = sObjectMgr.GetItemLocale(linkedItem->ItemId);
1369 
1370  if (!il)
1371  {
1372  #ifdef OREGON_DEBUG
1373  sLog.outBasic("ChatHandler::isValidChatMessage linked item name doesn't is wrong and there is no localization");
1374  #endif
1375  return false;
1376  }
1377 
1378  bool foundName = false;
1379  for (uint8 i = 0; i < il->Name.size(); ++i)
1380  {
1381  if (il->Name[i] == buffer)
1382  {
1383  foundName = true;
1384  break;
1385  }
1386  }
1387  if (!foundName)
1388  {
1389  #ifdef OREGON_DEBUG
1390  sLog.outBasic("ChatHandler::isValidChatMessage linked item name wasn't found in any localization");
1391  #endif
1392  return false;
1393  }
1394  }
1395  }
1396  // that place should never be reached - if nothing linked has been set in |H
1397  // it will return false before
1398  else
1399  return false;
1400  }
1401  break;
1402  case 'r':
1403  case '|':
1404  // no further payload
1405  break;
1406  default:
1407  #ifdef OREGON_DEBUG
1408  sLog.outBasic("ChatHandler::isValidChatMessage got invalid command |%c", commandChar);
1409  #endif
1410  return false;
1411  }
1412  }
1413 
1414  // check if every opened sequence was also closed properly
1415  #ifdef OREGON_DEBUG
1416  if (validSequence != validSequenceIterator)
1417  sLog.outBasic("ChatHandler::isValidChatMessage EOF in active sequence");
1418  #endif
1419  return validSequence == validSequenceIterator;
1420 }
1421 
1422 bool ChatHandler::ShowHelpForSubCommands(ChatCommand* table, char const* cmd, char const* subcmd)
1423 {
1424  std::string list;
1425  for (uint32 i = 0; table[i].Name != NULL; ++i)
1426  {
1427  // must be available (ignore handler existence for show command with possibe avalable subcomands
1428  if (!isAvailable(table[i]))
1429  continue;
1430 
1431  // for empty subcmd show all available
1432  if (*subcmd && !hasStringAbbr(table[i].Name, subcmd))
1433  continue;
1434 
1435  if (m_session)
1436  list += "\n ";
1437  else
1438  list += "\n\r ";
1439 
1440  list += table[i].Name;
1441 
1442  if (table[i].ChildCommands)
1443  list += " ...";
1444  }
1445 
1446  if (list.empty())
1447  return false;
1448 
1449  if (table == getCommandTable())
1450  {
1452  PSendSysMessage("%s", list.c_str());
1453  }
1454  else
1455  PSendSysMessage(LANG_SUBCMDS_LIST, cmd, list.c_str());
1456 
1457  return true;
1458 }
1459 
1461 {
1462  if (*cmd)
1463  {
1464  for (uint32 i = 0; table[i].Name != NULL; ++i)
1465  {
1466  // must be available (ignore handler existence for show command with possibe avalable subcomands
1467  if (!isAvailable(table[i]))
1468  continue;
1469 
1470  if (!hasStringAbbr(table[i].Name, cmd))
1471  continue;
1472 
1473  // have subcommand
1474  char const* subcmd = (*cmd) ? strtok(NULL, " ") : "";
1475 
1476  if (table[i].ChildCommands && subcmd && *subcmd)
1477  {
1478  if (ShowHelpForCommand(table[i].ChildCommands, subcmd))
1479  return true;
1480  }
1481 
1482  if (!table[i].Help.empty())
1483  SendSysMessage(table[i].Help.c_str());
1484 
1485  if (table[i].ChildCommands)
1486  if (ShowHelpForSubCommands(table[i].ChildCommands, table[i].Name, subcmd ? subcmd : ""))
1487  return true;
1488 
1489  return !table[i].Help.empty();
1490  }
1491  }
1492  else
1493  {
1494  for (uint32 i = 0; table[i].Name != NULL; ++i)
1495  {
1496  // must be available (ignore handler existence for show command with possibe avalable subcomands
1497  if (!isAvailable(table[i]))
1498  continue;
1499 
1500  if (strlen(table[i].Name))
1501  continue;
1502 
1503  if (!table[i].Help.empty())
1504  SendSysMessage(table[i].Help.c_str());
1505 
1506  if (table[i].ChildCommands)
1507  if (ShowHelpForSubCommands(table[i].ChildCommands, "", ""))
1508  return true;
1509 
1510  return !table[i].Help.empty();
1511  }
1512  }
1513 
1514  return ShowHelpForSubCommands(table, "", cmd);
1515 }
1516 
1517 //Note: target_guid used only in CHAT_MSG_WHISPER_INFORM mode (in this case channelName ignored)
1518 void ChatHandler::FillMessageData(WorldPacket* data, WorldSession* session, uint8 type, uint32 language, const char* channelName, uint64 target_guid, const char* message, Unit* speaker)
1519 {
1520  uint32 messageLength = (message ? strlen(message) : 0) + 1;
1521 
1522  data->Initialize(SMSG_MESSAGECHAT, 100); // guess size
1523  *data << uint8(type);
1524  if ((type != CHAT_MSG_CHANNEL && type != CHAT_MSG_WHISPER) || language == LANG_ADDON)
1525  *data << uint32(language);
1526  else
1527  *data << uint32(LANG_UNIVERSAL);
1528 
1529  switch (type)
1530  {
1531  case CHAT_MSG_SAY:
1532  case CHAT_MSG_PARTY:
1533  case CHAT_MSG_RAID:
1534  case CHAT_MSG_GUILD:
1535  case CHAT_MSG_OFFICER:
1536  case CHAT_MSG_YELL:
1537  case CHAT_MSG_WHISPER:
1538  case CHAT_MSG_CHANNEL:
1539  case CHAT_MSG_RAID_LEADER:
1540  case CHAT_MSG_RAID_WARNING:
1544  case CHAT_MSG_BATTLEGROUND:
1546  target_guid = session ? session->GetPlayer()->GetGUID() : 0;
1547  break;
1548  case CHAT_MSG_MONSTER_SAY:
1550  case CHAT_MSG_MONSTER_YELL:
1555  {
1556  *data << uint64(speaker->GetGUID());
1557  *data << uint32(0); // 2.1.0
1558  *data << uint32(strlen(speaker->GetName()) + 1);
1559  *data << speaker->GetName();
1560  uint64 listener_guid = 0;
1561  *data << uint64(listener_guid);
1562  if (listener_guid && !IS_PLAYER_GUID(listener_guid))
1563  {
1564  *data << uint32(1); // string listener_name_length
1565  *data << uint8(0); // string listener_name
1566  }
1567  *data << uint32(messageLength);
1568  *data << message;
1569  *data << uint8(0);
1570  return;
1571  }
1572  default:
1573  if (type != CHAT_MSG_REPLY && type != CHAT_MSG_IGNORED && type != CHAT_MSG_DND && type != CHAT_MSG_AFK)
1574  target_guid = 0; // only for CHAT_MSG_WHISPER_INFORM used original value target_guid
1575  break;
1576  }
1577 
1578  *data << uint64(target_guid); // there 0 for BG messages
1579  *data << uint32(0); // can be chat msg group or something
1580 
1581  if (type == CHAT_MSG_CHANNEL)
1582  {
1583  ASSERT(channelName);
1584  *data << channelName;
1585  }
1586 
1587  *data << uint64(target_guid);
1588  *data << uint32(messageLength);
1589  *data << message;
1590  if (session != 0 && type != CHAT_MSG_REPLY && type != CHAT_MSG_DND && type != CHAT_MSG_AFK)
1591  *data << uint8(session->GetPlayer()->GetChatTag());
1592  else
1593  *data << uint8(0);
1594 }
1595 
1597 {
1598  if (!m_session)
1599  return NULL;
1600 
1601  uint64 guid = m_session->GetPlayer()->GetSelection();
1602 
1603  if (guid == 0)
1604  return m_session->GetPlayer();
1605 
1606  return sObjectMgr.GetPlayer(guid);
1607 }
1608 
1610 {
1611  if (!m_session)
1612  return NULL;
1613 
1614  uint64 selected = m_session->GetPlayer()->GetTarget();
1615  if (!selected)
1616  return m_session->GetPlayer();
1617 
1618  // first try with selected target
1619  Player* targetPlayer = ObjectAccessor::FindPlayer(selected);
1620  // if the target is not a player, then return self
1621  if (!targetPlayer)
1622  targetPlayer = m_session->GetPlayer();
1623 
1624  return targetPlayer;
1625 }
1626 
1628 {
1629  if (!m_session)
1630  return NULL;
1631 
1632  uint64 guid = m_session->GetPlayer()->GetSelection();
1633 
1634  if (guid == 0)
1635  return m_session->GetPlayer();
1636 
1637  return ObjectAccessor::GetUnit(*m_session->GetPlayer(), guid);
1638 }
1639 
1641 {
1642  if (!m_session)
1643  return NULL;
1644 
1646 }
1647 
1648 char* ChatHandler::extractKeyFromLink(char* text, char const* linkType, char** something1)
1649 {
1650  // skip empty
1651  if (!text)
1652  return NULL;
1653 
1654  // skip spaces
1655  while (*text == ' ' || *text == '\t' || *text == '\b')
1656  ++text;
1657 
1658  if (!*text)
1659  return NULL;
1660 
1661  // return non link case
1662  if (text[0] != '|')
1663  return strtok(text, " ");
1664 
1665  // [name] Shift-click form |color|linkType:key|h[name]|h|r
1666  // or
1667  // [name] Shift-click form |color|linkType:key:something1:...:somethingN|h[name]|h|r
1668 
1669  char* check = strtok(text, "|"); // skip color
1670  if (!check)
1671  return NULL; // end of data
1672 
1673  char* cLinkType = strtok(NULL, ":"); // linktype
1674  if (!cLinkType)
1675  return NULL; // end of data
1676 
1677  if (strcmp(cLinkType, linkType) != 0)
1678  {
1679  strtok(NULL, " "); // skip link tail (to allow continue strtok(NULL,s) use after retturn from function
1681  return NULL;
1682  }
1683 
1684  char* cKeys = strtok(NULL, "|"); // extract keys and values
1685  char* cKeysTail = strtok(NULL, "");
1686 
1687  char* cKey = strtok(cKeys, ":|"); // extract key
1688  if (something1)
1689  *something1 = strtok(NULL, ":|"); // extract something
1690 
1691  strtok(cKeysTail, "]"); // restart scan tail and skip name with possible spaces
1692  strtok(NULL, " "); // skip link tail (to allow continue strtok(NULL,s) use after return from function
1693  return cKey;
1694 }
1695 
1696 char* ChatHandler::extractKeyFromLink(char* text, char const* const* linkTypes, int* found_idx, char** something1)
1697 {
1698  // skip empty
1699  if (!text)
1700  return NULL;
1701 
1702  // skip spaces
1703  while (*text == ' ' || *text == '\t' || *text == '\b')
1704  ++text;
1705 
1706  if (!*text)
1707  return NULL;
1708 
1709  // return non link case
1710  if (text[0] != '|')
1711  return strtok(text, " ");
1712 
1713  // [name] Shift-click form |color|linkType:key|h[name]|h|r
1714  // or
1715  // [name] Shift-click form |color|linkType:key:something1:...:somethingN|h[name]|h|r
1716 
1717  char* check = strtok(text, "|"); // skip color
1718  if (!check)
1719  return NULL; // end of data
1720 
1721  char* cLinkType = strtok(NULL, ":"); // linktype
1722  if (!cLinkType)
1723  return NULL; // end of data
1724 
1725  for (int i = 0; linkTypes[i]; ++i)
1726  {
1727  if (strcmp(cLinkType, linkTypes[i]) == 0)
1728  {
1729  char* cKeys = strtok(NULL, "|"); // extract keys and values
1730  char* cKeysTail = strtok(NULL, "");
1731 
1732  char* cKey = strtok(cKeys, ":|"); // extract key
1733  if (something1)
1734  *something1 = strtok(NULL, ":|"); // extract something
1735 
1736  strtok(cKeysTail, "]"); // restart scan tail and skip name with possible spaces
1737  strtok(NULL, " "); // skip link tail (to allow continue strtok(NULL,s) use after return from function
1738  if (found_idx)
1739  *found_idx = i;
1740  return cKey;
1741  }
1742  }
1743 
1744  strtok(NULL, " "); // skip link tail (to allow continue strtok(NULL,s) use after return from function
1746  return NULL;
1747 }
1748 
1749 char const* fmtstring(char const* format, ...)
1750 {
1751  va_list argptr;
1752 #define MAX_FMT_STRING 32000
1753  static char temp_buffer[MAX_FMT_STRING];
1754  static char string[MAX_FMT_STRING];
1755  static int index = 0;
1756  char* buf;
1757  int len;
1758 
1759  va_start(argptr, format);
1760  vsnprintf(temp_buffer, MAX_FMT_STRING, format, argptr);
1761  va_end(argptr);
1762 
1763  len = strlen(temp_buffer);
1764 
1765  if (len >= MAX_FMT_STRING)
1766  return "ERROR";
1767 
1768  if (len + index >= MAX_FMT_STRING - 1)
1769  index = 0;
1770 
1771  buf = &string[index];
1772  memcpy(buf, temp_buffer, len + 1);
1773 
1774  index += len + 1;
1775 
1776  return buf;
1777 }
1778 
1780 {
1781  if (!m_session)
1782  return NULL;
1783 
1784  Player* pl = m_session->GetPlayer();
1785 
1786  GameObject* obj = pl->GetMap()->GetGameObject(MAKE_NEW_GUID(lowguid, entry, HIGHGUID_GAMEOBJECT));
1787 
1788  if (!obj && sObjectMgr.GetGOData(lowguid)) // guid is DB guid of object
1789  {
1790  // search near player then
1792  Cell cell(p);
1793 
1794  Oregon::GameObjectWithDbGUIDCheck go_check(*pl, lowguid);
1796 
1798  cell.Visit(p, object_checker, *pl->GetMap(), *pl, pl->GetGridActivationRange());
1799  }
1800 
1801  return obj;
1802 }
1803 
1804 static char const* const spellTalentKeys[] =
1805 {
1806  "Hspell",
1807  "Htalent",
1808  0
1809 };
1810 
1812 {
1813  // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r
1814  // number or [name] Shift-click form |color|Htalent:talent_id,rank|h[name]|h|r
1815  int type = 0;
1816  char* rankS = NULL;
1817  char* idS = extractKeyFromLink(text, spellTalentKeys, &type, &rankS);
1818  if (!idS)
1819  return 0;
1820 
1821  uint32 id = (uint32)atol(idS);
1822 
1823  // spell
1824  if (type == 0)
1825  return id;
1826 
1827  // talent
1828  TalentEntry const* talentEntry = sTalentStore.LookupEntry(id);
1829  if (!talentEntry)
1830  return 0;
1831 
1832  int32 rank = rankS ? (uint32)atol(rankS) : 0;
1833  if (rank >= 5)
1834  return 0;
1835 
1836  if (rank < 0)
1837  rank = 0;
1838 
1839  return talentEntry->RankID[rank];
1840 }
1841 
1843 {
1844  // id, or string, or [name] Shift-click form |color|Htele:id|h[name]|h|r
1845  char* cId = extractKeyFromLink(text, "Htele");
1846  if (!cId)
1847  return NULL;
1848 
1849  // id case (explicit or from shift link)
1850  if (cId[0] >= '0' || cId[0] >= '9')
1851  if (uint32 id = atoi(cId))
1852  return sObjectMgr.GetGameTele(id);
1853 
1854  return sObjectMgr.GetGameTele(cId);
1855 }
1856 
1858 {
1859  if (!args || !*args)
1860  return NULL;
1861 
1862  if (*args == '"')
1863  return strtok(args + 1, "\"");
1864  else
1865  {
1866  char* space = strtok(args, "\"");
1867  if (!space)
1868  return NULL;
1869  return strtok(NULL, "\"");
1870  }
1871 }
1872 
1873 const char* ChatHandler::GetName() const
1874 {
1875  return m_session->GetPlayer()->GetName();
1876 }
1877 
1879 {
1880  Player* pl = m_session->GetPlayer();
1881  return pl != chr && pl->IsVisibleGloballyFor(chr);
1882 }
1883 
1884 const char* CliHandler::GetOregonString(int32 entry) const
1885 {
1886  return sObjectMgr.GetOregonStringForDBCLocale(entry);
1887 }
1888 
1889 bool CliHandler::isAvailable(ChatCommand const& cmd) const
1890 {
1891  // skip non-console commands in console case
1892  return cmd.AllowConsole;
1893 }
1894 
1895 void CliHandler::SendSysMessage(const char* str)
1896 {
1897  m_print(m_callbackArg, str);
1898  m_print(m_callbackArg, "\n");
1899 }
1900 
1901 const char* CliHandler::GetName() const
1902 {
1904 }
1905 
1907 {
1908  return true;
1909 }
1910 
1911 bool ChatHandler::GetPlayerGroupAndGUIDByName(const char* cname, Player*& plr, Group*& group, uint64& guid, bool offline)
1912 {
1913  plr = NULL;
1914  guid = 0;
1915 
1916  if (cname)
1917  {
1918  std::string name = cname;
1919  if (!name.empty())
1920  {
1921  if (!normalizePlayerName(name))
1922  {
1924  SetSentErrorMessage(true);
1925  return false;
1926  }
1927 
1928  plr = sObjectMgr.GetPlayer(name.c_str());
1929  if (offline)
1930  guid = sObjectMgr.GetPlayerGUIDByName(name.c_str());
1931  }
1932  }
1933 
1934  if (plr)
1935  {
1936  group = plr->GetGroup();
1937  if (!guid || !offline)
1938  guid = plr->GetGUID();
1939  }
1940  else
1941  {
1942  if (getSelectedPlayer())
1943  plr = getSelectedPlayer();
1944  else
1945  plr = m_session->GetPlayer();
1946 
1947  if (!guid || !offline)
1948  guid = plr->GetGUID();
1949  group = plr->GetGroup();
1950  }
1951 
1952  return true;
1953 }
1954 
bool HandleCharacterRenameCommand(const char *args)
Definition: Level2.cpp:3019
bool HandleCoolDownCheatCommand(const char *args)
Definition: Level3.cpp:4547
float GetGridActivationRange() const
Definition: Object.cpp:1531
bool HandleNpcSayCommand(const char *args)
Definition: Level1.cpp:41
bool HandleUnBanAccountCommand(const char *args)
Definition: Level3.cpp:5906
bool HandleGetValue(const char *args)
Definition: Level3.cpp:4942
bool HandleDebugInArcCommand(const char *args)
Definition: Debugcmds.cpp:38
bool HandleAnimCommand(const char *args)
Definition: Level2.cpp:3161
bool HandleUnAuraCommand(const char *args)
Definition: Level3.cpp:4227
bool HandleReloadAllScriptsCommand(const char *args)
Definition: Level3.cpp:524
bool HandleLearnAllMyClassCommand(const char *args)
Definition: Level3.cpp:2265
bool HandleCastTargetCommand(const char *args)
Definition: Level3.cpp:6853
bool HandleMaxSkillCommand(const char *args)
Definition: Level3.cpp:1442
Group * GetGroup()
Definition: Player.h:2577
bool GetPlayerGroupAndGUIDByName(const char *cname, Player *&plr, Group *&group, uint64 &guid, bool offline=false)
Definition: Chat.cpp:1911
bool HandleCooldownCommand(const char *args)
Definition: Level3.cpp:1562
bool HandleBanCharacterCommand(const char *args)
Definition: Level3.cpp:5823
bool HandleWpLoadPathCommand(const char *args)
Definition: Level2.cpp:2162
void SetSentErrorMessage(bool val)
Definition: Chat.h:593
bool HandleReloadAreaTriggerTeleportCommand(const char *args)
Definition: Level3.cpp:597
bool HandleGMTicketListCommand(const char *args)
Definition: Level1.cpp:295
bool HandleModifySpellCommand(const char *args)
Definition: Level1.cpp:1379
bool HandleEventActiveListCommand(const char *args)
Definition: Level2.cpp:3284
GameObject * GetObjectGlobalyWithGuidOrNearWithDbGuid(uint32 lowguid, uint32 entry)
Definition: Chat.cpp:1779
bool HandleNpcSpawnDistCommand(const char *args)
Definition: Level2.cpp:1459
DBCStorage< SkillLineEntry > sSkillLineStore(SkillLinefmt)
void SendGlobalGMSysMessage(const char *str)
Definition: Chat.cpp:825
bool HandleFreezeCommand(const char *args)
Definition: Level3.cpp:7537
bool HandleListCreatureCommand(const char *args)
Definition: Level3.cpp:3042
bool HandleUnmuteCommand(const char *args)
Definition: Level2.cpp:134
void SendSysMessage(const char *str)
Definition: Chat.cpp:1895
bool hasStringAbbr(const char *name, const char *part)
Definition: Chat.cpp:764
bool HandleRAFSummonCommand(const char *args)
Definition: Level0.cpp:274
bool HandleLookupEventCommand(const char *args)
Definition: Level2.cpp:3229
bool HandleLookupPlayerIpCommand(const char *args)
Definition: Level2.cpp:3598
bool HandleGOPhaseCommand(const char *args)
Definition: Level2.cpp:4414
bool HandleUnBanCharacterCommand(const char *args)
Definition: Level3.cpp:5911
std::string GetTitle() const
Definition: QuestDef.h:285
bool HandleSendItemsCommand(const char *args)
Definition: Level3.cpp:7166
bool HandleLookupSkillCommand(const char *args)
Definition: Level3.cpp:3267
bool HandleResetAllCommand(const char *args)
Definition: Level3.cpp:5439
bool HandleNpcFlagCommand(const char *args)
Definition: Level2.cpp:1119
Creature * getSelectedCreature()
Definition: Chat.cpp:1640
bool HandleCasttimeCheatCommand(const char *args)
Definition: Level3.cpp:4521
const char * Name
Definition: Chat.h:34
bool HandleTitlesCurrentCommand(const char *args)
Definition: Level2.cpp:4280
bool HandleGMTicketCommentCommand(const char *args)
Definition: Level1.cpp:600
bool HandleLoadPDumpCommand(const char *args)
Definition: Level3.cpp:6351
bool HandleReloadSpellThreatsCommand(const char *args)
Definition: Level3.cpp:937
bool HandleAddTeleCommand(const char *args)
Definition: Level3.cpp:5059
bool HandleNpcAddCommand(const char *args)
Definition: Level2.cpp:954
bool HandleReloadConditions(const char *args)
Definition: Level3.cpp:1213
Map * GetMap() const
Definition: Object.h:841
virtual bool isAvailable(ChatCommand const &cmd) const
Definition: Chat.cpp:758
bool HandleReloadCommand(const char *args)
Definition: Level3.cpp:458
DatabaseType WorldDatabase
Accessor to the world database.
Definition: Main.cpp:53
static bool load_command_table
Definition: Chat.h:601
static char * LineFromMessage(char *&pos)
Definition: Chat.h:61
bool HandleSummonCommand(const char *args)
Definition: Level1.cpp:812
bool HandleGuildInviteCommand(const char *args)
Definition: Level3.cpp:3796
bool HandleReloadSpellGroupStackRulesCommand(const char *args)
Definition: Level3.cpp:897
bool HandleRAFInfoCommand(const char *args)
Definition: Level2.cpp:4321
bool HandleGMChatCommand(const char *args)
Definition: Level1.cpp:252
bool HandleGMmodeCommand(const char *args)
Definition: Level1.cpp:210
Unit * getSelectedUnit()
Definition: Chat.cpp:1627
bool HandleBuyErrorCommand(const char *args)
Definition: Debugcmds.cpp:118
bool HandlePartyResultCommand(const char *args)
Definition: Debugcmds.cpp:759
bool HandleActivateObjectCommand(const char *args)
Definition: Level2.cpp:3895
std::vector< std::string > Name
bool HandleReloadReputationSpilloverTemplateCommand(const char *args)
Definition: Level3.cpp:841
bool HandleUpdateHonorFieldsCommand(const char *args)
Definition: Level2.cpp:3215
bool HandleSetValue(const char *args)
Development Commands.
Definition: Level3.cpp:4891
bool HandleModifyFactionCommand(const char *args)
Definition: Level1.cpp:1301
bool ShowHelpForCommand(ChatCommand *table, const char *cmd)
Definition: Chat.cpp:1460
bool HandlePetLearnCommand(const char *args)
Definition: Level2.cpp:3804
bool HandleRespawnCommand(const char *args)
Definition: Level3.cpp:6288
bool HandleBanInfoCharacterCommand(const char *args)
Definition: Level3.cpp:5991
bool HandleResetHonorCommand(const char *args)
Definition: Level3.cpp:5155
bool HandleHideAreaCommand(const char *args)
Definition: Level3.cpp:4761
bool HandleNpcInfoCommand(const char *args)
Definition: Level3.cpp:4390
bool HandleAddQuest(const char *args)
Definition: Level3.cpp:5622
bool HandleServerCorpsesCommand(const char *args)
Definition: Level2.cpp:3702
Definition: Field.h:24
bool HandleComeToMeCommand(const char *args)
Definition: Level3.cpp:6902
bool HandleReloadSkillDiscoveryTemplateCommand(const char *args)
Definition: Level3.cpp:849
bool HandleReloadConfigCommand(const char *args)
Definition: Level3.cpp:580
bool HandleTitlesSetMaskCommand(const char *args)
Definition: Level2.cpp:4201
bool HandleReloadSkillExtraItemTemplateCommand(const char *args)
Definition: Level3.cpp:857
bool HandleAccountPasswordCommand(const char *args)
Definition: Level0.cpp:189
bool HandleWpEventCommand(const char *args)
Definition: Level2.cpp:2266
bool HandleReloadAutobroadcastCommand(const char *args)
Definition: Level3.cpp:613
bool HandleDebugThreatList(const char *args)
Definition: Debugcmds.cpp:644
bool HandleMovegensCommand(const char *args)
Definition: Level3.cpp:6540
bool HandleNotifyCommand(const char *args)
Definition: Level1.cpp:178
bool HandleAddHonorCommand(const char *args)
Definition: Level2.cpp:3183
bool HandleDebugAnimationCommand(const char *args)
Definition: Debugcmds.cpp:771
bool HandleDamageCommand(const char *args)
Definition: Level3.cpp:4051
bool HandleGMTicketCloseByIdCommand(const char *args)
Definition: Level1.cpp:434
bool HandleModifySwimCommand(const char *args)
Definition: Level1.cpp:1571
bool HandleTurnObjectCommand(const char *args)
Definition: Level2.cpp:653
bool HandleModifyRageCommand(const char *args)
Definition: Level1.cpp:1256
bool HandleMod32Value(const char *args)
Definition: Level3.cpp:5027
bool HandleModifySpeedCommand(const char *args)
Definition: Level1.cpp:1532
ChatCommand * ChildCommands
Definition: Chat.h:39
bool HandleAllowMovementCommand(const char *args)
Definition: Level3.cpp:1427
bool HandleAuraCommand(const char *args)
Definition: Level3.cpp:4191
bool HandleNpcFactionIdCommand(const char *args)
Definition: Level2.cpp:1419
bool HandleReloadSpellTargetPositionCommand(const char *args)
Definition: Level3.cpp:929
bool HandleLookupObjectCommand(const char *args)
Definition: Level3.cpp:3657
bool HandleReloadSpellRequiredCommand(const char *args)
Definition: Level3.cpp:881
bool HandleRAFUnlinkCommand(const char *args)
Definition: Level2.cpp:4372
bool HandleNpcSetPhaseCommand(const char *args)
Definition: Level2.cpp:4384
#define sLog
Log class singleton.
Definition: Log.h:187
char * extractQuotedArg(char *args)
Definition: Chat.cpp:1857
std::vector< std::string > Title
Definition: QuestDef.h:160
bool HandleReloadCommandCommand(const char *args)
Definition: Level3.cpp:621
bool HandleNpcFollowCommand(const char *args)
Definition: Level2.cpp:1531
bool HandleNpcMoveCommand(const char *args)
Definition: Level2.cpp:1183
bool HandleGMListFullCommand(const char *args)
Definition: Level3.cpp:7078
bool HandleKickPlayerCommand(const char *args)
Definition: Level2.cpp:1750
bool HandleNpcSetLinkCommand(const char *args)
Definition: Level2.cpp:3992
ACE_INT32 int32
Definition: Define.h:67
bool HandleLevelUpCommand(const char *args)
Definition: Level3.cpp:4629
bool HandlePInfoCommand(const char *args)
Definition: Level2.cpp:1853
bool HandleLookupPlayerAccountCommand(const char *args)
Definition: Level2.cpp:3615
bool HandleEquipErrorCommand(const char *args)
Definition: Debugcmds.cpp:98
bool HandleGoTicketCommand(const char *args)
Definition: Level2.cpp:205
QueryResult_AutoPtr Query(const char *sql)
Definition: Database.cpp:383
bool HandleGoGraveyardCommand(const char *args)
Definition: Level2.cpp:292
bool HandlePetTpCommand(const char *args)
Definition: Level2.cpp:3872
bool HandleReloadLootTemplatesCreatureCommand(const char *args)
Definition: Level3.cpp:702
bool HandleCastSelfCommand(const char *args)
Definition: Level3.cpp:6928
bool HandleGPSCommand(const char *args)
Definition: Level1.cpp:721
bool HandleGMTicketDeleteByIdCommand(const char *args)
Definition: Level1.cpp:640
bool HandleServerRestartCommand(const char *args)
Definition: Level3.cpp:5517
uint32 SecurityLevel
Definition: Chat.h:35
bool HandleReloadSpellProcEventCommand(const char *args)
Definition: Level3.cpp:921
Player * getSelectedPlayerOrSelf()
Definition: Chat.cpp:1609
void Initialize(uint16 opcode, size_t newres=200)
Definition: WorldPacket.h:37
bool HandleReloadAllCommand(const char *args)
Definition: Level3.cpp:466
bool isAvailable(ChatCommand const &cmd) const
Definition: Chat.cpp:1889
bool HandlePowerCheatCommand(const char *args)
Definition: Level3.cpp:4573
bool HandleGoXYZCommand(const char *args)
Definition: Level1.cpp:2696
virtual void SendSysMessage(const char *str)
Definition: Chat.cpp:790
static Creature * GetCreatureOrPet(WorldObject const &, uint64)
uint32 GetAccountId() const
Definition: WorldSession.h:100
bool HandleNameCommand(const char *args)
Definition: Level2.cpp:1592
bool HandleModifyMoneyCommand(const char *args)
Definition: Level1.cpp:1972
bool HandleLookupSpellCommand(const char *args)
Definition: Level3.cpp:3344
bool HandleReloadLootTemplatesReferenceCommand(const char *args)
Definition: Level3.cpp:782
bool HandleUnLearnCommand(const char *args)
Definition: Level3.cpp:1515
int ParseCommands(const char *text)
Definition: Chat.cpp:938
Player * GetPlayer() const
Definition: WorldSession.h:104
bool HandleListItemCommand(const char *args)
Definition: Level3.cpp:2687
bool HandleGodModeCheatCommand(const char *args)
Definition: Level3.cpp:4495
bool HandleDrunkCommand(const char *args)
Definition: Level1.cpp:2857
bool HandleGoXYCommand(const char *args)
Definition: Level1.cpp:2649
std::string Help
Definition: Chat.h:38
bool HandleWpModifyCommand(const char *args)
Definition: Level2.cpp:2484
bool HandleGuildUninviteCommand(const char *args)
Definition: Level3.cpp:3835
bool HandleReloadAllQuestCommand(const char *args)
Definition: Level3.cpp:513
bool HandleFlushArenaPointsCommand(const char *args)
Definition: Level3.cpp:7443
bool HandleAnnounceCommand(const char *args)
Definition: Level1.cpp:158
bool HandleInstanceUnbindCommand(const char *args)
Definition: Level3.cpp:7011
bool HandleLookupItemSetCommand(const char *args)
Definition: Level3.cpp:3197
bool HandleNpcTextEmoteCommand(const char *args)
Definition: Level1.cpp:96
bool HandleGMTicketUnAssignCommand(const char *args)
Definition: Level1.cpp:549
WorldSession * m_session
Definition: Chat.h:596
bool HandleMorphCommand(const char *args)
Definition: Level2.cpp:1733
bool HandleReloadSpellScriptsCommand(const char *args)
Definition: Level3.cpp:1094
bool HandleServerExitCommand(const char *args)
Definition: Level4.cpp:443
bool HandleRepairitemsCommand(const char *args)
Definition: Level2.cpp:3708
#define sObjectMgr
Definition: ObjectMgr.h:1285
bool HandleMuteCommand(const char *args)
Definition: Level2.cpp:55
void SendPacket(WorldPacket const *packet)
bool HandleCastCommand(const char *args)
Definition: Level3.cpp:6717
bool HandleReloadAllSpellCommand(const char *args)
Definition: Level3.cpp:545
bool HandleGuildCreateCommand(const char *args)
GM command level 3 - Create a guild.
Definition: Level3.cpp:3749
bool HandleGuildDeleteCommand(const char *args)
Definition: Level3.cpp:3921
bool HandleNearObjectCommand(const char *args)
Definition: Level3.cpp:2964
bool HandleDelTeleCommand(const char *args)
Definition: Level3.cpp:5097
DBCStorage< SpellEntry > sSpellStore(SpellEntryfmt)
bool HandleDebugPlayCinematicCommand(const char *args)
Definition: Debugcmds.cpp:236
bool HandleGMTicketReloadCommand(const char *)
Definition: Level1.cpp:677
bool HandleNpcSetMoveTypeCommand(const char *args)
Definition: Level2.cpp:1269
bool HandleResetStatsCommand(const char *args)
Definition: Level3.cpp:5307
bool HandleAccountSetAddonCommand(const char *args)
Definition: Level3.cpp:7113
bool HandleTaxiCheatCommand(const char *args)
Definition: Level1.cpp:1451
bool HandleVisibleCommand(const char *args)
Definition: Level1.cpp:684
bool HandleAccountOnlineListCommand(const char *args)
Definition: Level4.cpp:451
std::string GetString() const
Definition: ObjectGuid.cpp:48
bool HandleBankCommand(const char *args)
Definition: Level3.cpp:4842
bool HandleGroupDisbandCommand(const char *args)
Definition: Level3.cpp:7720
bool HandleReloadItemEnchantementsCommand(const char *args)
Definition: Level3.cpp:961
bool HandleGMAnnounceCommand(const char *args)
Definition: Level1.cpp:168
bool HandleModifyHPCommand(const char *args)
Definition: Level1.cpp:1124
bool HandleSellErrorCommand(const char *args)
Definition: Debugcmds.cpp:108
bool HandleGroupSummonCommand(const char *args)
Definition: Level1.cpp:2553
bool HandleExploreCheatCommand(const char *args)
Definition: Level3.cpp:4437
bool HandleResetTalentsCommand(const char *args)
Definition: Level3.cpp:5392
bool HandleInstanceSaveDataCommand(const char *args)
Definition: Level3.cpp:7054
bool HandleGMNameAnnounceCommand(const char *args)
Definition: Level1.cpp:147
bool HandleHelpCommand(const char *args)
Definition: Level0.cpp:36
bool HandleGMTicketAssignToCommand(const char *args)
Definition: Level1.cpp:480
bool HandleAHBotOptionsCommand(const char *args)
Definition: Level3.cpp:58
bool HandleCharacterDeletedOldCommand(const char *args)
Definition: Level4.cpp:376
bool HandleRAFLinkCommand(const char *args)
Definition: Level2.cpp:4346
bool HandleNpcChangeEntryCommand(const char *args)
Definition: Level3.cpp:6462
bool HandleBanAccountCommand(const char *args)
Definition: Level3.cpp:5818
bool HandleListObjectCommand(const char *args)
Definition: Level3.cpp:2893
bool HandleSendQuestPartyMsgCommand(const char *args)
Definition: Debugcmds.cpp:347
bool HandleDismountCommand(const char *args)
Definition: Level0.cpp:116
bool HandleReloadGameObjectScriptsCommand(const char *args)
Definition: Level3.cpp:969
uint32 Attributes
Definition: DBCStructure.h:679
DBCStorage< TalentEntry > sTalentStore(TalentEntryfmt)
bool HandleReloadCreatureLinkedRespawnCommand(const char *args)
Definition: Level3.cpp:636
#define IS_PLAYER_GUID(Guid)
Definition: ObjectGuid.h:69
bool HandlePlayAllCommand(const char *args)
Definition: Level3.cpp:7515
bool HandleLearnCommand(const char *args)
Definition: Level3.cpp:2474
bool HandleReloadLocalesItemCommand(const char *args)
Definition: Level3.cpp:1171
char * SpellName[16]
Definition: DBCStructure.h:748
bool HandleLookupQuestCommand(const char *args)
Definition: Level3.cpp:3453
bool HandleListFreezeCommand(const char *args)
Definition: Level3.cpp:7682
bool HandleCharacterEraseCommand(const char *args)
Definition: Level4.cpp:398
bool normalizePlayerName(std::string &name)
Definition: ObjectMgr.cpp:225
bool HandleReloadAllItemCommand(const char *args)
Definition: Level3.cpp:562
bool HandleServerShutDownCommand(const char *args)
Definition: Level3.cpp:5482
bool HandleReloadGOQuestStarterCommand(const char *args)
Definition: Level3.cpp:670
bool HandleReloadQuestAreaTriggersCommand(const char *args)
Definition: Level3.cpp:686
bool HandleModifyPhaseCommand(const char *args)
Definition: Level2.cpp:1835
bool HandleAccountLockCommand(const char *args)
Definition: Level0.cpp:240
ACE_UINT8 uint8
Definition: Define.h:73
bool HandleGroupRemoveCommand(const char *args)
Definition: Level3.cpp:7734
bool HandleServerIdleShutDownCommand(const char *args)
Definition: Level3.cpp:5587
bool HandleUpdate(const char *args)
Definition: Level3.cpp:4793
uint64 GetTarget() const
Definition: Unit.h:1590
bool HandleGMTicketGetByIdCommand(const char *args)
Definition: Level1.cpp:357
std::string GetCppString() const
Definition: Field.h:52
bool HandleCharacterTitlesCommand(const char *args)
Definition: Level2.cpp:4238
bool HandleServerSetMotdCommand(const char *args)
Definition: Level3.cpp:7105
bool HandleWaterwalkCheatCommand(const char *args)
Definition: Level3.cpp:4599
bool HandleReloadOregonStringCommand(const char *args)
Definition: Level3.cpp:801
bool HandleReloadAuctionsCommand(const char *args)
Definition: Level3.cpp:1203
bool HandleReloadGossipMenuCommand(const char *args)
Definition: Level3.cpp:644
bool HandleReloadLocalesGameobjectCommand(const char *args)
Definition: Level3.cpp:1163
bool HandleTitlesRemoveCommand(const char *args)
Definition: Level2.cpp:4152
bool HandleUnPossessCommand(const char *args)
Definition: Level3.cpp:7813
bool HandleReloadLootTemplatesMailCommand(const char *args)
Definition: Level3.cpp:772
bool IsVisibleGloballyFor(Player *pl) const
Definition: Player.cpp:18728
const uint8 MAX_LOCALE
Definition: Common.h:224
#define MAX_FMT_STRING
bool HandleSubNameCommand(const char *args)
Definition: Level2.cpp:1639
bool HandleServerPLimitCommand(const char *args)
Definition: Level3.cpp:6656
bool HandleNpcPlayEmoteCommand(const char *args)
Definition: Level3.cpp:4373
bool HandleChangeWeather(const char *args)
Definition: Level3.cpp:4849
void PSendSysMessage(const char *format,...) ATTR_PRINTF(2
Definition: Chat.cpp:858
bool HandleGetLootRecipient(const char *args)
Definition: Debugcmds.cpp:354
bool HandleModifyScaleCommand(const char *args)
Definition: Level1.cpp:1681
bool HandleReloadNpcGossipCommand(const char *args)
Definition: Level3.cpp:809
bool HandleLearnAllCommand(const char *args)
Definition: Level3.cpp:1597
bool HandleLookupFactionCommand(const char *args)
Definition: Level2.cpp:3068
bool HandleNpcYellCommand(const char *args)
Definition: Level1.cpp:74
bool HandleReloadLocalesCreatureCommand(const char *args)
Definition: Level3.cpp:1155
uint32 GetQuestId() const
Definition: QuestDef.h:186
bool HandleRemoveQuest(const char *args)
Definition: Level3.cpp:5676
bool HandleGMTicketListOnlineCommand(const char *args)
Definition: Level1.cpp:315
bool HandleReloadLootTemplatesGameobjectCommand(const char *args)
Definition: Level3.cpp:732
bool HandleModifyMountCommand(const char *args)
Definition: Level1.cpp:1715
bool HandleNearGraveCommand(const char *args)
Definition: Level3.cpp:4307
const AuthHandler table[]
Definition: AuthSocket.cpp:149
bool HandleReloadCreatureQuestStarterCommand(const char *args)
Definition: Level3.cpp:628
bool HandleAppearCommand(const char *args)
Definition: Level1.cpp:927
bool HandleDeMorphCommand(const char *args)
Definition: Level2.cpp:1721
float GetPositionY() const
Definition: Position.h:98
bool HandleBanListAccountCommand(const char *args)
Definition: Level3.cpp:6105
bool HandleSaveCommand(const char *args)
Definition: Level0.cpp:138
bool sentErrorMessage
Definition: Chat.h:602
bool HandleReloadAreaTriggerTavernCommand(const char *args)
Definition: Level3.cpp:589
bool HandleGMListIngameCommand(const char *args)
Definition: Level0.cpp:161
bool HandleReloadGameGraveyardZoneCommand(const char *args)
Definition: Level3.cpp:1122
bool HandleCharacterDeletedListCommand(const char *args)
Definition: Level4.cpp:210
bool HandleReloadSpellGroupsCommand(const char *args)
Definition: Level3.cpp:889
bool HandleReloadEventAISummonsCommand(const char *args)
Definition: Level3.cpp:1018
#define MAKE_NEW_GUID(l, e, h)
Definition: ObjectGuid.h:80
uint8 GetChatTag() const
Definition: Player.cpp:1474
bool HandleLookupItemCommand(const char *args)
Definition: Level3.cpp:3112
bool HandleNpcSpawnTimeCommand(const char *args)
Definition: Level2.cpp:1497
bool HandleStandStateCommand(const char *args)
Definition: Level2.cpp:3172
static Player * FindPlayer(uint64, bool force=false)
bool HandleReloadLootTemplatesProspectingCommand(const char *args)
Definition: Level3.cpp:762
#define sSpellMgr
Definition: SpellMgr.h:1239
bool HandleListAurasCommand(const char *args)
Definition: Level3.cpp:5115
bool HandleLookupTeleCommand(const char *args)
Definition: Level1.cpp:2221
bool HandleBanInfoIPCommand(const char *args)
Definition: Level3.cpp:6054
bool HandleGetItemState(const char *args)
Definition: Debugcmds.cpp:371
float GetPositionZ() const
Definition: Position.h:99
bool HandleSetInstanceDataCommand(const char *args)
Definition: Debugcmds.cpp:687
bool HandleModifyRepCommand(const char *args)
Definition: Level2.cpp:857
bool HandleHoverCommand(const char *args)
Definition: Level3.cpp:4476
bool HandleModifyBWalkCommand(const char *args)
Definition: Level1.cpp:1610
const uint64 & GetSelection() const
Definition: Player.h:1553
bool HandleModifyGenderCommand(const char *args)
Definition: Level3.cpp:7449
bool HandleServerIdleRestartCommand(const char *args)
Definition: Level3.cpp:5552
bool HandleInstanceStatsCommand(const char *args)
Definition: Level3.cpp:7044
bool HandleReloadLootTemplatesItemCommand(const char *args)
Definition: Level3.cpp:742
char const * fmtstring(char const *format,...)
Definition: Chat.cpp:1749
bool HandleReloadEventAITextsCommand(const char *args)
Definition: Level3.cpp:1009
bool HandleGroupLeaderCommand(const char *args)
Definition: Level3.cpp:7706
bool HandleInstanceListBindsCommand(const char *args)
Definition: Level3.cpp:6973
bool HandleWpUnLoadPathCommand(const char *args)
Definition: Level2.cpp:2236
bool HandleGUIDCommand(const char *args)
Definition: Level2.cpp:842
bool HandleDebugPlaySoundCommand(const char *args)
Definition: Debugcmds.cpp:278
bool HandleGMNotifyCommand(const char *args)
Definition: Level1.cpp:194
bool ExecuteCommandInTable(ChatCommand *table, const char *text, const std::string &fullcommand)
Definition: Chat.cpp:868
uint32 GetMapId() const
Definition: Object.h:591
bool HandleGMTicketGetByNameCommand(const char *args)
Definition: Level1.cpp:396
bool HandleServerMotdCommand(const char *args)
Definition: Level0.cpp:268
uint32 extractSpellIdFromLink(char *text)
Definition: Chat.cpp:1811
bool HandleSetPoiCommand(const char *args)
Definition: Debugcmds.cpp:72
bool HandleAccountDeleteCommand(const char *args)
Definition: Level4.cpp:18
void FillSystemMessageData(WorldPacket *data, const char *message)
Definition: Chat.h:56
bool HandleServerInfoCommand(const char *args)
Definition: Level0.cpp:89
bool HandleEventStartCommand(const char *args)
Definition: Level2.cpp:3361
bool HandleLookupTitleCommand(const char *args)
Definition: Level2.cpp:4026
bool HandleModifyEnergyCommand(const char *args)
Definition: Level1.cpp:1209
const char * GetOregonString(int32 entry) const
bool HandleSendQuestInvalidMsgCommand(const char *args)
Definition: Debugcmds.cpp:364
bool HandleUnbindSightCommand(const char *args)
Definition: Level3.cpp:7836
bool HandleReloadGossipMenuOptionCommand(const char *args)
Definition: Level3.cpp:653
bool HandleLookupAreaCommand(const char *args)
Definition: Level1.cpp:2145
bool HandleGoGridCommand(const char *args)
Definition: Level1.cpp:2810
bool HandleLearnAllCraftsCommand(const char *args)
Definition: Level2.cpp:3481
bool HandleSpellCrashTestCommand(const char *args)
Definition: Debugcmds.cpp:737
CellCoord ComputeCellCoord(float x, float y)
Definition: GridDefines.h:167
bool HandleReloadWpScriptsCommand(const char *args)
Definition: Level3.cpp:1034
bool HandleLearnAllMySpellsCommand(const char *args)
Definition: Level3.cpp:2272
bool HandleCharacterDeletedDeleteCommand(const char *args)
Definition: Level4.cpp:339
bool HandleResetSpellsCommand(const char *args)
Definition: Level3.cpp:5344
bool HandleReloadLocalesPageTextCommand(const char *args)
Definition: Level3.cpp:1187
bool HandleBanIPCommand(const char *args)
Definition: Level3.cpp:5828
bool HandleGetInstanceDataCommand(const char *args)
Definition: Debugcmds.cpp:713
static ChatCommand * getCommandTable()
Definition: Chat.cpp:38
bool HandleItemMoveCommand(const char *args)
Definition: Level2.cpp:1686
bool HandleReloadAllLocalesCommand(const char *args)
Definition: Level3.cpp:569
bool HandleReloadPageTextsCommand(const char *args)
Definition: Level3.cpp:953
const char * GetName() const
Definition: Object.h:704
bool HandleLearnAllDefaultCommand(const char *args)
Definition: Level3.cpp:2440
bool HandleAddWeaponCommand(const char *args)
Definition: Level3.cpp:3960
Player * getSelectedPlayer()
Definition: Chat.cpp:1596
bool HandleDebugRAFError(const char *args)
Definition: Level3.cpp:5015
bool HandleUnFreezeCommand(const char *args)
Definition: Level3.cpp:7618
ACE_UINT64 uint64
Definition: Define.h:70
Definition: Cell.h:46
bool HandleReloadSpellLinkedSpellCommand(const char *args)
Definition: Level3.cpp:913
bool HandleGMTicketListClosedCommand(const char *args)
Definition: Level1.cpp:336
bool HandleReloadNpcTrainerCommand(const char *args)
Definition: Level3.cpp:817
bool HandleReloadLootTemplatesDisenchantCommand(const char *args)
Definition: Level3.cpp:712
bool HandleNameAnnounceCommand(const char *args)
Definition: Level1.cpp:137
bool HandleLearnAllLangCommand(const char *args)
Definition: Level3.cpp:2430
bool HandleDebugArenaCommand(const char *args)
Definition: Debugcmds.cpp:638
bool HandleWpShowCommand(const char *args)
Definition: Level2.cpp:2676
bool HandleGoCreatureCommand(const char *args)
Teleport the GM to the specified creature.
Definition: Level2.cpp:348
bool HandleLinkGraveCommand(const char *args)
Definition: Level3.cpp:4254
bool HandleReloadEventScriptsCommand(const char *args)
Definition: Level3.cpp:989
bool HandleReloadCreatureQuestEnderCommand(const char *args)
Definition: Level3.cpp:662
bool HandleTempGameObjectCommand(const char *args)
Definition: Level2.cpp:3954
bool HandleModifyASpeedCommand(const char *args)
Definition: Level1.cpp:1489
bool HandleSendChannelNotifyCommand(const char *args)
Definition: Debugcmds.cpp:316
bool HandleReloadAccessRequirementCommand(const char *args)
Definition: Level3.cpp:605
bool HandleWritePDumpCommand(const char *args)
Definition: Level3.cpp:6486
bool HandleRAFReloadCommand(const char *args)
Definition: Level3.cpp:451
bool HandleReloadAllLootCommand(const char *args)
Definition: Level3.cpp:496
bool HandleGroupJoinCommand(const char *args)
Definition: Level3.cpp:7748
bool HandleTitlesAddCommand(const char *args)
Definition: Level2.cpp:4109
uint32 RankID[5]
Definition: DBCStructure.h:934
bool HandleFlyModeCommand(const char *args)
Definition: Level3.cpp:6325
bool HandleGuildRankCommand(const char *args)
Definition: Level3.cpp:3876
bool HandleReloadLocalesQuestCommand(const char *args)
Definition: Level3.cpp:1195
bool HandleDebugSpellFailCommand(const char *args)
Definition: Debugcmds.cpp:53
bool HandleSetSkillCommand(const char *args)
Definition: Level3.cpp:1457
bool HandleCastDistCommand(const char *args)
Definition: Level3.cpp:6804
virtual const char * GetOregonString(int32 entry) const
Definition: Chat.cpp:753
bool HandleUpdateWorldStateCommand(const char *args)
Definition: Debugcmds.cpp:222
bool HandleRAFGrantLevelCommand(const char *args)
Definition: Level0.cpp:283
ACE_Refcounted_Auto_Ptr< QueryResult, ACE_Null_Mutex > QueryResult_AutoPtr
Definition: QueryResult.h:113
bool HandleCompleteQuest(const char *args)
Definition: Level3.cpp:5726
bool HandleSendOpcodeCommand(const char *args)
Definition: Debugcmds.cpp:128
bool HandleUnBanIPCommand(const char *args)
Definition: Level3.cpp:5916
bool HandleSendMailCommand(const char *args)
Definition: Level1.cpp:2319
bool HandleLearnAllMyTalentsCommand(const char *args)
Definition: Level3.cpp:2383
bool HandleLookupPlayerEmailCommand(const char *args)
Definition: Level2.cpp:3634
bool HandleSendMoneyCommand(const char *args)
Definition: Level3.cpp:7313
bool HandleCastBackCommand(const char *args)
Definition: Level3.cpp:6766
bool HandleGoObjectCommand(const char *args)
Definition: Level2.cpp:439
bool HandleStartCommand(const char *args)
Definition: Level0.cpp:66
bool HandleTargetObjectCommand(const char *args)
Definition: Level2.cpp:495
bool HandleReloadEventAIScriptsCommand(const char *args)
Definition: Level3.cpp:1026
bool HandleAccountSetPasswordCommand(const char *args)
Definition: Level3.cpp:1353
bool HandleDelVendorItemCommand(const char *args)
Definition: Level2.cpp:1048
bool HandleReloadDisablesCommand(const char *args)
Definition: Level3.cpp:1144
bool HandleRecallCommand(const char *args)
Definition: Level1.cpp:1076
bool HandleSendMessageCommand(const char *args)
Definition: Level3.cpp:7403
bool HandleTeleCommand(const char *args)
Definition: Level1.cpp:2096
bool HandleServerShutDownCancelCommand(const char *args)
Definition: Level3.cpp:5476
bool HandleWpAddCommand(const char *args)
Definition: Level2.cpp:2105
bool HandleResetLevelCommand(const char *args)
Definition: Level3.cpp:5260
bool HandleGoZoneXYCommand(const char *args)
Definition: Level1.cpp:2743
bool HandleReloadGOQuestEnderCommand(const char *args)
Definition: Level3.cpp:678
const uint32 ItemQualityColors[MAX_ITEM_QUALITY]
bool HandleNameTeleCommand(const char *args)
Definition: Level1.cpp:2403
bool HandleReloadQuestEndScriptsCommand(const char *args)
Definition: Level3.cpp:1054
bool HandleNpcWhisperCommand(const char *args)
Definition: Level1.cpp:116
bool HandleAddVendorItemCommand(const char *args)
Definition: Level2.cpp:1001
bool HandleReloadQuestStartScriptsCommand(const char *args)
Definition: Level3.cpp:1074
bool needReportToTarget(Player *chr) const
Definition: Chat.cpp:1906
bool HandleDieCommand(const char *args)
Definition: Level3.cpp:4029
bool HandleMoveObjectCommand(const char *args)
Definition: Level2.cpp:702
#define ASSERT
Definition: Errors.h:29
bool HandleReloadGameTeleCommand(const char *args)
Definition: Level3.cpp:1133
bool HandleChangeLevelCommand(const char *args)
Definition: Level2.cpp:1084
bool HandleGroupTeleCommand(const char *args)
Definition: Level1.cpp:2482
bool HandleGameObjectCommand(const char *args)
Definition: Level2.cpp:775
bool HandleAddItemCommand(const char *args)
Definition: Level3.cpp:2513
bool HandleServerSetLogMaskCommand(const char *args)
Definition: Level4.cpp:538
bool HandleReviveCommand(const char *args)
Definition: Level3.cpp:4148
static Unit * GetUnit(WorldObject const &, uint64 guid)
bool HandleReloadSkillFishingBaseLevelCommand(const char *args)
Definition: Level3.cpp:865
bool HandleDebugBattlegroundCommand(const char *args)
Definition: Debugcmds.cpp:632
bool HandleShowAreaCommand(const char *args)
Definition: Level3.cpp:4729
bool HandleBanListIPCommand(const char *args)
Definition: Level3.cpp:6213
bool HandleAccountCommand(const char *args)
Definition: Level0.cpp:59
bool HandleGoTriggerCommand(const char *args)
Definition: Level2.cpp:247
#define sWorld
Definition: World.h:860
bool HandlePetUnlearnCommand(const char *args)
Definition: Level2.cpp:3847
bool HandleBanInfoAccountCommand(const char *args)
Definition: Level3.cpp:5964
bool HandleReloadReservedNameCommand(const char *)
Definition: Level3.cpp:833
bool HandleLookupCreatureCommand(const char *args)
Definition: Level3.cpp:3573
bool HandleTempAddSpwCommand(const char *args)
Definition: Level2.cpp:3931
void uint32 GetSecurity() const
Definition: WorldSession.h:96
bool HandleEventStopCommand(const char *args)
Definition: Level2.cpp:3402
bool HandleLearnAllGMCommand(const char *args)
Definition: Level3.cpp:2226
ACE_UINT16 uint16
Definition: Define.h:72
bool HandleReloadLootTemplatesPickpocketingCommand(const char *args)
Definition: Level3.cpp:752
bool HandleModifyHonorCommand(const char *args)
Definition: Level1.cpp:2074
bool HandleReloadSpellAffectCommand(const char *args)
Definition: Level3.cpp:873
ACE_UINT32 uint32
Definition: Define.h:71
bool HandleEventInfoCommand(const char *args)
Definition: Level2.cpp:3312
float GetPositionX() const
Definition: Position.h:97
bool HandleReloadLootTemplatesFishingCommand(const char *args)
Definition: Level3.cpp:722
bool HandleReloadSpellPetAurasCommand(const char *args)
Definition: Level3.cpp:945
bool HandleSaveAllCommand(const char *args)
Definition: Level1.cpp:2311
bool HandleModifyFlyCommand(const char *args)
Definition: Level1.cpp:1649
GameObject * GetGameObject(uint64 guid)
Definition: Map.cpp:2636
bool HandleReloadSpellLearnSpellCommand(const char *args)
Definition: Level3.cpp:905
bool HandleModifyTalentCommand(const char *args)
Definition: Level1.cpp:1429
bool ShowHelpForSubCommands(ChatCommand *table, char const *cmd, char const *subcmd)
Definition: Chat.cpp:1422
Definition: Unit.h:908
char * extractKeyFromLink(char *text, char const *linkType, char **something1=NULL)
Definition: Chat.cpp:1648
bool HandleCreatePetCommand(const char *args)
Definition: Level2.cpp:3728
bool HandlePossessCommand(const char *args)
Definition: Level3.cpp:7803
bool HandleBanListCharacterCommand(const char *args)
Definition: Level3.cpp:6085
virtual bool needReportToTarget(Player *chr) const
Definition: Chat.cpp:1878
bool HandleAccountCreateCommand(const char *args)
Definition: Level4.cpp:495
bool HandleWhispersCommand(const char *args)
Definition: Level1.cpp:2280
bool HandleSendChatMsgCommand(const char *args)
Definition: Debugcmds.cpp:334
bool isValidChatMessage(const char *msg)
Definition: Chat.cpp:974
Definition: Player.h:922
bool HandleNpcDeleteCommand(const char *args)
Definition: Level2.cpp:1144
bool HandleDelObjectCommand(const char *args)
Definition: Level2.cpp:605
bool HandleCharacterDeletedRestoreCommand(const char *args)
Definition: Level4.cpp:274
char const * GetName() const
Definition: Chat.cpp:1901
bool HandleCommandsCommand(const char *args)
Definition: Level0.cpp:53
void Visit(CellCoord const &, TypeContainerVisitor< T, CONTAINER > &visitor, Map &, WorldObject const &, float) const
Definition: CellImpl.h:121
bool HandleModifyBitCommand(const char *args)
Definition: Level1.cpp:2024
bool AllowConsole
Definition: Chat.h:36
bool HandleReloadLootTemplatesSkinningCommand(const char *args)
Definition: Level3.cpp:791
bool HandleModifyArenaCommand(const char *args)
Definition: Level3.cpp:4126
bool HandleGetDistanceCommand(const char *args)
Definition: Level3.cpp:3942
bool HandleReloadAllNpcCommand(const char *args)
Definition: Level3.cpp:505
const char * GetOregonString(int32 entry) const
Definition: Chat.cpp:1884
#define vsnprintf
Definition: Common.h:131
bool HandleHonorAddKillCommand(const char *args)
Definition: Level2.cpp:3201
bool HandleNpcUnFollowCommand(const char *args)
Definition: Level2.cpp:1553
bool HandleBindSightCommand(const char *args)
Definition: Level3.cpp:7826
bool HandleModifyManaCommand(const char *args)
Definition: Level1.cpp:1165
Definition: Group.h:154
static void FillMessageData(WorldPacket *data, WorldSession *session, uint8 type, uint32 language, const char *channelName, uint64 target_guid, const char *message, Unit *speaker)
Definition: Chat.cpp:1518
bool HandleAccountSetGmLevelCommand(const char *args)
Definition: Level3.cpp:1221
bool HandleReloadAllPaths(const char *args)
Definition: Level2.cpp:2221
virtual char const * GetName() const
Definition: Chat.cpp:1873
#define atol(a)
Definition: Common.h:162
void SendGlobalSysMessage(const char *str)
Definition: Chat.cpp:807
GameTele const * extractGameTeleFromLink(char *text)
Definition: Chat.cpp:1842
bool HandleReloadQuestTemplateCommand(const char *args)
Definition: Level3.cpp:694
bool HandleLearnAllRecipesCommand(const char *args)
Definition: Level2.cpp:3523
bool HandleAddItemSetCommand(const char *args)
Definition: Level3.cpp:2618
const uint64 & GetGUID() const
Definition: Object.h:162
bool HandleCombatStopCommand(const char *args)
Definition: Level2.cpp:3444
bool HandleNpcSetModelCommand(const char *args)
Definition: Level2.cpp:1394
bool HandleServerSetDiffTimeCommand(const char *args)
Definition: Level4.cpp:567
char * name[16]
Definition: DBCStructure.h:634
bool HandleReloadNpcVendorCommand(const char *args)
Definition: Level3.cpp:825
bool HandleReloadLocalesNpcTextCommand(const char *args)
Definition: Level3.cpp:1179