Subversion Repositories WoWGM

Rev

Rev 32 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 32 Rev 36
Line 2... Line 2...
2
#pragma hdrstop
2
#pragma hdrstop
3
 
3
 
4
#include "ConsoleClient.h"
4
#include "ConsoleClient.h"
5
 
5
 
6
 
6
 
7
/****************************************************************************
7
/******************************************************************************
8
*
8
*
9
*   Client memory addresses
9
*   Client memory addresses
10
*
10
*
11
***/
11
***/
12
 
12
 
Line 26... Line 26...
26
#define  S_ACTIVE_PTR                  0x00C4EAC8
26
#define  S_ACTIVE_PTR                  0x00C4EAC8
27
#define  S_CONSOLEACCESSENABLED_PTR    0x00CABCC4
27
#define  S_CONSOLEACCESSENABLED_PTR    0x00CABCC4
28
#define  S_CONSOLEKEY_PTR              0x00864554
28
#define  S_CONSOLEKEY_PTR              0x00864554
29
 
29
 
30
 
30
 
31
/****************************************************************************
31
/******************************************************************************
32
*
32
*
33
*	  Client symbol pointers
33
*	  Client symbol pointers
34
*
34
*
35
***/
35
***/
36
 
36
 
Line 58... Line 58...
58
void (*ConsoleCommandUnregisterPtr)(LPCSTR) = *(void(*)(LPCSTR))CONSOLECOMMANDUNREGISTER_PTR;
58
void (*ConsoleCommandUnregisterPtr)(LPCSTR) = *(void(*)(LPCSTR))CONSOLECOMMANDUNREGISTER_PTR;
59
 
59
 
60
void (*ConsolePrintfPtr)(LPCSTR,...) = *(void(*)(LPCSTR,...))CONSOLEPRINTF_PTR;
60
void (*ConsolePrintfPtr)(LPCSTR,...) = *(void(*)(LPCSTR,...))CONSOLEPRINTF_PTR;
61
 
61
 
62
 
62
 
63
/****************************************************************************
63
/******************************************************************************
64
*
64
*
65
*   Global variables
65
*   Global variables
66
*
66
*
67
***/
67
***/
68
 
68
 
69
EXECMODE& g_ExecCreateMode = *(EXECMODE*)G_EXECCREATEMODE_PTR;
69
EXECMODE& g_ExecCreateMode = *(EXECMODE*)G_EXECCREATEMODE_PTR;
70
 
70
 
71
char* g_ExecBuffer = (char *)G_EXECBUFFER_PTR;
71
char* g_ExecBuffer = (char *)G_EXECBUFFER_PTR;
72
 
72
 
73
 
73
 
74
/****************************************************************************
74
/******************************************************************************
75
*
75
*
76
*   External
76
*   External
77
*
77
*
78
***/
78
***/
79
 
79
 
80
//===========================================================================
80
//=============================================================================
81
void ConsoleWrite (char const* str, COLOR_T color) {
81
void ConsoleWrite (char const* str, COLOR_T color) {
82
  ConsoleWritePtr(str,color);
82
  ConsoleWritePtr(str,color);
83
}
83
}
84
 
84
 
85
//===========================================================================
85
//=============================================================================
86
void ConsoleWriteA (char const* str, COLOR_T color, ...) {
86
void ConsoleWriteA (char const* str, COLOR_T color, ...) {
87
	va_list va;
87
	va_list va;
88
	va_start(va,color);
88
	va_start(va,color);
89
 
89
 
90
	if (str && *str) {
90
	if (str && *str) {
Line 94... Line 94...
94
	}
94
	}
95
 
95
 
96
	va_end(va);
96
	va_end(va);
97
}
97
}
98
 
98
 
99
//===========================================================================
99
//=============================================================================
100
void ConsoleAccessSetEnabled (BOOL enable) {
100
void ConsoleAccessSetEnabled (BOOL enable) {
101
  *s_consoleAccessEnabled = enable;
101
  *s_consoleAccessEnabled = enable;
102
}
102
}
103
 
103
 
104
//===========================================================================
104
//=============================================================================
105
BOOL ConsoleAccessGetEnabled () {
105
BOOL ConsoleAccessGetEnabled () {
106
  return *s_consoleAccessEnabled;
106
  return *s_consoleAccessEnabled;
107
}
107
}
108
 
108
 
109
//===========================================================================
109
//=============================================================================
110
BOOL ConsoleIsActive () {
110
BOOL ConsoleIsActive () {
111
  return *s_active;
111
  return *s_active;
112
}
112
}
113
 
113
 
114
//===========================================================================
114
//=============================================================================
115
void ConsoleSetHotkey (KEY key) {
115
void ConsoleSetHotkey (KEY key) {
116
  ConsoleSetHotkeyPtr(key);
116
  ConsoleSetHotkeyPtr(key);
117
}
117
}
118
 
118
 
119
//===========================================================================
119
//=============================================================================
120
void ConsoleSetTitle (LPSTR windowTitle) {
120
void ConsoleSetTitle (LPSTR windowTitle) {
121
  ConsoleSetTitlePtr(windowTitle);
121
  ConsoleSetTitlePtr(windowTitle);
122
}
122
}
123
 
123
 
124
//===========================================================================
124
//=============================================================================
125
void ConsoleCommandExecute (LPCSTR command, BOOL addToHistory) {
125
void ConsoleCommandExecute (LPCSTR command, BOOL addToHistory) {
126
  ConsoleCommandExecutePtr(command,addToHistory);
126
  ConsoleCommandExecutePtr(command,addToHistory);
127
}
127
}
128
 
128
 
129
//===========================================================================
129
//=============================================================================
130
BOOL ConsoleCommandRegister (LPCSTR   command,
130
BOOL ConsoleCommandRegister (LPCSTR   command,
131
                             BOOL     (*handler)(LPCSTR,LPCSTR),
131
                             BOOL     (*handler)(LPCSTR,LPCSTR),
132
                             CATEGORY category,
132
                             CATEGORY category,
133
                             LPCSTR   helpText) {
133
                             LPCSTR   helpText/* = NOHELP*/) {
134
 
134
 
135
	return ConsoleCommandRegisterPtr(command,handler,category,helpText);
135
	return ConsoleCommandRegisterPtr(command,handler,category,helpText);
136
}
136
}
137
 
137
 
138
//===========================================================================
138
//=============================================================================
139
void ConsoleCommandWriteHelp (LPCSTR str) {
139
void ConsoleCommandWriteHelp (LPCSTR str) {
140
	ConsoleCommandWriteHelpPtr(str);
140
	ConsoleCommandWriteHelpPtr(str);
141
}
141
}
142
 
142
 
143
//===========================================================================
143
//=============================================================================
144
void ConsoleCommandUnregister (LPCSTR command) {
144
void ConsoleCommandUnregister (LPCSTR command) {
145
	ConsoleCommandUnregisterPtr(command);
145
	ConsoleCommandUnregisterPtr(command);
146
}
146
}
147
 
147
 
148
//===========================================================================
148
//=============================================================================
149
void ConsolePrintf (LPCSTR str, ...) {
149
void ConsolePrintf (LPCSTR str, ...) {
150
  va_list arglist;
150
  va_list arglist;
151
  va_start(arglist, str);
151
  va_start(arglist, str);
152
 
152
 
153
  char const* token = va_arg(arglist, char const*);
153
  char const* token = va_arg(arglist, char const*);