[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
This commit is contained in:
+26
-21
@@ -108,35 +108,40 @@ ChatCommand * ChatHandler::getCommandTable()
|
||||
{ NULL, 0, false, NULL, "", NULL }
|
||||
};
|
||||
|
||||
static ChatCommand debugCommandTable[] =
|
||||
static ChatCommand debugSendCommandTable[] =
|
||||
{
|
||||
{ "inarc", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugInArcCommand, "", NULL },
|
||||
{ "spellfail", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSpellFailCommand, "", NULL },
|
||||
{ "setpoi", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugSetPoiCommand, "", NULL },
|
||||
{ "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 }
|
||||
};
|
||||
|
||||
|
||||
+35
-34
@@ -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();
|
||||
|
||||
+30
-20
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user