Browse Source

Merge pull request #248 from dpogue/uuid-fixes

Replace pnUtUuid with plUUID.
Adam Johnson 12 years ago
parent
commit
b574a583f4
  1. 4
      Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommandsNet.cpp
  2. 4
      Sources/Plasma/FeatureLib/pfGameMgr/pfGameMgr.cpp
  3. 4
      Sources/Plasma/FeatureLib/pfGameMgr/pfGameMgr.h
  4. 4
      Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralGame.cpp
  5. 2
      Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralGame.h
  6. 23
      Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralGameGlue.cpp
  7. 4
      Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallGame.cpp
  8. 2
      Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallGame.h
  9. 23
      Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallGameGlue.cpp
  10. 4
      Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekGame.cpp
  11. 2
      Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekGame.h
  12. 23
      Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekGameGlue.cpp
  13. 4
      Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerGame.cpp
  14. 2
      Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerGame.h
  15. 23
      Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerGameGlue.cpp
  16. 4
      Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTGame.cpp
  17. 2
      Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTGame.h
  18. 23
      Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTGameGlue.cpp
  19. 4
      Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncGame.cpp
  20. 2
      Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncGame.h
  21. 23
      Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncGameGlue.cpp
  22. 14
      Sources/Plasma/FeatureLib/pfPython/Games/pyGameCli.cpp
  23. 6
      Sources/Plasma/FeatureLib/pfPython/Games/pyGameCli.h
  24. 30
      Sources/Plasma/FeatureLib/pfPython/Games/pyGameCliGlue.cpp
  25. 3
      Sources/Plasma/FeatureLib/pfPython/Games/pyGameCliMsg.cpp
  26. 25
      Sources/Plasma/FeatureLib/pfPython/Games/pyGameMgrMsg.cpp
  27. 14
      Sources/Plasma/FeatureLib/pfPython/Games/pyGameMgrMsg.h
  28. 7
      Sources/Plasma/FeatureLib/pfPython/Games/pyGameMgrMsgGlue.cpp
  29. 14
      Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp
  30. 6
      Sources/Plasma/FeatureLib/pfPython/cyMisc.h
  31. 7
      Sources/Plasma/FeatureLib/pfPython/cyMiscGlue3.cpp
  32. 3
      Sources/Plasma/FeatureLib/pfPython/cyPythonInterface.cpp
  33. 2
      Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.cpp
  34. 2
      Sources/Plasma/FeatureLib/pfPython/pyAgeVault.cpp
  35. 2
      Sources/Plasma/FeatureLib/pfPython/pyAgeVault.h
  36. 2
      Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.cpp
  37. 2
      Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.h
  38. 2
      Sources/Plasma/FeatureLib/pfPython/pyEnum.cpp
  39. 1
      Sources/Plasma/FeatureLib/pfPython/pyGUIControlDraggable.cpp
  40. 1
      Sources/Plasma/FeatureLib/pfPython/pyGUIControlRadioGroup.cpp
  41. 1
      Sources/Plasma/FeatureLib/pfPython/pyGUIPopUpMenu.cpp
  42. 2
      Sources/Plasma/FeatureLib/pfPython/pyNotify.cpp
  43. 2
      Sources/Plasma/FeatureLib/pfPython/pyNotify.h
  44. 4
      Sources/Plasma/FeatureLib/pfPython/pyNotifyGlue.cpp
  45. 10
      Sources/Plasma/FeatureLib/pfPython/pyVault.cpp
  46. 10
      Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNode.cpp
  47. 4
      Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNode.h
  48. 3
      Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNodeGlue.cpp
  49. 2
      Sources/Plasma/FeatureLib/pfPython/pyVaultAgeLinkNode.h
  50. 3
      Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.cpp
  51. 12
      Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNode.cpp
  52. 4
      Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNode.h
  53. 3
      Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNodeGlue.cpp
  54. 57
      Sources/Plasma/FeatureLib/pfPython/pyVaultNode.cpp
  55. 4
      Sources/Plasma/FeatureLib/pfPython/pyVaultNode.h
  56. 3
      Sources/Plasma/FeatureLib/pfPython/pyVaultNodeGlue.cpp
  57. 2
      Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoListNode.cpp
  58. 17
      Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNode.cpp
  59. 5
      Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNode.h
  60. 3
      Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNodeGlue.cpp
  61. 4
      Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNode.cpp
  62. 11
      Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcIo.h
  63. 2
      Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Nt/pnAceNtSocket.cpp
  64. 18
      Sources/Plasma/NucleusLib/pnAsyncCoreExe/pnAceIo.cpp
  65. 2
      Sources/Plasma/NucleusLib/pnGameMgr/BlueSpiral/pnGmBlueSpiral.h
  66. 2
      Sources/Plasma/NucleusLib/pnGameMgr/ClimbingWall/pnGmClimbingWall.h
  67. 2
      Sources/Plasma/NucleusLib/pnGameMgr/Heek/pnGmHeek.h
  68. 2
      Sources/Plasma/NucleusLib/pnGameMgr/Marker/pnGmMarker.h
  69. 1
      Sources/Plasma/NucleusLib/pnGameMgr/Pch.h
  70. 2
      Sources/Plasma/NucleusLib/pnGameMgr/TicTacToe/pnGmTicTacToe.h
  71. 2
      Sources/Plasma/NucleusLib/pnGameMgr/VarSync/pnGmVarSync.h
  72. 10
      Sources/Plasma/NucleusLib/pnGameMgr/pnGameMgr.h
  73. 2
      Sources/Plasma/NucleusLib/pnMessage/plNotifyMsg.cpp
  74. 2
      Sources/Plasma/NucleusLib/pnMessage/plNotifyMsg.h
  75. 4
      Sources/Plasma/NucleusLib/pnNetCli/pnNcCli.cpp
  76. 22
      Sources/Plasma/NucleusLib/pnNetCommon/pnNetCommon.cpp
  77. 1
      Sources/Plasma/NucleusLib/pnNetProtocol/Pch.h
  78. 30
      Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2Auth/pnNpCli2Auth.h
  79. 6
      Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2Game/pnNpCli2Game.h
  80. 2
      Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2GateKeeper/pnNpCli2GateKeeper.h
  81. 42
      Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Db/pnNpSrv2Db.h
  82. 30
      Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Mcp/pnNpSrv2Mcp.h
  83. 6
      Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2State/pnNpSrv2State.h
  84. 60
      Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Vault/pnNpSrv2Vault.h
  85. 31
      Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.cpp
  86. 44
      Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.h
  87. 6
      Sources/Plasma/NucleusLib/pnUUID/CMakeLists.txt
  88. 39
      Sources/Plasma/NucleusLib/pnUUID/pnUUID.cpp
  89. 48
      Sources/Plasma/NucleusLib/pnUUID/pnUUID.h
  90. 23
      Sources/Plasma/NucleusLib/pnUUID/pnUUID_Unix.cpp
  91. 5
      Sources/Plasma/NucleusLib/pnUUID/pnUUID_Win32.cpp
  92. 4
      Sources/Plasma/NucleusLib/pnUtils/CMakeLists.txt
  93. 69
      Sources/Plasma/NucleusLib/pnUtils/Unix/pnUtUxUuid.cpp
  94. 186
      Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Uuid.cpp
  95. 1
      Sources/Plasma/NucleusLib/pnUtils/pnUtAllIncludes.h
  96. 106
      Sources/Plasma/NucleusLib/pnUtils/pnUtUuid.cpp
  97. 118
      Sources/Plasma/NucleusLib/pnUtils/pnUtUuid.h
  98. 4
      Sources/Plasma/PubUtilLib/plInputCore/plSceneInputInterface.cpp
  99. 14
      Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp
  100. 29
      Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.cpp
  101. Some files were not shown because too many files have changed in this diff Show More

4
Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommandsNet.cpp

@ -810,7 +810,7 @@ PF_CONSOLE_CMD( Net_Vault,
plAgeLinkStruct link;
link.GetAgeInfo()->SetAgeFilename( params[0] );
link.GetAgeInfo()->SetAgeInstanceName( params[0] );
plUUID guid(GuidGenerate());
plUUID guid = plUUID::Generate();
link.GetAgeInfo()->SetAgeInstanceGuid( &guid);
link.SetSpawnPoint( kDefaultSpawnPoint );
bool success = VaultRegisterOwnedAgeAndWait(&link);
@ -838,7 +838,7 @@ PF_CONSOLE_CMD( Net_Vault,
plAgeLinkStruct link;
link.GetAgeInfo()->SetAgeFilename( params[0] );
link.GetAgeInfo()->SetAgeInstanceName( params[0] );
plUUID guid(GuidGenerate());
plUUID guid = plUUID::Generate();
link.GetAgeInfo()->SetAgeInstanceGuid( &guid);
link.SetSpawnPoint( kDefaultSpawnPoint );
bool success = VaultRegisterOwnedAgeAndWait(&link);

4
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

4
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

4
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;
}

2
Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralGame.h

@ -68,7 +68,7 @@ public:
static void AddPlasmaClasses(PyObject* m);
static void AddPlasmaMethods(std::vector<PyMethodDef>& methods);
static bool IsBlueSpiralGame(std::wstring guid);
static bool IsBlueSpiralGame(plString& guid);
static void JoinCommonBlueSpiralGame(pyKey& callbackKey, unsigned gameID);
void StartGame();

23
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;
}
}

4
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;
}

2
Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallGame.h

@ -69,7 +69,7 @@ public:
static void AddPlasmaMethods(std::vector<PyMethodDef>& 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);

23
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;
}
}

4
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;
}

2
Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekGame.h

@ -69,7 +69,7 @@ public:
static void AddPlasmaConstantsClasses(PyObject* m);
static void AddPlasmaMethods(std::vector<PyMethodDef>& 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);

23
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;
}
}

4
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;
}

2
Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerGame.h

@ -69,7 +69,7 @@ public:
static void AddPlasmaConstantsClasses(PyObject* m);
static void AddPlasmaMethods(std::vector<PyMethodDef>& 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();

23
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;
}
}

4
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;
}

2
Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTGame.h

@ -69,7 +69,7 @@ public:
static void AddPlasmaConstantsClasses(PyObject* m);
static void AddPlasmaMethods(std::vector<PyMethodDef>& 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);

23
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;
}
}

4
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;
}

2
Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncGame.h

@ -68,7 +68,7 @@ public:
static void AddPlasmaClasses(PyObject* m);
static void AddPlasmaMethods(std::vector<PyMethodDef>& 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);

23
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;
}
}

14
Sources/Plasma/FeatureLib/pfPython/Games/pyGameCli.cpp

@ -42,10 +42,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include <Python.h>
#include "../pyKey.h"
#include "plString.h"
#pragma hdrstop
#include "pyGameCli.h"
#include "pfGameMgr/pfGameMgr.h"
#include "pnUUID/pnUUID.h"
#include "TicTacToe/pyTTTGame.h"
#include "Heek/pyHeekGame.h"
@ -81,9 +83,9 @@ PyObject* pyGameCli::GetGameCli(unsigned gameID)
PYTHON_RETURN_NONE;
}
std::wstring pyGameCli::GetGameNameByTypeID(std::wstring typeID)
std::wstring pyGameCli::GetGameNameByTypeID(plString& typeID)
{
Uuid gameUuid(typeID.c_str());
plUUID gameUuid(typeID);
return pfGameMgr::GetInstance()->GetGameNameByTypeId(gameUuid);
}
@ -99,15 +101,13 @@ unsigned pyGameCli::GameID() const
return 0;
}
std::wstring pyGameCli::GameTypeID() const
plUUID pyGameCli::GameTypeID() const
{
if (gameClient)
{
wchar_t guidStr[256];
GuidToString(gameClient->GetGameTypeId(), guidStr, arrsize(guidStr));
return guidStr;
return gameClient->GetGameTypeId();
}
return L"";
return kNilUuid;
}
std::wstring pyGameCli::Name() const

6
Sources/Plasma/FeatureLib/pfPython/Games/pyGameCli.h

@ -54,6 +54,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include <vector>
class pfGameCli;
class plString;
class plUUID;
class pyGameCli
{
@ -76,11 +78,11 @@ public:
static std::vector<unsigned> GetGameIDs();
static PyObject* GetGameCli(unsigned gameID); // returns a ptGameCli
static std::wstring GetGameNameByTypeID(std::wstring typeID);
static std::wstring GetGameNameByTypeID(plString& typeID);
static void JoinGame(pyKey& callbackKey, unsigned gameID);
unsigned GameID() const;
std::wstring GameTypeID() const;
plUUID GameTypeID() const;
std::wstring Name() const;
unsigned PlayerCount() const;

30
Sources/Plasma/FeatureLib/pfPython/Games/pyGameCliGlue.cpp

@ -44,6 +44,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "../pyKey.h"
#pragma hdrstop
#include "pnUUID/pnUUID.h"
#include "pyGameCli.h"
#include "../pyEnum.h"
@ -84,31 +85,20 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtGetGameNameByTypeID, args, "Params: guid\nRetu
PyObject* textObj;
if (!PyArg_ParseTuple(args, "O", &textObj))
{
PyErr_SetString(PyExc_TypeError, "PtGetGameNameByTypeID expects a unicode string");
PyErr_SetString(PyExc_TypeError, "PtGetGameNameByTypeID expects a string");
PYTHON_RETURN_ERROR;
}
if (PyUnicode_Check(textObj))
{
int strLen = PyUnicode_GetSize(textObj);
wchar_t* text = new wchar_t[strLen + 1];
PyUnicode_AsWideChar((PyUnicodeObject*)textObj, text, strLen);
text[strLen] = L'\0';
std::wstring retVal = pyGameCli::GetGameNameByTypeID(text);
delete [] text;
return PyUnicode_FromWideChar(retVal.c_str(), retVal.length());
}
else if (PyString_Check(textObj))
if (PyString_CheckEx(textObj))
{
// we'll allow this, just in case something goes weird
char* text = PyString_AsString(textObj);
wchar_t* wText = hsStringToWString(text);
std::wstring retVal = pyGameCli::GetGameNameByTypeID(wText);
delete [] wText;
plString guid = PyString_AsStringEx(textObj);
std::wstring retVal = pyGameCli::GetGameNameByTypeID(guid);
return PyUnicode_FromWideChar(retVal.c_str(), retVal.length());
}
else
{
PyErr_SetString(PyExc_TypeError, "PtGetGameNameByTypeID expects a unicode string");
PyErr_SetString(PyExc_TypeError, "PtGetGameNameByTypeID expects a string");
PYTHON_RETURN_ERROR;
}
}
@ -139,8 +129,8 @@ PYTHON_METHOD_DEFINITION_NOARGS(ptGameCli, gameID)
PYTHON_METHOD_DEFINITION_NOARGS(ptGameCli, gameTypeID)
{
std::wstring retVal = self->fThis->GameTypeID();
return PyUnicode_FromWideChar(retVal.c_str(), retVal.length());
plUUID retVal = self->fThis->GameTypeID();
return PyString_FromPlString(retVal.AsString());
}
PYTHON_METHOD_DEFINITION_NOARGS(ptGameCli, name)

3
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)

25
Sources/Plasma/FeatureLib/pfPython/Games/pyGameMgrMsg.cpp

@ -45,6 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "pyGameMgrMsg.h"
#include "pfGameMgr/pfGameMgr.h"
#include "pnUUID/pnUUID.h"
///////////////////////////////////////////////////////////////////////////////
//
@ -93,7 +94,7 @@ pyGameMgrInviteReceivedMsg::pyGameMgrInviteReceivedMsg(pfGameMgrMsg* msg): pyGam
message = nil; // wrong type, just clear it out
}
unsigned long pyGameMgrInviteReceivedMsg::InviterID() const
uint32_t pyGameMgrInviteReceivedMsg::InviterID() const
{
if (message)
{
@ -103,19 +104,17 @@ unsigned long pyGameMgrInviteReceivedMsg::InviterID() const
return 0;
}
std::wstring pyGameMgrInviteReceivedMsg::GameTypeID() const
plUUID pyGameMgrInviteReceivedMsg::GameTypeID() const
{
if (message)
{
const Srv2Cli_GameMgr_InviteReceived* gmMsg = (const Srv2Cli_GameMgr_InviteReceived*)message->netMsg;
wchar_t buffer[256];
GuidToString(gmMsg->gameTypeId, buffer, arrsize(buffer));
return buffer;
return gmMsg->gameTypeId;
}
return L"";
return kNilUuid;
}
unsigned long pyGameMgrInviteReceivedMsg::NewGameID() const
uint32_t pyGameMgrInviteReceivedMsg::NewGameID() const
{
if (message)
{
@ -134,7 +133,7 @@ pyGameMgrInviteRevokedMsg::pyGameMgrInviteRevokedMsg(pfGameMgrMsg* msg): pyGameM
message = nil; // wrong type, just clear it out
}
unsigned long pyGameMgrInviteRevokedMsg::InviterID() const
uint32_t pyGameMgrInviteRevokedMsg::InviterID() const
{
if (message)
{
@ -144,19 +143,17 @@ unsigned long pyGameMgrInviteRevokedMsg::InviterID() const
return 0;
}
std::wstring pyGameMgrInviteRevokedMsg::GameTypeID() const
plUUID pyGameMgrInviteRevokedMsg::GameTypeID() const
{
if (message)
{
const Srv2Cli_GameMgr_InviteRevoked* gmMsg = (const Srv2Cli_GameMgr_InviteRevoked*)message->netMsg;
wchar_t buffer[256];
GuidToString(gmMsg->gameTypeId, buffer, arrsize(buffer));
return buffer;
return gmMsg->gameTypeId;
}
return L"";
return kNilUuid;
}
unsigned long pyGameMgrInviteRevokedMsg::NewGameID() const
uint32_t pyGameMgrInviteRevokedMsg::NewGameID() const
{
if (message)
{

14
Sources/Plasma/FeatureLib/pfPython/Games/pyGameMgrMsg.h

@ -49,10 +49,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
// PURPOSE: Class wrapper for game manager messages
//
#include "HeadSpin.h"
#include "../pyGlueHelpers.h"
#include <string>
class pfGameMgrMsg;
class plUUID;
class pyGameMgrMsg
{
@ -95,9 +97,9 @@ public:
static void AddPlasmaClasses(PyObject* m);
unsigned long InviterID() const;
std::wstring GameTypeID() const;
unsigned long NewGameID() const;
uint32_t InviterID() const;
plUUID GameTypeID() const;
uint32_t NewGameID() const;
};
///////////////////////////////////////////////////////////////////////////////
@ -116,9 +118,9 @@ public:
static void AddPlasmaClasses(PyObject* m);
unsigned long InviterID() const;
std::wstring GameTypeID() const;
unsigned long NewGameID() const;
uint32_t InviterID() const;
plUUID GameTypeID() const;
uint32_t NewGameID() const;
};
#endif // pyGameMgrMsg_h

7
Sources/Plasma/FeatureLib/pfPython/Games/pyGameMgrMsgGlue.cpp

@ -45,6 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "pyGameMgrMsg.h"
#include "pfGameMgr/pfGameMgr.h"
#include "pnUUID/pnUUID.h"
#include "../pyEnum.h"
///////////////////////////////////////////////////////////////////////////////
@ -130,8 +131,7 @@ PYTHON_METHOD_DEFINITION_NOARGS(ptGameMgrInviteReceivedMsg, inviterID)
PYTHON_METHOD_DEFINITION_NOARGS(ptGameMgrInviteReceivedMsg, gameTypeID)
{
std::wstring retVal = self->fThis->GameTypeID();
return PyUnicode_FromWideChar(retVal.c_str(), retVal.length());
return PyString_FromString(self->fThis->GameTypeID().AsString().c_str());
}
PYTHON_METHOD_DEFINITION_NOARGS(ptGameMgrInviteReceivedMsg, newGameID)
@ -183,8 +183,7 @@ PYTHON_METHOD_DEFINITION_NOARGS(ptGameMgrInviteRevokedMsg, inviterID)
PYTHON_METHOD_DEFINITION_NOARGS(ptGameMgrInviteRevokedMsg, gameTypeID)
{
std::wstring retVal = self->fThis->GameTypeID();
return PyUnicode_FromWideChar(retVal.c_str(), retVal.length());
return PyString_FromString(self->fThis->GameTypeID().AsString().c_str());
}
PYTHON_METHOD_DEFINITION_NOARGS(ptGameMgrInviteRevokedMsg, newGameID)

14
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();
@ -2828,12 +2828,12 @@ void cyMisc::SendFriendInvite(const wchar_t email[], const wchar_t toName[])
if (RelVaultNode* pNode = VaultGetPlayerNodeIncRef())
{
VaultPlayerNode player(pNode);
Uuid inviteUuid = player.inviteUuid;
plUUID inviteUuid(player.inviteUuid);
// If we don't have an invite UUID set then make a new one
if (GuidIsNil(inviteUuid))
if (inviteUuid.IsNull())
{
inviteUuid = GuidGenerate();
inviteUuid = plUUID::Generate();
player.SetInviteUuid(inviteUuid);
}
@ -2844,11 +2844,9 @@ void cyMisc::SendFriendInvite(const wchar_t email[], const wchar_t toName[])
PyObject* cyMisc::PyGuidGenerate()
{
char guidStr[64];
Uuid newGuid = GuidGenerate();
GuidToString(newGuid, guidStr, arrsize(guidStr));
plUUID newGuid = plUUID::Generate();
return PyString_FromString(guidStr);
return PyString_FromString(newGuid.AsString().c_str());
}
PyObject* cyMisc::GetAIAvatarsByModelName(const char* name)

6
Sources/Plasma/FeatureLib/pfPython/cyMisc.h

@ -42,6 +42,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#ifndef cyMisc_h
#define cyMisc_h
#include <string>
/////////////////////////////////////////////////////////////////////////////
//
// NAME: cyMisc
@ -64,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;
@ -634,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);
//////////////////////////////////////////////////////////////////////////////
//

7
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;
}

3
Sources/Plasma/FeatureLib/pfPython/cyPythonInterface.cpp

@ -906,7 +906,8 @@ PyObject *ptImportHook_load_module_detail(ptImportHook *self, char* module_name,
PyObject* modules = PyImport_GetModuleDict();
hsAssert(PyDict_Check(modules), "sys.modules is not a dict");
if (result = PyDict_GetItemString(modules, module_name))
result = PyDict_GetItemString(modules, module_name);
if (result)
{
if (!PyModule_Check(result))
{

2
Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.cpp

@ -47,8 +47,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
//
//////////////////////////////////////////////////////////////////////////
#include <locale>
#include <Python.h>
#include <locale>
#include "HeadSpin.h"
#include "plgDispatch.h"
#include "pyGeometry3.h"

2
Sources/Plasma/FeatureLib/pfPython/pyAgeVault.cpp

@ -193,7 +193,7 @@ plUUID pyAgeVault::GetAgeGuid( void )
rvn->DecRef();
return uuid;
}
return plUUID();
return kNilUuid;
}

2
Sources/Plasma/FeatureLib/pfPython/pyAgeVault.h

@ -82,7 +82,7 @@ public:
static void AddPlasmaClasses(PyObject *m);
plUUID GetAgeGuid( void );
plUUID GetAgeGuid(void);
PyObject * GetAgeSDL() const; // returns pySDLStateDataRecord
void UpdateAgeSDL( pySDLStateDataRecord & pyrec );

2
Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.cpp

@ -111,5 +111,5 @@ plUUID pyDniInfoSource::GetAgeGuid( void ) const
return uuid;
}
return plUUID();
return kNilUuid;
}

2
Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.h

@ -74,7 +74,7 @@ public:
// name of current age
const char * GetAgeName( void ) const;
// unique identifier for this age instance
plUUID GetAgeGuid( void ) const;
plUUID GetAgeGuid(void) const;
};

2
Sources/Plasma/FeatureLib/pfPython/pyEnum.cpp

@ -107,7 +107,7 @@ static int EnumValue_print(PyObject *self, FILE *fp, int flags)
if (text == NULL)
return -1;
fprintf(fp, text); // and print it to the file
fprintf(fp, "%s", text); // and print it to the file
return 0;
}

1
Sources/Plasma/FeatureLib/pfPython/pyGUIControlDraggable.cpp

@ -40,6 +40,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
#include <Python.h>
#include "pyKey.h"
#pragma hdrstop

1
Sources/Plasma/FeatureLib/pfPython/pyGUIControlRadioGroup.cpp

@ -40,6 +40,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
#include <Python.h>
#include "pyKey.h"
#pragma hdrstop

1
Sources/Plasma/FeatureLib/pfPython/pyGUIPopUpMenu.cpp

@ -40,6 +40,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
#include <Python.h>
#include "pyKey.h"
#pragma hdrstop

2
Sources/Plasma/FeatureLib/pfPython/pyNotify.cpp

@ -141,7 +141,7 @@ void pyNotify::AddVarNumber(const char* name, float number)
fBuildMsg.AddVariableEvent(name, number);
}
void pyNotify::AddVarNumber(const char* name, int number)
void pyNotify::AddVarNumber(const char* name, int32_t number)
{
fBuildMsg.AddVariableEvent(name, number);
}

2
Sources/Plasma/FeatureLib/pfPython/pyNotify.h

@ -97,7 +97,7 @@ public:
virtual void AddPickEvent(bool enabled, pyKey* other, pyKey* self, pyPoint3 hitPoint);
virtual void AddControlKeyEvent( int32_t key, bool down );
virtual void AddVarNumber(const char* name, float number);
virtual void AddVarNumber(const char* name, int number);
virtual void AddVarNumber(const char* name, int32_t number);
virtual void AddVarNull(const char* name);
virtual void AddVarKey(const char* name, pyKey* key);
virtual void AddFacingEvent( bool enabled, pyKey* other, pyKey* self, float dot);

4
Sources/Plasma/FeatureLib/pfPython/pyNotifyGlue.cpp

@ -210,14 +210,14 @@ PYTHON_METHOD_DEFINITION(ptNotify, addVarNumber, args)
if (number == NULL || number == Py_None)
self->fThis->AddVarNull(name);
else if (PyInt_Check(number))
self->fThis->AddVarNumber(name, PyInt_AsLong(number));
self->fThis->AddVarNumber(name, static_cast<int32_t>(PyInt_AsLong(number)));
else if (PyLong_Check(number))
{
// try as int first
long i = PyLong_AsLong(number);
if (!PyErr_Occurred())
{
self->fThis->AddVarNumber(name, i);
self->fThis->AddVarNumber(name, static_cast<int32_t>(i));
}
else
{

10
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);
}
@ -671,7 +669,7 @@ void pyVault::CreateNeighborhood()
desc = plString::Format( "%s's %s", nc->GetPlayerName().c_str(), link.GetAgeInfo()->GetAgeInstanceName() );
}
plUUID guid(GuidGenerate());
plUUID guid = plUUID::Generate();
link.GetAgeInfo()->SetAgeInstanceGuid(&guid);
link.GetAgeInfo()->SetAgeUserDefinedName( title.c_str() );
link.GetAgeInfo()->SetAgeDescription( desc.c_str() );

10
Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNode.cpp

@ -58,6 +58,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "pyNetLinkingMgr.h"
#include "pyAgeInfoStruct.h"
#include "pnUUID/pnUUID.h"
#include "plVault/plVault.h"
// should only be created from C++ side
@ -228,15 +229,14 @@ void pyVaultAgeInfoNode::SetAgeUserDefinedName( const char * v )
{
}
const char * pyVaultAgeInfoNode::GetAgeInstanceGuid() const
plUUID pyVaultAgeInfoNode::GetAgeInstanceGuid() const
{
fAgeInstGuid[0] = 0;
if (fNode) {
VaultAgeInfoNode access(fNode);
GuidToString(access.ageInstUuid, fAgeInstGuid, arrsize(fAgeInstGuid));
return plUUID(access.ageInstUuid);
}
return fAgeInstGuid;
return kNilUuid;
}
void pyVaultAgeInfoNode::SetAgeInstanceGuid( const char * sguid )

4
Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNode.h

@ -56,12 +56,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
struct RelVaultNode;
class pyVaultSDLNode;
class pyAgeInfoStruct;
class plUUID;
class pyVaultAgeInfoNode : public pyVaultNode
{
private:
mutable char fAgeInstGuid[64];
mutable std::string fAgeFilename;
mutable std::string fAgeInstName;
mutable std::string fAgeUserName;
@ -105,7 +105,7 @@ public:
const char * GetAgeUserDefinedName() const;
void SetAgeUserDefinedName( const char * v );
const char * GetAgeInstanceGuid() const;
plUUID GetAgeInstanceGuid() const;
void SetAgeInstanceGuid( const char * guid );
const char * GetAgeDescription() const;

3
Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNodeGlue.cpp

@ -45,6 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "pyVaultAgeInfoNode.h"
#include "plVault/plVault.h"
#include "pnUUID/pnUUID.h"
// glue functions
PYTHON_CLASS_DEFINITION(ptVaultAgeInfoNode, pyVaultAgeInfoNode);
@ -147,7 +148,7 @@ PYTHON_METHOD_DEFINITION(ptVaultAgeInfoNode, setAgeUserDefinedName, args)
PYTHON_METHOD_DEFINITION_NOARGS(ptVaultAgeInfoNode, getAgeInstanceGuid)
{
return PyString_FromString(self->fThis->GetAgeInstanceGuid());
return PyString_FromPlString(self->fThis->GetAgeInstanceGuid().AsString());
}
PYTHON_METHOD_DEFINITION(ptVaultAgeInfoNode, setAgeInstanceGuid, args)

2
Sources/Plasma/FeatureLib/pfPython/pyVaultAgeLinkNode.h

@ -64,8 +64,6 @@ class pySpawnPointInfoRef;
class pyVaultAgeLinkNode : public pyVaultNode
{
private:
mutable std::string fAgeGuidStr; // for getting Age GUID
mutable plAgeLinkStruct fAgeLinkStruct; // for use with AsAgeLinkStruct()
protected:

3
Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.cpp

@ -192,7 +192,8 @@ void pyVaultImageNode::Image_SetImage(pyImage& image)
fMipmap = nil;
}
if (fMipmap = image.GetImage()) {
fMipmap = image.GetImage();
if (fMipmap) {
VaultImageNode access(fNode);
access.StuffImage(fMipmap);

12
Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNode.cpp

@ -49,6 +49,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "pyVaultMarkerGameNode.h"
#include "plVault/plVault.h"
#include "pnUUID/pnUUID.h"
// should only be created from C++ side
pyVaultMarkerGameNode::pyVaultMarkerGameNode(RelVaultNode* nfsNode)
@ -88,23 +89,20 @@ void pyVaultMarkerGameNode::SetGameName (const char v[])
}
}
const char * pyVaultMarkerGameNode::GetGameGuid () const
plUUID pyVaultMarkerGameNode::GetGameGuid() const
{
fGameGuid[0] = 0;
if (fNode) {
VaultMarkerGameNode access(fNode);
GuidToString(access.gameGuid, fGameGuid, arrsize(fGameGuid));
return access.gameGuid;
}
return fGameGuid;
return kNilUuid;
}
void pyVaultMarkerGameNode::SetGameGuid (const char v[])
{
if (fNode) {
VaultMarkerGameNode access(fNode);
Uuid uuid;
GuidFromString(v, &uuid);
plUUID uuid(v);
access.SetGameGuid(uuid);
}
}

4
Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNode.h

@ -56,12 +56,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "pnNetBase/pnNetBase.h"
struct RelVaultNode;
class plUUID;
class pyVaultMarkerGameNode : public pyVaultNode
{
private:
mutable char fGameName[kMaxVaultNodeStringLength];
mutable char fGameGuid[64];
protected:
// should only be created from C++ side
@ -86,7 +86,7 @@ public:
const char * GetGameName () const;
void SetGameName (const char v[]);
const char * GetGameGuid () const;
plUUID GetGameGuid() const;
void SetGameGuid (const char v[]);
};

3
Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNodeGlue.cpp

@ -45,6 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "pyVaultMarkerGameNode.h"
#include "plVault/plVault.h"
#include "pnUUID/pnUUID.h"
// glue functions
PYTHON_CLASS_DEFINITION(ptVaultMarkerGameNode, pyVaultMarkerGameNode);
@ -84,7 +85,7 @@ PYTHON_METHOD_DEFINITION(ptVaultMarkerGameNode, setGameName, args)
PYTHON_METHOD_DEFINITION_NOARGS(ptVaultMarkerGameNode, getGameGuid)
{
return PyString_FromString(self->fThis->GetGameGuid());
return PyString_FromPlString(self->fThis->GetGameGuid().AsString());
}
PYTHON_METHOD_DEFINITION(ptVaultMarkerGameNode, setGameGuid, args)

57
Sources/Plasma/FeatureLib/pfPython/pyVaultNode.cpp

@ -45,33 +45,36 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
//
//////////////////////////////////////////////////////////////////////
#include <exception>
#include <Python.h>
#include <exception>
#pragma hdrstop
#include "pyVaultNode.h"
#ifndef BUILDING_PYPLASMA
# include "pyVault.h"
# include "pyVaultSystemNode.h"
# include "pnNetCommon/plNetApp.h"
# include "plNetClientComm/plNetClientComm.h"
#endif
# include "pyImage.h"
# include "pyDniCoordinates.h"
# include "pyVaultNodeRef.h"
# include "pyVaultFolderNode.h"
# include "pyVaultPlayerInfoListNode.h"
# include "pyVaultImageNode.h"
# include "pyVaultTextNoteNode.h"
# include "pyVaultAgeLinkNode.h"
# include "pyVaultChronicleNode.h"
# include "pyVaultPlayerInfoNode.h"
# include "pyVaultMarkerGameNode.h"
# include "pyVaultAgeInfoNode.h"
# include "pyVaultAgeInfoListNode.h"
# include "pyVaultPlayerNode.h"
# include "pyVaultSDLNode.h"
#include "pyImage.h"
#include "pyDniCoordinates.h"
#include "pyVaultNodeRef.h"
#include "pyVaultFolderNode.h"
#include "pyVaultPlayerInfoListNode.h"
#include "pyVaultImageNode.h"
#include "pyVaultTextNoteNode.h"
#include "pyVaultAgeLinkNode.h"
#include "pyVaultChronicleNode.h"
#include "pyVaultPlayerInfoNode.h"
#include "pyVaultMarkerGameNode.h"
#include "pyVaultAgeInfoNode.h"
#include "pyVaultAgeInfoListNode.h"
#include "pyVaultPlayerNode.h"
#include "pyVaultSDLNode.h"
#include "pnUUID/pnUUID.h"
#include "plGImage/plMipmap.h"
#include "plVault/plVault.h"
@ -168,7 +171,6 @@ RelVaultNode * pyVaultNode::pyVaultNodeOperationCallback::GetNode () {
// only for python glue, do NOT call
pyVaultNode::pyVaultNode()
: fNode(nil)
, fCreateAgeGuid(nil)
, fCreateAgeName(nil)
{
}
@ -176,7 +178,6 @@ pyVaultNode::pyVaultNode()
// should only be created from C++ side
pyVaultNode::pyVaultNode( RelVaultNode* nfsNode )
: fNode(nfsNode)
, fCreateAgeGuid(nil)
, fCreateAgeName(nil)
{
if (fNode)
@ -187,7 +188,6 @@ pyVaultNode::~pyVaultNode()
{
if (fNode)
fNode->DecRef("pyVaultNode");
free(fCreateAgeGuid);
free(fCreateAgeName);
}
@ -322,20 +322,13 @@ const char * pyVaultNode::GetCreateAgeName( void )
return fCreateAgeName;
}
const char * pyVaultNode::GetCreateAgeGuid( void )
plUUID pyVaultNode::GetCreateAgeGuid(void) const
{
if (!fNode)
return "";
if (fCreateAgeGuid)
return fCreateAgeGuid;
if (fNode) {
fCreateAgeGuid = (char*)malloc(64);
GuidToString(fNode->createAgeUuid, fCreateAgeGuid, 64);
return fNode->createAgeUuid;
}
return fCreateAgeGuid;
return kNilUuid;
}
PyObject* pyVaultNode::GetCreateAgeCoords () {
@ -390,12 +383,8 @@ void pyVaultNode::SetCreateAgeName( const char * v )
void pyVaultNode::SetCreateAgeGuid( const char * v )
{
free(fCreateAgeGuid);
fCreateAgeGuid = nil;
ASSERT(fNode);
Uuid uuid;
GuidFromString(v, &uuid);
plUUID uuid(v);
fNode->SetCreateAgeUuid(uuid);
}

4
Sources/Plasma/FeatureLib/pfPython/pyVaultNode.h

@ -54,6 +54,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
struct RelVaultNode;
class plMipmap;
class pyImage;
class plUUID;
class pyDniCoordinates;
@ -97,7 +98,6 @@ public:
};
RelVaultNode * fNode;
mutable char * fCreateAgeGuid;
mutable char * fCreateAgeName;
protected:
@ -138,7 +138,7 @@ public:
uint32_t GetCreateTime( void );
uint32_t GetCreateAgeTime( void );
const char * GetCreateAgeName( void );
const char * GetCreateAgeGuid( void );
plUUID GetCreateAgeGuid(void) const;
PyObject* GetCreateAgeCoords ();
// public setters

3
Sources/Plasma/FeatureLib/pfPython/pyVaultNodeGlue.cpp

@ -44,6 +44,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#pragma hdrstop
#include "pyVaultNode.h"
#include "pnUUID/pnUUID.h"
#include "plVault/plVault.h"
// glue functions
@ -153,7 +154,7 @@ PYTHON_METHOD_DEFINITION_NOARGS(ptVaultNode, getCreateAgeName)
PYTHON_METHOD_DEFINITION_NOARGS(ptVaultNode, getCreateAgeGuid)
{
return PyString_FromString(self->fThis->GetCreateAgeGuid());
return PyString_FromPlString(self->fThis->GetCreateAgeGuid().AsString());
}
PYTHON_METHOD_DEFINITION_NOARGS(ptVaultNode, getCreateAgeCoords)

2
Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoListNode.cpp

@ -45,8 +45,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
//
//////////////////////////////////////////////////////////////////////
#include <algorithm>
#include <Python.h>
#include <algorithm>
#pragma hdrstop
#include "pyVaultPlayerInfoListNode.h"

17
Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNode.cpp

@ -49,6 +49,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "pyVaultPlayerInfoNode.h"
#include "plVault/plVault.h"
#include "pnUUID/pnUUID.h"
#ifndef BUILDING_PYPLASMA
# include "pyVault.h"
#endif
@ -152,20 +153,18 @@ void pyVaultPlayerInfoNode::Player_SetAgeGuid( const char * guidtext)
if (!fNode)
return;
Uuid ageInstId;
GuidFromString(guidtext, &ageInstId);
plUUID ageInstId(guidtext);
VaultPlayerInfoNode playerInfo(fNode);
playerInfo.SetAgeInstUuid(ageInstId);
}
const char * pyVaultPlayerInfoNode::Player_GetAgeGuid( void )
plUUID pyVaultPlayerInfoNode::Player_GetAgeGuid(void) const
{
if (!fNode)
return "";
VaultPlayerInfoNode playerInfo(fNode);
GuidToString(playerInfo.ageInstUuid, ansiAgeInstUuid, arrsize(ansiAgeInstUuid));
return ansiAgeInstUuid;
if (fNode) {
VaultPlayerInfoNode playerInfo(fNode);
return playerInfo.ageInstUuid;
}
return kNilUuid;
}
// online status

5
Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNode.h

@ -51,11 +51,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "pyVaultNode.h"
#include "pyGlueHelpers.h"
class plUUID;
class pyVaultPlayerInfoNode : public pyVaultNode
{
mutable char * ansiPlayerName;
mutable char * ansiAgeInstName;
mutable char ansiAgeInstUuid[256];
protected:
// should only be created from C++ side
@ -88,7 +89,7 @@ public:
void Player_SetAgeInstanceName( const char * agename );
const char * Player_GetAgeInstanceName( void );
void Player_SetAgeGuid( const char * guidtext);
const char * Player_GetAgeGuid( void );
plUUID Player_GetAgeGuid(void) const;
// online status
void Player_SetOnline( bool b );
bool Player_IsOnline( void );

3
Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNodeGlue.cpp

@ -44,6 +44,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#pragma hdrstop
#include "pyVaultPlayerInfoNode.h"
#include "pnUUID/pnUUID.h"
#include "plVault/plVault.h"
// glue functions
@ -122,7 +123,7 @@ PYTHON_METHOD_DEFINITION(ptVaultPlayerInfoNode, playerSetAgeGuid, args)
PYTHON_METHOD_DEFINITION_NOARGS(ptVaultPlayerInfoNode, playerGetAgeGuid)
{
return PyString_FromString(self->fThis->Player_GetAgeGuid());
return PyString_FromPlString(self->fThis->Player_GetAgeGuid().AsString());
}
PYTHON_METHOD_DEFINITION(ptVaultPlayerInfoNode, playerSetOnline, args)

4
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);
}

11
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
);

2
Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Nt/pnAceNtSocket.cpp

@ -489,7 +489,7 @@ static void SocketInitListen (
notify.buildId = 0;
notify.buildType = 0;
notify.branchId = 0;
notify.productId = 0;
notify.productId = kNilUuid;
notify.addr = listenAddr;
notify.buffer = sock->opRead.read.buffer;
notify.bytes = 0;

18
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
@ -428,6 +428,6 @@ FAsyncNotifySocketProc AsyncSocketFindNotifyProc (
*buildId = 0;
*buildType = 0;
*branchId = 0;
*productId = 0;
*productId = kNilUuid;
return nil;
}

2
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");
//============================================================================

2
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");
//============================================================================

2
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");
//============================================================================

2
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");
//============================================================================

1
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"

2
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");
//============================================================================

2
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");
//============================================================================

10
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;
};

2
Sources/Plasma/NucleusLib/pnMessage/plNotifyMsg.cpp

@ -607,7 +607,7 @@ void plNotifyMsg::AddVariableEvent( const char* name, float number )
//
// PURPOSE : Add a variable event record to this notify message
//
void plNotifyMsg::AddVariableEvent( const char* name, int number )
void plNotifyMsg::AddVariableEvent( const char* name, int32_t number )
{
// create the control key event record
proVariableEventData* pED = new proVariableEventData;

2
Sources/Plasma/NucleusLib/pnMessage/plNotifyMsg.h

@ -376,7 +376,7 @@ public:
void AddPickEvent( const plKey &other, const plKey& self, bool enabled, hsPoint3 hitPoint );
void AddControlKeyEvent( int32_t key, bool down );
void AddVariableEvent( const char* name, float number );
void AddVariableEvent( const char* name, int number );
void AddVariableEvent( const char* name, int32_t number );
void AddVariableEvent( const char* name );
void AddVariableEvent( const char *name, const plKey &key );
void AddFacingEvent( const plKey &other, const plKey &self, float dot, bool enabled);

4
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<Uuid> {
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

22
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;
}
////////////////////////////////////////////////////////////////////

1
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

30
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;

6
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;
};

2
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 {

42
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;
};

30
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;
};

6
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];
};

60
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
};

31
Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.cpp

@ -46,6 +46,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
***/
#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,9 +977,9 @@ void NetVaultNodeFieldArray::GetFieldValueString_LCS (
case NetVaultNode::kUuid_2:
case NetVaultNode::kUuid_3:
case NetVaultNode::kUuid_4: {
wchar_t tmp[64];
GuidToHex(*(Uuid *)fieldAddr, tmp, arrsize(tmp));
StrPrintf(dst, dstChars, L"hextoraw('%s')", tmp);
plString tmp = reinterpret_cast<plUUID*>(fieldAddr)->AsString();
StrPrintf(dst, dstChars, L"hextoraw('%s')", tmp.c_str());
}
break;

44
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; }

6
Sources/Plasma/NucleusLib/pnUUID/CMakeLists.txt

@ -7,10 +7,12 @@ set(pnUUID_SOURCES
if(WIN32)
set(pnUUID_SOURCES ${pnUUID_SOURCES} pnUUID_Win32.cpp)
else(WIN32)
set(pnUUID_SOURCES ${pnUUID_SOURCES} pnUUID_Unix.cpp)
endif(WIN32)
if(UNIX)
set(pnUUID_SOURCES ${pnUUID_SOURCES} pnUUID_Unix.cpp)
endif(UNIX)
set(pnUUID_HEADERS
pnUUID.h
)

39
Sources/Plasma/NucleusLib/pnUUID/pnUUID.cpp

@ -42,50 +42,39 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "pnUUID.h"
#include "hsStream.h"
plUUID::plUUID()
{
Clear();
}
static_assert(sizeof(plUUID) == sizeof(uint8_t[16]), "plUUID Must be the same size as a UUID");
plUUID::plUUID( const plString & s )
{
FromString( s );
}
const plUUID kNilUuid;
plUUID::plUUID( const char * s )
plUUID::plUUID()
{
FromString( s );
Clear();
}
plUUID::plUUID( const plUUID & other )
plUUID::plUUID(const plString& s)
{
CopyFrom( &other );
FromString(s.c_str());
}
plUUID::plUUID( const Uuid & uuid )
plUUID::plUUID(const plUUID& other)
{
memcpy(fData, uuid.data, sizeof(fData));
CopyFrom(&other);
}
void plUUID::Read( hsStream * s)
void plUUID::Read(hsStream* s)
{
s->LogSubStreamPushDesc("plUUID");
s->Read( sizeof( fData ), (void*)fData );
s->Read(sizeof(fData), (void*)fData);
}
void plUUID::Write( hsStream * s)
void plUUID::Write(hsStream* s)
{
s->Write( sizeof( fData ), (const void*)fData );
s->Write(sizeof(fData), (const void*)fData);
}
plString plUUID::AsString() const {
plString plUUID::AsString() const
{
plString str;
ToString(str);
return str;
}
plUUID::operator Uuid () const {
Uuid uuid;
memcpy(uuid.data, fData, sizeof(uuid.data));
return uuid;
}

48
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
{
@ -55,30 +56,31 @@ public:
uint8_t fData[16];
struct Match
{
const plUUID * fGuid;
Match( const plUUID * guid ):fGuid( guid ){}
bool operator()( const plUUID * guid ) const { return guid->IsEqualTo( fGuid );}
const plUUID* fGuid;
Match(const plUUID* guid) : fGuid(guid) {}
bool operator()(const plUUID* guid) const { return guid->IsEqualTo(fGuid); }
};
plUUID();
plUUID( const char * s );
plUUID( const plString & s );
plUUID( const plUUID & other );
plUUID( const Uuid & uuid );
void Clear();
bool IsNull() const;
bool IsSet() const { return !IsNull(); }
void CopyFrom( const plUUID * v );
void CopyFrom( const plUUID & v );
int CompareTo( const plUUID * v ) const;
bool IsEqualTo( const plUUID * v ) const;
bool FromString( const char * str );
bool FromString( const plString & str ) { return FromString( str.c_str() ); }
bool ToString( plString & out ) const;
plUUID(const plString& s);
plUUID(const plUUID& other);
void Clear();
bool IsNull() const;
bool IsSet() const { return !IsNull(); }
void CopyFrom(const plUUID* v);
void CopyFrom(const plUUID& v);
int CompareTo(const plUUID* v) const;
bool IsEqualTo(const plUUID* v) const;
bool FromString(const char* str);
bool FromString(const plString& str) { return FromString(str.c_str()); }
bool ToString(plString& out) const;
plString AsString() const;
void Read( hsStream * s );
void Write( hsStream * s );
operator plString ( void ) const { return AsString();}
void Read(hsStream* s);
void Write(hsStream* s);
operator bool () const { return !IsNull(); }
inline bool operator ! () const { return IsNull(); }
bool operator==(const plUUID& other) const {
return IsEqualTo(&other);
@ -89,7 +91,7 @@ public:
bool operator<(const plUUID& other) const {
return CompareTo(&other) == -1;
}
operator Uuid () const;
operator plString (void) const { return AsString(); }
static plUUID Generate();
};

23
Sources/Plasma/NucleusLib/pnUUID/pnUUID_Unix.cpp

@ -45,6 +45,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include <uuid/uuid.h>
// Check UUID size
static_assert(sizeof(plUUID) == sizeof(uuid_t), "plUUID and uuid_t types differ in size");
struct plUUIDHelper
{
static inline void CopyToPlasma( plUUID * dst, const uuid_t & src )
@ -64,7 +67,6 @@ struct plUUIDHelper
void plUUID::Clear()
{
uuid_t g;
plUUIDHelper::CopyToNative( g, this );
uuid_clear( g );
plUUIDHelper::CopyToPlasma( this, g );
}
@ -98,11 +100,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;
}
@ -126,12 +133,4 @@ plUUID plUUID::Generate()
return result;
}
#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 _preventLNK4221WarningStub()
{
}
#endif

5
Sources/Plasma/NucleusLib/pnUUID/pnUUID_Win32.cpp

@ -43,10 +43,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#ifdef HS_BUILD_FOR_WIN32
#include <rpc.h>
// Check UUID size
static_assert(sizeof(plUUID) == sizeof(GUID), "plUUID and Win32 GUID types differ in size");
void plUUID::Clear()
{
UuidCreateNil( (GUID *)this );

4
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()

69
Sources/Plasma/NucleusLib/pnUtils/Unix/pnUtUxUuid.cpp

@ -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 <http://www.gnu.org/licenses/>.
Additional permissions under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
(or a modified version of those libraries),
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
licensors of this Program grant you additional
permission to convey the resulting work. Corresponding Source for a
non-source form of such a combination shall include the source code for
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
work.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
/*****************************************************************************
*
* $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/Unix/pnUtUxUuid.cpp
*
***/
#include "../pnUtUuid.h"
/*****************************************************************************
*
* Uuid Unix implementation
*
***/
#ifdef HS_BUILD_FOR_UNIX
#include <uuid/uuid.h>
COMPILER_ASSERT(sizeof(Uuid) >= sizeof(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

186
Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Uuid.cpp

@ -1,186 +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 <http://www.gnu.org/licenses/>.
Additional permissions under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
(or a modified version of those libraries),
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
licensors of this Program grant you additional
permission to convey the resulting work. Corresponding Source for a
non-source form of such a combination shall include the source code for
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
work.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
/*****************************************************************************
*
* $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Uuid.cpp
*
***/
#include "../pnUtils.h"
#include <rpc.h>
#include <rpcdce.h>
#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");
//============================================================================
Uuid GuidGenerate () {
Uuid result;
UuidCreate( (GUID *)&result );
return result;
}
//============================================================================
void GuidClear (Uuid * uuid) {
UuidCreateNil((GUID *)uuid);
}
//============================================================================
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 );
}
//============================================================================
const wchar_t * GuidToString (const Uuid & uuid, wchar_t * dst, unsigned chars) {
wchar_t * src;
RPC_STATUS s;
s = UuidToStringW( (GUID *) &uuid, (unsigned short**)&src );
if (RPC_S_OK == s)
StrCopy(dst, src, chars);
else
StrCopy(dst, L"", chars);
RpcStringFreeW( (unsigned short**)&src );
return dst;
}
//============================================================================
const char * GuidToString (const Uuid & uuid, char * dst, unsigned chars) {
uint8_t * src;
RPC_STATUS s;
s = UuidToStringA( (GUID *) &uuid, &src );
if (RPC_S_OK == s)
StrCopy(dst, (char *)src, chars);
else
StrCopy(dst, "", chars);
RpcStringFreeA(&src);
return dst;
}
#endif // HS_BUILD_FOR_WIN32

1
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"

106
Sources/Plasma/NucleusLib/pnUtils/pnUtUuid.cpp

@ -1,106 +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 <http://www.gnu.org/licenses/>.
Additional permissions under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
(or a modified version of those libraries),
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
licensors of this Program grant you additional
permission to convey the resulting work. Corresponding Source for a
non-source form of such a combination shall include the source code for
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
work.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
/*****************************************************************************
*
* $/Plasma20/Sources/Plasma/NucleusLib/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);
}
//============================================================================
Uuid::Uuid (const uint8_t buf[], unsigned length) {
GuidFromHex(buf, length, this);
}
//============================================================================
unsigned GuidHash (const Uuid & uuid) {
CHashValue hash(&uuid.data, sizeof(uuid.data));
return hash.GetHash();
}
//============================================================================
static const wchar_t s_hexChars[] = L"0123456789ABCDEF";
const wchar_t * GuidToHex (const Uuid & uuid, wchar_t * dst, unsigned chars) {
wchar_t * str = (wchar_t*)malloc((sizeof(uuid.data) * 2 + 1) * sizeof(wchar_t));
wchar_t * cur = str;
for (unsigned i = 0; i < sizeof(uuid.data); ++i) {
*cur++ = s_hexChars[(uuid.data[i] >> 4) & 0x0f];
*cur++ = s_hexChars[uuid.data[i] & 0x0f];
}
*cur = 0;
StrCopy(dst, str, chars);
free(str);
return dst;
}
//============================================================================
bool GuidFromHex (const uint8_t buf[], unsigned length, Uuid * uuid) {
ASSERT(length == sizeof(uuid->data));
memcpy(uuid->data, buf, sizeof(uuid->data));
return true;
}

118
Sources/Plasma/NucleusLib/pnUtils/pnUtUuid.h

@ -1,118 +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 <http://www.gnu.org/licenses/>.
Additional permissions under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
(or a modified version of those libraries),
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
licensors of this Program grant you additional
permission to convey the resulting work. Corresponding Source for a
non-source form of such a combination shall include the source code for
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
work.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
/*****************************************************************************
*
* $/Plasma20/Sources/Plasma/NucleusLib/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 =(
Uuid GuidGenerate ();
void GuidClear (Uuid * uuid);
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);
unsigned GuidHash (const Uuid & uuid);
const wchar_t * GuidToString (const Uuid & uuid, wchar_t * dst, unsigned chars); // returns dst
const char * GuidToString (const Uuid & uuid, char * dst, unsigned chars); // returns dst
const wchar_t * GuidToHex (const Uuid & uuid, wchar_t * dst, unsigned chars); // returns dst
bool GuidFromHex (const uint8_t buf[], unsigned length, 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[]);
Uuid (const uint8_t buf[], unsigned length);
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

4
Sources/Plasma/PubUtilLib/plInputCore/plSceneInputInterface.cpp

@ -833,7 +833,7 @@ void plSceneInputInterface::ILinkOffereeToAge()
else if (!VaultGetOwnedAgeLink(&info, &link)) {
// We must have an owned copy of the age before we can offer it, so make one now
plUUID guid(GuidGenerate());
plUUID guid = plUUID::Generate();
info.SetAgeInstanceGuid(&guid);
plString title, desc;
@ -861,7 +861,7 @@ void plSceneInputInterface::ILinkOffereeToAge()
VaultAgeLinkNode linkAcc(linkNode);
if (linkAcc.volat) {
if (VaultUnregisterOwnedAgeAndWait(link.GetAgeInfo())) {
plUUID guid(GuidGenerate());
plUUID guid = plUUID::Generate();
link.GetAgeInfo()->SetAgeInstanceGuid(&guid);
VaultRegisterOwnedAgeAndWait(&link);
}

14
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);
@ -920,7 +920,7 @@ uint8_t plNetLinkingMgr::IPreProcessLink(void)
// BASIC LINK. Link to a unique instance of the age, if no instance specified.
case plNetCommon::LinkingRules::kBasicLink:
if (!info->HasAgeInstanceGuid()) {
plUUID newuuid(GuidGenerate());
plUUID newuuid = plUUID::Generate();
info->SetAgeInstanceGuid(&newuuid);
}
break;
@ -961,7 +961,7 @@ uint8_t plNetLinkingMgr::IPreProcessLink(void)
info->SetAgeDescription(desc.c_str());
}
if (!info->HasAgeInstanceGuid()) {
plUUID newuuid(GuidGenerate());
plUUID newuuid = plUUID::Generate();
info->SetAgeInstanceGuid(&newuuid);
}
@ -1002,7 +1002,7 @@ uint8_t plNetLinkingMgr::IPreProcessLink(void)
}
if (!info->HasAgeInstanceGuid()) {
plUUID newuuid(GuidGenerate());
plUUID newuuid = plUUID::Generate();
info->SetAgeInstanceGuid(&newuuid);
}

29
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,20 +590,23 @@ static void INetCliAuthAgeRequestCallback (
void * param,
unsigned ageMcpId,
unsigned ageVaultId,
const Uuid & ageInstId,
const plUUID& ageInstId,
plNetAddress gameAddr
) {
if (!IS_NET_ERROR(result) || result == kNetErrVaultNodeNotFound) {
s_age.ageInstId = ageInstId;
s_age.ageVaultId = ageVaultId;
wchar_t ageInstIdStr[64];
plString gameAddrStr = gameAddr.GetHostString();
plString ageInstIdStr = ageInstId.AsString();
LogMsg(
kLogPerf,
L"Connecting to game server %s, ageInstId %s",
gameAddr.GetHostString().ToWchar().GetData(),
GuidToString(ageInstId, ageInstIdStr, arrsize(ageInstIdStr))
gameAddrStr.c_str(),
ageInstIdStr.c_str()
);
NetCliGameDisconnect();
NetCliGameStartConnect(gameAddr.GetHost());
NetCliGameJoinAgeRequest(
@ -1118,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);
@ -1242,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
) {
}
@ -1282,7 +1285,7 @@ void NetCommRegisterVisitAge (
//============================================================================
void NetCommUnregisterVisitAge (
const Uuid & ageInstId,
const plUUID& ageInstId,
unsigned playerInt,
void * param
) {
@ -1296,7 +1299,7 @@ void NetCommConnectPlayerVault (
//============================================================================
void NetCommConnectAgeVault (
const Uuid & ageInstId,
const plUUID& ageInstId,
void * param
) {
}
@ -1330,7 +1333,7 @@ void NetCommSetCCRLevel (
void NetCommSendFriendInvite (
const wchar_t emailAddress[],
const wchar_t toName[],
const Uuid& inviteUuid
const plUUID& inviteUuid
) {
NetCliAuthSendFriendInvite(
emailAddress,

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save