Subversion Repositories WoWGM

Rev

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

Rev Author Line No. Line
3 tristanc 1
#include "pch.h"
2
#pragma hdrstop
3
 
4
#include "ClientDebugCommands.h"
6 tristanc 5
 
3 tristanc 6
#include <Console/ConsoleClient.h>
7 tristanc 7
#include <DB/WowClientDB.h>
3 tristanc 8
#include <WowSvcs/ClientServices.h>
9
 
10
/****************************************************************************
11
*
12
*	Command definitions
13
*
14
***/
15
 
16
//===========================================================================
17
BOOL CCommand_BootMe(const char *command, const char *arguments)
18
{
19
  CDataStore msg;
20
  msg.Put(CMSG_BOOTME);
21
  msg.Finalize();
22
  ClientServices_Send(&msg);
23
  return TRUE;
24
}
25
 
7 tristanc 26
//===========================================================================
27
BOOL CCommand_Learn(const char* command, const char* arguments)
28
{
29
	int spellId = 0;
30
	if (isdigit(*arguments)) {
31
		spellId = atoi(arguments);
32
		if (spellId <= 0) {
33
			return TRUE;
34
		}
35
	}
36
	else {
37
		ConsoleWrite("Learning by spell name is not yet implemented", DEFAULT_COLOR);
38
		return TRUE;
39
	}
3 tristanc 40
 
7 tristanc 41
	CDataStore msg;
42
	msg.Put(CMSG_LEARN_SPELL);
43
	msg.Put(spellId);
44
	msg.Finalize();
45
	ClientServices_Send(&msg);
46
	return TRUE;
47
}
48
 
49
 
3 tristanc 50
/****************************************************************************
51
*
52
*	External functions
53
*
54
***/
55
 
56
//===========================================================================
57
void DebugClientCommands::Install()
58
{
59
  ConsoleCommandRegister("bootme",CCommand_BootMe,DEBUG,NOHELP);
7 tristanc 60
  ConsoleCommandRegister("learn",CCommand_Learn,DEBUG,"Learn a spell or -1 for all spells");
3 tristanc 61
}
62
 
63
//===========================================================================
64
void DebugClientCommands::Uninstall()
65
{
66
  ConsoleCommandUnregister("bootme");
7 tristanc 67
  ConsoleCommandUnregister("learn");
3 tristanc 68
}