Subversion Repositories WoWGM

Rev

Rev 6 | Rev 15 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

#include "pch.h"
#pragma hdrstop

#include "ClientDebugCommands.h"

#include <Console/ConsoleClient.h>
#include <DB/WowClientDB.h>
#include <WowSvcs/ClientServices.h>

/****************************************************************************
*
*       Command definitions
*
***/

//===========================================================================
BOOL CCommand_BootMe(const char *command, const char *arguments)
{
  CDataStore msg;
  msg.Put(CMSG_BOOTME);
  msg.Finalize();
  ClientServices_Send(&msg);
  return TRUE;
}

//===========================================================================
BOOL CCommand_Learn(const char* command, const char* arguments)
{
        int spellId = 0;
        if (isdigit(*arguments)) {
                spellId = atoi(arguments);
                if (spellId <= 0) {
                        return TRUE;
                }
        }
        else {
                ConsoleWrite("Learning by spell name is not yet implemented", DEFAULT_COLOR);
                return TRUE;
        }

        CDataStore msg;
        msg.Put(CMSG_LEARN_SPELL);
        msg.Put(spellId);
        msg.Finalize();
        ClientServices_Send(&msg);
        return TRUE;
}


/****************************************************************************
*
*       External functions
*
***/

//===========================================================================
void DebugClientCommands::Install()
{
  ConsoleCommandRegister("bootme",CCommand_BootMe,DEBUG,NOHELP);
  ConsoleCommandRegister("learn",CCommand_Learn,DEBUG,"Learn a spell or -1 for all spells");
}

//===========================================================================
void DebugClientCommands::Uninstall()
{
  ConsoleCommandUnregister("bootme");
  ConsoleCommandUnregister("learn");
}