Subversion Repositories WoWGM

Rev

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

/****************************************************************************
*
*   ClientCommands.cpp
*
*   Client game commands
*
***/

#include "pch.h"
#pragma hdrstop

#include "ClientCommands.h"

#include <ClientDebugCommands.h>
#include <ClientGMCommands.h>
#include <Console/ConsoleClient.h>
#include <FrameScript/FrameScript.h>
#include <WowSvcs/ClientServices.h>


//===========================================================================
BOOL CCommand_Beastmaster (char const* commandStr, char const* arguments) {
  CDataStore msg;
  msg.Put(CMSG_BEASTMASTER);
  BYTE val = SStrCmpI(arguments, "off") != 0;
  msg.Put(val);
  msg.Finalize();
  ClientServices_Send(&msg);
  return TRUE;
}

//===========================================================================
BOOL CCommand_Bug (char const* command, char const* args) {
  //TODO:
  //ASSERT(command);

  unsigned int category;

  if (!SStrCmpI(command, "bug"))
    category = 0;
  else if (!SStrCmpI(command, "suggestion"))
    category = 1;

  if (ClientServices_Report(category, args))
    ConsolePrintf("%s submitted", command);
  else
    ConsolePrintf("%s submission failed", command);

  return TRUE;
}

//===========================================================================
BOOL CCommand_Godmode (const char* cmd, const char* arguments) {        
        if (arguments && *arguments) {
                int enable = atoi(arguments);

                CDataStore msg;
                msg.Put(CMSG_GODMODE);
                msg.Put(enable);
                msg.Finalize();

                ClientServices_Send(&msg);
        }

        return TRUE;
}