mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-13 18:17:49 -04:00
Fix line endings and tabs
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,106 +1,106 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2Csr/pnNpCli2Csr.cpp
|
||||
*
|
||||
***/
|
||||
|
||||
#define USES_PROTOCOL_CLI2CSR
|
||||
#include "../../../Pch.h"
|
||||
#pragma hdrstop
|
||||
|
||||
|
||||
namespace Cli2Csr {
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Cli2Csr message field definitions
|
||||
*
|
||||
***/
|
||||
|
||||
static const NetMsgField kPingRequestFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldTimeMs, // pingTimeMs
|
||||
NET_MSG_FIELD_VAR_COUNT(1, 64 * 1024), // payloadBytes
|
||||
NET_MSG_FIELD_VAR_PTR(), // payload
|
||||
};
|
||||
|
||||
static const NetMsgField kRegisterRequestFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
};
|
||||
|
||||
static const NetMsgField kLoginRequestFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
NET_MSG_FIELD_DWORD(), // clientChallenge
|
||||
kNetMsgFieldAccountName, // csrName
|
||||
kNetMsgFieldShaDigest, // challenge
|
||||
};
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Csr2Cli message field definitions
|
||||
*
|
||||
***/
|
||||
|
||||
static const NetMsgField kPingReplyFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldTimeMs, // pingTimeMs
|
||||
NET_MSG_FIELD_VAR_COUNT(1, 64 * 1024), // payloadBytes
|
||||
NET_MSG_FIELD_VAR_PTR(), // payload
|
||||
};
|
||||
|
||||
static const NetMsgField kRegisterReplyFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
NET_MSG_FIELD_DWORD(), // serverChallenge
|
||||
NET_MSG_FIELD_DWORD(), // latestBuildId
|
||||
};
|
||||
|
||||
static const NetMsgField kLoginReplyFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldENetError, // result
|
||||
kNetMsgFieldUuid, // csrId
|
||||
NET_MSG_FIELD_DWORD(), // csrFlags
|
||||
};
|
||||
|
||||
|
||||
} using namespace Cli2Csr;
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Exports
|
||||
*
|
||||
***/
|
||||
|
||||
const NetMsg kNetMsg_Cli2Csr_PingRequest = NET_MSG(kCli2Csr_PingRequest, kPingRequestFields);
|
||||
const NetMsg kNetMsg_Cli2Csr_RegisterRequest = NET_MSG(kCli2Csr_RegisterRequest, kRegisterRequestFields);
|
||||
const NetMsg kNetMsg_Cli2Csr_LoginRequest = NET_MSG(kCli2Csr_LoginRequest, kLoginRequestFields);
|
||||
|
||||
const NetMsg kNetMsg_Csr2Cli_PingReply = NET_MSG(kCsr2Cli_PingReply, kPingReplyFields);
|
||||
const NetMsg kNetMsg_Csr2Cli_RegisterReply = NET_MSG(kCsr2Cli_RegisterReply, kRegisterReplyFields);
|
||||
const NetMsg kNetMsg_Csr2Cli_LoginReply = NET_MSG(kCsr2Cli_LoginReply, kLoginReplyFields);
|
||||
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2Csr/pnNpCli2Csr.cpp
|
||||
*
|
||||
***/
|
||||
|
||||
#define USES_PROTOCOL_CLI2CSR
|
||||
#include "../../../Pch.h"
|
||||
#pragma hdrstop
|
||||
|
||||
|
||||
namespace Cli2Csr {
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Cli2Csr message field definitions
|
||||
*
|
||||
***/
|
||||
|
||||
static const NetMsgField kPingRequestFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldTimeMs, // pingTimeMs
|
||||
NET_MSG_FIELD_VAR_COUNT(1, 64 * 1024), // payloadBytes
|
||||
NET_MSG_FIELD_VAR_PTR(), // payload
|
||||
};
|
||||
|
||||
static const NetMsgField kRegisterRequestFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
};
|
||||
|
||||
static const NetMsgField kLoginRequestFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
NET_MSG_FIELD_DWORD(), // clientChallenge
|
||||
kNetMsgFieldAccountName, // csrName
|
||||
kNetMsgFieldShaDigest, // challenge
|
||||
};
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Csr2Cli message field definitions
|
||||
*
|
||||
***/
|
||||
|
||||
static const NetMsgField kPingReplyFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldTimeMs, // pingTimeMs
|
||||
NET_MSG_FIELD_VAR_COUNT(1, 64 * 1024), // payloadBytes
|
||||
NET_MSG_FIELD_VAR_PTR(), // payload
|
||||
};
|
||||
|
||||
static const NetMsgField kRegisterReplyFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
NET_MSG_FIELD_DWORD(), // serverChallenge
|
||||
NET_MSG_FIELD_DWORD(), // latestBuildId
|
||||
};
|
||||
|
||||
static const NetMsgField kLoginReplyFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldENetError, // result
|
||||
kNetMsgFieldUuid, // csrId
|
||||
NET_MSG_FIELD_DWORD(), // csrFlags
|
||||
};
|
||||
|
||||
|
||||
} using namespace Cli2Csr;
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Exports
|
||||
*
|
||||
***/
|
||||
|
||||
const NetMsg kNetMsg_Cli2Csr_PingRequest = NET_MSG(kCli2Csr_PingRequest, kPingRequestFields);
|
||||
const NetMsg kNetMsg_Cli2Csr_RegisterRequest = NET_MSG(kCli2Csr_RegisterRequest, kRegisterRequestFields);
|
||||
const NetMsg kNetMsg_Cli2Csr_LoginRequest = NET_MSG(kCli2Csr_LoginRequest, kLoginRequestFields);
|
||||
|
||||
const NetMsg kNetMsg_Csr2Cli_PingReply = NET_MSG(kCsr2Cli_PingReply, kPingReplyFields);
|
||||
const NetMsg kNetMsg_Csr2Cli_RegisterReply = NET_MSG(kCsr2Cli_RegisterReply, kRegisterReplyFields);
|
||||
const NetMsg kNetMsg_Csr2Cli_LoginReply = NET_MSG(kCsr2Cli_LoginReply, kLoginReplyFields);
|
||||
|
||||
|
@ -1,162 +1,162 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2Csr/pnNpCli2Csr.h
|
||||
*
|
||||
***/
|
||||
|
||||
#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNNETPROTOCOL_PRIVATE_PROTOCOLS_CLI2CSR_PNNPCLI2CSR_H
|
||||
#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2Csr/pnNpCli2Csr.h included more than once"
|
||||
#endif
|
||||
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNNETPROTOCOL_PRIVATE_PROTOCOLS_CLI2CSR_PNNPCLI2CSR_H
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* kNetProtocolCli2Csr message ids
|
||||
*
|
||||
***/
|
||||
|
||||
// Because SrvCsr must remain backward compatible with all client builds,
|
||||
// the following enum values may never change under any circumstances.
|
||||
|
||||
//============================================================================
|
||||
// Cli2Csr
|
||||
|
||||
enum {
|
||||
// Misc
|
||||
kCli2Csr_PingRequest = 0,
|
||||
// Encrypt
|
||||
kCli2Csr_RegisterRequest = 1,
|
||||
// Login
|
||||
kCli2Csr_LoginRequest = 2,
|
||||
// Patch
|
||||
kCli2Csr_PatchRequest = 3,
|
||||
|
||||
kNumCli2CsrMessages
|
||||
};
|
||||
COMPILER_ASSERT_HEADER(Cli2Scr, kNumCli2CsrMessages <= (word)-1);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Csr2Cli
|
||||
|
||||
enum {
|
||||
// Misc
|
||||
kCsr2Cli_PingReply = 0,
|
||||
// Encrypt
|
||||
kCsr2Cli_RegisterReply = 1,
|
||||
// Login
|
||||
kCsr2Cli_LoginReply = 2,
|
||||
// Patch
|
||||
kCli2Csr_PatchReply = 3,
|
||||
|
||||
kNumCsr2CliMessages
|
||||
};
|
||||
COMPILER_ASSERT_HEADER(Cli2Scr, kNumCsr2CliMessages <= (word)-1);
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Networked structures
|
||||
*
|
||||
***/
|
||||
#include <PshPack1.h>
|
||||
|
||||
//============================================================================
|
||||
// Connect packet
|
||||
|
||||
struct Cli2Csr_ConnData {
|
||||
dword dataBytes;
|
||||
};
|
||||
struct Cli2Csr_Connect {
|
||||
AsyncSocketConnectPacket hdr;
|
||||
Cli2Csr_ConnData data;
|
||||
};
|
||||
|
||||
//============================================================================
|
||||
// Message header
|
||||
|
||||
struct Cli2Csr_MsgHeader {
|
||||
dword messageId;
|
||||
dword transId;
|
||||
};
|
||||
|
||||
//============================================================================
|
||||
// Cli --> Csr message structures
|
||||
|
||||
// PingRequest
|
||||
extern const NetMsg kNetMsg_Cli2Csr_PingRequest;
|
||||
struct Cli2Csr_PingRequest : Cli2Csr_MsgHeader {
|
||||
dword pingTimeMs;
|
||||
dword payloadBytes;
|
||||
byte payload[1]; // [payloadBytes]
|
||||
};
|
||||
|
||||
// RegisterRequest
|
||||
extern const NetMsg kNetMsg_Cli2Csr_RegisterRequest;
|
||||
struct Cli2Csr_RegisterRequest : Cli2Csr_MsgHeader {
|
||||
};
|
||||
|
||||
// LoginRequest
|
||||
extern const NetMsg kNetMsg_Cli2Csr_LoginRequest;
|
||||
struct Cli2Csr_LoginRequest : Cli2Csr_MsgHeader {
|
||||
dword clientChallenge;
|
||||
wchar csrName[kMaxAccountNameLength];
|
||||
ShaDigest challengeHash;
|
||||
};
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Csr --> Cli message structures
|
||||
|
||||
// PingReply
|
||||
extern const NetMsg kNetMsg_Csr2Cli_PingReply;
|
||||
struct Csr2Cli_PingReply : Cli2Csr_MsgHeader {
|
||||
dword pingTimeMs;
|
||||
dword payloadBytes;
|
||||
byte payload[1]; // [payloadBytes]
|
||||
};
|
||||
|
||||
// RegisterReply
|
||||
extern const NetMsg kNetMsg_Csr2Cli_RegisterReply;
|
||||
struct Csr2Cli_RegisterReply : Cli2Csr_MsgHeader {
|
||||
dword serverChallenge;
|
||||
dword csrBuildId; // buildId of the latest csr client
|
||||
};
|
||||
|
||||
// LoginReply
|
||||
extern const NetMsg kNetMsg_Csr2Cli_LoginReply;
|
||||
struct Csr2Cli_LoginReply : Cli2Csr_MsgHeader {
|
||||
ENetError result;
|
||||
Uuid csrId;
|
||||
dword csrFlags;
|
||||
};
|
||||
|
||||
|
||||
#include <PopPack.h>
|
||||
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2Csr/pnNpCli2Csr.h
|
||||
*
|
||||
***/
|
||||
|
||||
#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNNETPROTOCOL_PRIVATE_PROTOCOLS_CLI2CSR_PNNPCLI2CSR_H
|
||||
#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2Csr/pnNpCli2Csr.h included more than once"
|
||||
#endif
|
||||
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNNETPROTOCOL_PRIVATE_PROTOCOLS_CLI2CSR_PNNPCLI2CSR_H
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* kNetProtocolCli2Csr message ids
|
||||
*
|
||||
***/
|
||||
|
||||
// Because SrvCsr must remain backward compatible with all client builds,
|
||||
// the following enum values may never change under any circumstances.
|
||||
|
||||
//============================================================================
|
||||
// Cli2Csr
|
||||
|
||||
enum {
|
||||
// Misc
|
||||
kCli2Csr_PingRequest = 0,
|
||||
// Encrypt
|
||||
kCli2Csr_RegisterRequest = 1,
|
||||
// Login
|
||||
kCli2Csr_LoginRequest = 2,
|
||||
// Patch
|
||||
kCli2Csr_PatchRequest = 3,
|
||||
|
||||
kNumCli2CsrMessages
|
||||
};
|
||||
COMPILER_ASSERT_HEADER(Cli2Scr, kNumCli2CsrMessages <= (word)-1);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Csr2Cli
|
||||
|
||||
enum {
|
||||
// Misc
|
||||
kCsr2Cli_PingReply = 0,
|
||||
// Encrypt
|
||||
kCsr2Cli_RegisterReply = 1,
|
||||
// Login
|
||||
kCsr2Cli_LoginReply = 2,
|
||||
// Patch
|
||||
kCli2Csr_PatchReply = 3,
|
||||
|
||||
kNumCsr2CliMessages
|
||||
};
|
||||
COMPILER_ASSERT_HEADER(Cli2Scr, kNumCsr2CliMessages <= (word)-1);
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Networked structures
|
||||
*
|
||||
***/
|
||||
#include <PshPack1.h>
|
||||
|
||||
//============================================================================
|
||||
// Connect packet
|
||||
|
||||
struct Cli2Csr_ConnData {
|
||||
dword dataBytes;
|
||||
};
|
||||
struct Cli2Csr_Connect {
|
||||
AsyncSocketConnectPacket hdr;
|
||||
Cli2Csr_ConnData data;
|
||||
};
|
||||
|
||||
//============================================================================
|
||||
// Message header
|
||||
|
||||
struct Cli2Csr_MsgHeader {
|
||||
dword messageId;
|
||||
dword transId;
|
||||
};
|
||||
|
||||
//============================================================================
|
||||
// Cli --> Csr message structures
|
||||
|
||||
// PingRequest
|
||||
extern const NetMsg kNetMsg_Cli2Csr_PingRequest;
|
||||
struct Cli2Csr_PingRequest : Cli2Csr_MsgHeader {
|
||||
dword pingTimeMs;
|
||||
dword payloadBytes;
|
||||
byte payload[1]; // [payloadBytes]
|
||||
};
|
||||
|
||||
// RegisterRequest
|
||||
extern const NetMsg kNetMsg_Cli2Csr_RegisterRequest;
|
||||
struct Cli2Csr_RegisterRequest : Cli2Csr_MsgHeader {
|
||||
};
|
||||
|
||||
// LoginRequest
|
||||
extern const NetMsg kNetMsg_Cli2Csr_LoginRequest;
|
||||
struct Cli2Csr_LoginRequest : Cli2Csr_MsgHeader {
|
||||
dword clientChallenge;
|
||||
wchar csrName[kMaxAccountNameLength];
|
||||
ShaDigest challengeHash;
|
||||
};
|
||||
|
||||
|
||||
//============================================================================
|
||||
// Csr --> Cli message structures
|
||||
|
||||
// PingReply
|
||||
extern const NetMsg kNetMsg_Csr2Cli_PingReply;
|
||||
struct Csr2Cli_PingReply : Cli2Csr_MsgHeader {
|
||||
dword pingTimeMs;
|
||||
dword payloadBytes;
|
||||
byte payload[1]; // [payloadBytes]
|
||||
};
|
||||
|
||||
// RegisterReply
|
||||
extern const NetMsg kNetMsg_Csr2Cli_RegisterReply;
|
||||
struct Csr2Cli_RegisterReply : Cli2Csr_MsgHeader {
|
||||
dword serverChallenge;
|
||||
dword csrBuildId; // buildId of the latest csr client
|
||||
};
|
||||
|
||||
// LoginReply
|
||||
extern const NetMsg kNetMsg_Csr2Cli_LoginReply;
|
||||
struct Csr2Cli_LoginReply : Cli2Csr_MsgHeader {
|
||||
ENetError result;
|
||||
Uuid csrId;
|
||||
dword csrFlags;
|
||||
};
|
||||
|
||||
|
||||
#include <PopPack.h>
|
||||
|
||||
|
@ -1,34 +1,34 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2File/pnNpCli2File.cpp
|
||||
*
|
||||
***/
|
||||
|
||||
#define USES_PROTOCOL_CLI2FILE
|
||||
#include "../../../Pch.h"
|
||||
#pragma hdrstop
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2File/pnNpCli2File.cpp
|
||||
*
|
||||
***/
|
||||
|
||||
#define USES_PROTOCOL_CLI2FILE
|
||||
#include "../../../Pch.h"
|
||||
#pragma hdrstop
|
||||
|
@ -1,195 +1,195 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2File/pnNpCli2File.h
|
||||
*
|
||||
***/
|
||||
|
||||
#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNNETPROTOCOL_PRIVATE_PROTOCOLS_CLI2FILE_PNNPCLI2FILE_H
|
||||
#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2File/pnNpCli2File.h included more than once"
|
||||
#endif
|
||||
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNNETPROTOCOL_PRIVATE_PROTOCOLS_CLI2FILE_PNNPCLI2FILE_H
|
||||
|
||||
|
||||
// Because SrvFile must remain backward compatible with all client builds,
|
||||
// the following enum values may never change under any circumstances.
|
||||
|
||||
// kNetProtocolCli2File messages
|
||||
enum {
|
||||
// Global
|
||||
kCli2File_PingRequest = 0,
|
||||
|
||||
// File server-related
|
||||
kCli2File_BuildIdRequest = 10,
|
||||
// 11 through 19 skipped
|
||||
|
||||
// Cache-related
|
||||
kCli2File_ManifestRequest = 20,
|
||||
kCli2File_FileDownloadRequest = 21,
|
||||
kCli2File_ManifestEntryAck = 22,
|
||||
kCli2File_FileDownloadChunkAck = 23,
|
||||
// 24 through 29 skipped
|
||||
|
||||
kCli2File_UNUSED_1 = 30,
|
||||
};
|
||||
|
||||
enum {
|
||||
// Global
|
||||
kFile2Cli_PingReply = 0,
|
||||
|
||||
// File server-related
|
||||
kFile2Cli_BuildIdReply = 10,
|
||||
kFile2Cli_BuildIdUpdate = 11,
|
||||
// 12 through 19 skipped
|
||||
|
||||
// Cache-related
|
||||
kFile2Cli_ManifestReply = 20,
|
||||
kFile2Cli_FileDownloadReply = 21,
|
||||
// 22 through 29 skipped
|
||||
|
||||
kFile2Cli_UNUSED_1 = 30,
|
||||
};
|
||||
|
||||
// we have a constant build id so all clients can connect to us, no matter what version
|
||||
static const unsigned kFileSrvBuildId = 0;
|
||||
|
||||
|
||||
//============================================================================
|
||||
// BEGIN PACKED DATA STRUCTURES
|
||||
//============================================================================
|
||||
#include <PshPack1.h>
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Cli2File connect packet
|
||||
*
|
||||
***/
|
||||
|
||||
struct Cli2File_ConnData {
|
||||
dword dataBytes;
|
||||
dword buildId;
|
||||
unsigned serverType;
|
||||
};
|
||||
struct Cli2File_Connect {
|
||||
AsyncSocketConnectPacket hdr;
|
||||
Cli2File_ConnData data;
|
||||
};
|
||||
|
||||
struct Cli2File_MsgHeader {
|
||||
dword messageBytes;
|
||||
dword messageId;
|
||||
};
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Cli2File message structures
|
||||
*
|
||||
***/
|
||||
|
||||
// PingRequest
|
||||
struct Cli2File_PingRequest : Cli2File_MsgHeader {
|
||||
dword pingTimeMs;
|
||||
};
|
||||
|
||||
// BuildIdRequest
|
||||
struct Cli2File_BuildIdRequest : Cli2File_MsgHeader {
|
||||
dword transId;
|
||||
};
|
||||
|
||||
// ManifestRequest
|
||||
struct Cli2File_ManifestRequest : Cli2File_MsgHeader {
|
||||
dword transId;
|
||||
wchar group[MAX_PATH];
|
||||
unsigned buildId; // 0 = newest
|
||||
};
|
||||
struct Cli2File_ManifestEntryAck : Cli2File_MsgHeader {
|
||||
dword transId;
|
||||
dword readerId;
|
||||
};
|
||||
|
||||
// FileDownloadRequest
|
||||
struct Cli2File_FileDownloadRequest : Cli2File_MsgHeader {
|
||||
dword transId;
|
||||
wchar filename[MAX_PATH];
|
||||
unsigned buildId; // 0 = newest
|
||||
};
|
||||
struct Cli2File_FileDownloadChunkAck : Cli2File_MsgHeader {
|
||||
dword transId;
|
||||
dword readerId;
|
||||
};
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* File2Cli message structures
|
||||
*
|
||||
***/
|
||||
|
||||
// PingReply
|
||||
struct File2Cli_PingReply : Cli2File_MsgHeader {
|
||||
dword pingTimeMs;
|
||||
};
|
||||
|
||||
// BuildIdReply
|
||||
struct File2Cli_BuildIdReply : Cli2File_MsgHeader {
|
||||
dword transId;
|
||||
ENetError result;
|
||||
unsigned buildId;
|
||||
};
|
||||
|
||||
// BuildIdUpdate
|
||||
struct File2Cli_BuildIdUpdate : Cli2File_MsgHeader {
|
||||
unsigned buildId;
|
||||
};
|
||||
|
||||
// ManifestReply
|
||||
struct File2Cli_ManifestReply : Cli2File_MsgHeader {
|
||||
dword transId;
|
||||
ENetError result;
|
||||
dword readerId;
|
||||
dword numFiles; // total number of files
|
||||
dword wcharCount; // size of the buffer
|
||||
wchar manifestData[1]; // manifestData[wcharCount], actually
|
||||
};
|
||||
|
||||
// FileDownloadReply
|
||||
struct File2Cli_FileDownloadReply : Cli2File_MsgHeader {
|
||||
dword transId;
|
||||
ENetError result;
|
||||
dword readerId;
|
||||
dword totalFileSize;
|
||||
dword byteCount;
|
||||
byte fileData[1]; // fileData[byteCount], actually
|
||||
};
|
||||
|
||||
|
||||
//============================================================================
|
||||
// END PACKED DATA STRUCTURES
|
||||
//============================================================================
|
||||
#include <PopPack.h>
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2File/pnNpCli2File.h
|
||||
*
|
||||
***/
|
||||
|
||||
#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNNETPROTOCOL_PRIVATE_PROTOCOLS_CLI2FILE_PNNPCLI2FILE_H
|
||||
#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2File/pnNpCli2File.h included more than once"
|
||||
#endif
|
||||
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNNETPROTOCOL_PRIVATE_PROTOCOLS_CLI2FILE_PNNPCLI2FILE_H
|
||||
|
||||
|
||||
// Because SrvFile must remain backward compatible with all client builds,
|
||||
// the following enum values may never change under any circumstances.
|
||||
|
||||
// kNetProtocolCli2File messages
|
||||
enum {
|
||||
// Global
|
||||
kCli2File_PingRequest = 0,
|
||||
|
||||
// File server-related
|
||||
kCli2File_BuildIdRequest = 10,
|
||||
// 11 through 19 skipped
|
||||
|
||||
// Cache-related
|
||||
kCli2File_ManifestRequest = 20,
|
||||
kCli2File_FileDownloadRequest = 21,
|
||||
kCli2File_ManifestEntryAck = 22,
|
||||
kCli2File_FileDownloadChunkAck = 23,
|
||||
// 24 through 29 skipped
|
||||
|
||||
kCli2File_UNUSED_1 = 30,
|
||||
};
|
||||
|
||||
enum {
|
||||
// Global
|
||||
kFile2Cli_PingReply = 0,
|
||||
|
||||
// File server-related
|
||||
kFile2Cli_BuildIdReply = 10,
|
||||
kFile2Cli_BuildIdUpdate = 11,
|
||||
// 12 through 19 skipped
|
||||
|
||||
// Cache-related
|
||||
kFile2Cli_ManifestReply = 20,
|
||||
kFile2Cli_FileDownloadReply = 21,
|
||||
// 22 through 29 skipped
|
||||
|
||||
kFile2Cli_UNUSED_1 = 30,
|
||||
};
|
||||
|
||||
// we have a constant build id so all clients can connect to us, no matter what version
|
||||
static const unsigned kFileSrvBuildId = 0;
|
||||
|
||||
|
||||
//============================================================================
|
||||
// BEGIN PACKED DATA STRUCTURES
|
||||
//============================================================================
|
||||
#include <PshPack1.h>
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Cli2File connect packet
|
||||
*
|
||||
***/
|
||||
|
||||
struct Cli2File_ConnData {
|
||||
dword dataBytes;
|
||||
dword buildId;
|
||||
unsigned serverType;
|
||||
};
|
||||
struct Cli2File_Connect {
|
||||
AsyncSocketConnectPacket hdr;
|
||||
Cli2File_ConnData data;
|
||||
};
|
||||
|
||||
struct Cli2File_MsgHeader {
|
||||
dword messageBytes;
|
||||
dword messageId;
|
||||
};
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Cli2File message structures
|
||||
*
|
||||
***/
|
||||
|
||||
// PingRequest
|
||||
struct Cli2File_PingRequest : Cli2File_MsgHeader {
|
||||
dword pingTimeMs;
|
||||
};
|
||||
|
||||
// BuildIdRequest
|
||||
struct Cli2File_BuildIdRequest : Cli2File_MsgHeader {
|
||||
dword transId;
|
||||
};
|
||||
|
||||
// ManifestRequest
|
||||
struct Cli2File_ManifestRequest : Cli2File_MsgHeader {
|
||||
dword transId;
|
||||
wchar group[MAX_PATH];
|
||||
unsigned buildId; // 0 = newest
|
||||
};
|
||||
struct Cli2File_ManifestEntryAck : Cli2File_MsgHeader {
|
||||
dword transId;
|
||||
dword readerId;
|
||||
};
|
||||
|
||||
// FileDownloadRequest
|
||||
struct Cli2File_FileDownloadRequest : Cli2File_MsgHeader {
|
||||
dword transId;
|
||||
wchar filename[MAX_PATH];
|
||||
unsigned buildId; // 0 = newest
|
||||
};
|
||||
struct Cli2File_FileDownloadChunkAck : Cli2File_MsgHeader {
|
||||
dword transId;
|
||||
dword readerId;
|
||||
};
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* File2Cli message structures
|
||||
*
|
||||
***/
|
||||
|
||||
// PingReply
|
||||
struct File2Cli_PingReply : Cli2File_MsgHeader {
|
||||
dword pingTimeMs;
|
||||
};
|
||||
|
||||
// BuildIdReply
|
||||
struct File2Cli_BuildIdReply : Cli2File_MsgHeader {
|
||||
dword transId;
|
||||
ENetError result;
|
||||
unsigned buildId;
|
||||
};
|
||||
|
||||
// BuildIdUpdate
|
||||
struct File2Cli_BuildIdUpdate : Cli2File_MsgHeader {
|
||||
unsigned buildId;
|
||||
};
|
||||
|
||||
// ManifestReply
|
||||
struct File2Cli_ManifestReply : Cli2File_MsgHeader {
|
||||
dword transId;
|
||||
ENetError result;
|
||||
dword readerId;
|
||||
dword numFiles; // total number of files
|
||||
dword wcharCount; // size of the buffer
|
||||
wchar manifestData[1]; // manifestData[wcharCount], actually
|
||||
};
|
||||
|
||||
// FileDownloadReply
|
||||
struct File2Cli_FileDownloadReply : Cli2File_MsgHeader {
|
||||
dword transId;
|
||||
ENetError result;
|
||||
dword readerId;
|
||||
dword totalFileSize;
|
||||
dword byteCount;
|
||||
byte fileData[1]; // fileData[byteCount], actually
|
||||
};
|
||||
|
||||
|
||||
//============================================================================
|
||||
// END PACKED DATA STRUCTURES
|
||||
//============================================================================
|
||||
#include <PopPack.h>
|
||||
|
@ -1,101 +1,101 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2Game/pnNpCli2Game.cpp
|
||||
*
|
||||
***/
|
||||
|
||||
#define USES_PROTOCOL_CLI2GAME
|
||||
#include "../../../Pch.h"
|
||||
#pragma hdrstop
|
||||
|
||||
|
||||
namespace Cli2Game {
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Cli2Game message definitions
|
||||
*
|
||||
***/
|
||||
|
||||
static const NetMsgField kPingRequestFields[] = {
|
||||
kNetMsgFieldTimeMs, // pingTimeMs
|
||||
};
|
||||
|
||||
static const NetMsgField kJoinAgeRequestFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
NET_MSG_FIELD_DWORD(), // ageMcpId
|
||||
kNetMsgFieldUuid, // accountUuid
|
||||
NET_MSG_FIELD_DWORD(), // playerInt
|
||||
};
|
||||
|
||||
static const NetMsgField kPropagateBufferFields[] = {
|
||||
NET_MSG_FIELD_DWORD(), // type
|
||||
NET_MSG_FIELD_VAR_COUNT(1, 1024 * 1024), // bytes
|
||||
NET_MSG_FIELD_VAR_PTR(), // buffer
|
||||
};
|
||||
|
||||
static const NetMsgField kGameMgrMsgFields[] = {
|
||||
NET_MSG_FIELD_VAR_COUNT(1, 1024 * 1024), // bytes
|
||||
NET_MSG_FIELD_VAR_PTR(), // buffer
|
||||
};
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Game2Cli message fields
|
||||
*
|
||||
***/
|
||||
|
||||
static const NetMsgField kPingReplyFields[] = {
|
||||
kNetMsgFieldTimeMs, // pingTimeMs
|
||||
};
|
||||
|
||||
static const NetMsgField kJoinAgeReplyFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldENetError, // result
|
||||
};
|
||||
|
||||
} using namespace Cli2Game;
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Exported data
|
||||
*
|
||||
***/
|
||||
|
||||
// Cli2Game
|
||||
const NetMsg kNetMsg_Cli2Game_PingRequest = NET_MSG(kCli2Game_PingRequest, kPingRequestFields);
|
||||
const NetMsg kNetMsg_Cli2Game_JoinAgeRequest = NET_MSG(kCli2Game_JoinAgeRequest, kJoinAgeRequestFields);
|
||||
const NetMsg kNetMsg_Cli2Game_PropagateBuffer = NET_MSG(kCli2Game_PropagateBuffer, kPropagateBufferFields);
|
||||
const NetMsg kNetMsg_Cli2Game_GameMgrMsg = NET_MSG(kCli2Game_GameMgrMsg, kGameMgrMsgFields);
|
||||
|
||||
// Game2Cli
|
||||
const NetMsg kNetMsg_Game2Cli_PingReply = NET_MSG(kGame2Cli_PingReply, kPingReplyFields);
|
||||
const NetMsg kNetMsg_Game2Cli_JoinAgeReply = NET_MSG(kGame2Cli_JoinAgeReply, kJoinAgeReplyFields);
|
||||
const NetMsg kNetMsg_Game2Cli_PropagateBuffer = NET_MSG(kGame2Cli_PropagateBuffer, kPropagateBufferFields);
|
||||
const NetMsg kNetMsg_Game2Cli_GameMgrMsg = NET_MSG(kGame2Cli_GameMgrMsg, kGameMgrMsgFields);
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2Game/pnNpCli2Game.cpp
|
||||
*
|
||||
***/
|
||||
|
||||
#define USES_PROTOCOL_CLI2GAME
|
||||
#include "../../../Pch.h"
|
||||
#pragma hdrstop
|
||||
|
||||
|
||||
namespace Cli2Game {
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Cli2Game message definitions
|
||||
*
|
||||
***/
|
||||
|
||||
static const NetMsgField kPingRequestFields[] = {
|
||||
kNetMsgFieldTimeMs, // pingTimeMs
|
||||
};
|
||||
|
||||
static const NetMsgField kJoinAgeRequestFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
NET_MSG_FIELD_DWORD(), // ageMcpId
|
||||
kNetMsgFieldUuid, // accountUuid
|
||||
NET_MSG_FIELD_DWORD(), // playerInt
|
||||
};
|
||||
|
||||
static const NetMsgField kPropagateBufferFields[] = {
|
||||
NET_MSG_FIELD_DWORD(), // type
|
||||
NET_MSG_FIELD_VAR_COUNT(1, 1024 * 1024), // bytes
|
||||
NET_MSG_FIELD_VAR_PTR(), // buffer
|
||||
};
|
||||
|
||||
static const NetMsgField kGameMgrMsgFields[] = {
|
||||
NET_MSG_FIELD_VAR_COUNT(1, 1024 * 1024), // bytes
|
||||
NET_MSG_FIELD_VAR_PTR(), // buffer
|
||||
};
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Game2Cli message fields
|
||||
*
|
||||
***/
|
||||
|
||||
static const NetMsgField kPingReplyFields[] = {
|
||||
kNetMsgFieldTimeMs, // pingTimeMs
|
||||
};
|
||||
|
||||
static const NetMsgField kJoinAgeReplyFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldENetError, // result
|
||||
};
|
||||
|
||||
} using namespace Cli2Game;
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Exported data
|
||||
*
|
||||
***/
|
||||
|
||||
// Cli2Game
|
||||
const NetMsg kNetMsg_Cli2Game_PingRequest = NET_MSG(kCli2Game_PingRequest, kPingRequestFields);
|
||||
const NetMsg kNetMsg_Cli2Game_JoinAgeRequest = NET_MSG(kCli2Game_JoinAgeRequest, kJoinAgeRequestFields);
|
||||
const NetMsg kNetMsg_Cli2Game_PropagateBuffer = NET_MSG(kCli2Game_PropagateBuffer, kPropagateBufferFields);
|
||||
const NetMsg kNetMsg_Cli2Game_GameMgrMsg = NET_MSG(kCli2Game_GameMgrMsg, kGameMgrMsgFields);
|
||||
|
||||
// Game2Cli
|
||||
const NetMsg kNetMsg_Game2Cli_PingReply = NET_MSG(kGame2Cli_PingReply, kPingReplyFields);
|
||||
const NetMsg kNetMsg_Game2Cli_JoinAgeReply = NET_MSG(kGame2Cli_JoinAgeReply, kJoinAgeReplyFields);
|
||||
const NetMsg kNetMsg_Game2Cli_PropagateBuffer = NET_MSG(kGame2Cli_PropagateBuffer, kPropagateBufferFields);
|
||||
const NetMsg kNetMsg_Game2Cli_GameMgrMsg = NET_MSG(kGame2Cli_GameMgrMsg, kGameMgrMsgFields);
|
||||
|
@ -1,178 +1,178 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2Game/pnNpCli2Game.h
|
||||
*
|
||||
***/
|
||||
|
||||
#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNNETPROTOCOL_PRIVATE_PROTOCOLS_CLI2GAME_PNNPCLI2GAME_H
|
||||
#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2Game/pnNpCli2Game.h included more than once"
|
||||
#endif
|
||||
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNNETPROTOCOL_PRIVATE_PROTOCOLS_CLI2GAME_PNNPCLI2GAME_H
|
||||
|
||||
|
||||
// kNetProtocolCli2Game messages
|
||||
enum {
|
||||
// Global
|
||||
kCli2Game_PingRequest,
|
||||
|
||||
// Age
|
||||
kCli2Game_JoinAgeRequest,
|
||||
|
||||
// Game
|
||||
kCli2Game_PropagateBuffer,
|
||||
kCli2Game_GameMgrMsg,
|
||||
|
||||
kNumCli2GameMessages
|
||||
};
|
||||
COMPILER_ASSERT_HEADER(Cli2Game, kNumCli2GameMessages <= (word)-1);
|
||||
|
||||
enum {
|
||||
// Global
|
||||
kGame2Cli_PingReply,
|
||||
|
||||
// Age
|
||||
kGame2Cli_JoinAgeReply,
|
||||
|
||||
// Game
|
||||
kGame2Cli_PropagateBuffer,
|
||||
kGame2Cli_GameMgrMsg,
|
||||
|
||||
kNumGame2CliMessages
|
||||
};
|
||||
COMPILER_ASSERT_HEADER(Cli2Game, kNumGame2CliMessages <= (word)-1);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// BEGIN PACKED DATA STRUCTURES
|
||||
//============================================================================
|
||||
#include <PshPack1.h>
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Cli2Game connect packet
|
||||
*
|
||||
***/
|
||||
|
||||
struct Cli2Game_ConnData {
|
||||
dword dataBytes;
|
||||
Uuid accountUuid;
|
||||
Uuid ageUuid;
|
||||
};
|
||||
struct Cli2Game_Connect {
|
||||
AsyncSocketConnectPacket hdr;
|
||||
Cli2Game_ConnData data;
|
||||
};
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Cli2Game message structures
|
||||
*
|
||||
***/
|
||||
|
||||
// PingRequest
|
||||
extern const NetMsg kNetMsg_Cli2Game_PingRequest;
|
||||
struct Cli2Game_PingRequest {
|
||||
dword messageId;
|
||||
dword pingTimeMs;
|
||||
};
|
||||
|
||||
// JoinAgeRequest
|
||||
extern const NetMsg kNetMsg_Cli2Game_JoinAgeRequest;
|
||||
struct Cli2Game_JoinAgeRequest {
|
||||
dword messageId;
|
||||
dword transId;
|
||||
dword ageMcpId;
|
||||
Uuid accountUuid;
|
||||
dword playerInt;
|
||||
};
|
||||
|
||||
// PropagateBuffer
|
||||
extern const NetMsg kNetMsg_Cli2Game_PropagateBuffer;
|
||||
struct Cli2Game_PropagateBuffer {
|
||||
dword messageId;
|
||||
dword type;
|
||||
dword bytes;
|
||||
byte buffer[1]; // actually, buffer[bytes]
|
||||
// no more fields
|
||||
};
|
||||
|
||||
// GameMgrMsg
|
||||
extern const NetMsg kNetMsg_Cli2Game_GameMgrMsg;
|
||||
struct Cli2Game_GameMgrMsg {
|
||||
dword messageId;
|
||||
dword bytes;
|
||||
byte buffer[1]; // actually: buffer[bytes]
|
||||
};
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Game2Cli message structures
|
||||
*
|
||||
***/
|
||||
|
||||
// PingReply
|
||||
extern const NetMsg kNetMsg_Game2Cli_PingReply;
|
||||
struct Game2Cli_PingReply{
|
||||
dword messageId;
|
||||
dword pingTimeMs;
|
||||
};
|
||||
|
||||
// JoinAgeReply
|
||||
extern const NetMsg kNetMsg_Game2Cli_JoinAgeReply;
|
||||
struct Game2Cli_JoinAgeReply {
|
||||
dword messageId;
|
||||
dword transId;
|
||||
ENetError result;
|
||||
};
|
||||
|
||||
// PropagateBuffer
|
||||
extern const NetMsg kNetMsg_Game2Cli_PropagateBuffer;
|
||||
struct Game2Cli_PropagateBuffer {
|
||||
dword messageId;
|
||||
dword type;
|
||||
dword bytes;
|
||||
byte buffer[1]; // actually, buffer[bytes]
|
||||
// no more fields
|
||||
};
|
||||
|
||||
// GameMgrMsg
|
||||
extern const NetMsg kNetMsg_Game2Cli_GameMgrMsg;
|
||||
struct Game2Cli_GameMgrMsg {
|
||||
dword messageId;
|
||||
dword bytes;
|
||||
byte buffer[1]; // actually: buffer[bytes]
|
||||
};
|
||||
|
||||
|
||||
//============================================================================
|
||||
// END PACKED DATA STRUCTURES
|
||||
//============================================================================
|
||||
#include <PopPack.h>
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2Game/pnNpCli2Game.h
|
||||
*
|
||||
***/
|
||||
|
||||
#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNNETPROTOCOL_PRIVATE_PROTOCOLS_CLI2GAME_PNNPCLI2GAME_H
|
||||
#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2Game/pnNpCli2Game.h included more than once"
|
||||
#endif
|
||||
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNNETPROTOCOL_PRIVATE_PROTOCOLS_CLI2GAME_PNNPCLI2GAME_H
|
||||
|
||||
|
||||
// kNetProtocolCli2Game messages
|
||||
enum {
|
||||
// Global
|
||||
kCli2Game_PingRequest,
|
||||
|
||||
// Age
|
||||
kCli2Game_JoinAgeRequest,
|
||||
|
||||
// Game
|
||||
kCli2Game_PropagateBuffer,
|
||||
kCli2Game_GameMgrMsg,
|
||||
|
||||
kNumCli2GameMessages
|
||||
};
|
||||
COMPILER_ASSERT_HEADER(Cli2Game, kNumCli2GameMessages <= (word)-1);
|
||||
|
||||
enum {
|
||||
// Global
|
||||
kGame2Cli_PingReply,
|
||||
|
||||
// Age
|
||||
kGame2Cli_JoinAgeReply,
|
||||
|
||||
// Game
|
||||
kGame2Cli_PropagateBuffer,
|
||||
kGame2Cli_GameMgrMsg,
|
||||
|
||||
kNumGame2CliMessages
|
||||
};
|
||||
COMPILER_ASSERT_HEADER(Cli2Game, kNumGame2CliMessages <= (word)-1);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// BEGIN PACKED DATA STRUCTURES
|
||||
//============================================================================
|
||||
#include <PshPack1.h>
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Cli2Game connect packet
|
||||
*
|
||||
***/
|
||||
|
||||
struct Cli2Game_ConnData {
|
||||
dword dataBytes;
|
||||
Uuid accountUuid;
|
||||
Uuid ageUuid;
|
||||
};
|
||||
struct Cli2Game_Connect {
|
||||
AsyncSocketConnectPacket hdr;
|
||||
Cli2Game_ConnData data;
|
||||
};
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Cli2Game message structures
|
||||
*
|
||||
***/
|
||||
|
||||
// PingRequest
|
||||
extern const NetMsg kNetMsg_Cli2Game_PingRequest;
|
||||
struct Cli2Game_PingRequest {
|
||||
dword messageId;
|
||||
dword pingTimeMs;
|
||||
};
|
||||
|
||||
// JoinAgeRequest
|
||||
extern const NetMsg kNetMsg_Cli2Game_JoinAgeRequest;
|
||||
struct Cli2Game_JoinAgeRequest {
|
||||
dword messageId;
|
||||
dword transId;
|
||||
dword ageMcpId;
|
||||
Uuid accountUuid;
|
||||
dword playerInt;
|
||||
};
|
||||
|
||||
// PropagateBuffer
|
||||
extern const NetMsg kNetMsg_Cli2Game_PropagateBuffer;
|
||||
struct Cli2Game_PropagateBuffer {
|
||||
dword messageId;
|
||||
dword type;
|
||||
dword bytes;
|
||||
byte buffer[1]; // actually, buffer[bytes]
|
||||
// no more fields
|
||||
};
|
||||
|
||||
// GameMgrMsg
|
||||
extern const NetMsg kNetMsg_Cli2Game_GameMgrMsg;
|
||||
struct Cli2Game_GameMgrMsg {
|
||||
dword messageId;
|
||||
dword bytes;
|
||||
byte buffer[1]; // actually: buffer[bytes]
|
||||
};
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Game2Cli message structures
|
||||
*
|
||||
***/
|
||||
|
||||
// PingReply
|
||||
extern const NetMsg kNetMsg_Game2Cli_PingReply;
|
||||
struct Game2Cli_PingReply{
|
||||
dword messageId;
|
||||
dword pingTimeMs;
|
||||
};
|
||||
|
||||
// JoinAgeReply
|
||||
extern const NetMsg kNetMsg_Game2Cli_JoinAgeReply;
|
||||
struct Game2Cli_JoinAgeReply {
|
||||
dword messageId;
|
||||
dword transId;
|
||||
ENetError result;
|
||||
};
|
||||
|
||||
// PropagateBuffer
|
||||
extern const NetMsg kNetMsg_Game2Cli_PropagateBuffer;
|
||||
struct Game2Cli_PropagateBuffer {
|
||||
dword messageId;
|
||||
dword type;
|
||||
dword bytes;
|
||||
byte buffer[1]; // actually, buffer[bytes]
|
||||
// no more fields
|
||||
};
|
||||
|
||||
// GameMgrMsg
|
||||
extern const NetMsg kNetMsg_Game2Cli_GameMgrMsg;
|
||||
struct Game2Cli_GameMgrMsg {
|
||||
dword messageId;
|
||||
dword bytes;
|
||||
byte buffer[1]; // actually: buffer[bytes]
|
||||
};
|
||||
|
||||
|
||||
//============================================================================
|
||||
// END PACKED DATA STRUCTURES
|
||||
//============================================================================
|
||||
#include <PopPack.h>
|
||||
|
@ -1,94 +1,94 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/pnNpCli2Auth.cpp
|
||||
*
|
||||
***/
|
||||
|
||||
#define USES_PROTOCOL_CLI2GATEKEEPER
|
||||
#include "../../../Pch.h"
|
||||
#pragma hdrstop
|
||||
|
||||
|
||||
namespace Cli2GateKeeper {
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Cli2GateKeeper message field definitions
|
||||
*
|
||||
***/
|
||||
|
||||
static const NetMsgField kPingRequestFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldTimeMs, // pingTimeMs
|
||||
NET_MSG_FIELD_VAR_COUNT(1, 64 * 1024), // payloadBytes
|
||||
NET_MSG_FIELD_VAR_PTR(), // payload
|
||||
};
|
||||
|
||||
static const NetMsgField kFileSrvIpAddressRequestFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
NET_MSG_FIELD_BYTE(), // isPatcher
|
||||
};
|
||||
|
||||
static const NetMsgField kAuthSrvIpAddressRequestFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
};
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* GateKeeper2Cli message field definitions
|
||||
*
|
||||
***/
|
||||
|
||||
static const NetMsgField kPingReplyFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldTimeMs, // pingTimeMs
|
||||
NET_MSG_FIELD_VAR_COUNT(1, 64 * 1024), // payloadBytes
|
||||
NET_MSG_FIELD_VAR_PTR(), // payload
|
||||
};
|
||||
|
||||
static const NetMsgField kFileSrvIpAddressReplyFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
NET_MSG_FIELD_STRING(24), // IpAddress
|
||||
};
|
||||
|
||||
static const NetMsgField kAuthSrvIpAddressReplyFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
NET_MSG_FIELD_STRING(24), // IpAddress
|
||||
};
|
||||
|
||||
} using namespace Cli2GateKeeper;
|
||||
|
||||
|
||||
const NetMsg kNetMsg_Cli2GateKeeper_PingRequest = NET_MSG(kCli2GateKeeper_PingRequest, kPingRequestFields);
|
||||
const NetMsg kNetMsg_Cli2GateKeeper_FileSrvIpAddressRequest = NET_MSG(kCli2GateKeeper_FileSrvIpAddressRequest, kFileSrvIpAddressRequestFields);
|
||||
const NetMsg kNetMsg_Cli2GateKeeper_AuthSrvIpAddressRequest = NET_MSG(kCli2GateKeeper_AuthSrvIpAddressRequest, kAuthSrvIpAddressRequestFields);
|
||||
|
||||
const NetMsg kNetMsg_GateKeeper2Cli_PingReply = NET_MSG(kGateKeeper2Cli_PingReply, kPingReplyFields);
|
||||
const NetMsg kNetMsg_GateKeeper2Cli_FileSrvIpAddressReply = NET_MSG(kGateKeeper2Cli_FileSrvIpAddressReply, kFileSrvIpAddressReplyFields);
|
||||
const NetMsg kNetMsg_GateKeeper2Cli_AuthSrvIpAddressReply = NET_MSG(kGateKeeper2Cli_AuthSrvIpAddressReply, kAuthSrvIpAddressReplyFields);
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/pnNpCli2Auth.cpp
|
||||
*
|
||||
***/
|
||||
|
||||
#define USES_PROTOCOL_CLI2GATEKEEPER
|
||||
#include "../../../Pch.h"
|
||||
#pragma hdrstop
|
||||
|
||||
|
||||
namespace Cli2GateKeeper {
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Cli2GateKeeper message field definitions
|
||||
*
|
||||
***/
|
||||
|
||||
static const NetMsgField kPingRequestFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldTimeMs, // pingTimeMs
|
||||
NET_MSG_FIELD_VAR_COUNT(1, 64 * 1024), // payloadBytes
|
||||
NET_MSG_FIELD_VAR_PTR(), // payload
|
||||
};
|
||||
|
||||
static const NetMsgField kFileSrvIpAddressRequestFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
NET_MSG_FIELD_BYTE(), // isPatcher
|
||||
};
|
||||
|
||||
static const NetMsgField kAuthSrvIpAddressRequestFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
};
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* GateKeeper2Cli message field definitions
|
||||
*
|
||||
***/
|
||||
|
||||
static const NetMsgField kPingReplyFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldTimeMs, // pingTimeMs
|
||||
NET_MSG_FIELD_VAR_COUNT(1, 64 * 1024), // payloadBytes
|
||||
NET_MSG_FIELD_VAR_PTR(), // payload
|
||||
};
|
||||
|
||||
static const NetMsgField kFileSrvIpAddressReplyFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
NET_MSG_FIELD_STRING(24), // IpAddress
|
||||
};
|
||||
|
||||
static const NetMsgField kAuthSrvIpAddressReplyFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
NET_MSG_FIELD_STRING(24), // IpAddress
|
||||
};
|
||||
|
||||
} using namespace Cli2GateKeeper;
|
||||
|
||||
|
||||
const NetMsg kNetMsg_Cli2GateKeeper_PingRequest = NET_MSG(kCli2GateKeeper_PingRequest, kPingRequestFields);
|
||||
const NetMsg kNetMsg_Cli2GateKeeper_FileSrvIpAddressRequest = NET_MSG(kCli2GateKeeper_FileSrvIpAddressRequest, kFileSrvIpAddressRequestFields);
|
||||
const NetMsg kNetMsg_Cli2GateKeeper_AuthSrvIpAddressRequest = NET_MSG(kCli2GateKeeper_AuthSrvIpAddressRequest, kAuthSrvIpAddressRequestFields);
|
||||
|
||||
const NetMsg kNetMsg_GateKeeper2Cli_PingReply = NET_MSG(kGateKeeper2Cli_PingReply, kPingReplyFields);
|
||||
const NetMsg kNetMsg_GateKeeper2Cli_FileSrvIpAddressReply = NET_MSG(kGateKeeper2Cli_FileSrvIpAddressReply, kFileSrvIpAddressReplyFields);
|
||||
const NetMsg kNetMsg_GateKeeper2Cli_AuthSrvIpAddressReply = NET_MSG(kGateKeeper2Cli_AuthSrvIpAddressReply, kAuthSrvIpAddressReplyFields);
|
||||
|
@ -1,141 +1,141 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/pnNpCli2GateKeeper.h
|
||||
*
|
||||
***/
|
||||
|
||||
#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNNETPROTOCOL_PRIVATE_PROTOCOLS_PNNPCLI2GATEKEEPER_H
|
||||
#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/pnNpCli2GateKeeper.h included more than once"
|
||||
#endif
|
||||
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNNETPROTOCOL_PRIVATE_PROTOCOLS_PNNPCLI2GATEKEEPER_H
|
||||
|
||||
|
||||
// kNetProtocolCli2GateKeeper messages (must be <= (word)-1)
|
||||
enum {
|
||||
// Global
|
||||
kCli2GateKeeper_PingRequest,
|
||||
kCli2GateKeeper_FileSrvIpAddressRequest,
|
||||
kCli2GateKeeper_AuthSrvIpAddressRequest,
|
||||
|
||||
kNumCli2GateKeeperMessages
|
||||
};
|
||||
COMPILER_ASSERT_HEADER(Cli2GateKeeper, kNumCli2GateKeeperMessages <= (word)-1);
|
||||
|
||||
enum {
|
||||
// Global
|
||||
kGateKeeper2Cli_PingReply,
|
||||
kGateKeeper2Cli_FileSrvIpAddressReply,
|
||||
kGateKeeper2Cli_AuthSrvIpAddressReply,
|
||||
|
||||
kNumGateKeeper2CliMessages
|
||||
};
|
||||
COMPILER_ASSERT_HEADER(Cli2GateKeeper, kNumGateKeeper2CliMessages <= (word)-1);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// BEGIN PACKED DATA STRUCTURES
|
||||
//============================================================================
|
||||
#include <PshPack1.h>
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Cli2GateKeeper connect packet
|
||||
*
|
||||
***/
|
||||
|
||||
struct Cli2GateKeeper_ConnData {
|
||||
dword dataBytes;
|
||||
Uuid token;
|
||||
};
|
||||
|
||||
struct Cli2GateKeeper_Connect {
|
||||
AsyncSocketConnectPacket hdr;
|
||||
Cli2GateKeeper_ConnData data;
|
||||
};
|
||||
|
||||
//============================================================================
|
||||
// Cli --> GateKeeper message structures
|
||||
|
||||
// PingRequest
|
||||
extern const NetMsg kNetMsg_Cli2GateKeeper_PingRequest;
|
||||
struct Cli2GateKeeper_PingRequest {
|
||||
dword messageId;
|
||||
dword transId;
|
||||
dword pingTimeMs;
|
||||
dword payloadBytes;
|
||||
byte payload[1]; // [payloadBytes]
|
||||
};
|
||||
|
||||
// FileSrvIpAddressRequest
|
||||
extern const NetMsg kNetMsg_Cli2GateKeeper_FileSrvIpAddressRequest;
|
||||
struct Cli2GateKeeper_FileSrvIpAddressRequest {
|
||||
dword messageId;
|
||||
dword transId;
|
||||
byte isPatcher;
|
||||
};
|
||||
|
||||
// AuthSrvIpAddressRequest
|
||||
extern const NetMsg kNetMsg_Cli2GateKeeper_AuthSrvIpAddressRequest;
|
||||
struct Cli2GateKeeper_AuthSrvIpAddressRequest {
|
||||
dword messageId;
|
||||
dword transId;
|
||||
};
|
||||
|
||||
|
||||
//============================================================================
|
||||
// GateKeeper --> Cli message structures
|
||||
|
||||
// PingReply
|
||||
extern const NetMsg kNetMsg_GateKeeper2Cli_PingReply;
|
||||
struct GateKeeper2Cli_PingReply {
|
||||
dword messageId;
|
||||
dword transId;
|
||||
dword pingTimeMs;
|
||||
dword payloadBytes;
|
||||
byte payload[1]; // [payloadBytes]
|
||||
};
|
||||
|
||||
// FileSrvIpAddressReply
|
||||
extern const NetMsg kNetMsg_GateKeeper2Cli_FileSrvIpAddressReply;
|
||||
struct GateKeeper2Cli_FileSrvIpAddressReply {
|
||||
dword messageId;
|
||||
dword transId;
|
||||
wchar address[24];
|
||||
};
|
||||
|
||||
|
||||
// FileSrvIpAddressReply
|
||||
extern const NetMsg kNetMsg_GateKeeper2Cli_AuthSrvIpAddressReply;
|
||||
struct GateKeeper2Cli_AuthSrvIpAddressReply {
|
||||
dword messageId;
|
||||
dword transId;
|
||||
wchar address[24];
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/pnNpCli2GateKeeper.h
|
||||
*
|
||||
***/
|
||||
|
||||
#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNNETPROTOCOL_PRIVATE_PROTOCOLS_PNNPCLI2GATEKEEPER_H
|
||||
#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/pnNpCli2GateKeeper.h included more than once"
|
||||
#endif
|
||||
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNNETPROTOCOL_PRIVATE_PROTOCOLS_PNNPCLI2GATEKEEPER_H
|
||||
|
||||
|
||||
// kNetProtocolCli2GateKeeper messages (must be <= (word)-1)
|
||||
enum {
|
||||
// Global
|
||||
kCli2GateKeeper_PingRequest,
|
||||
kCli2GateKeeper_FileSrvIpAddressRequest,
|
||||
kCli2GateKeeper_AuthSrvIpAddressRequest,
|
||||
|
||||
kNumCli2GateKeeperMessages
|
||||
};
|
||||
COMPILER_ASSERT_HEADER(Cli2GateKeeper, kNumCli2GateKeeperMessages <= (word)-1);
|
||||
|
||||
enum {
|
||||
// Global
|
||||
kGateKeeper2Cli_PingReply,
|
||||
kGateKeeper2Cli_FileSrvIpAddressReply,
|
||||
kGateKeeper2Cli_AuthSrvIpAddressReply,
|
||||
|
||||
kNumGateKeeper2CliMessages
|
||||
};
|
||||
COMPILER_ASSERT_HEADER(Cli2GateKeeper, kNumGateKeeper2CliMessages <= (word)-1);
|
||||
|
||||
|
||||
//============================================================================
|
||||
// BEGIN PACKED DATA STRUCTURES
|
||||
//============================================================================
|
||||
#include <PshPack1.h>
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Cli2GateKeeper connect packet
|
||||
*
|
||||
***/
|
||||
|
||||
struct Cli2GateKeeper_ConnData {
|
||||
dword dataBytes;
|
||||
Uuid token;
|
||||
};
|
||||
|
||||
struct Cli2GateKeeper_Connect {
|
||||
AsyncSocketConnectPacket hdr;
|
||||
Cli2GateKeeper_ConnData data;
|
||||
};
|
||||
|
||||
//============================================================================
|
||||
// Cli --> GateKeeper message structures
|
||||
|
||||
// PingRequest
|
||||
extern const NetMsg kNetMsg_Cli2GateKeeper_PingRequest;
|
||||
struct Cli2GateKeeper_PingRequest {
|
||||
dword messageId;
|
||||
dword transId;
|
||||
dword pingTimeMs;
|
||||
dword payloadBytes;
|
||||
byte payload[1]; // [payloadBytes]
|
||||
};
|
||||
|
||||
// FileSrvIpAddressRequest
|
||||
extern const NetMsg kNetMsg_Cli2GateKeeper_FileSrvIpAddressRequest;
|
||||
struct Cli2GateKeeper_FileSrvIpAddressRequest {
|
||||
dword messageId;
|
||||
dword transId;
|
||||
byte isPatcher;
|
||||
};
|
||||
|
||||
// AuthSrvIpAddressRequest
|
||||
extern const NetMsg kNetMsg_Cli2GateKeeper_AuthSrvIpAddressRequest;
|
||||
struct Cli2GateKeeper_AuthSrvIpAddressRequest {
|
||||
dword messageId;
|
||||
dword transId;
|
||||
};
|
||||
|
||||
|
||||
//============================================================================
|
||||
// GateKeeper --> Cli message structures
|
||||
|
||||
// PingReply
|
||||
extern const NetMsg kNetMsg_GateKeeper2Cli_PingReply;
|
||||
struct GateKeeper2Cli_PingReply {
|
||||
dword messageId;
|
||||
dword transId;
|
||||
dword pingTimeMs;
|
||||
dword payloadBytes;
|
||||
byte payload[1]; // [payloadBytes]
|
||||
};
|
||||
|
||||
// FileSrvIpAddressReply
|
||||
extern const NetMsg kNetMsg_GateKeeper2Cli_FileSrvIpAddressReply;
|
||||
struct GateKeeper2Cli_FileSrvIpAddressReply {
|
||||
dword messageId;
|
||||
dword transId;
|
||||
wchar address[24];
|
||||
};
|
||||
|
||||
|
||||
// FileSrvIpAddressReply
|
||||
extern const NetMsg kNetMsg_GateKeeper2Cli_AuthSrvIpAddressReply;
|
||||
struct GateKeeper2Cli_AuthSrvIpAddressReply {
|
||||
dword messageId;
|
||||
dword transId;
|
||||
wchar address[24];
|
||||
};
|
@ -1,77 +1,77 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Db/pnNpSrv2Db.cpp
|
||||
*
|
||||
***/
|
||||
|
||||
#ifdef SERVER
|
||||
|
||||
#define USES_PROTOCOL_SRV2DB
|
||||
#include "../../../Pch.h"
|
||||
#pragma hdrstop
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Exports
|
||||
*
|
||||
***/
|
||||
|
||||
//===========================================================================
|
||||
bool Srv2DbValidateConnect (
|
||||
AsyncNotifySocketListen * listen,
|
||||
Srv2Db_ConnData * connectPtr
|
||||
) {
|
||||
// Ensure that there are enough bytes for the header
|
||||
const Srv2Db_ConnData & connect = * (const Srv2Db_ConnData *) listen->buffer;
|
||||
|
||||
// Validate message size
|
||||
const unsigned kMinStructSize = sizeof(dword) * 1;
|
||||
if (listen->bytes < kMinStructSize)
|
||||
return false;
|
||||
if (listen->bytes < connect.dataBytes)
|
||||
return false;
|
||||
|
||||
// Validate connect server type
|
||||
if (! (connect.srvType == kSrvTypeAuth
|
||||
|| connect.srvType == kSrvTypeVault
|
||||
|| connect.srvType == kSrvTypeState
|
||||
|| connect.srvType == kSrvTypeScore
|
||||
|| connect.srvType == kSrvTypeCsr)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ZEROPTR(connectPtr);
|
||||
MemCopy(connectPtr, &connect, min(sizeof(*connectPtr), connect.dataBytes));
|
||||
|
||||
listen->bytesProcessed += connect.dataBytes;
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // SERVER
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Db/pnNpSrv2Db.cpp
|
||||
*
|
||||
***/
|
||||
|
||||
#ifdef SERVER
|
||||
|
||||
#define USES_PROTOCOL_SRV2DB
|
||||
#include "../../../Pch.h"
|
||||
#pragma hdrstop
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Exports
|
||||
*
|
||||
***/
|
||||
|
||||
//===========================================================================
|
||||
bool Srv2DbValidateConnect (
|
||||
AsyncNotifySocketListen * listen,
|
||||
Srv2Db_ConnData * connectPtr
|
||||
) {
|
||||
// Ensure that there are enough bytes for the header
|
||||
const Srv2Db_ConnData & connect = * (const Srv2Db_ConnData *) listen->buffer;
|
||||
|
||||
// Validate message size
|
||||
const unsigned kMinStructSize = sizeof(dword) * 1;
|
||||
if (listen->bytes < kMinStructSize)
|
||||
return false;
|
||||
if (listen->bytes < connect.dataBytes)
|
||||
return false;
|
||||
|
||||
// Validate connect server type
|
||||
if (! (connect.srvType == kSrvTypeAuth
|
||||
|| connect.srvType == kSrvTypeVault
|
||||
|| connect.srvType == kSrvTypeState
|
||||
|| connect.srvType == kSrvTypeScore
|
||||
|| connect.srvType == kSrvTypeCsr)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ZEROPTR(connectPtr);
|
||||
MemCopy(connectPtr, &connect, min(sizeof(*connectPtr), connect.dataBytes));
|
||||
|
||||
listen->bytesProcessed += connect.dataBytes;
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // SERVER
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,74 +1,74 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Log/pnNpSrv2Log.cpp
|
||||
*
|
||||
***/
|
||||
|
||||
#ifdef SERVER
|
||||
|
||||
#define USES_PROTOCOL_SRV2LOG
|
||||
|
||||
#include "../../../Pch.h"
|
||||
#pragma hdrstop
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Exports
|
||||
*
|
||||
***/
|
||||
|
||||
//===========================================================================
|
||||
bool Srv2LogValidateConnect (
|
||||
AsyncNotifySocketListen * listen,
|
||||
Srv2Log_ConnData * connectPtr
|
||||
) {
|
||||
// Ensure that there are enough bytes for the header
|
||||
const Srv2Log_ConnData & connect = * (const Srv2Log_ConnData *) listen->buffer;
|
||||
|
||||
// Validate message size
|
||||
const unsigned kMinStructSize = sizeof(dword) * 3;
|
||||
if (listen->bytes < kMinStructSize)
|
||||
return false;
|
||||
if (listen->bytes < connect.dataBytes)
|
||||
return false;
|
||||
|
||||
// Validate connect server type
|
||||
if (!(connect.srvType == kSrvTypeAuth || connect.srvType == kSrvTypeGame || connect.srvType == kSrvTypeVault || connect.srvType == kSrvTypeDb ||
|
||||
connect.srvType == kSrvTypeMcp || connect.srvType == kSrvTypeState || connect.srvType == kSrvTypeFile || connect.srvType == kSrvTypeDll))
|
||||
return false;
|
||||
|
||||
ZEROPTR(connectPtr);
|
||||
MemCopy(connectPtr, &connect, min(sizeof(*connectPtr), connect.dataBytes));
|
||||
|
||||
listen->bytesProcessed += connect.dataBytes;
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // SERVER
|
||||
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Log/pnNpSrv2Log.cpp
|
||||
*
|
||||
***/
|
||||
|
||||
#ifdef SERVER
|
||||
|
||||
#define USES_PROTOCOL_SRV2LOG
|
||||
|
||||
#include "../../../Pch.h"
|
||||
#pragma hdrstop
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Exports
|
||||
*
|
||||
***/
|
||||
|
||||
//===========================================================================
|
||||
bool Srv2LogValidateConnect (
|
||||
AsyncNotifySocketListen * listen,
|
||||
Srv2Log_ConnData * connectPtr
|
||||
) {
|
||||
// Ensure that there are enough bytes for the header
|
||||
const Srv2Log_ConnData & connect = * (const Srv2Log_ConnData *) listen->buffer;
|
||||
|
||||
// Validate message size
|
||||
const unsigned kMinStructSize = sizeof(dword) * 3;
|
||||
if (listen->bytes < kMinStructSize)
|
||||
return false;
|
||||
if (listen->bytes < connect.dataBytes)
|
||||
return false;
|
||||
|
||||
// Validate connect server type
|
||||
if (!(connect.srvType == kSrvTypeAuth || connect.srvType == kSrvTypeGame || connect.srvType == kSrvTypeVault || connect.srvType == kSrvTypeDb ||
|
||||
connect.srvType == kSrvTypeMcp || connect.srvType == kSrvTypeState || connect.srvType == kSrvTypeFile || connect.srvType == kSrvTypeDll))
|
||||
return false;
|
||||
|
||||
ZEROPTR(connectPtr);
|
||||
MemCopy(connectPtr, &connect, min(sizeof(*connectPtr), connect.dataBytes));
|
||||
|
||||
listen->bytesProcessed += connect.dataBytes;
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // SERVER
|
||||
|
||||
|
@ -1,104 +1,104 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Log/pnNpSrv2Log.h
|
||||
*
|
||||
***/
|
||||
|
||||
#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNNETPROTOCOL_PRIVATE_PROTOCOLS_SRV2LOG_PNNPSRV2LOG_H
|
||||
#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Log/pnNpSrv2Log.h included more than once"
|
||||
#endif
|
||||
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNNETPROTOCOL_PRIVATE_PROTOCOLS_SRV2LOG_PNNPSRV2LOG_H
|
||||
|
||||
|
||||
//============================================================================
|
||||
// BEGIN PACKED DATA STRUCTURES
|
||||
//============================================================================
|
||||
#include <PshPack1.h>
|
||||
|
||||
// Srv2Log
|
||||
enum {
|
||||
kSrv2Log_LogMsg = 0,
|
||||
};
|
||||
|
||||
// Log2Srv
|
||||
enum {
|
||||
|
||||
};
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Srv2State connect packet
|
||||
*
|
||||
***/
|
||||
|
||||
struct Srv2Log_ConnData {
|
||||
dword dataBytes;
|
||||
dword buildId;
|
||||
dword srvType;
|
||||
dword buildType;
|
||||
dword productId;
|
||||
};
|
||||
|
||||
struct Srv2Log_Connect {
|
||||
AsyncSocketConnectPacket hdr;
|
||||
Srv2Log_ConnData data;
|
||||
};
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Srv2Log message structures
|
||||
*
|
||||
***/
|
||||
|
||||
struct Srv2Log_LogMsg : SrvMsgHeader {
|
||||
unsigned eventType;
|
||||
qword timestamp;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//============================================================================
|
||||
// END PACKED DATA STRUCTURES
|
||||
//============================================================================
|
||||
#include <PopPack.h>
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Srv2State functions
|
||||
*
|
||||
***/
|
||||
|
||||
bool Srv2LogValidateConnect (
|
||||
AsyncNotifySocketListen * listen,
|
||||
Srv2Log_ConnData * connectPtr
|
||||
);
|
||||
|
||||
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Log/pnNpSrv2Log.h
|
||||
*
|
||||
***/
|
||||
|
||||
#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNNETPROTOCOL_PRIVATE_PROTOCOLS_SRV2LOG_PNNPSRV2LOG_H
|
||||
#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Log/pnNpSrv2Log.h included more than once"
|
||||
#endif
|
||||
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNNETPROTOCOL_PRIVATE_PROTOCOLS_SRV2LOG_PNNPSRV2LOG_H
|
||||
|
||||
|
||||
//============================================================================
|
||||
// BEGIN PACKED DATA STRUCTURES
|
||||
//============================================================================
|
||||
#include <PshPack1.h>
|
||||
|
||||
// Srv2Log
|
||||
enum {
|
||||
kSrv2Log_LogMsg = 0,
|
||||
};
|
||||
|
||||
// Log2Srv
|
||||
enum {
|
||||
|
||||
};
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Srv2State connect packet
|
||||
*
|
||||
***/
|
||||
|
||||
struct Srv2Log_ConnData {
|
||||
dword dataBytes;
|
||||
dword buildId;
|
||||
dword srvType;
|
||||
dword buildType;
|
||||
dword productId;
|
||||
};
|
||||
|
||||
struct Srv2Log_Connect {
|
||||
AsyncSocketConnectPacket hdr;
|
||||
Srv2Log_ConnData data;
|
||||
};
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Srv2Log message structures
|
||||
*
|
||||
***/
|
||||
|
||||
struct Srv2Log_LogMsg : SrvMsgHeader {
|
||||
unsigned eventType;
|
||||
qword timestamp;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//============================================================================
|
||||
// END PACKED DATA STRUCTURES
|
||||
//============================================================================
|
||||
#include <PopPack.h>
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Srv2State functions
|
||||
*
|
||||
***/
|
||||
|
||||
bool Srv2LogValidateConnect (
|
||||
AsyncNotifySocketListen * listen,
|
||||
Srv2Log_ConnData * connectPtr
|
||||
);
|
||||
|
||||
|
||||
|
@ -1,71 +1,71 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Mcp/pnNpSrv2Mcp.cpp
|
||||
*
|
||||
***/
|
||||
|
||||
#ifdef SERVER
|
||||
|
||||
#define USES_PROTOCOL_SRV2MCP
|
||||
#include "../../../Pch.h"
|
||||
#pragma hdrstop
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Exports
|
||||
*
|
||||
***/
|
||||
|
||||
//===========================================================================
|
||||
bool Srv2McpValidateConnect (
|
||||
AsyncNotifySocketListen * listen,
|
||||
Srv2Mcp_ConnData * connectPtr
|
||||
) {
|
||||
// Ensure that there are enough bytes for the header
|
||||
const Srv2Mcp_ConnData & connect = * (const Srv2Mcp_ConnData *) listen->buffer;
|
||||
|
||||
// Validate message size
|
||||
const unsigned kMinStructSize = sizeof(dword) * 3;
|
||||
if (listen->bytes < kMinStructSize)
|
||||
return false;
|
||||
if (listen->bytes < connect.dataBytes)
|
||||
return false;
|
||||
|
||||
// Validate connect server type
|
||||
if (!(connect.srvType == kSrvTypeAuth || connect.srvType == kSrvTypeGame))
|
||||
return false;
|
||||
|
||||
ZEROPTR(connectPtr);
|
||||
MemCopy(connectPtr, &connect, min(sizeof(*connectPtr), connect.dataBytes));
|
||||
|
||||
listen->bytesProcessed += connect.dataBytes;
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // SERVER
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Mcp/pnNpSrv2Mcp.cpp
|
||||
*
|
||||
***/
|
||||
|
||||
#ifdef SERVER
|
||||
|
||||
#define USES_PROTOCOL_SRV2MCP
|
||||
#include "../../../Pch.h"
|
||||
#pragma hdrstop
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Exports
|
||||
*
|
||||
***/
|
||||
|
||||
//===========================================================================
|
||||
bool Srv2McpValidateConnect (
|
||||
AsyncNotifySocketListen * listen,
|
||||
Srv2Mcp_ConnData * connectPtr
|
||||
) {
|
||||
// Ensure that there are enough bytes for the header
|
||||
const Srv2Mcp_ConnData & connect = * (const Srv2Mcp_ConnData *) listen->buffer;
|
||||
|
||||
// Validate message size
|
||||
const unsigned kMinStructSize = sizeof(dword) * 3;
|
||||
if (listen->bytes < kMinStructSize)
|
||||
return false;
|
||||
if (listen->bytes < connect.dataBytes)
|
||||
return false;
|
||||
|
||||
// Validate connect server type
|
||||
if (!(connect.srvType == kSrvTypeAuth || connect.srvType == kSrvTypeGame))
|
||||
return false;
|
||||
|
||||
ZEROPTR(connectPtr);
|
||||
MemCopy(connectPtr, &connect, min(sizeof(*connectPtr), connect.dataBytes));
|
||||
|
||||
listen->bytesProcessed += connect.dataBytes;
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // SERVER
|
||||
|
@ -1,251 +1,251 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Mcp/pnNpSrv2Mcp.h
|
||||
*
|
||||
***/
|
||||
|
||||
#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNNETPROTOCOL_PRIVATE_PROTOCOLS_SRV2MCP_PNNPSRV2MCP_H
|
||||
#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Mcp/pnNpSrv2Mcp.h included more than once"
|
||||
#endif
|
||||
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNNETPROTOCOL_PRIVATE_PROTOCOLS_SRV2MCP_PNNPSRV2MCP_H
|
||||
|
||||
|
||||
// kNetProtocolSrv2Mcp messages
|
||||
// Because SrvMcp must remain compatible with older auth builds, these message ids
|
||||
// must not change unless all front-end servers are synchronously replaced.
|
||||
enum {
|
||||
// Age
|
||||
kSrv2Mcp_AgeJoinRequest = 0,
|
||||
kSrv2Mcp_PlayerLoggedOut = 1,
|
||||
kSrv2Mcp_PlayerLoggedIn = 2,
|
||||
kSrv2Mcp_AgeSpawned = 3,
|
||||
kSrv2Mcp_AgeDied = 4,
|
||||
kSrv2Mcp_KickPlayer = 5,
|
||||
|
||||
// Account
|
||||
kSrv2Mcp_AccountLoginRequest = 20,
|
||||
kSrv2Mcp_AccountLogout = 21,
|
||||
kSrv2Mcp_AccountSetPlayer = 22,
|
||||
|
||||
// Messaging
|
||||
kSrv2Mcp_PropagateBuffer = 30,
|
||||
};
|
||||
|
||||
enum {
|
||||
// Age
|
||||
kMcp2Srv_AgeJoinReply = 0,
|
||||
kMcp2Srv_AgeSpawnRequest = 1,
|
||||
kMcp2Srv_AgeAddPlayerRequest = 2,
|
||||
kMcp2Srv_AgeRemovePlayerRequest = 3,
|
||||
kMcp2Srv_AgeUnspawn = 4,
|
||||
kMcp2Srv_AgeSpawnedReply = 5,
|
||||
|
||||
// Account
|
||||
kMcp2Srv_AccountLoginReply = 20,
|
||||
kMcp2Srv_AccountNotifyKicked = 21,
|
||||
|
||||
// Messaging
|
||||
kMcp2Srv_PropagateBuffer = 30,
|
||||
|
||||
// AgeSDL
|
||||
kMcp2Srv_NotifyAgeSDLChanged = 40,
|
||||
};
|
||||
|
||||
|
||||
//============================================================================
|
||||
// BEGIN PACKED DATA STRUCTURES
|
||||
//============================================================================
|
||||
#include <PshPack1.h>
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Srv2Mcp connect packet
|
||||
*
|
||||
***/
|
||||
|
||||
struct Srv2Mcp_ConnData {
|
||||
dword dataBytes;
|
||||
dword buildId;
|
||||
dword srvType;
|
||||
dword publicAddr;
|
||||
};
|
||||
struct Srv2Mcp_Connect {
|
||||
AsyncSocketConnectPacket hdr;
|
||||
Srv2Mcp_ConnData data;
|
||||
};
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Srv2Mcp message structures
|
||||
*
|
||||
***/
|
||||
|
||||
struct Srv2Mcp_AgeJoinRequest : SrvMsgHeader {
|
||||
wchar ageName[kMaxAgeNameLength];
|
||||
Uuid ageUuid;
|
||||
Uuid accountUuid;
|
||||
dword playerInt;
|
||||
byte ccrLevel;
|
||||
wchar playerName[kMaxPlayerNameLength];
|
||||
dword buildId;
|
||||
};
|
||||
|
||||
struct Srv2Mcp_PlayerLoggedIn : SrvMsgHeader {
|
||||
dword ageMcpId;
|
||||
Uuid ageUuid;
|
||||
Uuid accountUuid;
|
||||
wchar playerName[kMaxPlayerNameLength];
|
||||
dword playerInt;
|
||||
};
|
||||
|
||||
struct Srv2Mcp_PlayerLoggedOut : SrvMsgHeader {
|
||||
dword ageMcpId;
|
||||
Uuid accountUuid;
|
||||
dword playerInt;
|
||||
};
|
||||
|
||||
struct Srv2Mcp_AgeSpawned : SrvMsgHeader {
|
||||
wchar ageName[kMaxAgeNameLength];
|
||||
Uuid ageUuid;
|
||||
dword buildId;
|
||||
};
|
||||
|
||||
struct Srv2Mcp_AgeDied : SrvMsgHeader {
|
||||
dword ageMcpId;
|
||||
};
|
||||
|
||||
struct Srv2Mcp_AccountLoginRequest : SrvMsgHeader {
|
||||
wchar accountName[kMaxAccountNameLength];
|
||||
Uuid accountUuid;
|
||||
};
|
||||
|
||||
struct Srv2Mcp_AccountLogout : SrvMsgHeader {
|
||||
Uuid accountUuid;
|
||||
};
|
||||
|
||||
struct Srv2Mcp_AccountSetPlayer : SrvMsgHeader {
|
||||
Uuid accountUuid;
|
||||
dword playerInt;
|
||||
};
|
||||
|
||||
struct Srv2Mcp_PropagateBuffer : SrvMsgHeader {
|
||||
dword type;
|
||||
dword bufferLength;
|
||||
dword numRecvrs;
|
||||
// packed data:
|
||||
// byte netMessage[];
|
||||
// dword playerlist[];
|
||||
};
|
||||
|
||||
struct Srv2Mcp_KickPlayer : SrvMsgHeader {
|
||||
dword playerInt;
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Mcp2Srv message structures
|
||||
*
|
||||
***/
|
||||
|
||||
struct Mcp2Srv_AgeJoinReply : SrvMsgHeader {
|
||||
dword ageMcpId;
|
||||
Uuid ageUuid;
|
||||
NetAddressNode gameSrvNode;
|
||||
};
|
||||
|
||||
struct Mcp2Srv_AgeSpawnRequest : SrvMsgHeader {
|
||||
wchar ageName[kMaxAgeNameLength];
|
||||
dword ageMcpId;
|
||||
Uuid ageUuid;
|
||||
dword buildId;
|
||||
};
|
||||
|
||||
struct Mcp2Srv_AgeUnspawn : SrvMsgHeader {
|
||||
dword ageMcpId;
|
||||
};
|
||||
|
||||
struct Mcp2Srv_AgeAddPlayerRequest : SrvMsgHeader {
|
||||
dword ageMcpId;
|
||||
Uuid accountUuid;
|
||||
dword playerInt;
|
||||
byte ccrLevel;
|
||||
wchar playerName[kMaxPlayerNameLength];
|
||||
};
|
||||
|
||||
struct Mcp2Srv_AgeRemovePlayerRequest : SrvMsgHeader {
|
||||
Uuid ageMcpId;
|
||||
Uuid accountUuid;
|
||||
dword playerInt;
|
||||
};
|
||||
|
||||
struct Mcp2Srv_AgeSpawnedReply : SrvMsgHeader {
|
||||
dword ageMcpId; // assigns a new mcpId if age wasn't found (in case of a reconnect)
|
||||
};
|
||||
|
||||
struct Mcp2Srv_AccountLoginReply : SrvMsgHeader {
|
||||
dword acctMcpId;
|
||||
};
|
||||
|
||||
struct Mcp2Srv_AccountNotifyKicked : SrvMsgHeader {
|
||||
Uuid accountUuid;
|
||||
dword acctMcpId;
|
||||
ENetError reason;
|
||||
};
|
||||
|
||||
struct Mcp2Srv_NotifyAgeSDLChanged : SrvMsgHeader {
|
||||
dword ageMcpId;
|
||||
byte global;
|
||||
};
|
||||
|
||||
struct Mcp2Srv_PropagateBuffer : SrvMsgHeader {
|
||||
dword ageMcpId;
|
||||
dword type;
|
||||
dword bytes;
|
||||
byte buffer[1]; // actually, buffer[bytes]
|
||||
// no more fields
|
||||
};
|
||||
|
||||
|
||||
//============================================================================
|
||||
// END PACKED DATA STRUCTURES
|
||||
//============================================================================
|
||||
#include <PopPack.h>
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Srv2Mcp functions
|
||||
*
|
||||
***/
|
||||
|
||||
bool Srv2McpValidateConnect (
|
||||
AsyncNotifySocketListen * listen,
|
||||
Srv2Mcp_ConnData * connectPtr
|
||||
);
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Mcp/pnNpSrv2Mcp.h
|
||||
*
|
||||
***/
|
||||
|
||||
#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNNETPROTOCOL_PRIVATE_PROTOCOLS_SRV2MCP_PNNPSRV2MCP_H
|
||||
#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Mcp/pnNpSrv2Mcp.h included more than once"
|
||||
#endif
|
||||
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNNETPROTOCOL_PRIVATE_PROTOCOLS_SRV2MCP_PNNPSRV2MCP_H
|
||||
|
||||
|
||||
// kNetProtocolSrv2Mcp messages
|
||||
// Because SrvMcp must remain compatible with older auth builds, these message ids
|
||||
// must not change unless all front-end servers are synchronously replaced.
|
||||
enum {
|
||||
// Age
|
||||
kSrv2Mcp_AgeJoinRequest = 0,
|
||||
kSrv2Mcp_PlayerLoggedOut = 1,
|
||||
kSrv2Mcp_PlayerLoggedIn = 2,
|
||||
kSrv2Mcp_AgeSpawned = 3,
|
||||
kSrv2Mcp_AgeDied = 4,
|
||||
kSrv2Mcp_KickPlayer = 5,
|
||||
|
||||
// Account
|
||||
kSrv2Mcp_AccountLoginRequest = 20,
|
||||
kSrv2Mcp_AccountLogout = 21,
|
||||
kSrv2Mcp_AccountSetPlayer = 22,
|
||||
|
||||
// Messaging
|
||||
kSrv2Mcp_PropagateBuffer = 30,
|
||||
};
|
||||
|
||||
enum {
|
||||
// Age
|
||||
kMcp2Srv_AgeJoinReply = 0,
|
||||
kMcp2Srv_AgeSpawnRequest = 1,
|
||||
kMcp2Srv_AgeAddPlayerRequest = 2,
|
||||
kMcp2Srv_AgeRemovePlayerRequest = 3,
|
||||
kMcp2Srv_AgeUnspawn = 4,
|
||||
kMcp2Srv_AgeSpawnedReply = 5,
|
||||
|
||||
// Account
|
||||
kMcp2Srv_AccountLoginReply = 20,
|
||||
kMcp2Srv_AccountNotifyKicked = 21,
|
||||
|
||||
// Messaging
|
||||
kMcp2Srv_PropagateBuffer = 30,
|
||||
|
||||
// AgeSDL
|
||||
kMcp2Srv_NotifyAgeSDLChanged = 40,
|
||||
};
|
||||
|
||||
|
||||
//============================================================================
|
||||
// BEGIN PACKED DATA STRUCTURES
|
||||
//============================================================================
|
||||
#include <PshPack1.h>
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Srv2Mcp connect packet
|
||||
*
|
||||
***/
|
||||
|
||||
struct Srv2Mcp_ConnData {
|
||||
dword dataBytes;
|
||||
dword buildId;
|
||||
dword srvType;
|
||||
dword publicAddr;
|
||||
};
|
||||
struct Srv2Mcp_Connect {
|
||||
AsyncSocketConnectPacket hdr;
|
||||
Srv2Mcp_ConnData data;
|
||||
};
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Srv2Mcp message structures
|
||||
*
|
||||
***/
|
||||
|
||||
struct Srv2Mcp_AgeJoinRequest : SrvMsgHeader {
|
||||
wchar ageName[kMaxAgeNameLength];
|
||||
Uuid ageUuid;
|
||||
Uuid accountUuid;
|
||||
dword playerInt;
|
||||
byte ccrLevel;
|
||||
wchar playerName[kMaxPlayerNameLength];
|
||||
dword buildId;
|
||||
};
|
||||
|
||||
struct Srv2Mcp_PlayerLoggedIn : SrvMsgHeader {
|
||||
dword ageMcpId;
|
||||
Uuid ageUuid;
|
||||
Uuid accountUuid;
|
||||
wchar playerName[kMaxPlayerNameLength];
|
||||
dword playerInt;
|
||||
};
|
||||
|
||||
struct Srv2Mcp_PlayerLoggedOut : SrvMsgHeader {
|
||||
dword ageMcpId;
|
||||
Uuid accountUuid;
|
||||
dword playerInt;
|
||||
};
|
||||
|
||||
struct Srv2Mcp_AgeSpawned : SrvMsgHeader {
|
||||
wchar ageName[kMaxAgeNameLength];
|
||||
Uuid ageUuid;
|
||||
dword buildId;
|
||||
};
|
||||
|
||||
struct Srv2Mcp_AgeDied : SrvMsgHeader {
|
||||
dword ageMcpId;
|
||||
};
|
||||
|
||||
struct Srv2Mcp_AccountLoginRequest : SrvMsgHeader {
|
||||
wchar accountName[kMaxAccountNameLength];
|
||||
Uuid accountUuid;
|
||||
};
|
||||
|
||||
struct Srv2Mcp_AccountLogout : SrvMsgHeader {
|
||||
Uuid accountUuid;
|
||||
};
|
||||
|
||||
struct Srv2Mcp_AccountSetPlayer : SrvMsgHeader {
|
||||
Uuid accountUuid;
|
||||
dword playerInt;
|
||||
};
|
||||
|
||||
struct Srv2Mcp_PropagateBuffer : SrvMsgHeader {
|
||||
dword type;
|
||||
dword bufferLength;
|
||||
dword numRecvrs;
|
||||
// packed data:
|
||||
// byte netMessage[];
|
||||
// dword playerlist[];
|
||||
};
|
||||
|
||||
struct Srv2Mcp_KickPlayer : SrvMsgHeader {
|
||||
dword playerInt;
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Mcp2Srv message structures
|
||||
*
|
||||
***/
|
||||
|
||||
struct Mcp2Srv_AgeJoinReply : SrvMsgHeader {
|
||||
dword ageMcpId;
|
||||
Uuid ageUuid;
|
||||
NetAddressNode gameSrvNode;
|
||||
};
|
||||
|
||||
struct Mcp2Srv_AgeSpawnRequest : SrvMsgHeader {
|
||||
wchar ageName[kMaxAgeNameLength];
|
||||
dword ageMcpId;
|
||||
Uuid ageUuid;
|
||||
dword buildId;
|
||||
};
|
||||
|
||||
struct Mcp2Srv_AgeUnspawn : SrvMsgHeader {
|
||||
dword ageMcpId;
|
||||
};
|
||||
|
||||
struct Mcp2Srv_AgeAddPlayerRequest : SrvMsgHeader {
|
||||
dword ageMcpId;
|
||||
Uuid accountUuid;
|
||||
dword playerInt;
|
||||
byte ccrLevel;
|
||||
wchar playerName[kMaxPlayerNameLength];
|
||||
};
|
||||
|
||||
struct Mcp2Srv_AgeRemovePlayerRequest : SrvMsgHeader {
|
||||
Uuid ageMcpId;
|
||||
Uuid accountUuid;
|
||||
dword playerInt;
|
||||
};
|
||||
|
||||
struct Mcp2Srv_AgeSpawnedReply : SrvMsgHeader {
|
||||
dword ageMcpId; // assigns a new mcpId if age wasn't found (in case of a reconnect)
|
||||
};
|
||||
|
||||
struct Mcp2Srv_AccountLoginReply : SrvMsgHeader {
|
||||
dword acctMcpId;
|
||||
};
|
||||
|
||||
struct Mcp2Srv_AccountNotifyKicked : SrvMsgHeader {
|
||||
Uuid accountUuid;
|
||||
dword acctMcpId;
|
||||
ENetError reason;
|
||||
};
|
||||
|
||||
struct Mcp2Srv_NotifyAgeSDLChanged : SrvMsgHeader {
|
||||
dword ageMcpId;
|
||||
byte global;
|
||||
};
|
||||
|
||||
struct Mcp2Srv_PropagateBuffer : SrvMsgHeader {
|
||||
dword ageMcpId;
|
||||
dword type;
|
||||
dword bytes;
|
||||
byte buffer[1]; // actually, buffer[bytes]
|
||||
// no more fields
|
||||
};
|
||||
|
||||
|
||||
//============================================================================
|
||||
// END PACKED DATA STRUCTURES
|
||||
//============================================================================
|
||||
#include <PopPack.h>
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Srv2Mcp functions
|
||||
*
|
||||
***/
|
||||
|
||||
bool Srv2McpValidateConnect (
|
||||
AsyncNotifySocketListen * listen,
|
||||
Srv2Mcp_ConnData * connectPtr
|
||||
);
|
||||
|
@ -1,72 +1,72 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Score/pnNpSrv2Score.cpp
|
||||
*
|
||||
***/
|
||||
|
||||
#ifdef SERVER
|
||||
|
||||
#define USES_PROTOCOL_SRV2SCORE
|
||||
|
||||
#include "../../../Pch.h"
|
||||
#pragma hdrstop
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Exports
|
||||
*
|
||||
***/
|
||||
|
||||
//===========================================================================
|
||||
bool Srv2ScoreValidateConnect (
|
||||
AsyncNotifySocketListen * listen,
|
||||
Srv2Score_ConnData * connectPtr
|
||||
) {
|
||||
// Ensure that there are enough bytes for the header
|
||||
const Srv2Score_ConnData & connect = * (const Srv2Score_ConnData *) listen->buffer;
|
||||
|
||||
// Validate message size
|
||||
const unsigned kMinStructSize = sizeof(dword) * 3;
|
||||
if (listen->bytes < kMinStructSize)
|
||||
return false;
|
||||
if (listen->bytes < connect.dataBytes)
|
||||
return false;
|
||||
|
||||
// Validate connect server type
|
||||
if (!(connect.srvType == kSrvTypeAuth || connect.srvType == kSrvTypeGame))
|
||||
return false;
|
||||
|
||||
ZEROPTR(connectPtr);
|
||||
MemCopy(connectPtr, &connect, min(sizeof(*connectPtr), connect.dataBytes));
|
||||
|
||||
listen->bytesProcessed += connect.dataBytes;
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // SERVER
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Score/pnNpSrv2Score.cpp
|
||||
*
|
||||
***/
|
||||
|
||||
#ifdef SERVER
|
||||
|
||||
#define USES_PROTOCOL_SRV2SCORE
|
||||
|
||||
#include "../../../Pch.h"
|
||||
#pragma hdrstop
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Exports
|
||||
*
|
||||
***/
|
||||
|
||||
//===========================================================================
|
||||
bool Srv2ScoreValidateConnect (
|
||||
AsyncNotifySocketListen * listen,
|
||||
Srv2Score_ConnData * connectPtr
|
||||
) {
|
||||
// Ensure that there are enough bytes for the header
|
||||
const Srv2Score_ConnData & connect = * (const Srv2Score_ConnData *) listen->buffer;
|
||||
|
||||
// Validate message size
|
||||
const unsigned kMinStructSize = sizeof(dword) * 3;
|
||||
if (listen->bytes < kMinStructSize)
|
||||
return false;
|
||||
if (listen->bytes < connect.dataBytes)
|
||||
return false;
|
||||
|
||||
// Validate connect server type
|
||||
if (!(connect.srvType == kSrvTypeAuth || connect.srvType == kSrvTypeGame))
|
||||
return false;
|
||||
|
||||
ZEROPTR(connectPtr);
|
||||
MemCopy(connectPtr, &connect, min(sizeof(*connectPtr), connect.dataBytes));
|
||||
|
||||
listen->bytesProcessed += connect.dataBytes;
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // SERVER
|
||||
|
@ -1,169 +1,169 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Score/pnNpSrv2Score.h
|
||||
*
|
||||
***/
|
||||
|
||||
#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNNETPROTOCOL_PRIVATE_PROTOCOLS_SRV2SCORE_PNNPSRV2SCORE_H
|
||||
#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Score/pnNpSrv2Score.h included more than once"
|
||||
#endif
|
||||
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNNETPROTOCOL_PRIVATE_PROTOCOLS_SRV2SCORE_PNNPSRV2SCORE_H
|
||||
|
||||
|
||||
//============================================================================
|
||||
// BEGIN PACKED DATA STRUCTURES
|
||||
//============================================================================
|
||||
#include <PshPack1.h>
|
||||
|
||||
// kNetProtocolSrv2Score messages
|
||||
enum {
|
||||
kSrv2Score_ScoreCreate = 0,
|
||||
kSrv2Score_ScoreGetScores = 1,
|
||||
kSrv2Score_ScoreAddPoints = 2,
|
||||
kSrv2Score_ScoreTransferPoints = 3,
|
||||
kSrv2Score_ScoreSetPoints = 4,
|
||||
kSrv2Score_ScoreDelete = 5,
|
||||
kSrv2Score_ScoreGetRanks = 6,
|
||||
};
|
||||
|
||||
enum {
|
||||
kScore2Srv_ScoreCreateReply = 0,
|
||||
kScore2Srv_ScoreGetScoresReply = 1,
|
||||
kScore2Srv_ScoreDeleteReply = 2,
|
||||
kScore2Srv_ScoreGetRanksReply = 3,
|
||||
};
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Srv2Score connect packet
|
||||
*
|
||||
***/
|
||||
|
||||
struct Srv2Score_ConnData {
|
||||
dword dataBytes;
|
||||
dword buildId;
|
||||
dword srvType;
|
||||
};
|
||||
struct Srv2Score_Connect {
|
||||
AsyncSocketConnectPacket hdr;
|
||||
Srv2Score_ConnData data;
|
||||
};
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Srv2Score message structures
|
||||
*
|
||||
***/
|
||||
|
||||
struct Srv2Score_ScoreCreate : SrvMsgHeader {
|
||||
dword ownerId;
|
||||
wchar gameName[kMaxGameScoreNameLength];
|
||||
dword gameType;
|
||||
dword value;
|
||||
};
|
||||
|
||||
struct Srv2Score_ScoreDelete : SrvMsgHeader {
|
||||
dword scoreId;
|
||||
};
|
||||
|
||||
struct Srv2Score_ScoreGetScores : SrvMsgHeader {
|
||||
dword ownerId;
|
||||
wchar gameName[kMaxGameScoreNameLength];
|
||||
};
|
||||
|
||||
struct Srv2Score_ScoreAddPoints : SrvMsgHeader {
|
||||
dword scoreId;
|
||||
dword numPoints;
|
||||
};
|
||||
|
||||
struct Srv2Score_ScoreTransferPoints : SrvMsgHeader {
|
||||
dword srcScoreId;
|
||||
dword destScoreId;
|
||||
dword numPoints;
|
||||
};
|
||||
|
||||
struct Srv2Score_ScoreSetPoints : SrvMsgHeader {
|
||||
dword scoreId;
|
||||
dword numPoints;
|
||||
};
|
||||
|
||||
struct Srv2Score_ScoreGetRanks : SrvMsgHeader {
|
||||
dword ownerId;
|
||||
dword scoreGroup;
|
||||
dword parentFolderId;
|
||||
wchar gameName[kMaxGameScoreNameLength];
|
||||
dword timePeriod;
|
||||
dword numResults;
|
||||
dword pageNumber;
|
||||
dword sortDesc;
|
||||
};
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Score2Srv message structures
|
||||
*
|
||||
***/
|
||||
|
||||
struct Score2Srv_ScoreCreateReply : SrvMsgHeader {
|
||||
dword scoreId;
|
||||
dword createdTime;
|
||||
};
|
||||
|
||||
struct Score2Srv_ScoreGetScoresReply : SrvMsgHeader {
|
||||
dword scoreCount;
|
||||
dword byteCount;
|
||||
byte buffer[1];
|
||||
};
|
||||
|
||||
struct Score2Srv_ScoreGetRanksReply : SrvMsgHeader {
|
||||
dword rankCount;
|
||||
dword byteCount;
|
||||
byte buffer[1];
|
||||
};
|
||||
|
||||
|
||||
//============================================================================
|
||||
// END PACKED DATA STRUCTURES
|
||||
//============================================================================
|
||||
#include <PopPack.h>
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Srv2Score functions
|
||||
*
|
||||
***/
|
||||
|
||||
bool Srv2ScoreValidateConnect (
|
||||
AsyncNotifySocketListen * listen,
|
||||
Srv2Score_ConnData * connectPtr
|
||||
);
|
||||
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Score/pnNpSrv2Score.h
|
||||
*
|
||||
***/
|
||||
|
||||
#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNNETPROTOCOL_PRIVATE_PROTOCOLS_SRV2SCORE_PNNPSRV2SCORE_H
|
||||
#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Score/pnNpSrv2Score.h included more than once"
|
||||
#endif
|
||||
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNNETPROTOCOL_PRIVATE_PROTOCOLS_SRV2SCORE_PNNPSRV2SCORE_H
|
||||
|
||||
|
||||
//============================================================================
|
||||
// BEGIN PACKED DATA STRUCTURES
|
||||
//============================================================================
|
||||
#include <PshPack1.h>
|
||||
|
||||
// kNetProtocolSrv2Score messages
|
||||
enum {
|
||||
kSrv2Score_ScoreCreate = 0,
|
||||
kSrv2Score_ScoreGetScores = 1,
|
||||
kSrv2Score_ScoreAddPoints = 2,
|
||||
kSrv2Score_ScoreTransferPoints = 3,
|
||||
kSrv2Score_ScoreSetPoints = 4,
|
||||
kSrv2Score_ScoreDelete = 5,
|
||||
kSrv2Score_ScoreGetRanks = 6,
|
||||
};
|
||||
|
||||
enum {
|
||||
kScore2Srv_ScoreCreateReply = 0,
|
||||
kScore2Srv_ScoreGetScoresReply = 1,
|
||||
kScore2Srv_ScoreDeleteReply = 2,
|
||||
kScore2Srv_ScoreGetRanksReply = 3,
|
||||
};
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Srv2Score connect packet
|
||||
*
|
||||
***/
|
||||
|
||||
struct Srv2Score_ConnData {
|
||||
dword dataBytes;
|
||||
dword buildId;
|
||||
dword srvType;
|
||||
};
|
||||
struct Srv2Score_Connect {
|
||||
AsyncSocketConnectPacket hdr;
|
||||
Srv2Score_ConnData data;
|
||||
};
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Srv2Score message structures
|
||||
*
|
||||
***/
|
||||
|
||||
struct Srv2Score_ScoreCreate : SrvMsgHeader {
|
||||
dword ownerId;
|
||||
wchar gameName[kMaxGameScoreNameLength];
|
||||
dword gameType;
|
||||
dword value;
|
||||
};
|
||||
|
||||
struct Srv2Score_ScoreDelete : SrvMsgHeader {
|
||||
dword scoreId;
|
||||
};
|
||||
|
||||
struct Srv2Score_ScoreGetScores : SrvMsgHeader {
|
||||
dword ownerId;
|
||||
wchar gameName[kMaxGameScoreNameLength];
|
||||
};
|
||||
|
||||
struct Srv2Score_ScoreAddPoints : SrvMsgHeader {
|
||||
dword scoreId;
|
||||
dword numPoints;
|
||||
};
|
||||
|
||||
struct Srv2Score_ScoreTransferPoints : SrvMsgHeader {
|
||||
dword srcScoreId;
|
||||
dword destScoreId;
|
||||
dword numPoints;
|
||||
};
|
||||
|
||||
struct Srv2Score_ScoreSetPoints : SrvMsgHeader {
|
||||
dword scoreId;
|
||||
dword numPoints;
|
||||
};
|
||||
|
||||
struct Srv2Score_ScoreGetRanks : SrvMsgHeader {
|
||||
dword ownerId;
|
||||
dword scoreGroup;
|
||||
dword parentFolderId;
|
||||
wchar gameName[kMaxGameScoreNameLength];
|
||||
dword timePeriod;
|
||||
dword numResults;
|
||||
dword pageNumber;
|
||||
dword sortDesc;
|
||||
};
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Score2Srv message structures
|
||||
*
|
||||
***/
|
||||
|
||||
struct Score2Srv_ScoreCreateReply : SrvMsgHeader {
|
||||
dword scoreId;
|
||||
dword createdTime;
|
||||
};
|
||||
|
||||
struct Score2Srv_ScoreGetScoresReply : SrvMsgHeader {
|
||||
dword scoreCount;
|
||||
dword byteCount;
|
||||
byte buffer[1];
|
||||
};
|
||||
|
||||
struct Score2Srv_ScoreGetRanksReply : SrvMsgHeader {
|
||||
dword rankCount;
|
||||
dword byteCount;
|
||||
byte buffer[1];
|
||||
};
|
||||
|
||||
|
||||
//============================================================================
|
||||
// END PACKED DATA STRUCTURES
|
||||
//============================================================================
|
||||
#include <PopPack.h>
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Srv2Score functions
|
||||
*
|
||||
***/
|
||||
|
||||
bool Srv2ScoreValidateConnect (
|
||||
AsyncNotifySocketListen * listen,
|
||||
Srv2Score_ConnData * connectPtr
|
||||
);
|
||||
|
||||
|
@ -1,72 +1,72 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2State/pnNpSrv2State.cpp
|
||||
*
|
||||
***/
|
||||
|
||||
#ifdef SERVER
|
||||
|
||||
#define USES_PROTOCOL_SRV2STATE
|
||||
|
||||
#include "../../../Pch.h"
|
||||
#pragma hdrstop
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Exports
|
||||
*
|
||||
***/
|
||||
|
||||
//===========================================================================
|
||||
bool Srv2StateValidateConnect (
|
||||
AsyncNotifySocketListen * listen,
|
||||
Srv2State_ConnData * connectPtr
|
||||
) {
|
||||
// Ensure that there are enough bytes for the header
|
||||
const Srv2State_ConnData & connect = * (const Srv2State_ConnData *) listen->buffer;
|
||||
|
||||
// Validate message size
|
||||
const unsigned kMinStructSize = sizeof(dword) * 3;
|
||||
if (listen->bytes < kMinStructSize)
|
||||
return false;
|
||||
if (listen->bytes < connect.dataBytes)
|
||||
return false;
|
||||
|
||||
// Validate connect server type
|
||||
if (!(connect.srvType == kSrvTypeAuth || connect.srvType == kSrvTypeGame))
|
||||
return false;
|
||||
|
||||
ZEROPTR(connectPtr);
|
||||
MemCopy(connectPtr, &connect, min(sizeof(*connectPtr), connect.dataBytes));
|
||||
|
||||
listen->bytesProcessed += connect.dataBytes;
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // SERVER
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2State/pnNpSrv2State.cpp
|
||||
*
|
||||
***/
|
||||
|
||||
#ifdef SERVER
|
||||
|
||||
#define USES_PROTOCOL_SRV2STATE
|
||||
|
||||
#include "../../../Pch.h"
|
||||
#pragma hdrstop
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Exports
|
||||
*
|
||||
***/
|
||||
|
||||
//===========================================================================
|
||||
bool Srv2StateValidateConnect (
|
||||
AsyncNotifySocketListen * listen,
|
||||
Srv2State_ConnData * connectPtr
|
||||
) {
|
||||
// Ensure that there are enough bytes for the header
|
||||
const Srv2State_ConnData & connect = * (const Srv2State_ConnData *) listen->buffer;
|
||||
|
||||
// Validate message size
|
||||
const unsigned kMinStructSize = sizeof(dword) * 3;
|
||||
if (listen->bytes < kMinStructSize)
|
||||
return false;
|
||||
if (listen->bytes < connect.dataBytes)
|
||||
return false;
|
||||
|
||||
// Validate connect server type
|
||||
if (!(connect.srvType == kSrvTypeAuth || connect.srvType == kSrvTypeGame))
|
||||
return false;
|
||||
|
||||
ZEROPTR(connectPtr);
|
||||
MemCopy(connectPtr, &connect, min(sizeof(*connectPtr), connect.dataBytes));
|
||||
|
||||
listen->bytesProcessed += connect.dataBytes;
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // SERVER
|
||||
|
@ -1,131 +1,131 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2State/pnNpSrv2State.h
|
||||
*
|
||||
***/
|
||||
|
||||
#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNNETPROTOCOL_PRIVATE_PROTOCOLS_SRV2STATE_PNNPSRV2STATE_H
|
||||
#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2State/pnNpSrv2State.h included more than once"
|
||||
#endif
|
||||
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNNETPROTOCOL_PRIVATE_PROTOCOLS_SRV2STATE_PNNPSRV2STATE_H
|
||||
|
||||
|
||||
// kNetProtocolSrv2State messages
|
||||
// Because SrvState must remain compatible with older auth builds, these message ids
|
||||
// must not change unless all front-end servers are synchronously replaced.
|
||||
enum {
|
||||
kSrv2State_SaveObject = 0,
|
||||
kSrv2State_DeleteObject = 1,
|
||||
kSrv2State_FetchObject = 2,
|
||||
};
|
||||
|
||||
enum {
|
||||
kState2Srv_ObjectFetched = 0,
|
||||
};
|
||||
|
||||
|
||||
//============================================================================
|
||||
// BEGIN PACKED DATA STRUCTURES
|
||||
//============================================================================
|
||||
#include <PshPack1.h>
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Srv2State connect packet
|
||||
*
|
||||
***/
|
||||
|
||||
struct Srv2State_ConnData {
|
||||
dword dataBytes;
|
||||
dword buildId;
|
||||
dword srvType;
|
||||
};
|
||||
struct Srv2State_Connect {
|
||||
AsyncSocketConnectPacket hdr;
|
||||
Srv2State_ConnData data;
|
||||
};
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Srv2State message structures
|
||||
*
|
||||
***/
|
||||
|
||||
struct Srv2State_FetchObject : SrvMsgHeader {
|
||||
Uuid ownerId;
|
||||
wchar objectName[kMaxStateObjectName];
|
||||
};
|
||||
|
||||
struct Srv2State_SaveObject : SrvMsgHeader {
|
||||
Uuid ownerId;
|
||||
wchar objectName[kMaxStateObjectName];
|
||||
dword objectDataBytes;
|
||||
byte objectData[1]; // objectData[objectDataBytes], actually
|
||||
// no more fields after var length alloc
|
||||
};
|
||||
|
||||
struct Srv2State_DeleteObject : SrvMsgHeader {
|
||||
Uuid ownerId;
|
||||
wchar objectName[kMaxStateObjectName];
|
||||
};
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* State2Srv message structures
|
||||
*
|
||||
***/
|
||||
|
||||
struct State2Srv_ObjectFetched : SrvMsgHeader {
|
||||
dword objectDataBytes;
|
||||
byte objectData[1];
|
||||
// no more fields after var length alloc
|
||||
};
|
||||
|
||||
|
||||
//============================================================================
|
||||
// END PACKED DATA STRUCTURES
|
||||
//============================================================================
|
||||
#include <PopPack.h>
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Srv2State functions
|
||||
*
|
||||
***/
|
||||
|
||||
bool Srv2StateValidateConnect (
|
||||
AsyncNotifySocketListen * listen,
|
||||
Srv2State_ConnData * connectPtr
|
||||
);
|
||||
|
||||
|
||||
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2State/pnNpSrv2State.h
|
||||
*
|
||||
***/
|
||||
|
||||
#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNNETPROTOCOL_PRIVATE_PROTOCOLS_SRV2STATE_PNNPSRV2STATE_H
|
||||
#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2State/pnNpSrv2State.h included more than once"
|
||||
#endif
|
||||
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNNETPROTOCOL_PRIVATE_PROTOCOLS_SRV2STATE_PNNPSRV2STATE_H
|
||||
|
||||
|
||||
// kNetProtocolSrv2State messages
|
||||
// Because SrvState must remain compatible with older auth builds, these message ids
|
||||
// must not change unless all front-end servers are synchronously replaced.
|
||||
enum {
|
||||
kSrv2State_SaveObject = 0,
|
||||
kSrv2State_DeleteObject = 1,
|
||||
kSrv2State_FetchObject = 2,
|
||||
};
|
||||
|
||||
enum {
|
||||
kState2Srv_ObjectFetched = 0,
|
||||
};
|
||||
|
||||
|
||||
//============================================================================
|
||||
// BEGIN PACKED DATA STRUCTURES
|
||||
//============================================================================
|
||||
#include <PshPack1.h>
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Srv2State connect packet
|
||||
*
|
||||
***/
|
||||
|
||||
struct Srv2State_ConnData {
|
||||
dword dataBytes;
|
||||
dword buildId;
|
||||
dword srvType;
|
||||
};
|
||||
struct Srv2State_Connect {
|
||||
AsyncSocketConnectPacket hdr;
|
||||
Srv2State_ConnData data;
|
||||
};
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Srv2State message structures
|
||||
*
|
||||
***/
|
||||
|
||||
struct Srv2State_FetchObject : SrvMsgHeader {
|
||||
Uuid ownerId;
|
||||
wchar objectName[kMaxStateObjectName];
|
||||
};
|
||||
|
||||
struct Srv2State_SaveObject : SrvMsgHeader {
|
||||
Uuid ownerId;
|
||||
wchar objectName[kMaxStateObjectName];
|
||||
dword objectDataBytes;
|
||||
byte objectData[1]; // objectData[objectDataBytes], actually
|
||||
// no more fields after var length alloc
|
||||
};
|
||||
|
||||
struct Srv2State_DeleteObject : SrvMsgHeader {
|
||||
Uuid ownerId;
|
||||
wchar objectName[kMaxStateObjectName];
|
||||
};
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* State2Srv message structures
|
||||
*
|
||||
***/
|
||||
|
||||
struct State2Srv_ObjectFetched : SrvMsgHeader {
|
||||
dword objectDataBytes;
|
||||
byte objectData[1];
|
||||
// no more fields after var length alloc
|
||||
};
|
||||
|
||||
|
||||
//============================================================================
|
||||
// END PACKED DATA STRUCTURES
|
||||
//============================================================================
|
||||
#include <PopPack.h>
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Srv2State functions
|
||||
*
|
||||
***/
|
||||
|
||||
bool Srv2StateValidateConnect (
|
||||
AsyncNotifySocketListen * listen,
|
||||
Srv2State_ConnData * connectPtr
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
@ -1,71 +1,71 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Vault/pnNpSrv2Vault.cpp
|
||||
*
|
||||
***/
|
||||
|
||||
#ifdef SERVER
|
||||
|
||||
#define USES_PROTOCOL_SRV2VAULT
|
||||
#include "../../../Pch.h"
|
||||
#pragma hdrstop
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Exports
|
||||
*
|
||||
***/
|
||||
|
||||
//===========================================================================
|
||||
bool Srv2VaultValidateConnect (
|
||||
AsyncNotifySocketListen * listen,
|
||||
Srv2Vault_ConnData * connectPtr
|
||||
) {
|
||||
// Ensure that there are enough bytes for the header
|
||||
const Srv2Vault_ConnData & connect = * (const Srv2Vault_ConnData *) listen->buffer;
|
||||
|
||||
// Validate message size
|
||||
const unsigned kMinStructSize = sizeof(dword) * 3;
|
||||
if (listen->bytes < kMinStructSize)
|
||||
return false;
|
||||
if (listen->bytes < connect.dataBytes)
|
||||
return false;
|
||||
|
||||
// Validate connect server type
|
||||
if (!(connect.srvType == kSrvTypeAuth || connect.srvType == kSrvTypeGame || connect.srvType == kSrvTypeMcp))
|
||||
return false;
|
||||
|
||||
ZEROPTR(connectPtr);
|
||||
MemCopy(connectPtr, &connect, min(sizeof(*connectPtr), connect.dataBytes));
|
||||
|
||||
listen->bytesProcessed += connect.dataBytes;
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // SERVER
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Vault/pnNpSrv2Vault.cpp
|
||||
*
|
||||
***/
|
||||
|
||||
#ifdef SERVER
|
||||
|
||||
#define USES_PROTOCOL_SRV2VAULT
|
||||
#include "../../../Pch.h"
|
||||
#pragma hdrstop
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Exports
|
||||
*
|
||||
***/
|
||||
|
||||
//===========================================================================
|
||||
bool Srv2VaultValidateConnect (
|
||||
AsyncNotifySocketListen * listen,
|
||||
Srv2Vault_ConnData * connectPtr
|
||||
) {
|
||||
// Ensure that there are enough bytes for the header
|
||||
const Srv2Vault_ConnData & connect = * (const Srv2Vault_ConnData *) listen->buffer;
|
||||
|
||||
// Validate message size
|
||||
const unsigned kMinStructSize = sizeof(dword) * 3;
|
||||
if (listen->bytes < kMinStructSize)
|
||||
return false;
|
||||
if (listen->bytes < connect.dataBytes)
|
||||
return false;
|
||||
|
||||
// Validate connect server type
|
||||
if (!(connect.srvType == kSrvTypeAuth || connect.srvType == kSrvTypeGame || connect.srvType == kSrvTypeMcp))
|
||||
return false;
|
||||
|
||||
ZEROPTR(connectPtr);
|
||||
MemCopy(connectPtr, &connect, min(sizeof(*connectPtr), connect.dataBytes));
|
||||
|
||||
listen->bytesProcessed += connect.dataBytes;
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // SERVER
|
||||
|
@ -1,452 +1,452 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Vault/pnNpSrv2Vault.h
|
||||
*
|
||||
***/
|
||||
|
||||
#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNNETPROTOCOL_PRIVATE_PROTOCOLS_SRV2VAULT_PNNPSRV2VAULT_H
|
||||
#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Vault/pnNpSrv2Vault.h included more than once"
|
||||
#endif
|
||||
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNNETPROTOCOL_PRIVATE_PROTOCOLS_SRV2VAULT_PNNPSRV2VAULT_H
|
||||
|
||||
|
||||
// kNetProtocolSrv2Db messages
|
||||
// Because SrvVault must remain compatible with older auth builds, these message ids
|
||||
// must not change unless all front-end servers are synchronously replaced.
|
||||
enum {
|
||||
// Player creation
|
||||
kSrv2Vault_PlayerCreateRequest = 0,
|
||||
kSrv2Vault_PlayerDeleteRequest = 1,
|
||||
kSrv2Vault_UpgradeVisitorRequest = 2,
|
||||
kSrv2Vault_ChangePlayerNameRequest = 3,
|
||||
|
||||
// Account
|
||||
kSrv2Vault_AccountLoginRequest = 20,
|
||||
kSrv2Vault_AccountLogout = 21,
|
||||
|
||||
// NodeRefs
|
||||
kSrv2Vault_FetchChildNodeRefs = 40,
|
||||
kSrv2Vault_NodeAdd = 41,
|
||||
kSrv2Vault_NodeRemove = 42,
|
||||
kSrv2Vault_NodeAdd2 = 43,
|
||||
kSrv2Vault_NodeRemove2 = 44,
|
||||
|
||||
// Nodes
|
||||
kSrv2Vault_NodeFetch = 60,
|
||||
kSrv2Vault_CreateNodeRequest = 61,
|
||||
kSrv2Vault_NodeSave = 62,
|
||||
kSrv2Vault_DeleteNodeRequest = 63,
|
||||
kSrv2Vault_NodeFindRequest = 64,
|
||||
kSrv2Vault_SendNode = 65,
|
||||
kSrv2Vault_NodeSave2 = 66,
|
||||
|
||||
// Notification targets
|
||||
kSrv2Vault_RegisterPlayerVault = 80,
|
||||
kSrv2Vault_UnregisterPlayerVault = 81,
|
||||
kSrv2Vault_RegisterAgeVault = 82,
|
||||
kSrv2Vault_UnregisterAgeVault = 83,
|
||||
kSrv2Vault_AgeInitRequest = 84,
|
||||
|
||||
// Public ages
|
||||
kSrv2Vault_GetPublicAgeList = 100,
|
||||
kSrv2Vault_SetAgePublic = 101,
|
||||
kSrv2Vault_CurrentPopulationReply = 102,
|
||||
// MCP Notifications
|
||||
kSrv2Vault_AccountOnline = 140,
|
||||
kSrv2Vault_AccountOffline = 141,
|
||||
kSrv2Vault_PlayerOnline = 142,
|
||||
kSrv2Vault_PlayerOffline = 143,
|
||||
kSrv2Vault_AgeOnline = 144,
|
||||
kSrv2Vault_AgeOffline = 145,
|
||||
kSrv2Vault_PlayerJoinedAge = 146,
|
||||
kSrv2Vault_PlayerLeftAge = 147,
|
||||
};
|
||||
|
||||
enum {
|
||||
// Player creation
|
||||
kVault2Srv_PlayerCreateReply = 0,
|
||||
kVault2Srv_PlayerDeleteReply = 1,
|
||||
kVault2Srv_UpgradeVisitorReply = 2,
|
||||
kVault2Srv_ChangePlayerNameReply = 3,
|
||||
|
||||
// Account
|
||||
kVault2Srv_AccountLoginReply = 20,
|
||||
|
||||
// NodeRefs
|
||||
kVault2Srv_NodeRefsFetched = 40,
|
||||
|
||||
// Nodes
|
||||
kVault2Srv_NodeFetched = 60,
|
||||
kVault2Srv_NodeCreated = 61,
|
||||
kVault2Srv_NodeFindReply = 62,
|
||||
|
||||
// Notification
|
||||
kVault2Srv_NodeChanged = 80,
|
||||
kVault2Srv_NodeAdded = 81,
|
||||
kVault2Srv_NodeRemoved = 82,
|
||||
kVault2Srv_NodeDeleted = 83,
|
||||
|
||||
// Notification targets
|
||||
kVault2Srv_AgeInitReply = 102,
|
||||
|
||||
// Public ages
|
||||
kVault2Srv_PublicAgeList = 120,
|
||||
kVault2Srv_CurrentPopulationRequest = 121,
|
||||
|
||||
// AgeSDL
|
||||
kVault2Srv_NotifyAgeSDLChanged = 140,
|
||||
};
|
||||
|
||||
|
||||
//============================================================================
|
||||
// BEGIN PACKED DATA STRUCTURES
|
||||
//============================================================================
|
||||
#include <PshPack1.h>
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Srv2Vault connect packet
|
||||
*
|
||||
***/
|
||||
|
||||
struct Srv2Vault_ConnData {
|
||||
dword dataBytes;
|
||||
dword buildId;
|
||||
dword srvType;
|
||||
};
|
||||
struct Srv2Vault_Connect {
|
||||
AsyncSocketConnectPacket hdr;
|
||||
Srv2Vault_ConnData data;
|
||||
};
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Srv2Vault packets
|
||||
*
|
||||
***/
|
||||
|
||||
struct Srv2Vault_PlayerCreateRequest : SrvMsgHeader {
|
||||
Uuid accountUuid;
|
||||
wchar playerName[kMaxPlayerNameLength];
|
||||
wchar avatarShape[MAX_PATH];
|
||||
wchar friendInvite[MAX_PATH];
|
||||
byte explorer;
|
||||
};
|
||||
|
||||
struct Srv2Vault_PlayerDeleteRequest : SrvMsgHeader {
|
||||
Uuid accountId;
|
||||
dword playerId;
|
||||
};
|
||||
|
||||
struct Srv2Vault_UpgradeVisitorRequest : SrvMsgHeader {
|
||||
Uuid accountId;
|
||||
dword playerId;
|
||||
};
|
||||
|
||||
struct Srv2Vault_AccountLoginRequest : SrvMsgHeader {
|
||||
Uuid accountUuid;
|
||||
};
|
||||
|
||||
struct Srv2Vault_AccountLogout : SrvMsgHeader {
|
||||
Uuid accountUuid;
|
||||
};
|
||||
|
||||
struct Srv2Vault_FetchChildNodeRefs : SrvMsgHeader {
|
||||
dword parentId;
|
||||
dword maxDepth;
|
||||
};
|
||||
|
||||
struct Srv2Vault_NodeFetch : SrvMsgHeader {
|
||||
dword nodeId;
|
||||
};
|
||||
|
||||
struct Srv2Vault_CreateNodeRequest : SrvMsgHeader {
|
||||
Uuid accountId;
|
||||
dword creatorId;
|
||||
dword nodeBytes;
|
||||
byte nodeBuffer[1];
|
||||
};
|
||||
|
||||
struct Srv2Vault_DeleteNodeRequest : SrvMsgHeader {
|
||||
dword nodeId;
|
||||
unsigned playerCheckId;
|
||||
unsigned isRequestFromAuth;
|
||||
};
|
||||
|
||||
struct Srv2Vault_NodeSave : SrvMsgHeader {
|
||||
dword nodeId;
|
||||
unsigned playerCheckId;
|
||||
unsigned isRequestFromAuth;
|
||||
Uuid revisionId;
|
||||
dword nodeBytes;
|
||||
byte nodeBuffer[1];
|
||||
};
|
||||
|
||||
struct Srv2Vault_NodeSave2 : SrvMsgHeader {
|
||||
dword nodeId;
|
||||
unsigned playerCheckId;
|
||||
unsigned isRequestFromAuth;
|
||||
Uuid revisionId;
|
||||
dword nodeBytes;
|
||||
byte nodeBuffer[1];
|
||||
};
|
||||
|
||||
struct Srv2Vault_NodeAdd : SrvMsgHeader {
|
||||
NetVaultNodeRef ref;
|
||||
};
|
||||
|
||||
struct Srv2Vault_NodeAdd2 : SrvMsgHeader {
|
||||
NetVaultNodeRef ref;
|
||||
};
|
||||
|
||||
struct Srv2Vault_NodeRemove : SrvMsgHeader {
|
||||
dword parentId;
|
||||
dword childId;
|
||||
unsigned playerCheckId;
|
||||
unsigned isRequestFromAuth;
|
||||
};
|
||||
|
||||
struct Srv2Vault_NodeRemove2 : SrvMsgHeader {
|
||||
dword parentId;
|
||||
dword childId;
|
||||
unsigned playerCheckId;
|
||||
unsigned isRequestFromAuth;
|
||||
};
|
||||
|
||||
struct Srv2Vault_NodeFindRequest : SrvMsgHeader {
|
||||
// Template node to match
|
||||
dword nodeBytes;
|
||||
byte nodeBuffer[1]; // [nodeBytes], actually
|
||||
// no more fields after var length alloc
|
||||
};
|
||||
|
||||
struct Srv2Vault_SendNode : SrvMsgHeader {
|
||||
dword srcPlayerId; // sender
|
||||
dword srcNodeId; // sent item
|
||||
dword dstPlayerId; // recipient
|
||||
};
|
||||
|
||||
struct Srv2Vault_RegisterPlayerVault : SrvMsgHeader {
|
||||
Uuid accountId;
|
||||
dword playerId;
|
||||
};
|
||||
|
||||
struct Srv2Vault_UnregisterPlayerVault : SrvMsgHeader {
|
||||
Uuid accountId;
|
||||
};
|
||||
|
||||
struct Srv2Vault_RegisterAgeVault : SrvMsgHeader {
|
||||
Uuid accountId;
|
||||
dword ageId; // age's vault node id
|
||||
};
|
||||
|
||||
struct Srv2Vault_UnregisterAgeVault : SrvMsgHeader {
|
||||
Uuid accountId;
|
||||
};
|
||||
|
||||
struct Srv2Vault_AgeInitRequest : SrvMsgHeader {
|
||||
Uuid accountId;
|
||||
dword playerId;
|
||||
Uuid ageInstId;
|
||||
Uuid parentAgeInstId;
|
||||
dword ageLanguage;
|
||||
dword ageSequenceNumber;
|
||||
// packed fields:
|
||||
// wchar ageFilename[]
|
||||
// wchar ageInstName[]
|
||||
// wchar ageUserName[]
|
||||
// wchar ageDesc[]
|
||||
};
|
||||
|
||||
struct Srv2Vault_GetPublicAgeList : SrvMsgHeader {
|
||||
wchar ageName[kMaxAgeNameLength];
|
||||
};
|
||||
|
||||
struct Srv2Vault_SetAgePublic : SrvMsgHeader {
|
||||
dword playerId;
|
||||
dword ageInfoId;
|
||||
byte publicOrNot;
|
||||
};
|
||||
|
||||
struct Srv2Vault_CurrentPopulationReply : SrvMsgHeader {
|
||||
dword ageCount;
|
||||
unsigned agePopulations[1]; // [ageCount], actually
|
||||
// no more fields after var length alloc
|
||||
};
|
||||
|
||||
struct Srv2Vault_ChangePlayerNameRequest : SrvMsgHeader {
|
||||
Uuid accountId;
|
||||
dword playerId;
|
||||
wchar newName[kMaxPlayerNameLength];
|
||||
};
|
||||
|
||||
struct Srv2Vault_AccountOnline : SrvMsgHeader {
|
||||
Uuid acctId;
|
||||
dword buildId;
|
||||
dword authNode;
|
||||
};
|
||||
|
||||
struct Srv2Vault_AccountOffline : SrvMsgHeader {
|
||||
Uuid acctId;
|
||||
dword buildId;
|
||||
};
|
||||
|
||||
struct Srv2Vault_PlayerOnline : SrvMsgHeader {
|
||||
Uuid acctId;
|
||||
dword buildId;
|
||||
dword playerId;
|
||||
};
|
||||
|
||||
struct Srv2Vault_PlayerOffline : SrvMsgHeader {
|
||||
dword playerId;
|
||||
dword buildId;
|
||||
};
|
||||
|
||||
struct Srv2Vault_AgeOnline : SrvMsgHeader {
|
||||
Uuid ageInstId;
|
||||
dword buildId;
|
||||
dword gameNode;
|
||||
};
|
||||
|
||||
struct Srv2Vault_AgeOffline : SrvMsgHeader {
|
||||
Uuid ageInstId;
|
||||
dword buildId;
|
||||
};
|
||||
|
||||
struct Srv2Vault_PlayerJoinedAge : SrvMsgHeader {
|
||||
dword playerId;
|
||||
Uuid ageInstId;
|
||||
dword buildId;
|
||||
};
|
||||
|
||||
struct Srv2Vault_PlayerLeftAge : SrvMsgHeader {
|
||||
dword playerId;
|
||||
dword buildId;
|
||||
};
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Vault2Srv packets
|
||||
*
|
||||
***/
|
||||
|
||||
struct Vault2Srv_PlayerCreateReply : SrvMsgHeader {
|
||||
dword playerId;
|
||||
};
|
||||
|
||||
struct Vault2Srv_AccountLoginReply : SrvMsgHeader {
|
||||
dword playerInfoCount;
|
||||
SrvPlayerInfo playerInfos[1];
|
||||
};
|
||||
|
||||
struct Vault2Srv_NodeRefsFetched : SrvMsgHeader {
|
||||
dword refCount;
|
||||
NetVaultNodeRef refs[1];
|
||||
};
|
||||
|
||||
struct Vault2Srv_NodeFetched : SrvMsgHeader {
|
||||
dword nodeBytes;
|
||||
byte nodeBuffer[1];
|
||||
};
|
||||
|
||||
struct Vault2Srv_NodeCreated : SrvMsgHeader {
|
||||
dword nodeId;
|
||||
};
|
||||
|
||||
struct Vault2Srv_NodeChanged : SrvMsgHeader {
|
||||
dword nodeId;
|
||||
Uuid revisionId;
|
||||
Uuid accountId; // the notify target
|
||||
};
|
||||
|
||||
struct Vault2Srv_NodeAdded : SrvMsgHeader {
|
||||
NetVaultNodeRef ref;
|
||||
Uuid accountId; // the notify target
|
||||
};
|
||||
|
||||
struct Vault2Srv_NodeRemoved : SrvMsgHeader {
|
||||
dword parentId;
|
||||
dword childId;
|
||||
Uuid accountId; // the notify target
|
||||
};
|
||||
|
||||
struct Vault2Srv_NodeDeleted : SrvMsgHeader {
|
||||
dword nodeId;
|
||||
Uuid accountId; // the notify target
|
||||
};
|
||||
|
||||
struct Vault2Srv_NodeFindReply : SrvMsgHeader {
|
||||
// out: ids of matching nodes
|
||||
dword nodeIdCount;
|
||||
dword nodeIds[1]; // [nodeIdCount], actually
|
||||
// no more fields after var length alloc
|
||||
};
|
||||
|
||||
struct Vault2Srv_AgeInitReply : SrvMsgHeader {
|
||||
dword ageNodeId;
|
||||
dword ageInfoNodeId;
|
||||
Uuid accountId; // the requestor
|
||||
};
|
||||
|
||||
struct Vault2Srv_PublicAgeList : SrvMsgHeader {
|
||||
dword ageCount;
|
||||
NetAgeInfo ages[1]; // [ageCount], actually
|
||||
// no more fields after var length alloc
|
||||
};
|
||||
|
||||
struct Vault2Srv_NotifyAgeSDLChanged : SrvMsgHeader {
|
||||
wchar ageName[kMaxAgeNameLength];
|
||||
Uuid ageInstId;
|
||||
};
|
||||
|
||||
struct Vault2Srv_CurrentPopulationRequest : SrvMsgHeader {
|
||||
dword ageCount;
|
||||
Uuid ageInstIds[1]; // [ageCount], actually
|
||||
// no more fields after var length alloc
|
||||
};
|
||||
|
||||
//============================================================================
|
||||
// END PACKED DATA STRUCTURES
|
||||
//============================================================================
|
||||
#include <PopPack.h>
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Srv2Vault functions
|
||||
*
|
||||
***/
|
||||
|
||||
bool Srv2VaultValidateConnect (
|
||||
AsyncNotifySocketListen * listen,
|
||||
Srv2Vault_ConnData * connectPtr
|
||||
);
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*****************************************************************************
|
||||
*
|
||||
* $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Vault/pnNpSrv2Vault.h
|
||||
*
|
||||
***/
|
||||
|
||||
#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNNETPROTOCOL_PRIVATE_PROTOCOLS_SRV2VAULT_PNNPSRV2VAULT_H
|
||||
#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Vault/pnNpSrv2Vault.h included more than once"
|
||||
#endif
|
||||
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNNETPROTOCOL_PRIVATE_PROTOCOLS_SRV2VAULT_PNNPSRV2VAULT_H
|
||||
|
||||
|
||||
// kNetProtocolSrv2Db messages
|
||||
// Because SrvVault must remain compatible with older auth builds, these message ids
|
||||
// must not change unless all front-end servers are synchronously replaced.
|
||||
enum {
|
||||
// Player creation
|
||||
kSrv2Vault_PlayerCreateRequest = 0,
|
||||
kSrv2Vault_PlayerDeleteRequest = 1,
|
||||
kSrv2Vault_UpgradeVisitorRequest = 2,
|
||||
kSrv2Vault_ChangePlayerNameRequest = 3,
|
||||
|
||||
// Account
|
||||
kSrv2Vault_AccountLoginRequest = 20,
|
||||
kSrv2Vault_AccountLogout = 21,
|
||||
|
||||
// NodeRefs
|
||||
kSrv2Vault_FetchChildNodeRefs = 40,
|
||||
kSrv2Vault_NodeAdd = 41,
|
||||
kSrv2Vault_NodeRemove = 42,
|
||||
kSrv2Vault_NodeAdd2 = 43,
|
||||
kSrv2Vault_NodeRemove2 = 44,
|
||||
|
||||
// Nodes
|
||||
kSrv2Vault_NodeFetch = 60,
|
||||
kSrv2Vault_CreateNodeRequest = 61,
|
||||
kSrv2Vault_NodeSave = 62,
|
||||
kSrv2Vault_DeleteNodeRequest = 63,
|
||||
kSrv2Vault_NodeFindRequest = 64,
|
||||
kSrv2Vault_SendNode = 65,
|
||||
kSrv2Vault_NodeSave2 = 66,
|
||||
|
||||
// Notification targets
|
||||
kSrv2Vault_RegisterPlayerVault = 80,
|
||||
kSrv2Vault_UnregisterPlayerVault = 81,
|
||||
kSrv2Vault_RegisterAgeVault = 82,
|
||||
kSrv2Vault_UnregisterAgeVault = 83,
|
||||
kSrv2Vault_AgeInitRequest = 84,
|
||||
|
||||
// Public ages
|
||||
kSrv2Vault_GetPublicAgeList = 100,
|
||||
kSrv2Vault_SetAgePublic = 101,
|
||||
kSrv2Vault_CurrentPopulationReply = 102,
|
||||
// MCP Notifications
|
||||
kSrv2Vault_AccountOnline = 140,
|
||||
kSrv2Vault_AccountOffline = 141,
|
||||
kSrv2Vault_PlayerOnline = 142,
|
||||
kSrv2Vault_PlayerOffline = 143,
|
||||
kSrv2Vault_AgeOnline = 144,
|
||||
kSrv2Vault_AgeOffline = 145,
|
||||
kSrv2Vault_PlayerJoinedAge = 146,
|
||||
kSrv2Vault_PlayerLeftAge = 147,
|
||||
};
|
||||
|
||||
enum {
|
||||
// Player creation
|
||||
kVault2Srv_PlayerCreateReply = 0,
|
||||
kVault2Srv_PlayerDeleteReply = 1,
|
||||
kVault2Srv_UpgradeVisitorReply = 2,
|
||||
kVault2Srv_ChangePlayerNameReply = 3,
|
||||
|
||||
// Account
|
||||
kVault2Srv_AccountLoginReply = 20,
|
||||
|
||||
// NodeRefs
|
||||
kVault2Srv_NodeRefsFetched = 40,
|
||||
|
||||
// Nodes
|
||||
kVault2Srv_NodeFetched = 60,
|
||||
kVault2Srv_NodeCreated = 61,
|
||||
kVault2Srv_NodeFindReply = 62,
|
||||
|
||||
// Notification
|
||||
kVault2Srv_NodeChanged = 80,
|
||||
kVault2Srv_NodeAdded = 81,
|
||||
kVault2Srv_NodeRemoved = 82,
|
||||
kVault2Srv_NodeDeleted = 83,
|
||||
|
||||
// Notification targets
|
||||
kVault2Srv_AgeInitReply = 102,
|
||||
|
||||
// Public ages
|
||||
kVault2Srv_PublicAgeList = 120,
|
||||
kVault2Srv_CurrentPopulationRequest = 121,
|
||||
|
||||
// AgeSDL
|
||||
kVault2Srv_NotifyAgeSDLChanged = 140,
|
||||
};
|
||||
|
||||
|
||||
//============================================================================
|
||||
// BEGIN PACKED DATA STRUCTURES
|
||||
//============================================================================
|
||||
#include <PshPack1.h>
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Srv2Vault connect packet
|
||||
*
|
||||
***/
|
||||
|
||||
struct Srv2Vault_ConnData {
|
||||
dword dataBytes;
|
||||
dword buildId;
|
||||
dword srvType;
|
||||
};
|
||||
struct Srv2Vault_Connect {
|
||||
AsyncSocketConnectPacket hdr;
|
||||
Srv2Vault_ConnData data;
|
||||
};
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Srv2Vault packets
|
||||
*
|
||||
***/
|
||||
|
||||
struct Srv2Vault_PlayerCreateRequest : SrvMsgHeader {
|
||||
Uuid accountUuid;
|
||||
wchar playerName[kMaxPlayerNameLength];
|
||||
wchar avatarShape[MAX_PATH];
|
||||
wchar friendInvite[MAX_PATH];
|
||||
byte explorer;
|
||||
};
|
||||
|
||||
struct Srv2Vault_PlayerDeleteRequest : SrvMsgHeader {
|
||||
Uuid accountId;
|
||||
dword playerId;
|
||||
};
|
||||
|
||||
struct Srv2Vault_UpgradeVisitorRequest : SrvMsgHeader {
|
||||
Uuid accountId;
|
||||
dword playerId;
|
||||
};
|
||||
|
||||
struct Srv2Vault_AccountLoginRequest : SrvMsgHeader {
|
||||
Uuid accountUuid;
|
||||
};
|
||||
|
||||
struct Srv2Vault_AccountLogout : SrvMsgHeader {
|
||||
Uuid accountUuid;
|
||||
};
|
||||
|
||||
struct Srv2Vault_FetchChildNodeRefs : SrvMsgHeader {
|
||||
dword parentId;
|
||||
dword maxDepth;
|
||||
};
|
||||
|
||||
struct Srv2Vault_NodeFetch : SrvMsgHeader {
|
||||
dword nodeId;
|
||||
};
|
||||
|
||||
struct Srv2Vault_CreateNodeRequest : SrvMsgHeader {
|
||||
Uuid accountId;
|
||||
dword creatorId;
|
||||
dword nodeBytes;
|
||||
byte nodeBuffer[1];
|
||||
};
|
||||
|
||||
struct Srv2Vault_DeleteNodeRequest : SrvMsgHeader {
|
||||
dword nodeId;
|
||||
unsigned playerCheckId;
|
||||
unsigned isRequestFromAuth;
|
||||
};
|
||||
|
||||
struct Srv2Vault_NodeSave : SrvMsgHeader {
|
||||
dword nodeId;
|
||||
unsigned playerCheckId;
|
||||
unsigned isRequestFromAuth;
|
||||
Uuid revisionId;
|
||||
dword nodeBytes;
|
||||
byte nodeBuffer[1];
|
||||
};
|
||||
|
||||
struct Srv2Vault_NodeSave2 : SrvMsgHeader {
|
||||
dword nodeId;
|
||||
unsigned playerCheckId;
|
||||
unsigned isRequestFromAuth;
|
||||
Uuid revisionId;
|
||||
dword nodeBytes;
|
||||
byte nodeBuffer[1];
|
||||
};
|
||||
|
||||
struct Srv2Vault_NodeAdd : SrvMsgHeader {
|
||||
NetVaultNodeRef ref;
|
||||
};
|
||||
|
||||
struct Srv2Vault_NodeAdd2 : SrvMsgHeader {
|
||||
NetVaultNodeRef ref;
|
||||
};
|
||||
|
||||
struct Srv2Vault_NodeRemove : SrvMsgHeader {
|
||||
dword parentId;
|
||||
dword childId;
|
||||
unsigned playerCheckId;
|
||||
unsigned isRequestFromAuth;
|
||||
};
|
||||
|
||||
struct Srv2Vault_NodeRemove2 : SrvMsgHeader {
|
||||
dword parentId;
|
||||
dword childId;
|
||||
unsigned playerCheckId;
|
||||
unsigned isRequestFromAuth;
|
||||
};
|
||||
|
||||
struct Srv2Vault_NodeFindRequest : SrvMsgHeader {
|
||||
// Template node to match
|
||||
dword nodeBytes;
|
||||
byte nodeBuffer[1]; // [nodeBytes], actually
|
||||
// no more fields after var length alloc
|
||||
};
|
||||
|
||||
struct Srv2Vault_SendNode : SrvMsgHeader {
|
||||
dword srcPlayerId; // sender
|
||||
dword srcNodeId; // sent item
|
||||
dword dstPlayerId; // recipient
|
||||
};
|
||||
|
||||
struct Srv2Vault_RegisterPlayerVault : SrvMsgHeader {
|
||||
Uuid accountId;
|
||||
dword playerId;
|
||||
};
|
||||
|
||||
struct Srv2Vault_UnregisterPlayerVault : SrvMsgHeader {
|
||||
Uuid accountId;
|
||||
};
|
||||
|
||||
struct Srv2Vault_RegisterAgeVault : SrvMsgHeader {
|
||||
Uuid accountId;
|
||||
dword ageId; // age's vault node id
|
||||
};
|
||||
|
||||
struct Srv2Vault_UnregisterAgeVault : SrvMsgHeader {
|
||||
Uuid accountId;
|
||||
};
|
||||
|
||||
struct Srv2Vault_AgeInitRequest : SrvMsgHeader {
|
||||
Uuid accountId;
|
||||
dword playerId;
|
||||
Uuid ageInstId;
|
||||
Uuid parentAgeInstId;
|
||||
dword ageLanguage;
|
||||
dword ageSequenceNumber;
|
||||
// packed fields:
|
||||
// wchar ageFilename[]
|
||||
// wchar ageInstName[]
|
||||
// wchar ageUserName[]
|
||||
// wchar ageDesc[]
|
||||
};
|
||||
|
||||
struct Srv2Vault_GetPublicAgeList : SrvMsgHeader {
|
||||
wchar ageName[kMaxAgeNameLength];
|
||||
};
|
||||
|
||||
struct Srv2Vault_SetAgePublic : SrvMsgHeader {
|
||||
dword playerId;
|
||||
dword ageInfoId;
|
||||
byte publicOrNot;
|
||||
};
|
||||
|
||||
struct Srv2Vault_CurrentPopulationReply : SrvMsgHeader {
|
||||
dword ageCount;
|
||||
unsigned agePopulations[1]; // [ageCount], actually
|
||||
// no more fields after var length alloc
|
||||
};
|
||||
|
||||
struct Srv2Vault_ChangePlayerNameRequest : SrvMsgHeader {
|
||||
Uuid accountId;
|
||||
dword playerId;
|
||||
wchar newName[kMaxPlayerNameLength];
|
||||
};
|
||||
|
||||
struct Srv2Vault_AccountOnline : SrvMsgHeader {
|
||||
Uuid acctId;
|
||||
dword buildId;
|
||||
dword authNode;
|
||||
};
|
||||
|
||||
struct Srv2Vault_AccountOffline : SrvMsgHeader {
|
||||
Uuid acctId;
|
||||
dword buildId;
|
||||
};
|
||||
|
||||
struct Srv2Vault_PlayerOnline : SrvMsgHeader {
|
||||
Uuid acctId;
|
||||
dword buildId;
|
||||
dword playerId;
|
||||
};
|
||||
|
||||
struct Srv2Vault_PlayerOffline : SrvMsgHeader {
|
||||
dword playerId;
|
||||
dword buildId;
|
||||
};
|
||||
|
||||
struct Srv2Vault_AgeOnline : SrvMsgHeader {
|
||||
Uuid ageInstId;
|
||||
dword buildId;
|
||||
dword gameNode;
|
||||
};
|
||||
|
||||
struct Srv2Vault_AgeOffline : SrvMsgHeader {
|
||||
Uuid ageInstId;
|
||||
dword buildId;
|
||||
};
|
||||
|
||||
struct Srv2Vault_PlayerJoinedAge : SrvMsgHeader {
|
||||
dword playerId;
|
||||
Uuid ageInstId;
|
||||
dword buildId;
|
||||
};
|
||||
|
||||
struct Srv2Vault_PlayerLeftAge : SrvMsgHeader {
|
||||
dword playerId;
|
||||
dword buildId;
|
||||
};
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Vault2Srv packets
|
||||
*
|
||||
***/
|
||||
|
||||
struct Vault2Srv_PlayerCreateReply : SrvMsgHeader {
|
||||
dword playerId;
|
||||
};
|
||||
|
||||
struct Vault2Srv_AccountLoginReply : SrvMsgHeader {
|
||||
dword playerInfoCount;
|
||||
SrvPlayerInfo playerInfos[1];
|
||||
};
|
||||
|
||||
struct Vault2Srv_NodeRefsFetched : SrvMsgHeader {
|
||||
dword refCount;
|
||||
NetVaultNodeRef refs[1];
|
||||
};
|
||||
|
||||
struct Vault2Srv_NodeFetched : SrvMsgHeader {
|
||||
dword nodeBytes;
|
||||
byte nodeBuffer[1];
|
||||
};
|
||||
|
||||
struct Vault2Srv_NodeCreated : SrvMsgHeader {
|
||||
dword nodeId;
|
||||
};
|
||||
|
||||
struct Vault2Srv_NodeChanged : SrvMsgHeader {
|
||||
dword nodeId;
|
||||
Uuid revisionId;
|
||||
Uuid accountId; // the notify target
|
||||
};
|
||||
|
||||
struct Vault2Srv_NodeAdded : SrvMsgHeader {
|
||||
NetVaultNodeRef ref;
|
||||
Uuid accountId; // the notify target
|
||||
};
|
||||
|
||||
struct Vault2Srv_NodeRemoved : SrvMsgHeader {
|
||||
dword parentId;
|
||||
dword childId;
|
||||
Uuid accountId; // the notify target
|
||||
};
|
||||
|
||||
struct Vault2Srv_NodeDeleted : SrvMsgHeader {
|
||||
dword nodeId;
|
||||
Uuid accountId; // the notify target
|
||||
};
|
||||
|
||||
struct Vault2Srv_NodeFindReply : SrvMsgHeader {
|
||||
// out: ids of matching nodes
|
||||
dword nodeIdCount;
|
||||
dword nodeIds[1]; // [nodeIdCount], actually
|
||||
// no more fields after var length alloc
|
||||
};
|
||||
|
||||
struct Vault2Srv_AgeInitReply : SrvMsgHeader {
|
||||
dword ageNodeId;
|
||||
dword ageInfoNodeId;
|
||||
Uuid accountId; // the requestor
|
||||
};
|
||||
|
||||
struct Vault2Srv_PublicAgeList : SrvMsgHeader {
|
||||
dword ageCount;
|
||||
NetAgeInfo ages[1]; // [ageCount], actually
|
||||
// no more fields after var length alloc
|
||||
};
|
||||
|
||||
struct Vault2Srv_NotifyAgeSDLChanged : SrvMsgHeader {
|
||||
wchar ageName[kMaxAgeNameLength];
|
||||
Uuid ageInstId;
|
||||
};
|
||||
|
||||
struct Vault2Srv_CurrentPopulationRequest : SrvMsgHeader {
|
||||
dword ageCount;
|
||||
Uuid ageInstIds[1]; // [ageCount], actually
|
||||
// no more fields after var length alloc
|
||||
};
|
||||
|
||||
//============================================================================
|
||||
// END PACKED DATA STRUCTURES
|
||||
//============================================================================
|
||||
#include <PopPack.h>
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Srv2Vault functions
|
||||
*
|
||||
***/
|
||||
|
||||
bool Srv2VaultValidateConnect (
|
||||
AsyncNotifySocketListen * listen,
|
||||
Srv2Vault_ConnData * connectPtr
|
||||
);
|
||||
|
Reference in New Issue
Block a user