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