Browse Source

Deprecate and remove NEWZERO macro

Michael Hansen 12 years ago
parent
commit
bc0d04da48
  1. 3
      Sources/Plasma/Apps/plClientPatcher/UruPlayer.cpp
  2. 2
      Sources/Plasma/Apps/plUruLauncher/SelfPatcher.cpp
  3. 3
      Sources/Plasma/CoreLib/HeadSpin.h
  4. 2
      Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp
  5. 2
      Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp
  6. 2
      Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGameGUIMgr.cpp
  7. 30
      Sources/Plasma/FeatureLib/pfGameMgr/BlueSpiral/pfGmBlueSpiral.cpp
  8. 32
      Sources/Plasma/FeatureLib/pfGameMgr/ClimbingWall/pfGmClimbingWall.cpp
  9. 42
      Sources/Plasma/FeatureLib/pfGameMgr/Heek/pfGmHeek.cpp
  10. 48
      Sources/Plasma/FeatureLib/pfGameMgr/Marker/pfGmMarker.cpp
  11. 20
      Sources/Plasma/FeatureLib/pfGameMgr/TicTacToe/pfGmTicTacToe.cpp
  12. 30
      Sources/Plasma/FeatureLib/pfGameMgr/VarSync/pfGmVarSync.cpp
  13. 29
      Sources/Plasma/FeatureLib/pfGameMgr/pfGameMgr.cpp
  14. 4
      Sources/Plasma/FeatureLib/pfGameMgr/pfGameMgr.h
  15. 6
      Sources/Plasma/FeatureLib/pfPython/pyAgeVault.cpp
  16. 10
      Sources/Plasma/FeatureLib/pfPython/pyVault.cpp
  17. 2
      Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNode.cpp
  18. 2
      Sources/Plasma/FeatureLib/pfPython/pyVaultAgeLinkNode.cpp
  19. 2
      Sources/Plasma/FeatureLib/pfPython/pyVaultChronicleNode.cpp
  20. 2
      Sources/Plasma/FeatureLib/pfPython/pyVaultFolderNode.cpp
  21. 2
      Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.cpp
  22. 2
      Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNode.cpp
  23. 19
      Sources/Plasma/FeatureLib/pfPython/pyVaultNode.cpp
  24. 2
      Sources/Plasma/FeatureLib/pfPython/pyVaultNodeRef.cpp
  25. 8
      Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoListNode.cpp
  26. 2
      Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNode.cpp
  27. 4
      Sources/Plasma/FeatureLib/pfPython/pyVaultSDLNode.cpp
  28. 4
      Sources/Plasma/FeatureLib/pfPython/pyVaultTextNoteNode.cpp
  29. 10
      Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcIo.h
  30. 12
      Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Nt/pnAceNtInt.h
  31. 11
      Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Nt/pnAceNtSocket.cpp
  32. 12
      Sources/Plasma/NucleusLib/pnNetCli/pnNcCli.cpp
  33. 15
      Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.cpp
  34. 2
      Sources/Plasma/NucleusLib/pnUtils/pnUtHash.h
  35. 6
      Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp
  36. 11
      Sources/Plasma/PubUtilLib/plMessage/plNetClientMgrMsg.h
  37. 3
      Sources/Plasma/PubUtilLib/plNetClient/plNetCliAgeJoiner.cpp
  38. 2
      Sources/Plasma/PubUtilLib/plNetClient/plNetCliAgeLeaver.cpp
  39. 10
      Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.cpp
  40. 12
      Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp
  41. 9
      Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.cpp
  42. 6
      Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.h
  43. 35
      Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.cpp
  44. 10
      Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglFile.cpp
  45. 13
      Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGame.cpp
  46. 11
      Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGateKeeper.cpp
  47. 1
      Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglTrans.cpp
  48. 2
      Sources/Plasma/PubUtilLib/plSDL/plSDL.h
  49. 197
      Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp
  50. 2
      Sources/Plasma/PubUtilLib/plVault/plVaultNodeAccess.cpp

3
Sources/Plasma/Apps/plClientPatcher/UruPlayer.cpp

@ -631,8 +631,7 @@ static void ProcessManifest (void * param) {
); );
if (i < kMaxManifestFileRequests) { if (i < kMaxManifestFileRequests) {
ProgressStream * stream; ProgressStream * stream = new ProgressStream;
stream = NEWZERO(ProgressStream);
if (!stream->Open(path, "wb")) { if (!stream->Open(path, "wb")) {
#ifdef PLASMA_EXTERNAL_RELEASE #ifdef PLASMA_EXTERNAL_RELEASE
MessageBox(nil, s_fileOpenError, "URU Launcher", MB_ICONERROR); MessageBox(nil, s_fileOpenError, "URU Launcher", MB_ICONERROR);

2
Sources/Plasma/Apps/plUruLauncher/SelfPatcher.cpp

@ -198,7 +198,7 @@ static void ManifestCallback (
SetText("Downloading new patcher..."); SetText("Downloading new patcher...");
StrToAnsi(ansi, s_newPatcherFile, arrsize(ansi)); StrToAnsi(ansi, s_newPatcherFile, arrsize(ansi));
SelfPatcherStream * stream = NEWZERO(SelfPatcherStream); SelfPatcherStream * stream = new SelfPatcherStream;
if (!stream->Open(ansi, "wb")) if (!stream->Open(ansi, "wb"))
ErrorAssert(__LINE__, __FILE__, "Failed to create file: %s, errno: %u", ansi, errno); ErrorAssert(__LINE__, __FILE__, "Failed to create file: %s, errno: %u", ansi, errno);

3
Sources/Plasma/CoreLib/HeadSpin.h

@ -446,9 +446,6 @@ inline float hsDegreesToRadians(float deg) { return float(deg * (M_PI / 180)); }
inline float hsRadiansToDegrees(float rad) { return float(rad * (180 / M_PI)); } inline float hsRadiansToDegrees(float rad) { return float(rad * (180 / M_PI)); }
#define hsInvert(a) (1 / (a)) #define hsInvert(a) (1 / (a))
#include <new>
#define NEWZERO(t) new(calloc(sizeof(t), 1)) t
#ifdef _MSC_VER #ifdef _MSC_VER
# define ALIGN(n) __declspec(align(n)) # define ALIGN(n) __declspec(align(n))
#else #else

2
Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp

@ -1223,7 +1223,7 @@ void pfConsole::AddLineF(const char * fmt, ...) {
//============================================================================ //============================================================================
void pfConsole::RunCommandAsync (const char cmd[]) { void pfConsole::RunCommandAsync (const char cmd[]) {
plConsoleMsg * consoleMsg = NEWZERO(plConsoleMsg); plConsoleMsg * consoleMsg = new plConsoleMsg;
consoleMsg->SetCmd(plConsoleMsg::kExecuteLine); consoleMsg->SetCmd(plConsoleMsg::kExecuteLine);
consoleMsg->SetString(cmd); consoleMsg->SetString(cmd);
// consoleMsg->SetBreakBeforeDispatch(true); // consoleMsg->SetBreakBeforeDispatch(true);

2
Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp

@ -6036,7 +6036,7 @@ PF_CONSOLE_GROUP( Age )
PF_CONSOLE_CMD(Age, ShowSDL, "", "Prints the age SDL values") PF_CONSOLE_CMD(Age, ShowSDL, "", "Prints the age SDL values")
{ {
plStateDataRecord * rec = NEWZERO(plStateDataRecord); plStateDataRecord * rec = new plStateDataRecord;
if (!VaultAgeGetAgeSDL(rec)) { if (!VaultAgeGetAgeSDL(rec)) {
PrintString("Age SDL not found"); PrintString("Age SDL not found");
delete rec; delete rec;

2
Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGameGUIMgr.cpp

@ -796,7 +796,7 @@ bool pfGameUIInputInterface::InterpretInputEvent( plInputEventMsg *pMsg )
if ((keymap->GetKey1().IsSatisfiedBy(combo)) || (keymap->GetKey2().IsSatisfiedBy(combo))) if ((keymap->GetKey1().IsSatisfiedBy(combo)) || (keymap->GetKey2().IsSatisfiedBy(combo)))
{ {
// tell the KI to take the shot // tell the KI to take the shot
plConsoleMsg * consoleMsg = NEWZERO(plConsoleMsg); plConsoleMsg * consoleMsg = new plConsoleMsg;
consoleMsg->SetCmd(plConsoleMsg::kExecuteLine); consoleMsg->SetCmd(plConsoleMsg::kExecuteLine);
consoleMsg->SetString("Game.KITakePicture"); consoleMsg->SetString("Game.KITakePicture");
consoleMsg->Send(nil, true); consoleMsg->Send(nil, true);

30
Sources/Plasma/FeatureLib/pfGameMgr/BlueSpiral/pfGmBlueSpiral.cpp

@ -59,7 +59,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
struct IBlueSpiral { struct IBlueSpiral {
pfGmBlueSpiral * gameCli; pfGmBlueSpiral * gameCli;
IBlueSpiral (pfGmBlueSpiral * gameCli); IBlueSpiral (pfGmBlueSpiral * gameCli) : gameCli(gameCli) { }
// pfGameCli event notification handlers // pfGameCli event notification handlers
void Recv (GameMsgHeader * msg, void * param); void Recv (GameMsgHeader * msg, void * param);
@ -88,7 +88,7 @@ static pfGameCli * BlueSpiralFactory (
unsigned gameId, unsigned gameId,
plKey receiver plKey receiver
) { ) {
return NEWZERO(pfGmBlueSpiral)(gameId, receiver); return new pfGmBlueSpiral(gameId, receiver);
} }
//============================================================================ //============================================================================
@ -110,16 +110,10 @@ AUTO_INIT_FUNC(RegisterBlueSpiralFactory) {
* *
***/ ***/
//============================================================================
IBlueSpiral::IBlueSpiral (pfGmBlueSpiral * gameCli)
: gameCli(gameCli)
{
}
//============================================================================ //============================================================================
void IBlueSpiral::OnPlayerJoined (const Srv2Cli_Game_PlayerJoined & msg) { void IBlueSpiral::OnPlayerJoined (const Srv2Cli_Game_PlayerJoined & msg) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
@ -127,7 +121,7 @@ void IBlueSpiral::OnPlayerJoined (const Srv2Cli_Game_PlayerJoined & msg) {
//============================================================================ //============================================================================
void IBlueSpiral::OnPlayerLeft (const Srv2Cli_Game_PlayerLeft & msg) { void IBlueSpiral::OnPlayerLeft (const Srv2Cli_Game_PlayerLeft & msg) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
@ -135,7 +129,7 @@ void IBlueSpiral::OnPlayerLeft (const Srv2Cli_Game_PlayerLeft & msg) {
//============================================================================ //============================================================================
void IBlueSpiral::OnInviteFailed (const Srv2Cli_Game_InviteFailed & msg) { void IBlueSpiral::OnInviteFailed (const Srv2Cli_Game_InviteFailed & msg) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
@ -143,42 +137,42 @@ void IBlueSpiral::OnInviteFailed (const Srv2Cli_Game_InviteFailed & msg) {
//============================================================================ //============================================================================
void IBlueSpiral::OnOwnerChange (const Srv2Cli_Game_OwnerChange & msg) { void IBlueSpiral::OnOwnerChange (const Srv2Cli_Game_OwnerChange & msg) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
//============================================================================ //============================================================================
void IBlueSpiral::RecvClothOrder (const Srv2Cli_BlueSpiral_ClothOrder & msg, void * param) { void IBlueSpiral::RecvClothOrder (const Srv2Cli_BlueSpiral_ClothOrder & msg, void * param) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
//============================================================================ //============================================================================
void IBlueSpiral::RecvSuccessfulHit (const Srv2Cli_BlueSpiral_SuccessfulHit & msg, void * param) { void IBlueSpiral::RecvSuccessfulHit (const Srv2Cli_BlueSpiral_SuccessfulHit & msg, void * param) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
//============================================================================ //============================================================================
void IBlueSpiral::RecvGameWon (const Srv2Cli_BlueSpiral_GameWon & msg, void * param) { void IBlueSpiral::RecvGameWon (const Srv2Cli_BlueSpiral_GameWon & msg, void * param) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
//============================================================================ //============================================================================
void IBlueSpiral::RecvGameOver (const Srv2Cli_BlueSpiral_GameOver & msg, void * param) { void IBlueSpiral::RecvGameOver (const Srv2Cli_BlueSpiral_GameOver & msg, void * param) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
//============================================================================ //============================================================================
void IBlueSpiral::RecvGameStarted (const Srv2Cli_BlueSpiral_GameStarted & msg, void * param) { void IBlueSpiral::RecvGameStarted (const Srv2Cli_BlueSpiral_GameStarted & msg, void * param) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
@ -197,7 +191,7 @@ pfGmBlueSpiral::pfGmBlueSpiral (
) )
: pfGameCli(gameId, receiver) : pfGameCli(gameId, receiver)
{ {
internal = NEWZERO(IBlueSpiral)(this); internal = new IBlueSpiral(this);
} }
//============================================================================ //============================================================================

32
Sources/Plasma/FeatureLib/pfGameMgr/ClimbingWall/pfGmClimbingWall.cpp

@ -59,7 +59,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
struct IClimbingWall { struct IClimbingWall {
pfGmClimbingWall * gameCli; pfGmClimbingWall * gameCli;
IClimbingWall (pfGmClimbingWall * gameCli); IClimbingWall (pfGmClimbingWall * gameCli) : gameCli(gameCli) { }
// pfGameCli event notification handlers // pfGameCli event notification handlers
void Recv (GameMsgHeader * msg, void * param); void Recv (GameMsgHeader * msg, void * param);
@ -89,7 +89,7 @@ static pfGameCli * ClimbingWallFactory (
unsigned gameId, unsigned gameId,
plKey receiver plKey receiver
) { ) {
return NEWZERO(pfGmClimbingWall)(gameId, receiver); return new pfGmClimbingWall(gameId, receiver);
} }
//============================================================================ //============================================================================
@ -111,16 +111,10 @@ AUTO_INIT_FUNC(RegisterClimbingWallFactory) {
* *
***/ ***/
//============================================================================
IClimbingWall::IClimbingWall (pfGmClimbingWall * gameCli)
: gameCli(gameCli)
{
}
//============================================================================ //============================================================================
void IClimbingWall::OnPlayerJoined (const Srv2Cli_Game_PlayerJoined & msg) { void IClimbingWall::OnPlayerJoined (const Srv2Cli_Game_PlayerJoined & msg) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
@ -128,7 +122,7 @@ void IClimbingWall::OnPlayerJoined (const Srv2Cli_Game_PlayerJoined & msg) {
//============================================================================ //============================================================================
void IClimbingWall::OnPlayerLeft (const Srv2Cli_Game_PlayerLeft & msg) { void IClimbingWall::OnPlayerLeft (const Srv2Cli_Game_PlayerLeft & msg) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
@ -136,7 +130,7 @@ void IClimbingWall::OnPlayerLeft (const Srv2Cli_Game_PlayerLeft & msg) {
//============================================================================ //============================================================================
void IClimbingWall::OnInviteFailed (const Srv2Cli_Game_InviteFailed & msg) { void IClimbingWall::OnInviteFailed (const Srv2Cli_Game_InviteFailed & msg) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
@ -144,49 +138,49 @@ void IClimbingWall::OnInviteFailed (const Srv2Cli_Game_InviteFailed & msg) {
//============================================================================ //============================================================================
void IClimbingWall::OnOwnerChange (const Srv2Cli_Game_OwnerChange & msg) { void IClimbingWall::OnOwnerChange (const Srv2Cli_Game_OwnerChange & msg) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
//============================================================================ //============================================================================
void IClimbingWall::RecvNumBlockersChanged (const Srv2Cli_ClimbingWall_NumBlockersChanged & msg, void * param) { void IClimbingWall::RecvNumBlockersChanged (const Srv2Cli_ClimbingWall_NumBlockersChanged & msg, void * param) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
//============================================================================ //============================================================================
void IClimbingWall::RecvReady (const Srv2Cli_ClimbingWall_Ready & msg, void * param) { void IClimbingWall::RecvReady (const Srv2Cli_ClimbingWall_Ready & msg, void * param) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
//============================================================================ //============================================================================
void IClimbingWall::RecvBlockersChanged (const Srv2Cli_ClimbingWall_BlockersChanged & msg, void * param) { void IClimbingWall::RecvBlockersChanged (const Srv2Cli_ClimbingWall_BlockersChanged & msg, void * param) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
//============================================================================ //============================================================================
void IClimbingWall::RecvPlayerEntered (const Srv2Cli_ClimbingWall_PlayerEntered & msg, void * param) { void IClimbingWall::RecvPlayerEntered (const Srv2Cli_ClimbingWall_PlayerEntered & msg, void * param) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
//============================================================================ //============================================================================
void IClimbingWall::RecvSuitMachineLocked (const Srv2Cli_ClimbingWall_SuitMachineLocked & msg, void * param) { void IClimbingWall::RecvSuitMachineLocked (const Srv2Cli_ClimbingWall_SuitMachineLocked & msg, void * param) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
//============================================================================ //============================================================================
void IClimbingWall::RecvGameOver (const Srv2Cli_ClimbingWall_GameOver & msg, void * param) { void IClimbingWall::RecvGameOver (const Srv2Cli_ClimbingWall_GameOver & msg, void * param) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
@ -205,7 +199,7 @@ pfGmClimbingWall::pfGmClimbingWall (
) )
: pfGameCli(gameId, receiver) : pfGameCli(gameId, receiver)
{ {
internal = NEWZERO(IClimbingWall)(this); internal = new IClimbingWall(this);
} }
//============================================================================ //============================================================================

42
Sources/Plasma/FeatureLib/pfGameMgr/Heek/pfGmHeek.cpp

@ -59,7 +59,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
struct IHeek { struct IHeek {
pfGmHeek * gameCli; pfGmHeek * gameCli;
IHeek (pfGmHeek * gameCli); IHeek (pfGmHeek * gameCli) : gameCli(gameCli) { }
// pfGameCli event notification handlers // pfGameCli event notification handlers
void Recv (GameMsgHeader * msg, void * param); void Recv (GameMsgHeader * msg, void * param);
@ -94,7 +94,7 @@ static pfGameCli * HeekFactory (
unsigned gameId, unsigned gameId,
plKey receiver plKey receiver
) { ) {
return NEWZERO(pfGmHeek)(gameId, receiver); return new pfGmHeek(gameId, receiver);
} }
//============================================================================ //============================================================================
@ -115,113 +115,107 @@ AUTO_INIT_FUNC(RegisterHeek) {
* *
***/ ***/
//============================================================================
IHeek::IHeek (pfGmHeek * gameCli)
: gameCli(gameCli)
{
}
//============================================================================ //============================================================================
void IHeek::OnPlayerJoined (const Srv2Cli_Game_PlayerJoined & msg) { void IHeek::OnPlayerJoined (const Srv2Cli_Game_PlayerJoined & msg) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
//============================================================================ //============================================================================
void IHeek::OnPlayerLeft (const Srv2Cli_Game_PlayerLeft & msg) { void IHeek::OnPlayerLeft (const Srv2Cli_Game_PlayerLeft & msg) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
//============================================================================ //============================================================================
void IHeek::OnInviteFailed (const Srv2Cli_Game_InviteFailed & msg) { void IHeek::OnInviteFailed (const Srv2Cli_Game_InviteFailed & msg) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
//============================================================================ //============================================================================
void IHeek::OnOwnerChange (const Srv2Cli_Game_OwnerChange & msg) { void IHeek::OnOwnerChange (const Srv2Cli_Game_OwnerChange & msg) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
//============================================================================ //============================================================================
void IHeek::RecvPlayGame (const Srv2Cli_Heek_PlayGame & msg, void * param) { void IHeek::RecvPlayGame (const Srv2Cli_Heek_PlayGame & msg, void * param) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
//============================================================================ //============================================================================
void IHeek::RecvGoodbye (const Srv2Cli_Heek_Goodbye & msg, void * param) { void IHeek::RecvGoodbye (const Srv2Cli_Heek_Goodbye & msg, void * param) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
//============================================================================ //============================================================================
void IHeek::RecvWelcome (const Srv2Cli_Heek_Welcome & msg, void * param) { void IHeek::RecvWelcome (const Srv2Cli_Heek_Welcome & msg, void * param) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
//============================================================================ //============================================================================
void IHeek::RecvDrop (const Srv2Cli_Heek_Drop & msg, void * param) { void IHeek::RecvDrop (const Srv2Cli_Heek_Drop & msg, void * param) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
//============================================================================ //============================================================================
void IHeek::RecvSetup (const Srv2Cli_Heek_Setup & msg, void * param) { void IHeek::RecvSetup (const Srv2Cli_Heek_Setup & msg, void * param) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
//============================================================================ //============================================================================
void IHeek::RecvLightState (const Srv2Cli_Heek_LightState & msg, void * param) { void IHeek::RecvLightState (const Srv2Cli_Heek_LightState & msg, void * param) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
//============================================================================ //============================================================================
void IHeek::RecvInterfaceState (const Srv2Cli_Heek_InterfaceState & msg, void * param) { void IHeek::RecvInterfaceState (const Srv2Cli_Heek_InterfaceState & msg, void * param) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
//============================================================================ //============================================================================
void IHeek::RecvCountdownState (const Srv2Cli_Heek_CountdownState & msg, void * param) { void IHeek::RecvCountdownState (const Srv2Cli_Heek_CountdownState & msg, void * param) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
//============================================================================ //============================================================================
void IHeek::RecvWinLose (const Srv2Cli_Heek_WinLose & msg, void * param) { void IHeek::RecvWinLose (const Srv2Cli_Heek_WinLose & msg, void * param) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
//============================================================================ //============================================================================
void IHeek::RecvGameWin (const Srv2Cli_Heek_GameWin & msg, void * param) { void IHeek::RecvGameWin (const Srv2Cli_Heek_GameWin & msg, void * param) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
//============================================================================ //============================================================================
void IHeek::RecvPointUpdate (const Srv2Cli_Heek_PointUpdate & msg, void * param) { void IHeek::RecvPointUpdate (const Srv2Cli_Heek_PointUpdate & msg, void * param) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
@ -240,7 +234,7 @@ pfGmHeek::pfGmHeek (
) )
: pfGameCli(gameId, receiver) : pfGameCli(gameId, receiver)
{ {
internal = NEWZERO(IHeek)(this); internal = new IHeek(this);
} }
//============================================================================ //============================================================================

48
Sources/Plasma/FeatureLib/pfGameMgr/Marker/pfGmMarker.cpp

@ -59,7 +59,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
struct IMarker { struct IMarker {
pfGmMarker * gameCli; pfGmMarker * gameCli;
IMarker (pfGmMarker * gameCli); IMarker (pfGmMarker * gameCli) : gameCli(gameCli) { }
// pfGameCli event notification handlers // pfGameCli event notification handlers
void Recv (GameMsgHeader * msg, void * param); void Recv (GameMsgHeader * msg, void * param);
@ -97,7 +97,7 @@ static pfGameCli * MarkerFactory (
unsigned gameId, unsigned gameId,
plKey receiver plKey receiver
) { ) {
return NEWZERO(pfGmMarker)(gameId, receiver); return new pfGmMarker(gameId, receiver);
} }
//============================================================================ //============================================================================
@ -119,16 +119,10 @@ AUTO_INIT_FUNC(RegisterMarkerFactory) {
* *
***/ ***/
//============================================================================
IMarker::IMarker (pfGmMarker * gameCli)
: gameCli(gameCli)
{
}
//============================================================================ //============================================================================
void IMarker::OnPlayerJoined (const Srv2Cli_Game_PlayerJoined & msg) { void IMarker::OnPlayerJoined (const Srv2Cli_Game_PlayerJoined & msg) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
@ -136,7 +130,7 @@ void IMarker::OnPlayerJoined (const Srv2Cli_Game_PlayerJoined & msg) {
//============================================================================ //============================================================================
void IMarker::OnPlayerLeft (const Srv2Cli_Game_PlayerLeft & msg) { void IMarker::OnPlayerLeft (const Srv2Cli_Game_PlayerLeft & msg) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
@ -144,7 +138,7 @@ void IMarker::OnPlayerLeft (const Srv2Cli_Game_PlayerLeft & msg) {
//============================================================================ //============================================================================
void IMarker::OnInviteFailed (const Srv2Cli_Game_InviteFailed & msg) { void IMarker::OnInviteFailed (const Srv2Cli_Game_InviteFailed & msg) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
@ -152,7 +146,7 @@ void IMarker::OnInviteFailed (const Srv2Cli_Game_InviteFailed & msg) {
//============================================================================ //============================================================================
void IMarker::OnOwnerChange (const Srv2Cli_Game_OwnerChange & msg) { void IMarker::OnOwnerChange (const Srv2Cli_Game_OwnerChange & msg) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
@ -160,7 +154,7 @@ void IMarker::OnOwnerChange (const Srv2Cli_Game_OwnerChange & msg) {
//============================================================================ //============================================================================
void IMarker::RecvTemplateCreated (const Srv2Cli_Marker_TemplateCreated & msg, void * param) { void IMarker::RecvTemplateCreated (const Srv2Cli_Marker_TemplateCreated & msg, void * param) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
@ -168,63 +162,63 @@ void IMarker::RecvTemplateCreated (const Srv2Cli_Marker_TemplateCreated & msg, v
//============================================================================ //============================================================================
void IMarker::RecvTeamAssigned (const Srv2Cli_Marker_TeamAssigned & msg, void * param) { void IMarker::RecvTeamAssigned (const Srv2Cli_Marker_TeamAssigned & msg, void * param) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
//============================================================================ //============================================================================
void IMarker::RecvGameType (const Srv2Cli_Marker_GameType & msg, void * param) { void IMarker::RecvGameType (const Srv2Cli_Marker_GameType & msg, void * param) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
//============================================================================ //============================================================================
void IMarker::RecvGameStarted (const Srv2Cli_Marker_GameStarted & msg, void * param) { void IMarker::RecvGameStarted (const Srv2Cli_Marker_GameStarted & msg, void * param) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
//============================================================================ //============================================================================
void IMarker::RecvGamePaused (const Srv2Cli_Marker_GamePaused & msg, void * param) { void IMarker::RecvGamePaused (const Srv2Cli_Marker_GamePaused & msg, void * param) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
//============================================================================ //============================================================================
void IMarker::RecvGameReset (const Srv2Cli_Marker_GameReset & msg, void * param) { void IMarker::RecvGameReset (const Srv2Cli_Marker_GameReset & msg, void * param) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
//============================================================================ //============================================================================
void IMarker::RecvGameOver (const Srv2Cli_Marker_GameOver & msg, void * param) { void IMarker::RecvGameOver (const Srv2Cli_Marker_GameOver & msg, void * param) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
//============================================================================ //============================================================================
void IMarker::RecvGameNameChanged (const Srv2Cli_Marker_GameNameChanged & msg, void * param) { void IMarker::RecvGameNameChanged (const Srv2Cli_Marker_GameNameChanged & msg, void * param) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
//============================================================================ //============================================================================
void IMarker::RecvTimeLimitChanged (const Srv2Cli_Marker_TimeLimitChanged & msg, void * param) { void IMarker::RecvTimeLimitChanged (const Srv2Cli_Marker_TimeLimitChanged & msg, void * param) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
//============================================================================ //============================================================================
void IMarker::RecvGameDeleted (const Srv2Cli_Marker_GameDeleted & msg, void * param) { void IMarker::RecvGameDeleted (const Srv2Cli_Marker_GameDeleted & msg, void * param) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
@ -234,28 +228,28 @@ void IMarker::RecvGameDeleted (const Srv2Cli_Marker_GameDeleted & msg, void * pa
//============================================================================ //============================================================================
void IMarker::RecvMarkerAdded (const Srv2Cli_Marker_MarkerAdded & msg, void * param) { void IMarker::RecvMarkerAdded (const Srv2Cli_Marker_MarkerAdded & msg, void * param) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
//============================================================================ //============================================================================
void IMarker::RecvMarkerDeleted (const Srv2Cli_Marker_MarkerDeleted & msg, void * param) { void IMarker::RecvMarkerDeleted (const Srv2Cli_Marker_MarkerDeleted & msg, void * param) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
//============================================================================ //============================================================================
void IMarker::RecvMarkerNameChanged (const Srv2Cli_Marker_MarkerNameChanged & msg, void * param) { void IMarker::RecvMarkerNameChanged (const Srv2Cli_Marker_MarkerNameChanged & msg, void * param) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
//============================================================================ //============================================================================
void IMarker::RecvMarkerCaptured (const Srv2Cli_Marker_MarkerCaptured & msg, void * param) { void IMarker::RecvMarkerCaptured (const Srv2Cli_Marker_MarkerCaptured & msg, void * param) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
@ -274,7 +268,7 @@ pfGmMarker::pfGmMarker (
) )
: pfGameCli(gameId, receiver) : pfGameCli(gameId, receiver)
{ {
internal = NEWZERO(IMarker)(this); internal = new IMarker(this);
} }
//============================================================================ //============================================================================

20
Sources/Plasma/FeatureLib/pfGameMgr/TicTacToe/pfGmTicTacToe.cpp

@ -89,7 +89,7 @@ static pfGameCli * TicTacToeFactory (
unsigned gameId, unsigned gameId,
plKey receiver plKey receiver
) { ) {
return NEWZERO(pfGmTicTacToe)(gameId, receiver); return new pfGmTicTacToe(gameId, receiver);
} }
//============================================================================ //============================================================================
@ -113,7 +113,7 @@ AUTO_INIT_FUNC(RegisterTicTacToeFactory) {
//============================================================================ //============================================================================
ITicTacToe::ITicTacToe (pfGmTicTacToe * gameCli) ITicTacToe::ITicTacToe (pfGmTicTacToe * gameCli)
: gameCli(gameCli) : gameCli(gameCli), myself(0), other(0)
{ {
// Fill the board with space chars // Fill the board with space chars
memset(board, ' ', sizeof(board)); memset(board, ' ', sizeof(board));
@ -122,7 +122,7 @@ ITicTacToe::ITicTacToe (pfGmTicTacToe * gameCli)
//============================================================================ //============================================================================
void ITicTacToe::OnPlayerJoined (const Srv2Cli_Game_PlayerJoined & msg) { void ITicTacToe::OnPlayerJoined (const Srv2Cli_Game_PlayerJoined & msg) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
@ -130,7 +130,7 @@ void ITicTacToe::OnPlayerJoined (const Srv2Cli_Game_PlayerJoined & msg) {
//============================================================================ //============================================================================
void ITicTacToe::OnPlayerLeft (const Srv2Cli_Game_PlayerLeft & msg) { void ITicTacToe::OnPlayerLeft (const Srv2Cli_Game_PlayerLeft & msg) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
@ -138,7 +138,7 @@ void ITicTacToe::OnPlayerLeft (const Srv2Cli_Game_PlayerLeft & msg) {
//============================================================================ //============================================================================
void ITicTacToe::OnInviteFailed (const Srv2Cli_Game_InviteFailed & msg) { void ITicTacToe::OnInviteFailed (const Srv2Cli_Game_InviteFailed & msg) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
@ -146,7 +146,7 @@ void ITicTacToe::OnInviteFailed (const Srv2Cli_Game_InviteFailed & msg) {
//============================================================================ //============================================================================
void ITicTacToe::OnOwnerChange (const Srv2Cli_Game_OwnerChange & msg) { void ITicTacToe::OnOwnerChange (const Srv2Cli_Game_OwnerChange & msg) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
@ -163,14 +163,14 @@ void ITicTacToe::RecvGameStarted (const Srv2Cli_TTT_GameStarted & msg, void * pa
other = 'X'; other = 'X';
} }
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
//============================================================================ //============================================================================
void ITicTacToe::RecvGameOver (const Srv2Cli_TTT_GameOver & msg, void * param) { void ITicTacToe::RecvGameOver (const Srv2Cli_TTT_GameOver & msg, void * param) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
@ -185,7 +185,7 @@ void ITicTacToe::RecvMoveMade (const Srv2Cli_TTT_MoveMade & msg, void * param) {
else else
board[msg.row][msg.col] = other; board[msg.row][msg.col] = other;
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
@ -204,7 +204,7 @@ pfGmTicTacToe::pfGmTicTacToe (
) )
: pfGameCli(gameId, receiver) : pfGameCli(gameId, receiver)
{ {
internal = NEWZERO(ITicTacToe)(this); internal = new ITicTacToe(this);
} }
//============================================================================ //============================================================================

30
Sources/Plasma/FeatureLib/pfGameMgr/VarSync/pfGmVarSync.cpp

@ -59,7 +59,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
struct IVarSync { struct IVarSync {
pfGmVarSync * gameCli; pfGmVarSync * gameCli;
IVarSync (pfGmVarSync * gameCli); IVarSync (pfGmVarSync * gameCli) : gameCli(gameCli) { }
// pfGameCli event notification handlers // pfGameCli event notification handlers
void Recv (GameMsgHeader * msg, void * param); void Recv (GameMsgHeader * msg, void * param);
@ -88,7 +88,7 @@ static pfGameCli * VarSyncFactory (
unsigned gameId, unsigned gameId,
plKey receiver plKey receiver
) { ) {
return NEWZERO(pfGmVarSync)(gameId, receiver); return new pfGmVarSync(gameId, receiver);
} }
//============================================================================ //============================================================================
@ -110,16 +110,10 @@ AUTO_INIT_FUNC(RegisterVarSyncFactory) {
* *
***/ ***/
//============================================================================
IVarSync::IVarSync (pfGmVarSync * gameCli)
: gameCli(gameCli)
{
}
//============================================================================ //============================================================================
void IVarSync::OnPlayerJoined (const Srv2Cli_Game_PlayerJoined & msg) { void IVarSync::OnPlayerJoined (const Srv2Cli_Game_PlayerJoined & msg) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
@ -127,7 +121,7 @@ void IVarSync::OnPlayerJoined (const Srv2Cli_Game_PlayerJoined & msg) {
//============================================================================ //============================================================================
void IVarSync::OnPlayerLeft (const Srv2Cli_Game_PlayerLeft & msg) { void IVarSync::OnPlayerLeft (const Srv2Cli_Game_PlayerLeft & msg) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
@ -135,7 +129,7 @@ void IVarSync::OnPlayerLeft (const Srv2Cli_Game_PlayerLeft & msg) {
//============================================================================ //============================================================================
void IVarSync::OnInviteFailed (const Srv2Cli_Game_InviteFailed & msg) { void IVarSync::OnInviteFailed (const Srv2Cli_Game_InviteFailed & msg) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
@ -143,42 +137,42 @@ void IVarSync::OnInviteFailed (const Srv2Cli_Game_InviteFailed & msg) {
//============================================================================ //============================================================================
void IVarSync::OnOwnerChange (const Srv2Cli_Game_OwnerChange & msg) { void IVarSync::OnOwnerChange (const Srv2Cli_Game_OwnerChange & msg) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
//============================================================================ //============================================================================
void IVarSync::RecvStringVarChanged (const Srv2Cli_VarSync_StringVarChanged & msg, void * param) { void IVarSync::RecvStringVarChanged (const Srv2Cli_VarSync_StringVarChanged & msg, void * param) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
//============================================================================ //============================================================================
void IVarSync::RecvNumericVarChanged (const Srv2Cli_VarSync_NumericVarChanged & msg, void * param) { void IVarSync::RecvNumericVarChanged (const Srv2Cli_VarSync_NumericVarChanged & msg, void * param) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
//============================================================================ //============================================================================
void IVarSync::RecvAllVarsSent (const Srv2Cli_VarSync_AllVarsSent & msg, void * param) { void IVarSync::RecvAllVarsSent (const Srv2Cli_VarSync_AllVarsSent & msg, void * param) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
//============================================================================ //============================================================================
void IVarSync::RecvStringVarCreated (const Srv2Cli_VarSync_StringVarCreated & msg, void * param) { void IVarSync::RecvStringVarCreated (const Srv2Cli_VarSync_StringVarCreated & msg, void * param) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
//============================================================================ //============================================================================
void IVarSync::RecvNumericVarCreated (const Srv2Cli_VarSync_NumericVarCreated & msg, void * param) { void IVarSync::RecvNumericVarCreated (const Srv2Cli_VarSync_NumericVarCreated & msg, void * param) {
pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); pfGameCliMsg * gameCliMsg = new pfGameCliMsg;
gameCliMsg->Set(gameCli, msg); gameCliMsg->Set(gameCli, msg);
gameCliMsg->Send(gameCli->GetReceiver()); gameCliMsg->Send(gameCli->GetReceiver());
} }
@ -196,7 +190,7 @@ pfGmVarSync::pfGmVarSync (
) )
: pfGameCli(gameId, receiver) : pfGameCli(gameId, receiver)
{ {
internal = NEWZERO(IVarSync)(this); internal = new IVarSync(this);
} }
//============================================================================ //============================================================================

29
Sources/Plasma/FeatureLib/pfGameMgr/pfGameMgr.cpp

@ -209,7 +209,7 @@ void IGameMgr::RecvGameInstance (const Srv2Cli_GameMgr_GameInstance & msg, void
//============================================================================ //============================================================================
void IGameMgr::RecvInviteReceived (const Srv2Cli_GameMgr_InviteReceived & msg, void * param) { void IGameMgr::RecvInviteReceived (const Srv2Cli_GameMgr_InviteReceived & msg, void * param) {
pfGameMgrMsg * gameMgrMsg = NEWZERO(pfGameMgrMsg); pfGameMgrMsg * gameMgrMsg = new pfGameMgrMsg;
gameMgrMsg->Set(msg); gameMgrMsg->Set(msg);
for (unsigned i = 0; i < s_receivers.Count(); ++i) for (unsigned i = 0; i < s_receivers.Count(); ++i)
gameMgrMsg->AddReceiver(s_receivers[i]); gameMgrMsg->AddReceiver(s_receivers[i]);
@ -218,7 +218,7 @@ void IGameMgr::RecvInviteReceived (const Srv2Cli_GameMgr_InviteReceived & msg, v
//============================================================================ //============================================================================
void IGameMgr::RecvInviteRevoked (const Srv2Cli_GameMgr_InviteRevoked & msg, void * param) { void IGameMgr::RecvInviteRevoked (const Srv2Cli_GameMgr_InviteRevoked & msg, void * param) {
pfGameMgrMsg * gameMgrMsg = NEWZERO(pfGameMgrMsg); pfGameMgrMsg * gameMgrMsg = new pfGameMgrMsg;
gameMgrMsg->Set(msg); gameMgrMsg->Set(msg);
for (unsigned i = 0; i < s_receivers.Count(); ++i) for (unsigned i = 0; i < s_receivers.Count(); ++i)
gameMgrMsg->AddReceiver(s_receivers[i]); gameMgrMsg->AddReceiver(s_receivers[i]);
@ -275,12 +275,6 @@ void IGameMgr::StaticRecv (GameMsgHeader * msg) {
* *
***/ ***/
//============================================================================
pfGameMgrMsg::pfGameMgrMsg () {
netMsg = nil;
}
//============================================================================ //============================================================================
pfGameMgrMsg::~pfGameMgrMsg () { pfGameMgrMsg::~pfGameMgrMsg () {
@ -301,13 +295,6 @@ void pfGameMgrMsg::Set (const GameMsgHeader & msg) {
* *
***/ ***/
//============================================================================
pfGameCliMsg::pfGameCliMsg () {
gameCli = nil;
netMsg = nil;
}
//============================================================================ //============================================================================
pfGameCliMsg::~pfGameCliMsg () { pfGameCliMsg::~pfGameCliMsg () {
@ -403,7 +390,7 @@ void pfGameMgr::JoinGame (
msg.messageBytes = msgBytes; msg.messageBytes = msgBytes;
GameMgrSend(&msg, NEWZERO(JoinTransState)(receiver)); GameMgrSend(&msg, new JoinTransState(receiver));
} }
//============================================================================ //============================================================================
@ -431,7 +418,7 @@ void pfGameMgr::CreateGame (
msg->createDataBytes = initBytes; msg->createDataBytes = initBytes;
memcpy(msg->createData, initData, initBytes); memcpy(msg->createData, initData, initBytes);
GameMgrSend(msg, NEWZERO(JoinTransState)(receiver)); GameMgrSend(msg, new JoinTransState(receiver));
free(msg); free(msg);
} }
@ -462,7 +449,7 @@ void pfGameMgr::JoinCommonGame (
msg->createDataBytes = initBytes; msg->createDataBytes = initBytes;
memcpy(msg->createData, initData, initBytes); memcpy(msg->createData, initData, initBytes);
GameMgrSend(msg, NEWZERO(JoinTransState)(receiver)); GameMgrSend(msg, new JoinTransState(receiver));
free(msg); free(msg);
} }
@ -479,7 +466,7 @@ pfGameCli::pfGameCli (
unsigned gameId, unsigned gameId,
plKey receiver plKey receiver
) { ) {
internal = NEWZERO(IGameCli)(this, gameId, receiver); internal = new IGameCli(this, gameId, receiver);
} }
//============================================================================ //============================================================================
@ -567,7 +554,9 @@ IGameCli::IGameCli (
plKey receiver plKey receiver
) : THashKeyVal<unsigned>(gameId) ) : THashKeyVal<unsigned>(gameId)
, gameCli(gameCli) , gameCli(gameCli)
, factory(nil)
, receiver(receiver) , receiver(receiver)
, playerCount(0)
{ {
s_games.Add(this); s_games.Add(this);
} }
@ -651,7 +640,7 @@ TransState::TransState (unsigned transId, void * param)
//============================================================================ //============================================================================
void GameMgrRegisterGameType (const GameTypeReg & reg) { void GameMgrRegisterGameType (const GameTypeReg & reg) {
(void)NEWZERO(Factory)(reg); (void)new Factory(reg);
} }
//============================================================================ //============================================================================

4
Sources/Plasma/FeatureLib/pfGameMgr/pfGameMgr.h

@ -86,7 +86,7 @@ public:
void Read(hsStream *, hsResMgr *) { FATAL("not impl"); } void Read(hsStream *, hsResMgr *) { FATAL("not impl"); }
void Write(hsStream *, hsResMgr *) { FATAL("not impl"); } void Write(hsStream *, hsResMgr *) { FATAL("not impl"); }
pfGameMgrMsg (); pfGameMgrMsg () : netMsg(nil) { }
~pfGameMgrMsg (); ~pfGameMgrMsg ();
void Set (const GameMsgHeader & msg); void Set (const GameMsgHeader & msg);
@ -109,7 +109,7 @@ public:
GETINTERFACE_ANY(pfGameCliMsg, plMessage); GETINTERFACE_ANY(pfGameCliMsg, plMessage);
#pragma warning(pop) #pragma warning(pop)
pfGameCliMsg (); pfGameCliMsg () : gameCli(nil), netMsg(nil) { }
~pfGameCliMsg (); ~pfGameCliMsg ();
void Read(hsStream *, hsResMgr *) { FATAL("not impl"); } void Read(hsStream *, hsResMgr *) { FATAL("not impl"); }

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

@ -229,7 +229,7 @@ void pyAgeVault::AddChronicleEntry( const char * name, uint32_t type, const char
// Add a new device. // Add a new device.
void pyAgeVault::AddDevice( const char * deviceName, PyObject * cbObject, uint32_t cbContext ) void pyAgeVault::AddDevice( const char * deviceName, PyObject * cbObject, uint32_t cbContext )
{ {
pyVaultNode::pyVaultNodeOperationCallback * cb = NEWZERO(pyVaultNode::pyVaultNodeOperationCallback)( cbObject ); pyVaultNode::pyVaultNodeOperationCallback * cb = new pyVaultNode::pyVaultNodeOperationCallback( cbObject );
cb->VaultOperationStarted( cbContext ); cb->VaultOperationStarted( cbContext );
wchar_t wStr[MAX_PATH]; wchar_t wStr[MAX_PATH];
@ -278,7 +278,7 @@ PyObject * pyAgeVault::GetDevice( const char * deviceName )
// Sets the inbox associated with a device. // Sets the inbox associated with a device.
void pyAgeVault::SetDeviceInbox( const char * deviceName, const char * inboxName, PyObject * cbObject, uint32_t cbContext ) void pyAgeVault::SetDeviceInbox( const char * deviceName, const char * inboxName, PyObject * cbObject, uint32_t cbContext )
{ {
pyVaultNode::pyVaultNodeOperationCallback * cb = NEWZERO(pyVaultNode::pyVaultNodeOperationCallback)( cbObject ); pyVaultNode::pyVaultNodeOperationCallback * cb = new pyVaultNode::pyVaultNodeOperationCallback( cbObject );
cb->VaultOperationStarted( cbContext ); cb->VaultOperationStarted( cbContext );
wchar_t wDev[MAX_PATH]; wchar_t wDev[MAX_PATH];
@ -310,7 +310,7 @@ PyObject * pyAgeVault::GetDeviceInbox( const char * deviceName )
PyObject * pyAgeVault::GetAgeSDL() const PyObject * pyAgeVault::GetAgeSDL() const
{ {
plStateDataRecord * rec = NEWZERO(plStateDataRecord); plStateDataRecord * rec = new plStateDataRecord;
if (!VaultAgeGetAgeSDL(rec)) { if (!VaultAgeGetAgeSDL(rec)) {
delete rec; delete rec;
PYTHON_RETURN_NONE; PYTHON_RETURN_NONE;

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

@ -431,7 +431,7 @@ PyObject* pyVault::GetInviteFolder(void)
PyObject* pyVault::GetPsnlAgeSDL() const PyObject* pyVault::GetPsnlAgeSDL() const
{ {
PyObject * result = nil; PyObject * result = nil;
NetVaultNode * templateNode = NEWZERO(NetVaultNode); NetVaultNode * templateNode = new NetVaultNode;
templateNode->IncRef(); templateNode->IncRef();
if (RelVaultNode * rvnFldr = VaultGetAgesIOwnFolderIncRef()) { if (RelVaultNode * rvnFldr = VaultGetAgesIOwnFolderIncRef()) {
@ -450,7 +450,7 @@ PyObject* pyVault::GetPsnlAgeSDL() const
if (RelVaultNode * rvnSdl = rvnInfo->GetChildNodeIncRef(templateNode, 1)) { if (RelVaultNode * rvnSdl = rvnInfo->GetChildNodeIncRef(templateNode, 1)) {
VaultSDLNode sdl(rvnSdl); VaultSDLNode sdl(rvnSdl);
plStateDataRecord * rec = NEWZERO(plStateDataRecord); plStateDataRecord * rec = new plStateDataRecord;
if (sdl.GetStateDataRecord(rec, plSDL::kKeepDirty)) if (sdl.GetStateDataRecord(rec, plSDL::kKeepDirty))
result = pySDLStateDataRecord::New(rec); result = pySDLStateDataRecord::New(rec);
else else
@ -476,7 +476,7 @@ void pyVault::UpdatePsnlAgeSDL( pySDLStateDataRecord & pyrec )
if ( !rec ) if ( !rec )
return; return;
NetVaultNode * templateNode = NEWZERO(NetVaultNode); NetVaultNode * templateNode = new NetVaultNode;
templateNode->IncRef(); templateNode->IncRef();
if (RelVaultNode * rvnFldr = VaultGetAgesIOwnFolderIncRef()) { if (RelVaultNode * rvnFldr = VaultGetAgesIOwnFolderIncRef()) {
@ -589,7 +589,7 @@ void _InvitePlayerToAge(ENetError result, void* state, void* param, RelVaultNode
void pyVault::InvitePlayerToAge( const pyAgeLinkStruct & link, uint32_t playerID ) void pyVault::InvitePlayerToAge( const pyAgeLinkStruct & link, uint32_t playerID )
{ {
NetVaultNode * templateNode = NEWZERO(NetVaultNode); NetVaultNode * templateNode = new NetVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeType(plVault::kNodeType_TextNote); templateNode->SetNodeType(plVault::kNodeType_TextNote);
VaultTextNoteNode visitAcc(templateNode); VaultTextNoteNode visitAcc(templateNode);
@ -622,7 +622,7 @@ void pyVault::UnInvitePlayerToAge( const char * str, uint32_t playerID )
rvnLink->DecRef(); rvnLink->DecRef();
} }
NetVaultNode * templateNode = NEWZERO(NetVaultNode); NetVaultNode * templateNode = new NetVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeType(plVault::kNodeType_TextNote); templateNode->SetNodeType(plVault::kNodeType_TextNote);
VaultTextNoteNode visitAcc(templateNode); VaultTextNoteNode visitAcc(templateNode);

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

@ -69,7 +69,7 @@ pyVaultAgeInfoNode::pyVaultAgeInfoNode(RelVaultNode* nfsNode)
//create from the Python side //create from the Python side
pyVaultAgeInfoNode::pyVaultAgeInfoNode(int n) pyVaultAgeInfoNode::pyVaultAgeInfoNode(int n)
: pyVaultNode(NEWZERO(RelVaultNode)) : pyVaultNode(new RelVaultNode)
{ {
fNode->SetNodeType(plVault::kNodeType_AgeInfo); fNode->SetNodeType(plVault::kNodeType_AgeInfo);
} }

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

@ -66,7 +66,7 @@ pyVaultAgeLinkNode::pyVaultAgeLinkNode(RelVaultNode* nfsNode)
//create from the Python side //create from the Python side
pyVaultAgeLinkNode::pyVaultAgeLinkNode(int n) pyVaultAgeLinkNode::pyVaultAgeLinkNode(int n)
: pyVaultNode(NEWZERO(RelVaultNode)) : pyVaultNode(new RelVaultNode)
{ {
fNode->SetNodeType(plVault::kNodeType_AgeLink); fNode->SetNodeType(plVault::kNodeType_AgeLink);
} }

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

@ -63,7 +63,7 @@ pyVaultChronicleNode::pyVaultChronicleNode(RelVaultNode* nfsNode)
//create from the Python side //create from the Python side
pyVaultChronicleNode::pyVaultChronicleNode(int n) pyVaultChronicleNode::pyVaultChronicleNode(int n)
: pyVaultNode(NEWZERO(RelVaultNode)) : pyVaultNode(new RelVaultNode)
, ansiName(nil) , ansiName(nil)
, ansiValue(nil) , ansiValue(nil)
{ {

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

@ -58,7 +58,7 @@ pyVaultFolderNode::pyVaultFolderNode( RelVaultNode* nfsNode )
//create from the Python side //create from the Python side
pyVaultFolderNode::pyVaultFolderNode(int n) pyVaultFolderNode::pyVaultFolderNode(int n)
: pyVaultNode(NEWZERO(RelVaultNode)) : pyVaultNode(new RelVaultNode)
{ {
fNode->SetNodeType(plVault::kNodeType_Folder); fNode->SetNodeType(plVault::kNodeType_Folder);
} }

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

@ -96,7 +96,7 @@ pyVaultImageNode::pyVaultImageNode(RelVaultNode* nfsNode)
//create from the Python side //create from the Python side
pyVaultImageNode::pyVaultImageNode(int n) pyVaultImageNode::pyVaultImageNode(int n)
: pyVaultNode(NEWZERO(RelVaultNode)) : pyVaultNode(new RelVaultNode)
, fMipmapKey(nil) , fMipmapKey(nil)
, fMipmap(nil) , fMipmap(nil)
{ {

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

@ -59,7 +59,7 @@ pyVaultMarkerGameNode::pyVaultMarkerGameNode(RelVaultNode* nfsNode)
//create from the Python side //create from the Python side
pyVaultMarkerGameNode::pyVaultMarkerGameNode(int n) pyVaultMarkerGameNode::pyVaultMarkerGameNode(int n)
: pyVaultNode(NEWZERO(RelVaultNode)) : pyVaultNode(new RelVaultNode)
{ {
fNode->SetNodeType(plVault::kNodeType_MarkerGame); fNode->SetNodeType(plVault::kNodeType_MarkerGame);
} }

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

@ -96,6 +96,7 @@ pyVaultNode::pyVaultNodeOperationCallback::pyVaultNodeOperationCallback(PyObject
: fCbObject( cbObject ) : fCbObject( cbObject )
, fNode(nil) , fNode(nil)
, fPyNodeRef(nil) , fPyNodeRef(nil)
, fContext(0)
{ {
Py_XINCREF( fCbObject ); Py_XINCREF( fCbObject );
} }
@ -269,7 +270,7 @@ PyObject* pyVaultNode::GetCreatorNode( void )
PyObject * result = nil; PyObject * result = nil;
if (fNode) if (fNode)
{ {
RelVaultNode * templateNode = NEWZERO(RelVaultNode); RelVaultNode * templateNode = new RelVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeType(plVault::kNodeType_PlayerInfo); templateNode->SetNodeType(plVault::kNodeType_PlayerInfo);
VaultPlayerInfoNode plrInfo(templateNode); VaultPlayerInfoNode plrInfo(templateNode);
@ -403,7 +404,7 @@ void _AddNodeCallback(ENetError result, void* param) {
PyObject* pyVaultNode::AddNode(pyVaultNode* pynode, PyObject* cbObject, uint32_t cbContext) PyObject* pyVaultNode::AddNode(pyVaultNode* pynode, PyObject* cbObject, uint32_t cbContext)
{ {
pyVaultNodeOperationCallback * cb = NEWZERO(pyVaultNodeOperationCallback)(cbObject); pyVaultNodeOperationCallback * cb = new pyVaultNodeOperationCallback(cbObject);
if ( fNode && pynode && pynode->GetNode() ) if ( fNode && pynode && pynode->GetNode() )
{ {
@ -460,7 +461,7 @@ PyObject* pyVaultNode::AddNode(pyVaultNode* pynode, PyObject* cbObject, uint32_t
// Link a node to this one // Link a node to this one
void pyVaultNode::LinkToNode(int nodeID, PyObject* cbObject, uint32_t cbContext) void pyVaultNode::LinkToNode(int nodeID, PyObject* cbObject, uint32_t cbContext)
{ {
pyVaultNodeOperationCallback * cb = NEWZERO(pyVaultNodeOperationCallback)( cbObject ); pyVaultNodeOperationCallback * cb = new pyVaultNodeOperationCallback( cbObject );
if (fNode && nodeID) if (fNode && nodeID)
{ {
@ -491,7 +492,7 @@ void pyVaultNode::LinkToNode(int nodeID, PyObject* cbObject, uint32_t cbContext)
// Remove child node // Remove child node
bool pyVaultNode::RemoveNode( pyVaultNode& pynode, PyObject* cbObject, uint32_t cbContext ) bool pyVaultNode::RemoveNode( pyVaultNode& pynode, PyObject* cbObject, uint32_t cbContext )
{ {
pyVaultNodeOperationCallback * cb = NEWZERO(pyVaultNodeOperationCallback)( cbObject ); pyVaultNodeOperationCallback * cb = new pyVaultNodeOperationCallback( cbObject );
if (fNode && pynode.fNode) if (fNode && pynode.fNode)
{ {
@ -539,7 +540,7 @@ void pyVaultNode::Save(PyObject* cbObject, uint32_t cbContext)
fNode = node; fNode = node;
} }
} }
pyVaultNodeOperationCallback * cb = NEWZERO(pyVaultNodeOperationCallback)( cbObject ); pyVaultNodeOperationCallback * cb = new pyVaultNodeOperationCallback( cbObject );
cb->SetNode(fNode); cb->SetNode(fNode);
cb->VaultOperationStarted( cbContext ); cb->VaultOperationStarted( cbContext );
cb->VaultOperationComplete( cbContext, hsOK ); cb->VaultOperationComplete( cbContext, hsOK );
@ -549,7 +550,7 @@ void pyVaultNode::Save(PyObject* cbObject, uint32_t cbContext)
void pyVaultNode::SaveAll(PyObject* cbObject, uint32_t cbContext) void pyVaultNode::SaveAll(PyObject* cbObject, uint32_t cbContext)
{ {
// Nodes are now auto-saved // Nodes are now auto-saved
pyVaultNodeOperationCallback * cb = NEWZERO(pyVaultNodeOperationCallback)( cbObject ); pyVaultNodeOperationCallback * cb = new pyVaultNodeOperationCallback( cbObject );
cb->VaultOperationStarted( cbContext ); cb->VaultOperationStarted( cbContext );
cb->VaultOperationComplete( cbContext, hsOK ); cb->VaultOperationComplete( cbContext, hsOK );
} }
@ -570,7 +571,7 @@ void pyVaultNode::ForceSave()
// Send this node to the destination client node. will be received in it's inbox folder. // Send this node to the destination client node. will be received in it's inbox folder.
void pyVaultNode::SendTo(uint32_t destClientNodeID, PyObject* cbObject, uint32_t cbContext ) void pyVaultNode::SendTo(uint32_t destClientNodeID, PyObject* cbObject, uint32_t cbContext )
{ {
pyVaultNodeOperationCallback * cb = NEWZERO(pyVaultNodeOperationCallback)( cbObject ); pyVaultNodeOperationCallback * cb = new pyVaultNodeOperationCallback( cbObject );
if (fNode) if (fNode)
{ {
@ -655,7 +656,7 @@ PyObject * pyVaultNode::GetNode2( uint32_t nodeID ) const
PyObject * result = nil; PyObject * result = nil;
if ( fNode ) if ( fNode )
{ {
RelVaultNode * templateNode = NEWZERO(RelVaultNode); RelVaultNode * templateNode = new RelVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeId(nodeID); templateNode->SetNodeId(nodeID);
if (RelVaultNode * rvn = fNode->GetChildNodeIncRef(templateNode, 1)) { if (RelVaultNode * rvn = fNode->GetChildNodeIncRef(templateNode, 1)) {
@ -693,7 +694,7 @@ PyObject * pyVaultNode::GetChildNode (unsigned nodeId) {
if (!fNode) if (!fNode)
PYTHON_RETURN_NONE; PYTHON_RETURN_NONE;
RelVaultNode * templateNode = NEWZERO(RelVaultNode); RelVaultNode * templateNode = new RelVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeId(nodeId); templateNode->SetNodeId(nodeId);
RelVaultNode * rvn = fNode->GetChildNodeIncRef(templateNode, 1); RelVaultNode * rvn = fNode->GetChildNodeIncRef(templateNode, 1);

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

@ -128,7 +128,7 @@ PyObject * pyVaultNodeRef::GetSaver () {
if (RelVaultNode * child = VaultGetNodeIncRef(fChild->nodeId)) { if (RelVaultNode * child = VaultGetNodeIncRef(fChild->nodeId)) {
if (unsigned saverId = child->GetRefOwnerId(fParent->nodeId)) { if (unsigned saverId = child->GetRefOwnerId(fParent->nodeId)) {
// Find the player info node representing the saver // Find the player info node representing the saver
NetVaultNode * templateNode = NEWZERO(NetVaultNode); NetVaultNode * templateNode = new NetVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeType(plVault::kNodeType_PlayerInfo); templateNode->SetNodeType(plVault::kNodeType_PlayerInfo);
VaultPlayerInfoNode access(templateNode); VaultPlayerInfoNode access(templateNode);

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

@ -79,7 +79,7 @@ bool pyVaultPlayerInfoListNode::HasPlayer( uint32_t playerID )
if (!fNode) if (!fNode)
return false; return false;
NetVaultNode * templateNode = NEWZERO(NetVaultNode); NetVaultNode * templateNode = new NetVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeType(plVault::kNodeType_PlayerInfo); templateNode->SetNodeType(plVault::kNodeType_PlayerInfo);
VaultPlayerInfoNode access(templateNode); VaultPlayerInfoNode access(templateNode);
@ -101,7 +101,7 @@ bool pyVaultPlayerInfoListNode::AddPlayer( uint32_t playerID )
if (!fNode) if (!fNode)
return false; return false;
NetVaultNode * templateNode = NEWZERO(NetVaultNode); NetVaultNode * templateNode = new NetVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeType(plVault::kNodeType_PlayerInfo); templateNode->SetNodeType(plVault::kNodeType_PlayerInfo);
VaultPlayerInfoNode access(templateNode); VaultPlayerInfoNode access(templateNode);
@ -125,7 +125,7 @@ void pyVaultPlayerInfoListNode::RemovePlayer( uint32_t playerID )
if (!fNode) if (!fNode)
return; return;
NetVaultNode * templateNode = NEWZERO(NetVaultNode); NetVaultNode * templateNode = new NetVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeType(plVault::kNodeType_PlayerInfo); templateNode->SetNodeType(plVault::kNodeType_PlayerInfo);
VaultPlayerInfoNode access(templateNode); VaultPlayerInfoNode access(templateNode);
@ -144,7 +144,7 @@ PyObject * pyVaultPlayerInfoListNode::GetPlayer( uint32_t playerID )
if (!fNode) if (!fNode)
PYTHON_RETURN_NONE; PYTHON_RETURN_NONE;
NetVaultNode * templateNode = NEWZERO(NetVaultNode); NetVaultNode * templateNode = new NetVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeType(plVault::kNodeType_PlayerInfo); templateNode->SetNodeType(plVault::kNodeType_PlayerInfo);
VaultPlayerInfoNode access(templateNode); VaultPlayerInfoNode access(templateNode);

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

@ -64,7 +64,7 @@ pyVaultPlayerInfoNode::pyVaultPlayerInfoNode(RelVaultNode* nfsNode)
//create from the Python side //create from the Python side
pyVaultPlayerInfoNode::pyVaultPlayerInfoNode() pyVaultPlayerInfoNode::pyVaultPlayerInfoNode()
: pyVaultNode(NEWZERO(RelVaultNode)) : pyVaultNode(new RelVaultNode)
, ansiPlayerName(nil) , ansiPlayerName(nil)
, ansiAgeInstName(nil) , ansiAgeInstName(nil)
{ {

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

@ -61,7 +61,7 @@ pyVaultSDLNode::pyVaultSDLNode(RelVaultNode* nfsNode)
//create from the Python side //create from the Python side
pyVaultSDLNode::pyVaultSDLNode() pyVaultSDLNode::pyVaultSDLNode()
: pyVaultNode(NEWZERO(RelVaultNode)) : pyVaultNode(new RelVaultNode)
{ {
fNode->SetNodeType(plVault::kNodeType_SDL); fNode->SetNodeType(plVault::kNodeType_SDL);
} }
@ -94,7 +94,7 @@ PyObject * pyVaultSDLNode::GetStateDataRecord() const
PYTHON_RETURN_NONE; PYTHON_RETURN_NONE;
VaultSDLNode sdl(fNode); VaultSDLNode sdl(fNode);
plStateDataRecord * rec = NEWZERO(plStateDataRecord); plStateDataRecord * rec = new plStateDataRecord;
if (sdl.GetStateDataRecord(rec)) if (sdl.GetStateDataRecord(rec))
return pySDLStateDataRecord::New(rec); return pySDLStateDataRecord::New(rec);
else else

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

@ -64,7 +64,7 @@ pyVaultTextNoteNode::pyVaultTextNoteNode(RelVaultNode* nfsNode)
//create from the Python side //create from the Python side
pyVaultTextNoteNode::pyVaultTextNoteNode() pyVaultTextNoteNode::pyVaultTextNoteNode()
: pyVaultNode(NEWZERO(RelVaultNode)) : pyVaultNode(new RelVaultNode)
{ {
fNode->SetNodeType(plVault::kNodeType_TextNote); fNode->SetNodeType(plVault::kNodeType_TextNote);
} }
@ -222,7 +222,7 @@ void pyVaultTextNoteNode::SetDeviceInbox( const char * devName, PyObject * cbObj
if (!fNode) if (!fNode)
return; return;
pyVaultNode::pyVaultNodeOperationCallback * cb = NEWZERO(pyVaultNode::pyVaultNodeOperationCallback)( cbObject ); pyVaultNode::pyVaultNodeOperationCallback * cb = new pyVaultNode::pyVaultNodeOperationCallback( cbObject );
cb->VaultOperationStarted( cbContext ); cb->VaultOperationStarted( cbContext );
wchar_t wDev[MAX_PATH]; wchar_t wDev[MAX_PATH];

10
Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcIo.h

@ -103,12 +103,16 @@ enum EAsyncNotifySocket {
struct AsyncNotifySocket { struct AsyncNotifySocket {
void * param; void * param;
AsyncId asyncId; AsyncId asyncId;
AsyncNotifySocket() : param(nil), asyncId(nil) { }
}; };
struct AsyncNotifySocketConnect : AsyncNotifySocket { struct AsyncNotifySocketConnect : AsyncNotifySocket {
plNetAddress localAddr; plNetAddress localAddr;
plNetAddress remoteAddr; plNetAddress remoteAddr;
unsigned connType; unsigned connType;
AsyncNotifySocketConnect() : connType(0) { }
}; };
struct AsyncNotifySocketListen : AsyncNotifySocketConnect { struct AsyncNotifySocketListen : AsyncNotifySocketConnect {
@ -120,12 +124,18 @@ struct AsyncNotifySocketListen : AsyncNotifySocketConnect {
uint8_t * buffer; uint8_t * buffer;
unsigned bytes; unsigned bytes;
unsigned bytesProcessed; unsigned bytesProcessed;
AsyncNotifySocketListen()
: buildId(0), buildType(0), branchId(0), buffer(nil), bytes(0),
bytesProcessed(0) { }
}; };
struct AsyncNotifySocketRead : AsyncNotifySocket { struct AsyncNotifySocketRead : AsyncNotifySocket {
uint8_t * buffer; uint8_t * buffer;
unsigned bytes; unsigned bytes;
unsigned bytesProcessed; unsigned bytesProcessed;
AsyncNotifySocketRead() : buffer(nil), bytes(0), bytesProcessed(0) { }
}; };
typedef AsyncNotifySocketRead AsyncNotifySocketWrite; typedef AsyncNotifySocketRead AsyncNotifySocketWrite;

12
Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Nt/pnAceNtInt.h

@ -109,6 +109,13 @@ struct Operation {
CNtWaitHandle * signalComplete; CNtWaitHandle * signalComplete;
LINK(Operation) link; LINK(Operation) link;
Operation()
: opType((EOpType)0), asyncId(nil), notify(false), pending(0),
signalComplete(nil)
{
memset(&overlapped, 0, sizeof(overlapped));
}
#ifdef HS_DEBUGGING #ifdef HS_DEBUGGING
~Operation () { ~Operation () {
ASSERT(!signalComplete); ASSERT(!signalComplete);
@ -126,6 +133,11 @@ struct NtObject {
long nextStartSequence; long nextStartSequence;
long ioCount; long ioCount;
bool closed; bool closed;
NtObject()
: ioType((EIoType)0), handle(nil), userState(nil),
nextCompleteSequence(0), nextStartSequence(0),
ioCount(0), closed(false) { }
}; };

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

@ -105,6 +105,8 @@ struct NtOpSocketWrite : Operation {
unsigned queueTimeMs; unsigned queueTimeMs;
unsigned bytesAlloc; unsigned bytesAlloc;
AsyncNotifySocketWrite write; AsyncNotifySocketWrite write;
NtOpSocketWrite() : queueTimeMs(0), bytesAlloc(0) { }
}; };
struct NtOpSocketRead : Operation { struct NtOpSocketRead : Operation {
@ -144,7 +146,12 @@ static LISTDECL(NtSock, link) s_socketList;
//=========================================================================== //===========================================================================
inline NtSock::NtSock () { inline NtSock::NtSock ()
: closeTimeMs(0), connType(0), notifyProc(nil), bytesLeft(0)
, backlogAlloc(0), initTimeMs(0)
{
memset(buffer, 0, sizeof(buffer));
PerfAddCounter(kAsyncPerfSocketsCurr, 1); PerfAddCounter(kAsyncPerfSocketsCurr, 1);
PerfAddCounter(kAsyncPerfSocketsTotal, 1); PerfAddCounter(kAsyncPerfSocketsTotal, 1);
} }
@ -406,7 +413,7 @@ static NtSock * SocketInitCommon (SOCKET hSocket) {
LogMsg(kLogError, "setsockopt(recv) failed (set recv buffer size)"); LogMsg(kLogError, "setsockopt(recv) failed (set recv buffer size)");
// allocate a new socket // allocate a new socket
NtSock * sock = NEWZERO(NtSock); NtSock * sock = new NtSock;
sock->ioType = kNtSocket; sock->ioType = kNtSocket;
sock->handle = (HANDLE) hSocket; sock->handle = (HANDLE) hSocket;
sock->initTimeMs = TimeGetMs(); sock->initTimeMs = TimeGetMs();

12
Sources/Plasma/NucleusLib/pnNetCli/pnNcCli.cpp

@ -144,6 +144,16 @@ struct NetCli {
// Message buffers // Message buffers
uint8_t sendBuffer[kAsyncSocketBufferSize]; uint8_t sendBuffer[kAsyncSocketBufferSize];
ARRAY(uint8_t) recvBuffer; ARRAY(uint8_t) recvBuffer;
NetCli()
: sock(nil), protocol((ENetProtocol)0), channel(nil), server(false)
, queue(nil), recvMsg(nil), recvField(nil), recvFieldBytes(0)
, recvDispatch(false), sendCurr(nil), mode((ENetCliMode)0)
, encryptFcn(nil), cryptIn(nil), cryptOut(nil), encryptParam(nil)
{
memset(seed, 0, sizeof(seed));
memset(sendBuffer, 0, sizeof(sendBuffer));
}
}; };
struct NetCliQueue { struct NetCliQueue {
@ -913,7 +923,7 @@ static NetCli * ConnCreate (
if (!channel) if (!channel)
return nil; return nil;
NetCli * const cli = NEWZERO(NetCli); NetCli * const cli = new NetCli;
cli->sock = sock; cli->sock = sock;
cli->protocol = (ENetProtocol) protocol; cli->protocol = (ENetProtocol) protocol;
cli->channel = channel; cli->channel = channel;

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

@ -363,9 +363,18 @@ static void DeallocNodeFields (NetVaultNode * node) {
} }
//============================================================================ //============================================================================
NetVaultNode::NetVaultNode () { NetVaultNode::NetVaultNode ()
ASSERTMSG(!fieldFlags, "NetVaultNode instances must be allocated with NEWZERO"); : fieldFlags(0), dirtyFlags(0)
} , nodeId(0), createTime(0), modifyTime(0)
, createAgeName(nil), creatorId(0)
, nodeType(0)
, int32_1(0), int32_2(0), int32_3(0), int32_4(0)
, uint32_1(0), uint32_2(0), uint32_3(0), uint32_4(0)
, string64_1(nil), string64_2(nil), string64_3(nil), string64_4(nil)
, string64_5(nil), string64_6(nil)
, istring64_1(nil), istring64_2(nil)
, text_1(nil), text_2(nil)
, blob_1(nil), blob_1Length(0), blob_2(nil), blob_2Length(0) { }
//============================================================================ //============================================================================
NetVaultNode::~NetVaultNode () { NetVaultNode::~NetVaultNode () {

2
Sources/Plasma/NucleusLib/pnUtils/pnUtHash.h

@ -163,6 +163,8 @@ private:
LINK(T) m_linkToSlot; LINK(T) m_linkToSlot;
public: public:
THashLink() : m_hash(0) { }
inline bool IsLinked () const; inline bool IsLinked () const;
inline T * Next (); inline T * Next ();
inline const T * Next () const; inline const T * Next () const;

6
Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp

@ -934,7 +934,7 @@ void plClothingOutfit::WriteToVault(const ARRAY(plStateDataRecord*) & SDRs)
node->DecRef(); // REF: Find node->DecRef(); // REF: Find
} }
else { else {
RelVaultNode * templateNode = NEWZERO(RelVaultNode); RelVaultNode * templateNode = new RelVaultNode;
templateNode->SetNodeType(plVault::kNodeType_SDL); templateNode->SetNodeType(plVault::kNodeType_SDL);
templates.Add(templateNode); templates.Add(templateNode);
node = templateNode; node = templateNode;
@ -1571,7 +1571,7 @@ void plClothingMgr::AddItemsToCloset(hsTArray<plClosetItem> &items)
plStateDataRecord rec(plClothingSDLModifier::GetClothingItemSDRName()); plStateDataRecord rec(plClothingSDLModifier::GetClothingItemSDRName());
plClothingSDLModifier::PutSingleItemIntoSDR(&items[i], &rec); plClothingSDLModifier::PutSingleItemIntoSDR(&items[i], &rec);
RelVaultNode * templateNode = NEWZERO(RelVaultNode); RelVaultNode * templateNode = new RelVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeType(plVault::kNodeType_SDL); templateNode->SetNodeType(plVault::kNodeType_SDL);
@ -1609,7 +1609,7 @@ void plClothingMgr::GetClosetItems(hsTArray<plClosetItem> &out)
for (unsigned i = 0; i < nodes.Count(); ++i) { for (unsigned i = 0; i < nodes.Count(); ++i) {
VaultSDLNode sdl(nodes[i]); VaultSDLNode sdl(nodes[i]);
plStateDataRecord * rec = NEWZERO(plStateDataRecord); plStateDataRecord * rec = new plStateDataRecord;
if (sdl.GetStateDataRecord(rec, 0)) if (sdl.GetStateDataRecord(rec, 0))
plClothingSDLModifier::HandleSingleSDR(rec, nil, &out[i]); plClothingSDLModifier::HandleSingleSDR(rec, nil, &out[i]);
delete rec; delete rec;

11
Sources/Plasma/PubUtilLib/plMessage/plNetClientMgrMsg.h

@ -65,6 +65,17 @@ public:
CLASSNAME_REGISTER(plNetClientMgrMsg); CLASSNAME_REGISTER(plNetClientMgrMsg);
GETINTERFACE_ANY(plNetClientMgrMsg, plMessage); GETINTERFACE_ANY(plNetClientMgrMsg, plMessage);
plNetClientMgrMsg(unsigned _type = 0, bool _yes = false, const char * _str = nil)
: type(_type), yes(_yes)
{
if (_str) {
strncpy(str, _str, arrsize(str));
str[arrsize(str)-1] = 0;
} else {
memset(str, 0, sizeof(str));
}
}
void Read (hsStream *, hsResMgr *) { FATAL("plNetClientMgrMsg::Read"); } void Read (hsStream *, hsResMgr *) { FATAL("plNetClientMgrMsg::Read"); }
void Write (hsStream *, hsResMgr *) { FATAL("plNetClientMgrMsg::Write"); } void Write (hsStream *, hsResMgr *) { FATAL("plNetClientMgrMsg::Write"); }
}; };

3
Sources/Plasma/PubUtilLib/plNetClient/plNetCliAgeJoiner.cpp

@ -163,6 +163,7 @@ plNCAgeJoiner::plNCAgeJoiner (
, age(age) , age(age)
, callback(callback) , callback(callback)
, userState(userState) , userState(userState)
, complete(false)
, progressBar(nil) , progressBar(nil)
{ {
} }
@ -475,7 +476,7 @@ void NCAgeJoinerCreate (
ASSERT(callback); ASSERT(callback);
plNCAgeJoiner * joiner; plNCAgeJoiner * joiner;
*pjoiner = joiner = NEWZERO(plNCAgeJoiner)( *pjoiner = joiner = new plNCAgeJoiner(
age, age,
callback, callback,
userState userState

2
Sources/Plasma/PubUtilLib/plNetClient/plNetCliAgeLeaver.cpp

@ -271,7 +271,7 @@ void NCAgeLeaverCreate (
ASSERT(callback); ASSERT(callback);
plNCAgeLeaver * leaver; plNCAgeLeaver * leaver;
*pleaver = leaver = NEWZERO(plNCAgeLeaver)( *pleaver = leaver = new plNCAgeLeaver(
quitting, quitting,
callback, callback,
userState userState

10
Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.cpp

@ -1139,8 +1139,7 @@ void plNetClientMgr::IncNumInitialSDLStates()
void plNetClientMgr::NotifyRcvdAllSDLStates() { void plNetClientMgr::NotifyRcvdAllSDLStates() {
DebugMsg( "Got all initial SDL states" ); DebugMsg( "Got all initial SDL states" );
plNetClientMgrMsg * msg = new plNetClientMgrMsg(); plNetClientMgrMsg * msg = new plNetClientMgrMsg(plNetClientMgrMsg::kNotifyRcvdAllSDLStates);
msg->type = plNetClientMgrMsg::kNotifyRcvdAllSDLStates;
msg->SetBCastFlag(plMessage::kBCastByType); msg->SetBCastFlag(plMessage::kBCastByType);
msg->Send(); msg->Send();
} }
@ -1303,11 +1302,8 @@ void plNetClientMgr::MakeCCRInvisible(plKey avKey, int level)
void plNetClientMgr::QueueDisableNet (bool showDlg, const char str[]) { void plNetClientMgr::QueueDisableNet (bool showDlg, const char str[]) {
plNetClientMgrMsg * msg = NEWZERO(plNetClientMgrMsg); plNetClientMgrMsg * msg = new plNetClientMgrMsg(plNetClientMgrMsg::kCmdDisableNet,
msg->type = plNetClientMgrMsg::kCmdDisableNet; showDlg, str);
msg->yes = showDlg;
if (str)
StrCopy(msg->str, str, arrsize(msg->str));
#if 0 #if 0
msg->Send(GetKey()); msg->Send(GetKey());

12
Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp

@ -109,7 +109,7 @@ struct NlmJoinAgeOp : NlmOp {
struct NlmLeaveAgeOp : NlmOp { struct NlmLeaveAgeOp : NlmOp {
bool quitting; bool quitting;
NlmLeaveAgeOp () NlmLeaveAgeOp ()
: NlmOp(kNlmOpLeaveAgeOp) : NlmOp(kNlmOpLeaveAgeOp), quitting(false)
{ } { }
}; };
@ -231,7 +231,7 @@ void plNetLinkingMgr::ExecNextOp () {
ASSERT(!s_ageLeaver); ASSERT(!s_ageLeaver);
// Insert a wait operation into the exec queue // Insert a wait operation into the exec queue
NlmOpWaitOp * waitOp = NEWZERO(NlmOpWaitOp); NlmOpWaitOp * waitOp = new NlmOpWaitOp;
QueueOp(waitOp, true); QueueOp(waitOp, true);
NlmJoinAgeOp * joinAgeOp = (NlmJoinAgeOp *)op; NlmJoinAgeOp * joinAgeOp = (NlmJoinAgeOp *)op;
@ -249,7 +249,7 @@ void plNetLinkingMgr::ExecNextOp () {
ASSERT(!s_ageLeaver); ASSERT(!s_ageLeaver);
// Insert a wait operation into the exec queue // Insert a wait operation into the exec queue
NlmOpWaitOp * waitOp = NEWZERO(NlmOpWaitOp); NlmOpWaitOp * waitOp = new NlmOpWaitOp;
QueueOp(waitOp, true); QueueOp(waitOp, true);
lm->SetEnabled(false); lm->SetEnabled(false);
@ -413,12 +413,12 @@ void plNetLinkingMgr::IDoLink(plLinkToAgeMsg* msg)
avMod->SetLinkInAnim(msg->GetLinkInAnimName()); avMod->SetLinkInAnim(msg->GetLinkInAnimName());
} }
// Queue leave op // Queue leave op
NlmLeaveAgeOp * leaveAgeOp = NEWZERO(NlmLeaveAgeOp); NlmLeaveAgeOp * leaveAgeOp = new NlmLeaveAgeOp;
QueueOp(leaveAgeOp); QueueOp(leaveAgeOp);
} }
// Queue join op // Queue join op
NlmJoinAgeOp * joinAgeOp = NEWZERO(NlmJoinAgeOp); NlmJoinAgeOp * joinAgeOp = new NlmJoinAgeOp;
joinAgeOp->age.ageInstId = *GetAgeLink()->GetAgeInfo()->GetAgeInstanceGuid(); joinAgeOp->age.ageInstId = *GetAgeLink()->GetAgeInfo()->GetAgeInstanceGuid();
StrCopy( StrCopy(
joinAgeOp->age.ageDatasetName, joinAgeOp->age.ageDatasetName,
@ -1118,7 +1118,7 @@ uint8_t plNetLinkingMgr::IPreProcessLink(void)
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
void plNetLinkingMgr::LeaveAge (bool quitting) { void plNetLinkingMgr::LeaveAge (bool quitting) {
// Queue leave op // Queue leave op
NlmLeaveAgeOp * leaveAgeOp = NEWZERO(NlmLeaveAgeOp); NlmLeaveAgeOp * leaveAgeOp = new NlmLeaveAgeOp;
leaveAgeOp->quitting = quitting; leaveAgeOp->quitting = quitting;
QueueOp(leaveAgeOp); QueueOp(leaveAgeOp);

9
Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.cpp

@ -158,9 +158,8 @@ static void INetErrorCallback (
) { ) {
NetClientDestroy(false); NetClientDestroy(false);
plNetClientMgrMsg * msg = NEWZERO(plNetClientMgrMsg); plNetClientMgrMsg * msg = new plNetClientMgrMsg(plNetClientMgrMsg::kCmdDisableNet,
msg->type = plNetClientMgrMsg::kCmdDisableNet; true, nil);
msg->yes = true;
msg->AddReceiver(plNetClientApp::GetInstance()->GetKey()); msg->AddReceiver(plNetClientApp::GetInstance()->GetKey());
switch (error) switch (error)
@ -259,7 +258,7 @@ static void INotifyAuthConnectedCallback () {
if (!hsgResMgr::ResMgr()) if (!hsgResMgr::ResMgr())
return; return;
plNetCommAuthConnectedMsg * msg = NEWZERO(plNetCommAuthConnectedMsg); plNetCommAuthConnectedMsg * msg = new plNetCommAuthConnectedMsg;
msg->Send(); msg->Send();
} }
@ -535,7 +534,7 @@ static void INetCliAuthGetPublicAgeListCallback (
) { ) {
NetCommParam * cp = (NetCommParam *) param; NetCommParam * cp = (NetCommParam *) param;
plNetCommPublicAgeListMsg * msg = NEWZERO(plNetCommPublicAgeListMsg); plNetCommPublicAgeListMsg * msg = new plNetCommPublicAgeListMsg;
msg->result = result; msg->result = result;
msg->param = cp->param; msg->param = cp->param;
msg->ptype = cp->type; msg->ptype = cp->type;

6
Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.h

@ -92,6 +92,12 @@ struct NetCommAge {
unsigned ageVaultId; unsigned ageVaultId;
char ageDatasetName[kMaxAgeNameLength]; char ageDatasetName[kMaxAgeNameLength];
char spawnPtName[64]; char spawnPtName[64];
NetCommAge() : ageVaultId(0)
{
memset(ageDatasetName, 0, sizeof(ageDatasetName));
memset(spawnPtName, 0, sizeof(spawnPtName));
}
}; };
const NetCommAge * NetCommGetAge (); const NetCommAge * NetCommGetAge ();

35
Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.cpp

@ -1532,7 +1532,7 @@ static void Connect (
) { ) {
ASSERT(s_running); ASSERT(s_running);
CliAuConn * conn = NEWZERO(CliAuConn); CliAuConn * conn = new CliAuConn;
conn->addr = addr; conn->addr = addr;
conn->seq = ConnNextSequence(); conn->seq = ConnNextSequence();
conn->lastHeardTimeMs = GetNonZeroTimeMs(); // used in connect timeout, and ping timeout conn->lastHeardTimeMs = GetNonZeroTimeMs(); // used in connect timeout, and ping timeout
@ -1586,7 +1586,14 @@ static unsigned CliAuConnPingTimerProc (void * param) {
} }
//============================================================================ //============================================================================
CliAuConn::CliAuConn () { CliAuConn::CliAuConn ()
: reconnectTimer(nil), reconnectStartMs(0)
, pingTimer(nil), pingSendTimeMs(0), lastHeardTimeMs(0)
, sock(nil), cli(nil), seq(0), serverChallenge(0)
, cancelId(nil), abandoned(false)
{
memset(name, 0, sizeof(name));
AtomicAdd(&s_perf[kPerfConnCount], 1); AtomicAdd(&s_perf[kPerfConnCount], 1);
} }
@ -3824,6 +3831,8 @@ VaultInitAgeTrans::VaultInitAgeTrans (
, m_ageDesc(StrDup(ageDesc ? ageDesc : L"")) , m_ageDesc(StrDup(ageDesc ? ageDesc : L""))
, m_ageSequenceNumber(ageSequenceNumber) , m_ageSequenceNumber(ageSequenceNumber)
, m_ageLanguage(ageLanguage) , m_ageLanguage(ageLanguage)
, m_ageId(0)
, m_ageInfoId(0)
{ {
} }
@ -3901,6 +3910,7 @@ VaultFetchNodeTrans::VaultFetchNodeTrans (
, m_nodeId(nodeId) , m_nodeId(nodeId)
, m_callback(callback) , m_callback(callback)
, m_param(param) , m_param(param)
, m_node(nil)
{ {
} }
@ -3939,7 +3949,7 @@ bool VaultFetchNodeTrans::Recv (
const Auth2Cli_VaultNodeFetched & reply = *(const Auth2Cli_VaultNodeFetched *) msg; const Auth2Cli_VaultNodeFetched & reply = *(const Auth2Cli_VaultNodeFetched *) msg;
if (IS_NET_SUCCESS(reply.result)) { if (IS_NET_SUCCESS(reply.result)) {
m_node = NEWZERO(NetVaultNode); m_node = new NetVaultNode;
m_node->Read_LCS(reply.nodeBuffer, reply.nodeBytes, 0); m_node->Read_LCS(reply.nodeBuffer, reply.nodeBytes, 0);
m_node->IncRef("Recv"); m_node->IncRef("Recv");
} }
@ -3963,9 +3973,9 @@ VaultFindNodeTrans::VaultFindNodeTrans (
FNetCliAuthVaultNodeFind callback, FNetCliAuthVaultNodeFind callback,
void * param void * param
) : NetAuthTrans(kVaultFindNodeTrans) ) : NetAuthTrans(kVaultFindNodeTrans)
, m_node(templateNode)
, m_callback(callback) , m_callback(callback)
, m_param(param) , m_param(param)
, m_node(templateNode)
{ {
m_node->IncRef(); m_node->IncRef();
} }
@ -4041,6 +4051,7 @@ VaultCreateNodeTrans::VaultCreateNodeTrans (
, m_templateNode(templateNode) , m_templateNode(templateNode)
, m_callback(callback) , m_callback(callback)
, m_param(param) , m_param(param)
, m_nodeId(0)
{ {
m_templateNode->IncRef(); m_templateNode->IncRef();
} }
@ -5560,7 +5571,7 @@ void NetCliAuthVaultNodeCreate (
FNetCliAuthVaultNodeCreated callback, FNetCliAuthVaultNodeCreated callback,
void * param void * param
) { ) {
VaultCreateNodeTrans * trans = NEWZERO(VaultCreateNodeTrans)( VaultCreateNodeTrans * trans = new VaultCreateNodeTrans(
templateNode, templateNode,
callback, callback,
param param
@ -5574,7 +5585,7 @@ void NetCliAuthVaultNodeFetch (
FNetCliAuthVaultNodeFetched callback, FNetCliAuthVaultNodeFetched callback,
void * param void * param
) { ) {
VaultFetchNodeTrans * trans = NEWZERO(VaultFetchNodeTrans)( VaultFetchNodeTrans * trans = new VaultFetchNodeTrans(
nodeId, nodeId,
callback, callback,
param param
@ -5588,7 +5599,7 @@ void NetCliAuthVaultNodeFind (
FNetCliAuthVaultNodeFind callback, FNetCliAuthVaultNodeFind callback,
void * param void * param
) { ) {
VaultFindNodeTrans * trans = NEWZERO(VaultFindNodeTrans)( VaultFindNodeTrans * trans = new VaultFindNodeTrans(
templateNode, templateNode,
callback, callback,
param param
@ -5629,7 +5640,7 @@ unsigned NetCliAuthVaultNodeSave (
ARRAY(uint8_t) buffer; ARRAY(uint8_t) buffer;
unsigned bytes = node->Write_LCS(&buffer, NetVaultNode::kRwDirtyOnly | NetVaultNode::kRwUpdateDirty); unsigned bytes = node->Write_LCS(&buffer, NetVaultNode::kRwDirtyOnly | NetVaultNode::kRwUpdateDirty);
VaultSaveNodeTrans * trans = NEWZERO(VaultSaveNodeTrans)( VaultSaveNodeTrans * trans = new VaultSaveNodeTrans(
node->nodeId, node->nodeId,
node->revisionId, node->revisionId,
buffer.Count(), buffer.Count(),
@ -5656,7 +5667,7 @@ void NetCliAuthVaultNodeAdd (
FNetCliAuthVaultNodeAddCallback callback, FNetCliAuthVaultNodeAddCallback callback,
void * param void * param
) { ) {
VaultAddNodeTrans * trans = NEWZERO(VaultAddNodeTrans)( VaultAddNodeTrans * trans = new VaultAddNodeTrans(
parentId, parentId,
childId, childId,
ownerId, ownerId,
@ -5673,7 +5684,7 @@ void NetCliAuthVaultNodeRemove (
FNetCliAuthVaultNodeRemoveCallback callback, FNetCliAuthVaultNodeRemoveCallback callback,
void * param void * param
) { ) {
VaultRemoveNodeTrans * trans = NEWZERO(VaultRemoveNodeTrans)( VaultRemoveNodeTrans * trans = new VaultRemoveNodeTrans(
parentId, parentId,
childId, childId,
callback, callback,
@ -5688,7 +5699,7 @@ void NetCliAuthVaultFetchNodeRefs (
FNetCliAuthVaultNodeRefsFetched callback, FNetCliAuthVaultNodeRefsFetched callback,
void * param void * param
) { ) {
VaultFetchNodeRefsTrans * trans = NEWZERO(VaultFetchNodeRefsTrans)( VaultFetchNodeRefsTrans * trans = new VaultFetchNodeRefsTrans(
nodeId, nodeId,
callback, callback,
param param
@ -5751,7 +5762,7 @@ void NetCliAuthVaultInitAge (
FNetCliAuthAgeInitCallback callback, // optional FNetCliAuthAgeInitCallback callback, // optional
void * param // optional void * param // optional
) { ) {
VaultInitAgeTrans * trans = NEWZERO(VaultInitAgeTrans)( VaultInitAgeTrans * trans = new VaultInitAgeTrans(
callback, callback,
param, param,
ageInstId, ageInstId,

10
Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglFile.cpp

@ -544,7 +544,7 @@ static void Connect (
) { ) {
ASSERT(s_running); ASSERT(s_running);
CliFileConn * conn = NEWZERO(CliFileConn); CliFileConn * conn = new CliFileConn;
strncpy(conn->name, name, arrsize(conn->name)); strncpy(conn->name, name, arrsize(conn->name));
conn->addr = addr; conn->addr = addr;
conn->buildId = s_connectBuildId; conn->buildId = s_connectBuildId;
@ -580,7 +580,13 @@ static void AsyncLookupCallback (
***/ ***/
//============================================================================ //============================================================================
CliFileConn::CliFileConn () { CliFileConn::CliFileConn ()
: sock(nil), seq(0), cancelId(nil), abandoned(false), buildId(0), serverType(0)
, reconnectTimer(nil), reconnectStartMs(0), connectStartMs(0)
, numImmediateDisconnects(0), numFailedConnects(0)
, pingTimer(nil), pingSendTimeMs(0), lastHeardTimeMs(0)
{
memset(name, 0, sizeof(name));
AtomicAdd(&s_perf[kPerfConnCount], 1); AtomicAdd(&s_perf[kPerfConnCount], 1);
} }

13
Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGame.cpp

@ -356,7 +356,7 @@ static bool SocketNotifyCallback (
static void Connect ( static void Connect (
const plNetAddress& addr const plNetAddress& addr
) { ) {
CliGmConn * conn = NEWZERO(CliGmConn); CliGmConn * conn = new CliGmConn;
conn->addr = addr; conn->addr = addr;
conn->seq = ConnNextSequence(); conn->seq = ConnNextSequence();
conn->lastHeardTimeMs = GetNonZeroTimeMs(); conn->lastHeardTimeMs = GetNonZeroTimeMs();
@ -414,7 +414,10 @@ static unsigned CliGmConnPingTimerProc (void * param) {
} }
//============================================================================ //============================================================================
CliGmConn::CliGmConn () { CliGmConn::CliGmConn ()
: sock(nil), cancelId(nil), cli(nil), seq(0), abandoned(false)
, pingTimer(nil), pingSendTimeMs(0), lastHeardTimeMs(0)
{
AtomicAdd(&s_perf[kPerfConnCount], 1); AtomicAdd(&s_perf[kPerfConnCount], 1);
} }
@ -579,11 +582,11 @@ JoinAgeRequestTrans::JoinAgeRequestTrans (
FNetCliGameJoinAgeRequestCallback callback, FNetCliGameJoinAgeRequestCallback callback,
void * param void * param
) : NetGameTrans(kJoinAgeRequestTrans) ) : NetGameTrans(kJoinAgeRequestTrans)
, m_callback(callback)
, m_param(param)
, m_ageMcpId(ageMcpId) , m_ageMcpId(ageMcpId)
, m_accountUuid(accountUuid) , m_accountUuid(accountUuid)
, m_playerInt(playerInt) , m_playerInt(playerInt)
, m_callback(callback)
, m_param(param)
{ {
} }
@ -822,7 +825,7 @@ void NetCliGameJoinAgeRequest (
FNetCliGameJoinAgeRequestCallback callback, FNetCliGameJoinAgeRequestCallback callback,
void * param void * param
) { ) {
JoinAgeRequestTrans * trans = NEWZERO(JoinAgeRequestTrans)( JoinAgeRequestTrans * trans = new JoinAgeRequestTrans(
ageMcpId, ageMcpId,
accountUuid, accountUuid,
playerInt, playerInt,

11
Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGateKeeper.cpp

@ -468,7 +468,7 @@ static void Connect (
) { ) {
ASSERT(s_running); ASSERT(s_running);
CliGkConn * conn = NEWZERO(CliGkConn); CliGkConn * conn = new CliGkConn;
conn->addr = addr; conn->addr = addr;
conn->seq = ConnNextSequence(); conn->seq = ConnNextSequence();
conn->lastHeardTimeMs = GetNonZeroTimeMs(); // used in connect timeout, and ping timeout conn->lastHeardTimeMs = GetNonZeroTimeMs(); // used in connect timeout, and ping timeout
@ -524,7 +524,14 @@ static unsigned CliGkConnPingTimerProc (void * param) {
} }
//============================================================================ //============================================================================
CliGkConn::CliGkConn () { CliGkConn::CliGkConn ()
: reconnectTimer(nil), reconnectStartMs(0)
, pingTimer(nil), pingSendTimeMs(0), lastHeardTimeMs(0)
, sock(nil), cli(nil), seq(0), serverChallenge(0)
, cancelId(nil), abandoned(false)
{
memset(name, 0, sizeof(name));
AtomicAdd(&s_perf[kPerfConnCount], 1); AtomicAdd(&s_perf[kPerfConnCount], 1);
} }

1
Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglTrans.cpp

@ -123,6 +123,7 @@ NetTrans::NetTrans (ENetProtocol protocol, ETransType transType)
, m_connId(0) , m_connId(0)
, m_protocol(protocol) , m_protocol(protocol)
, m_hasSubTrans(false) , m_hasSubTrans(false)
, m_timeoutAtMs(0)
, m_transType(transType) , m_transType(transType)
{ {
AtomicAdd(&s_perf[kPerfCurrTransactions], 1); AtomicAdd(&s_perf[kPerfCurrTransactions], 1);

2
Sources/Plasma/PubUtilLib/plSDL/plSDL.h

@ -433,7 +433,7 @@ public:
plStateDataRecord(const plString& sdName, int version=plSDL::kLatestVersion); plStateDataRecord(const plString& sdName, int version=plSDL::kLatestVersion);
plStateDataRecord(plStateDescriptor* sd); plStateDataRecord(plStateDescriptor* sd);
plStateDataRecord(const plStateDataRecord &other, uint32_t writeOptions=0 ):fFlags(0) { CopyFrom(other, writeOptions); } plStateDataRecord(const plStateDataRecord &other, uint32_t writeOptions=0 ):fFlags(0) { CopyFrom(other, writeOptions); }
plStateDataRecord():fFlags(0) {} plStateDataRecord() : fDescriptor(nil), fFlags(0) {}
~plStateDataRecord(); ~plStateDataRecord();
bool ConvertTo(plStateDescriptor* other, bool force=false ); bool ConvertTo(plStateDescriptor* other, bool force=false );

197
Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp

@ -95,9 +95,9 @@ struct RelVaultNodeLink : THashKeyVal<unsigned> {
RelVaultNodeLink (bool seen, unsigned ownerId, unsigned nodeId, RelVaultNode * node) RelVaultNodeLink (bool seen, unsigned ownerId, unsigned nodeId, RelVaultNode * node)
: THashKeyVal<unsigned>(nodeId) : THashKeyVal<unsigned>(nodeId)
, seen(seen)
, ownerId(ownerId)
, node(node) , node(node)
, ownerId(ownerId)
, seen(seen)
{ {
node->IncRef(); node->IncRef();
} }
@ -141,6 +141,14 @@ struct VaultCreateNodeTrans {
unsigned nodeId; unsigned nodeId;
RelVaultNode * node; RelVaultNode * node;
VaultCreateNodeTrans ()
: callback(nil), state(nil), param(nil), nodeId(0), node(nil) { }
VaultCreateNodeTrans (FVaultCreateNodeCallback _callback,
void * _state, void * _param)
: callback(_callback), state(_state), param(_param),
nodeId(0), node(nil) { }
static void VaultNodeCreated ( static void VaultNodeCreated (
ENetError result, ENetError result,
void * param, void * param,
@ -160,6 +168,11 @@ struct VaultFindNodeTrans {
FVaultFindNodeCallback callback; FVaultFindNodeCallback callback;
void * param; void * param;
VaultFindNodeTrans () : callback(nil), param(nil) { }
VaultFindNodeTrans (FVaultFindNodeCallback _callback, void * _param)
: callback(_callback), param(_param) { }
static void VaultNodeFound ( static void VaultNodeFound (
ENetError result, ENetError result,
void * param, void * param,
@ -181,7 +194,24 @@ struct VaultDownloadTrans {
unsigned vaultId; unsigned vaultId;
ENetError result; ENetError result;
VaultDownloadTrans (); VaultDownloadTrans ()
: callback(nil), cbParam(nil), progressCallback(nil), cbProgressParam(nil),
nodeCount(0), nodesLeft(0), vaultId(0), result(kNetSuccess)
{
memset(tag, 0, sizeof(tag));
}
VaultDownloadTrans (const wchar_t * _tag, FVaultDownloadCallback _callback,
void * _cbParam, FVaultProgressCallback _progressCallback,
void * _cbProgressParam, unsigned _vaultId)
: callback(_callback), cbParam(_cbParam), progressCallback(_progressCallback),
cbProgressParam(_cbProgressParam), nodeCount(0), nodesLeft(0),
vaultId(_vaultId), result(kNetSuccess)
{
wcsncpy(tag, _tag, arrsize(tag));
tag[arrsize(tag)-1] = 0;
}
static void VaultNodeFetched ( static void VaultNodeFetched (
ENetError result, ENetError result,
@ -201,6 +231,13 @@ struct VaultAgeInitTrans {
void * cbState; void * cbState;
void * cbParam; void * cbParam;
VaultAgeInitTrans()
: callback(nil), cbState(nil), cbParam(nil) { }
VaultAgeInitTrans(FVaultInitAgeCallback _callback,
void * state, void * param)
: callback(_callback), cbState(state), cbParam(param) { }
static void AgeInitCallback ( static void AgeInitCallback (
ENetError result, ENetError result,
void * param, void * param,
@ -215,6 +252,12 @@ struct AddChildNodeFetchTrans {
ENetError result; ENetError result;
long opCount; long opCount;
AddChildNodeFetchTrans()
: callback(nil), cbParam(nil), result(kNetSuccess), opCount(0) { }
AddChildNodeFetchTrans(FVaultAddChildNodeCallback _callback, void * _param)
: callback(_callback), cbParam(_param), result(kNetSuccess), opCount(0) { }
static void VaultNodeFetched ( static void VaultNodeFetched (
ENetError result, ENetError result,
void * param, void * param,
@ -338,7 +381,7 @@ static void BuildNodeTree (
RelVaultNodeLink * parentLink = s_nodes.Find(refs[i].parentId); RelVaultNodeLink * parentLink = s_nodes.Find(refs[i].parentId);
if (!parentLink) { if (!parentLink) {
newNodeIds->Add(refs[i].parentId); newNodeIds->Add(refs[i].parentId);
parentLink = NEWZERO(RelVaultNodeLink)(false, 0, refs[i].parentId, NEWZERO(RelVaultNode)); parentLink = new RelVaultNodeLink(false, 0, refs[i].parentId, new RelVaultNode);
parentLink->node->nodeId = refs[i].parentId; // set directly so that the field's dirty flag isn't set parentLink->node->nodeId = refs[i].parentId; // set directly so that the field's dirty flag isn't set
s_nodes.Add(parentLink); s_nodes.Add(parentLink);
} }
@ -348,7 +391,7 @@ static void BuildNodeTree (
RelVaultNodeLink * childLink = s_nodes.Find(refs[i].childId); RelVaultNodeLink * childLink = s_nodes.Find(refs[i].childId);
if (!childLink) { if (!childLink) {
newNodeIds->Add(refs[i].childId); newNodeIds->Add(refs[i].childId);
childLink = NEWZERO(RelVaultNodeLink)(refs[i].seen, refs[i].ownerId, refs[i].childId, NEWZERO(RelVaultNode)); childLink = new RelVaultNodeLink(refs[i].seen, refs[i].ownerId, refs[i].childId, new RelVaultNode);
childLink->node->nodeId = refs[i].childId; // set directly so that the field's dirty flag isn't set childLink->node->nodeId = refs[i].childId; // set directly so that the field's dirty flag isn't set
s_nodes.Add(childLink); s_nodes.Add(childLink);
} }
@ -366,14 +409,14 @@ static void BuildNodeTree (
if (!isImmediateParent) { if (!isImmediateParent) {
// Add parent to child's parents table // Add parent to child's parents table
parentLink = NEWZERO(RelVaultNodeLink)(false, 0, parentNode->nodeId, parentNode); parentLink = new RelVaultNodeLink(false, 0, parentNode->nodeId, parentNode);
childNode->state->parents.Add(parentLink); childNode->state->parents.Add(parentLink);
LogMsg(kLogDebug, L"Added relationship: p:%u,c:%u", refs[i].parentId, refs[i].childId); LogMsg(kLogDebug, L"Added relationship: p:%u,c:%u", refs[i].parentId, refs[i].childId);
} }
if (!isImmediateChild) { if (!isImmediateChild) {
// Add child to parent's children table // Add child to parent's children table
childLink = NEWZERO(RelVaultNodeLink)(refs[i].seen, refs[i].ownerId, childNode->nodeId, childNode); childLink = new RelVaultNodeLink(refs[i].seen, refs[i].ownerId, childNode->nodeId, childNode);
parentNode->state->children.Add(childLink); parentNode->state->children.Add(childLink);
if (notifyNow || childNode->nodeType != 0) { if (notifyNow || childNode->nodeType != 0) {
@ -382,7 +425,7 @@ static void BuildNodeTree (
cb->cb->AddedChildNode(parentNode, childNode); cb->cb->AddedChildNode(parentNode, childNode);
} }
else { else {
INotifyAfterDownload* notify = NEWZERO(INotifyAfterDownload)(parentNode->nodeId, childNode->nodeId); INotifyAfterDownload* notify = new INotifyAfterDownload(parentNode->nodeId, childNode->nodeId);
s_notifyAfterDownload.Add(notify); s_notifyAfterDownload.Add(notify);
} }
} }
@ -413,7 +456,7 @@ static void FetchRefOwners (
ownerIds.Add(ownerId); ownerIds.Add(ownerId);
} }
QSORT(unsigned, ownerIds.Ptr(), ownerIds.Count(), elem1 < elem2); QSORT(unsigned, ownerIds.Ptr(), ownerIds.Count(), elem1 < elem2);
RelVaultNode * templateNode = NEWZERO(RelVaultNode); RelVaultNode * templateNode = new RelVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeType(plVault::kNodeType_PlayerInfo); templateNode->SetNodeType(plVault::kNodeType_PlayerInfo);
{ unsigned prevId = 0; { unsigned prevId = 0;
@ -518,7 +561,7 @@ static void VaultNodeFetched (
// Add to global node table // Add to global node table
RelVaultNodeLink * link = s_nodes.Find(node->nodeId); RelVaultNodeLink * link = s_nodes.Find(node->nodeId);
if (!link) { if (!link) {
link = NEWZERO(RelVaultNodeLink)(false, 0, node->nodeId, NEWZERO(RelVaultNode)); link = new RelVaultNodeLink(false, 0, node->nodeId, new RelVaultNode);
link->node->nodeId = node->nodeId; // set directly so that the field's dirty flag isn't set link->node->nodeId = node->nodeId; // set directly so that the field's dirty flag isn't set
s_nodes.Add(link); s_nodes.Add(link);
} }
@ -609,7 +652,7 @@ static void VaultNodeAdded (
// Fetch the nodes that do not yet have a nodetype // Fetch the nodes that do not yet have a nodetype
unsigned prevId = 0; unsigned prevId = 0;
unsigned i = 0; unsigned i = 0;
{for (; i < nodeIds.Count(); ++i) { for (; i < nodeIds.Count(); ++i) {
RelVaultNodeLink * link = s_nodes.Find(nodeIds[i]); RelVaultNodeLink * link = s_nodes.Find(nodeIds[i]);
if (link->node->nodeType != 0) if (link->node->nodeType != 0)
continue; continue;
@ -625,7 +668,7 @@ static void VaultNodeAdded (
nil, nil,
nil nil
); );
}} }
if (parentId == inboxId) { if (parentId == inboxId) {
if (i > 0) if (i > 0)
@ -831,11 +874,6 @@ void VaultFindNodeTrans::VaultNodeFound (
* *
***/ ***/
//============================================================================
VaultDownloadTrans::VaultDownloadTrans () {
ASSERT(!nodeCount); // must be alloced with
}
//============================================================================ //============================================================================
void VaultDownloadTrans::VaultNodeFetched ( void VaultDownloadTrans::VaultNodeFetched (
ENetError result, ENetError result,
@ -1091,7 +1129,7 @@ void IRelVaultNode::Unlink (RelVaultNode * other) {
//============================================================================ //============================================================================
RelVaultNode::RelVaultNode () { RelVaultNode::RelVaultNode () {
state = NEWZERO(IRelVaultNode)(this); state = new IRelVaultNode(this);
} }
//============================================================================ //============================================================================
@ -1233,7 +1271,7 @@ RelVaultNode * RelVaultNode::GetChildNodeIncRef (
unsigned nodeType, unsigned nodeType,
unsigned maxDepth unsigned maxDepth
) { ) {
NetVaultNode * templateNode = NEWZERO(NetVaultNode); NetVaultNode * templateNode = new NetVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeType(nodeType); templateNode->SetNodeType(nodeType);
RelVaultNode * result = GetChildNodeIncRef(templateNode, maxDepth); RelVaultNode * result = GetChildNodeIncRef(templateNode, maxDepth);
@ -1246,7 +1284,7 @@ RelVaultNode * RelVaultNode::GetChildFolderNodeIncRef (
unsigned folderType, unsigned folderType,
unsigned maxDepth unsigned maxDepth
) { ) {
NetVaultNode * templateNode = NEWZERO(NetVaultNode); NetVaultNode * templateNode = new NetVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeType(plVault::kNodeType_Folder); templateNode->SetNodeType(plVault::kNodeType_Folder);
VaultFolderNode folder(templateNode); VaultFolderNode folder(templateNode);
@ -1261,7 +1299,7 @@ RelVaultNode * RelVaultNode::GetChildPlayerInfoListNodeIncRef (
unsigned folderType, unsigned folderType,
unsigned maxDepth unsigned maxDepth
) { ) {
NetVaultNode * templateNode = NEWZERO(NetVaultNode); NetVaultNode * templateNode = new NetVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeType(plVault::kNodeType_PlayerInfoList); templateNode->SetNodeType(plVault::kNodeType_PlayerInfoList);
VaultPlayerInfoListNode access(templateNode); VaultPlayerInfoListNode access(templateNode);
@ -1276,7 +1314,7 @@ RelVaultNode * RelVaultNode::GetChildAgeInfoListNodeIncRef (
unsigned folderType, unsigned folderType,
unsigned maxDepth unsigned maxDepth
) { ) {
NetVaultNode * templateNode = NEWZERO(NetVaultNode); NetVaultNode * templateNode = new NetVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeType(plVault::kNodeType_AgeInfoList); templateNode->SetNodeType(plVault::kNodeType_AgeInfoList);
VaultAgeInfoListNode access(templateNode); VaultAgeInfoListNode access(templateNode);
@ -1333,7 +1371,7 @@ void RelVaultNode::GetChildNodesIncRef (
unsigned maxDepth, unsigned maxDepth,
ARRAY(RelVaultNode*) * nodes ARRAY(RelVaultNode*) * nodes
) { ) {
NetVaultNode * templateNode = NEWZERO(NetVaultNode); NetVaultNode * templateNode = new NetVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeType(nodeType); templateNode->SetNodeType(nodeType);
GetChildNodesIncRef( GetChildNodesIncRef(
@ -1350,7 +1388,7 @@ void RelVaultNode::GetChildFolderNodesIncRef (
unsigned maxDepth, unsigned maxDepth,
ARRAY(RelVaultNode*) * nodes ARRAY(RelVaultNode*) * nodes
) { ) {
NetVaultNode * templateNode = NEWZERO(NetVaultNode); NetVaultNode * templateNode = new NetVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeType(plVault::kNodeType_Folder); templateNode->SetNodeType(plVault::kNodeType_Folder);
VaultFolderNode fldr(templateNode); VaultFolderNode fldr(templateNode);
@ -1442,7 +1480,7 @@ RelVaultNode * RelVaultNode::GetParentAgeLinkIncRef () {
RelVaultNode * result = nil; RelVaultNode * result = nil;
NetVaultNode * templateNode = NEWZERO(NetVaultNode); NetVaultNode * templateNode = new NetVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeType(plVault::kNodeType_AgeLink); templateNode->SetNodeType(plVault::kNodeType_AgeLink);
@ -1606,7 +1644,7 @@ void VaultAddChildNode (
if (RelVaultNodeLink * parentLink = s_nodes.Find(parentId)) { if (RelVaultNodeLink * parentLink = s_nodes.Find(parentId)) {
RelVaultNodeLink * childLink = s_nodes.Find(childId); RelVaultNodeLink * childLink = s_nodes.Find(childId);
if (!childLink) { if (!childLink) {
childLink = NEWZERO(RelVaultNodeLink)(false, ownerId, childId, NEWZERO(RelVaultNode)); childLink = new RelVaultNodeLink(false, ownerId, childId, new RelVaultNode);
childLink->node->nodeId = childId; // set directly so that the field's dirty flag isn't set childLink->node->nodeId = childId; // set directly so that the field's dirty flag isn't set
s_nodes.Add(childLink); s_nodes.Add(childLink);
} }
@ -1644,9 +1682,7 @@ void VaultAddChildNode (
if (!childLink->node->nodeType || !parentLink->node->nodeType) { if (!childLink->node->nodeType || !parentLink->node->nodeType) {
// One or more nodes need to be fetched before the callback is made // One or more nodes need to be fetched before the callback is made
AddChildNodeFetchTrans * trans = NEWZERO(AddChildNodeFetchTrans); AddChildNodeFetchTrans * trans = new AddChildNodeFetchTrans(callback, param);
trans->callback = callback;
trans->cbParam = param;
if (!childLink->node->nodeType) { if (!childLink->node->nodeType) {
AtomicAdd(&trans->opCount, 1); AtomicAdd(&trans->opCount, 1);
NetCliAuthVaultNodeFetch( NetCliAuthVaultNodeFetch(
@ -1845,10 +1881,7 @@ void VaultCreateNode (
void * state, void * state,
void * param void * param
) { ) {
VaultCreateNodeTrans * trans = NEWZERO(VaultCreateNodeTrans); VaultCreateNodeTrans * trans = new VaultCreateNodeTrans(callback, state, param);
trans->callback = callback;
trans->state = state;
trans->param = param;
if (RelVaultNode * age = VaultGetAgeNodeIncRef()) { if (RelVaultNode * age = VaultGetAgeNodeIncRef()) {
VaultAgeNode access(age); VaultAgeNode access(age);
@ -1873,7 +1906,7 @@ void VaultCreateNode (
void * state, void * state,
void * param void * param
) { ) {
RelVaultNode * templateNode = NEWZERO(RelVaultNode); RelVaultNode * templateNode = new RelVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeType(nodeType); templateNode->SetNodeType(nodeType);
@ -1943,7 +1976,7 @@ RelVaultNode * VaultCreateNodeAndWaitIncRef (
ENetError * result ENetError * result
) { ) {
RelVaultNode * node; RelVaultNode * node;
RelVaultNode * templateNode = NEWZERO(RelVaultNode); RelVaultNode * templateNode = new RelVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeType(nodeType); templateNode->SetNodeType(nodeType);
@ -1998,9 +2031,7 @@ void VaultFindNodes (
FVaultFindNodeCallback callback, FVaultFindNodeCallback callback,
void * param void * param
) { ) {
VaultFindNodeTrans * trans = NEWZERO(VaultFindNodeTrans); VaultFindNodeTrans * trans = new VaultFindNodeTrans(callback, param);
trans->callback = callback;
trans->param = param;
NetCliAuthVaultNodeFind( NetCliAuthVaultNodeFind(
templateNode, templateNode,
@ -2120,10 +2151,7 @@ void VaultInitAge (
void * state, void * state,
void * param void * param
) { ) {
VaultAgeInitTrans * trans = NEWZERO(VaultAgeInitTrans); VaultAgeInitTrans * trans = new VaultAgeInitTrans(callback, state, param);
trans->callback = callback;
trans->cbState = state;
trans->cbParam = param;
wchar_t ageFilename[MAX_PATH]; wchar_t ageFilename[MAX_PATH];
wchar_t ageInstName[MAX_PATH]; wchar_t ageInstName[MAX_PATH];
@ -2157,7 +2185,7 @@ void VaultInitAge (
//============================================================================ //============================================================================
static RelVaultNode * GetPlayerNode () { static RelVaultNode * GetPlayerNode () {
NetVaultNode * templateNode = NEWZERO(NetVaultNode); NetVaultNode * templateNode = new NetVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeType(plVault::kNodeType_VNodeMgrPlayer); templateNode->SetNodeType(plVault::kNodeType_VNodeMgrPlayer);
if (NetCommGetPlayer()) if (NetCommGetPlayer())
@ -2189,7 +2217,7 @@ RelVaultNode * VaultGetPlayerInfoNodeIncRef () {
if (!rvnPlr) if (!rvnPlr)
return nil; return nil;
NetVaultNode * templateNode = NEWZERO(NetVaultNode); NetVaultNode * templateNode = new NetVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeType(plVault::kNodeType_PlayerInfo); templateNode->SetNodeType(plVault::kNodeType_PlayerInfo);
VaultPlayerInfoNode plrInfo(templateNode); VaultPlayerInfoNode plrInfo(templateNode);
@ -2254,7 +2282,7 @@ bool VaultGetLinkToMyNeighborhood (plAgeLinkStruct * link) {
if (!rvnFldr) if (!rvnFldr)
return false; return false;
NetVaultNode * templateNode = NEWZERO(NetVaultNode); NetVaultNode * templateNode = new NetVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeType(plVault::kNodeType_AgeInfo); templateNode->SetNodeType(plVault::kNodeType_AgeInfo);
@ -2281,7 +2309,7 @@ bool VaultGetLinkToMyPersonalAge (plAgeLinkStruct * link) {
if (!rvnFldr) if (!rvnFldr)
return false; return false;
NetVaultNode * templateNode = NEWZERO(NetVaultNode); NetVaultNode * templateNode = new NetVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeType(plVault::kNodeType_AgeInfo); templateNode->SetNodeType(plVault::kNodeType_AgeInfo);
@ -2308,7 +2336,7 @@ bool VaultGetLinkToCity (plAgeLinkStruct * link) {
if (!rvnFldr) if (!rvnFldr)
return false; return false;
NetVaultNode * templateNode = NEWZERO(NetVaultNode); NetVaultNode * templateNode = new NetVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeType(plVault::kNodeType_AgeInfo); templateNode->SetNodeType(plVault::kNodeType_AgeInfo);
@ -2336,7 +2364,7 @@ RelVaultNode * VaultGetOwnedAgeLinkIncRef (const plAgeInfoStruct * info) {
if (RelVaultNode * rvnFldr = VaultGetAgesIOwnFolderIncRef()) { if (RelVaultNode * rvnFldr = VaultGetAgesIOwnFolderIncRef()) {
NetVaultNode * templateNode = NEWZERO(NetVaultNode); NetVaultNode * templateNode = new NetVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeType(plVault::kNodeType_AgeInfo); templateNode->SetNodeType(plVault::kNodeType_AgeInfo);
@ -2371,7 +2399,7 @@ RelVaultNode * VaultGetOwnedAgeInfoIncRef (const plAgeInfoStruct * info) {
if (RelVaultNode * rvnFldr = VaultGetAgesIOwnFolderIncRef()) { if (RelVaultNode * rvnFldr = VaultGetAgesIOwnFolderIncRef()) {
NetVaultNode * templateNode = NEWZERO(NetVaultNode); NetVaultNode * templateNode = new NetVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeType(plVault::kNodeType_AgeInfo); templateNode->SetNodeType(plVault::kNodeType_AgeInfo);
@ -2436,7 +2464,7 @@ bool VaultAddOwnedAgeSpawnPoint (const plUUID& ageInstId, const plSpawnPointInfo
ARRAY(unsigned) nodeIds; ARRAY(unsigned) nodeIds;
fldr->GetChildNodeIds(&nodeIds, 1); fldr->GetChildNodeIds(&nodeIds, 1);
NetVaultNode * templateNode = NEWZERO(NetVaultNode); NetVaultNode * templateNode = new NetVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeType(plVault::kNodeType_AgeInfo); templateNode->SetNodeType(plVault::kNodeType_AgeInfo);
VaultAgeInfoNode access(templateNode); VaultAgeInfoNode access(templateNode);
@ -2478,7 +2506,7 @@ bool VaultSetOwnedAgePublicAndWait (const plAgeInfoStruct * info, bool publicOrN
char ageName[MAX_PATH]; char ageName[MAX_PATH];
StrToAnsi(ageName, access.ageFilename, arrsize(ageName)); StrToAnsi(ageName, access.ageFilename, arrsize(ageName));
plVaultNotifyMsg * msg = NEWZERO(plVaultNotifyMsg); plVaultNotifyMsg * msg = new plVaultNotifyMsg;
if (publicOrNot) if (publicOrNot)
msg->SetType(plVaultNotifyMsg::kPublicAgeCreated); msg->SetType(plVaultNotifyMsg::kPublicAgeCreated);
else else
@ -2500,7 +2528,7 @@ RelVaultNode * VaultGetVisitAgeLinkIncRef (const plAgeInfoStruct * info) {
if (RelVaultNode * rvnFldr = VaultGetAgesICanVisitFolderIncRef()) { if (RelVaultNode * rvnFldr = VaultGetAgesICanVisitFolderIncRef()) {
NetVaultNode * templateNode = NEWZERO(NetVaultNode); NetVaultNode * templateNode = new NetVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeType(plVault::kNodeType_AgeInfo); templateNode->SetNodeType(plVault::kNodeType_AgeInfo);
@ -2789,7 +2817,7 @@ bool VaultRegisterOwnedAgeAndWait (const plAgeLinkStruct * link) {
break; break;
} }
plVaultNotifyMsg * msg = NEWZERO(plVaultNotifyMsg); plVaultNotifyMsg * msg = new plVaultNotifyMsg;
msg->SetType(plVaultNotifyMsg::kRegisteredOwnedAge); msg->SetType(plVaultNotifyMsg::kRegisteredOwnedAge);
msg->SetResultCode(result); msg->SetResultCode(result);
msg->GetArgs()->AddInt(plNetCommon::VaultTaskArgs::kAgeLinkNode, ageLinkId); msg->GetArgs()->AddInt(plNetCommon::VaultTaskArgs::kAgeLinkNode, ageLinkId);
@ -2855,7 +2883,7 @@ namespace _VaultRegisterOwnedAge {
} }
// Fire off vault callbacks // Fire off vault callbacks
plVaultNotifyMsg* msg = NEWZERO(plVaultNotifyMsg); plVaultNotifyMsg* msg = new plVaultNotifyMsg;
msg->SetType(plVaultNotifyMsg::kRegisteredOwnedAge); msg->SetType(plVaultNotifyMsg::kRegisteredOwnedAge);
msg->SetResultCode(result); msg->SetResultCode(result);
msg->GetArgs()->AddInt(plNetCommon::VaultTaskArgs::kAgeLinkNode, node->nodeId); msg->GetArgs()->AddInt(plNetCommon::VaultTaskArgs::kAgeLinkNode, node->nodeId);
@ -3162,7 +3190,7 @@ bool VaultRegisterVisitAgeAndWait (const plAgeLinkStruct * link) {
break; break;
} }
plVaultNotifyMsg * msg = NEWZERO(plVaultNotifyMsg); plVaultNotifyMsg * msg = new plVaultNotifyMsg;
msg->SetType(plVaultNotifyMsg::kRegisteredVisitAge); msg->SetType(plVaultNotifyMsg::kRegisteredVisitAge);
msg->SetResultCode(result); msg->SetResultCode(result);
msg->GetArgs()->AddInt(plNetCommon::VaultTaskArgs::kAgeLinkNode, ageLinkId); msg->GetArgs()->AddInt(plNetCommon::VaultTaskArgs::kAgeLinkNode, ageLinkId);
@ -3214,7 +3242,7 @@ namespace _VaultRegisterVisitAge {
access.AddSpawnPoint(*p->fSpawn); access.AddSpawnPoint(*p->fSpawn);
// Send out the VaultNotify msg // Send out the VaultNotify msg
plVaultNotifyMsg * msg = NEWZERO(plVaultNotifyMsg); plVaultNotifyMsg * msg = new plVaultNotifyMsg;
msg->SetType(plVaultNotifyMsg::kRegisteredVisitAge); msg->SetType(plVaultNotifyMsg::kRegisteredVisitAge);
msg->SetResultCode(true); msg->SetResultCode(true);
msg->GetArgs()->AddInt(plNetCommon::VaultTaskArgs::kAgeLinkNode, node->nodeId); msg->GetArgs()->AddInt(plNetCommon::VaultTaskArgs::kAgeLinkNode, node->nodeId);
@ -3333,7 +3361,7 @@ bool VaultUnregisterOwnedAgeAndWait (const plAgeInfoStruct * info) {
break; break;
} }
plVaultNotifyMsg * msg = NEWZERO(plVaultNotifyMsg); plVaultNotifyMsg * msg = new plVaultNotifyMsg;
msg->SetType(plVaultNotifyMsg::kUnRegisteredOwnedAge); msg->SetType(plVaultNotifyMsg::kUnRegisteredOwnedAge);
msg->SetResultCode(result); msg->SetResultCode(result);
msg->GetArgs()->AddInt(plNetCommon::VaultTaskArgs::kAgeLinkNode, ageLinkId); msg->GetArgs()->AddInt(plNetCommon::VaultTaskArgs::kAgeLinkNode, ageLinkId);
@ -3397,7 +3425,7 @@ bool VaultUnregisterVisitAgeAndWait (const plAgeInfoStruct * info) {
break; break;
} }
plVaultNotifyMsg * msg = NEWZERO(plVaultNotifyMsg); plVaultNotifyMsg * msg = new plVaultNotifyMsg;
msg->SetType(plVaultNotifyMsg::kUnRegisteredVisitAge); msg->SetType(plVaultNotifyMsg::kUnRegisteredVisitAge);
msg->SetResultCode(result); msg->SetResultCode(result);
msg->GetArgs()->AddInt(plNetCommon::VaultTaskArgs::kAgeLinkNode, ageLinkId); msg->GetArgs()->AddInt(plNetCommon::VaultTaskArgs::kAgeLinkNode, ageLinkId);
@ -3411,7 +3439,7 @@ RelVaultNode * VaultFindChronicleEntryIncRef (const wchar_t entryName[], int ent
RelVaultNode * result = nil; RelVaultNode * result = nil;
if (RelVaultNode * rvnFldr = GetChildFolderNode(GetPlayerNode(), plVault::kChronicleFolder, 1)) { if (RelVaultNode * rvnFldr = GetChildFolderNode(GetPlayerNode(), plVault::kChronicleFolder, 1)) {
NetVaultNode * templateNode = NEWZERO(NetVaultNode); NetVaultNode * templateNode = new NetVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeType(plVault::kNodeType_Chronicle); templateNode->SetNodeType(plVault::kNodeType_Chronicle);
VaultChronicleNode chrn(templateNode); VaultChronicleNode chrn(templateNode);
@ -3445,7 +3473,7 @@ void VaultAddChronicleEntryAndWait (
chrnNode.SetEntryValue(entryValue); chrnNode.SetEntryValue(entryValue);
} }
else if (RelVaultNode * rvnFldr = GetChildFolderNode(GetPlayerNode(), plVault::kChronicleFolder, 1)) { else if (RelVaultNode * rvnFldr = GetChildFolderNode(GetPlayerNode(), plVault::kChronicleFolder, 1)) {
NetVaultNode * templateNode = NEWZERO(NetVaultNode); NetVaultNode * templateNode = new NetVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeType(plVault::kNodeType_Chronicle); templateNode->SetNodeType(plVault::kNodeType_Chronicle);
VaultChronicleNode chrnNode(templateNode); VaultChronicleNode chrnNode(templateNode);
@ -3467,7 +3495,7 @@ bool VaultAmIgnoringPlayer (unsigned playerId) {
if (RelVaultNode * rvnFldr = GetChildPlayerInfoListNode(GetPlayerNode(), plVault::kIgnoreListFolder, 1)) { if (RelVaultNode * rvnFldr = GetChildPlayerInfoListNode(GetPlayerNode(), plVault::kIgnoreListFolder, 1)) {
rvnFldr->IncRef(); rvnFldr->IncRef();
NetVaultNode * templateNode = NEWZERO(NetVaultNode); NetVaultNode * templateNode = new NetVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeType(plVault::kNodeType_PlayerInfo); templateNode->SetNodeType(plVault::kNodeType_PlayerInfo);
VaultPlayerInfoNode pinfoNode(templateNode); VaultPlayerInfoNode pinfoNode(templateNode);
@ -3704,7 +3732,7 @@ void VaultProcessPlayerInbox () {
if (RelVaultNode * rvnInbox = VaultGetPlayerInboxFolderIncRef()) { if (RelVaultNode * rvnInbox = VaultGetPlayerInboxFolderIncRef()) {
{ // Process new visit requests { // Process new visit requests
ARRAY(RelVaultNode*) visits; ARRAY(RelVaultNode*) visits;
RelVaultNode * templateNode = NEWZERO(RelVaultNode); RelVaultNode * templateNode = new RelVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeType(plVault::kNodeType_TextNote); templateNode->SetNodeType(plVault::kNodeType_TextNote);
VaultTextNoteNode tmpAcc(templateNode); VaultTextNoteNode tmpAcc(templateNode);
@ -3727,7 +3755,7 @@ void VaultProcessPlayerInbox () {
} }
{ // Process new unvisit requests { // Process new unvisit requests
ARRAY(RelVaultNode*) unvisits; ARRAY(RelVaultNode*) unvisits;
RelVaultNode * templateNode = NEWZERO(RelVaultNode); RelVaultNode * templateNode = new RelVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeType(plVault::kNodeType_TextNote); templateNode->SetNodeType(plVault::kNodeType_TextNote);
VaultTextNoteNode tmpAcc(templateNode); VaultTextNoteNode tmpAcc(templateNode);
@ -3762,7 +3790,7 @@ void VaultProcessPlayerInbox () {
//============================================================================ //============================================================================
static RelVaultNode * GetAgeNode () { static RelVaultNode * GetAgeNode () {
NetVaultNode * templateNode = NEWZERO(NetVaultNode); NetVaultNode * templateNode = new NetVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeType(plVault::kNodeType_VNodeMgrAge); templateNode->SetNodeType(plVault::kNodeType_VNodeMgrAge);
if (NetCommGetAge()) if (NetCommGetAge())
@ -3775,7 +3803,7 @@ static RelVaultNode * GetAgeNode () {
//============================================================================ //============================================================================
RelVaultNode * VaultGetAgeNodeIncRef () { RelVaultNode * VaultGetAgeNodeIncRef () {
RelVaultNode * result = nil; RelVaultNode * result = nil;
NetVaultNode * templateNode = NEWZERO(NetVaultNode); NetVaultNode * templateNode = new NetVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeType(plVault::kNodeType_VNodeMgrAge); templateNode->SetNodeType(plVault::kNodeType_VNodeMgrAge);
if (NetCommGetAge()) if (NetCommGetAge())
@ -3793,7 +3821,7 @@ static RelVaultNode * GetAgeInfoNode () {
return nil; return nil;
RelVaultNode * result = nil; RelVaultNode * result = nil;
NetVaultNode * templateNode = NEWZERO(NetVaultNode); NetVaultNode * templateNode = new NetVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeType(plVault::kNodeType_AgeInfo); templateNode->SetNodeType(plVault::kNodeType_AgeInfo);
@ -3817,7 +3845,7 @@ RelVaultNode * VaultGetAgeInfoNodeIncRef () {
return nil; return nil;
RelVaultNode * result = nil; RelVaultNode * result = nil;
NetVaultNode * templateNode = NEWZERO(NetVaultNode); NetVaultNode * templateNode = new NetVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeType(plVault::kNodeType_AgeInfo); templateNode->SetNodeType(plVault::kNodeType_AgeInfo);
templateNode->SetCreatorId(rvnAge->nodeId); templateNode->SetCreatorId(rvnAge->nodeId);
@ -3892,7 +3920,7 @@ RelVaultNode * VaultFindAgeSubAgeLinkIncRef (const plAgeInfoStruct * info) {
if (RelVaultNode * rvnFldr = VaultGetAgeSubAgesFolderIncRef()) { if (RelVaultNode * rvnFldr = VaultGetAgeSubAgesFolderIncRef()) {
NetVaultNode * templateNode = NEWZERO(NetVaultNode); NetVaultNode * templateNode = new NetVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeType(plVault::kNodeType_AgeInfo); templateNode->SetNodeType(plVault::kNodeType_AgeInfo);
@ -3965,7 +3993,7 @@ RelVaultNode * VaultAgeAddDeviceAndWaitIncRef (const wchar_t deviceName[]) {
//============================================================================ //============================================================================
void VaultAgeRemoveDevice (const wchar_t deviceName[]) { void VaultAgeRemoveDevice (const wchar_t deviceName[]) {
if (RelVaultNode * folder = VaultGetAgeDevicesFolderIncRef()) { if (RelVaultNode * folder = VaultGetAgeDevicesFolderIncRef()) {
NetVaultNode * templateNode = NEWZERO(NetVaultNode); NetVaultNode * templateNode = new NetVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeType(plVault::kNodeType_TextNote); templateNode->SetNodeType(plVault::kNodeType_TextNote);
VaultTextNoteNode access(templateNode); VaultTextNoteNode access(templateNode);
@ -3986,7 +4014,7 @@ void VaultAgeRemoveDevice (const wchar_t deviceName[]) {
bool VaultAgeHasDevice (const wchar_t deviceName[]) { bool VaultAgeHasDevice (const wchar_t deviceName[]) {
bool found = false; bool found = false;
if (RelVaultNode * folder = VaultGetAgeDevicesFolderIncRef()) { if (RelVaultNode * folder = VaultGetAgeDevicesFolderIncRef()) {
NetVaultNode * templateNode = NEWZERO(NetVaultNode); NetVaultNode * templateNode = new NetVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeType(plVault::kNodeType_TextNote); templateNode->SetNodeType(plVault::kNodeType_TextNote);
VaultTextNoteNode access(templateNode); VaultTextNoteNode access(templateNode);
@ -4005,7 +4033,7 @@ bool VaultAgeHasDevice (const wchar_t deviceName[]) {
RelVaultNode * VaultAgeGetDeviceIncRef (const wchar_t deviceName[]) { RelVaultNode * VaultAgeGetDeviceIncRef (const wchar_t deviceName[]) {
RelVaultNode * result = nil; RelVaultNode * result = nil;
if (RelVaultNode * folder = VaultGetAgeDevicesFolderIncRef()) { if (RelVaultNode * folder = VaultGetAgeDevicesFolderIncRef()) {
NetVaultNode * templateNode = NEWZERO(NetVaultNode); NetVaultNode * templateNode = new NetVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeType(plVault::kNodeType_TextNote); templateNode->SetNodeType(plVault::kNodeType_TextNote);
VaultTextNoteNode access(templateNode); VaultTextNoteNode access(templateNode);
@ -4025,7 +4053,7 @@ RelVaultNode * VaultAgeSetDeviceInboxAndWaitIncRef (const wchar_t deviceName[],
StrCopy(devInbox->inboxName, inboxName, arrsize(devInbox->inboxName)); StrCopy(devInbox->inboxName, inboxName, arrsize(devInbox->inboxName));
} }
else { else {
devInbox = NEWZERO(DeviceInbox)(deviceName, inboxName); devInbox = new DeviceInbox(deviceName, inboxName);
s_ageDeviceInboxes.Add(devInbox); s_ageDeviceInboxes.Add(devInbox);
} }
@ -4077,7 +4105,7 @@ RelVaultNode * VaultAgeGetDeviceInboxIncRef (const wchar_t deviceName[]) {
} }
if (parentNode) { if (parentNode) {
NetVaultNode * templateNode = NEWZERO(NetVaultNode); NetVaultNode * templateNode = new NetVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeType(plVault::kNodeType_Folder); templateNode->SetNodeType(plVault::kNodeType_Folder);
VaultFolderNode access(templateNode); VaultFolderNode access(templateNode);
@ -4141,7 +4169,7 @@ RelVaultNode * VaultGetSubAgeLinkIncRef (const plAgeInfoStruct * info) {
if (RelVaultNode * rvnFldr = VaultGetAgeSubAgesFolderIncRef()) { if (RelVaultNode * rvnFldr = VaultGetAgeSubAgesFolderIncRef()) {
NetVaultNode * templateNode = NEWZERO(NetVaultNode); NetVaultNode * templateNode = new NetVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeType(plVault::kNodeType_AgeInfo); templateNode->SetNodeType(plVault::kNodeType_AgeInfo);
@ -4426,7 +4454,7 @@ namespace _VaultCreateSubAge {
LogMsg(kLogError, "CreateSubAge: Couldn't find SubAges folder (async)"); LogMsg(kLogError, "CreateSubAge: Couldn't find SubAges folder (async)");
// Send the VaultNotify that the plNetLinkingMgr wants... // Send the VaultNotify that the plNetLinkingMgr wants...
plVaultNotifyMsg * msg = NEWZERO(plVaultNotifyMsg); plVaultNotifyMsg * msg = new plVaultNotifyMsg;
msg->SetType(plVaultNotifyMsg::kRegisteredSubAgeLink); msg->SetType(plVaultNotifyMsg::kRegisteredSubAgeLink);
msg->SetResultCode(result); msg->SetResultCode(result);
msg->GetArgs()->AddInt(plNetCommon::VaultTaskArgs::kAgeLinkNode, node->nodeId); msg->GetArgs()->AddInt(plNetCommon::VaultTaskArgs::kAgeLinkNode, node->nodeId);
@ -4602,7 +4630,7 @@ bool VaultAgeFindOrCreateChildAgeLinkAndWait (
// Check for existing child age in folder // Check for existing child age in folder
RelVaultNode * rvnLink = nil; RelVaultNode * rvnLink = nil;
NetVaultNode * templateNode = NEWZERO(NetVaultNode); NetVaultNode * templateNode = new NetVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeType(plVault::kNodeType_AgeInfo); templateNode->SetNodeType(plVault::kNodeType_AgeInfo);
@ -4788,7 +4816,7 @@ namespace _VaultCreateChildAge {
VaultAddChildNode((uint32_t)((uintptr_t)p->fChildAgesFldr), node->nodeId, 0, nil, nil); VaultAddChildNode((uint32_t)((uintptr_t)p->fChildAgesFldr), node->nodeId, 0, nil, nil);
// Send the VaultNotify that the plNetLinkingMgr wants... // Send the VaultNotify that the plNetLinkingMgr wants...
plVaultNotifyMsg * msg = NEWZERO(plVaultNotifyMsg); plVaultNotifyMsg * msg = new plVaultNotifyMsg;
msg->SetType(plVaultNotifyMsg::kRegisteredChildAgeLink); msg->SetType(plVaultNotifyMsg::kRegisteredChildAgeLink);
msg->SetResultCode(result); msg->SetResultCode(result);
msg->GetArgs()->AddInt(plNetCommon::VaultTaskArgs::kAgeLinkNode, node->nodeId); msg->GetArgs()->AddInt(plNetCommon::VaultTaskArgs::kAgeLinkNode, node->nodeId);
@ -4867,7 +4895,7 @@ uint8_t VaultAgeFindOrCreateChildAgeLink(
StrToUnicode(hack, ageName, arrsize(hack)); StrToUnicode(hack, ageName, arrsize(hack));
// Search for our age // Search for our age
NetVaultNode* temp = NEWZERO(NetVaultNode); NetVaultNode* temp = new NetVaultNode;
temp->SetNodeType(plVault::kNodeType_AgeInfo); temp->SetNodeType(plVault::kNodeType_AgeInfo);
VaultAgeInfoNode theAge(temp); VaultAgeInfoNode theAge(temp);
theAge.SetAgeFilename(hack); theAge.SetAgeFilename(hack);
@ -4934,13 +4962,8 @@ void VaultDownload (
FVaultProgressCallback progressCallback, FVaultProgressCallback progressCallback,
void * cbProgressParam void * cbProgressParam
) { ) {
VaultDownloadTrans * trans = NEWZERO(VaultDownloadTrans); VaultDownloadTrans * trans = new VaultDownloadTrans(tag, callback, cbParam,
StrCopy(trans->tag, tag, arrsize(trans->tag)); progressCallback, cbProgressParam, vaultId);
trans->callback = callback;
trans->cbParam = cbParam;
trans->progressCallback = progressCallback;
trans->cbProgressParam = cbProgressParam;
trans->vaultId = vaultId;
NetCliAuthVaultFetchNodeRefs( NetCliAuthVaultFetchNodeRefs(
vaultId, vaultId,
@ -5032,7 +5055,7 @@ void VaultCull (unsigned vaultId) {
RelVaultNode * VaultGetSystemNodeIncRef () { RelVaultNode * VaultGetSystemNodeIncRef () {
RelVaultNode * result = nil; RelVaultNode * result = nil;
if (RelVaultNode * player = VaultGetPlayerNodeIncRef()) { if (RelVaultNode * player = VaultGetPlayerNodeIncRef()) {
NetVaultNode * templateNode = NEWZERO(NetVaultNode); NetVaultNode * templateNode = new NetVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeType(plVault::kNodeType_System); templateNode->SetNodeType(plVault::kNodeType_System);
if (RelVaultNode * systemNode = player->GetChildNodeIncRef(templateNode, 1)) if (RelVaultNode * systemNode = player->GetChildNodeIncRef(templateNode, 1))
@ -5047,7 +5070,7 @@ RelVaultNode * VaultGetSystemNodeIncRef () {
RelVaultNode * VaultGetGlobalInboxIncRef () { RelVaultNode * VaultGetGlobalInboxIncRef () {
RelVaultNode * result = nil; RelVaultNode * result = nil;
if (RelVaultNode * system = VaultGetSystemNodeIncRef()) { if (RelVaultNode * system = VaultGetSystemNodeIncRef()) {
NetVaultNode * templateNode = NEWZERO(NetVaultNode); NetVaultNode * templateNode = new NetVaultNode;
templateNode->IncRef(); templateNode->IncRef();
templateNode->SetNodeType(plVault::kNodeType_Folder); templateNode->SetNodeType(plVault::kNodeType_Folder);
VaultFolderNode folder(templateNode); VaultFolderNode folder(templateNode);

2
Sources/Plasma/PubUtilLib/plVault/plVaultNodeAccess.cpp

@ -579,7 +579,7 @@ void VaultSDLNode::SetStateDataRecord (const plStateDataRecord * rec, unsigned w
#ifdef CLIENT #ifdef CLIENT
void VaultSDLNode::InitStateDataRecord (const wchar_t sdlRecName[], unsigned writeOptions) { void VaultSDLNode::InitStateDataRecord (const wchar_t sdlRecName[], unsigned writeOptions) {
{ {
plStateDataRecord * rec = NEWZERO(plStateDataRecord); plStateDataRecord * rec = new plStateDataRecord;
bool exists = GetStateDataRecord(rec, 0); bool exists = GetStateDataRecord(rec, 0);
delete rec; delete rec;
if (exists) if (exists)

Loading…
Cancel
Save