Subversion Repositories WoWGM

Rev

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

Rev 6 Rev 25
Line 34... Line 34...
34
*	Game commands
34
*	Game commands
35
*
35
*
36
***/
36
***/
37
 
37
 
38
//===========================================================================
38
//===========================================================================
39
BOOL CCommand_CreateMonster(const char* cmd, const char* arguments)
-
 
40
{
-
 
41
	if (arguments && *arguments) {
-
 
42
		unsigned int monster = atoi(arguments);
-
 
43
 
-
 
44
		CDataStore msg;
-
 
45
		msg.Put(CMSG_CREATEMONSTER);
-
 
46
		msg.Put(monster);
-
 
47
		msg.Finalize();
-
 
48
		
-
 
49
		ClientServices_Send(&msg);
-
 
50
	}
-
 
51
	return TRUE;
-
 
52
}
-
 
53
 
-
 
54
//===========================================================================
-
 
55
BOOL CCommand_GodMode(const char* cmd, const char* arguments)
39
BOOL CCommand_GodMode(const char* cmd, const char* arguments)
56
{	
40
{	
57
	if (arguments && *arguments) {
41
	if (arguments && *arguments) {
58
		int enable = atoi(arguments);
42
		int enable = atoi(arguments);
59
 
43
 
Line 78... Line 62...
78
void InstallGameConsoleCommands()
62
void InstallGameConsoleCommands()
79
{
63
{
80
	InstallGameConsoleCommandsPtr();
64
	InstallGameConsoleCommandsPtr();
81
 
65
 
82
	// Register our own commands
66
	// Register our own commands
83
	ConsoleCommandRegister("cm",CCommand_CreateMonster,GAME,NOHELP);
-
 
84
	ConsoleCommandRegister("createmonster",CCommand_CreateMonster,GAME,NOHELP);
-
 
85
	ConsoleCommandRegister("godmode",CCommand_GodMode,GAME,NOHELP);
67
	ConsoleCommandRegister("godmode",CCommand_GodMode,GAME,NOHELP);
86
 
68
 
87
	DebugClientCommands::Install();
69
	DebugClientCommands::Install();
88
	GMClientCommands::Install();
70
	GMClientCommands::Install();
89
}
71
}
Line 92... Line 74...
92
void UninstallGameConsoleCommands()
74
void UninstallGameConsoleCommands()
93
{
75
{
94
	UninstallGameConsoleCommandsPtr();
76
	UninstallGameConsoleCommandsPtr();
95
	
77
	
96
	// Unregister our own commands
78
	// Unregister our own commands
97
	ConsoleCommandUnregister("cm");
-
 
98
	ConsoleCommandUnregister("createmonster");
-
 
99
	ConsoleCommandUnregister("godmode");
79
	ConsoleCommandUnregister("godmode");
100
 
80
 
101
	DebugClientCommands::Uninstall();
81
	DebugClientCommands::Uninstall();
102
	GMClientCommands::Uninstall();
82
	GMClientCommands::Uninstall();
103
}
83
}