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 26
Line 4... Line 4...
4
#include "ClientGMCommands.h"
4
#include "ClientGMCommands.h"
5
 
5
 
6
#include <Console/ConsoleClient.h>
6
#include <Console/ConsoleClient.h>
7
#include <WowSvcs/ClientServices.h>
7
#include <WowSvcs/ClientServices.h>
8
 
8
 
-
 
9
 
-
 
10
//===========================================================================
-
 
11
char const* GetWord (const char* string, char* buffer, uint bufferchars) {
-
 
12
 
-
 
13
  //ASSERT(string);
-
 
14
  //ASSERT(buffer || bufferchars);
-
 
15
 
-
 
16
  uint length = bufferchars - 1;
-
 
17
  for (uint i = 0; i != length; i++) {
-
 
18
    if (buffer[i] == ' ')
-
 
19
      break;
-
 
20
    buffer[i] = *string;
-
 
21
    ++string;
-
 
22
  };
-
 
23
 
-
 
24
  return string;    
-
 
25
}
-
 
26
 
-
 
27
 
9
/****************************************************************************
28
/****************************************************************************
10
*
29
*
11
*	Command definitions
30
*	Command definitions
12
*
31
*
13
***/
32
***/
Line 25... Line 44...
25
		ConsoleWrite("Expected a player name", DEFAULT_COLOR);
44
		ConsoleWrite("Expected a player name", DEFAULT_COLOR);
26
	}
45
	}
27
	return TRUE;
46
	return TRUE;
28
}
47
}
29
 
48
 
-
 
49
//===========================================================================
-
 
50
BOOL CCommand_SetSecurity (char const* command, char const* arguments) {
-
 
51
  char name[49];
-
 
52
 
-
 
53
  GetWord(command, name, sizeof(name));
-
 
54
  int security = SStrToInt(command);
-
 
55
 
-
 
56
  ConsoleWriteA("Setting '%s' to security group %d", DEFAULT_COLOR, name, security);
-
 
57
 
-
 
58
  CDataStore msg;
-
 
59
  msg.Put(CMSG_SET_SECURITY_GROUP);
-
 
60
  msg.Put(security);
-
 
61
  msg.Finalize();
-
 
62
 
-
 
63
  ClientServices_Send(&msg);
-
 
64
  
-
 
65
  return TRUE;
-
 
66
}
-
 
67
 
30
 
68
 
31
/****************************************************************************
69
/****************************************************************************
32
*
70
*
33
*	External functions
71
*	External functions
34
*
72
*
35
***/
73
***/
36
 
74
 
37
//===========================================================================
75
//===========================================================================
38
void GMClientCommands::Install()
76
void GMClientCommands::Install()
39
{
77
{
-
 
78
  ConsoleCommandRegister("setsecurity",CCommand_SetSecurity,GM,"Set another character's security group");
40
	ConsoleCommandRegister("resurrect",CCommand_GMResurrect,DEBUG,NOHELP);
79
	ConsoleCommandRegister("resurrect",CCommand_GMResurrect,DEBUG,NOHELP);
41
}
80
}
42
 
81
 
43
//===========================================================================
82
//===========================================================================
44
void GMClientCommands::Uninstall()
83
void GMClientCommands::Uninstall()
45
{
84
{
-
 
85
  ConsoleCommandUnregister("setsecurity");
46
	ConsoleCommandUnregister("resurrect");
86
	ConsoleCommandUnregister("resurrect");
47
}
87
}