Subversion Repositories WoWGM

Rev

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

Rev 6 Rev 7
Line 2... Line 2...
2
#pragma hdrstop
2
#pragma hdrstop
3
 
3
 
4
#include "ClientDebugCommands.h"
4
#include "ClientDebugCommands.h"
5
 
5
 
6
#include <Console/ConsoleClient.h>
6
#include <Console/ConsoleClient.h>
-
 
7
#include <DB/WowClientDB.h>
7
#include <WowSvcs/ClientServices.h>
8
#include <WowSvcs/ClientServices.h>
8
 
9
 
9
/****************************************************************************
10
/****************************************************************************
10
*
11
*
11
*	Command definitions
12
*	Command definitions
Line 20... Line 21...
20
  msg.Finalize();
21
  msg.Finalize();
21
  ClientServices_Send(&msg);
22
  ClientServices_Send(&msg);
22
  return TRUE;
23
  return TRUE;
23
}
24
}
24
 
25
 
-
 
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
	}
-
 
40
 
-
 
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
 
25
 
49
 
26
/****************************************************************************
50
/****************************************************************************
27
*
51
*
28
*	External functions
52
*	External functions
29
*
53
*
Line 31... Line 55...
31
 
55
 
32
//===========================================================================
56
//===========================================================================
33
void DebugClientCommands::Install()
57
void DebugClientCommands::Install()
34
{
58
{
35
  ConsoleCommandRegister("bootme",CCommand_BootMe,DEBUG,NOHELP);
59
  ConsoleCommandRegister("bootme",CCommand_BootMe,DEBUG,NOHELP);
-
 
60
  ConsoleCommandRegister("learn",CCommand_Learn,DEBUG,"Learn a spell or -1 for all spells");
36
}
61
}
37
 
62
 
38
//===========================================================================
63
//===========================================================================
39
void DebugClientCommands::Uninstall()
64
void DebugClientCommands::Uninstall()
40
{
65
{
41
  ConsoleCommandUnregister("bootme");
66
  ConsoleCommandUnregister("bootme");
-
 
67
  ConsoleCommandUnregister("learn");
42
}
68
}