mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-13 18:17:49 -04:00
CWE Directory Reorganization
Rearrange directory structure of CWE to be loosely equivalent to the H'uru Plasma repository. Part 1: Movement of directories and files.
This commit is contained in:
@ -0,0 +1,721 @@
|
||||
/*==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/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
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_CLI2AUTH
|
||||
#include "../../../Pch.h"
|
||||
#pragma hdrstop
|
||||
|
||||
|
||||
namespace Cli2Auth {
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Cli2Auth message definitions
|
||||
*
|
||||
***/
|
||||
|
||||
static const NetMsgField kPingRequestFields[] = {
|
||||
kNetMsgFieldTimeMs, // pingTimeMs
|
||||
NET_MSG_FIELD_DWORD(), // transId
|
||||
NET_MSG_FIELD_VAR_COUNT(1, 64 * 1024), // payloadBytes
|
||||
NET_MSG_FIELD_VAR_PTR(), // payload
|
||||
};
|
||||
|
||||
static const NetMsgField kClientRegisterRequestFields[] = {
|
||||
kNetMsgFieldBuildId, // buildId
|
||||
};
|
||||
|
||||
static const NetMsgField kAccountExistsRequestFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldAccountName, // accountName
|
||||
};
|
||||
|
||||
static const NetMsgField kAcctLoginRequestFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
NET_MSG_FIELD_DWORD(), // clientChallenge
|
||||
kNetMsgFieldAccountName, // accountName
|
||||
kNetMsgFieldShaDigest, // challenge
|
||||
NET_MSG_FIELD_STRING(kMaxPublisherAuthKeyLength), // authToken
|
||||
NET_MSG_FIELD_STRING(kMaxGTOSIdLength), // os
|
||||
};
|
||||
|
||||
static const NetMsgField kAgeRequestFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
NET_MSG_FIELD_STRING(kMaxAgeNameLength), // ageName
|
||||
kNetMsgFieldUuid, // ageInstId
|
||||
};
|
||||
|
||||
static const NetMsgField kAcctCreateRequestFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
NET_MSG_FIELD_STRING(kMaxAccountNameLength), // accountName
|
||||
kNetMsgFieldShaDigest, // namePassHash
|
||||
NET_MSG_FIELD_DWORD(), // accountFlags
|
||||
NET_MSG_FIELD_DWORD(), // billingType
|
||||
};
|
||||
|
||||
static const NetMsgField kAcctCreateFromKeyRequestFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
NET_MSG_FIELD_STRING(kMaxAccountNameLength), // accountName
|
||||
kNetMsgFieldShaDigest, // namePassHash
|
||||
kNetMsgFieldUuid, // key
|
||||
NET_MSG_FIELD_DWORD(), // billingType
|
||||
};
|
||||
|
||||
static const NetMsgField kPlayerCreateRequestFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
NET_MSG_FIELD_STRING(kMaxPlayerNameLength), // playerName
|
||||
NET_MSG_FIELD_STRING(MAX_PATH), // avatarShape
|
||||
NET_MSG_FIELD_STRING(MAX_PATH), // friendInvite
|
||||
};
|
||||
|
||||
static const NetMsgField kPlayerDeleteRequestFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
NET_MSG_FIELD_DWORD(), // playerInt
|
||||
};
|
||||
|
||||
static const NetMsgField kUpgradeVisitorRequestFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
NET_MSG_FIELD_DWORD(), // playerInt
|
||||
};
|
||||
|
||||
static const NetMsgField kAcctSetPlayerRequestFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
NET_MSG_FIELD_DWORD(), // playerInt
|
||||
};
|
||||
|
||||
static const NetMsgField kAcctChangePasswordRequestFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
NET_MSG_FIELD_STRING(kMaxAccountNameLength), // accountName
|
||||
kNetMsgFieldShaDigest, // namePassHash
|
||||
};
|
||||
|
||||
static const NetMsgField kAcctSetRolesRequestFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
NET_MSG_FIELD_STRING(kMaxAccountNameLength), // accountName
|
||||
NET_MSG_FIELD_DWORD(), // accountFlags
|
||||
};
|
||||
|
||||
static const NetMsgField kAcctSetBillingTypeRequestFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
NET_MSG_FIELD_STRING(kMaxAccountNameLength), // accountName
|
||||
NET_MSG_FIELD_DWORD(), // billingType
|
||||
};
|
||||
|
||||
static const NetMsgField kAcctActivateRequestFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldUuid, // activationKey
|
||||
};
|
||||
|
||||
static const NetMsgField kFileListRequestFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
NET_MSG_FIELD_STRING(MAX_PATH), // directory
|
||||
NET_MSG_FIELD_STRING(MAX_EXT), // ext
|
||||
};
|
||||
|
||||
static const NetMsgField kFileDownloadRequestFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
NET_MSG_FIELD_STRING(MAX_PATH), // filename
|
||||
};
|
||||
|
||||
static const NetMsgField kFileDownloadChunkAckFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
};
|
||||
|
||||
static const NetMsgField kVaultFetchNodeRefsFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
NET_MSG_FIELD_DWORD(), // nodeId
|
||||
};
|
||||
|
||||
static const NetMsgField kVaultNodeAddFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
NET_MSG_FIELD_DWORD(), // parentId
|
||||
NET_MSG_FIELD_DWORD(), // childId
|
||||
NET_MSG_FIELD_DWORD(), // ownerId
|
||||
};
|
||||
|
||||
static const NetMsgField kVaultNodeRemoveFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
NET_MSG_FIELD_DWORD(), // parentId
|
||||
NET_MSG_FIELD_DWORD(), // childId
|
||||
};
|
||||
|
||||
static const NetMsgField kVaultNodeSaveFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
NET_MSG_FIELD_DWORD(), // nodeId
|
||||
kNetMsgFieldUuid, // revId
|
||||
NET_MSG_FIELD_VAR_COUNT(1, 1024 * 1024), // nodeBytes
|
||||
NET_MSG_FIELD_VAR_PTR(), // nodeBuffer
|
||||
};
|
||||
|
||||
static const NetMsgField kVaultNodeCreateFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
NET_MSG_FIELD_VAR_COUNT(1, 1024 * 1024), // nodeBytes
|
||||
NET_MSG_FIELD_VAR_PTR(), // nodeBuffer
|
||||
};
|
||||
|
||||
static const NetMsgField kVaultNodeFetchFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
NET_MSG_FIELD_DWORD(), // nodeId
|
||||
};
|
||||
|
||||
static const NetMsgField kVaultInitAgeRequestFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldUuid, // ageInstId
|
||||
kNetMsgFieldUuid, // parentAgeInstId
|
||||
NET_MSG_FIELD_STRING(MAX_PATH), // ageFilename
|
||||
NET_MSG_FIELD_STRING(MAX_PATH), // ageInstName
|
||||
NET_MSG_FIELD_STRING(MAX_PATH), // ageUserName
|
||||
NET_MSG_FIELD_STRING(1024), // ageDesc
|
||||
NET_MSG_FIELD_DWORD(), // ageSequenceNumber
|
||||
NET_MSG_FIELD_DWORD(), // ageLanguage
|
||||
};
|
||||
|
||||
static const NetMsgField kVaultNodeFindFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
NET_MSG_FIELD_VAR_COUNT(1, 1024 * 1024), // nodeBytes
|
||||
NET_MSG_FIELD_VAR_PTR(), // nodeBuffer
|
||||
};
|
||||
|
||||
static const NetMsgField kVaultSetSeenFields[] = {
|
||||
NET_MSG_FIELD_DWORD(), // parentId
|
||||
NET_MSG_FIELD_DWORD(), // childId
|
||||
NET_MSG_FIELD_BYTE(), // seen
|
||||
};
|
||||
|
||||
static const NetMsgField kVaultSendNodeFields[] = {
|
||||
NET_MSG_FIELD_DWORD(), // srcNodeId
|
||||
NET_MSG_FIELD_DWORD(), // dstPlayerId
|
||||
};
|
||||
|
||||
static const NetMsgField kGetPublicAgeListFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
NET_MSG_FIELD_STRING(kMaxAgeNameLength), // ageFilename
|
||||
};
|
||||
|
||||
static const NetMsgField kSetAgePublicFields[] = {
|
||||
NET_MSG_FIELD_DWORD(), // ageInfoId
|
||||
NET_MSG_FIELD_BYTE(), // publicOrNot
|
||||
};
|
||||
|
||||
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 kClientSetCCRLevelFields[] = {
|
||||
NET_MSG_FIELD_DWORD(), // ccrLevel
|
||||
};
|
||||
|
||||
static const NetMsgField kLogPythonTracebackFields[] = {
|
||||
NET_MSG_FIELD_STRING(1024), // traceback text
|
||||
};
|
||||
|
||||
static const NetMsgField kLogStackDumpFields[] = {
|
||||
NET_MSG_FIELD_STRING(1024), // stackdump text
|
||||
};
|
||||
|
||||
static const NetMsgField kLogClientDebuggerConnectFields[] = {
|
||||
NET_MSG_FIELD_DWORD(), // nothing
|
||||
};
|
||||
|
||||
static const NetMsgField kSetPlayerBanStatusRequestFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
NET_MSG_FIELD_DWORD(), // playerId
|
||||
NET_MSG_FIELD_DWORD(), // banned
|
||||
};
|
||||
|
||||
static const NetMsgField kKickPlayerFields[] = {
|
||||
NET_MSG_FIELD_DWORD(), // playerId
|
||||
};
|
||||
|
||||
static const NetMsgField kChangePlayerNameRequestFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
NET_MSG_FIELD_DWORD(), // playerId
|
||||
NET_MSG_FIELD_STRING(kMaxPlayerNameLength), // newName
|
||||
};
|
||||
|
||||
static const NetMsgField kSendFriendInviteRequestFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldUuid, // inviteUuid
|
||||
NET_MSG_FIELD_STRING(kMaxEmailAddressLength), // emailAddress
|
||||
NET_MSG_FIELD_STRING(kMaxPlayerNameLength), // toPlayer
|
||||
};
|
||||
|
||||
static const NetMsgField kScoreCreateFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
NET_MSG_FIELD_DWORD(), // ownerId
|
||||
NET_MSG_FIELD_STRING(kMaxGameScoreNameLength), // gameName
|
||||
NET_MSG_FIELD_DWORD(), // gameType
|
||||
NET_MSG_FIELD_DWORD(), // value
|
||||
};
|
||||
|
||||
static const NetMsgField kScoreDeleteFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
NET_MSG_FIELD_DWORD(), // scoreId
|
||||
};
|
||||
|
||||
static const NetMsgField kScoreGetScoresFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
NET_MSG_FIELD_DWORD(), // ownerId
|
||||
NET_MSG_FIELD_STRING(kMaxGameScoreNameLength), // gameName
|
||||
};
|
||||
|
||||
static const NetMsgField kScoreAddPointsFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
NET_MSG_FIELD_DWORD(), // scoreId
|
||||
NET_MSG_FIELD_DWORD(), // numPoints
|
||||
};
|
||||
|
||||
static const NetMsgField kScoreTransferPointsFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
NET_MSG_FIELD_DWORD(), // srcScoreId
|
||||
NET_MSG_FIELD_DWORD(), // destScoreId
|
||||
NET_MSG_FIELD_DWORD(), // numPoints
|
||||
};
|
||||
|
||||
static const NetMsgField kScoreSetPointsFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
NET_MSG_FIELD_DWORD(), // scoreId
|
||||
NET_MSG_FIELD_DWORD(), // numPoints
|
||||
};
|
||||
|
||||
static const NetMsgField kScoreGetRanksFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
NET_MSG_FIELD_DWORD(), // ownerId
|
||||
NET_MSG_FIELD_DWORD(), // scoreGroup
|
||||
NET_MSG_FIELD_DWORD(), // parentFolderId
|
||||
NET_MSG_FIELD_STRING(kMaxGameScoreNameLength), // gameName
|
||||
NET_MSG_FIELD_DWORD(), // timePeriod
|
||||
NET_MSG_FIELD_DWORD(), // numResults
|
||||
NET_MSG_FIELD_DWORD(), // pageNumber
|
||||
NET_MSG_FIELD_DWORD(), // sortDesc
|
||||
};
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Auth2Cli message fields
|
||||
*
|
||||
***/
|
||||
|
||||
static const NetMsgField kPingReplyFields[] = {
|
||||
kNetMsgFieldTimeMs, // pingTimeMs
|
||||
NET_MSG_FIELD_DWORD(), // transId
|
||||
NET_MSG_FIELD_VAR_COUNT(1, 64 * 1024), // payloadBytes
|
||||
NET_MSG_FIELD_VAR_PTR(), // payload
|
||||
};
|
||||
|
||||
static const NetMsgField kClientRegisterReplyFields[] = {
|
||||
NET_MSG_FIELD_DWORD(), // serverChallenge
|
||||
};
|
||||
|
||||
static const NetMsgField kAccountExistsReplyFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldENetError, // result
|
||||
NET_MSG_FIELD_BYTE(), // account exists
|
||||
};
|
||||
|
||||
static const NetMsgField kServerAddrFields[] = {
|
||||
kNetMsgFieldNetNode, // srvAddr
|
||||
kNetMsgFieldUuid, // token
|
||||
};
|
||||
|
||||
static const NetMsgField kNotifyNewBuildFields[] = {
|
||||
NET_MSG_FIELD_DWORD(), // foo
|
||||
};
|
||||
|
||||
static const NetMsgField kAcctPlayerInfoFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
NET_MSG_FIELD_DWORD(), // playerInt
|
||||
NET_MSG_FIELD_STRING(kMaxPlayerNameLength), // playerName
|
||||
NET_MSG_FIELD_STRING(kMaxVaultNodeStringLength), // avatarShape
|
||||
NET_MSG_FIELD_DWORD(), // explorer
|
||||
};
|
||||
|
||||
static const NetMsgField kAcctLoginReplyFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldENetError, // result
|
||||
kNetMsgFieldUuid, // accountId
|
||||
NET_MSG_FIELD_DWORD(), // accountFlags
|
||||
NET_MSG_FIELD_DWORD(), // billingType
|
||||
NET_MSG_FIELD_DWORD_ARRAY(4), // encryptionKey
|
||||
};
|
||||
|
||||
static const NetMsgField kAgeReplyFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldENetError, // result
|
||||
NET_MSG_FIELD_DWORD(), // ageMcpId
|
||||
kNetMsgFieldUuid, // ageInstId
|
||||
NET_MSG_FIELD_DWORD(), // ageVaultId
|
||||
kNetMsgFieldNetNode, // gameSrvNode
|
||||
};
|
||||
|
||||
static const NetMsgField kAcctCreateReplyFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldENetError, // result
|
||||
kNetMsgFieldUuid // accountId
|
||||
};
|
||||
|
||||
static const NetMsgField kAcctCreateFromKeyReplyFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldENetError, // result
|
||||
kNetMsgFieldUuid, // accountId
|
||||
kNetMsgFieldUuid // activationKey
|
||||
};
|
||||
|
||||
static const NetMsgField kPlayerCreateReplyFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldENetError, // result
|
||||
NET_MSG_FIELD_DWORD(), // playerInt
|
||||
NET_MSG_FIELD_DWORD(), // explorer
|
||||
NET_MSG_FIELD_STRING(kMaxPlayerNameLength), // playerName
|
||||
NET_MSG_FIELD_STRING(kMaxVaultNodeStringLength), // avatarShape
|
||||
};
|
||||
|
||||
static const NetMsgField kPlayerDeleteReplyFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldENetError, // result
|
||||
};
|
||||
|
||||
static const NetMsgField kUpgradeVisitorReplyFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldENetError, // result
|
||||
};
|
||||
|
||||
static const NetMsgField kAcctSetPlayerReplyFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldENetError, // result
|
||||
};
|
||||
|
||||
static const NetMsgField kAcctChangePasswordReplyFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldENetError, // result
|
||||
};
|
||||
|
||||
static const NetMsgField kAcctSetRolesReplyFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldENetError, // result
|
||||
};
|
||||
|
||||
static const NetMsgField kAcctSetBillingTypeReplyFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldENetError, // result
|
||||
};
|
||||
|
||||
static const NetMsgField kAcctActivateReplyFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldENetError, // result
|
||||
};
|
||||
|
||||
static const NetMsgField kFileListReplyFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldENetError, // result
|
||||
NET_MSG_FIELD_VAR_COUNT(sizeof(wchar), 1024 * 1024), // wcharCount
|
||||
NET_MSG_FIELD_VAR_PTR(), // fileData
|
||||
};
|
||||
|
||||
static const NetMsgField kFileDownloadChunkFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldENetError, // result
|
||||
NET_MSG_FIELD_DWORD(), // totalFileSize
|
||||
NET_MSG_FIELD_DWORD(), // chunkOffset
|
||||
NET_MSG_FIELD_VAR_COUNT(1, kMaxTcpPacketSize), // chunkSize
|
||||
NET_MSG_FIELD_VAR_PTR(), // chunkData
|
||||
};
|
||||
|
||||
static const NetMsgField kKickedOffFields[] = {
|
||||
kNetMsgFieldENetError, // reason
|
||||
};
|
||||
|
||||
static const NetMsgField kVaultNodeFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
NET_MSG_FIELD_VAR_COUNT(1, 1024 * 1024), // nodeBytes
|
||||
NET_MSG_FIELD_VAR_PTR(), // nodeBuffer
|
||||
};
|
||||
|
||||
static const NetMsgField kVaultNodeRefsFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
NET_MSG_FIELD_VAR_COUNT(sizeof(NetVaultNodeRef), 1024 * 1024), // refCount
|
||||
NET_MSG_FIELD_VAR_PTR(), // refs
|
||||
};
|
||||
|
||||
static const NetMsgField kVaultNodeCreatedFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldENetError, // result
|
||||
NET_MSG_FIELD_DWORD(), // nodeId
|
||||
};
|
||||
|
||||
static const NetMsgField kVaultNodeRefsFetchedFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldENetError, // result
|
||||
NET_MSG_FIELD_VAR_COUNT(sizeof(NetVaultNodeRef), 1024 * 1024), // refCount
|
||||
NET_MSG_FIELD_VAR_PTR(), // refs
|
||||
};
|
||||
|
||||
static const NetMsgField kVaultNodeFetchedFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldENetError, // result
|
||||
NET_MSG_FIELD_VAR_COUNT(1, 1024 * 1024), // nodeBytes
|
||||
NET_MSG_FIELD_VAR_PTR(), // nodeBuffer
|
||||
};
|
||||
|
||||
static const NetMsgField kVaultNodeChangedFields[] = {
|
||||
NET_MSG_FIELD_DWORD(), // nodeId
|
||||
kNetMsgFieldUuid, // revisionId
|
||||
};
|
||||
|
||||
static const NetMsgField kVaultNodeAddedFields[] = {
|
||||
NET_MSG_FIELD_DWORD(), // parentId
|
||||
NET_MSG_FIELD_DWORD(), // childId
|
||||
NET_MSG_FIELD_DWORD(), // ownerId
|
||||
};
|
||||
|
||||
static const NetMsgField kVaultNodeRemovedFields[] = {
|
||||
NET_MSG_FIELD_DWORD(), // parentId
|
||||
NET_MSG_FIELD_DWORD(), // childId
|
||||
};
|
||||
|
||||
static const NetMsgField kVaultNodeDeletedFields[] = {
|
||||
NET_MSG_FIELD_DWORD(), // nodeId
|
||||
};
|
||||
|
||||
static const NetMsgField kVaultSaveNodeReplyFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldENetError, // result
|
||||
};
|
||||
|
||||
static const NetMsgField kVaultAddNodeReplyFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldENetError, // result
|
||||
};
|
||||
|
||||
static const NetMsgField kVaultRemoveNodeReplyFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldENetError, // result
|
||||
};
|
||||
|
||||
static const NetMsgField kVaultInitAgeReplyFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldENetError, // result
|
||||
NET_MSG_FIELD_DWORD(), // ageVaultId
|
||||
NET_MSG_FIELD_DWORD(), // ageInfoVaultId
|
||||
};
|
||||
|
||||
static const NetMsgField kVaultNodeFindReplyFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldENetError, // result
|
||||
NET_MSG_FIELD_VAR_COUNT(sizeof(dword), 512), // nodeIdCount
|
||||
NET_MSG_FIELD_VAR_PTR(), // nodeIds
|
||||
};
|
||||
|
||||
static const NetMsgField kPublicAgeListFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldENetError, // result
|
||||
NET_MSG_FIELD_VAR_COUNT(sizeof(NetAgeInfo), 512), // ageCount
|
||||
NET_MSG_FIELD_VAR_PTR(), // ages
|
||||
};
|
||||
|
||||
static const NetMsgField kSetPlayerBanStatusReplyFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldENetError, // result
|
||||
};
|
||||
|
||||
static const NetMsgField kChangePlayerNameReplyFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldENetError, // result
|
||||
};
|
||||
|
||||
static const NetMsgField kSendFriendInviteReplyFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldENetError, // result
|
||||
};
|
||||
|
||||
static const NetMsgField kScoreCreateReplyFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldENetError, // result
|
||||
NET_MSG_FIELD_DWORD(), // scoreId
|
||||
NET_MSG_FIELD_DWORD(), // createdTime
|
||||
};
|
||||
|
||||
static const NetMsgField kScoreDeleteReplyFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldENetError, // result
|
||||
};
|
||||
|
||||
static const NetMsgField kScoreGetScoresReplyFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldENetError, // result
|
||||
NET_MSG_FIELD_DWORD(), // scoreCount
|
||||
NET_MSG_FIELD_VAR_COUNT(1, 1024 * 1024), // nodeBytes
|
||||
NET_MSG_FIELD_VAR_PTR(), // nodeBuffer
|
||||
};
|
||||
|
||||
static const NetMsgField kScoreAddPointsReplyFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldENetError, // result
|
||||
};
|
||||
|
||||
static const NetMsgField kScoreTransferPointsReplyFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldENetError, // result
|
||||
};
|
||||
|
||||
static const NetMsgField kScoreSetPointsReplyFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldENetError, // result
|
||||
};
|
||||
|
||||
static const NetMsgField kScoreGetRanksReplyFields[] = {
|
||||
kNetMsgFieldTransId, // transId
|
||||
kNetMsgFieldENetError, // result
|
||||
NET_MSG_FIELD_DWORD(), // rankCount
|
||||
NET_MSG_FIELD_VAR_COUNT(1, 1024 * 1024), // nodeBytes
|
||||
NET_MSG_FIELD_VAR_PTR(), // nodeBuffer
|
||||
};
|
||||
|
||||
} using namespace Cli2Auth;
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Exported data
|
||||
*
|
||||
***/
|
||||
|
||||
|
||||
const NetMsg kNetMsg_Cli2Auth_PingRequest = NET_MSG(kCli2Auth_PingRequest, kPingRequestFields);
|
||||
const NetMsg kNetMsg_Cli2Auth_ClientRegisterRequest = NET_MSG(kCli2Auth_ClientRegisterRequest, kClientRegisterRequestFields);
|
||||
const NetMsg kNetMsg_Cli2Auth_AccountExistsRequest = NET_MSG(kCli2Auth_AccountExistsRequest, kAccountExistsRequestFields);
|
||||
const NetMsg kNetMsg_Cli2Auth_AcctLoginRequest = NET_MSG(kCli2Auth_AcctLoginRequest, kAcctLoginRequestFields);
|
||||
const NetMsg kNetMsg_Cli2Auth_AcctCreateRequest = NET_MSG(kCli2Auth_AcctCreateRequest, kAcctCreateRequestFields);
|
||||
const NetMsg kNetMsg_Cli2Auth_AcctCreateFromKeyRequest = NET_MSG(kCli2Auth_AcctCreateFromKeyRequest, kAcctCreateFromKeyRequestFields);
|
||||
const NetMsg kNetMsg_Cli2Auth_PlayerCreateRequest = NET_MSG(kCli2Auth_PlayerCreateRequest, kPlayerCreateRequestFields);
|
||||
const NetMsg kNetMsg_Cli2Auth_PlayerDeleteRequest = NET_MSG(kCli2Auth_PlayerDeleteRequest, kPlayerDeleteRequestFields);
|
||||
const NetMsg kNetMsg_Cli2Auth_UpgradeVisitorRequest = NET_MSG(kCli2Auth_UpgradeVisitorRequest, kUpgradeVisitorRequestFields);
|
||||
const NetMsg kNetMsg_Cli2Auth_AcctSetPlayerRequest = NET_MSG(kCli2Auth_AcctSetPlayerRequest, kAcctSetPlayerRequestFields);
|
||||
const NetMsg kNetMsg_Cli2Auth_AcctChangePasswordRequest = NET_MSG(kCli2Auth_AcctChangePasswordRequest, kAcctChangePasswordRequestFields);
|
||||
const NetMsg kNetMsg_Cli2Auth_AcctSetRolesRequest = NET_MSG(kCli2Auth_AcctSetRolesRequest, kAcctSetRolesRequestFields);
|
||||
const NetMsg kNetMsg_Cli2Auth_AcctSetBillingTypeRequest = NET_MSG(kCli2Auth_AcctSetBillingTypeRequest, kAcctSetBillingTypeRequestFields);
|
||||
const NetMsg kNetMsg_Cli2Auth_AcctActivateRequest = NET_MSG(kCli2Auth_AcctActivateRequest, kAcctActivateRequestFields);
|
||||
const NetMsg kNetMsg_Cli2Auth_AgeRequest = NET_MSG(kCli2Auth_AgeRequest, kAgeRequestFields);
|
||||
const NetMsg kNetMsg_Cli2Auth_FileListRequest = NET_MSG(kCli2Auth_FileListRequest, kFileListRequestFields);
|
||||
const NetMsg kNetMsg_Cli2Auth_FileDownloadRequest = NET_MSG(kCli2Auth_FileDownloadRequest, kFileDownloadRequestFields);
|
||||
const NetMsg kNetMsg_Cli2Auth_FileDownloadChunkAck = NET_MSG(kCli2Auth_FileDownloadChunkAck, kFileDownloadChunkAckFields);
|
||||
const NetMsg kNetMsg_Cli2Auth_VaultFetchNodeRefs = NET_MSG(kCli2Auth_VaultFetchNodeRefs, kVaultFetchNodeRefsFields);
|
||||
const NetMsg kNetMsg_Cli2Auth_VaultNodeAdd = NET_MSG(kCli2Auth_VaultNodeAdd, kVaultNodeAddFields);
|
||||
const NetMsg kNetMsg_Cli2Auth_VaultNodeRemove = NET_MSG(kCli2Auth_VaultNodeRemove, kVaultNodeRemoveFields);
|
||||
const NetMsg kNetMsg_Cli2Auth_VaultNodeCreate = NET_MSG(kCli2Auth_VaultNodeCreate, kVaultNodeCreateFields);
|
||||
const NetMsg kNetMsg_Cli2Auth_VaultNodeSave = NET_MSG(kCli2Auth_VaultNodeSave, kVaultNodeSaveFields);
|
||||
const NetMsg kNetMsg_Cli2Auth_VaultNodeFetch = NET_MSG(kCli2Auth_VaultNodeFetch, kVaultNodeFetchFields);
|
||||
const NetMsg kNetMsg_Cli2Auth_VaultInitAgeRequest = NET_MSG(kCli2Auth_VaultInitAgeRequest, kVaultInitAgeRequestFields);
|
||||
const NetMsg kNetMsg_Cli2Auth_VaultNodeFind = NET_MSG(kCli2Auth_VaultNodeFind, kVaultNodeFindFields);
|
||||
const NetMsg kNetMsg_Cli2Auth_VaultSetSeen = NET_MSG(kCli2Auth_VaultSetSeen, kVaultSetSeenFields);
|
||||
const NetMsg kNetMsg_Cli2Auth_VaultSendNode = NET_MSG(kCli2Auth_VaultSendNode, kVaultSendNodeFields);
|
||||
const NetMsg kNetMsg_Cli2Auth_GetPublicAgeList = NET_MSG(kCli2Auth_GetPublicAgeList, kGetPublicAgeListFields);
|
||||
const NetMsg kNetMsg_Cli2Auth_SetAgePublic = NET_MSG(kCli2Auth_SetAgePublic, kSetAgePublicFields);
|
||||
const NetMsg kNetMsg_Cli2Auth_PropagateBuffer = NET_MSG(kCli2Auth_PropagateBuffer, kPropagateBufferFields);
|
||||
const NetMsg kNetMsg_Cli2Auth_ClientSetCCRLevel = NET_MSG(kCli2Auth_ClientSetCCRLevel, kClientSetCCRLevelFields);
|
||||
const NetMsg kNetMsg_Cli2Auth_LogPythonTraceback = NET_MSG(kCli2Auth_LogPythonTraceback, kLogPythonTracebackFields);
|
||||
const NetMsg kNetMsg_Cli2Auth_LogStackDump = NET_MSG(kCli2Auth_LogStackDump, kLogStackDumpFields);
|
||||
const NetMsg kNetMsg_Cli2Auth_LogClientDebuggerConnect = NET_MSG(kCli2Auth_LogClientDebuggerConnect, kLogClientDebuggerConnectFields);
|
||||
const NetMsg kNetMsg_Cli2Auth_SetPlayerBanStatusRequest = NET_MSG(kCli2Auth_SetPlayerBanStatusRequest, kSetPlayerBanStatusRequestFields);
|
||||
const NetMsg kNetMsg_Cli2Auth_KickPlayer = NET_MSG(kCli2Auth_KickPlayer, kKickPlayerFields);
|
||||
const NetMsg kNetMsg_Cli2Auth_ChangePlayerNameRequest = NET_MSG(kCli2Auth_ChangePlayerNameRequest, kChangePlayerNameRequestFields);
|
||||
const NetMsg kNetMsg_Cli2Auth_SendFriendInviteRequest = NET_MSG(kCli2Auth_SendFriendInviteRequest, kSendFriendInviteRequestFields);
|
||||
const NetMsg kNetMsg_Cli2Auth_ScoreCreate = NET_MSG(kCli2Auth_ScoreCreate, kScoreCreateFields);
|
||||
const NetMsg kNetMsg_Cli2Auth_ScoreDelete = NET_MSG(kCli2Auth_ScoreDelete, kScoreDeleteFields);
|
||||
const NetMsg kNetMsg_Cli2Auth_ScoreGetScores = NET_MSG(kCli2Auth_ScoreGetScores, kScoreGetScoresFields);
|
||||
const NetMsg kNetMsg_Cli2Auth_ScoreAddPoints = NET_MSG(kCli2Auth_ScoreAddPoints, kScoreAddPointsFields);
|
||||
const NetMsg kNetMsg_Cli2Auth_ScoreTransferPoints = NET_MSG(kCli2Auth_ScoreTransferPoints, kScoreTransferPointsFields);
|
||||
const NetMsg kNetMsg_Cli2Auth_ScoreSetPoints = NET_MSG(kCli2Auth_ScoreSetPoints, kScoreSetPointsFields);
|
||||
const NetMsg kNetMsg_Cli2Auth_ScoreGetRanks = NET_MSG(kCli2Auth_ScoreGetRanks, kScoreGetRanksFields);
|
||||
|
||||
const NetMsg kNetMsg_Auth2Cli_PingReply = NET_MSG(kAuth2Cli_PingReply, kPingReplyFields);
|
||||
const NetMsg kNetMsg_Auth2Cli_ClientRegisterReply = NET_MSG(kAuth2Cli_ClientRegisterReply, kClientRegisterReplyFields);
|
||||
const NetMsg kNetMsg_Auth2Cli_AccountExistsReply = NET_MSG(kAuth2Cli_AccountExistsReply, kAccountExistsReplyFields);
|
||||
const NetMsg kNetMsg_Auth2Cli_ServerAddr = NET_MSG(kAuth2Cli_ServerAddr, kServerAddrFields);
|
||||
const NetMsg kNetMsg_Auth2Cli_NotifyNewBuild = NET_MSG(kAuth2Cli_NotifyNewBuild, kNotifyNewBuildFields);
|
||||
const NetMsg kNetMsg_Auth2Cli_AcctPlayerInfo = NET_MSG(kAuth2Cli_AcctPlayerInfo, kAcctPlayerInfoFields);
|
||||
const NetMsg kNetMsg_Auth2Cli_AcctLoginReply = NET_MSG(kAuth2Cli_AcctLoginReply, kAcctLoginReplyFields);
|
||||
const NetMsg kNetMsg_Auth2Cli_AcctCreateReply = NET_MSG(kAuth2Cli_AcctCreateReply, kAcctCreateReplyFields);
|
||||
const NetMsg kNetMsg_Auth2Cli_AcctCreateFromKeyReply = NET_MSG(kAuth2Cli_AcctCreateFromKeyReply, kAcctCreateFromKeyReplyFields);
|
||||
const NetMsg kNetMsg_Auth2Cli_PlayerCreateReply = NET_MSG(kAuth2Cli_PlayerCreateReply, kPlayerCreateReplyFields);
|
||||
const NetMsg kNetMsg_Auth2Cli_PlayerDeleteReply = NET_MSG(kAuth2Cli_PlayerDeleteReply, kPlayerDeleteReplyFields);
|
||||
const NetMsg kNetMsg_Auth2Cli_UpgradeVisitorReply = NET_MSG(kAuth2Cli_UpgradeVisitorReply, kUpgradeVisitorReplyFields);
|
||||
const NetMsg kNetMsg_Auth2Cli_AcctSetPlayerReply = NET_MSG(kAuth2Cli_AcctSetPlayerReply, kAcctSetPlayerReplyFields);
|
||||
const NetMsg kNetMsg_Auth2Cli_AcctChangePasswordReply = NET_MSG(kAuth2Cli_AcctChangePasswordReply, kAcctChangePasswordReplyFields);
|
||||
const NetMsg kNetMsg_Auth2Cli_AcctSetRolesReply = NET_MSG(kAuth2Cli_AcctSetRolesReply, kAcctSetRolesReplyFields);
|
||||
const NetMsg kNetMsg_Auth2Cli_AcctSetBillingTypeReply = NET_MSG(kAuth2Cli_AcctSetBillingTypeReply, kAcctSetBillingTypeReplyFields);
|
||||
const NetMsg kNetMsg_Auth2Cli_AcctActivateReply = NET_MSG(kAuth2Cli_AcctActivateReply, kAcctActivateReplyFields);
|
||||
const NetMsg kNetMsg_Auth2Cli_AgeReply = NET_MSG(kAuth2Cli_AgeReply, kAgeReplyFields);
|
||||
const NetMsg kNetMsg_Auth2Cli_FileListReply = NET_MSG(kAuth2Cli_FileListReply, kFileListReplyFields);
|
||||
const NetMsg kNetMsg_Auth2Cli_FileDownloadChunk = NET_MSG(kAuth2Cli_FileDownloadChunk, kFileDownloadChunkFields);
|
||||
const NetMsg kNetMsg_Auth2Cli_KickedOff = NET_MSG(kAuth2Cli_KickedOff, kKickedOffFields);
|
||||
const NetMsg kNetMsg_Auth2Cli_VaultNodeRefsFetched = NET_MSG(kAuth2Cli_VaultNodeRefsFetched, kVaultNodeRefsFetchedFields);
|
||||
const NetMsg kNetMsg_Auth2Cli_VaultNodeCreated = NET_MSG(kAuth2Cli_VaultNodeCreated, kVaultNodeCreatedFields);
|
||||
const NetMsg kNetMsg_Auth2Cli_VaultNodeFetched = NET_MSG(kAuth2Cli_VaultNodeFetched, kVaultNodeFetchedFields);
|
||||
const NetMsg kNetMsg_Auth2Cli_VaultNodeChanged = NET_MSG(kAuth2Cli_VaultNodeChanged, kVaultNodeChangedFields);
|
||||
const NetMsg kNetMsg_Auth2Cli_VaultNodeAdded = NET_MSG(kAuth2Cli_VaultNodeAdded, kVaultNodeAddedFields);
|
||||
const NetMsg kNetMsg_Auth2Cli_VaultNodeRemoved = NET_MSG(kAuth2Cli_VaultNodeRemoved, kVaultNodeRemovedFields);
|
||||
const NetMsg kNetMsg_Auth2Cli_VaultNodeDeleted = NET_MSG(kAuth2Cli_VaultNodeDeleted, kVaultNodeDeletedFields);
|
||||
const NetMsg kNetMsg_Auth2Cli_VaultSaveNodeReply = NET_MSG(kAuth2Cli_VaultSaveNodeReply, kVaultSaveNodeReplyFields);
|
||||
const NetMsg kNetMsg_Auth2Cli_VaultAddNodeReply = NET_MSG(kAuth2Cli_VaultAddNodeReply, kVaultAddNodeReplyFields);
|
||||
const NetMsg kNetMsg_Auth2Cli_VaultRemoveNodeReply = NET_MSG(kAuth2Cli_VaultRemoveNodeReply, kVaultRemoveNodeReplyFields);
|
||||
const NetMsg kNetMsg_Auth2Cli_VaultInitAgeReply = NET_MSG(kAuth2Cli_VaultInitAgeReply, kVaultInitAgeReplyFields);
|
||||
const NetMsg kNetMsg_Auth2Cli_VaultNodeFindReply = NET_MSG(kAuth2Cli_VaultNodeFindReply, kVaultNodeFindReplyFields);
|
||||
const NetMsg kNetMsg_Auth2Cli_PublicAgeList = NET_MSG(kAuth2Cli_PublicAgeList, kPublicAgeListFields);
|
||||
const NetMsg kNetMsg_Auth2Cli_PropagateBuffer = NET_MSG(kAuth2Cli_PropagateBuffer, kPropagateBufferFields);
|
||||
const NetMsg kNetMsg_Auth2Cli_SetPlayerBanStatusReply = NET_MSG(kAuth2Cli_SetPlayerBanStatusReply, kSetPlayerBanStatusReplyFields);
|
||||
const NetMsg kNetMsg_Auth2Cli_ChangePlayerNameReply = NET_MSG(kAuth2Cli_ChangePlayerNameReply, kChangePlayerNameReplyFields);
|
||||
const NetMsg kNetMsg_Auth2Cli_SendFriendInviteReply = NET_MSG(kAuth2Cli_SendFriendInviteReply, kSendFriendInviteReplyFields);
|
||||
const NetMsg kNetMsg_Auth2Cli_ScoreCreateReply = NET_MSG(kAuth2Cli_ScoreCreateReply, kScoreCreateReplyFields);
|
||||
const NetMsg kNetMsg_Auth2Cli_ScoreDeleteReply = NET_MSG(kAuth2Cli_ScoreDeleteReply, kScoreDeleteReplyFields);
|
||||
const NetMsg kNetMsg_Auth2Cli_ScoreGetScoresReply = NET_MSG(kAuth2Cli_ScoreGetScoresReply, kScoreGetScoresReplyFields);
|
||||
const NetMsg kNetMsg_Auth2Cli_ScoreAddPointsReply = NET_MSG(kAuth2Cli_ScoreAddPointsReply, kScoreAddPointsReplyFields);
|
||||
const NetMsg kNetMsg_Auth2Cli_ScoreTransferPointsReply = NET_MSG(kAuth2Cli_ScoreTransferPointsReply, kScoreTransferPointsReplyFields);
|
||||
const NetMsg kNetMsg_Auth2Cli_ScoreSetPointsReply = NET_MSG(kAuth2Cli_ScoreSetPointsReply, kScoreSetPointsReplyFields);
|
||||
const NetMsg kNetMsg_Auth2Cli_ScoreGetRanksReply = NET_MSG(kAuth2Cli_ScoreGetRanksReply, kScoreGetRanksReplyFields);
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,122 @@
|
||||
/*==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/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
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);
|
||||
|
@ -0,0 +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/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
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>
|
||||
|
@ -0,0 +1,50 @@
|
||||
/*==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/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
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
|
@ -0,0 +1,211 @@
|
||||
/*==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/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
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>
|
@ -0,0 +1,117 @@
|
||||
/*==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/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
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);
|
@ -0,0 +1,194 @@
|
||||
/*==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/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
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>
|
@ -0,0 +1,110 @@
|
||||
/*==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/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
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);
|
@ -0,0 +1,157 @@
|
||||
/*==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/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
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];
|
||||
};
|
@ -0,0 +1,93 @@
|
||||
/*==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/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
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
|
@ -0,0 +1,569 @@
|
||||
/*==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/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
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.h
|
||||
*
|
||||
***/
|
||||
|
||||
#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNNETPROTOCOL_PRIVATE_PROTOCOLS_SRV2DB_PNNPSRV2DB_H
|
||||
#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Db/pnNpSrv2Db.h included more than once"
|
||||
#endif
|
||||
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNNETPROTOCOL_PRIVATE_PROTOCOLS_SRV2DB_PNNPSRV2DB_H
|
||||
|
||||
|
||||
|
||||
// kNetProtocolSrv2Db messages
|
||||
// Because SrvDb must remain compatible with older auth builds, these message ids
|
||||
// must not change unless all front-end servers are synchronously replaced.
|
||||
enum {
|
||||
// Account
|
||||
kSrv2Db_AccountCreateRequest = 0,
|
||||
kSrv2Db_AccountLoginRequest = 1,
|
||||
kSrv2Db_AccountLogout = 2,
|
||||
kSrv2Db_AccountChangePasswordRequest = 3,
|
||||
kSrv2Db_AccountSetRolesRequest = 4,
|
||||
kSrv2Db_AccountSetBillingTypeRequest = 5,
|
||||
kSrv2Db_AccountActivateRequest = 6,
|
||||
kSrv2Db_AccountCreateFromKeyRequest = 7,
|
||||
kSrv2Db_AccountLockPlayerNameRequest = 8,
|
||||
kSrv2Db_SetPlayerBanStatusRequest = 9,
|
||||
kSrv2Db_AccountLoginRequest2 = 10,
|
||||
kSrv2Db_AccountExistsRequest = 11,
|
||||
|
||||
// VaultNodes
|
||||
kSrv2Db_VaultNodeCreateRequest = 20,
|
||||
kSrv2Db_VaultNodeFetchRequest = 21,
|
||||
kSrv2Db_VaultNodeSaveRequest = 22,
|
||||
kSrv2Db_VaultNodeDeleteRequest = 23,
|
||||
kSrv2Db_VaultNodeFindRequest = 24,
|
||||
kSrv2Db_VaultSendNode = 25,
|
||||
kSrv2Db_SetAgeSequenceNumRequest = 26,
|
||||
kSrv2Db_VaultNodeChanged = 27,
|
||||
kSrv2Db_FetchInviterInfo = 28,
|
||||
|
||||
// VaultNodeRefs
|
||||
kSrv2Db_VaultNodeAddRefs = 40,
|
||||
kSrv2Db_VaultNodeDelRefs = 41,
|
||||
kSrv2Db_VaultNodeGetChildRefs = 42,
|
||||
kSrv2Db_VaultNodeGetParentRefs = 43,
|
||||
|
||||
// State Objects
|
||||
kSrv2Db_StateSaveObject = 60,
|
||||
kSrv2Db_StateDeleteObject = 61,
|
||||
kSrv2Db_StateFetchObject = 62,
|
||||
|
||||
// Public ages
|
||||
kSrv2Db_GetPublicAgeInfoIds = 80,
|
||||
kSrv2Db_SetAgePublic = 81,
|
||||
|
||||
// Score
|
||||
kSrv2Db_ScoreCreate = 100,
|
||||
kSrv2Db_ScoreFindScoreIds = 101,
|
||||
kSrv2Db_ScoreFetchScores = 102,
|
||||
kSrv2Db_ScoreSave = 103,
|
||||
kSrv2Db_ScoreDelete = 104,
|
||||
kSrv2Db_ScoreGetRanks = 105,
|
||||
|
||||
// Vault Notifications
|
||||
kSrv2Db_PlayerOnline = 120,
|
||||
kSrv2Db_PlayerOffline = 121,
|
||||
kSrv2Db_AgeOnline = 122,
|
||||
kSrv2Db_AgeOffline = 123,
|
||||
|
||||
// CSR
|
||||
kSrv2Db_CsrAcctInfoRequest = 140,
|
||||
};
|
||||
|
||||
enum {
|
||||
// Account
|
||||
kDb2Srv_AccountCreateReply = 0,
|
||||
kDb2Srv_AccountLoginReply = 1,
|
||||
kDb2Srv_AccountCreateFromKeyReply = 2,
|
||||
kDb2Srv_AccountExistsReply = 3,
|
||||
|
||||
// VaultNodes
|
||||
kDb2Srv_VaultNodeCreateReply = 20,
|
||||
kDb2Srv_VaultNodeFetchReply = 21,
|
||||
kDb2Srv_VaultNodeSaveReply = 22,
|
||||
kDb2Srv_VaultNodeDeleteReply = 23,
|
||||
kDb2Srv_VaultNodeFindReply = 24,
|
||||
kDb2Srv_SetAgeSequenceNumReply = 25,
|
||||
kDb2Srv_FetchInviterInfoReply = 26,
|
||||
|
||||
// VaultNodeRefs
|
||||
kDb2Srv_VaultNodeRefs = 40,
|
||||
|
||||
// State Objects
|
||||
kDb2Srv_StateObjectFetched = 60,
|
||||
|
||||
// Vault Notification
|
||||
kDb2Srv_NotifyVaultNodeChanged = 80,
|
||||
kDb2Srv_NotifyVaultNodeAdded = 81,
|
||||
kDb2Srv_NotifyVaultNodeRemoved = 82,
|
||||
kDb2Srv_NotifyVaultNodeDeleted = 83,
|
||||
|
||||
// Public ages
|
||||
kDb2Srv_PublicAgeInfoIds = 100,
|
||||
|
||||
// Score
|
||||
kDb2Srv_ScoreCreateReply = 120,
|
||||
kDb2Srv_ScoreFindScoreIdsReply = 121,
|
||||
kDb2Srv_ScoreFetchScoresReply = 122,
|
||||
kDb2Srv_ScoreDeleteReply = 123,
|
||||
kDb2Srv_ScoreGetRanksReply = 124,
|
||||
|
||||
// CSR
|
||||
kDb2Srv_CsrAcctInfoReply = 140,
|
||||
};
|
||||
|
||||
|
||||
//============================================================================
|
||||
// BEGIN PACKED DATA STRUCTURES
|
||||
//============================================================================
|
||||
#include <PshPack1.h>
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Srv2Db connect packet
|
||||
*
|
||||
***/
|
||||
|
||||
struct Srv2Db_ConnData {
|
||||
dword dataBytes;
|
||||
dword srvType;
|
||||
};
|
||||
struct Srv2Db_Connect {
|
||||
AsyncSocketConnectPacket hdr;
|
||||
Srv2Db_ConnData data;
|
||||
};
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Srv2Db packets
|
||||
*
|
||||
***/
|
||||
|
||||
|
||||
struct Srv2Db_AccountExistsRequest : SrvMsgHeader {
|
||||
wchar accountName[kMaxAccountNameLength];
|
||||
};
|
||||
|
||||
struct Srv2Db_AccountCreateRequest : SrvMsgHeader {
|
||||
wchar accountName[kMaxAccountNameLength];
|
||||
ShaDigest namePassHash;
|
||||
dword billingType;
|
||||
dword accountFlags;
|
||||
wchar foreignAcctId[kMaxPublisherAuthKeyLength];
|
||||
};
|
||||
|
||||
struct Srv2Db_AccountCreateFromKeyRequest : SrvMsgHeader {
|
||||
wchar accountName[kMaxAccountNameLength];
|
||||
ShaDigest namePassHash;
|
||||
Uuid key;
|
||||
dword billingType;
|
||||
};
|
||||
|
||||
struct Srv2Db_AccountLoginRequest : SrvMsgHeader {
|
||||
wchar accountName[kMaxAccountNameLength];
|
||||
};
|
||||
|
||||
struct Srv2Db_AccountLoginRequest2 : SrvMsgHeader {
|
||||
wchar accountName[kMaxAccountNameLength];
|
||||
dword buildId;
|
||||
};
|
||||
|
||||
struct Srv2Db_AccountLogout : SrvMsgHeader {
|
||||
Uuid accountUuid;
|
||||
dword timeLoggedMins;
|
||||
};
|
||||
|
||||
struct Srv2Db_AccountChangePasswordRequest : SrvMsgHeader {
|
||||
wchar accountName[kMaxAccountNameLength];
|
||||
ShaDigest namePassHash;
|
||||
};
|
||||
|
||||
struct Srv2Db_AccountSetRolesRequest : SrvMsgHeader {
|
||||
wchar accountName[kMaxAccountNameLength];
|
||||
dword accountFlags;
|
||||
};
|
||||
|
||||
struct Srv2Db_AccountSetBillingTypeRequest : SrvMsgHeader {
|
||||
wchar accountName[kMaxAccountNameLength];
|
||||
dword billingType;
|
||||
};
|
||||
|
||||
struct Srv2Db_AccountActivateRequest : SrvMsgHeader {
|
||||
Uuid activationKey;
|
||||
};
|
||||
|
||||
struct Srv2Db_AccountLockPlayerNameRequest :SrvMsgHeader {
|
||||
wchar playerName[kMaxPlayerNameLength];
|
||||
Uuid accountUuid;
|
||||
};
|
||||
|
||||
struct Srv2Db_VaultNodeCreateRequest : SrvMsgHeader {
|
||||
Uuid accountUuid;
|
||||
dword creatorId;
|
||||
dword nodeBytes;
|
||||
byte nodeBuffer[1];
|
||||
};
|
||||
|
||||
struct Srv2Db_VaultNodeFetchRequest : SrvMsgHeader {
|
||||
dword nodeId;
|
||||
};
|
||||
|
||||
struct Srv2Db_VaultNodeChanged : SrvMsgHeader {
|
||||
dword nodeId;
|
||||
Uuid revisionId;
|
||||
};
|
||||
|
||||
struct Srv2Db_VaultNodeSaveRequest : SrvMsgHeader {
|
||||
Uuid revisionId;
|
||||
dword nodeId;
|
||||
unsigned playerCheckId;
|
||||
unsigned isRequestFromAuth;
|
||||
dword nodeBytes;
|
||||
byte buffer[1]; // buffer[bytes], actually
|
||||
// no more fields after var length alloc
|
||||
};
|
||||
|
||||
struct Srv2Db_VaultNodeDeleteRequest : SrvMsgHeader {
|
||||
dword nodeId;
|
||||
unsigned playerCheckId;
|
||||
unsigned isRequestFromAuth;
|
||||
};
|
||||
|
||||
|
||||
struct Srv2Db_VaultNodeFindRequest : SrvMsgHeader {
|
||||
// Template node to match
|
||||
dword nodeBytes;
|
||||
byte nodeBuffer[1]; // [nodeBytes], actually
|
||||
// no more fields after var length alloc
|
||||
};
|
||||
|
||||
struct Srv2Db_VaultNodeAddRefs : SrvMsgHeader {
|
||||
dword refCount;
|
||||
NetVaultNodeRef refs[1];
|
||||
// no more fields after var length alloc
|
||||
};
|
||||
|
||||
struct Srv2Db_VaultNodeDelRefs : SrvMsgHeader {
|
||||
dword refCount;
|
||||
unsigned playerCheckId;
|
||||
unsigned isRequestFromAuth;
|
||||
NetVaultNodeRef refs[1];
|
||||
// no more fields after var length alloc
|
||||
};
|
||||
|
||||
struct Srv2Db_VaultNodeGetChildRefs : SrvMsgHeader {
|
||||
dword nodeId;
|
||||
dword maxDepth;
|
||||
};
|
||||
|
||||
struct Srv2Db_VaultNodeGetParentRefs : SrvMsgHeader {
|
||||
dword nodeId;
|
||||
dword maxDepth;
|
||||
};
|
||||
|
||||
struct Srv2Db_VaultSendNode : SrvMsgHeader {
|
||||
dword srcPlayerId; // sender
|
||||
dword srcNodeId; // sent item
|
||||
dword dstPlayerId; // recipient
|
||||
};
|
||||
|
||||
struct Srv2Db_SetAgeSequenceNumRequest : SrvMsgHeader {
|
||||
dword nodeId;
|
||||
wchar ageInstName[kMaxAgeNameLength];
|
||||
wchar ageUserName[kMaxAgeNameLength];
|
||||
};
|
||||
|
||||
struct Srv2Db_StateSaveObject : SrvMsgHeader {
|
||||
dword buildId;
|
||||
Uuid ownerId;
|
||||
wchar objectName[kMaxStateObjectName];
|
||||
dword objectDataBytes;
|
||||
byte objectData[1];
|
||||
// no more fields after var length alloc
|
||||
};
|
||||
|
||||
struct Srv2Db_StateDeleteObject : SrvMsgHeader {
|
||||
Uuid ownerId;
|
||||
wchar objectName[kMaxStateObjectName];
|
||||
};
|
||||
|
||||
struct Srv2Db_StateFetchObject : SrvMsgHeader {
|
||||
Uuid ownerId;
|
||||
wchar objectName[kMaxStateObjectName];
|
||||
};
|
||||
|
||||
struct Srv2Db_GetPublicAgeInfoIds : SrvMsgHeader {
|
||||
wchar ageName[kMaxAgeNameLength];
|
||||
};
|
||||
|
||||
struct Srv2Db_SetAgePublic : SrvMsgHeader {
|
||||
dword playerId;
|
||||
dword ageInfoId;
|
||||
byte publicOrNot;
|
||||
};
|
||||
|
||||
struct Srv2Db_SetPlayerBanStatusRequest : SrvMsgHeader {
|
||||
dword playerId;
|
||||
dword banned;
|
||||
};
|
||||
|
||||
struct Srv2Db_ScoreCreate : SrvMsgHeader {
|
||||
dword ownerId;
|
||||
wchar gameName[kMaxGameScoreNameLength];
|
||||
dword gameType;
|
||||
dword value;
|
||||
};
|
||||
|
||||
struct Srv2Db_ScoreDelete : SrvMsgHeader {
|
||||
dword scoreId;
|
||||
};
|
||||
|
||||
struct Srv2Db_ScoreFindScoreIds : SrvMsgHeader {
|
||||
dword ownerId;
|
||||
wchar gameName[kMaxGameScoreNameLength];
|
||||
};
|
||||
|
||||
struct Srv2Db_ScoreFetchScores : SrvMsgHeader {
|
||||
dword scoreCount;
|
||||
dword scoreIds[1]; // [scoreCount], actually
|
||||
// no more fields after var length alloc
|
||||
};
|
||||
|
||||
struct Srv2Db_ScoreSave : SrvMsgHeader {
|
||||
dword scoreId;
|
||||
dword value;
|
||||
};
|
||||
|
||||
struct Srv2Db_ScoreGetRanks : SrvMsgHeader {
|
||||
dword ownerId;
|
||||
dword scoreGroup;
|
||||
dword parentFolderId;
|
||||
wchar gameName[kMaxGameScoreNameLength];
|
||||
dword timePeriod;
|
||||
dword numResults;
|
||||
dword pageNumber;
|
||||
dword sortDesc;
|
||||
};
|
||||
|
||||
struct Srv2Db_PlayerOnline : SrvMsgHeader {
|
||||
dword playerId;
|
||||
};
|
||||
|
||||
struct Srv2Db_PlayerOffline : SrvMsgHeader {
|
||||
dword playerId;
|
||||
};
|
||||
|
||||
struct Srv2Db_AgeOnline : SrvMsgHeader {
|
||||
Uuid ageInstId;
|
||||
};
|
||||
|
||||
struct Srv2Db_AgeOffline : SrvMsgHeader {
|
||||
Uuid ageInstId;
|
||||
};
|
||||
|
||||
struct Srv2Db_CsrAcctInfoRequest : SrvMsgHeader {
|
||||
wchar csrName[kMaxAccountNameLength];
|
||||
};
|
||||
|
||||
struct Srv2Db_FetchInviterInfo : SrvMsgHeader {
|
||||
Uuid inviteUuid;
|
||||
};
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Db2Srv packets
|
||||
*
|
||||
***/
|
||||
|
||||
struct Db2Srv_AccountExistsReply : SrvMsgHeader {
|
||||
byte exists;
|
||||
};
|
||||
|
||||
struct Db2Srv_AccountCreateReply : SrvMsgHeader {
|
||||
Uuid accountUuid;
|
||||
};
|
||||
|
||||
struct Db2Srv_AccountCreateFromKeyReply : SrvMsgHeader {
|
||||
Uuid accountUuid;
|
||||
Uuid activationKey;
|
||||
};
|
||||
|
||||
struct Db2Srv_AccountLoginReply : SrvMsgHeader {
|
||||
Uuid accountUuid;
|
||||
dword accountFlags;
|
||||
dword billingType;
|
||||
ShaDigest namePassHash;
|
||||
};
|
||||
|
||||
struct Db2Srv_VaultNodeCreateReply : SrvMsgHeader {
|
||||
dword nodeId;
|
||||
};
|
||||
|
||||
struct Db2Srv_VaultNodeFetchReply : SrvMsgHeader {
|
||||
dword nodeBytes;
|
||||
byte buffer[1];
|
||||
// no more fields after var length alloc
|
||||
};
|
||||
|
||||
struct Db2Srv_VaultNodeFindReply : SrvMsgHeader {
|
||||
// out: ids of matching nodes
|
||||
dword nodeIdCount;
|
||||
dword nodeIds[1]; // [nodeIdCount], actually
|
||||
// no more fields after var length alloc
|
||||
};
|
||||
|
||||
struct Db2Srv_VaultNodeRefs : SrvMsgHeader {
|
||||
dword refCount;
|
||||
NetVaultNodeRef refs[1];
|
||||
// no more fields after var length alloc
|
||||
};
|
||||
|
||||
struct Db2Srv_SetAgeSequenceNumReply : SrvMsgHeader {
|
||||
dword sequenceNum;
|
||||
};
|
||||
|
||||
struct Db2Srv_FetchInviterInfoReply : SrvMsgHeader {
|
||||
Uuid hoodInstance;
|
||||
};
|
||||
|
||||
struct Db2Srv_StateObjectFetched : SrvMsgHeader {
|
||||
dword buildId;
|
||||
Uuid ownerId;
|
||||
wchar objectName[kMaxStateObjectName];
|
||||
dword objectDataBytes;
|
||||
byte objectData[1];
|
||||
// no more fields after var length alloc
|
||||
};
|
||||
|
||||
struct Db2Srv_NotifyVaultNodeChanged : SrvMsgHeader {
|
||||
dword nodeId;
|
||||
Uuid revId;
|
||||
dword notifyIdCount;
|
||||
dword notifyIds[1];
|
||||
};
|
||||
|
||||
struct Db2Srv_NotifyVaultNodeAdded : SrvMsgHeader {
|
||||
NetVaultNodeRef ref;
|
||||
dword notifyIdCount;
|
||||
dword notifyIds[1];
|
||||
};
|
||||
|
||||
struct Db2Srv_NotifyVaultNodeRemoved : SrvMsgHeader {
|
||||
dword parentId;
|
||||
dword childId;
|
||||
dword notifyIdCount;
|
||||
dword notifyIds[1];
|
||||
};
|
||||
|
||||
struct Db2Srv_NotifyVaultNodeDeleted : SrvMsgHeader {
|
||||
dword nodeId;
|
||||
dword notifyIdCount;
|
||||
dword notifyIds[1];
|
||||
};
|
||||
|
||||
struct Db2Srv_PublicAgeInfoIds : SrvMsgHeader {
|
||||
dword idCount;
|
||||
dword ids[1]; // [idCount], actually
|
||||
// no more fields after var length alloc
|
||||
};
|
||||
|
||||
struct Db2Srv_ScoreCreateReply : SrvMsgHeader {
|
||||
dword scoreId;
|
||||
dword createdTime;
|
||||
};
|
||||
|
||||
struct Db2Srv_ScoreDeleteReply : SrvMsgHeader {
|
||||
dword ownerId;
|
||||
wchar gameName[kMaxGameScoreNameLength];
|
||||
};
|
||||
|
||||
struct Db2Srv_ScoreFindScoreIdsReply : SrvMsgHeader {
|
||||
dword idCount;
|
||||
dword scoreIds[1]; // [idCount], actually
|
||||
// no more fields after var length alloc
|
||||
};
|
||||
|
||||
struct Db2Srv_ScoreFetchScoresReply : SrvMsgHeader {
|
||||
dword scoreCount;
|
||||
dword byteCount;
|
||||
byte buffer[1]; // [byteCount], actually
|
||||
// no more fields after var length alloc
|
||||
};
|
||||
|
||||
struct Db2Srv_ScoreGetRanksReply : SrvMsgHeader {
|
||||
dword rankCount;
|
||||
dword byteCount;
|
||||
byte buffer[1]; // [byteCount], actually
|
||||
// no more fields after var length alloc
|
||||
};
|
||||
|
||||
struct Db2Srv_CsrAcctInfoReply : SrvMsgHeader {
|
||||
Uuid csrId;
|
||||
dword csrFlags;
|
||||
ShaDigest namePassHash;
|
||||
};
|
||||
|
||||
|
||||
//============================================================================
|
||||
// END PACKED DATA STRUCTURES
|
||||
//============================================================================
|
||||
#include <PopPack.h>
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Srv2Db functions
|
||||
*
|
||||
***/
|
||||
|
||||
bool Srv2DbValidateConnect (
|
||||
AsyncNotifySocketListen * listen,
|
||||
Srv2Db_ConnData * connectPtr
|
||||
);
|
@ -0,0 +1,90 @@
|
||||
/*==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/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
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
|
||||
|
@ -0,0 +1,120 @@
|
||||
/*==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/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
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
|
||||
);
|
||||
|
||||
|
@ -0,0 +1,87 @@
|
||||
/*==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/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
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
|
@ -0,0 +1,267 @@
|
||||
/*==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/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
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
|
||||
);
|
@ -0,0 +1,88 @@
|
||||
/*==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/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
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
|
@ -0,0 +1,185 @@
|
||||
/*==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/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
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
|
||||
);
|
||||
|
@ -0,0 +1,88 @@
|
||||
/*==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/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
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
|
@ -0,0 +1,147 @@
|
||||
/*==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/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
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
|
||||
);
|
||||
|
||||
|
||||
|
@ -0,0 +1,87 @@
|
||||
/*==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/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
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
|
@ -0,0 +1,468 @@
|
||||
/*==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/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
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
|
||||
);
|
@ -0,0 +1,120 @@
|
||||
/*==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/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
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/pnNpAllIncludes.h
|
||||
*
|
||||
***/
|
||||
|
||||
#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNNETPROTOCOL_PRIVATE_PNNPALLINCLUDES_H
|
||||
#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpAllIncludes.h included more than once"
|
||||
#endif
|
||||
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNNETPROTOCOL_PRIVATE_PNNPALLINCLUDES_H
|
||||
|
||||
#if defined(USES_PROTOCOL_CLI2AUTH) || defined(USES_PROTOCOL_CLI2GAME) || defined(USES_PROTOCOL_CLI2CSR) || defined(USES_PROTOCOL_CLI2GATEKEEPER)
|
||||
# define USES_NETCLI
|
||||
#endif
|
||||
|
||||
#if defined(USES_PROTOCOL_SRV2VAULT) || defined(USES_PROTOCOL_SRV2DB) || defined(USES_PROTOCOL_SRV2MCP) || defined(USES_PROTOCOL_SRV2STATE) || defined(USES_PROTOCOL_SRV2LOG) || defined(USES_PROTOCOL_SRV2SCORE)
|
||||
# define USES_NETSRV
|
||||
#endif
|
||||
|
||||
#include "pnNpCommon.h"
|
||||
|
||||
|
||||
|
||||
#ifdef USES_PROTOCOL_CLI2FILE
|
||||
# include "Protocols/Cli2File/pnNpCli2File.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef USES_NETCLI
|
||||
# ifdef USES_PROTOCOL_CLI2AUTH
|
||||
# include "Protocols/Cli2Auth/pnNpCli2Auth.h"
|
||||
# endif
|
||||
|
||||
# ifdef USES_PROTOCOL_CLI2GAME
|
||||
# include "Protocols/Cli2Game/pnNpCli2Game.h"
|
||||
# endif
|
||||
|
||||
# ifdef USES_PROTOCOL_CLI2CSR
|
||||
# include "Protocols/Cli2Csr/pnNpCli2Csr.h"
|
||||
# endif
|
||||
|
||||
# ifdef USES_PROTOCOL_CLI2GATEKEEPER
|
||||
# include "Protocols/Cli2GateKeeper/pnNpCli2GateKeeper.h"
|
||||
# endif
|
||||
#endif // def USES_NETCLI
|
||||
|
||||
|
||||
#ifdef SERVER
|
||||
# ifdef USES_NETSRV
|
||||
// for SrvMsgHeader definition
|
||||
# include "../../NucleusLib/pnIni/pnIni.h" // psSrvConn needs ini types
|
||||
# include "../../ServerLib/psUtils/psUtils.h"
|
||||
|
||||
# ifdef USES_PROTOCOL_SRV2VAULT
|
||||
# include "Protocols/Srv2Vault/pnNpSrv2Vault.h"
|
||||
# endif
|
||||
|
||||
# ifdef USES_PROTOCOL_SRV2DB
|
||||
# include "Protocols/Srv2Db/pnNpSrv2Db.h"
|
||||
# endif
|
||||
|
||||
# ifdef USES_PROTOCOL_SRV2MCP
|
||||
# include "Protocols/Srv2Mcp/pnNpSrv2Mcp.h"
|
||||
# endif
|
||||
|
||||
# ifdef USES_PROTOCOL_SRV2STATE
|
||||
# include "Protocols/Srv2State/pnNpSrv2State.h"
|
||||
# endif
|
||||
|
||||
# ifdef USES_PROTOCOL_SRV2SCORE
|
||||
# include "Protocols/Srv2Score/pnNpSrv2Score.h"
|
||||
# endif
|
||||
|
||||
# ifdef USES_PROTOCOL_SRV2LOG
|
||||
# include "Protocols/Srv2Log/pnNpSrv2Log.h"
|
||||
# endif
|
||||
|
||||
# endif // def USES_NETSRV
|
||||
#endif // def SERVER
|
1217
Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.cpp
Normal file
1217
Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.cpp
Normal file
File diff suppressed because it is too large
Load Diff
499
Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.h
Normal file
499
Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.h
Normal file
@ -0,0 +1,499 @@
|
||||
/*==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/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
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/pnNpCommon.h
|
||||
*
|
||||
***/
|
||||
|
||||
#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNNETPROTOCOL_PRIVATE_PNNPCOMMON_H
|
||||
#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.h included more than once"
|
||||
#endif
|
||||
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNNETPROTOCOL_PRIVATE_PNNPCOMMON_H
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Client message field types
|
||||
*
|
||||
***/
|
||||
|
||||
#ifdef USES_NETCLI
|
||||
|
||||
const NetMsgField kNetMsgFieldAccountName = NET_MSG_FIELD_STRING(kMaxAccountNameLength);
|
||||
const NetMsgField kNetMsgFieldPlayerName = NET_MSG_FIELD_STRING(kMaxPlayerNameLength);
|
||||
const NetMsgField kNetMsgFieldShaDigest = NET_MSG_FIELD_RAW_DATA(sizeof(ShaDigest));
|
||||
const NetMsgField kNetMsgFieldUuid = NET_MSG_FIELD_DATA(sizeof(Uuid));
|
||||
const NetMsgField kNetMsgFieldTransId = NET_MSG_FIELD_DWORD();
|
||||
const NetMsgField kNetMsgFieldTimeMs = NET_MSG_FIELD_DWORD();
|
||||
const NetMsgField kNetMsgFieldENetError = NET_MSG_FIELD_DWORD();
|
||||
const NetMsgField kNetMsgFieldEAgeId = NET_MSG_FIELD_DWORD();
|
||||
const NetMsgField kNetMsgFieldNetNode = NET_MSG_FIELD_DWORD();
|
||||
const NetMsgField kNetMsgFieldBuildId = NET_MSG_FIELD_DWORD();
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Player information structures
|
||||
*
|
||||
***/
|
||||
|
||||
#include <PshPack1.h>
|
||||
struct SrvPlayerInfo {
|
||||
unsigned playerInt;
|
||||
wchar playerName[kMaxPlayerNameLength];
|
||||
wchar avatarShape[kMaxVaultNodeStringLength];
|
||||
unsigned explorer;
|
||||
};
|
||||
#include <PopPack.h>
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* NetAgeInfo
|
||||
*
|
||||
***/
|
||||
|
||||
struct NetAgeInfo {
|
||||
Uuid ageInstId;
|
||||
wchar ageFilename[kMaxAgeNameLength];
|
||||
wchar ageInstName[kMaxAgeNameLength];
|
||||
wchar ageUserName[kMaxAgeNameLength];
|
||||
wchar ageDesc[1024];
|
||||
dword ageSequenceNumber;
|
||||
dword ageLanguage;
|
||||
dword population; // only used with GetPublicAgeList query results
|
||||
dword currentPopulation; // only used with GetPublicAgeList query results
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* NetGameScore
|
||||
*
|
||||
***/
|
||||
|
||||
struct NetGameScore {
|
||||
unsigned scoreId;
|
||||
unsigned ownerId;
|
||||
UInt32 createdTime;
|
||||
wchar gameName[kMaxGameScoreNameLength];
|
||||
unsigned gameType;
|
||||
int value;
|
||||
|
||||
unsigned Read (const byte inbuffer[], unsigned bufsz, byte** end = nil); // returns number of bytes read
|
||||
unsigned Write (ARRAY(byte) * buffer) const; // returns number of bytes written
|
||||
|
||||
void CopyFrom (const NetGameScore & score);
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* NetGameRank
|
||||
*
|
||||
***/
|
||||
|
||||
struct NetGameRank {
|
||||
unsigned rank;
|
||||
int score;
|
||||
wchar name[kMaxPlayerNameLength];
|
||||
|
||||
unsigned Read (const byte inbuffer[], unsigned bufsz, byte** end = nil); // returns number of bytes read
|
||||
unsigned Write (ARRAY(byte) * buffer) const; // returns number of bytes written
|
||||
|
||||
void CopyFrom (const NetGameRank & fromRank);
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Server vault structures
|
||||
*
|
||||
***/
|
||||
|
||||
//============================================================================
|
||||
// NetVaultNode
|
||||
//============================================================================
|
||||
// Threaded apps: App is responsible for locking node->critsect before accessing *any* field in this struct
|
||||
struct NetVaultNode : AtomicRef {
|
||||
enum RwOptions {
|
||||
kRwDirtyOnly = 1<<0, // READ : No meaning
|
||||
// WRITE: Only write fields marked dirty
|
||||
kRwUpdateDirty = 1<<1, // READ : Set dirty flag on fields read from stream
|
||||
// WRITE: Clear dirty flag on fields written to stream
|
||||
};
|
||||
|
||||
enum CopyOptions {
|
||||
kCopySetDirty = 1<<0, // set dirty flag on changed dst fields
|
||||
kCopyOverwrite = 1<<1, // overwrite fields for which dst node already has values
|
||||
kCopyClear = 1<<2, // clear dst fields for which src node does not have values
|
||||
};
|
||||
|
||||
// These flag values must not change unless all servers are
|
||||
// simultaneously replaced, so basically forget it.
|
||||
static const qword kNodeId = (qword)1<< 0;
|
||||
static const qword kCreateTime = (qword)1<< 1;
|
||||
static const qword kModifyTime = (qword)1<< 2;
|
||||
static const qword kCreateAgeName = (qword)1<< 3;
|
||||
static const qword kCreateAgeUuid = (qword)1<< 4;
|
||||
static const qword kCreatorAcct = (qword)1<< 5;
|
||||
static const qword kCreatorId = (qword)1<< 6;
|
||||
static const qword kNodeType = (qword)1<< 7;
|
||||
static const qword kInt32_1 = (qword)1<< 8;
|
||||
static const qword kInt32_2 = (qword)1<< 9;
|
||||
static const qword kInt32_3 = (qword)1<<10;
|
||||
static const qword kInt32_4 = (qword)1<<11;
|
||||
static const qword kUInt32_1 = (qword)1<<12;
|
||||
static const qword kUInt32_2 = (qword)1<<13;
|
||||
static const qword kUInt32_3 = (qword)1<<14;
|
||||
static const qword kUInt32_4 = (qword)1<<15;
|
||||
static const qword kUuid_1 = (qword)1<<16;
|
||||
static const qword kUuid_2 = (qword)1<<17;
|
||||
static const qword kUuid_3 = (qword)1<<18;
|
||||
static const qword kUuid_4 = (qword)1<<19;
|
||||
static const qword kString64_1 = (qword)1<<20;
|
||||
static const qword kString64_2 = (qword)1<<21;
|
||||
static const qword kString64_3 = (qword)1<<22;
|
||||
static const qword kString64_4 = (qword)1<<23;
|
||||
static const qword kString64_5 = (qword)1<<24;
|
||||
static const qword kString64_6 = (qword)1<<25;
|
||||
static const qword kIString64_1 = (qword)1<<26;
|
||||
static const qword kIString64_2 = (qword)1<<27;
|
||||
// blobs always come last
|
||||
static const qword kText_1 = (qword)1<<28;
|
||||
static const qword kText_2 = (qword)1<<29;
|
||||
static const qword kBlob_1 = (qword)1<<30;
|
||||
static const qword kBlob_2 = (qword)1<<31;
|
||||
|
||||
CCritSect critsect;
|
||||
|
||||
qword fieldFlags;
|
||||
qword dirtyFlags;
|
||||
|
||||
Uuid revisionId;
|
||||
|
||||
// Treat these as read-only or node flag fields will become invalid
|
||||
// Threaded apps: Must be accessed with node->critsect locked
|
||||
unsigned nodeId;
|
||||
unsigned createTime;
|
||||
unsigned modifyTime;
|
||||
wchar * createAgeName;
|
||||
Uuid createAgeUuid;
|
||||
Uuid creatorAcct; // accountId of node creator
|
||||
unsigned creatorId; // playerId of node creator
|
||||
unsigned nodeType;
|
||||
int int32_1;
|
||||
int int32_2;
|
||||
int int32_3;
|
||||
int int32_4;
|
||||
unsigned uint32_1;
|
||||
unsigned uint32_2;
|
||||
unsigned uint32_3;
|
||||
unsigned uint32_4;
|
||||
Uuid uuid_1;
|
||||
Uuid uuid_2;
|
||||
Uuid uuid_3;
|
||||
Uuid uuid_4;
|
||||
wchar * string64_1;
|
||||
wchar * string64_2;
|
||||
wchar * string64_3;
|
||||
wchar * string64_4;
|
||||
wchar * string64_5;
|
||||
wchar * string64_6;
|
||||
wchar * istring64_1;
|
||||
wchar * istring64_2;
|
||||
wchar * text_1;
|
||||
wchar * text_2;
|
||||
byte * blob_1; unsigned blob_1Length;
|
||||
byte * blob_2; unsigned blob_2Length;
|
||||
|
||||
NetVaultNode ();
|
||||
~NetVaultNode ();
|
||||
|
||||
// Threaded apps: Must be called with node->critsect locked
|
||||
unsigned Read_LCS (const byte buffer[], unsigned bufsz, unsigned rwOpts); // returns number of bytes read
|
||||
unsigned Write_LCS (ARRAY(byte) * buffer, unsigned rwOpts); // returns number of bytes written
|
||||
|
||||
bool Matches (const NetVaultNode * other);
|
||||
void CopyFrom (const NetVaultNode * other, unsigned copyOpts);
|
||||
|
||||
// Threaded apps: Must be called with node->critsect locked
|
||||
void SetNodeId (unsigned v);
|
||||
void SetCreateTime (unsigned v);
|
||||
void SetModifyTime (unsigned v);
|
||||
void SetCreateAgeName (const wchar v[]);
|
||||
void SetCreateAgeUuid (const Uuid & v);
|
||||
void SetCreatorAcct (const Uuid & v);
|
||||
void SetCreatorId (unsigned v);
|
||||
void SetNodeType (unsigned v);
|
||||
void SetInt32_1 (int v);
|
||||
void SetInt32_2 (int v);
|
||||
void SetInt32_3 (int v);
|
||||
void SetInt32_4 (int v);
|
||||
void SetUInt32_1 (unsigned v);
|
||||
void SetUInt32_2 (unsigned v);
|
||||
void SetUInt32_3 (unsigned v);
|
||||
void SetUInt32_4 (unsigned v);
|
||||
void SetUuid_1 (const Uuid & v);
|
||||
void SetUuid_2 (const Uuid & v);
|
||||
void SetUuid_3 (const Uuid & v);
|
||||
void SetUuid_4 (const Uuid & v);
|
||||
void SetString64_1 (const wchar v[]);
|
||||
void SetString64_2 (const wchar v[]);
|
||||
void SetString64_3 (const wchar v[]);
|
||||
void SetString64_4 (const wchar v[]);
|
||||
void SetString64_5 (const wchar v[]);
|
||||
void SetString64_6 (const wchar v[]);
|
||||
void SetIString64_1 (const wchar v[]);
|
||||
void SetIString64_2 (const wchar v[]);
|
||||
void SetText_1 (const wchar v[]);
|
||||
void SetText_2 (const wchar v[]);
|
||||
void SetBlob_1 (const byte v[], unsigned len);
|
||||
void SetBlob_2 (const byte v[], unsigned len);
|
||||
|
||||
void SetText (qword fieldFlag, const wchar v[]);
|
||||
void SetBlob (qword fieldFlag, const byte v[], unsigned len);
|
||||
|
||||
// These are only here to aid macro expansions (naming case matches field flags)
|
||||
inline unsigned GetNodeId () const { return nodeId; }
|
||||
inline unsigned GetCreateTime () const { return createTime; }
|
||||
inline unsigned GetModifyTime () const { return modifyTime; }
|
||||
inline wchar * GetCreateAgeName () const { return createAgeName; }
|
||||
inline Uuid GetCreateAgeUuid () const { return createAgeUuid; }
|
||||
inline Uuid GetCreatorAcct () const { return creatorAcct; }
|
||||
inline unsigned GetCreatorId () const { return creatorId; }
|
||||
inline unsigned GetNodeType () const { return nodeType; }
|
||||
inline int GetInt32_1 () const { return int32_1; }
|
||||
inline int GetInt32_2 () const { return int32_2; }
|
||||
inline int GetInt32_3 () const { return int32_3; }
|
||||
inline int GetInt32_4 () const { return int32_4; }
|
||||
inline unsigned GetUInt32_1 () const { return uint32_1; }
|
||||
inline unsigned GetUInt32_2 () const { return uint32_2; }
|
||||
inline unsigned GetUInt32_3 () const { return uint32_3; }
|
||||
inline unsigned GetUInt32_4 () const { return uint32_4; }
|
||||
inline Uuid GetUuid_1 () const { return uuid_1; }
|
||||
inline Uuid GetUuid_2 () const { return uuid_2; }
|
||||
inline Uuid GetUuid_3 () const { return uuid_3; }
|
||||
inline Uuid GetUuid_4 () const { return uuid_4; }
|
||||
inline wchar * GetString64_1 () const { return string64_1; }
|
||||
inline wchar * GetString64_2 () const { return string64_2; }
|
||||
inline wchar * GetString64_3 () const { return string64_3; }
|
||||
inline wchar * GetString64_4 () const { return string64_4; }
|
||||
inline wchar * GetString64_5 () const { return string64_5; }
|
||||
inline wchar * GetString64_6 () const { return string64_6; }
|
||||
inline wchar * GetIString64_1 () const { return istring64_1; }
|
||||
inline wchar * GetIString64_2 () const { return istring64_2; }
|
||||
// no blob "getters"
|
||||
};
|
||||
|
||||
|
||||
//============================================================================
|
||||
inline void IVaultNodeSetString (
|
||||
qword bit,
|
||||
NetVaultNode * node,
|
||||
char ** pdst,
|
||||
const char src[],
|
||||
unsigned chars
|
||||
) {
|
||||
FREE(*pdst);
|
||||
if (src && src[0])
|
||||
*pdst = StrDupLen(src, chars);
|
||||
else
|
||||
*pdst = StrDupLen("", chars);
|
||||
node->fieldFlags |= bit;
|
||||
node->dirtyFlags |= bit;
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
inline void IVaultNodeSetString (
|
||||
qword bit,
|
||||
NetVaultNode * node,
|
||||
wchar ** pdst,
|
||||
const wchar src[],
|
||||
unsigned chars
|
||||
) {
|
||||
FREE(*pdst);
|
||||
if (src && src[0])
|
||||
*pdst = StrDupLen(src, chars);
|
||||
else
|
||||
*pdst = StrDupLen(L"", chars);
|
||||
node->fieldFlags |= bit;
|
||||
node->dirtyFlags |= bit;
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
template <typename T>
|
||||
inline void IVaultNodeSetValue (
|
||||
qword bit,
|
||||
NetVaultNode * node,
|
||||
T * pdst,
|
||||
const T & src
|
||||
) {
|
||||
*pdst = src;
|
||||
node->fieldFlags |= bit;
|
||||
node->dirtyFlags |= bit;
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
inline void IVaultNodeSetBlob (
|
||||
qword bit,
|
||||
NetVaultNode * node,
|
||||
byte ** pdst,
|
||||
unsigned * pdstLen,
|
||||
const byte src[],
|
||||
unsigned srcLen
|
||||
) {
|
||||
FREE(*pdst);
|
||||
if (src) {
|
||||
*pdst = (byte*)MEMDUP(src, srcLen);
|
||||
*pdstLen = srcLen;
|
||||
}
|
||||
else {
|
||||
*pdst = nil;
|
||||
*pdstLen = 0;
|
||||
}
|
||||
node->fieldFlags |= bit;
|
||||
node->dirtyFlags |= bit;
|
||||
}
|
||||
|
||||
|
||||
//============================================================================
|
||||
// NetVaultNodeFieldArray
|
||||
//============================================================================
|
||||
struct NetVaultNodeFieldArray {
|
||||
enum EWhereCondition {
|
||||
kAnd,
|
||||
kOr
|
||||
};
|
||||
enum ESqlType {
|
||||
kSqlInvalid,
|
||||
kSqlInt32,
|
||||
kSqlUInt32,
|
||||
kSqlUuid,
|
||||
kSqlString,
|
||||
kSqlCLob,
|
||||
KSqlBlob,
|
||||
};
|
||||
|
||||
struct Field {
|
||||
void * addr;
|
||||
const wchar * name;
|
||||
Field (void * addr, const wchar name[])
|
||||
: addr(addr), name(name)
|
||||
{ }
|
||||
};
|
||||
ARRAY(Field) fields;
|
||||
NetVaultNode * node;
|
||||
|
||||
NetVaultNodeFieldArray (NetVaultNode * node);
|
||||
~NetVaultNodeFieldArray ();
|
||||
|
||||
void * GetFieldAddress (qword bit);
|
||||
const wchar * GetFieldName (qword bit);
|
||||
|
||||
// client must lock node's local critical section before calling these.
|
||||
void GetFieldValueString_LCS (qword bit, wchar * dst, unsigned dstChars);
|
||||
void BuildWhereClause_LCS (EWhereCondition condition, wchar * dst, unsigned dstChars);
|
||||
ESqlType GetSqlType_LCS (qword bit);
|
||||
};
|
||||
|
||||
|
||||
//============================================================================
|
||||
// NetVaultNodeRef (packed because is sent over wire directly)
|
||||
//============================================================================
|
||||
#include <PshPack1.h>
|
||||
struct NetVaultNodeRef {
|
||||
unsigned parentId;
|
||||
unsigned childId;
|
||||
unsigned ownerId;
|
||||
bool seen;
|
||||
};
|
||||
#include <PopPack.h>
|
||||
|
||||
//============================================================================
|
||||
// SrvPackBuffer
|
||||
//============================================================================
|
||||
|
||||
// Allocate a CSrvPackBuffer on the heap with one extra dword to allow for padding
|
||||
#define SRV_ALLOC_BUFFER(bytes) \
|
||||
new(ALLOC(sizeof(CSrvPackBuffer) + (bytes) + sizeof(dword))) \
|
||||
CSrvPackBuffer(bytes + sizeof(dword))
|
||||
|
||||
// Allocate a CSrvPackBuffer on the stack with one extra dword to allow for padding
|
||||
#define SRV_ALLOCA_BUFFER(bytes) \
|
||||
new(_alloca(sizeof(CSrvPackBuffer) + (bytes) + sizeof(dword))) \
|
||||
CSrvPackBuffer(bytes + sizeof(dword))
|
||||
|
||||
class CSrvPackBuffer {
|
||||
public:
|
||||
CSrvPackBuffer (unsigned bytes);
|
||||
|
||||
void * Alloc (unsigned bytes);
|
||||
void AddData (const void * ptr, unsigned bytes);
|
||||
void AddString (const wchar str[]);
|
||||
void AddDWordArray (const dword * arr, unsigned count);
|
||||
void AddDWordArray (const unsigned * arr, unsigned count);
|
||||
// add new "Add..." methods here as needed
|
||||
|
||||
unsigned Size ();
|
||||
|
||||
private:
|
||||
byte * m_pos;
|
||||
byte * m_end;
|
||||
byte * m_data;
|
||||
};
|
||||
|
||||
class CSrvUnpackBuffer {
|
||||
public:
|
||||
CSrvUnpackBuffer (const void * buffer, unsigned count);
|
||||
|
||||
const void * GetData (unsigned bytes);
|
||||
const wchar * GetString ();
|
||||
const dword * GetDWordArray (unsigned count);
|
||||
|
||||
unsigned BytesLeft ();
|
||||
bool ParseError ();
|
||||
|
||||
private:
|
||||
const byte * m_pos;
|
||||
const byte * m_end;
|
||||
};
|
Reference in New Issue
Block a user