mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-18 11:19:10 +00:00
Convert custom HeadSpin integer types to standard types from stdint.h
This commit is contained in:
@ -52,9 +52,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
//============================================================================
|
||||
// These errors should only be used in debugging. They should not be shown
|
||||
// in release clients because they are not localized
|
||||
const wchar * NetErrorToString (ENetError code) {
|
||||
const wchar_t * NetErrorToString (ENetError code) {
|
||||
|
||||
static const wchar* s_errors[] = {
|
||||
static const wchar_t* s_errors[] = {
|
||||
L"Success", // kNetSuccess
|
||||
L"Internal Error", // kNetErrInternalError
|
||||
L"No Response From Server", // kNetErrTimeout
|
||||
@ -119,9 +119,9 @@ const wchar * NetErrorToString (ENetError code) {
|
||||
//============================================================================
|
||||
// These errors should only be used in debugging. They should not be shown
|
||||
// in release clients because they are not localized
|
||||
const wchar * NetErrorAsString (ENetError code) {
|
||||
const wchar_t * NetErrorAsString (ENetError code) {
|
||||
|
||||
static const wchar* s_errors[] = {
|
||||
static const wchar_t* s_errors[] = {
|
||||
L"kNetSuccess",
|
||||
L"kNetErrInternalError",
|
||||
L"kNetErrTimeout",
|
||||
|
@ -113,17 +113,17 @@ enum ENetError {
|
||||
// (don't worry, the compiler will tell you if one is missing ;)
|
||||
kNumNetErrors,
|
||||
|
||||
// Net messages require ENetError to be sizeof(dword)
|
||||
kNetErrorForceDword = (dword)(-1)
|
||||
// Net messages require ENetError to be sizeof(uint32_t)
|
||||
kNetErrorForceDword = (uint32_t)(-1)
|
||||
};
|
||||
|
||||
//COMPILER_ASSERT_HEADER(pnNbError, sizeof(ENetError) == sizeof(dword));
|
||||
//COMPILER_ASSERT_HEADER(pnNbError, sizeof(ENetError) == sizeof(uint32_t));
|
||||
|
||||
#define IS_NET_ERROR(a) (((int)(a)) > kNetSuccess)
|
||||
#define IS_NET_SUCCESS(a) (((int)(a)) == kNetSuccess)
|
||||
|
||||
|
||||
const wchar * NetErrorToString (ENetError code); // user-friendly string
|
||||
const wchar * NetErrorAsString (ENetError code); // string version of enum identifier
|
||||
const wchar_t * NetErrorToString (ENetError code); // user-friendly string
|
||||
const wchar_t * NetErrorAsString (ENetError code); // string version of enum identifier
|
||||
|
||||
#endif // pnNbError_inc
|
||||
|
@ -43,17 +43,17 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
#include "pnNbKeys.h"
|
||||
|
||||
// Auth Server
|
||||
byte kAuthDhNData[kNetDiffieHellmanKeyBits / 8] = {0};
|
||||
byte kAuthDhXData[kNetDiffieHellmanKeyBits / 8] = {0};
|
||||
uint8_t kAuthDhNData[kNetDiffieHellmanKeyBits / 8] = {0};
|
||||
uint8_t kAuthDhXData[kNetDiffieHellmanKeyBits / 8] = {0};
|
||||
|
||||
// CSR Server
|
||||
byte kCsrDhNData[kNetDiffieHellmanKeyBits / 8] = {0};
|
||||
byte kCsrDhXData[kNetDiffieHellmanKeyBits / 8] = {0};
|
||||
uint8_t kCsrDhNData[kNetDiffieHellmanKeyBits / 8] = {0};
|
||||
uint8_t kCsrDhXData[kNetDiffieHellmanKeyBits / 8] = {0};
|
||||
|
||||
// Game Server
|
||||
byte kGameDhNData[kNetDiffieHellmanKeyBits / 8] = {0};
|
||||
byte kGameDhXData[kNetDiffieHellmanKeyBits / 8] = {0};
|
||||
uint8_t kGameDhNData[kNetDiffieHellmanKeyBits / 8] = {0};
|
||||
uint8_t kGameDhXData[kNetDiffieHellmanKeyBits / 8] = {0};
|
||||
|
||||
// GateKeeper Server
|
||||
byte kGateKeeperDhNData[kNetDiffieHellmanKeyBits / 8] = {0};
|
||||
byte kGateKeeperDhXData[kNetDiffieHellmanKeyBits / 8] = {0};
|
||||
uint8_t kGateKeeperDhNData[kNetDiffieHellmanKeyBits / 8] = {0};
|
||||
uint8_t kGateKeeperDhXData[kNetDiffieHellmanKeyBits / 8] = {0};
|
||||
|
@ -48,22 +48,22 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
|
||||
// Auth Server
|
||||
static const unsigned kAuthDhGValue = 41;
|
||||
extern byte kAuthDhNData[kNetDiffieHellmanKeyBits / 8];
|
||||
extern byte kAuthDhXData[kNetDiffieHellmanKeyBits / 8];
|
||||
extern uint8_t kAuthDhNData[kNetDiffieHellmanKeyBits / 8];
|
||||
extern uint8_t kAuthDhXData[kNetDiffieHellmanKeyBits / 8];
|
||||
|
||||
// CSR Server
|
||||
static const unsigned kCsrDhGValue = 97;
|
||||
extern byte kCsrDhNData[kNetDiffieHellmanKeyBits / 8];
|
||||
extern byte kCsrDhXData[kNetDiffieHellmanKeyBits / 8];
|
||||
extern uint8_t kCsrDhNData[kNetDiffieHellmanKeyBits / 8];
|
||||
extern uint8_t kCsrDhXData[kNetDiffieHellmanKeyBits / 8];
|
||||
|
||||
// Game Server
|
||||
static const unsigned kGameDhGValue = 73;
|
||||
extern byte kGameDhNData[kNetDiffieHellmanKeyBits / 8];
|
||||
extern byte kGameDhXData[kNetDiffieHellmanKeyBits / 8];
|
||||
extern uint8_t kGameDhNData[kNetDiffieHellmanKeyBits / 8];
|
||||
extern uint8_t kGameDhXData[kNetDiffieHellmanKeyBits / 8];
|
||||
|
||||
// GateKeeper Server
|
||||
static const unsigned kGateKeeperDhGValue = 4;
|
||||
extern byte kGateKeeperDhNData[kNetDiffieHellmanKeyBits / 8];
|
||||
extern byte kGateKeeperDhXData[kNetDiffieHellmanKeyBits / 8];
|
||||
extern uint8_t kGateKeeperDhNData[kNetDiffieHellmanKeyBits / 8];
|
||||
extern uint8_t kGateKeeperDhXData[kNetDiffieHellmanKeyBits / 8];
|
||||
|
||||
#endif // pnNbKeys_inc
|
||||
|
@ -50,9 +50,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
***/
|
||||
|
||||
//============================================================================
|
||||
const wchar * NetProtocolToString (ENetProtocol protocol) {
|
||||
const wchar_t * NetProtocolToString (ENetProtocol protocol) {
|
||||
|
||||
static struct { ENetProtocol protocol; const wchar *name; } s_protocols[] = {
|
||||
static struct { ENetProtocol protocol; const wchar_t *name; } s_protocols[] = {
|
||||
{ kNetProtocolNil, L"kNetProtocolNil" },
|
||||
|
||||
// For test applications
|
||||
|
@ -84,6 +84,6 @@ enum ENetProtocol {
|
||||
// NetProtocolToString as well. Unfortunately, the compiler
|
||||
// cannot enforce this since the protocol values are not
|
||||
// numerically sequential.
|
||||
const wchar * NetProtocolToString (ENetProtocol protocol);
|
||||
const wchar_t * NetProtocolToString (ENetProtocol protocol);
|
||||
|
||||
#endif // pnNbProtocol_inc
|
||||
|
@ -53,26 +53,26 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
*
|
||||
***/
|
||||
|
||||
static wchar s_authAddrConsole[64] = {0};
|
||||
static const wchar * s_authAddrs[] = {
|
||||
static wchar_t s_authAddrConsole[64] = {0};
|
||||
static const wchar_t * s_authAddrs[] = {
|
||||
s_authAddrConsole
|
||||
};
|
||||
|
||||
|
||||
static wchar s_fileAddrConsole[64] = {0};
|
||||
static const wchar * s_fileAddrs[] = {
|
||||
static wchar_t s_fileAddrConsole[64] = {0};
|
||||
static const wchar_t * s_fileAddrs[] = {
|
||||
s_fileAddrConsole
|
||||
};
|
||||
|
||||
|
||||
static wchar s_csrAddrConsole[64] = {0};
|
||||
static const wchar * s_csrAddrs[] = {
|
||||
static wchar_t s_csrAddrConsole[64] = {0};
|
||||
static const wchar_t * s_csrAddrs[] = {
|
||||
s_csrAddrConsole
|
||||
};
|
||||
|
||||
|
||||
static wchar s_gateKeeperAddrConsole[64] = {0};
|
||||
static const wchar * s_gateKeeperAddrs[] = {
|
||||
static wchar_t s_gateKeeperAddrConsole[64] = {0};
|
||||
static const wchar_t * s_gateKeeperAddrs[] = {
|
||||
s_gateKeeperAddrConsole
|
||||
};
|
||||
|
||||
@ -86,14 +86,14 @@ static const wchar * s_gateKeeperAddrs[] = {
|
||||
//============================================================================
|
||||
// Auth
|
||||
//============================================================================
|
||||
unsigned GetAuthSrvHostnames (const wchar *** addrs) {
|
||||
unsigned GetAuthSrvHostnames (const wchar_t *** addrs) {
|
||||
|
||||
*addrs = s_authAddrs;
|
||||
return arrsize(s_authAddrs);
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
void SetAuthSrvHostname (const wchar addr[]) {
|
||||
void SetAuthSrvHostname (const wchar_t addr[]) {
|
||||
|
||||
wcsncpy(s_authAddrConsole, addr, arrsize(s_authAddrConsole));
|
||||
}
|
||||
@ -101,14 +101,14 @@ void SetAuthSrvHostname (const wchar addr[]) {
|
||||
//============================================================================
|
||||
// File
|
||||
//============================================================================
|
||||
unsigned GetFileSrvHostnames (const wchar *** addrs) {
|
||||
unsigned GetFileSrvHostnames (const wchar_t *** addrs) {
|
||||
|
||||
*addrs = s_fileAddrs;
|
||||
return arrsize(s_fileAddrs);
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
void SetFileSrvHostname (const wchar addr[]) {
|
||||
void SetFileSrvHostname (const wchar_t addr[]) {
|
||||
|
||||
wcsncpy(s_fileAddrConsole, addr, arrsize(s_fileAddrConsole));
|
||||
}
|
||||
@ -116,14 +116,14 @@ void SetFileSrvHostname (const wchar addr[]) {
|
||||
//============================================================================
|
||||
// Csr
|
||||
//============================================================================
|
||||
unsigned GetCsrSrvHostnames (const wchar *** addrs) {
|
||||
unsigned GetCsrSrvHostnames (const wchar_t *** addrs) {
|
||||
|
||||
*addrs = s_csrAddrs;
|
||||
return arrsize(s_csrAddrs);
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
void SetCsrSrvHostname (const wchar addr[]) {
|
||||
void SetCsrSrvHostname (const wchar_t addr[]) {
|
||||
|
||||
wcsncpy(s_csrAddrConsole, addr, arrsize(s_csrAddrConsole));
|
||||
}
|
||||
@ -132,14 +132,14 @@ void SetCsrSrvHostname (const wchar addr[]) {
|
||||
//============================================================================
|
||||
// GateKeeper
|
||||
//============================================================================
|
||||
unsigned GetGateKeeperSrvHostnames (const wchar *** addrs) {
|
||||
unsigned GetGateKeeperSrvHostnames (const wchar_t *** addrs) {
|
||||
|
||||
*addrs = s_gateKeeperAddrs;
|
||||
return arrsize(s_gateKeeperAddrs);
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
void SetGateKeeperSrvHostname (const wchar addr[]) {
|
||||
void SetGateKeeperSrvHostname (const wchar_t addr[]) {
|
||||
wcsncpy(s_gateKeeperAddrConsole, addr, arrsize(s_gateKeeperAddrConsole));
|
||||
}
|
||||
|
||||
@ -147,36 +147,36 @@ void SetGateKeeperSrvHostname (const wchar addr[]) {
|
||||
//============================================================================
|
||||
// User-visible Server
|
||||
//============================================================================
|
||||
static wchar s_serverStatusUrl[256] = {0};
|
||||
static wchar s_serverSignupUrl[256] = {0};
|
||||
static wchar s_serverName[256] = {0};
|
||||
static wchar_t s_serverStatusUrl[256] = {0};
|
||||
static wchar_t s_serverSignupUrl[256] = {0};
|
||||
static wchar_t s_serverName[256] = {0};
|
||||
|
||||
//============================================================================
|
||||
const wchar *GetServerStatusUrl () {
|
||||
const wchar_t *GetServerStatusUrl () {
|
||||
return s_serverStatusUrl;
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
void SetServerStatusUrl (const wchar url[]) {
|
||||
void SetServerStatusUrl (const wchar_t url[]) {
|
||||
wcsncpy(s_serverStatusUrl, url, arrsize(s_serverStatusUrl));
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
const wchar *GetServerSignupUrl () {
|
||||
const wchar_t *GetServerSignupUrl () {
|
||||
return s_serverSignupUrl;
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
void SetServerSignupUrl (const wchar url[]) {
|
||||
void SetServerSignupUrl (const wchar_t url[]) {
|
||||
wcsncpy(s_serverSignupUrl, url, arrsize(s_serverSignupUrl));
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
const wchar *GetServerDisplayName () {
|
||||
const wchar_t *GetServerDisplayName () {
|
||||
return s_serverName;
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
void SetServerDisplayName (const wchar name[]) {
|
||||
void SetServerDisplayName (const wchar_t name[]) {
|
||||
wcsncpy(s_serverName, name, arrsize(s_serverName));
|
||||
}
|
||||
|
@ -84,25 +84,25 @@ enum ESrvType {
|
||||
*
|
||||
***/
|
||||
|
||||
unsigned GetAuthSrvHostnames (const wchar *** addrs); // returns addrCount
|
||||
void SetAuthSrvHostname (const wchar addr[]);
|
||||
unsigned GetAuthSrvHostnames (const wchar_t *** addrs); // returns addrCount
|
||||
void SetAuthSrvHostname (const wchar_t addr[]);
|
||||
|
||||
unsigned GetFileSrvHostnames (const wchar *** addrs); // returns addrCount
|
||||
void SetFileSrvHostname (const wchar addr[]);
|
||||
unsigned GetFileSrvHostnames (const wchar_t *** addrs); // returns addrCount
|
||||
void SetFileSrvHostname (const wchar_t addr[]);
|
||||
|
||||
unsigned GetCsrSrvHostnames (const wchar *** addrs); // returns addrCount
|
||||
void SetCsrSrvHostname (const wchar addr[]);
|
||||
unsigned GetCsrSrvHostnames (const wchar_t *** addrs); // returns addrCount
|
||||
void SetCsrSrvHostname (const wchar_t addr[]);
|
||||
|
||||
unsigned GetGateKeeperSrvHostnames (const wchar *** addrs); // returns addrCount
|
||||
void SetGateKeeperSrvHostname (const wchar addr[]);
|
||||
unsigned GetGateKeeperSrvHostnames (const wchar_t *** addrs); // returns addrCount
|
||||
void SetGateKeeperSrvHostname (const wchar_t addr[]);
|
||||
|
||||
const wchar *GetServerStatusUrl ();
|
||||
void SetServerStatusUrl (const wchar url[]);
|
||||
const wchar_t *GetServerStatusUrl ();
|
||||
void SetServerStatusUrl (const wchar_t url[]);
|
||||
|
||||
const wchar *GetServerSignupUrl ();
|
||||
void SetServerSignupUrl (const wchar url[]);
|
||||
const wchar_t *GetServerSignupUrl ();
|
||||
void SetServerSignupUrl (const wchar_t url[]);
|
||||
|
||||
const wchar *GetServerDisplayName ();
|
||||
void SetServerDisplayName (const wchar name[]);
|
||||
const wchar_t *GetServerDisplayName ();
|
||||
void SetServerDisplayName (const wchar_t name[]);
|
||||
|
||||
#endif // pnNbSrvs_inc
|
||||
|
Reference in New Issue
Block a user