Subversion Repositories WoWGM

Rev

Rev 30 | Rev 32 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 30 Rev 31
Line 5... Line 5...
5
 
5
 
6
#include <Console/ConsoleClient.h>
6
#include <Console/ConsoleClient.h>
7
#include <DB/WowClientDB.h>
7
#include <DB/WowClientDB.h>
8
#include <WowSvcs/ClientServices.h>
8
#include <WowSvcs/ClientServices.h>
9
 
9
 
-
 
10
 
10
/****************************************************************************
11
/****************************************************************************
11
*
12
*
12
*	Command definitions
13
*   Client Debug Commands
13
*
14
*
14
***/
15
***/
15
 
16
 
16
//===========================================================================
17
//===========================================================================
17
BOOL CCommand_BootMe(const char *command, const char *arguments)
18
BOOL CCommand_BootMe (const char *command, const char *arguments) {
18
{
-
 
19
  CDataStore msg;
19
  CDataStore msg;
20
  msg.Put(CMSG_BOOTME);
20
  msg.Put(CMSG_BOOTME);
21
  msg.Finalize();
21
  msg.Finalize();
22
  ClientServices_Send(&msg);
22
  ClientServices_Send(&msg);
23
  return TRUE;
23
  return TRUE;
24
}
24
}
25
 
25
 
26
//===========================================================================
26
//===========================================================================
27
BOOL CCommand_Bug(char const* command, char const* args) {
27
BOOL CCommand_Bug (char const* command, char const* args) {
28
  //TODO:
28
  //TODO:
29
  //ASSERT(command);
29
  //ASSERT(command);
30
 
30
 
31
  unsigned int category;
31
  unsigned int category;
32
 
32
 
Line 42... Line 42...
42
 
42
 
43
  return TRUE;
43
  return TRUE;
44
}
44
}
45
 
45
 
46
//===========================================================================
46
//===========================================================================
47
BOOL CCommand_CreateItem(char const* command, char const* arguments)
47
BOOL CCommand_CreateItem (char const* command, char const* arguments) {
48
{
-
 
49
	char string[256];
48
	char string[256];
50
	SStrCopy(string, arguments, 0xffffffff);
49
	SStrCopy(string, arguments, 0xffffffff);
51
	char *token = 0;
50
	char *token = 0;
52
	token = strtok(string, " \t");
51
	token = strtok(string, " \t");
53
	int itemId = SStrToInt(token);
52
	int itemId = SStrToInt(token);
Line 84... Line 83...
84
	ClientServices_Send(&msg);
83
	ClientServices_Send(&msg);
85
	return TRUE;
84
	return TRUE;
86
}
85
}
87
 
86
 
88
//===========================================================================
87
//===========================================================================
89
BOOL CCommand_Learn(const char* command, const char* arguments)
88
BOOL CCommand_Learn (const char* command, const char* arguments) {
90
{
-
 
91
	int spellId = 0;
89
	int spellId = 0;
92
	if (isdigit(*arguments)) {
90
	if (isdigit(*arguments)) {
93
		spellId = SStrToInt(arguments);
91
		spellId = SStrToInt(arguments);
94
		if (spellId <= 0) {
92
		if (spellId <= 0) {
95
			return TRUE;
93
			return TRUE;
Line 135... Line 133...
135
}
133
}
136
 
134
 
137
 
135
 
138
/****************************************************************************
136
/****************************************************************************
139
*
137
*
140
*	External functions
138
*   External
141
*
139
*
142
***/
140
***/
143
 
141
 
144
//===========================================================================
142
//===========================================================================
145
void DebugClientCommands::Install()
143
void DebugClientCommands::Install () {
146
{
-
 
147
  ConsoleCommandRegister("bootme",CCommand_BootMe,DEBUG,NOHELP);
144
  ConsoleCommandRegister("bootme",CCommand_BootMe,DEBUG,NOHELP);
148
  ConsoleCommandRegister("learn",CCommand_Learn,DEBUG,"Learn a spell or -1 for all spells");
145
  ConsoleCommandRegister("learn",CCommand_Learn,DEBUG,"Learn a spell or -1 for all spells");
149
  ConsoleCommandRegister("ci",CCommand_CreateItem,GAME,NOHELP);
146
  ConsoleCommandRegister("ci",CCommand_CreateItem,GAME,NOHELP);
150
  ConsoleCommandRegister("createitem",CCommand_CreateItem,GAME,NOHELP);
147
  ConsoleCommandRegister("createitem",CCommand_CreateItem,GAME,NOHELP);
151
  ConsoleCommandRegister("cm",CCommand_CreateMonster,GAME,NOHELP);
148
  ConsoleCommandRegister("cm",CCommand_CreateMonster,GAME,NOHELP);
Line 154... Line 151...
154
  ConsoleCommandRegister("decharge",CCommand_Decharge,GAME,NOHELP);
151
  ConsoleCommandRegister("decharge",CCommand_Decharge,GAME,NOHELP);
155
  ConsoleCommandRegister("level",CCommand_Level,DEBUG,NOHELP);
152
  ConsoleCommandRegister("level",CCommand_Level,DEBUG,NOHELP);
156
}
153
}
157
 
154
 
158
//===========================================================================
155
//===========================================================================
159
void DebugClientCommands::Uninstall()
156
void DebugClientCommands::Uninstall () {
160
{
-
 
161
  ConsoleCommandUnregister("bootme");
157
  ConsoleCommandUnregister("bootme");
162
  ConsoleCommandUnregister("learn");
158
  ConsoleCommandUnregister("learn");
163
  ConsoleCommandUnregister("ci");
159
  ConsoleCommandUnregister("ci");
164
  ConsoleCommandUnregister("createitem");
160
  ConsoleCommandUnregister("createitem");
165
  ConsoleCommandUnregister("cm");
161
  ConsoleCommandUnregister("cm");