From bcf6e97d232bc33b36007dd8509f2ca8b1b8b2c4 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sat, 29 Dec 2012 02:05:23 -0800 Subject: [PATCH] Replace Uuid with plUUID EVERYWHERE. --- .../Plasma/FeatureLib/pfGameMgr/pfGameMgr.cpp | 4 +- .../Plasma/FeatureLib/pfGameMgr/pfGameMgr.h | 4 +- .../Games/BlueSpiral/pyBlueSpiralGame.cpp | 6 +- .../Games/BlueSpiral/pyBlueSpiralGame.h | 2 +- .../Games/BlueSpiral/pyBlueSpiralGameGlue.cpp | 25 +-- .../Games/ClimbingWall/pyClimbingWallGame.cpp | 6 +- .../Games/ClimbingWall/pyClimbingWallGame.h | 2 +- .../ClimbingWall/pyClimbingWallGameGlue.cpp | 25 +-- .../pfPython/Games/Heek/pyHeekGame.cpp | 6 +- .../pfPython/Games/Heek/pyHeekGame.h | 2 +- .../pfPython/Games/Heek/pyHeekGameGlue.cpp | 25 +-- .../pfPython/Games/Marker/pyMarkerGame.cpp | 6 +- .../pfPython/Games/Marker/pyMarkerGame.h | 2 +- .../Games/Marker/pyMarkerGameGlue.cpp | 23 +-- .../pfPython/Games/TicTacToe/pyTTTGame.cpp | 6 +- .../pfPython/Games/TicTacToe/pyTTTGame.h | 2 +- .../Games/TicTacToe/pyTTTGameGlue.cpp | 25 +-- .../pfPython/Games/VarSync/pyVarSyncGame.cpp | 6 +- .../pfPython/Games/VarSync/pyVarSyncGame.h | 2 +- .../Games/VarSync/pyVarSyncGameGlue.cpp | 25 +-- .../FeatureLib/pfPython/Games/pyGameCli.cpp | 2 +- .../pfPython/Games/pyGameCliMsg.cpp | 3 +- .../pfPython/Games/pyGameMgrMsg.cpp | 4 +- Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp | 2 +- Sources/Plasma/FeatureLib/pfPython/cyMisc.h | 4 +- .../FeatureLib/pfPython/cyMiscGlue3.cpp | 9 +- .../Plasma/FeatureLib/pfPython/pyAgeVault.cpp | 2 +- .../FeatureLib/pfPython/pyDniInfoSource.cpp | 2 +- .../Plasma/FeatureLib/pfPython/pyVault.cpp | 8 +- .../pfPython/pyVaultAgeInfoNode.cpp | 2 +- .../pfPython/pyVaultMarkerGameNode.cpp | 5 +- .../FeatureLib/pfPython/pyVaultNode.cpp | 5 +- .../pfPython/pyVaultPlayerInfoNode.cpp | 7 +- .../FeatureLib/pfPython/pyVaultPlayerNode.cpp | 4 +- .../NucleusLib/pnAsyncCore/Private/pnAcIo.h | 11 +- .../NucleusLib/pnAsyncCoreExe/pnAceIo.cpp | 16 +- .../pnGameMgr/BlueSpiral/pnGmBlueSpiral.h | 2 +- .../pnGameMgr/ClimbingWall/pnGmClimbingWall.h | 2 +- .../NucleusLib/pnGameMgr/Heek/pnGmHeek.h | 2 +- .../NucleusLib/pnGameMgr/Marker/pnGmMarker.h | 2 +- Sources/Plasma/NucleusLib/pnGameMgr/Pch.h | 1 + .../pnGameMgr/TicTacToe/pnGmTicTacToe.h | 2 +- .../pnGameMgr/VarSync/pnGmVarSync.h | 2 +- .../Plasma/NucleusLib/pnGameMgr/pnGameMgr.h | 10 +- .../Plasma/NucleusLib/pnNetCli/pnNcCli.cpp | 4 +- .../NucleusLib/pnNetCommon/pnNetCommon.cpp | 22 ++- Sources/Plasma/NucleusLib/pnNetProtocol/Pch.h | 1 + .../Private/Protocols/Cli2Auth/pnNpCli2Auth.h | 30 ++-- .../Private/Protocols/Cli2Game/pnNpCli2Game.h | 6 +- .../Cli2GateKeeper/pnNpCli2GateKeeper.h | 2 +- .../Private/Protocols/Srv2Db/pnNpSrv2Db.h | 42 ++--- .../Private/Protocols/Srv2Mcp/pnNpSrv2Mcp.h | 30 ++-- .../Protocols/Srv2State/pnNpSrv2State.h | 6 +- .../Protocols/Srv2Vault/pnNpSrv2Vault.h | 60 +++---- .../pnNetProtocol/Private/pnNpCommon.cpp | 29 ++-- .../pnNetProtocol/Private/pnNpCommon.h | 44 ++--- Sources/Plasma/NucleusLib/pnUUID/pnUUID.cpp | 14 +- Sources/Plasma/NucleusLib/pnUUID/pnUUID.h | 7 +- .../Plasma/NucleusLib/pnUUID/pnUUID_Unix.cpp | 13 +- .../Plasma/NucleusLib/pnUtils/CMakeLists.txt | 4 - .../NucleusLib/pnUtils/Unix/pnUtUxUuid.cpp | 69 -------- .../NucleusLib/pnUtils/Win32/pnUtW32Uuid.cpp | 150 ------------------ .../NucleusLib/pnUtils/pnUtAllIncludes.h | 1 - .../Plasma/NucleusLib/pnUtils/pnUtUuid.cpp | 66 -------- Sources/Plasma/NucleusLib/pnUtils/pnUtUuid.h | 110 ------------- .../plNetClient/plNetClientMsgHandler.cpp | 2 +- .../plNetClient/plNetLinkingMgr.cpp | 8 +- .../plNetClientComm/plNetClientComm.cpp | 22 +-- .../plNetClientComm/plNetClientComm.h | 14 +- .../plNetGameLib/Private/plNglAuth.cpp | 114 ++++++------- .../plNetGameLib/Private/plNglAuth.h | 24 +-- .../plNetGameLib/Private/plNglGame.cpp | 8 +- .../plNetGameLib/Private/plNglGame.h | 2 +- .../plNetGameLib/Private/plNglGateKeeper.cpp | 6 +- .../PubUtilLib/plVault/plVaultClientApi.cpp | 27 ++-- .../PubUtilLib/plVault/plVaultClientApi.h | 13 +- .../PubUtilLib/plVault/plVaultNodeAccess.cpp | 24 ++- .../PubUtilLib/plVault/plVaultNodeAccess.h | 32 ++-- 78 files changed, 427 insertions(+), 892 deletions(-) delete mode 100644 Sources/Plasma/NucleusLib/pnUtils/Unix/pnUtUxUuid.cpp delete mode 100644 Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Uuid.cpp delete mode 100644 Sources/Plasma/NucleusLib/pnUtils/pnUtUuid.cpp delete mode 100644 Sources/Plasma/NucleusLib/pnUtils/pnUtUuid.h diff --git a/Sources/Plasma/FeatureLib/pfGameMgr/pfGameMgr.cpp b/Sources/Plasma/FeatureLib/pfGameMgr/pfGameMgr.cpp index a4a7bfb1..a612533a 100644 --- a/Sources/Plasma/FeatureLib/pfGameMgr/pfGameMgr.cpp +++ b/Sources/Plasma/FeatureLib/pfGameMgr/pfGameMgr.cpp @@ -409,7 +409,7 @@ void pfGameMgr::JoinGame ( //============================================================================ void pfGameMgr::CreateGame ( plKey receiver, - const Uuid & gameTypeId, + const plUUID& gameTypeId, unsigned createOptions, unsigned initBytes, const void * initData @@ -439,7 +439,7 @@ void pfGameMgr::CreateGame ( //============================================================================ void pfGameMgr::JoinCommonGame ( plKey receiver, - const Uuid & gameTypeId, + const plUUID& gameTypeId, unsigned gameNumber, unsigned initBytes, const void * initData diff --git a/Sources/Plasma/FeatureLib/pfGameMgr/pfGameMgr.h b/Sources/Plasma/FeatureLib/pfGameMgr/pfGameMgr.h index 5f93ace7..d7a86cde 100644 --- a/Sources/Plasma/FeatureLib/pfGameMgr/pfGameMgr.h +++ b/Sources/Plasma/FeatureLib/pfGameMgr/pfGameMgr.h @@ -170,7 +170,7 @@ public: // Create a new game void CreateGame ( plKey receiver, // Receiver of pfGameCliMsgs for this game - const Uuid & gameTypeId, // typeid of game to create + const plUUID& gameTypeId, // typeid of game to create unsigned createOptions, // Game create options from pnGameMgr.h unsigned initBytes, // Game-specific initialization data const void * initData @@ -178,7 +178,7 @@ public: // Join or create the specified common game void JoinCommonGame ( plKey receiver, // Receiver of pfGameCliMsgs for this game - const Uuid & gameTypeId, // typeid of common game to create/join + const plUUID& gameTypeId, // typeid of common game to create/join unsigned gameNumber, // "table number" of common game to create/join // In case the common game needs to // be created on the server, these diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralGame.cpp b/Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralGame.cpp index 3406c43a..b38a47f4 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralGame.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralGame.cpp @@ -59,9 +59,9 @@ pyBlueSpiralGame::pyBlueSpiralGame(pfGameCli* client): pyGameCli(client) gameClient = nil; // wrong type, just clear it out } -bool pyBlueSpiralGame::IsBlueSpiralGame(std::wstring guid) +bool pyBlueSpiralGame::IsBlueSpiralGame(plString& guid) { - Uuid gameUuid(guid.c_str()); + plUUID gameUuid(guid); return gameUuid == kGameTypeId_BlueSpiral; } @@ -87,4 +87,4 @@ void pyBlueSpiralGame::HitCloth(int clothNum) pfGmBlueSpiral* blueSpiral = pfGmBlueSpiral::ConvertNoRef(gameClient); blueSpiral->HitCloth(clothNum); } -} \ No newline at end of file +} diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralGame.h b/Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralGame.h index 2a6fa7a4..7514337c 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralGame.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralGame.h @@ -68,7 +68,7 @@ public: static void AddPlasmaClasses(PyObject* m); static void AddPlasmaMethods(std::vector& methods); - static bool IsBlueSpiralGame(std::wstring guid); + static bool IsBlueSpiralGame(plString& guid); static void JoinCommonBlueSpiralGame(pyKey& callbackKey, unsigned gameID); void StartGame(); diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralGameGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralGameGlue.cpp index b08fd931..f2d8defb 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralGameGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralGameGlue.cpp @@ -65,31 +65,20 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtIsBlueSpiralGame, args, "Params: typeID\nRetur PyObject* textObj; if (!PyArg_ParseTuple(args, "O", &textObj)) { - PyErr_SetString(PyExc_TypeError, "PtIsBlueSpiralGame expects a unicode string"); + PyErr_SetString(PyExc_TypeError, "PtIsBlueSpiralGame expects a string"); PYTHON_RETURN_ERROR; } - if (PyUnicode_Check(textObj)) + + if (PyString_CheckEx(textObj)) { - int strLen = PyUnicode_GetSize(textObj); - wchar_t* text = new wchar_t[strLen + 1]; - PyUnicode_AsWideChar((PyUnicodeObject*)textObj, text, strLen); - text[strLen] = L'\0'; + plString text = PyString_AsStringEx(textObj); + bool retVal = pyBlueSpiralGame::IsBlueSpiralGame(text); - delete [] text; - PYTHON_RETURN_BOOL(retVal); - } - else if (PyString_Check(textObj)) - { - // we'll allow this, just in case something goes weird - char* text = PyString_AsString(textObj); - wchar_t* wText = hsStringToWString(text); - bool retVal = pyBlueSpiralGame::IsBlueSpiralGame(wText); - delete [] wText; PYTHON_RETURN_BOOL(retVal); } else { - PyErr_SetString(PyExc_TypeError, "PtIsBlueSpiralGame expects a unicode string"); + PyErr_SetString(PyExc_TypeError, "PtIsBlueSpiralGame expects a string"); PYTHON_RETURN_ERROR; } } @@ -159,4 +148,4 @@ void pyBlueSpiralGame::AddPlasmaMethods(std::vector& methods) { PYTHON_GLOBAL_METHOD(methods, PtIsBlueSpiralGame); PYTHON_GLOBAL_METHOD(methods, PtJoinCommonBlueSpiralGame); -} \ No newline at end of file +} diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallGame.cpp b/Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallGame.cpp index 87b4bdb1..a1a9e661 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallGame.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallGame.cpp @@ -59,9 +59,9 @@ pyClimbingWallGame::pyClimbingWallGame(pfGameCli* client): pyGameCli(client) gameClient = nil; // wrong type, just clear it out } -bool pyClimbingWallGame::IsClimbingWallGame(std::wstring guid) +bool pyClimbingWallGame::IsClimbingWallGame(plString& guid) { - Uuid gameUuid(guid.c_str()); + plUUID gameUuid(guid); return gameUuid == kGameTypeId_ClimbingWall; } @@ -132,4 +132,4 @@ void pyClimbingWallGame::Panic() pfGmClimbingWall* climbingWall = pfGmClimbingWall::ConvertNoRef(gameClient); climbingWall->Panic(); } -} \ No newline at end of file +} diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallGame.h b/Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallGame.h index 2552d7b3..b2817858 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallGame.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallGame.h @@ -69,7 +69,7 @@ public: static void AddPlasmaMethods(std::vector& methods); static void AddPlasmaConstantsClasses(PyObject* m); - static bool IsClimbingWallGame(std::wstring guid); + static bool IsClimbingWallGame(plString& guid); static void JoinCommonClimbingWallGame(pyKey& callbackKey, unsigned gameID); void ChangeNumBlockers(int amountToAdjust); diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallGameGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallGameGlue.cpp index e67284e9..1738c4d4 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallGameGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallGameGlue.cpp @@ -65,31 +65,20 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtIsClimbingWallGame, args, "Params: typeID\nRet PyObject* textObj; if (!PyArg_ParseTuple(args, "O", &textObj)) { - PyErr_SetString(PyExc_TypeError, "PtIsClimbingWallGame expects a unicode string"); + PyErr_SetString(PyExc_TypeError, "PtIsClimbingWallGame expects a string"); PYTHON_RETURN_ERROR; } - if (PyUnicode_Check(textObj)) + + if (PyString_CheckEx(textObj)) { - int strLen = PyUnicode_GetSize(textObj); - wchar_t* text = new wchar_t[strLen + 1]; - PyUnicode_AsWideChar((PyUnicodeObject*)textObj, text, strLen); - text[strLen] = L'\0'; + plString text = PyString_AsStringEx(textObj); + bool retVal = pyClimbingWallGame::IsClimbingWallGame(text); - delete [] text; - PYTHON_RETURN_BOOL(retVal); - } - else if (PyString_Check(textObj)) - { - // we'll allow this, just in case something goes weird - char* text = PyString_AsString(textObj); - wchar_t* wText = hsStringToWString(text); - bool retVal = pyClimbingWallGame::IsClimbingWallGame(wText); - delete [] wText; PYTHON_RETURN_BOOL(retVal); } else { - PyErr_SetString(PyExc_TypeError, "PtIsClimbingWallGame expects a unicode string"); + PyErr_SetString(PyExc_TypeError, "PtIsClimbingWallGame expects a string"); PYTHON_RETURN_ERROR; } } @@ -213,4 +202,4 @@ void pyClimbingWallGame::AddPlasmaConstantsClasses(PyObject* m) PYTHON_ENUM_ELEMENT(PtClimbingWallReadyTypes, kClimbingWallReadyNumBlockers, kClimbingWallReadyNumBlockers); PYTHON_ENUM_ELEMENT(PtClimbingWallReadyTypes, kClimbingWallReadyBlockers, kClimbingWallReadyBlockers); PYTHON_ENUM_END(m, PtClimbingWallReadyTypes); -} \ No newline at end of file +} diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekGame.cpp b/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekGame.cpp index ec3071fe..8a684f24 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekGame.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekGame.cpp @@ -59,9 +59,9 @@ pyHeekGame::pyHeekGame(pfGameCli* client): pyGameCli(client) gameClient = nil; // wrong type, just clear it out } -bool pyHeekGame::IsHeekGame(std::wstring guid) +bool pyHeekGame::IsHeekGame(plString& guid) { - Uuid gameUuid(guid.c_str()); + plUUID gameUuid(guid); return gameUuid == kGameTypeId_Heek; } @@ -104,4 +104,4 @@ void pyHeekGame::SequenceFinished(int seq) pfGmHeek* heek = pfGmHeek::ConvertNoRef(gameClient); heek->SequenceFinished((EHeekSeqFinished)seq); } -} \ No newline at end of file +} diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekGame.h b/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekGame.h index 8db63168..13787e1c 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekGame.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekGame.h @@ -69,7 +69,7 @@ public: static void AddPlasmaConstantsClasses(PyObject* m); static void AddPlasmaMethods(std::vector& methods); - static bool IsHeekGame(std::wstring guid); + static bool IsHeekGame(plString& guid); static void JoinCommonHeekGame(pyKey& callbackKey, unsigned gameID); void PlayGame(int position, uint32_t points, std::wstring name); diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekGameGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekGameGlue.cpp index 604c18f9..f24d4db4 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekGameGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekGameGlue.cpp @@ -65,31 +65,20 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtIsHeekGame, args, "Params: typeID\nReturns tru PyObject* textObj; if (!PyArg_ParseTuple(args, "O", &textObj)) { - PyErr_SetString(PyExc_TypeError, "PtIsHeekGame expects a unicode string"); + PyErr_SetString(PyExc_TypeError, "PtIsHeekGame expects a string"); PYTHON_RETURN_ERROR; } - if (PyUnicode_Check(textObj)) + + if (PyString_CheckEx(textObj)) { - int strLen = PyUnicode_GetSize(textObj); - wchar_t* text = new wchar_t[strLen + 1]; - PyUnicode_AsWideChar((PyUnicodeObject*)textObj, text, strLen); - text[strLen] = L'\0'; + plString text = PyString_AsStringEx(textObj); + bool retVal = pyHeekGame::IsHeekGame(text); - delete [] text; - PYTHON_RETURN_BOOL(retVal); - } - else if (PyString_Check(textObj)) - { - // we'll allow this, just in case something goes weird - char* text = PyString_AsString(textObj); - wchar_t* wText = hsStringToWString(text); - bool retVal = pyHeekGame::IsHeekGame(wText); - delete [] wText; PYTHON_RETURN_BOOL(retVal); } else { - PyErr_SetString(PyExc_TypeError, "PtIsHeekGame expects a unicode string"); + PyErr_SetString(PyExc_TypeError, "PtIsHeekGame expects a string"); PYTHON_RETURN_ERROR; } } @@ -224,4 +213,4 @@ void pyHeekGame::AddPlasmaMethods(std::vector& methods) { PYTHON_GLOBAL_METHOD(methods, PtIsHeekGame); PYTHON_GLOBAL_METHOD(methods, PtJoinCommonHeekGame); -} \ No newline at end of file +} diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerGame.cpp b/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerGame.cpp index f715fd47..fb2917ca 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerGame.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerGame.cpp @@ -60,9 +60,9 @@ pyMarkerGame::pyMarkerGame(pfGameCli* client): pyGameCli(client) gameClient = nil; // wrong type, just clear it out } -bool pyMarkerGame::IsMarkerGame(std::wstring guid) +bool pyMarkerGame::IsMarkerGame(plString& guid) { - Uuid gameUuid(guid.c_str()); + plUUID gameUuid(guid); return gameUuid == kGameTypeId_Marker; } @@ -164,4 +164,4 @@ void pyMarkerGame::CaptureMarker(unsigned long markerId) pfGmMarker* marker = pfGmMarker::ConvertNoRef(gameClient); marker->CaptureMarker(markerId); } -} \ No newline at end of file +} diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerGame.h b/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerGame.h index f86173f5..ac296b43 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerGame.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerGame.h @@ -69,7 +69,7 @@ public: static void AddPlasmaConstantsClasses(PyObject* m); static void AddPlasmaMethods(std::vector& methods); - static bool IsMarkerGame(std::wstring guid); + static bool IsMarkerGame(plString& guid); static void CreateMarkerGame(pyKey& callbackKey, unsigned gameType, std::wstring gameName, unsigned long timeLimit, std::wstring templateId); void StartGame(); diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerGameGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerGameGlue.cpp index eb49b96b..101fb007 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerGameGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerGameGlue.cpp @@ -65,31 +65,20 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtIsMarkerGame, args, "Params: typeID\nReturns t PyObject* textObj; if (!PyArg_ParseTuple(args, "O", &textObj)) { - PyErr_SetString(PyExc_TypeError, "PtIsMarkerGame expects a unicode string"); + PyErr_SetString(PyExc_TypeError, "PtIsMarkerGame expects a string"); PYTHON_RETURN_ERROR; } - if (PyUnicode_Check(textObj)) + + if (PyString_CheckEx(textObj)) { - int strLen = PyUnicode_GetSize(textObj); - wchar_t* text = new wchar_t[strLen + 1]; - PyUnicode_AsWideChar((PyUnicodeObject*)textObj, text, strLen); - text[strLen] = L'\0'; + plString text = PyString_AsStringEx(textObj); + bool retVal = pyMarkerGame::IsMarkerGame(text); - delete [] text; - PYTHON_RETURN_BOOL(retVal); - } - else if (PyString_Check(textObj)) - { - // we'll allow this, just in case something goes weird - char* text = PyString_AsString(textObj); - wchar_t* wText = hsStringToWString(text); - bool retVal = pyMarkerGame::IsMarkerGame(wText); - delete [] wText; PYTHON_RETURN_BOOL(retVal); } else { - PyErr_SetString(PyExc_TypeError, "PtIsMarkerGame expects a unicode string"); + PyErr_SetString(PyExc_TypeError, "PtIsMarkerGame expects a string"); PYTHON_RETURN_ERROR; } } diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTGame.cpp b/Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTGame.cpp index 97f290e2..43d43834 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTGame.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTGame.cpp @@ -59,9 +59,9 @@ pyTTTGame::pyTTTGame(pfGameCli* client): pyGameCli(client) gameClient = nil; // wrong type, just clear it out } -bool pyTTTGame::IsTTTGame(std::wstring guid) +bool pyTTTGame::IsTTTGame(plString& guid) { - Uuid gameUuid(guid.c_str()); + plUUID gameUuid(guid); return gameUuid == kGameTypeId_TicTacToe; } @@ -95,4 +95,4 @@ void pyTTTGame::ShowBoard() pfGmTicTacToe* ttt = pfGmTicTacToe::ConvertNoRef(gameClient); ttt->ShowBoard(); } -} \ No newline at end of file +} diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTGame.h b/Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTGame.h index 740859b0..d2f03fc3 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTGame.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTGame.h @@ -69,7 +69,7 @@ public: static void AddPlasmaConstantsClasses(PyObject* m); static void AddPlasmaMethods(std::vector& methods); - static bool IsTTTGame(std::wstring guid); + static bool IsTTTGame(plString& guid); static void CreateTTTGame(pyKey& callbackKey, unsigned numPlayers); static void JoinCommonTTTGame(pyKey& callbackKey, unsigned gameID, unsigned numPlayers); diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTGameGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTGameGlue.cpp index 4be01e71..039a8d68 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTGameGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTGameGlue.cpp @@ -65,31 +65,20 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtIsTTTGame, args, "Params: typeID\nReturns true PyObject* textObj; if (!PyArg_ParseTuple(args, "O", &textObj)) { - PyErr_SetString(PyExc_TypeError, "PtIsTTTGame expects a unicode string"); + PyErr_SetString(PyExc_TypeError, "PtIsTTTGame expects a string"); PYTHON_RETURN_ERROR; } - if (PyUnicode_Check(textObj)) + + if (PyString_CheckEx(textObj)) { - int strLen = PyUnicode_GetSize(textObj); - wchar_t* text = new wchar_t[strLen + 1]; - PyUnicode_AsWideChar((PyUnicodeObject*)textObj, text, strLen); - text[strLen] = L'\0'; + plString text = PyString_AsStringEx(textObj); + bool retVal = pyTTTGame::IsTTTGame(text); - delete [] text; - PYTHON_RETURN_BOOL(retVal); - } - else if (PyString_Check(textObj)) - { - // we'll allow this, just in case something goes weird - char* text = PyString_AsString(textObj); - wchar_t* wText = hsStringToWString(text); - bool retVal = pyTTTGame::IsTTTGame(wText); - delete [] wText; PYTHON_RETURN_BOOL(retVal); } else { - PyErr_SetString(PyExc_TypeError, "PtIsTTTGame expects a unicode string"); + PyErr_SetString(PyExc_TypeError, "PtIsTTTGame expects a string"); PYTHON_RETURN_ERROR; } } @@ -189,4 +178,4 @@ void pyTTTGame::AddPlasmaMethods(std::vector& methods) PYTHON_GLOBAL_METHOD(methods, PtIsTTTGame); PYTHON_GLOBAL_METHOD(methods, PtCreateTTTGame); PYTHON_GLOBAL_METHOD(methods, PtJoinCommonTTTGame); -} \ No newline at end of file +} diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncGame.cpp b/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncGame.cpp index 8728bf58..bf759687 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncGame.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncGame.cpp @@ -61,9 +61,9 @@ pyVarSyncGame::pyVarSyncGame(pfGameCli* client): pyGameCli(client) gameClient = nil; // wrong type, just clear it out } -bool pyVarSyncGame::IsVarSyncGame(std::wstring guid) +bool pyVarSyncGame::IsVarSyncGame(plString& guid) { - Uuid gameUuid(guid.c_str()); + plUUID gameUuid(guid); return gameUuid == kGameTypeId_VarSync; } @@ -117,4 +117,4 @@ void pyVarSyncGame::CreateNumericVar(std::wstring name, double val) pfGmVarSync* vsync = pfGmVarSync::ConvertNoRef(gameClient); vsync->CreateNumericVar(name.c_str(), val); } -} \ No newline at end of file +} diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncGame.h b/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncGame.h index b83e543c..49e5cbf3 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncGame.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncGame.h @@ -68,7 +68,7 @@ public: static void AddPlasmaClasses(PyObject* m); static void AddPlasmaMethods(std::vector& methods); - static bool IsVarSyncGame(std::wstring guid); + static bool IsVarSyncGame(plString& guid); static void JoinCommonVarSyncGame(pyKey& callbackKey); void SetStringVar(unsigned long id, std::wstring val); diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncGameGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncGameGlue.cpp index 5434e55a..3500707b 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncGameGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncGameGlue.cpp @@ -65,31 +65,20 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtIsVarSyncGame, args, "Params: typeID\nReturns PyObject* textObj; if (!PyArg_ParseTuple(args, "O", &textObj)) { - PyErr_SetString(PyExc_TypeError, "PtIsVarSyncGame expects a unicode string"); + PyErr_SetString(PyExc_TypeError, "PtIsVarSyncGame expects a string"); PYTHON_RETURN_ERROR; } - if (PyUnicode_Check(textObj)) + + if (PyString_CheckEx(textObj)) { - int strLen = PyUnicode_GetSize(textObj); - wchar_t* text = new wchar_t[strLen + 1]; - PyUnicode_AsWideChar((PyUnicodeObject*)textObj, text, strLen); - text[strLen] = L'\0'; + plString text = PyString_AsStringEx(textObj); + bool retVal = pyVarSyncGame::IsVarSyncGame(text); - delete [] text; - PYTHON_RETURN_BOOL(retVal); - } - else if (PyString_Check(textObj)) - { - // we'll allow this, just in case something goes weird - char* text = PyString_AsString(textObj); - wchar_t* wText = hsStringToWString(text); - bool retVal = pyVarSyncGame::IsVarSyncGame(wText); - delete [] wText; PYTHON_RETURN_BOOL(retVal); } else { - PyErr_SetString(PyExc_TypeError, "PtIsVarSyncGame expects a unicode string"); + PyErr_SetString(PyExc_TypeError, "PtIsVarSyncGame expects a string"); PYTHON_RETURN_ERROR; } } @@ -325,4 +314,4 @@ void pyVarSyncGame::AddPlasmaMethods(std::vector& methods) { PYTHON_GLOBAL_METHOD(methods, PtIsVarSyncGame); PYTHON_GLOBAL_METHOD(methods, PtJoinCommonVarSyncGame); -} \ No newline at end of file +} diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCli.cpp b/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCli.cpp index b1153236..a1d9533d 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCli.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCli.cpp @@ -106,7 +106,7 @@ plUUID pyGameCli::GameTypeID() const { return plUUID(gameClient->GetGameTypeId()); } - return plUUID(); + return kNilUuid; } std::wstring pyGameCli::Name() const diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCliMsg.cpp b/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCliMsg.cpp index 53c0f2aa..1a949e61 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCliMsg.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCliMsg.cpp @@ -129,7 +129,8 @@ PyObject* pyGameCliMsg::UpcastToGameMsg() const if (!message) PYTHON_RETURN_NONE; - const Uuid& gameTypeId = message->gameCli->GetGameTypeId(); + const plUUID& gameTypeId = message->gameCli->GetGameTypeId(); + if (gameTypeId == kGameTypeId_TicTacToe) return pyTTTMsg::New(message); else if (gameTypeId == kGameTypeId_Heek) diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/pyGameMgrMsg.cpp b/Sources/Plasma/FeatureLib/pfPython/Games/pyGameMgrMsg.cpp index f4002871..07f91329 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/pyGameMgrMsg.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/Games/pyGameMgrMsg.cpp @@ -111,7 +111,7 @@ plUUID pyGameMgrInviteReceivedMsg::GameTypeID() const const Srv2Cli_GameMgr_InviteReceived* gmMsg = (const Srv2Cli_GameMgr_InviteReceived*)message->netMsg; return plUUID(gmMsg->gameTypeId); } - return plUUID(); + return kNilUuid; } uint32_t pyGameMgrInviteReceivedMsg::NewGameID() const @@ -150,7 +150,7 @@ plUUID pyGameMgrInviteRevokedMsg::GameTypeID() const const Srv2Cli_GameMgr_InviteRevoked* gmMsg = (const Srv2Cli_GameMgr_InviteRevoked*)message->netMsg; return plUUID(gmMsg->gameTypeId); } - return plUUID(); + return kNilUuid; } uint32_t pyGameMgrInviteRevokedMsg::NewGameID() const diff --git a/Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp b/Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp index c7eb6341..b3a90bc3 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp @@ -1689,7 +1689,7 @@ void cyMisc::SetShareSpawnPoint(const char* spawnPoint) pMsg->Send(); } -void cyMisc::SetShareAgeInstanceGuid(const Uuid& guid) +void cyMisc::SetShareAgeInstanceGuid(const plUUID& guid) { plInputIfaceMgrMsg* pMsg = new plInputIfaceMgrMsg(plInputIfaceMgrMsg::kSetShareAgeInstanceGuid); plKey k = plNetClientMgr::GetInstance()->GetLocalPlayerKey(); diff --git a/Sources/Plasma/FeatureLib/pfPython/cyMisc.h b/Sources/Plasma/FeatureLib/pfPython/cyMisc.h index 0293e2d4..a0d901f8 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyMisc.h +++ b/Sources/Plasma/FeatureLib/pfPython/cyMisc.h @@ -66,8 +66,8 @@ class pyPoint3; class pyGUIDialog; class plPipeline; class plDisplayMode; +class plUUID; struct PipelineParams; -struct Uuid; typedef struct _object PyObject; typedef struct PyMethodDef PyMethodDef; @@ -636,7 +636,7 @@ public: static void NotifyOffererPublicLinkCompleted(uint32_t offerer); static void ToggleAvatarClickability(bool on); static void SetShareSpawnPoint(const char* spawnPoint); - static void SetShareAgeInstanceGuid(const Uuid& guid); + static void SetShareAgeInstanceGuid(const plUUID& guid); ////////////////////////////////////////////////////////////////////////////// // diff --git a/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue3.cpp b/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue3.cpp index 689302b0..e763aef8 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue3.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue3.cpp @@ -48,6 +48,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyGlueHelpers.h" #include "pySceneObject.h" #include "pnUtils/pnUtils.h" +#include "pnUUID/pnUUID.h" PYTHON_GLOBAL_METHOD_DEFINITION(PtSendPetitionToCCR, args, "Params: message,reason=0,title=\"\"\nSends a petition with a message to the CCR group") { @@ -437,12 +438,14 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtSetShareAgeInstanceGuid, args, "Params: instan PyErr_SetString(PyExc_TypeError, "PtSetShareAgeInstanceGuid expects a string"); PYTHON_RETURN_ERROR; } - Uuid guid; - if (!GuidFromString(guidStr, &guid)) + + plUUID guid(guidStr); + if (guid == kNilUuid) { PyErr_SetString(PyExc_TypeError, "PtSetShareAgeInstanceGuid string parameter is not a guid string"); PYTHON_RETURN_ERROR; } + cyMisc::SetShareAgeInstanceGuid(guid); PYTHON_RETURN_NONE; } @@ -778,4 +781,4 @@ void cyMisc::AddPlasmaMethods3(std::vector &methods) PYTHON_GLOBAL_METHOD_NOARGS(methods, PtGetUserPath); PYTHON_GLOBAL_METHOD_NOARGS(methods, PtGetInitPath); -} \ No newline at end of file +} diff --git a/Sources/Plasma/FeatureLib/pfPython/pyAgeVault.cpp b/Sources/Plasma/FeatureLib/pfPython/pyAgeVault.cpp index 1a2a5e4f..16e2c093 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyAgeVault.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyAgeVault.cpp @@ -193,7 +193,7 @@ plUUID pyAgeVault::GetAgeGuid( void ) rvn->DecRef(); return uuid; } - return plUUID(); + return kNilUuid; } diff --git a/Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.cpp b/Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.cpp index 42f3ee87..702d10d2 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.cpp @@ -111,5 +111,5 @@ plUUID pyDniInfoSource::GetAgeGuid( void ) const return uuid; } - return plUUID(); + return kNilUuid; } diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVault.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVault.cpp index 73a38b6d..cbecd840 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVault.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVault.cpp @@ -531,7 +531,7 @@ bool pyVault::AmAgeOwner( const pyAgeInfoStruct * ageInfo ) if (!ageInfo->GetAgeInfo()) return false; - Uuid ageInstId = *ageInfo->GetAgeInfo()->GetAgeInstanceGuid(); + plUUID ageInstId = *ageInfo->GetAgeInfo()->GetAgeInstanceGuid(); return VaultAmOwnerOfAge(ageInstId); } @@ -540,7 +540,7 @@ bool pyVault::AmAgeCzar( const pyAgeInfoStruct * ageInfo ) if (!ageInfo->GetAgeInfo()) return false; - Uuid ageInstId = *ageInfo->GetAgeInfo()->GetAgeInstanceGuid(); + plUUID ageInstId = *ageInfo->GetAgeInfo()->GetAgeInstanceGuid(); return VaultAmCzarOfAge(ageInstId); } @@ -574,10 +574,8 @@ void pyVault::RegisterVisitAge( const pyAgeLinkStruct & link ) void pyVault::UnRegisterVisitAge( const char * guidstr ) { - Uuid uuid; - GuidFromString(guidstr, &uuid); plAgeInfoStruct info; - plUUID guid(uuid); + plUUID guid(guidstr); info.SetAgeInstanceGuid(&guid); VaultUnregisterVisitAgeAndWait(&info); } diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNode.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNode.cpp index 5e911472..5a914ab8 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNode.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNode.cpp @@ -236,7 +236,7 @@ plUUID pyVaultAgeInfoNode::GetAgeInstanceGuid() const return plUUID(access.ageInstUuid); } - return plUUID(); + return kNilUuid; } void pyVaultAgeInfoNode::SetAgeInstanceGuid( const char * sguid ) diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNode.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNode.cpp index 965bb559..2901d681 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNode.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNode.cpp @@ -95,15 +95,14 @@ plUUID pyVaultMarkerGameNode::GetGameGuid() const VaultMarkerGameNode access(fNode); return plUUID(access.gameGuid); } - return plUUID(); + return kNilUuid; } void pyVaultMarkerGameNode::SetGameGuid (const char v[]) { if (fNode) { VaultMarkerGameNode access(fNode); - Uuid uuid; - GuidFromString(v, &uuid); + plUUID uuid(v); access.SetGameGuid(uuid); } } diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultNode.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultNode.cpp index 710af162..baeee32e 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultNode.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultNode.cpp @@ -328,7 +328,7 @@ plUUID pyVaultNode::GetCreateAgeGuid(void) const return plUUID(fNode->createAgeUuid); } - return plUUID(); + return kNilUuid; } PyObject* pyVaultNode::GetCreateAgeCoords () { @@ -384,8 +384,7 @@ void pyVaultNode::SetCreateAgeName( const char * v ) void pyVaultNode::SetCreateAgeGuid( const char * v ) { ASSERT(fNode); - Uuid uuid; - GuidFromString(v, &uuid); + plUUID uuid(v); fNode->SetCreateAgeUuid(uuid); } diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNode.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNode.cpp index 8c15ffd8..15547e56 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNode.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNode.cpp @@ -153,10 +153,9 @@ void pyVaultPlayerInfoNode::Player_SetAgeGuid( const char * guidtext) if (!fNode) return; - Uuid ageInstId; - GuidFromString(guidtext, &ageInstId); + plUUID ageInstId(guidtext); VaultPlayerInfoNode playerInfo(fNode); - playerInfo.SetAgeInstUuid(ageInstId); + playerInfo.SetAgeInstUuid(ageInstId); } plUUID pyVaultPlayerInfoNode::Player_GetAgeGuid(void) const @@ -165,7 +164,7 @@ plUUID pyVaultPlayerInfoNode::Player_GetAgeGuid(void) const VaultPlayerInfoNode playerInfo(fNode); return plUUID(playerInfo.ageInstUuid); } - return plUUID(); + return kNilUuid; } // online status diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNode.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNode.cpp index 3cae6818..3abc2d01 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNode.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNode.cpp @@ -236,10 +236,8 @@ PyObject *pyVaultPlayerNode::GetVisitAgeLink(const pyAgeInfoStruct *info) void pyVaultPlayerNode::RemoveVisitAgeLink(const char *guidstr) { - Uuid uuid; - GuidFromString(guidstr, &uuid); plAgeInfoStruct info; - plUUID guid(uuid); + plUUID guid(guidstr); info.SetAgeInstanceGuid(&guid); VaultUnregisterOwnedAgeAndWait(&info); } diff --git a/Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcIo.h b/Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcIo.h index b2dae81d..73605e3b 100644 --- a/Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcIo.h +++ b/Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcIo.h @@ -51,6 +51,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNASYNCCORE_PRIVATE_PNACIO_H #include "pnNetCommon/plNetAddress.h" +#include "pnUUID/pnUUID.h" /**************************************************************************** @@ -79,7 +80,7 @@ struct AsyncSocketConnectPacket { uint32_t buildId; uint32_t buildType; uint32_t branchId; - Uuid productId; + plUUID productId; }; #pragma pack(pop) @@ -114,7 +115,7 @@ struct AsyncNotifySocketListen : AsyncNotifySocketConnect { unsigned buildId; unsigned buildType; unsigned branchId; - Uuid productId; + plUUID productId; plNetAddress addr; uint8_t * buffer; unsigned bytes; @@ -183,7 +184,7 @@ void AsyncSocketRegisterNotifyProc ( unsigned buildId = 0, unsigned buildType = 0, unsigned branchId = 0, - const Uuid & productId = kNilGuid + const plUUID& productId = kNilUuid ); void AsyncSocketUnregisterNotifyProc ( @@ -192,7 +193,7 @@ void AsyncSocketUnregisterNotifyProc ( unsigned buildId = 0, unsigned buildType = 0, unsigned branchId = 0, - const Uuid & productId = kNilGuid + const plUUID& productId = kNilUuid ); FAsyncNotifySocketProc AsyncSocketFindNotifyProc ( @@ -203,7 +204,7 @@ FAsyncNotifySocketProc AsyncSocketFindNotifyProc ( unsigned * buildId, unsigned * buildType, unsigned * branchId, - Uuid * productId + plUUID* productId ); diff --git a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/pnAceIo.cpp b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/pnAceIo.cpp index a0bf3ecf..eb94d2a9 100644 --- a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/pnAceIo.cpp +++ b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/pnAceIo.cpp @@ -62,7 +62,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // uint32_t buildId; [optional] // uint32_t branchId; [optional] // uint32_t buildType; [optional] -// Uuid productId; [optional] +// plUUID productId; [optional] const unsigned kConnHashFlagsIgnore = 0x01; const unsigned kConnHashFlagsExactMatch = 0x02; struct ISocketConnHash { @@ -70,7 +70,7 @@ struct ISocketConnHash { unsigned buildId; unsigned buildType; unsigned branchId; - Uuid productId; + plUUID productId; unsigned flags; unsigned GetHash () const; @@ -102,7 +102,7 @@ unsigned ISocketConnHash::GetHash () const { hash.Hash32(buildType); if (branchId) hash.Hash32(branchId); - if (productId != kNilGuid) + if (productId != kNilUuid) hash.Hash(&productId, sizeof(productId)); */ return hash.GetHash(); @@ -145,7 +145,7 @@ bool ISocketConnHash::operator== (const ISocketConnHash & rhs) const { if (productId != rhs.productId) { if (rhs.flags & kConnHashFlagsExactMatch) break; - if (productId != kNilGuid) + if (productId != kNilUuid) break; } @@ -171,7 +171,7 @@ static unsigned GetConnHash ( hash->buildId = 0; hash->buildType = 0; hash->branchId = 0; - hash->productId = 0; + hash->productId = kNilUuid; hash->flags = 0; // one uint8_t consumed @@ -325,7 +325,7 @@ void AsyncSocketRegisterNotifyProc ( unsigned buildId, unsigned buildType, unsigned branchId, - const Uuid & productId + const plUUID& productId ) { ASSERT(connType != kConnTypeNil); ASSERT(notifyProc); @@ -354,7 +354,7 @@ void AsyncSocketUnregisterNotifyProc ( unsigned buildId, unsigned buildType, unsigned branchId, - const Uuid & productId + const plUUID& productId ) { ISocketConnHash hash; hash.connType = connType; @@ -392,7 +392,7 @@ FAsyncNotifySocketProc AsyncSocketFindNotifyProc ( unsigned * buildId, unsigned * buildType, unsigned * branchId, - Uuid * productId + plUUID* productId ) { for (;;) { // Get the connType diff --git a/Sources/Plasma/NucleusLib/pnGameMgr/BlueSpiral/pnGmBlueSpiral.h b/Sources/Plasma/NucleusLib/pnGameMgr/BlueSpiral/pnGmBlueSpiral.h index 3210c765..fd8754fd 100644 --- a/Sources/Plasma/NucleusLib/pnGameMgr/BlueSpiral/pnGmBlueSpiral.h +++ b/Sources/Plasma/NucleusLib/pnGameMgr/BlueSpiral/pnGmBlueSpiral.h @@ -68,7 +68,7 @@ enum EBlueSpiralInitResult { // Game type id //============================================================================ -const Uuid kGameTypeId_BlueSpiral = Uuid(L"5ff98165-913e-4fd1-a2c2-9c7f31be2cc8"); +const plUUID kGameTypeId_BlueSpiral("5ff98165-913e-4fd1-a2c2-9c7f31be2cc8"); //============================================================================ diff --git a/Sources/Plasma/NucleusLib/pnGameMgr/ClimbingWall/pnGmClimbingWall.h b/Sources/Plasma/NucleusLib/pnGameMgr/ClimbingWall/pnGmClimbingWall.h index 9afccb28..0e89dc1b 100644 --- a/Sources/Plasma/NucleusLib/pnGameMgr/ClimbingWall/pnGmClimbingWall.h +++ b/Sources/Plasma/NucleusLib/pnGameMgr/ClimbingWall/pnGmClimbingWall.h @@ -75,7 +75,7 @@ const int kClimbingWallNoBlocker = -1; // the value of a slot in the blocker arr // Game type id //============================================================================ -const Uuid kGameTypeId_ClimbingWall = Uuid(L"6224cdf4-3556-4740-b7cd-d637562d07be"); +const plUUID kGameTypeId_ClimbingWall("6224cdf4-3556-4740-b7cd-d637562d07be"); //============================================================================ diff --git a/Sources/Plasma/NucleusLib/pnGameMgr/Heek/pnGmHeek.h b/Sources/Plasma/NucleusLib/pnGameMgr/Heek/pnGmHeek.h index 6511680e..fdaa8ba7 100644 --- a/Sources/Plasma/NucleusLib/pnGameMgr/Heek/pnGmHeek.h +++ b/Sources/Plasma/NucleusLib/pnGameMgr/Heek/pnGmHeek.h @@ -91,7 +91,7 @@ enum EHeekCountdownState { // Game type id //============================================================================ -const Uuid kGameTypeId_Heek = Uuid(L"9d83c2e2-7835-4477-9aaa-22254c59a753"); +const plUUID kGameTypeId_Heek("9d83c2e2-7835-4477-9aaa-22254c59a753"); //============================================================================ diff --git a/Sources/Plasma/NucleusLib/pnGameMgr/Marker/pnGmMarker.h b/Sources/Plasma/NucleusLib/pnGameMgr/Marker/pnGmMarker.h index a90f39ae..419a4035 100644 --- a/Sources/Plasma/NucleusLib/pnGameMgr/Marker/pnGmMarker.h +++ b/Sources/Plasma/NucleusLib/pnGameMgr/Marker/pnGmMarker.h @@ -75,7 +75,7 @@ enum EMarkerGameType { // Game type id //============================================================================ -const Uuid kGameTypeId_Marker = Uuid(L"000b2c39-0319-4be1-b06c-7a105b160fcf"); +const plUUID kGameTypeId_Marker("000b2c39-0319-4be1-b06c-7a105b160fcf"); //============================================================================ diff --git a/Sources/Plasma/NucleusLib/pnGameMgr/Pch.h b/Sources/Plasma/NucleusLib/pnGameMgr/Pch.h index 78a46e76..b9049068 100644 --- a/Sources/Plasma/NucleusLib/pnGameMgr/Pch.h +++ b/Sources/Plasma/NucleusLib/pnGameMgr/Pch.h @@ -54,6 +54,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pnUtils/pnUtils.h" #include "pnNetBase/pnNetBase.h" #include "pnProduct/pnProduct.h" +#include "pnUUID/pnUUID.h" #include "pnGameMgr.h" #include "Intern.h" diff --git a/Sources/Plasma/NucleusLib/pnGameMgr/TicTacToe/pnGmTicTacToe.h b/Sources/Plasma/NucleusLib/pnGameMgr/TicTacToe/pnGmTicTacToe.h index 68e85305..4b261363 100644 --- a/Sources/Plasma/NucleusLib/pnGameMgr/TicTacToe/pnGmTicTacToe.h +++ b/Sources/Plasma/NucleusLib/pnGameMgr/TicTacToe/pnGmTicTacToe.h @@ -74,7 +74,7 @@ enum ETTTGameResult { // Game type id //============================================================================ -const Uuid kGameTypeId_TicTacToe = Uuid(L"a7236529-11d8-4758-9368-59cb43445a83"); +const plUUID kGameTypeId_TicTacToe("a7236529-11d8-4758-9368-59cb43445a83"); //============================================================================ diff --git a/Sources/Plasma/NucleusLib/pnGameMgr/VarSync/pnGmVarSync.h b/Sources/Plasma/NucleusLib/pnGameMgr/VarSync/pnGmVarSync.h index 892a62d7..4aea2833 100644 --- a/Sources/Plasma/NucleusLib/pnGameMgr/VarSync/pnGmVarSync.h +++ b/Sources/Plasma/NucleusLib/pnGameMgr/VarSync/pnGmVarSync.h @@ -68,7 +68,7 @@ enum EVarSyncInitResult { // Game type id //============================================================================ -const Uuid kGameTypeId_VarSync = Uuid(L"475c2e9b-a245-4106-a047-9b25d41ff333"); +const plUUID kGameTypeId_VarSync("475c2e9b-a245-4106-a047-9b25d41ff333"); //============================================================================ diff --git a/Sources/Plasma/NucleusLib/pnGameMgr/pnGameMgr.h b/Sources/Plasma/NucleusLib/pnGameMgr/pnGameMgr.h index 3aa9bd66..e81c8580 100644 --- a/Sources/Plasma/NucleusLib/pnGameMgr/pnGameMgr.h +++ b/Sources/Plasma/NucleusLib/pnGameMgr/pnGameMgr.h @@ -181,7 +181,7 @@ enum { // Cli2Srv struct Cli2Srv_GameMgr_CreateGame : GameMsgHeader { - Uuid gameTypeId; + plUUID gameTypeId; uint32_t createOptions; uint32_t createDataBytes; uint8_t createData[1]; // [createDataBytes] @@ -190,7 +190,7 @@ enum { // Field ordering here is vitally important, see pfGameMgr::JoinGame for explanation uint32_t newGameId; uint32_t createOptions; - Uuid gameTypeId; + plUUID gameTypeId; uint32_t createDataBytes; uint8_t createData[1]; // [createDataBytes] }; @@ -199,17 +199,17 @@ enum { struct Srv2Cli_GameMgr_GameInstance : GameMsgHeader { EGameJoinError result; uint32_t ownerId; - Uuid gameTypeId; + plUUID gameTypeId; uint32_t newGameId; }; struct Srv2Cli_GameMgr_InviteReceived : GameMsgHeader { uint32_t inviterId; - Uuid gameTypeId; + plUUID gameTypeId; uint32_t newGameId; }; struct Srv2Cli_GameMgr_InviteRevoked : GameMsgHeader { uint32_t inviterId; - Uuid gameTypeId; + plUUID gameTypeId; uint32_t newGameId; }; diff --git a/Sources/Plasma/NucleusLib/pnNetCli/pnNcCli.cpp b/Sources/Plasma/NucleusLib/pnNetCli/pnNcCli.cpp index a50f308c..ee941c87 100644 --- a/Sources/Plasma/NucleusLib/pnNetCli/pnNcCli.cpp +++ b/Sources/Plasma/NucleusLib/pnNetCli/pnNcCli.cpp @@ -49,6 +49,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #pragma hdrstop #include "pnEncryption/plChallengeHash.h" +#include "pnUUID/pnUUID.h" //#define NCCLI_DEBUGGING #ifdef NCCLI_DEBUGGING @@ -112,7 +113,7 @@ enum ENetCliMode { ***/ // connection structure attached to each socket -struct NetCli : THashKeyVal { +struct NetCli { // communication channel AsyncSocket sock; @@ -917,7 +918,6 @@ static NetCli * ConnCreate ( cli->protocol = (ENetProtocol) protocol; cli->channel = channel; cli->mode = mode; - cli->SetValue(kNilGuid); #if !defined(PLASMA_EXTERNAL_RELEASE) && defined(HS_BUILD_FOR_WIN32) // Network debug pipe diff --git a/Sources/Plasma/NucleusLib/pnNetCommon/pnNetCommon.cpp b/Sources/Plasma/NucleusLib/pnNetCommon/pnNetCommon.cpp index 3554ebfb..8c34e98a 100644 --- a/Sources/Plasma/NucleusLib/pnNetCommon/pnNetCommon.cpp +++ b/Sources/Plasma/NucleusLib/pnNetCommon/pnNetCommon.cpp @@ -105,25 +105,31 @@ uint32_t GetBinAddr(const char * textAddr) void plCreatableStream::Write( hsStream* stream, hsResMgr* mgr ) { fStream.Rewind(); - std::string buf; + uint32_t len = fStream.GetEOF(); stream->WriteLE( len ); - buf.resize( len ); - fStream.Read( len, (void*)buf.data() ); - stream->Write( len, (const void*)buf.data() ); + + uint8_t* buf = new uint8_t[len]; + fStream.Read(len, (void*)buf); + stream->Write(len, (const void*)buf); + fStream.Rewind(); + delete[] buf; } void plCreatableStream::Read( hsStream* stream, hsResMgr* mgr ) { fStream.Rewind(); - std::string buf; + uint32_t len; stream->LogReadLE( &len,"CreatableStream Len"); - buf.resize( len ); - stream->LogRead( len, (void*)buf.data(),"CreatableStream Data"); - fStream.Write( len, (const void*)buf.data() ); + + uint8_t* buf = new uint8_t[len]; + stream->LogRead(len, (void*)buf, "CreatableStream Data"); + fStream.Write(len, (const void*)buf); + fStream.Rewind(); + delete[] buf; } //////////////////////////////////////////////////////////////////// diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/Pch.h b/Sources/Plasma/NucleusLib/pnNetProtocol/Pch.h index 7799fb55..62e7d06f 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/Pch.h +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/Pch.h @@ -55,6 +55,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pnNetBase/pnNetBase.h" #include "pnAsyncCore/pnAsyncCore.h" #include "pnNetCli/pnNetCli.h" +#include "pnUUID/pnUUID.h" #ifdef SERVER #include "psUtils/psUtils.h" // for SrvMsgHeader, ugh diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2Auth/pnNpCli2Auth.h b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2Auth/pnNpCli2Auth.h index f7fc7024..776ac59f 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2Auth/pnNpCli2Auth.h +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2Auth/pnNpCli2Auth.h @@ -229,7 +229,7 @@ static_assert(kNumAuth2CliMessages <= 0xFFFF, "Auth2Cli message types overflow u struct Cli2Auth_ConnData { uint32_t dataBytes; - Uuid token; + plUUID token; }; struct Cli2Auth_Connect { AsyncSocketConnectPacket hdr; @@ -286,7 +286,7 @@ struct Cli2Auth_AgeRequest { uint32_t messageId; uint32_t transId; wchar_t ageName[kMaxAgeNameLength]; - Uuid ageUuid; + plUUID ageUuid; }; // AcctCreateRequest @@ -307,7 +307,7 @@ struct Cli2Auth_AcctCreateFromKeyRequest { uint32_t transId; wchar_t accountName[kMaxAccountNameLength]; ShaDigest namePassHash; - Uuid key; + plUUID key; uint32_t billingType; }; @@ -375,7 +375,7 @@ extern const NetMsg kNetMsg_Cli2Auth_AcctActivateRequest; struct Cli2Auth_AcctActivateRequest { uint32_t messageId; uint32_t transId; - Uuid activationKey; + plUUID activationKey; }; // FileListRequest @@ -435,7 +435,7 @@ struct Cli2Auth_VaultNodeSave { uint32_t messageId; uint32_t transId; uint32_t nodeId; - Uuid revisionId; + plUUID revisionId; uint32_t nodeBytes; uint8_t nodeBuffer[1]; }; @@ -462,8 +462,8 @@ extern const NetMsg kNetMsg_Cli2Auth_VaultInitAgeRequest; struct Cli2Auth_VaultInitAgeRequest { uint32_t messageId; uint32_t transId; - Uuid ageInstId; - Uuid parentAgeInstId; + plUUID ageInstId; + plUUID parentAgeInstId; wchar_t ageFilename[MAX_PATH]; wchar_t ageInstName[MAX_PATH]; wchar_t ageUserName[MAX_PATH]; @@ -572,7 +572,7 @@ extern const NetMsg kNetMsg_Cli2Auth_SendFriendInviteRequest; struct Cli2Auth_SendFriendInviteRequest { uint32_t messageId; uint32_t transId; - Uuid inviteUuid; + plUUID inviteUuid; wchar_t emailAddress[kMaxEmailAddressLength]; wchar_t toName[kMaxPlayerNameLength]; }; @@ -679,7 +679,7 @@ extern const NetMsg kNetMsg_Auth2Cli_ServerAddr; struct Auth2Cli_ServerAddr { uint32_t messageId; uint32_t srvAddr; - Uuid token; + plUUID token; }; extern const NetMsg kNetMsg_Auth2Cli_NotifyNewBuild; @@ -704,7 +704,7 @@ struct Auth2Cli_AcctLoginReply { uint32_t messageId; uint32_t transId; ENetError result; - Uuid accountId; + plUUID accountId; uint32_t accountFlags; uint32_t billingType; uint32_t encryptionKey[4]; @@ -717,7 +717,7 @@ struct Auth2Cli_AgeReply { uint32_t transId; ENetError result; uint32_t ageMcpId; - Uuid ageInstId; + plUUID ageInstId; uint32_t ageVaultId; uint32_t gameSrvNode; }; @@ -728,7 +728,7 @@ struct Auth2Cli_AcctCreateReply { uint32_t messageId; uint32_t transId; ENetError result; - Uuid accountId; + plUUID accountId; }; // AcctCreateFromKeyReply @@ -737,8 +737,8 @@ struct Auth2Cli_AcctCreateFromKeyReply { uint32_t messageId; uint32_t transId; ENetError result; - Uuid accountId; - Uuid activationKey; + plUUID accountId; + plUUID activationKey; }; // CreatePlayerReply @@ -870,7 +870,7 @@ extern const NetMsg kNetMsg_Auth2Cli_VaultNodeChanged; struct Auth2Cli_VaultNodeChanged { uint32_t messageId; uint32_t nodeId; - Uuid revisionId; + plUUID revisionId; }; extern const NetMsg kNetMsg_Auth2Cli_VaultNodeAdded; diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2Game/pnNpCli2Game.h b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2Game/pnNpCli2Game.h index ac06b83c..b04c2a7e 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2Game/pnNpCli2Game.h +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2Game/pnNpCli2Game.h @@ -97,8 +97,8 @@ static_assert(kNumGame2CliMessages <= 0xFFFF, "Game2Cli message types overflow u struct Cli2Game_ConnData { uint32_t dataBytes; - Uuid accountUuid; - Uuid ageUuid; + plUUID accountUuid; + plUUID ageUuid; }; struct Cli2Game_Connect { AsyncSocketConnectPacket hdr; @@ -125,7 +125,7 @@ struct Cli2Game_JoinAgeRequest { uint32_t messageId; uint32_t transId; uint32_t ageMcpId; - Uuid accountUuid; + plUUID accountUuid; uint32_t playerInt; }; diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2GateKeeper/pnNpCli2GateKeeper.h b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2GateKeeper/pnNpCli2GateKeeper.h index 42810676..f2e1f425 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2GateKeeper/pnNpCli2GateKeeper.h +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2GateKeeper/pnNpCli2GateKeeper.h @@ -89,7 +89,7 @@ static_assert(kNumGateKeeper2CliMessages <= 0xFFFF, "GateKeeper2Cli message type struct Cli2GateKeeper_ConnData { uint32_t dataBytes; - Uuid token; + plUUID token; }; struct Cli2GateKeeper_Connect { diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Db/pnNpSrv2Db.h b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Db/pnNpSrv2Db.h index 3bd0a089..b1cb2c50 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Db/pnNpSrv2Db.h +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Db/pnNpSrv2Db.h @@ -201,7 +201,7 @@ struct Srv2Db_AccountCreateRequest : SrvMsgHeader { struct Srv2Db_AccountCreateFromKeyRequest : SrvMsgHeader { wchar_t accountName[kMaxAccountNameLength]; ShaDigest namePassHash; - Uuid key; + plUUID key; uint32_t billingType; }; @@ -215,7 +215,7 @@ struct Srv2Db_AccountLoginRequest2 : SrvMsgHeader { }; struct Srv2Db_AccountLogout : SrvMsgHeader { - Uuid accountUuid; + plUUID accountUuid; uint32_t timeLoggedMins; }; @@ -235,16 +235,16 @@ struct Srv2Db_AccountSetBillingTypeRequest : SrvMsgHeader { }; struct Srv2Db_AccountActivateRequest : SrvMsgHeader { - Uuid activationKey; + plUUID activationKey; }; struct Srv2Db_AccountLockPlayerNameRequest :SrvMsgHeader { wchar_t playerName[kMaxPlayerNameLength]; - Uuid accountUuid; + plUUID accountUuid; }; struct Srv2Db_VaultNodeCreateRequest : SrvMsgHeader { - Uuid accountUuid; + plUUID accountUuid; uint32_t creatorId; uint32_t nodeBytes; uint8_t nodeBuffer[1]; @@ -256,11 +256,11 @@ struct Srv2Db_VaultNodeFetchRequest : SrvMsgHeader { struct Srv2Db_VaultNodeChanged : SrvMsgHeader { uint32_t nodeId; - Uuid revisionId; + plUUID revisionId; }; struct Srv2Db_VaultNodeSaveRequest : SrvMsgHeader { - Uuid revisionId; + plUUID revisionId; uint32_t nodeId; unsigned playerCheckId; unsigned isRequestFromAuth; @@ -321,7 +321,7 @@ struct Srv2Db_SetAgeSequenceNumRequest : SrvMsgHeader { struct Srv2Db_StateSaveObject : SrvMsgHeader { uint32_t buildId; - Uuid ownerId; + plUUID ownerId; wchar_t objectName[kMaxStateObjectName]; uint32_t objectDataBytes; uint8_t objectData[1]; @@ -329,12 +329,12 @@ struct Srv2Db_StateSaveObject : SrvMsgHeader { }; struct Srv2Db_StateDeleteObject : SrvMsgHeader { - Uuid ownerId; + plUUID ownerId; wchar_t objectName[kMaxStateObjectName]; }; struct Srv2Db_StateFetchObject : SrvMsgHeader { - Uuid ownerId; + plUUID ownerId; wchar_t objectName[kMaxStateObjectName]; }; @@ -400,11 +400,11 @@ struct Srv2Db_PlayerOffline : SrvMsgHeader { }; struct Srv2Db_AgeOnline : SrvMsgHeader { - Uuid ageInstId; + plUUID ageInstId; }; struct Srv2Db_AgeOffline : SrvMsgHeader { - Uuid ageInstId; + plUUID ageInstId; }; struct Srv2Db_CsrAcctInfoRequest : SrvMsgHeader { @@ -412,7 +412,7 @@ struct Srv2Db_CsrAcctInfoRequest : SrvMsgHeader { }; struct Srv2Db_FetchInviterInfo : SrvMsgHeader { - Uuid inviteUuid; + plUUID inviteUuid; }; @@ -427,16 +427,16 @@ struct Db2Srv_AccountExistsReply : SrvMsgHeader { }; struct Db2Srv_AccountCreateReply : SrvMsgHeader { - Uuid accountUuid; + plUUID accountUuid; }; struct Db2Srv_AccountCreateFromKeyReply : SrvMsgHeader { - Uuid accountUuid; - Uuid activationKey; + plUUID accountUuid; + plUUID activationKey; }; struct Db2Srv_AccountLoginReply : SrvMsgHeader { - Uuid accountUuid; + plUUID accountUuid; uint32_t accountFlags; uint32_t billingType; ShaDigest namePassHash; @@ -470,12 +470,12 @@ struct Db2Srv_SetAgeSequenceNumReply : SrvMsgHeader { }; struct Db2Srv_FetchInviterInfoReply : SrvMsgHeader { - Uuid hoodInstance; + plUUID hoodInstance; }; struct Db2Srv_StateObjectFetched : SrvMsgHeader { uint32_t buildId; - Uuid ownerId; + plUUID ownerId; wchar_t objectName[kMaxStateObjectName]; uint32_t objectDataBytes; uint8_t objectData[1]; @@ -484,7 +484,7 @@ struct Db2Srv_StateObjectFetched : SrvMsgHeader { struct Db2Srv_NotifyVaultNodeChanged : SrvMsgHeader { uint32_t nodeId; - Uuid revId; + plUUID revId; uint32_t notifyIdCount; uint32_t notifyIds[1]; }; @@ -545,7 +545,7 @@ struct Db2Srv_ScoreGetRanksReply : SrvMsgHeader { }; struct Db2Srv_CsrAcctInfoReply : SrvMsgHeader { - Uuid csrId; + plUUID csrId; uint32_t csrFlags; ShaDigest namePassHash; }; diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Mcp/pnNpSrv2Mcp.h b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Mcp/pnNpSrv2Mcp.h index 87a00242..d9c9ddeb 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Mcp/pnNpSrv2Mcp.h +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Mcp/pnNpSrv2Mcp.h @@ -125,8 +125,8 @@ struct Srv2Mcp_Connect { struct Srv2Mcp_AgeJoinRequest : SrvMsgHeader { wchar_t ageName[kMaxAgeNameLength]; - Uuid ageUuid; - Uuid accountUuid; + plUUID ageUuid; + plUUID accountUuid; uint32_t playerInt; uint8_t ccrLevel; wchar_t playerName[kMaxPlayerNameLength]; @@ -135,21 +135,21 @@ struct Srv2Mcp_AgeJoinRequest : SrvMsgHeader { struct Srv2Mcp_PlayerLoggedIn : SrvMsgHeader { uint32_t ageMcpId; - Uuid ageUuid; - Uuid accountUuid; + plUUID ageUuid; + plUUID accountUuid; wchar_t playerName[kMaxPlayerNameLength]; uint32_t playerInt; }; struct Srv2Mcp_PlayerLoggedOut : SrvMsgHeader { uint32_t ageMcpId; - Uuid accountUuid; + plUUID accountUuid; uint32_t playerInt; }; struct Srv2Mcp_AgeSpawned : SrvMsgHeader { wchar_t ageName[kMaxAgeNameLength]; - Uuid ageUuid; + plUUID ageUuid; uint32_t buildId; }; @@ -159,15 +159,15 @@ struct Srv2Mcp_AgeDied : SrvMsgHeader { struct Srv2Mcp_AccountLoginRequest : SrvMsgHeader { wchar_t accountName[kMaxAccountNameLength]; - Uuid accountUuid; + plUUID accountUuid; }; struct Srv2Mcp_AccountLogout : SrvMsgHeader { - Uuid accountUuid; + plUUID accountUuid; }; struct Srv2Mcp_AccountSetPlayer : SrvMsgHeader { - Uuid accountUuid; + plUUID accountUuid; uint32_t playerInt; }; @@ -192,14 +192,14 @@ struct Srv2Mcp_KickPlayer : SrvMsgHeader { struct Mcp2Srv_AgeJoinReply : SrvMsgHeader { uint32_t ageMcpId; - Uuid ageUuid; + plUUID ageUuid; uint32_t gameSrvNode; }; struct Mcp2Srv_AgeSpawnRequest : SrvMsgHeader { wchar_t ageName[kMaxAgeNameLength]; uint32_t ageMcpId; - Uuid ageUuid; + plUUID ageUuid; uint32_t buildId; }; @@ -209,15 +209,15 @@ struct Mcp2Srv_AgeUnspawn : SrvMsgHeader { struct Mcp2Srv_AgeAddPlayerRequest : SrvMsgHeader { uint32_t ageMcpId; - Uuid accountUuid; + plUUID accountUuid; uint32_t playerInt; uint8_t ccrLevel; wchar_t playerName[kMaxPlayerNameLength]; }; struct Mcp2Srv_AgeRemovePlayerRequest : SrvMsgHeader { - Uuid ageMcpId; - Uuid accountUuid; + plUUID ageMcpId; + plUUID accountUuid; uint32_t playerInt; }; @@ -230,7 +230,7 @@ struct Mcp2Srv_AccountLoginReply : SrvMsgHeader { }; struct Mcp2Srv_AccountNotifyKicked : SrvMsgHeader { - Uuid accountUuid; + plUUID accountUuid; uint32_t acctMcpId; ENetError reason; }; diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2State/pnNpSrv2State.h b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2State/pnNpSrv2State.h index 31b364e9..5e5c6af4 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2State/pnNpSrv2State.h +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2State/pnNpSrv2State.h @@ -95,12 +95,12 @@ struct Srv2State_Connect { ***/ struct Srv2State_FetchObject : SrvMsgHeader { - Uuid ownerId; + plUUID ownerId; wchar_t objectName[kMaxStateObjectName]; }; struct Srv2State_SaveObject : SrvMsgHeader { - Uuid ownerId; + plUUID ownerId; wchar_t objectName[kMaxStateObjectName]; uint32_t objectDataBytes; uint8_t objectData[1]; // objectData[objectDataBytes], actually @@ -108,7 +108,7 @@ struct Srv2State_SaveObject : SrvMsgHeader { }; struct Srv2State_DeleteObject : SrvMsgHeader { - Uuid ownerId; + plUUID ownerId; wchar_t objectName[kMaxStateObjectName]; }; diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Vault/pnNpSrv2Vault.h b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Vault/pnNpSrv2Vault.h index 1187f2d0..0c808aca 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Vault/pnNpSrv2Vault.h +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Vault/pnNpSrv2Vault.h @@ -169,7 +169,7 @@ struct Srv2Vault_Connect { ***/ struct Srv2Vault_PlayerCreateRequest : SrvMsgHeader { - Uuid accountUuid; + plUUID accountUuid; wchar_t playerName[kMaxPlayerNameLength]; wchar_t avatarShape[MAX_PATH]; wchar_t friendInvite[MAX_PATH]; @@ -177,21 +177,21 @@ struct Srv2Vault_PlayerCreateRequest : SrvMsgHeader { }; struct Srv2Vault_PlayerDeleteRequest : SrvMsgHeader { - Uuid accountId; + plUUID accountId; uint32_t playerId; }; struct Srv2Vault_UpgradeVisitorRequest : SrvMsgHeader { - Uuid accountId; + plUUID accountId; uint32_t playerId; }; struct Srv2Vault_AccountLoginRequest : SrvMsgHeader { - Uuid accountUuid; + plUUID accountUuid; }; struct Srv2Vault_AccountLogout : SrvMsgHeader { - Uuid accountUuid; + plUUID accountUuid; }; struct Srv2Vault_FetchChildNodeRefs : SrvMsgHeader { @@ -204,7 +204,7 @@ struct Srv2Vault_NodeFetch : SrvMsgHeader { }; struct Srv2Vault_CreateNodeRequest : SrvMsgHeader { - Uuid accountId; + plUUID accountId; uint32_t creatorId; uint32_t nodeBytes; uint8_t nodeBuffer[1]; @@ -220,7 +220,7 @@ struct Srv2Vault_NodeSave : SrvMsgHeader { uint32_t nodeId; unsigned playerCheckId; unsigned isRequestFromAuth; - Uuid revisionId; + plUUID revisionId; uint32_t nodeBytes; uint8_t nodeBuffer[1]; }; @@ -229,7 +229,7 @@ struct Srv2Vault_NodeSave2 : SrvMsgHeader { uint32_t nodeId; unsigned playerCheckId; unsigned isRequestFromAuth; - Uuid revisionId; + plUUID revisionId; uint32_t nodeBytes; uint8_t nodeBuffer[1]; }; @@ -270,28 +270,28 @@ struct Srv2Vault_SendNode : SrvMsgHeader { }; struct Srv2Vault_RegisterPlayerVault : SrvMsgHeader { - Uuid accountId; + plUUID accountId; uint32_t playerId; }; struct Srv2Vault_UnregisterPlayerVault : SrvMsgHeader { - Uuid accountId; + plUUID accountId; }; struct Srv2Vault_RegisterAgeVault : SrvMsgHeader { - Uuid accountId; + plUUID accountId; uint32_t ageId; // age's vault node id }; struct Srv2Vault_UnregisterAgeVault : SrvMsgHeader { - Uuid accountId; + plUUID accountId; }; struct Srv2Vault_AgeInitRequest : SrvMsgHeader { - Uuid accountId; + plUUID accountId; uint32_t playerId; - Uuid ageInstId; - Uuid parentAgeInstId; + plUUID ageInstId; + plUUID parentAgeInstId; uint32_t ageLanguage; uint32_t ageSequenceNumber; // packed fields: @@ -318,24 +318,24 @@ struct Srv2Vault_CurrentPopulationReply : SrvMsgHeader { }; struct Srv2Vault_ChangePlayerNameRequest : SrvMsgHeader { - Uuid accountId; + plUUID accountId; uint32_t playerId; wchar_t newName[kMaxPlayerNameLength]; }; struct Srv2Vault_AccountOnline : SrvMsgHeader { - Uuid acctId; + plUUID acctId; uint32_t buildId; uint32_t authNode; }; struct Srv2Vault_AccountOffline : SrvMsgHeader { - Uuid acctId; + plUUID acctId; uint32_t buildId; }; struct Srv2Vault_PlayerOnline : SrvMsgHeader { - Uuid acctId; + plUUID acctId; uint32_t buildId; uint32_t playerId; }; @@ -346,19 +346,19 @@ struct Srv2Vault_PlayerOffline : SrvMsgHeader { }; struct Srv2Vault_AgeOnline : SrvMsgHeader { - Uuid ageInstId; + plUUID ageInstId; uint32_t buildId; uint32_t gameNode; }; struct Srv2Vault_AgeOffline : SrvMsgHeader { - Uuid ageInstId; + plUUID ageInstId; uint32_t buildId; }; struct Srv2Vault_PlayerJoinedAge : SrvMsgHeader { uint32_t playerId; - Uuid ageInstId; + plUUID ageInstId; uint32_t buildId; }; @@ -400,24 +400,24 @@ struct Vault2Srv_NodeCreated : SrvMsgHeader { struct Vault2Srv_NodeChanged : SrvMsgHeader { uint32_t nodeId; - Uuid revisionId; - Uuid accountId; // the notify target + plUUID revisionId; + plUUID accountId; // the notify target }; struct Vault2Srv_NodeAdded : SrvMsgHeader { NetVaultNodeRef ref; - Uuid accountId; // the notify target + plUUID accountId; // the notify target }; struct Vault2Srv_NodeRemoved : SrvMsgHeader { uint32_t parentId; uint32_t childId; - Uuid accountId; // the notify target + plUUID accountId; // the notify target }; struct Vault2Srv_NodeDeleted : SrvMsgHeader { uint32_t nodeId; - Uuid accountId; // the notify target + plUUID accountId; // the notify target }; struct Vault2Srv_NodeFindReply : SrvMsgHeader { @@ -430,7 +430,7 @@ struct Vault2Srv_NodeFindReply : SrvMsgHeader { struct Vault2Srv_AgeInitReply : SrvMsgHeader { uint32_t ageNodeId; uint32_t ageInfoNodeId; - Uuid accountId; // the requestor + plUUID accountId; // the requestor }; struct Vault2Srv_PublicAgeList : SrvMsgHeader { @@ -441,12 +441,12 @@ struct Vault2Srv_PublicAgeList : SrvMsgHeader { struct Vault2Srv_NotifyAgeSDLChanged : SrvMsgHeader { wchar_t ageName[kMaxAgeNameLength]; - Uuid ageInstId; + plUUID ageInstId; }; struct Vault2Srv_CurrentPopulationRequest : SrvMsgHeader { uint32_t ageCount; - Uuid ageInstIds[1]; // [ageCount], actually + plUUID ageInstIds[1]; // [ageCount], actually // no more fields after var length alloc }; diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.cpp b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.cpp index a48aa22f..51ffd96e 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.cpp +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.cpp @@ -42,10 +42,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com /***************************************************************************** * * $/Plasma20/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.cpp -* +* ***/ #include "../Pch.h" +#include "pnUUID/pnUUID.h" #pragma hdrstop @@ -599,8 +600,8 @@ void NetVaultNode::CopyFrom (const NetVaultNode * other, unsigned copyOpts) { _ZERO(kCreateTime, IVaultNodeSetValue, createTime, (unsigned)0); _ZERO(kModifyTime, IVaultNodeSetValue, modifyTime, (unsigned)0); _ZEROSTRING(kCreateAgeName, IVaultNodeSetString, createAgeName, L""); - _ZERO(kCreateAgeUuid, IVaultNodeSetValue, createAgeUuid, kNilGuid); - _ZERO(kCreatorAcct, IVaultNodeSetValue, creatorAcct, kNilGuid); + _ZERO(kCreateAgeUuid, IVaultNodeSetValue, createAgeUuid, kNilUuid); + _ZERO(kCreatorAcct, IVaultNodeSetValue, creatorAcct, kNilUuid); _ZERO(kCreatorId, IVaultNodeSetValue, creatorId, (unsigned)0); _ZERO(kNodeType, IVaultNodeSetValue, nodeType, (unsigned)0); _ZERO(kInt32_1, IVaultNodeSetValue, int32_1, (signed)0); @@ -611,10 +612,10 @@ void NetVaultNode::CopyFrom (const NetVaultNode * other, unsigned copyOpts) { _ZERO(kUInt32_2, IVaultNodeSetValue, uint32_2, (unsigned)0); _ZERO(kUInt32_3, IVaultNodeSetValue, uint32_3, (unsigned)0); _ZERO(kUInt32_4, IVaultNodeSetValue, uint32_4, (unsigned)0); - _ZERO(kUuid_1, IVaultNodeSetValue, uuid_1, kNilGuid); - _ZERO(kUuid_2, IVaultNodeSetValue, uuid_2, kNilGuid); - _ZERO(kUuid_3, IVaultNodeSetValue, uuid_3, kNilGuid); - _ZERO(kUuid_4, IVaultNodeSetValue, uuid_4, kNilGuid); + _ZERO(kUuid_1, IVaultNodeSetValue, uuid_1, kNilUuid); + _ZERO(kUuid_2, IVaultNodeSetValue, uuid_2, kNilUuid); + _ZERO(kUuid_3, IVaultNodeSetValue, uuid_3, kNilUuid); + _ZERO(kUuid_4, IVaultNodeSetValue, uuid_4, kNilUuid); _ZEROSTRING(kString64_1, IVaultNodeSetString, string64_1, L""); _ZEROSTRING(kString64_2, IVaultNodeSetString, string64_2, L""); _ZEROSTRING(kString64_3, IVaultNodeSetString, string64_3, L""); @@ -706,12 +707,12 @@ void NetVaultNode::SetCreateAgeName (const wchar_t v[]) { } //============================================================================ -void NetVaultNode::SetCreateAgeUuid (const Uuid & v) { +void NetVaultNode::SetCreateAgeUuid (const plUUID& v) { IVaultNodeSetValue(kCreateAgeUuid, this, &createAgeUuid, v); } //============================================================================ -void NetVaultNode::SetCreatorAcct (const Uuid & v) { +void NetVaultNode::SetCreatorAcct (const plUUID& v) { IVaultNodeSetValue(kCreatorAcct, this, &creatorAcct, v); } @@ -766,22 +767,22 @@ void NetVaultNode::SetUInt32_4 (unsigned v) { } //============================================================================ -void NetVaultNode::SetUuid_1 (const Uuid & v) { +void NetVaultNode::SetUuid_1 (const plUUID& v) { IVaultNodeSetValue(kUuid_1, this, &uuid_1, v); } //============================================================================ -void NetVaultNode::SetUuid_2 (const Uuid & v) { +void NetVaultNode::SetUuid_2 (const plUUID& v) { IVaultNodeSetValue(kUuid_2, this, &uuid_2, v); } //============================================================================ -void NetVaultNode::SetUuid_3 (const Uuid & v) { +void NetVaultNode::SetUuid_3 (const plUUID& v) { IVaultNodeSetValue(kUuid_3, this, &uuid_3, v); } //============================================================================ -void NetVaultNode::SetUuid_4 (const Uuid & v) { +void NetVaultNode::SetUuid_4 (const plUUID& v) { IVaultNodeSetValue(kUuid_4, this, &uuid_4, v); } @@ -976,7 +977,7 @@ void NetVaultNodeFieldArray::GetFieldValueString_LCS ( case NetVaultNode::kUuid_2: case NetVaultNode::kUuid_3: case NetVaultNode::kUuid_4: { - plString tmp = plUUID(fieldAddr).AsString(); + plString tmp = plUUID((char*)fieldAddr).AsString(); StrPrintf(dst, dstChars, L"hextoraw('%s')", tmp.c_str()); } diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.h b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.h index 1a3cef0c..5680d093 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.h +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.h @@ -50,6 +50,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #endif #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNNETPROTOCOL_PRIVATE_PNNPCOMMON_H +#include "pnUUID/pnUUID.h" + /***************************************************************************** * @@ -62,7 +64,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com 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 kNetMsgFieldUuid = NET_MSG_FIELD_DATA(sizeof(plUUID)); const NetMsgField kNetMsgFieldTransId = NET_MSG_FIELD_DWORD(); const NetMsgField kNetMsgFieldTimeMs = NET_MSG_FIELD_DWORD(); const NetMsgField kNetMsgFieldENetError = NET_MSG_FIELD_DWORD(); @@ -96,7 +98,7 @@ struct SrvPlayerInfo { ***/ struct NetAgeInfo { - Uuid ageInstId; + plUUID ageInstId; wchar_t ageFilename[kMaxAgeNameLength]; wchar_t ageInstName[kMaxAgeNameLength]; wchar_t ageUserName[kMaxAgeNameLength]; @@ -209,7 +211,7 @@ struct NetVaultNode : AtomicRef { uint64_t fieldFlags; uint64_t dirtyFlags; - Uuid revisionId; + plUUID revisionId; // Treat these as read-only or node flag fields will become invalid // Threaded apps: Must be accessed with node->critsect locked @@ -217,8 +219,8 @@ struct NetVaultNode : AtomicRef { unsigned createTime; unsigned modifyTime; wchar_t * createAgeName; - Uuid createAgeUuid; - Uuid creatorAcct; // accountId of node creator + plUUID createAgeUuid; + plUUID creatorAcct; // accountId of node creator unsigned creatorId; // playerId of node creator unsigned nodeType; int int32_1; @@ -229,10 +231,10 @@ struct NetVaultNode : AtomicRef { unsigned uint32_2; unsigned uint32_3; unsigned uint32_4; - Uuid uuid_1; - Uuid uuid_2; - Uuid uuid_3; - Uuid uuid_4; + plUUID uuid_1; + plUUID uuid_2; + plUUID uuid_3; + plUUID uuid_4; wchar_t * string64_1; wchar_t * string64_2; wchar_t * string64_3; @@ -261,8 +263,8 @@ struct NetVaultNode : AtomicRef { void SetCreateTime (unsigned v); void SetModifyTime (unsigned v); void SetCreateAgeName (const wchar_t v[]); - void SetCreateAgeUuid (const Uuid & v); - void SetCreatorAcct (const Uuid & v); + void SetCreateAgeUuid (const plUUID& v); + void SetCreatorAcct (const plUUID& v); void SetCreatorId (unsigned v); void SetNodeType (unsigned v); void SetInt32_1 (int v); @@ -273,10 +275,10 @@ struct NetVaultNode : AtomicRef { 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 SetUuid_1 (const plUUID& v); + void SetUuid_2 (const plUUID& v); + void SetUuid_3 (const plUUID& v); + void SetUuid_4 (const plUUID& v); void SetString64_1 (const wchar_t v[]); void SetString64_2 (const wchar_t v[]); void SetString64_3 (const wchar_t v[]); @@ -298,8 +300,8 @@ struct NetVaultNode : AtomicRef { inline unsigned GetCreateTime () const { return createTime; } inline unsigned GetModifyTime () const { return modifyTime; } inline wchar_t * GetCreateAgeName () const { return createAgeName; } - inline Uuid GetCreateAgeUuid () const { return createAgeUuid; } - inline Uuid GetCreatorAcct () const { return creatorAcct; } + inline plUUID GetCreateAgeUuid () const { return createAgeUuid; } + inline plUUID GetCreatorAcct () const { return creatorAcct; } inline unsigned GetCreatorId () const { return creatorId; } inline unsigned GetNodeType () const { return nodeType; } inline int GetInt32_1 () const { return int32_1; } @@ -310,10 +312,10 @@ struct NetVaultNode : AtomicRef { 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 plUUID GetUuid_1 () const { return uuid_1; } + inline plUUID GetUuid_2 () const { return uuid_2; } + inline plUUID GetUuid_3 () const { return uuid_3; } + inline plUUID GetUuid_4 () const { return uuid_4; } inline wchar_t * GetString64_1 () const { return string64_1; } inline wchar_t * GetString64_2 () const { return string64_2; } inline wchar_t * GetString64_3 () const { return string64_3; } diff --git a/Sources/Plasma/NucleusLib/pnUUID/pnUUID.cpp b/Sources/Plasma/NucleusLib/pnUUID/pnUUID.cpp index ca27ff5a..05bbc5ca 100644 --- a/Sources/Plasma/NucleusLib/pnUUID/pnUUID.cpp +++ b/Sources/Plasma/NucleusLib/pnUUID/pnUUID.cpp @@ -42,6 +42,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pnUUID.h" #include "hsStream.h" +const plUUID kNilUuid; + plUUID::plUUID() { Clear(); @@ -57,11 +59,6 @@ plUUID::plUUID(const plUUID& other) CopyFrom(&other); } -plUUID::plUUID(const Uuid& uuid) -{ - memcpy(fData, uuid.data, sizeof(fData)); -} - void plUUID::Read(hsStream* s) { s->LogSubStreamPushDesc("plUUID"); @@ -79,10 +76,3 @@ plString plUUID::AsString() const ToString(str); return str; } - -plUUID::operator Uuid () const -{ - Uuid uuid; - memcpy(uuid.data, fData, sizeof(uuid.data)); - return uuid; -} diff --git a/Sources/Plasma/NucleusLib/pnUUID/pnUUID.h b/Sources/Plasma/NucleusLib/pnUUID/pnUUID.h index 890f6294..d9ac5849 100644 --- a/Sources/Plasma/NucleusLib/pnUUID/pnUUID.h +++ b/Sources/Plasma/NucleusLib/pnUUID/pnUUID.h @@ -43,10 +43,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define pnUUID_h_inc #include "HeadSpin.h" -#include "pnUtils/pnUtUuid.h" +#include "plString.h" class hsStream; -class plString; + +extern const class plUUID kNilUuid; class plUUID { @@ -63,7 +64,6 @@ public: plUUID(); plUUID(const plString& s); plUUID(const plUUID& other); - plUUID(const Uuid& uuid); void Clear(); bool IsNull() const; @@ -92,7 +92,6 @@ public: return CompareTo(&other) == -1; } operator plString (void) const { return AsString(); } - operator Uuid () const; static plUUID Generate(); }; diff --git a/Sources/Plasma/NucleusLib/pnUUID/pnUUID_Unix.cpp b/Sources/Plasma/NucleusLib/pnUUID/pnUUID_Unix.cpp index 7cc270e7..2154bfa1 100644 --- a/Sources/Plasma/NucleusLib/pnUUID/pnUUID_Unix.cpp +++ b/Sources/Plasma/NucleusLib/pnUUID/pnUUID_Unix.cpp @@ -64,7 +64,7 @@ struct plUUIDHelper void plUUID::Clear() { uuid_t g; - plUUIDHelper::CopyToNative( g, this ); + //plUUIDHelper::CopyToNative( g, this ); uuid_clear( g ); plUUIDHelper::CopyToPlasma( this, g ); } @@ -98,11 +98,16 @@ bool plUUID::IsEqualTo( const plUUID * v ) const bool plUUID::FromString( const char * str ) { Clear(); - if ( !str ) + if (!str) { return false; + } + uuid_t g; - uuid_parse( str, g ); - plUUIDHelper::CopyToPlasma( this, g ); + if (uuid_parse(str, g) != 0) { + return false; + } + + plUUIDHelper::CopyToPlasma(this, g); return true; } diff --git a/Sources/Plasma/NucleusLib/pnUtils/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnUtils/CMakeLists.txt index 3e46f898..ab6c127e 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnUtils/CMakeLists.txt @@ -19,7 +19,6 @@ set(pnUtils_HEADERS pnUtSort.h pnUtStr.h pnUtTime.h - pnUtUuid.h ) set(pnUtils_SOURCES @@ -32,7 +31,6 @@ set(pnUtils_SOURCES pnUtPath.cpp pnUtStr.cpp pnUtTime.cpp - pnUtUuid.cpp ) if(WIN32) @@ -40,12 +38,10 @@ if(WIN32) Win32/pnUtW32Misc.cpp Win32/pnUtW32Path.cpp Win32/pnUtW32Str.cpp - Win32/pnUtW32Uuid.cpp ) else() set(pnUtils_UNIX Unix/pnUtUxStr.cpp - Unix/pnUtUxUuid.cpp ) endif() diff --git a/Sources/Plasma/NucleusLib/pnUtils/Unix/pnUtUxUuid.cpp b/Sources/Plasma/NucleusLib/pnUtils/Unix/pnUtUxUuid.cpp deleted file mode 100644 index 9e286384..00000000 --- a/Sources/Plasma/NucleusLib/pnUtils/Unix/pnUtUxUuid.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/*==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 . - -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/pnUtils/Private/Unix/pnUtUxUuid.cpp -* -***/ - -#include "../pnUtUuid.h" - -/***************************************************************************** -* -* Uuid Unix implementation -* -***/ - -#ifdef HS_BUILD_FOR_UNIX - -#include - -static_assert(sizeof(Uuid) >= sizeof(uuid_t), "UUID size does not match uuid_t"); - -#else - -// Dummy function to prevent a linker warning complaining about no public symbols if the -// contents of the file get compiled out via pre-processor -void UxUuidPreventLNK4221Warning () { -} - -#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Uuid.cpp b/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Uuid.cpp deleted file mode 100644 index 24ce023a..00000000 --- a/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Uuid.cpp +++ /dev/null @@ -1,150 +0,0 @@ -/*==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 . - -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/pnUtils/Private/Win32/pnUtW32Uuid.cpp -* -***/ - -#include "../pnUtils.h" -#include -#include - -#if 0 - -void Uuid::Clear() -{ - UuidCreateNil( (GUID *)this ); -} - -int Uuid::CompareTo( const Uuid * v ) const -{ - RPC_STATUS s; - return UuidCompare( (GUID *)this, (GUID *)v, &s ); -} - -bool Uuid::IsEqualTo( const Uuid * v ) const -{ - return ( CompareTo( v )==0 ); -} - -void Uuid::CopyFrom( const Uuid * v ) -{ - memcpy( (void*)fData, (const void*)v->fData, sizeof(fData) ); -} - -bool Uuid::IsNull() const -{ - RPC_STATUS s; - return 1 == UuidIsNil( (GUID *)this, &s ); -} - -bool Uuid::FromString( const char * str ) -{ - Clear(); - if ( !str ) - return false; - return RPC_S_OK == UuidFromString( (unsigned char *)str, (GUID *)this ); -} - -bool Uuid::ToString( std::string & out ) const -{ - out = ""; - unsigned char * ubuf; - RPC_STATUS s; - s = UuidToString( (GUID *) this, &ubuf ); - bool success = ( s==RPC_S_OK ); - if ( success ) - out = (char*)ubuf; - RpcStringFree( &ubuf ); - return success; -} - -// static -Uuid Uuid::Generate() -{ - Uuid result; - UuidCreate( (GUID *)&result ); - return result; -} - -#endif - - -#ifdef HS_BUILD_FOR_WIN32 - -/***************************************************************************** -* -* Exports -* -***/ - -static_assert(sizeof(Uuid) >= sizeof(GUID), "pnUtils Uuid and Win32 GUID types differ in size"); - - - -//============================================================================ -bool GuidFromString (const wchar_t str[], Uuid * uuid) { - ASSERT(uuid); - static_assert(sizeof(wchar_t) == sizeof(unsigned short), "Wchar is not an uint16"); - return RPC_S_OK == UuidFromStringW((unsigned short *) str, (GUID *) uuid); -} - -//============================================================================ -bool GuidFromString (const char str[], Uuid * uuid) { - ASSERT(uuid); - return RPC_S_OK == UuidFromStringA((unsigned char *) str, (GUID *) uuid); -} - -//============================================================================ -int GuidCompare (const Uuid & a, const Uuid & b) { - RPC_STATUS s; - return UuidCompare((GUID *)&a, (GUID *)&b, &s); -} - -//============================================================================ -bool GuidIsNil (const Uuid & uuid) { - RPC_STATUS s; - return 1 == UuidIsNil((GUID *)&uuid, &s ); -} - -#endif // HS_BUILD_FOR_WIN32 diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtAllIncludes.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtAllIncludes.h index 3b7bda2d..fc83886e 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtAllIncludes.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtAllIncludes.h @@ -51,7 +51,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pnUtCoreLib.h" // must be first in list #include "pnUtPragma.h" -#include "pnUtUuid.h" #include "pnUtSort.h" #include "pnUtArray.h" #include "pnUtList.h" diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtUuid.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtUuid.cpp deleted file mode 100644 index 4745c3da..00000000 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtUuid.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/*==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 . - -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/pnUtils/Private/pnUtUuid.cpp -* -***/ - -#include "pnUtUuid.h" -#include "pnUtHash.h" -#include "pnUtStr.h" - - -const Uuid kNilGuid; - - -/***************************************************************************** -* -* Exports -* -***/ - -//============================================================================ -Uuid::Uuid (const wchar_t str[]) { - - GuidFromString(str, this); -} diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtUuid.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtUuid.h deleted file mode 100644 index daae5008..00000000 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtUuid.h +++ /dev/null @@ -1,110 +0,0 @@ -/*==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 . - -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/pnUtils/Private/pnUtUuid.h -* -***/ - -#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTUUID_H -#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTUUID_H - -#include "Pch.h" - -/***************************************************************************** -* -* Types -* -***/ - -struct Uuid; - -/***************************************************************************** -* -* Constants -* -***/ - -extern const Uuid kNilGuid; - - -/***************************************************************************** -* -* Functions -* -***/ - -// Using 'Guid' here instead of 'Uuid' to avoid name clash with windows API =( - -bool GuidFromString (const wchar_t str[], Uuid * uuid); -bool GuidFromString (const char str[], Uuid * uuid); -int GuidCompare (const Uuid & a, const Uuid & b); -inline bool GuidsAreEqual (const Uuid & a, const Uuid & b) { return 0 == GuidCompare(a, b); } -bool GuidIsNil (const Uuid & uuid); - - -/***************************************************************************** -* -* Uuid -* -***/ - -#pragma pack(push, 1) -struct Uuid { - union { - uint32_t uint32_ts[4]; - uint8_t data[16]; - }; - - Uuid () {} - Uuid (const wchar_t str[]); - operator bool () const { return !GuidIsNil(*this); } - inline bool operator ! () const { return GuidIsNil(*this); } - inline bool operator < (const Uuid & rhs) const { return GuidCompare(*this, rhs) < 0; } - inline bool operator == (const Uuid & rhs) const { return GuidsAreEqual(*this, rhs); } - inline bool operator == (int rhs) const { ASSERT(!rhs); return GuidsAreEqual(*this, kNilGuid); } - inline bool operator != (const Uuid & rhs) const { return !GuidsAreEqual(*this, rhs); } - inline bool operator != (int rhs) const { ASSERT(!rhs); return !GuidsAreEqual(*this, kNilGuid); } -}; -#pragma pack(pop) - -#endif diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMsgHandler.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMsgHandler.cpp index c15f9e6a..80275072 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMsgHandler.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMsgHandler.cpp @@ -261,7 +261,7 @@ MSG_HANDLER_DEFN(plNetClientMsgHandler,plNetMsgSDLState) nc->ErrorMsg(err.c_str()); // Post Quit message - nc->QueueDisableNet(true, "SDL Desc Problem"); + nc->QueueDisableNet(true, "SDL Desc Problem"); delete sdRec; } else if( sdRec->Read( &stream, 0, rwFlags ) ) diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp index 3948eae6..23c4fc72 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp @@ -419,7 +419,7 @@ void plNetLinkingMgr::IDoLink(plLinkToAgeMsg* msg) // Queue join op NlmJoinAgeOp * joinAgeOp = NEWZERO(NlmJoinAgeOp); - joinAgeOp->age.ageInstId = (Uuid) *GetAgeLink()->GetAgeInfo()->GetAgeInstanceGuid(); + joinAgeOp->age.ageInstId = *GetAgeLink()->GetAgeInfo()->GetAgeInstanceGuid(); StrCopy( joinAgeOp->age.ageDatasetName, GetAgeLink()->GetAgeInfo()->GetAgeFilename(), @@ -768,7 +768,7 @@ void plNetLinkingMgr::IPostProcessLink( void ) if (RelVaultNode* rvnInfo = VaultGetPlayerInfoNodeIncRef()) { VaultPlayerInfoNode accInfo(rvnInfo); wchar_t ageInstName[MAX_PATH]; - Uuid ageInstGuid = *info->GetAgeInstanceGuid(); + plUUID ageInstGuid = *info->GetAgeInstanceGuid(); StrToUnicode(ageInstName, info->GetAgeInstanceName(), arrsize(ageInstName)); accInfo.SetAgeInstName(ageInstName); accInfo.SetAgeInstUuid(ageInstGuid); @@ -863,7 +863,7 @@ uint8_t plNetLinkingMgr::IPreProcessLink(void) if (RelVaultNode * rvnInfo = VaultGetPlayerInfoNodeIncRef()) { VaultPlayerInfoNode accInfo(rvnInfo); accInfo.SetAgeInstName(nil); - accInfo.SetAgeInstUuid(kNilGuid); + accInfo.SetAgeInstUuid(kNilUuid); accInfo.SetOnline(false); rvnInfo->DecRef(); } @@ -872,7 +872,7 @@ uint8_t plNetLinkingMgr::IPreProcessLink(void) if (RelVaultNode * rvnInfo = VaultGetPlayerInfoNodeIncRef()) { VaultPlayerInfoNode accInfo(rvnInfo); wchar_t ageInstName[MAX_PATH]; - Uuid ageInstGuid = *GetAgeLink()->GetAgeInfo()->GetAgeInstanceGuid(); + plUUID ageInstGuid = *GetAgeLink()->GetAgeInfo()->GetAgeInstanceGuid(); StrToUnicode(ageInstName, info->GetAgeInstanceName(), arrsize(ageInstName)); accInfo.SetAgeInstName(ageInstName); accInfo.SetAgeInstUuid(ageInstGuid); diff --git a/Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.cpp b/Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.cpp index 99728029..a8c70264 100644 --- a/Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.cpp @@ -121,7 +121,7 @@ static wchar_t s_iniAuthToken[kMaxPublisherAuthKeyLength]; static wchar_t s_iniOS[kMaxGTOSIdLength]; static bool s_iniReadAccountInfo = true; static wchar_t s_iniStartupAgeName[kMaxAgeNameLength]; -static Uuid s_iniStartupAgeInstId; +static plUUID s_iniStartupAgeInstId; static wchar_t s_iniStartupPlayerName[kMaxPlayerNameLength]; static bool s_netError = false; @@ -382,7 +382,7 @@ static void INetCliAuthLoginSetPlayerRequestCallback ( static void INetCliAuthLoginRequestCallback ( ENetError result, void * param, - const Uuid & accountUuid, + const plUUID& accountUuid, unsigned accountFlags, unsigned billingType, const NetCliAuthPlayerInfo playerInfoArr[], @@ -417,7 +417,7 @@ static void INetCliAuthLoginRequestCallback ( } } else - s_account.accountUuid = kNilGuid; + s_account.accountUuid = kNilUuid; // If they specified an alternate age, but we couldn't find the player, force // the StartUp age to load so that they may select/create a player first. @@ -590,7 +590,7 @@ static void INetCliAuthAgeRequestCallback ( void * param, unsigned ageMcpId, unsigned ageVaultId, - const Uuid & ageInstId, + const plUUID& ageInstId, plNetAddress gameAddr ) { if (!IS_NET_ERROR(result) || result == kNetErrVaultNodeNotFound) { @@ -598,7 +598,7 @@ static void INetCliAuthAgeRequestCallback ( s_age.ageVaultId = ageVaultId; plString gameAddrStr = gameAddr.GetHostString(); - plString ageInstIdStr = plUUID(ageInstId).AsString(); + plString ageInstIdStr = ageInstId.AsString(); LogMsg( kLogPerf, @@ -1121,7 +1121,7 @@ void NetCommSetActivePlayer (//--> plNetCommActivePlayerMsg if (RelVaultNode* rvn = VaultGetPlayerInfoNodeIncRef()) { VaultPlayerInfoNode pInfo(rvn); pInfo.SetAgeInstName(nil); - pInfo.SetAgeInstUuid(kNilGuid); + pInfo.SetAgeInstUuid(kNilUuid); pInfo.SetOnline(false); NetCliAuthVaultNodeSave(rvn, nil, nil); @@ -1245,14 +1245,14 @@ void NetCommSetAgePublic ( // --> no msg //============================================================================ void NetCommCreatePublicAge (// --> plNetCommPublicAgeMsg const char ageName[], - const Uuid & ageInstId, + const plUUID& ageInstId, void * param ) { } //============================================================================ void NetCommRemovePublicAge(// --> plNetCommPublicAgeMsg - const Uuid & ageInstId, + const plUUID& ageInstId, void * param ) { } @@ -1285,7 +1285,7 @@ void NetCommRegisterVisitAge ( //============================================================================ void NetCommUnregisterVisitAge ( - const Uuid & ageInstId, + const plUUID& ageInstId, unsigned playerInt, void * param ) { @@ -1299,7 +1299,7 @@ void NetCommConnectPlayerVault ( //============================================================================ void NetCommConnectAgeVault ( - const Uuid & ageInstId, + const plUUID& ageInstId, void * param ) { } @@ -1333,7 +1333,7 @@ void NetCommSetCCRLevel ( void NetCommSendFriendInvite ( const wchar_t emailAddress[], const wchar_t toName[], - const Uuid& inviteUuid + const plUUID& inviteUuid ) { NetCliAuthSendFriendInvite( emailAddress, diff --git a/Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.h b/Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.h index 8dd0c0e9..99152bc9 100644 --- a/Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.h +++ b/Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.h @@ -79,7 +79,7 @@ struct NetCommPlayer { }; struct NetCommAccount { - Uuid accountUuid; + plUUID accountUuid; wchar_t accountName[kMaxAccountNameLength]; ShaDigest accountNamePassHash; char accountNameAnsi[kMaxAccountNameLength]; @@ -88,7 +88,7 @@ struct NetCommAccount { }; struct NetCommAge { - Uuid ageInstId; + plUUID ageInstId; unsigned ageVaultId; char ageDatasetName[kMaxAgeNameLength]; char spawnPtName[64]; @@ -232,11 +232,11 @@ void NetCommSetAgePublic ( // --> no msg ); void NetCommCreatePublicAge (// --> plNetCommPublicAgeMsg const char ageName[], - const Uuid & ageInstId, + const plUUID& ageInstId, void * param ); void NetCommRemovePublicAge(// --> plNetCommPublicAgeMsg - const Uuid & ageInstId, + const plUUID& ageInstId, void * param ); void NetCommRegisterOwnedAge ( @@ -257,7 +257,7 @@ void NetCommRegisterVisitAge ( void * param ); void NetCommUnregisterVisitAge ( - const Uuid & ageInstId, + const plUUID& ageInstId, unsigned playerInt, void * param ); @@ -266,7 +266,7 @@ void NetCommConnectPlayerVault ( ); void NetCommDisconnectPlayerVault (); void NetCommConnectAgeVault ( - const Uuid & ageInstId, + const plUUID& ageInstId, void * param ); void NetCommDisconnectAgeVault (); @@ -280,7 +280,7 @@ void NetCommSetCCRLevel ( void NetCommSendFriendInvite ( const wchar_t emailAddress[], const wchar_t toName[], - const Uuid& inviteUuid + const plUUID& inviteUuid ); #endif // PLASMA20_SOURCES_PLASMA_PUBUTILLIB_PLNETCLIENTCOMM_PLNETCLIENTCOMM_H diff --git a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.cpp b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.cpp index a6fa421e..0e82c23f 100644 --- a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.cpp +++ b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.cpp @@ -92,7 +92,7 @@ struct CliAuConn : AtomicRef { NetCli * cli; char name[MAX_PATH]; plNetAddress addr; - Uuid token; + plUUID token; unsigned seq; unsigned serverChallenge; AsyncCancelId cancelId; @@ -161,7 +161,7 @@ struct LoginRequestTrans : NetAuthTrans { FNetCliAuthLoginRequestCallback m_callback; void * m_param; - Uuid m_accountId; + plUUID m_accountId; unsigned m_accountFlags; unsigned m_billingType; unsigned m_playerCount; @@ -195,13 +195,13 @@ struct AgeRequestTrans : NetAuthTrans { void * m_param; wchar_t m_ageName[kMaxAgeNameLength]; unsigned m_ageMcpId; - Uuid m_ageInstId; + plUUID m_ageInstId; unsigned m_ageVaultId; uint32_t m_gameSrvNode; AgeRequestTrans ( const wchar_t ageName[], - const Uuid & ageInstId, + const plUUID& ageInstId, FNetCliAuthAgeRequestCallback callback, void * param ); @@ -229,7 +229,7 @@ struct AccountCreateRequestTrans : NetAuthTrans { unsigned m_billingType; // recv - Uuid m_accountId; + plUUID m_accountId; AccountCreateRequestTrans ( const wchar_t accountName[], @@ -258,17 +258,17 @@ struct AccountCreateFromKeyRequestTrans : NetAuthTrans { // send wchar_t m_accountName[kMaxAccountNameLength]; ShaDigest m_namePassHash; - Uuid m_key; + plUUID m_key; unsigned m_billingType; // recv - Uuid m_accountId; - Uuid m_activationKey; + plUUID m_accountId; + plUUID m_activationKey; - AccountCreateFromKeyRequestTrans ( - const wchar_t accountName[], - const wchar_t password[], - const Uuid & key, + AccountCreateFromKeyRequestTrans( + const wchar_t accountName[], + const wchar_t password[], + const plUUID& key, unsigned billingType, FNetCliAuthAccountCreateFromKeyRequestCallback callback, void * param @@ -505,10 +505,10 @@ struct AccountActivateRequestTrans : NetAuthTrans { void * m_param; // send - Uuid m_activationKey; + plUUID m_activationKey; AccountActivateRequestTrans ( - const Uuid & activationKey, + const plUUID& activationKey, FNetCliAuthAccountActivateRequestCallback callback, void * param ); @@ -609,7 +609,7 @@ struct RcvdPropagatedBufferTrans : NetNotifyTrans { struct VaultNodeChangedTrans : NetNotifyTrans { unsigned m_nodeId; - Uuid m_revId; + plUUID m_revId; VaultNodeChangedTrans () : NetNotifyTrans(kVaultNodeChangedTrans) {} void Post (); @@ -683,8 +683,8 @@ struct VaultInitAgeTrans : NetAuthTrans { FNetCliAuthAgeInitCallback m_callback; void * m_param; - Uuid m_ageInstId; - Uuid m_parentAgeInstId; + plUUID m_ageInstId; + plUUID m_parentAgeInstId; wchar_t * m_ageFilename; wchar_t * m_ageInstName; wchar_t * m_ageUserName; @@ -695,15 +695,15 @@ struct VaultInitAgeTrans : NetAuthTrans { unsigned m_ageId; unsigned m_ageInfoId; - VaultInitAgeTrans ( + VaultInitAgeTrans( FNetCliAuthAgeInitCallback callback, // optional void * param, // optional - const Uuid & ageInstId, // optional. is used in match - const Uuid & parentAgeInstId, // optional. is used in match - const wchar_t ageFilename[], // optional. is used in match - const wchar_t ageInstName[], // optional. not used in match - const wchar_t ageUserName[], // optional. not used in match - const wchar_t ageDesc[], // optional. not used in match + const plUUID& ageInstId, // optional. is used in match + const plUUID& parentAgeInstId, // optional. is used in match + const wchar_t ageFilename[], // optional. is used in match + const wchar_t ageInstName[], // optional. not used in match + const wchar_t ageUserName[], // optional. not used in match + const wchar_t ageDesc[], // optional. not used in match unsigned ageSequenceNumber, // optional. not used in match unsigned ageLanguage // optional. not used in match ); @@ -800,14 +800,14 @@ struct VaultCreateNodeTrans : NetAuthTrans { struct VaultSaveNodeTrans : NetAuthTrans { unsigned m_nodeId; - Uuid m_revisionId; + plUUID m_revisionId; ARRAY(uint8_t) m_buffer; FNetCliAuthVaultNodeSaveCallback m_callback; void * m_param; VaultSaveNodeTrans ( unsigned nodeId, - const Uuid & revisionId, + const plUUID& revisionId, unsigned dataCount, const void * data, FNetCliAuthVaultNodeSaveCallback callback, @@ -945,12 +945,12 @@ struct SendFriendInviteTrans : NetAuthTrans { // send wchar_t m_emailAddress[kMaxEmailAddressLength]; wchar_t m_toName[kMaxPlayerNameLength]; - Uuid m_inviteUuid; + plUUID m_inviteUuid; - SendFriendInviteTrans ( - const wchar_t emailAddr[], - const wchar_t toName[], - const Uuid & inviteUuid, + SendFriendInviteTrans( + const wchar_t emailAddr[], + const wchar_t toName[], + const plUUID& inviteUuid, FNetCliAuthSendFriendInviteCallback callback, void * param ); @@ -1371,7 +1371,7 @@ static void CheckedReconnect (CliAuConn * conn, ENetError error) { ReportNetError(kNetProtocolCli2Auth, error); } else { - if (conn->token != kNilGuid) + if (conn->token != kNilUuid) // previously encrypted; reconnect quickly conn->reconnectStartMs = GetNonZeroTimeMs() + 500; else @@ -2595,7 +2595,7 @@ LoginRequestTrans::LoginRequestTrans ( ) : NetAuthTrans(kLoginRequestTrans) , m_callback(callback) , m_param(param) -, m_accountId(kNilGuid) +, m_accountId(kNilUuid) , m_accountFlags(0) , m_playerCount(0) { @@ -2717,7 +2717,7 @@ bool LoginRequestTrans::Recv ( //============================================================================ AgeRequestTrans::AgeRequestTrans ( const wchar_t ageName[], - const Uuid & ageInstId, + const plUUID& ageInstId, FNetCliAuthAgeRequestCallback callback, void * param ) : NetAuthTrans(kAgeRequestTrans) @@ -2859,7 +2859,7 @@ bool AccountCreateRequestTrans::Recv ( AccountCreateFromKeyRequestTrans::AccountCreateFromKeyRequestTrans ( const wchar_t accountName[], const wchar_t password[], - const Uuid & key, + const plUUID& key, unsigned billingType, FNetCliAuthAccountCreateFromKeyRequestCallback callback, void * param @@ -3394,7 +3394,7 @@ bool AccountSetBillingTypeRequestTrans::Recv ( //============================================================================ AccountActivateRequestTrans::AccountActivateRequestTrans ( - const Uuid & activationKey, + const plUUID& activationKey, FNetCliAuthAccountActivateRequestCallback callback, void * param ) : NetAuthTrans(kAccountActivateRequestTrans) @@ -3805,12 +3805,12 @@ bool VaultFetchNodeRefsTrans::Recv ( VaultInitAgeTrans::VaultInitAgeTrans ( FNetCliAuthAgeInitCallback callback, // optional void * param, // optional - const Uuid & ageInstId, // optional. is used in match - const Uuid & parentAgeInstId, // optional. is used in match - const wchar_t ageFilename[], // optional. is used in match - const wchar_t ageInstName[], // optional. not used in match - const wchar_t ageUserName[], // optional. not used in match - const wchar_t ageDesc[], // optional. not used in match + const plUUID& ageInstId, // optional. is used in match + const plUUID& parentAgeInstId, // optional. is used in match + const wchar_t ageFilename[], // optional. is used in match + const wchar_t ageInstName[], // optional. not used in match + const wchar_t ageUserName[], // optional. not used in match + const wchar_t ageDesc[], // optional. not used in match unsigned ageSequenceNumber, // optional. not used in match unsigned ageLanguage // optional. not used in match ) : NetAuthTrans(kVaultInitAgeTrans) @@ -4100,7 +4100,7 @@ bool VaultCreateNodeTrans::Recv ( //============================================================================ VaultSaveNodeTrans::VaultSaveNodeTrans ( unsigned nodeId, - const Uuid & revisionId, + const plUUID& revisionId, unsigned dataCount, const void * data, FNetCliAuthVaultNodeSaveCallback callback, @@ -4415,9 +4415,9 @@ bool ChangePlayerNameRequestTrans::Recv ( //============================================================================ SendFriendInviteTrans::SendFriendInviteTrans ( - const wchar_t emailAddr[], - const wchar_t toName[], - const Uuid & inviteUuid, + const wchar_t emailAddr[], + const wchar_t toName[], + const plUUID& inviteUuid, FNetCliAuthSendFriendInviteCallback callback, void * param ) : NetAuthTrans(kSendFriendInviteTrans) @@ -4521,7 +4521,7 @@ bool ScoreCreateTrans::Send () { m_ownerId, (uintptr_t) wgameName, m_gameType, - m_value + (uintptr_t)m_value }; m_conn->Send(msg, arrsize(msg)); @@ -4727,7 +4727,7 @@ bool ScoreAddPointsTrans::Send () { kCli2Auth_ScoreAddPoints, m_transId, m_scoreId, - m_numPoints, + (uintptr_t)m_numPoints, }; m_conn->Send(msg, arrsize(msg)); @@ -4789,7 +4789,7 @@ bool ScoreTransferPointsTrans::Send () { m_transId, m_srcScoreId, m_destScoreId, - m_numPoints, + (uintptr_t)m_numPoints, }; m_conn->Send(msg, arrsize(msg)); @@ -4848,7 +4848,7 @@ bool ScoreSetPointsTrans::Send () { kCli2Auth_ScoreSetPoints, m_transId, m_scoreId, - m_numPoints, + (uintptr_t)m_numPoints, }; m_conn->Send(msg, arrsize(msg)); @@ -5249,7 +5249,7 @@ void NetCliAuthLoginRequest ( //============================================================================ void NetCliAuthAgeRequest ( const wchar_t ageName[], - const Uuid & ageInstId, + const plUUID& ageInstId, FNetCliAuthAgeRequestCallback callback, void * param ) { @@ -5296,7 +5296,7 @@ void NetCliAuthAccountCreateRequest ( void NetCliAuthAccountCreateFromKeyRequest ( const wchar_t accountName[], const wchar_t password[], - Uuid key, + plUUID key, unsigned billingType, FNetCliAuthAccountCreateFromKeyRequestCallback callback, void * param @@ -5482,7 +5482,7 @@ void NetCliAuthAccountSetBillingTypeRequest ( //============================================================================ void NetCliAuthAccountActivateRequest ( - const Uuid & activationKey, + const plUUID& activationKey, FNetCliAuthAccountActivateRequestCallback callback, void * param ) { @@ -5624,7 +5624,7 @@ unsigned NetCliAuthVaultNodeSave ( node->dirtyFlags |= NetVaultNode::kNodeType; // We're definitely saving this node, so assign a revisionId - node->revisionId = (Uuid)plUUID::Generate(); + node->revisionId = plUUID::Generate(); ARRAY(uint8_t) buffer; unsigned bytes = node->Write_LCS(&buffer, NetVaultNode::kRwDirtyOnly | NetVaultNode::kRwUpdateDirty); @@ -5740,8 +5740,8 @@ void NetCliAuthVaultSendNode ( //============================================================================ void NetCliAuthVaultInitAge ( - const Uuid & ageInstId, // optional. is used in match - const Uuid & parentAgeInstId, // optional. is used in match + const plUUID& ageInstId, // optional. is used in match + const plUUID& parentAgeInstId, // optional. is used in match const wchar_t ageFilename[], // optional. is used in match const wchar_t ageInstName[], // optional. not used in match const wchar_t ageUserName[], // optional. not used in match @@ -5913,7 +5913,7 @@ void NetCliAuthChangePlayerNameRequest ( void NetCliAuthSendFriendInvite ( const wchar_t emailAddress[], const wchar_t toName[], - const Uuid& inviteUuid, + const plUUID& inviteUuid, FNetCliAuthSendFriendInviteCallback callback, void * param ) { diff --git a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.h b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.h index 5ebeb223..a8080cbb 100644 --- a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.h +++ b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.h @@ -128,7 +128,7 @@ struct NetCliAuthPlayerInfo { typedef void (*FNetCliAuthLoginRequestCallback)( ENetError result, void * param, - const Uuid & accountId, + const plUUID& accountId, unsigned accountFlags, unsigned billingType, const NetCliAuthPlayerInfo playerInfoArr[], @@ -162,7 +162,7 @@ void NetCliAuthSetPlayerRequest ( typedef void (*FNetCliAuthAccountCreateRequestCallback)( ENetError result, void * param, - const Uuid & accountId + const plUUID& accountId ); void NetCliAuthAccountCreateRequest ( const wchar_t accountName[], @@ -179,13 +179,13 @@ void NetCliAuthAccountCreateRequest ( typedef void (*FNetCliAuthAccountCreateFromKeyRequestCallback)( ENetError result, void * param, - const Uuid & accountId, - const Uuid & activationKey + const plUUID& accountId, + const plUUID& activationKey ); void NetCliAuthAccountCreateFromKeyRequest ( const wchar_t accountName[], const wchar_t accountPass[], - Uuid key, + plUUID key, unsigned billingType, FNetCliAuthAccountCreateFromKeyRequestCallback callback, void * param @@ -313,7 +313,7 @@ typedef void (*FNetCliAuthAccountActivateRequestCallback)( void * param ); void NetCliAuthAccountActivateRequest ( - const Uuid & activationKey, + const plUUID& activationKey, FNetCliAuthAccountActivateRequestCallback callback, void * param ); @@ -326,12 +326,12 @@ typedef void (*FNetCliAuthAgeRequestCallback)( void * param, unsigned ageMcpId, unsigned ageVaultId, - const Uuid & ageInstId, + const plUUID& ageInstId, plNetAddress gameAddr ); void NetCliAuthAgeRequest ( const wchar_t ageName[], // L"Teledahn" - const Uuid & ageInstId, + const plUUID& ageInstId, FNetCliAuthAgeRequestCallback callback, void * param ); @@ -389,7 +389,7 @@ struct NetVaultNodeRef; // VaultNodeChanged typedef void (*FNetCliAuthVaultNodeChanged)( unsigned nodeId, - const Uuid & revisionId + const plUUID& revisionId ); void NetCliAuthVaultSetRecvNodeChangedHandler ( FNetCliAuthVaultNodeChanged handler @@ -519,8 +519,8 @@ typedef void (*FNetCliAuthAgeInitCallback) ( unsigned ageInfoVaultId ); void NetCliAuthVaultInitAge ( - const Uuid & ageInstId, // optional. is used in match - const Uuid & parentAgeInstId, // optional. is used in match + const plUUID& ageInstId, // optional. is used in match + const plUUID& parentAgeInstId, // optional. is used in match const wchar_t ageFilename[], // optional. is used in match const wchar_t ageInstName[], // optional. not used in match const wchar_t ageUserName[], // optional. not used in match @@ -589,7 +589,7 @@ typedef void (*FNetCliAuthSendFriendInviteCallback)( void NetCliAuthSendFriendInvite ( const wchar_t emailAddress[], const wchar_t toName[], - const Uuid& inviteUuid, + const plUUID& inviteUuid, FNetCliAuthSendFriendInviteCallback callback, void * param ); diff --git a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGame.cpp b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGame.cpp index a2d2ef7e..ef0eb673 100644 --- a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGame.cpp +++ b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGame.cpp @@ -91,12 +91,12 @@ struct JoinAgeRequestTrans : NetGameTrans { void * m_param; // sent unsigned m_ageMcpId; - Uuid m_accountUuid; + plUUID m_accountUuid; unsigned m_playerInt; JoinAgeRequestTrans ( unsigned ageMcpId, - const Uuid & accountUuid, + const plUUID& accountUuid, unsigned playerInt, FNetCliGameJoinAgeRequestCallback callback, void * param @@ -574,7 +574,7 @@ static NetMsgInitRecv s_recv[] = { //============================================================================ JoinAgeRequestTrans::JoinAgeRequestTrans ( unsigned ageMcpId, - const Uuid & accountUuid, + const plUUID& accountUuid, unsigned playerInt, FNetCliGameJoinAgeRequestCallback callback, void * param @@ -817,7 +817,7 @@ void NetCliGameDisconnect () { //============================================================================ void NetCliGameJoinAgeRequest ( unsigned ageMcpId, - const Uuid & accountUuid, + const plUUID& accountUuid, unsigned playerInt, FNetCliGameJoinAgeRequestCallback callback, void * param diff --git a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGame.h b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGame.h index afca4c95..efce72e5 100644 --- a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGame.h +++ b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGame.h @@ -78,7 +78,7 @@ typedef void (*FNetCliGameJoinAgeRequestCallback)( ); void NetCliGameJoinAgeRequest ( unsigned ageMcpId, - const Uuid & accountUuid, + const plUUID& accountUuid, unsigned playerInt, FNetCliGameJoinAgeRequestCallback callback, void * param diff --git a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGateKeeper.cpp b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGateKeeper.cpp index 5e7ca09d..86c30fa9 100644 --- a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGateKeeper.cpp +++ b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGateKeeper.cpp @@ -91,7 +91,7 @@ struct CliGkConn : AtomicRef { NetCli * cli; char name[MAX_PATH]; plNetAddress addr; - Uuid token; + plUUID token; unsigned seq; unsigned serverChallenge; AsyncCancelId cancelId; @@ -307,7 +307,7 @@ static void CheckedReconnect (CliGkConn * conn, ENetError error) { ReportNetError(kNetProtocolCli2GateKeeper, error); } else { - if (conn->token != kNilGuid) + if (conn->token != kNilUuid) // previously encrypted; reconnect quickly conn->reconnectStartMs = GetNonZeroTimeMs() + 500; else @@ -841,7 +841,7 @@ bool FileSrvIpAddressRequestTrans::Send () { const uintptr_t msg[] = { kCli2GateKeeper_FileSrvIpAddressRequest, m_transId, - m_isPatcher == true ? 1 : 0 + (uintptr_t)(m_isPatcher == true ? 1 : 0) }; m_conn->Send(msg, arrsize(msg)); diff --git a/Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp b/Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp index 777c7340..c39a3f97 100644 --- a/Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp +++ b/Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp @@ -552,7 +552,7 @@ static void ChangedVaultNodeFetched ( //============================================================================ static void VaultNodeChanged ( unsigned nodeId, - const Uuid & revisionId + const plUUID& revisionId ) { LogMsg(kLogDebug, L"Notify: Node changed: %u", nodeId); @@ -2115,7 +2115,7 @@ void VaultFetchNodesAndWait ( //============================================================================ void VaultInitAge ( const plAgeInfoStruct * info, - const Uuid & parentAgeInstId, // optional + const plUUID parentAgeInstId, // optional FVaultInitAgeCallback callback, void * state, void * param @@ -2136,7 +2136,7 @@ void VaultInitAge ( StrToUnicode(ageDesc, info->GetAgeDescription(), arrsize(ageDesc)); NetCliAuthVaultInitAge( - (Uuid)*info->GetAgeInstanceGuid(), + *info->GetAgeInstanceGuid(), parentAgeInstId, ageFilename, ageInstName, @@ -2418,7 +2418,7 @@ bool VaultFindOrCreateChildAgeLinkAndWait (const wchar_t ownedAgeName[], const p } //============================================================================ -bool VaultAddOwnedAgeSpawnPoint (const Uuid & ageInstId, const plSpawnPointInfo & spawnPt) { +bool VaultAddOwnedAgeSpawnPoint (const plUUID& ageInstId, const plSpawnPointInfo & spawnPt) { RelVaultNode * fldr = nil; RelVaultNode * link = nil; @@ -2638,7 +2638,7 @@ bool VaultRegisterOwnedAgeAndWait (const plAgeLinkStruct * link) { VaultInitAge( link->GetAgeInfo(), - kNilGuid, + kNilUuid, _InitAgeCallback, nil, ¶m @@ -2909,7 +2909,7 @@ void VaultRegisterOwnedAge(const plAgeLinkStruct* link) { // Let's go async, my friend :) VaultInitAge(link->GetAgeInfo(), - kNilGuid, + kNilUuid, (FVaultInitAgeCallback)_InitAgeCallback, nil, new plSpawnPointInfo(link->SpawnPoint())); @@ -3012,7 +3012,7 @@ bool VaultRegisterVisitAgeAndWait (const plAgeLinkStruct * link) { VaultInitAge( link->GetAgeInfo(), - kNilGuid, + kNilUuid, _InitAgeCallback, nil, ¶m @@ -3271,7 +3271,7 @@ void VaultRegisterVisitAge(const plAgeLinkStruct* link) { // This doesn't actually *create* a new age but rather fetches the // already existing age vault. Weird? Yes... VaultInitAge(link->GetAgeInfo(), - kNilGuid, + kNilUuid, (FVaultInitAgeCallback)_InitAgeCallback, nil, p @@ -3632,13 +3632,13 @@ bool VaultAmCzarOfCurrentAge () { } //============================================================================ -bool VaultAmOwnerOfAge (const Uuid & ageInstId) { +bool VaultAmOwnerOfAge (const plUUID& ageInstId) { hsAssert(false, "eric, implement me"); return true; } //============================================================================ -bool VaultAmCzarOfAge (const Uuid & ageInstId) { +bool VaultAmCzarOfAge (const plUUID& ageInstId) { // hsAssert(false, "eric, implement me"); return false; } @@ -4249,7 +4249,7 @@ static void _AddChildNodeCallback ( bool VaultAgeFindOrCreateSubAgeLinkAndWait ( const plAgeInfoStruct * info, plAgeLinkStruct * link, - const Uuid & parentAgeInstId + const plUUID& parentAgeInstId ) { if (RelVaultNode * rvnLink = VaultFindAgeSubAgeLinkIncRef(info)) { VaultAgeLinkNode linkAcc(rvnLink); @@ -4464,7 +4464,7 @@ namespace _VaultCreateSubAge { } }; // namespace _VaultCreateSubAge -bool VaultAgeFindOrCreateSubAgeLink(const plAgeInfoStruct* info, plAgeLinkStruct* link, const Uuid& parentUuid) { +bool VaultAgeFindOrCreateSubAgeLink(const plAgeInfoStruct* info, plAgeLinkStruct* link, const plUUID& parentUuid) { using namespace _VaultCreateSubAge; // First, try to find an already existing subage @@ -4633,8 +4633,7 @@ bool VaultAgeFindOrCreateChildAgeLinkAndWait ( _InitAgeParam param; memset(¶m, 0, sizeof(param)); - Uuid parentAgeInstId; - memset(&parentAgeInstId, 0, sizeof(parentAgeInstId)); + plUUID parentAgeInstId; if (RelVaultNode * rvnAge = VaultGetAgeNodeIncRef()) { VaultAgeNode access(rvnAge); parentAgeInstId = access.ageInstUuid; diff --git a/Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.h b/Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.h index 13e0df9e..c6c6c47a 100644 --- a/Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.h +++ b/Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.h @@ -60,6 +60,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com ***/ struct RelVaultNode; +class plUUID; struct VaultCallback { struct IVaultCallback * internal; @@ -316,7 +317,7 @@ typedef void (*FVaultInitAgeCallback)( ); void VaultInitAge ( const class plAgeInfoStruct * info, - const Uuid & parentAgeInstId, + const plUUID parentAgeInstId, FVaultInitAgeCallback callback, void * state, void * param @@ -343,7 +344,7 @@ RelVaultNode * VaultGetPlayerInboxFolderIncRef (); RelVaultNode * VaultGetOwnedAgeLinkIncRef (const plAgeInfoStruct * info); RelVaultNode * VaultGetOwnedAgeInfoIncRef (const plAgeInfoStruct * info); bool VaultGetOwnedAgeLink (const plAgeInfoStruct * info, plAgeLinkStruct * link); -bool VaultAddOwnedAgeSpawnPoint (const Uuid & ageInstId, const plSpawnPointInfo & spawnPt); +bool VaultAddOwnedAgeSpawnPoint (const plUUID& ageInstId, const plSpawnPointInfo & spawnPt); bool VaultSetOwnedAgePublicAndWait (const plAgeInfoStruct * info, bool publicOrNot); RelVaultNode * VaultGetVisitAgeLinkIncRef (const plAgeInfoStruct * info); bool VaultGetVisitAgeLink (const plAgeInfoStruct * info, class plAgeLinkStruct * link); @@ -372,8 +373,8 @@ bool VaultAmInMyPersonalAge (); bool VaultAmInMyNeighborhoodAge (); bool VaultAmOwnerOfCurrentAge (); bool VaultAmCzarOfCurrentAge (); -bool VaultAmOwnerOfAge (const Uuid & ageInstId); -bool VaultAmCzarOfAge (const Uuid & ageInstId); +bool VaultAmOwnerOfAge (const plUUID& ageInstId); +bool VaultAmCzarOfAge (const plUUID& ageInstId); bool VaultRegisterMTStationAndWait ( const wchar_t stationName[], const wchar_t linkBackSpawnPtObjName[] @@ -430,9 +431,9 @@ bool VaultAgeGetSubAgeLink ( bool VaultAgeFindOrCreateSubAgeLinkAndWait ( const plAgeInfoStruct * info, plAgeLinkStruct * link, - const Uuid & parentAgeInstId + const plUUID& parentAgeInstId ); -bool VaultAgeFindOrCreateSubAgeLink(const plAgeInfoStruct* info, plAgeLinkStruct* link, const Uuid& parentUuid); +bool VaultAgeFindOrCreateSubAgeLink(const plAgeInfoStruct* info, plAgeLinkStruct* link, const plUUID& arentUuid); bool VaultAgeFindOrCreateChildAgeLinkAndWait ( const wchar_t parentAgeName[], // nil --> current age, non-nil --> owned age by given name const plAgeInfoStruct * info, diff --git a/Sources/Plasma/PubUtilLib/plVault/plVaultNodeAccess.cpp b/Sources/Plasma/PubUtilLib/plVault/plVaultNodeAccess.cpp index 3596aa56..b3eed74e 100644 --- a/Sources/Plasma/PubUtilLib/plVault/plVaultNodeAccess.cpp +++ b/Sources/Plasma/PubUtilLib/plVault/plVaultNodeAccess.cpp @@ -132,12 +132,12 @@ void VaultPlayerNode::SetOnlineTime (unsigned v) { } //============================================================================ -void VaultPlayerNode::SetAccountUuid (const Uuid & v) { +void VaultPlayerNode::SetAccountUuid (const plUUID& v) { IVaultNodeSetValue(kAccountUuid, base, &accountUuid, v); } //============================================================================ -void VaultPlayerNode::SetInviteUuid (const Uuid & v) { +void VaultPlayerNode::SetInviteUuid (const plUUID& v) { IVaultNodeSetValue(kInviteUuid, base, &inviteUuid, v); } @@ -181,7 +181,7 @@ void VaultPlayerInfoNode::SetAgeInstName (const wchar_t v[]) { } //============================================================================ -void VaultPlayerInfoNode::SetAgeInstUuid (const Uuid & v) { +void VaultPlayerInfoNode::SetAgeInstUuid (const plUUID& v) { IVaultNodeSetValue(kAgeInstUuid, base, &ageInstUuid, v); } @@ -369,7 +369,7 @@ void VaultTextNoteNode::SetVisitInfo (const plAgeInfoStruct & info) { break; case kAgeInstGuid: { - plUUID guid = (plUUID)*info.GetAgeInstanceGuid(); + plUUID guid = *info.GetAgeInstanceGuid(); wchar_t src[64]; wcsncpy(src, guid.AsString().ToWchar(), 64); unsigned len = StrLen(src); @@ -464,9 +464,7 @@ bool VaultTextNoteNode::GetVisitInfo (plAgeInfoStruct * info) { case kAgeInstGuid: { StrTokenize(&str, token, arrsize(token), L"|", 1); if (StrLen(token) > 0) { - Uuid guid; - GuidFromString(token, &guid); - plUUID uuid(guid); + plUUID uuid(plString::FromWchar(token)); info->SetAgeInstanceGuid(&uuid); } } @@ -859,12 +857,12 @@ VaultAgeNode::VaultAgeNode (NetVaultNode * node) } //============================================================================ -void VaultAgeNode::SetAgeInstGuid (const Uuid & v) { +void VaultAgeNode::SetAgeInstGuid (const plUUID& v) { IVaultNodeSetValue(kAgeInstanceGuid, base, &ageInstUuid, v); } //============================================================================ -void VaultAgeNode::SetParentAgeInstGuid (const Uuid & v) { +void VaultAgeNode::SetParentAgeInstGuid (const plUUID& v) { IVaultNodeSetValue(kParentAgeInstanceGuid, base, &parentAgeInstUuid, v); } @@ -914,12 +912,12 @@ void VaultAgeInfoNode::SetAgeUserDefinedName (const wchar_t v[]) { } //============================================================================ -void VaultAgeInfoNode::SetAgeInstGuid (const Uuid & v) { +void VaultAgeInfoNode::SetAgeInstGuid (const plUUID& v) { IVaultNodeSetValue(kAgeInstanceGuid, base, &ageInstUuid, v); } //============================================================================ -void VaultAgeInfoNode::SetParentAgeInstGuid (const Uuid & v) { +void VaultAgeInfoNode::SetParentAgeInstGuid (const plUUID& v) { IVaultNodeSetValue(kParentAgeInstanceGuid, base, &parentAgeInstUuid, v); } @@ -1012,7 +1010,7 @@ void VaultAgeInfoNode::CopyFrom (const plAgeInfoStruct * info) { SetAgeSequenceNumber(info->GetAgeSequenceNumber()); // age instance guid - SetAgeInstGuid((Uuid)*info->GetAgeInstanceGuid()); + SetAgeInstGuid(*info->GetAgeInstanceGuid()); // age language SetAgeLanguage(info->GetAgeLanguage()); @@ -1091,6 +1089,6 @@ void VaultMarkerGameNode::SetGameName (const wchar_t v[]) { } //============================================================================ -void VaultMarkerGameNode::SetGameGuid (const Uuid & v) { +void VaultMarkerGameNode::SetGameGuid (const plUUID& v) { IVaultNodeSetValue(kGameGuid, base, &gameGuid, v); } diff --git a/Sources/Plasma/PubUtilLib/plVault/plVaultNodeAccess.h b/Sources/Plasma/PubUtilLib/plVault/plVaultNodeAccess.h index a2dd1386..fefdd004 100644 --- a/Sources/Plasma/PubUtilLib/plVault/plVaultNodeAccess.h +++ b/Sources/Plasma/PubUtilLib/plVault/plVaultNodeAccess.h @@ -101,8 +101,8 @@ struct VaultPlayerNode : NetVaultNodeAccess { wchar_t *& avatarShapeName; int & disabled; unsigned & onlineTime; - Uuid & accountUuid; - Uuid & inviteUuid; + plUUID& accountUuid; + plUUID& inviteUuid; int & explorer; VaultPlayerNode (NetVaultNode * node); @@ -114,8 +114,8 @@ struct VaultPlayerNode : NetVaultNodeAccess { void SetAvatarShapeName (const wchar_t v[]); void SetDisabled (int v); void SetOnlineTime (unsigned v); - void SetAccountUuid (const Uuid & v); - void SetInviteUuid (const Uuid & v); + void SetAccountUuid (const plUUID& v); + void SetInviteUuid (const plUUID& v); void SetExplorer (int v); }; @@ -136,7 +136,7 @@ struct VaultPlayerInfoNode : NetVaultNodeAccess { unsigned & playerId; wchar_t *& playerName; wchar_t *& ageInstName; - Uuid & ageInstUuid; + plUUID& ageInstUuid; int & online; int & ccrLevel; @@ -148,7 +148,7 @@ struct VaultPlayerInfoNode : NetVaultNodeAccess { void SetPlayerId (unsigned v); void SetPlayerName (const wchar_t v[]); void SetAgeInstName (const wchar_t v[]); - void SetAgeInstUuid (const Uuid & v); + void SetAgeInstUuid (const plUUID& v); void SetOnline (int v); void SetCCRLevel (int v); }; @@ -362,16 +362,16 @@ struct VaultAgeNode : NetVaultNodeAccess { static const uint64_t kParentAgeInstanceGuid = NetVaultNode::kUuid_2; static const uint64_t kAgeName = NetVaultNode::kString64_1; - Uuid & ageInstUuid; - Uuid & parentAgeInstUuid; + plUUID& ageInstUuid; + plUUID& parentAgeInstUuid; wchar_t *& ageName; VaultAgeNode (NetVaultNode * node); VaultAgeNode (const VaultAgeNode &); // not implemented const VaultAgeNode & operator= (const VaultAgeNode &); // not implemented - void SetAgeInstGuid (const Uuid & v); - void SetParentAgeInstGuid (const Uuid & v); + void SetAgeInstGuid (const plUUID& v); + void SetParentAgeInstGuid (const plUUID& v); void SetAgeName (const wchar_t v[]); }; @@ -396,8 +396,8 @@ struct VaultAgeInfoNode : NetVaultNodeAccess { wchar_t *& ageFilename; wchar_t *& ageInstName; wchar_t *& ageUserDefinedName; - Uuid & ageInstUuid; - Uuid & parentAgeInstUuid; + plUUID& ageInstUuid; + plUUID& parentAgeInstUuid; int & ageSequenceNumber; int & ageIsPublic; int & ageLanguage; @@ -413,8 +413,8 @@ struct VaultAgeInfoNode : NetVaultNodeAccess { void SetAgeFilename (const wchar_t v[]); void SetAgeInstName (const wchar_t v[]); void SetAgeUserDefinedName (const wchar_t v[]); - void SetAgeInstGuid (const Uuid & v); - void SetParentAgeInstGuid (const Uuid & v); + void SetAgeInstGuid (const plUUID& v); + void SetParentAgeInstGuid (const plUUID& v); void SetAgeSequenceNumber (int v); void _SetAgeIsPublic (int v); // WARNING: Do not call this. The age will not be set public this way. Use NetCliAuthSetAgePublic instead (changes this field's value in the process). void SetAgeLanguage (int v); @@ -456,12 +456,12 @@ struct VaultMarkerGameNode : NetVaultNodeAccess { static const uint64_t kGameGuid = NetVaultNode::kUuid_1; wchar_t *& gameName; - Uuid & gameGuid; + plUUID& gameGuid; VaultMarkerGameNode (NetVaultNode * node); VaultMarkerGameNode (const VaultMarkerGameNode &); // not implemented const VaultMarkerGameNode & operator= (const VaultMarkerGameNode &); // not implemented void SetGameName (const wchar_t v[]); - void SetGameGuid (const Uuid & v); + void SetGameGuid (const plUUID& v); };