aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2009-04-05 16:43:17 -0500
committermegamage <none@none>2009-04-05 16:43:17 -0500
commit274759b04aee651582fe8e54eaa23f7498179f25 (patch)
tree6236f3e89e4ca28c237c368bdb69dbbb1d990633 /src
parent022e2df6123ae0d01aad71dd2031beaf1e3f2030 (diff)
[7614] Sort/rename debug commands, Move packet send commands to new ".debug send " subcommands list. Author: VladimirMangos
Also drop not implemented .debug inarc Add to .debug send spellfail support for up to 2 additional args for spell fail packet. --HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/Chat.cpp49
-rw-r--r--src/game/Chat.h69
-rw-r--r--src/game/Debugcmds.cpp50
-rw-r--r--src/game/Level2.cpp11
4 files changed, 92 insertions, 87 deletions
diff --git a/src/game/Chat.cpp b/src/game/Chat.cpp
index 5b5c3e782d9..0914868deff 100644
--- a/src/game/Chat.cpp
+++ b/src/game/Chat.cpp
@@ -108,35 +108,40 @@ ChatCommand * ChatHandler::getCommandTable()
{ NULL, 0, false, NULL, "", NULL }
};
- static ChatCommand debugCommandTable[] =
- {
- { "inarc", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugInArcCommand, "", NULL },
- { "spellfail", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSpellFailCommand, "", NULL },
- { "setpoi", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSetPoiCommand, "", NULL },
+ static ChatCommand debugSendCommandTable[] =
+ {
+ { "buyerror", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSendBuyErrorCommand, "", NULL },
+ { "channelnotify", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSendChannelNotifyCommand, "", NULL },
+ { "chatmmessage", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSendChatMsgCommand, "", NULL },
+ { "equiperror", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSendEquipErrorCommand, "", NULL },
+ { "largepacket", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSendLargePacketCommand, "", NULL },
+ { "opcode", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSendOpcodeCommand, "", NULL },
+ { "poi", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSendPoiCommand, "", NULL },
{ "qpartymsg", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSendQuestPartyMsgCommand, "", NULL },
{ "qinvalidmsg", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSendQuestInvalidMsgCommand, "", NULL },
- { "equiperr", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugEquipErrorCommand, "", NULL },
- { "sellerr", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSellErrorCommand, "", NULL },
- { "buyerr", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugBuyErrorCommand, "", NULL },
- { "sendopcode", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSendOpcodeCommand, "", NULL },
- { "spawnvehicle", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSpawnVehicle, "", NULL },
- { "uws", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugUpdateWorldStateCommand, "", NULL },
- { "scn", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSendChannelNotifyCommand, "", NULL },
- { "scm", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSendChatMsgCommand, "", NULL },
- { "sps", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSendSetPhaseShiftCommand, "", NULL },
- { "getitemstate", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugGetItemState, "", NULL },
- { "playsound", SEC_MODERATOR, false, &ChatHandler::HandleDebugPlaySoundCommand, "", NULL },
- { "update", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugUpdate, "", NULL },
- { "setvalue", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSetValue, "", NULL },
- { "getvalue", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugGetValue, "", NULL },
+ { "sellerror", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSendSellErrorCommand, "", NULL },
+ { "setphaseshift", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSendSetPhaseShiftCommand, "", NULL },
+ { "spellfail", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSendSpellFailCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+
+ static ChatCommand debugCommandTable[] =
+ {
{ "setbit", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSet32Bit, "", NULL },
- { "Mod32Value", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugMod32Value, "", NULL },
{ "anim", SEC_GAMEMASTER, false, &ChatHandler::HandleDebugAnimCommand, "", NULL },
- { "lootrecipient", SEC_GAMEMASTER, false, &ChatHandler::HandleDebugGetLootRecipient, "", NULL },
{ "arena", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugArenaCommand, "", NULL },
{ "bg", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugBattlegroundCommand, "", NULL },
- { "sendlargepacket",SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSendLargePacketCommand, "", NULL },
+ { "getitemstate", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugGetItemState, "", NULL },
+ { "lootrecipient", SEC_GAMEMASTER, false, &ChatHandler::HandleDebugGetLootRecipient, "", NULL },
+ { "getvalue", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugGetValue, "", NULL },
+ { "Mod32Value", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugMod32Value, "", NULL },
+ { "playsound", SEC_MODERATOR, false, &ChatHandler::HandleDebugPlaySoundCommand, "", NULL },
+ { "send", SEC_ADMINISTRATOR, false, NULL, "", debugSendCommandTable },
{ "setitemflag", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSetItemFlagCommand, "", NULL },
+ { "setvalue", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSetValue, "", NULL },
+ { "spawnvehicle", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSpawnVehicle, "", NULL },
+ { "uws", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugUpdateWorldStateCommand, "", NULL },
+ { "update", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugUpdate, "", NULL },
{ NULL, 0, false, NULL, "", NULL }
};
diff --git a/src/game/Chat.h b/src/game/Chat.h
index cedb889f9bd..8d72eb2beb9 100644
--- a/src/game/Chat.h
+++ b/src/game/Chat.h
@@ -128,6 +128,41 @@ class ChatHandler
bool HandleSendMailCommand(const char* args);
bool HandleSendMoneyCommand(const char* args);
+ bool HandleDebugAnimCommand(const char* args);
+ bool HandleDebugArenaCommand(const char * args);
+ bool HandleDebugBattlegroundCommand(const char * args);
+ bool HandleDebugGetItemState(const char * args);
+ bool HandleDebugGetLootRecipient(const char * args);
+ bool HandleDebugGetValue(const char* args);
+ bool HandleDebugMod32Value(const char* args);
+ bool HandleDebugPlaySoundCommand(const char* args);
+ bool HandleDebugSetValue(const char* args);
+ bool HandleDebugSetItemFlagCommand(const char * args);
+ bool HandleDebugSpawnVehicle(const char * args);
+ bool HandleDebugUpdate(const char* args);
+ bool HandleDebugUpdateWorldStateCommand(const char* args);
+
+ bool HandleDebugSet32Bit(const char* args);
+ bool HandleDebugThreatList(const char * args);
+ bool HandleDebugHostilRefList(const char * args);
+ bool HandlePossessCommand(const char* args);
+ bool HandleUnPossessCommand(const char* args);
+ bool HandleBindSightCommand(const char* args);
+ bool HandleUnbindSightCommand(const char* args);
+
+ bool HandleDebugSendBuyErrorCommand(const char* args);
+ bool HandleDebugSendChannelNotifyCommand(const char* args);
+ bool HandleDebugSendChatMsgCommand(const char* args);
+ bool HandleDebugSendEquipErrorCommand(const char* args);
+ bool HandleDebugSendLargePacketCommand(const char * args);
+ bool HandleDebugSendOpcodeCommand(const char* args);
+ bool HandleDebugSendPoiCommand(const char* args);
+ bool HandleDebugSendQuestPartyMsgCommand(const char* args);
+ bool HandleDebugSendQuestInvalidMsgCommand(const char* args);
+ bool HandleDebugSendSellErrorCommand(const char* args);
+ bool HandleDebugSendSetPhaseShiftCommand(const char * args);
+ bool HandleDebugSendSpellFailCommand(const char* args);
+
bool HandleEventActiveListCommand(const char* args);
bool HandleEventStartCommand(const char* args);
bool HandleEventStopCommand(const char* args);
@@ -326,17 +361,10 @@ class ChatHandler
bool HandleHonorUpdateCommand(const char* args);
bool HandleLoadScriptsCommand(const char* args);
- bool HandleDebugSendQuestPartyMsgCommand(const char* args);
- bool HandleDebugSendQuestInvalidMsgCommand(const char* args);
-
- bool HandleDebugInArcCommand(const char* args);
- bool HandleDebugSpellFailCommand(const char* args);
bool HandleGUIDCommand(const char* args);
bool HandleItemMoveCommand(const char* args);
bool HandleDeMorphCommand(const char* args);
- bool HandleDebugSetPoiCommand(const char* args);
- bool HandleDebugEquipErrorCommand(const char* args);
bool HandleGoCreatureCommand(const char* args);
bool HandleGoObjectCommand(const char* args);
bool HandleGoTriggerCommand(const char* args);
@@ -380,8 +408,6 @@ class ChatHandler
bool HandleUnLearnCommand(const char* args);
bool HandleGetDistanceCommand(const char* args);
bool HandleGameObjectAddCommand(const char* args);
- bool HandleDebugAnimCommand(const char* args);
- bool HandleDebugPlaySoundCommand(const char* args);
bool HandleModifyStandStateCommand(const char* args);
bool HandleDieCommand(const char* args);
bool HandleDamageCommand(const char *args);
@@ -415,7 +441,6 @@ class ChatHandler
bool HandleGuildUninviteCommand(const char* args);
bool HandleGuildRankCommand(const char* args);
bool HandleGuildDeleteCommand(const char* args);
- bool HandleDebugUpdate(const char* args);
bool HandleBankCommand(const char* args);
bool HandleChangeWeather(const char* args);
bool HandleKickPlayerCommand(const char * args);
@@ -463,12 +488,6 @@ class ChatHandler
bool HandleWpEventCommand(const char* args);
bool HandleWpShowCommand(const char* args);
bool HandleReloadAllPaths(const char *args);
- bool HandleDebugSendOpcodeCommand(const char* args);
- bool HandleDebugSellErrorCommand(const char* args);
- bool HandleDebugBuyErrorCommand(const char* args);
- bool HandleDebugUpdateWorldStateCommand(const char* args);
- bool HandleDebugSendChannelNotifyCommand(const char* args);
- bool HandleDebugSendChatMsgCommand(const char* args);
bool HandleRenameCommand(const char * args);
bool HandleCustomizeCommand(const char * args);
bool HandlePDumpLoadCommand(const char *args);
@@ -490,28 +509,10 @@ class ChatHandler
bool HandleTempAddSpwCommand(const char* args);
//! Development Commands
- bool HandleDebugSetValue(const char* args);
- bool HandleDebugGetValue(const char* args);
- bool HandleDebugSet32Bit(const char* args);
- bool HandleDebugMod32Value(const char* args);
bool HandleQuestAdd(const char * args);
bool HandleQuestRemove(const char * args);
bool HandleQuestComplete(const char * args);
bool HandleSaveAllCommand(const char* args);
- bool HandleDebugGetItemState(const char * args);
- bool HandleDebugGetLootRecipient(const char * args);
- bool HandleDebugArenaCommand(const char * args);
- bool HandleDebugThreatList(const char * args);
- bool HandleDebugHostilRefList(const char * args);
- bool HandlePossessCommand(const char* args);
- bool HandleUnPossessCommand(const char* args);
- bool HandleBindSightCommand(const char* args);
- bool HandleUnbindSightCommand(const char* args);
- bool HandleDebugBattlegroundCommand(const char * args);
- bool HandleDebugSpawnVehicle(const char * args);
- bool HandleDebugSendLargePacketCommand(const char * args);
- bool HandleDebugSendSetPhaseShiftCommand(const char * args);
- bool HandleDebugSetItemFlagCommand(const char * args);
Player* getSelectedPlayer();
Creature* getSelectedCreature();
diff --git a/src/game/Debugcmds.cpp b/src/game/Debugcmds.cpp
index 6e7ef493ce5..3bd630f799b 100644
--- a/src/game/Debugcmds.cpp
+++ b/src/game/Debugcmds.cpp
@@ -33,22 +33,7 @@
#include <fstream>
#include "ObjectMgr.h"
-bool ChatHandler::HandleDebugInArcCommand(const char* /*args*/)
-{
- Object *obj = getSelectedUnit();
-
- if(!obj)
- {
- SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
- return true;
- }
-
- SendSysMessage(LANG_NOT_IMPLEMENTED);
-
- return true;
-}
-
-bool ChatHandler::HandleDebugSpellFailCommand(const char* args)
+bool ChatHandler::HandleDebugSendSpellFailCommand(const char* args)
{
if(!args)
return false;
@@ -58,17 +43,31 @@ bool ChatHandler::HandleDebugSpellFailCommand(const char* args)
return false;
uint8 failnum = (uint8)atoi(px);
+ if(failnum==0 && *px!='0')
+ return false;
+
+ char* p1 = strtok(NULL, " ");
+ uint8 failarg1 = p1 ? (uint8)atoi(p1) : 0;
+
+ char* p2 = strtok(NULL, " ");
+ uint8 failarg2 = p2 ? (uint8)atoi(p2) : 0;
+
WorldPacket data(SMSG_CAST_FAILED, 5);
data << uint8(0);
data << uint32(133);
data << uint8(failnum);
+ if(p1 || p2)
+ data << uint32(failarg1);
+ if(p2)
+ data << uint32(failarg2);
+
m_session->SendPacket(&data);
return true;
}
-bool ChatHandler::HandleDebugSetPoiCommand(const char* args)
+bool ChatHandler::HandleDebugSendPoiCommand(const char* args)
{
Player *pPlayer = m_session->GetPlayer();
Unit* target = getSelectedUnit();
@@ -94,7 +93,7 @@ bool ChatHandler::HandleDebugSetPoiCommand(const char* args)
return true;
}
-bool ChatHandler::HandleDebugEquipErrorCommand(const char* args)
+bool ChatHandler::HandleDebugSendEquipErrorCommand(const char* args)
{
if(!args)
return false;
@@ -104,7 +103,7 @@ bool ChatHandler::HandleDebugEquipErrorCommand(const char* args)
return true;
}
-bool ChatHandler::HandleDebugSellErrorCommand(const char* args)
+bool ChatHandler::HandleDebugSendSellErrorCommand(const char* args)
{
if(!args)
return false;
@@ -114,7 +113,7 @@ bool ChatHandler::HandleDebugSellErrorCommand(const char* args)
return true;
}
-bool ChatHandler::HandleDebugBuyErrorCommand(const char* args)
+bool ChatHandler::HandleDebugSendBuyErrorCommand(const char* args)
{
if(!args)
return false;
@@ -719,3 +718,14 @@ bool ChatHandler::HandleDebugSetItemFlagCommand(const char* args)
return true;
}
+
+//show animation
+bool ChatHandler::HandleDebugAnimCommand(const char* args)
+{
+ if (!*args)
+ return false;
+
+ uint32 anim_id = atoi((char*)args);
+ m_session->GetPlayer()->HandleEmoteCommand(anim_id);
+ return true;
+}
diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp
index 91f5fc516da..d1f4c864f24 100644
--- a/src/game/Level2.cpp
+++ b/src/game/Level2.cpp
@@ -3696,17 +3696,6 @@ bool ChatHandler::HandleCustomizeCommand(const char* args)
return true;
}
-//show animation
-bool ChatHandler::HandleDebugAnimCommand(const char* args)
-{
- if (!*args)
- return false;
-
- uint32 anim_id = atoi((char*)args);
- m_session->GetPlayer()->HandleEmoteCommand(anim_id);
- return true;
-}
-
//change standstate
bool ChatHandler::HandleModifyStandStateCommand(const char* args)
{