From bc0d04da4815d67ce3d8aced7161fb0cccf7304e Mon Sep 17 00:00:00 2001 From: Michael Hansen Date: Fri, 4 Jan 2013 21:32:48 -0800 Subject: [PATCH] Deprecate and remove NEWZERO macro --- .../Plasma/Apps/plClientPatcher/UruPlayer.cpp | 3 +- .../Plasma/Apps/plUruLauncher/SelfPatcher.cpp | 2 +- Sources/Plasma/CoreLib/HeadSpin.h | 3 - .../Plasma/FeatureLib/pfConsole/pfConsole.cpp | 2 +- .../pfConsole/pfConsoleCommands.cpp | 2 +- .../FeatureLib/pfGameGUIMgr/pfGameGUIMgr.cpp | 2 +- .../pfGameMgr/BlueSpiral/pfGmBlueSpiral.cpp | 32 ++- .../ClimbingWall/pfGmClimbingWall.cpp | 36 ++- .../FeatureLib/pfGameMgr/Heek/pfGmHeek.cpp | 44 ++-- .../pfGameMgr/Marker/pfGmMarker.cpp | 52 ++--- .../pfGameMgr/TicTacToe/pfGmTicTacToe.cpp | 24 +- .../pfGameMgr/VarSync/pfGmVarSync.cpp | 34 ++- .../Plasma/FeatureLib/pfGameMgr/pfGameMgr.cpp | 31 +-- .../Plasma/FeatureLib/pfGameMgr/pfGameMgr.h | 6 +- .../Plasma/FeatureLib/pfPython/pyAgeVault.cpp | 6 +- .../Plasma/FeatureLib/pfPython/pyVault.cpp | 10 +- .../pfPython/pyVaultAgeInfoNode.cpp | 2 +- .../pfPython/pyVaultAgeLinkNode.cpp | 2 +- .../pfPython/pyVaultChronicleNode.cpp | 2 +- .../FeatureLib/pfPython/pyVaultFolderNode.cpp | 2 +- .../FeatureLib/pfPython/pyVaultImageNode.cpp | 2 +- .../pfPython/pyVaultMarkerGameNode.cpp | 2 +- .../FeatureLib/pfPython/pyVaultNode.cpp | 19 +- .../Plasma/FeatureLib/pfPython/pyVaultNode.h | 2 +- .../FeatureLib/pfPython/pyVaultNodeRef.cpp | 2 +- .../pfPython/pyVaultPlayerInfoListNode.cpp | 8 +- .../pfPython/pyVaultPlayerInfoNode.cpp | 2 +- .../FeatureLib/pfPython/pyVaultSDLNode.cpp | 4 +- .../pfPython/pyVaultTextNoteNode.cpp | 4 +- .../NucleusLib/pnAsyncCore/Private/pnAcIo.h | 10 + .../pnAsyncCore/Private/pnAcThread.h | 4 +- .../pnAsyncCoreExe/Private/Nt/pnAceNtInt.h | 16 +- .../Private/Nt/pnAceNtSocket.cpp | 13 +- .../Plasma/NucleusLib/pnNetCli/pnNcCli.cpp | 16 +- .../pnNetProtocol/Private/pnNpCommon.cpp | 15 +- Sources/Plasma/NucleusLib/pnUtils/pnUtHash.h | 2 + Sources/Plasma/NucleusLib/pnUtils/pnUtList.h | 2 +- .../PubUtilLib/plAvatar/plAvatarClothing.cpp | 6 +- .../PubUtilLib/plMessage/plNetClientMgrMsg.h | 15 +- .../PubUtilLib/plMessage/plVaultNotifyMsg.h | 8 +- .../plNetClient/plNetCliAgeJoiner.cpp | 5 +- .../plNetClient/plNetCliAgeLeaver.cpp | 6 +- .../PubUtilLib/plNetClient/plNetClientMgr.cpp | 10 +- .../plNetClient/plNetLinkingMgr.cpp | 14 +- .../plNetClientComm/plNetClientComm.cpp | 9 +- .../plNetClientComm/plNetClientComm.h | 8 +- .../plNetCommon/plNetCommonHelpers.h | 4 +- .../plNetGameLib/Private/plNglAuth.cpp | 67 +++--- .../plNetGameLib/Private/plNglFile.cpp | 12 +- .../plNetGameLib/Private/plNglGame.cpp | 13 +- .../plNetGameLib/Private/plNglGateKeeper.cpp | 17 +- .../plNetGameLib/Private/plNglTrans.cpp | 1 + Sources/Plasma/PubUtilLib/plSDL/plSDL.h | 4 +- .../PubUtilLib/plVault/plVaultClientApi.cpp | 219 ++++++++++-------- .../PubUtilLib/plVault/plVaultNodeAccess.cpp | 2 +- 55 files changed, 455 insertions(+), 385 deletions(-) diff --git a/Sources/Plasma/Apps/plClientPatcher/UruPlayer.cpp b/Sources/Plasma/Apps/plClientPatcher/UruPlayer.cpp index 5a80f1a8..8ed2701d 100644 --- a/Sources/Plasma/Apps/plClientPatcher/UruPlayer.cpp +++ b/Sources/Plasma/Apps/plClientPatcher/UruPlayer.cpp @@ -631,8 +631,7 @@ static void ProcessManifest (void * param) { ); if (i < kMaxManifestFileRequests) { - ProgressStream * stream; - stream = NEWZERO(ProgressStream); + ProgressStream * stream = new ProgressStream; if (!stream->Open(path, "wb")) { #ifdef PLASMA_EXTERNAL_RELEASE MessageBox(nil, s_fileOpenError, "URU Launcher", MB_ICONERROR); diff --git a/Sources/Plasma/Apps/plUruLauncher/SelfPatcher.cpp b/Sources/Plasma/Apps/plUruLauncher/SelfPatcher.cpp index 8e1b4689..491ad2f0 100644 --- a/Sources/Plasma/Apps/plUruLauncher/SelfPatcher.cpp +++ b/Sources/Plasma/Apps/plUruLauncher/SelfPatcher.cpp @@ -198,7 +198,7 @@ static void ManifestCallback ( SetText("Downloading new patcher..."); StrToAnsi(ansi, s_newPatcherFile, arrsize(ansi)); - SelfPatcherStream * stream = NEWZERO(SelfPatcherStream); + SelfPatcherStream * stream = new SelfPatcherStream; if (!stream->Open(ansi, "wb")) ErrorAssert(__LINE__, __FILE__, "Failed to create file: %s, errno: %u", ansi, errno); diff --git a/Sources/Plasma/CoreLib/HeadSpin.h b/Sources/Plasma/CoreLib/HeadSpin.h index e032b5f6..10b00422 100644 --- a/Sources/Plasma/CoreLib/HeadSpin.h +++ b/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)); } #define hsInvert(a) (1 / (a)) -#include -#define NEWZERO(t) new(calloc(sizeof(t), 1)) t - #ifdef _MSC_VER # define ALIGN(n) __declspec(align(n)) #else diff --git a/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp b/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp index bc262f0e..92e0821c 100644 --- a/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp +++ b/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp @@ -1223,7 +1223,7 @@ void pfConsole::AddLineF(const char * fmt, ...) { //============================================================================ void pfConsole::RunCommandAsync (const char cmd[]) { - plConsoleMsg * consoleMsg = NEWZERO(plConsoleMsg); + plConsoleMsg * consoleMsg = new plConsoleMsg; consoleMsg->SetCmd(plConsoleMsg::kExecuteLine); consoleMsg->SetString(cmd); // consoleMsg->SetBreakBeforeDispatch(true); diff --git a/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp b/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp index 5c7676b3..f5b850f5 100644 --- a/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp +++ b/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp @@ -6036,7 +6036,7 @@ PF_CONSOLE_GROUP( Age ) PF_CONSOLE_CMD(Age, ShowSDL, "", "Prints the age SDL values") { - plStateDataRecord * rec = NEWZERO(plStateDataRecord); + plStateDataRecord * rec = new plStateDataRecord; if (!VaultAgeGetAgeSDL(rec)) { PrintString("Age SDL not found"); delete rec; diff --git a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGameGUIMgr.cpp b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGameGUIMgr.cpp index 3b7d3ce5..420aea8f 100644 --- a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGameGUIMgr.cpp +++ b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGameGUIMgr.cpp @@ -796,7 +796,7 @@ bool pfGameUIInputInterface::InterpretInputEvent( plInputEventMsg *pMsg ) if ((keymap->GetKey1().IsSatisfiedBy(combo)) || (keymap->GetKey2().IsSatisfiedBy(combo))) { // tell the KI to take the shot - plConsoleMsg * consoleMsg = NEWZERO(plConsoleMsg); + plConsoleMsg * consoleMsg = new plConsoleMsg; consoleMsg->SetCmd(plConsoleMsg::kExecuteLine); consoleMsg->SetString("Game.KITakePicture"); consoleMsg->Send(nil, true); diff --git a/Sources/Plasma/FeatureLib/pfGameMgr/BlueSpiral/pfGmBlueSpiral.cpp b/Sources/Plasma/FeatureLib/pfGameMgr/BlueSpiral/pfGmBlueSpiral.cpp index 3121767e..0389e310 100644 --- a/Sources/Plasma/FeatureLib/pfGameMgr/BlueSpiral/pfGmBlueSpiral.cpp +++ b/Sources/Plasma/FeatureLib/pfGameMgr/BlueSpiral/pfGmBlueSpiral.cpp @@ -58,8 +58,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com struct IBlueSpiral { pfGmBlueSpiral * gameCli; - - IBlueSpiral (pfGmBlueSpiral * gameCli); + + IBlueSpiral (pfGmBlueSpiral * gameCli) : gameCli(gameCli) { } // pfGameCli event notification handlers void Recv (GameMsgHeader * msg, void * param); @@ -88,7 +88,7 @@ static pfGameCli * BlueSpiralFactory ( unsigned gameId, 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) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } @@ -127,7 +121,7 @@ void IBlueSpiral::OnPlayerJoined (const Srv2Cli_Game_PlayerJoined & msg) { //============================================================================ void IBlueSpiral::OnPlayerLeft (const Srv2Cli_Game_PlayerLeft & msg) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } @@ -135,7 +129,7 @@ void IBlueSpiral::OnPlayerLeft (const Srv2Cli_Game_PlayerLeft & msg) { //============================================================================ void IBlueSpiral::OnInviteFailed (const Srv2Cli_Game_InviteFailed & msg) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } @@ -143,42 +137,42 @@ void IBlueSpiral::OnInviteFailed (const Srv2Cli_Game_InviteFailed & msg) { //============================================================================ void IBlueSpiral::OnOwnerChange (const Srv2Cli_Game_OwnerChange & msg) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } //============================================================================ void IBlueSpiral::RecvClothOrder (const Srv2Cli_BlueSpiral_ClothOrder & msg, void * param) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } //============================================================================ void IBlueSpiral::RecvSuccessfulHit (const Srv2Cli_BlueSpiral_SuccessfulHit & msg, void * param) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } //============================================================================ void IBlueSpiral::RecvGameWon (const Srv2Cli_BlueSpiral_GameWon & msg, void * param) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } //============================================================================ void IBlueSpiral::RecvGameOver (const Srv2Cli_BlueSpiral_GameOver & msg, void * param) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } //============================================================================ void IBlueSpiral::RecvGameStarted (const Srv2Cli_BlueSpiral_GameStarted & msg, void * param) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } @@ -197,7 +191,7 @@ pfGmBlueSpiral::pfGmBlueSpiral ( ) : pfGameCli(gameId, receiver) { - internal = NEWZERO(IBlueSpiral)(this); + internal = new IBlueSpiral(this); } //============================================================================ diff --git a/Sources/Plasma/FeatureLib/pfGameMgr/ClimbingWall/pfGmClimbingWall.cpp b/Sources/Plasma/FeatureLib/pfGameMgr/ClimbingWall/pfGmClimbingWall.cpp index d367aaf1..127a5fc1 100644 --- a/Sources/Plasma/FeatureLib/pfGameMgr/ClimbingWall/pfGmClimbingWall.cpp +++ b/Sources/Plasma/FeatureLib/pfGameMgr/ClimbingWall/pfGmClimbingWall.cpp @@ -57,9 +57,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com ***/ struct IClimbingWall { - pfGmClimbingWall * gameCli; - - IClimbingWall (pfGmClimbingWall * gameCli); + pfGmClimbingWall * gameCli; + + IClimbingWall (pfGmClimbingWall * gameCli) : gameCli(gameCli) { } // pfGameCli event notification handlers void Recv (GameMsgHeader * msg, void * param); @@ -89,7 +89,7 @@ static pfGameCli * ClimbingWallFactory ( unsigned gameId, 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) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } @@ -128,7 +122,7 @@ void IClimbingWall::OnPlayerJoined (const Srv2Cli_Game_PlayerJoined & msg) { //============================================================================ void IClimbingWall::OnPlayerLeft (const Srv2Cli_Game_PlayerLeft & msg) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } @@ -136,7 +130,7 @@ void IClimbingWall::OnPlayerLeft (const Srv2Cli_Game_PlayerLeft & msg) { //============================================================================ void IClimbingWall::OnInviteFailed (const Srv2Cli_Game_InviteFailed & msg) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } @@ -144,49 +138,49 @@ void IClimbingWall::OnInviteFailed (const Srv2Cli_Game_InviteFailed & msg) { //============================================================================ void IClimbingWall::OnOwnerChange (const Srv2Cli_Game_OwnerChange & msg) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } //============================================================================ void IClimbingWall::RecvNumBlockersChanged (const Srv2Cli_ClimbingWall_NumBlockersChanged & msg, void * param) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } //============================================================================ void IClimbingWall::RecvReady (const Srv2Cli_ClimbingWall_Ready & msg, void * param) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } //============================================================================ void IClimbingWall::RecvBlockersChanged (const Srv2Cli_ClimbingWall_BlockersChanged & msg, void * param) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } //============================================================================ void IClimbingWall::RecvPlayerEntered (const Srv2Cli_ClimbingWall_PlayerEntered & msg, void * param) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } //============================================================================ void IClimbingWall::RecvSuitMachineLocked (const Srv2Cli_ClimbingWall_SuitMachineLocked & msg, void * param) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } //============================================================================ void IClimbingWall::RecvGameOver (const Srv2Cli_ClimbingWall_GameOver & msg, void * param) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } @@ -205,7 +199,7 @@ pfGmClimbingWall::pfGmClimbingWall ( ) : pfGameCli(gameId, receiver) { - internal = NEWZERO(IClimbingWall)(this); + internal = new IClimbingWall(this); } //============================================================================ diff --git a/Sources/Plasma/FeatureLib/pfGameMgr/Heek/pfGmHeek.cpp b/Sources/Plasma/FeatureLib/pfGameMgr/Heek/pfGmHeek.cpp index 348a1e50..0c136e2a 100644 --- a/Sources/Plasma/FeatureLib/pfGameMgr/Heek/pfGmHeek.cpp +++ b/Sources/Plasma/FeatureLib/pfGameMgr/Heek/pfGmHeek.cpp @@ -57,9 +57,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com ***/ struct IHeek { - pfGmHeek * gameCli; + pfGmHeek * gameCli; - IHeek (pfGmHeek * gameCli); + IHeek (pfGmHeek * gameCli) : gameCli(gameCli) { } // pfGameCli event notification handlers void Recv (GameMsgHeader * msg, void * param); @@ -94,7 +94,7 @@ static pfGameCli * HeekFactory ( unsigned gameId, 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) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } //============================================================================ void IHeek::OnPlayerLeft (const Srv2Cli_Game_PlayerLeft & msg) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } //============================================================================ void IHeek::OnInviteFailed (const Srv2Cli_Game_InviteFailed & msg) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } //============================================================================ void IHeek::OnOwnerChange (const Srv2Cli_Game_OwnerChange & msg) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } //============================================================================ void IHeek::RecvPlayGame (const Srv2Cli_Heek_PlayGame & msg, void * param) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } //============================================================================ void IHeek::RecvGoodbye (const Srv2Cli_Heek_Goodbye & msg, void * param) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } //============================================================================ void IHeek::RecvWelcome (const Srv2Cli_Heek_Welcome & msg, void * param) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } //============================================================================ void IHeek::RecvDrop (const Srv2Cli_Heek_Drop & msg, void * param) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } //============================================================================ void IHeek::RecvSetup (const Srv2Cli_Heek_Setup & msg, void * param) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } //============================================================================ void IHeek::RecvLightState (const Srv2Cli_Heek_LightState & msg, void * param) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } //============================================================================ void IHeek::RecvInterfaceState (const Srv2Cli_Heek_InterfaceState & msg, void * param) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } //============================================================================ void IHeek::RecvCountdownState (const Srv2Cli_Heek_CountdownState & msg, void * param) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } //============================================================================ void IHeek::RecvWinLose (const Srv2Cli_Heek_WinLose & msg, void * param) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } //============================================================================ void IHeek::RecvGameWin (const Srv2Cli_Heek_GameWin & msg, void * param) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } //============================================================================ void IHeek::RecvPointUpdate (const Srv2Cli_Heek_PointUpdate & msg, void * param) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } @@ -240,7 +234,7 @@ pfGmHeek::pfGmHeek ( ) : pfGameCli(gameId, receiver) { - internal = NEWZERO(IHeek)(this); + internal = new IHeek(this); } //============================================================================ diff --git a/Sources/Plasma/FeatureLib/pfGameMgr/Marker/pfGmMarker.cpp b/Sources/Plasma/FeatureLib/pfGameMgr/Marker/pfGmMarker.cpp index 46d8459d..3a7ebe93 100644 --- a/Sources/Plasma/FeatureLib/pfGameMgr/Marker/pfGmMarker.cpp +++ b/Sources/Plasma/FeatureLib/pfGameMgr/Marker/pfGmMarker.cpp @@ -57,9 +57,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com ***/ struct IMarker { - pfGmMarker * gameCli; - - IMarker (pfGmMarker * gameCli); + pfGmMarker * gameCli; + + IMarker (pfGmMarker * gameCli) : gameCli(gameCli) { } // pfGameCli event notification handlers void Recv (GameMsgHeader * msg, void * param); @@ -97,7 +97,7 @@ static pfGameCli * MarkerFactory ( unsigned gameId, 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) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } @@ -136,7 +130,7 @@ void IMarker::OnPlayerJoined (const Srv2Cli_Game_PlayerJoined & msg) { //============================================================================ void IMarker::OnPlayerLeft (const Srv2Cli_Game_PlayerLeft & msg) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } @@ -144,7 +138,7 @@ void IMarker::OnPlayerLeft (const Srv2Cli_Game_PlayerLeft & msg) { //============================================================================ void IMarker::OnInviteFailed (const Srv2Cli_Game_InviteFailed & msg) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } @@ -152,7 +146,7 @@ void IMarker::OnInviteFailed (const Srv2Cli_Game_InviteFailed & msg) { //============================================================================ void IMarker::OnOwnerChange (const Srv2Cli_Game_OwnerChange & msg) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); 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) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); 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) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } //============================================================================ void IMarker::RecvGameType (const Srv2Cli_Marker_GameType & msg, void * param) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } //============================================================================ void IMarker::RecvGameStarted (const Srv2Cli_Marker_GameStarted & msg, void * param) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } //============================================================================ void IMarker::RecvGamePaused (const Srv2Cli_Marker_GamePaused & msg, void * param) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } //============================================================================ void IMarker::RecvGameReset (const Srv2Cli_Marker_GameReset & msg, void * param) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } //============================================================================ void IMarker::RecvGameOver (const Srv2Cli_Marker_GameOver & msg, void * param) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } //============================================================================ void IMarker::RecvGameNameChanged (const Srv2Cli_Marker_GameNameChanged & msg, void * param) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } //============================================================================ void IMarker::RecvTimeLimitChanged (const Srv2Cli_Marker_TimeLimitChanged & msg, void * param) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } //============================================================================ void IMarker::RecvGameDeleted (const Srv2Cli_Marker_GameDeleted & msg, void * param) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); 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) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } //============================================================================ void IMarker::RecvMarkerDeleted (const Srv2Cli_Marker_MarkerDeleted & msg, void * param) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } //============================================================================ void IMarker::RecvMarkerNameChanged (const Srv2Cli_Marker_MarkerNameChanged & msg, void * param) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } //============================================================================ void IMarker::RecvMarkerCaptured (const Srv2Cli_Marker_MarkerCaptured & msg, void * param) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } @@ -274,7 +268,7 @@ pfGmMarker::pfGmMarker ( ) : pfGameCli(gameId, receiver) { - internal = NEWZERO(IMarker)(this); + internal = new IMarker(this); } //============================================================================ diff --git a/Sources/Plasma/FeatureLib/pfGameMgr/TicTacToe/pfGmTicTacToe.cpp b/Sources/Plasma/FeatureLib/pfGameMgr/TicTacToe/pfGmTicTacToe.cpp index 1ae046d8..f78f7610 100644 --- a/Sources/Plasma/FeatureLib/pfGameMgr/TicTacToe/pfGmTicTacToe.cpp +++ b/Sources/Plasma/FeatureLib/pfGameMgr/TicTacToe/pfGmTicTacToe.cpp @@ -61,7 +61,7 @@ struct ITicTacToe { char board[3][3]; char myself; char other; - + ITicTacToe (pfGmTicTacToe * gameCli); // pfGameCli event notification handlers @@ -89,7 +89,7 @@ static pfGameCli * TicTacToeFactory ( unsigned gameId, plKey receiver ) { - return NEWZERO(pfGmTicTacToe)(gameId, receiver); + return new pfGmTicTacToe(gameId, receiver); } //============================================================================ @@ -113,7 +113,7 @@ AUTO_INIT_FUNC(RegisterTicTacToeFactory) { //============================================================================ ITicTacToe::ITicTacToe (pfGmTicTacToe * gameCli) -: gameCli(gameCli) +: gameCli(gameCli), myself(0), other(0) { // Fill the board with space chars memset(board, ' ', sizeof(board)); @@ -122,7 +122,7 @@ ITicTacToe::ITicTacToe (pfGmTicTacToe * gameCli) //============================================================================ void ITicTacToe::OnPlayerJoined (const Srv2Cli_Game_PlayerJoined & msg) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } @@ -130,7 +130,7 @@ void ITicTacToe::OnPlayerJoined (const Srv2Cli_Game_PlayerJoined & msg) { //============================================================================ void ITicTacToe::OnPlayerLeft (const Srv2Cli_Game_PlayerLeft & msg) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } @@ -138,7 +138,7 @@ void ITicTacToe::OnPlayerLeft (const Srv2Cli_Game_PlayerLeft & msg) { //============================================================================ void ITicTacToe::OnInviteFailed (const Srv2Cli_Game_InviteFailed & msg) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } @@ -146,7 +146,7 @@ void ITicTacToe::OnInviteFailed (const Srv2Cli_Game_InviteFailed & msg) { //============================================================================ void ITicTacToe::OnOwnerChange (const Srv2Cli_Game_OwnerChange & msg) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } @@ -163,14 +163,14 @@ void ITicTacToe::RecvGameStarted (const Srv2Cli_TTT_GameStarted & msg, void * pa other = 'X'; } - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } //============================================================================ void ITicTacToe::RecvGameOver (const Srv2Cli_TTT_GameOver & msg, void * param) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); @@ -185,11 +185,11 @@ void ITicTacToe::RecvMoveMade (const Srv2Cli_TTT_MoveMade & msg, void * param) { else board[msg.row][msg.col] = other; - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } - + /***************************************************************************** * @@ -204,7 +204,7 @@ pfGmTicTacToe::pfGmTicTacToe ( ) : pfGameCli(gameId, receiver) { - internal = NEWZERO(ITicTacToe)(this); + internal = new ITicTacToe(this); } //============================================================================ diff --git a/Sources/Plasma/FeatureLib/pfGameMgr/VarSync/pfGmVarSync.cpp b/Sources/Plasma/FeatureLib/pfGameMgr/VarSync/pfGmVarSync.cpp index 9a8d9530..f80077b6 100644 --- a/Sources/Plasma/FeatureLib/pfGameMgr/VarSync/pfGmVarSync.cpp +++ b/Sources/Plasma/FeatureLib/pfGameMgr/VarSync/pfGmVarSync.cpp @@ -57,9 +57,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com ***/ struct IVarSync { - pfGmVarSync * gameCli; - - IVarSync (pfGmVarSync * gameCli); + pfGmVarSync * gameCli; + + IVarSync (pfGmVarSync * gameCli) : gameCli(gameCli) { } // pfGameCli event notification handlers void Recv (GameMsgHeader * msg, void * param); @@ -88,7 +88,7 @@ static pfGameCli * VarSyncFactory ( unsigned gameId, 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) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } @@ -127,7 +121,7 @@ void IVarSync::OnPlayerJoined (const Srv2Cli_Game_PlayerJoined & msg) { //============================================================================ void IVarSync::OnPlayerLeft (const Srv2Cli_Game_PlayerLeft & msg) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } @@ -135,7 +129,7 @@ void IVarSync::OnPlayerLeft (const Srv2Cli_Game_PlayerLeft & msg) { //============================================================================ void IVarSync::OnInviteFailed (const Srv2Cli_Game_InviteFailed & msg) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } @@ -143,42 +137,42 @@ void IVarSync::OnInviteFailed (const Srv2Cli_Game_InviteFailed & msg) { //============================================================================ void IVarSync::OnOwnerChange (const Srv2Cli_Game_OwnerChange & msg) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } //============================================================================ void IVarSync::RecvStringVarChanged (const Srv2Cli_VarSync_StringVarChanged & msg, void * param) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } //============================================================================ void IVarSync::RecvNumericVarChanged (const Srv2Cli_VarSync_NumericVarChanged & msg, void * param) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } //============================================================================ void IVarSync::RecvAllVarsSent (const Srv2Cli_VarSync_AllVarsSent & msg, void * param) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } //============================================================================ void IVarSync::RecvStringVarCreated (const Srv2Cli_VarSync_StringVarCreated & msg, void * param) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } //============================================================================ void IVarSync::RecvNumericVarCreated (const Srv2Cli_VarSync_NumericVarCreated & msg, void * param) { - pfGameCliMsg * gameCliMsg = NEWZERO(pfGameCliMsg); + pfGameCliMsg * gameCliMsg = new pfGameCliMsg; gameCliMsg->Set(gameCli, msg); gameCliMsg->Send(gameCli->GetReceiver()); } @@ -196,7 +190,7 @@ pfGmVarSync::pfGmVarSync ( ) : pfGameCli(gameId, receiver) { - internal = NEWZERO(IVarSync)(this); + internal = new IVarSync(this); } //============================================================================ diff --git a/Sources/Plasma/FeatureLib/pfGameMgr/pfGameMgr.cpp b/Sources/Plasma/FeatureLib/pfGameMgr/pfGameMgr.cpp index a612533a..61b88b88 100644 --- a/Sources/Plasma/FeatureLib/pfGameMgr/pfGameMgr.cpp +++ b/Sources/Plasma/FeatureLib/pfGameMgr/pfGameMgr.cpp @@ -76,7 +76,7 @@ struct IGameCli : THashKeyVal { Factory * factory; plKey receiver; unsigned playerCount; - + IGameCli ( pfGameCli * gameCli, unsigned gameId, @@ -209,7 +209,7 @@ void IGameMgr::RecvGameInstance (const Srv2Cli_GameMgr_GameInstance & msg, void //============================================================================ void IGameMgr::RecvInviteReceived (const Srv2Cli_GameMgr_InviteReceived & msg, void * param) { - pfGameMgrMsg * gameMgrMsg = NEWZERO(pfGameMgrMsg); + pfGameMgrMsg * gameMgrMsg = new pfGameMgrMsg; gameMgrMsg->Set(msg); for (unsigned i = 0; i < s_receivers.Count(); ++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) { - pfGameMgrMsg * gameMgrMsg = NEWZERO(pfGameMgrMsg); + pfGameMgrMsg * gameMgrMsg = new pfGameMgrMsg; gameMgrMsg->Set(msg); for (unsigned i = 0; i < s_receivers.Count(); ++i) gameMgrMsg->AddReceiver(s_receivers[i]); @@ -275,12 +275,6 @@ void IGameMgr::StaticRecv (GameMsgHeader * msg) { * ***/ -//============================================================================ -pfGameMgrMsg::pfGameMgrMsg () { - - netMsg = nil; -} - //============================================================================ pfGameMgrMsg::~pfGameMgrMsg () { @@ -301,13 +295,6 @@ void pfGameMgrMsg::Set (const GameMsgHeader & msg) { * ***/ -//============================================================================ -pfGameCliMsg::pfGameCliMsg () { - - gameCli = nil; - netMsg = nil; -} - //============================================================================ pfGameCliMsg::~pfGameCliMsg () { @@ -403,7 +390,7 @@ void pfGameMgr::JoinGame ( msg.messageBytes = msgBytes; - GameMgrSend(&msg, NEWZERO(JoinTransState)(receiver)); + GameMgrSend(&msg, new JoinTransState(receiver)); } //============================================================================ @@ -431,7 +418,7 @@ void pfGameMgr::CreateGame ( msg->createDataBytes = initBytes; memcpy(msg->createData, initData, initBytes); - GameMgrSend(msg, NEWZERO(JoinTransState)(receiver)); + GameMgrSend(msg, new JoinTransState(receiver)); free(msg); } @@ -462,7 +449,7 @@ void pfGameMgr::JoinCommonGame ( msg->createDataBytes = initBytes; memcpy(msg->createData, initData, initBytes); - GameMgrSend(msg, NEWZERO(JoinTransState)(receiver)); + GameMgrSend(msg, new JoinTransState(receiver)); free(msg); } @@ -479,7 +466,7 @@ pfGameCli::pfGameCli ( unsigned gameId, plKey receiver ) { - internal = NEWZERO(IGameCli)(this, gameId, receiver); + internal = new IGameCli(this, gameId, receiver); } //============================================================================ @@ -567,7 +554,9 @@ IGameCli::IGameCli ( plKey receiver ) : THashKeyVal(gameId) , gameCli(gameCli) +, factory(nil) , receiver(receiver) +, playerCount(0) { s_games.Add(this); } @@ -651,7 +640,7 @@ TransState::TransState (unsigned transId, void * param) //============================================================================ void GameMgrRegisterGameType (const GameTypeReg & reg) { - (void)NEWZERO(Factory)(reg); + (void)new Factory(reg); } //============================================================================ diff --git a/Sources/Plasma/FeatureLib/pfGameMgr/pfGameMgr.h b/Sources/Plasma/FeatureLib/pfGameMgr/pfGameMgr.h index d7a86cde..7fae8419 100644 --- a/Sources/Plasma/FeatureLib/pfGameMgr/pfGameMgr.h +++ b/Sources/Plasma/FeatureLib/pfGameMgr/pfGameMgr.h @@ -86,7 +86,7 @@ public: void Read(hsStream *, hsResMgr *) { FATAL("not impl"); } void Write(hsStream *, hsResMgr *) { FATAL("not impl"); } - pfGameMgrMsg (); + pfGameMgrMsg () : netMsg(nil) { } ~pfGameMgrMsg (); void Set (const GameMsgHeader & msg); @@ -108,8 +108,8 @@ public: CLASSNAME_REGISTER(pfGameCliMsg); GETINTERFACE_ANY(pfGameCliMsg, plMessage); #pragma warning(pop) - - pfGameCliMsg (); + + pfGameCliMsg () : gameCli(nil), netMsg(nil) { } ~pfGameCliMsg (); void Read(hsStream *, hsResMgr *) { FATAL("not impl"); } diff --git a/Sources/Plasma/FeatureLib/pfPython/pyAgeVault.cpp b/Sources/Plasma/FeatureLib/pfPython/pyAgeVault.cpp index 16e2c093..61721e1c 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyAgeVault.cpp +++ b/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. 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 ); wchar_t wStr[MAX_PATH]; @@ -278,7 +278,7 @@ PyObject * pyAgeVault::GetDevice( const char * deviceName ) // Sets the inbox associated with a device. 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 ); wchar_t wDev[MAX_PATH]; @@ -310,7 +310,7 @@ PyObject * pyAgeVault::GetDeviceInbox( const char * deviceName ) PyObject * pyAgeVault::GetAgeSDL() const { - plStateDataRecord * rec = NEWZERO(plStateDataRecord); + plStateDataRecord * rec = new plStateDataRecord; if (!VaultAgeGetAgeSDL(rec)) { delete rec; PYTHON_RETURN_NONE; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVault.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVault.cpp index cbecd840..c09b2a75 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVault.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVault.cpp @@ -431,7 +431,7 @@ PyObject* pyVault::GetInviteFolder(void) PyObject* pyVault::GetPsnlAgeSDL() const { PyObject * result = nil; - NetVaultNode * templateNode = NEWZERO(NetVaultNode); + NetVaultNode * templateNode = new NetVaultNode; templateNode->IncRef(); if (RelVaultNode * rvnFldr = VaultGetAgesIOwnFolderIncRef()) { @@ -450,7 +450,7 @@ PyObject* pyVault::GetPsnlAgeSDL() const if (RelVaultNode * rvnSdl = rvnInfo->GetChildNodeIncRef(templateNode, 1)) { VaultSDLNode sdl(rvnSdl); - plStateDataRecord * rec = NEWZERO(plStateDataRecord); + plStateDataRecord * rec = new plStateDataRecord; if (sdl.GetStateDataRecord(rec, plSDL::kKeepDirty)) result = pySDLStateDataRecord::New(rec); else @@ -476,7 +476,7 @@ void pyVault::UpdatePsnlAgeSDL( pySDLStateDataRecord & pyrec ) if ( !rec ) return; - NetVaultNode * templateNode = NEWZERO(NetVaultNode); + NetVaultNode * templateNode = new NetVaultNode; templateNode->IncRef(); 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 ) { - NetVaultNode * templateNode = NEWZERO(NetVaultNode); + NetVaultNode * templateNode = new NetVaultNode; templateNode->IncRef(); templateNode->SetNodeType(plVault::kNodeType_TextNote); VaultTextNoteNode visitAcc(templateNode); @@ -622,7 +622,7 @@ void pyVault::UnInvitePlayerToAge( const char * str, uint32_t playerID ) rvnLink->DecRef(); } - NetVaultNode * templateNode = NEWZERO(NetVaultNode); + NetVaultNode * templateNode = new NetVaultNode; templateNode->IncRef(); templateNode->SetNodeType(plVault::kNodeType_TextNote); VaultTextNoteNode visitAcc(templateNode); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNode.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNode.cpp index 5a914ab8..e5b0c0c2 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNode.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNode.cpp @@ -69,7 +69,7 @@ pyVaultAgeInfoNode::pyVaultAgeInfoNode(RelVaultNode* nfsNode) //create from the Python side pyVaultAgeInfoNode::pyVaultAgeInfoNode(int n) -: pyVaultNode(NEWZERO(RelVaultNode)) +: pyVaultNode(new RelVaultNode) { fNode->SetNodeType(plVault::kNodeType_AgeInfo); } diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeLinkNode.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeLinkNode.cpp index 27d23d94..0115e3f4 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeLinkNode.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeLinkNode.cpp @@ -66,7 +66,7 @@ pyVaultAgeLinkNode::pyVaultAgeLinkNode(RelVaultNode* nfsNode) //create from the Python side pyVaultAgeLinkNode::pyVaultAgeLinkNode(int n) -: pyVaultNode(NEWZERO(RelVaultNode)) +: pyVaultNode(new RelVaultNode) { fNode->SetNodeType(plVault::kNodeType_AgeLink); } diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultChronicleNode.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultChronicleNode.cpp index a168b729..ff286ca6 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultChronicleNode.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultChronicleNode.cpp @@ -63,7 +63,7 @@ pyVaultChronicleNode::pyVaultChronicleNode(RelVaultNode* nfsNode) //create from the Python side pyVaultChronicleNode::pyVaultChronicleNode(int n) -: pyVaultNode(NEWZERO(RelVaultNode)) +: pyVaultNode(new RelVaultNode) , ansiName(nil) , ansiValue(nil) { diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultFolderNode.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultFolderNode.cpp index f1988f79..c1920f95 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultFolderNode.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultFolderNode.cpp @@ -58,7 +58,7 @@ pyVaultFolderNode::pyVaultFolderNode( RelVaultNode* nfsNode ) //create from the Python side pyVaultFolderNode::pyVaultFolderNode(int n) -: pyVaultNode(NEWZERO(RelVaultNode)) +: pyVaultNode(new RelVaultNode) { fNode->SetNodeType(plVault::kNodeType_Folder); } diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.cpp index 4c2cd6d6..e185db00 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.cpp @@ -96,7 +96,7 @@ pyVaultImageNode::pyVaultImageNode(RelVaultNode* nfsNode) //create from the Python side pyVaultImageNode::pyVaultImageNode(int n) -: pyVaultNode(NEWZERO(RelVaultNode)) +: pyVaultNode(new RelVaultNode) , fMipmapKey(nil) , fMipmap(nil) { diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNode.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNode.cpp index 655d6ae0..27564ff3 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNode.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNode.cpp @@ -59,7 +59,7 @@ pyVaultMarkerGameNode::pyVaultMarkerGameNode(RelVaultNode* nfsNode) //create from the Python side pyVaultMarkerGameNode::pyVaultMarkerGameNode(int n) -: pyVaultNode(NEWZERO(RelVaultNode)) +: pyVaultNode(new RelVaultNode) { fNode->SetNodeType(plVault::kNodeType_MarkerGame); } diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultNode.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultNode.cpp index bc22584c..3e4dcf9f 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultNode.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultNode.cpp @@ -96,6 +96,7 @@ pyVaultNode::pyVaultNodeOperationCallback::pyVaultNodeOperationCallback(PyObject : fCbObject( cbObject ) , fNode(nil) , fPyNodeRef(nil) +, fContext(0) { Py_XINCREF( fCbObject ); } @@ -269,7 +270,7 @@ PyObject* pyVaultNode::GetCreatorNode( void ) PyObject * result = nil; if (fNode) { - RelVaultNode * templateNode = NEWZERO(RelVaultNode); + RelVaultNode * templateNode = new RelVaultNode; templateNode->IncRef(); templateNode->SetNodeType(plVault::kNodeType_PlayerInfo); VaultPlayerInfoNode plrInfo(templateNode); @@ -403,7 +404,7 @@ void _AddNodeCallback(ENetError result, void* param) { 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() ) { @@ -460,7 +461,7 @@ PyObject* pyVaultNode::AddNode(pyVaultNode* pynode, PyObject* cbObject, uint32_t // Link a node to this one void pyVaultNode::LinkToNode(int nodeID, PyObject* cbObject, uint32_t cbContext) { - pyVaultNodeOperationCallback * cb = NEWZERO(pyVaultNodeOperationCallback)( cbObject ); + pyVaultNodeOperationCallback * cb = new pyVaultNodeOperationCallback( cbObject ); if (fNode && nodeID) { @@ -491,7 +492,7 @@ void pyVaultNode::LinkToNode(int nodeID, PyObject* cbObject, uint32_t cbContext) // Remove child node bool pyVaultNode::RemoveNode( pyVaultNode& pynode, PyObject* cbObject, uint32_t cbContext ) { - pyVaultNodeOperationCallback * cb = NEWZERO(pyVaultNodeOperationCallback)( cbObject ); + pyVaultNodeOperationCallback * cb = new pyVaultNodeOperationCallback( cbObject ); if (fNode && pynode.fNode) { @@ -539,7 +540,7 @@ void pyVaultNode::Save(PyObject* cbObject, uint32_t cbContext) fNode = node; } } - pyVaultNodeOperationCallback * cb = NEWZERO(pyVaultNodeOperationCallback)( cbObject ); + pyVaultNodeOperationCallback * cb = new pyVaultNodeOperationCallback( cbObject ); cb->SetNode(fNode); cb->VaultOperationStarted( cbContext ); cb->VaultOperationComplete( cbContext, hsOK ); @@ -549,7 +550,7 @@ void pyVaultNode::Save(PyObject* cbObject, uint32_t cbContext) void pyVaultNode::SaveAll(PyObject* cbObject, uint32_t cbContext) { // Nodes are now auto-saved - pyVaultNodeOperationCallback * cb = NEWZERO(pyVaultNodeOperationCallback)( cbObject ); + pyVaultNodeOperationCallback * cb = new pyVaultNodeOperationCallback( cbObject ); cb->VaultOperationStarted( cbContext ); 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. void pyVaultNode::SendTo(uint32_t destClientNodeID, PyObject* cbObject, uint32_t cbContext ) { - pyVaultNodeOperationCallback * cb = NEWZERO(pyVaultNodeOperationCallback)( cbObject ); + pyVaultNodeOperationCallback * cb = new pyVaultNodeOperationCallback( cbObject ); if (fNode) { @@ -655,7 +656,7 @@ PyObject * pyVaultNode::GetNode2( uint32_t nodeID ) const PyObject * result = nil; if ( fNode ) { - RelVaultNode * templateNode = NEWZERO(RelVaultNode); + RelVaultNode * templateNode = new RelVaultNode; templateNode->IncRef(); templateNode->SetNodeId(nodeID); if (RelVaultNode * rvn = fNode->GetChildNodeIncRef(templateNode, 1)) { @@ -693,7 +694,7 @@ PyObject * pyVaultNode::GetChildNode (unsigned nodeId) { if (!fNode) PYTHON_RETURN_NONE; - RelVaultNode * templateNode = NEWZERO(RelVaultNode); + RelVaultNode * templateNode = new RelVaultNode; templateNode->IncRef(); templateNode->SetNodeId(nodeId); RelVaultNode * rvn = fNode->GetChildNodeIncRef(templateNode, 1); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultNode.h index 842f3009..c0bc0bad 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultNode.h @@ -84,7 +84,7 @@ public: PyObject * fCbObject; RelVaultNode * fNode; PyObject * fPyNodeRef; - uint32_t fContext; + uint32_t fContext; pyVaultNodeOperationCallback(PyObject * cbObject); ~pyVaultNodeOperationCallback(); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultNodeRef.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultNodeRef.cpp index c499caa2..f9c9778b 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultNodeRef.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultNodeRef.cpp @@ -128,7 +128,7 @@ PyObject * pyVaultNodeRef::GetSaver () { if (RelVaultNode * child = VaultGetNodeIncRef(fChild->nodeId)) { if (unsigned saverId = child->GetRefOwnerId(fParent->nodeId)) { // Find the player info node representing the saver - NetVaultNode * templateNode = NEWZERO(NetVaultNode); + NetVaultNode * templateNode = new NetVaultNode; templateNode->IncRef(); templateNode->SetNodeType(plVault::kNodeType_PlayerInfo); VaultPlayerInfoNode access(templateNode); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoListNode.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoListNode.cpp index 2d3d6e3c..2211ff3e 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoListNode.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoListNode.cpp @@ -79,7 +79,7 @@ bool pyVaultPlayerInfoListNode::HasPlayer( uint32_t playerID ) if (!fNode) return false; - NetVaultNode * templateNode = NEWZERO(NetVaultNode); + NetVaultNode * templateNode = new NetVaultNode; templateNode->IncRef(); templateNode->SetNodeType(plVault::kNodeType_PlayerInfo); VaultPlayerInfoNode access(templateNode); @@ -101,7 +101,7 @@ bool pyVaultPlayerInfoListNode::AddPlayer( uint32_t playerID ) if (!fNode) return false; - NetVaultNode * templateNode = NEWZERO(NetVaultNode); + NetVaultNode * templateNode = new NetVaultNode; templateNode->IncRef(); templateNode->SetNodeType(plVault::kNodeType_PlayerInfo); VaultPlayerInfoNode access(templateNode); @@ -125,7 +125,7 @@ void pyVaultPlayerInfoListNode::RemovePlayer( uint32_t playerID ) if (!fNode) return; - NetVaultNode * templateNode = NEWZERO(NetVaultNode); + NetVaultNode * templateNode = new NetVaultNode; templateNode->IncRef(); templateNode->SetNodeType(plVault::kNodeType_PlayerInfo); VaultPlayerInfoNode access(templateNode); @@ -144,7 +144,7 @@ PyObject * pyVaultPlayerInfoListNode::GetPlayer( uint32_t playerID ) if (!fNode) PYTHON_RETURN_NONE; - NetVaultNode * templateNode = NEWZERO(NetVaultNode); + NetVaultNode * templateNode = new NetVaultNode; templateNode->IncRef(); templateNode->SetNodeType(plVault::kNodeType_PlayerInfo); VaultPlayerInfoNode access(templateNode); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNode.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNode.cpp index d93e87c0..96dc537b 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNode.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNode.cpp @@ -64,7 +64,7 @@ pyVaultPlayerInfoNode::pyVaultPlayerInfoNode(RelVaultNode* nfsNode) //create from the Python side pyVaultPlayerInfoNode::pyVaultPlayerInfoNode() -: pyVaultNode(NEWZERO(RelVaultNode)) +: pyVaultNode(new RelVaultNode) , ansiPlayerName(nil) , ansiAgeInstName(nil) { diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultSDLNode.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultSDLNode.cpp index 1186e7b2..08efd884 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultSDLNode.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultSDLNode.cpp @@ -61,7 +61,7 @@ pyVaultSDLNode::pyVaultSDLNode(RelVaultNode* nfsNode) //create from the Python side pyVaultSDLNode::pyVaultSDLNode() -: pyVaultNode(NEWZERO(RelVaultNode)) +: pyVaultNode(new RelVaultNode) { fNode->SetNodeType(plVault::kNodeType_SDL); } @@ -94,7 +94,7 @@ PyObject * pyVaultSDLNode::GetStateDataRecord() const PYTHON_RETURN_NONE; VaultSDLNode sdl(fNode); - plStateDataRecord * rec = NEWZERO(plStateDataRecord); + plStateDataRecord * rec = new plStateDataRecord; if (sdl.GetStateDataRecord(rec)) return pySDLStateDataRecord::New(rec); else diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultTextNoteNode.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultTextNoteNode.cpp index a4d54872..f57c66f9 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultTextNoteNode.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultTextNoteNode.cpp @@ -64,7 +64,7 @@ pyVaultTextNoteNode::pyVaultTextNoteNode(RelVaultNode* nfsNode) //create from the Python side pyVaultTextNoteNode::pyVaultTextNoteNode() -: pyVaultNode(NEWZERO(RelVaultNode)) +: pyVaultNode(new RelVaultNode) { fNode->SetNodeType(plVault::kNodeType_TextNote); } @@ -222,7 +222,7 @@ void pyVaultTextNoteNode::SetDeviceInbox( const char * devName, PyObject * cbObj if (!fNode) return; - pyVaultNode::pyVaultNodeOperationCallback * cb = NEWZERO(pyVaultNode::pyVaultNodeOperationCallback)( cbObject ); + pyVaultNode::pyVaultNodeOperationCallback * cb = new pyVaultNode::pyVaultNodeOperationCallback( cbObject ); cb->VaultOperationStarted( cbContext ); wchar_t wDev[MAX_PATH]; diff --git a/Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcIo.h b/Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcIo.h index 73605e3b..5e09ab14 100644 --- a/Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcIo.h +++ b/Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcIo.h @@ -103,12 +103,16 @@ enum EAsyncNotifySocket { struct AsyncNotifySocket { void * param; AsyncId asyncId; + + AsyncNotifySocket() : param(nil), asyncId(nil) { } }; struct AsyncNotifySocketConnect : AsyncNotifySocket { plNetAddress localAddr; plNetAddress remoteAddr; unsigned connType; + + AsyncNotifySocketConnect() : connType(0) { } }; struct AsyncNotifySocketListen : AsyncNotifySocketConnect { @@ -120,12 +124,18 @@ struct AsyncNotifySocketListen : AsyncNotifySocketConnect { uint8_t * buffer; unsigned bytes; unsigned bytesProcessed; + + AsyncNotifySocketListen() + : buildId(0), buildType(0), branchId(0), buffer(nil), bytes(0), + bytesProcessed(0) { } }; struct AsyncNotifySocketRead : AsyncNotifySocket { uint8_t * buffer; unsigned bytes; unsigned bytesProcessed; + + AsyncNotifySocketRead() : buffer(nil), bytes(0), bytesProcessed(0) { } }; typedef AsyncNotifySocketRead AsyncNotifySocketWrite; diff --git a/Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcThread.h b/Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcThread.h index 81ca9c24..27ec1a75 100644 --- a/Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcThread.h +++ b/Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcThread.h @@ -83,7 +83,7 @@ struct AsyncThread { void * handle; void * argument; unsigned workTimeMs; - wchar_t name[16]; + wchar_t name[16]; }; /***************************************************************************** @@ -95,7 +95,7 @@ struct AsyncThread { void * AsyncThreadCreate ( FAsyncThreadProc proc, void * argument, - const wchar_t name[] + const wchar_t name[] ); // This function should ONLY be called during shutdown while waiting for things to expire diff --git a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Nt/pnAceNtInt.h b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Nt/pnAceNtInt.h index 60d5148e..f142836e 100644 --- a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Nt/pnAceNtInt.h +++ b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Nt/pnAceNtInt.h @@ -108,12 +108,19 @@ struct Operation { unsigned pending; CNtWaitHandle * signalComplete; LINK(Operation) link; - + + Operation() + : opType((EOpType)0), asyncId(nil), notify(false), pending(0), + signalComplete(nil) + { + memset(&overlapped, 0, sizeof(overlapped)); + } + #ifdef HS_DEBUGGING ~Operation () { ASSERT(!signalComplete); } - #endif + #endif }; struct NtObject { @@ -126,6 +133,11 @@ struct NtObject { long nextStartSequence; long ioCount; bool closed; + + NtObject() + : ioType((EIoType)0), handle(nil), userState(nil), + nextCompleteSequence(0), nextStartSequence(0), + ioCount(0), closed(false) { } }; diff --git a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Nt/pnAceNtSocket.cpp b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Nt/pnAceNtSocket.cpp index 429f78b2..1cf4d8fc 100644 --- a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Nt/pnAceNtSocket.cpp +++ b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Nt/pnAceNtSocket.cpp @@ -105,6 +105,8 @@ struct NtOpSocketWrite : Operation { unsigned queueTimeMs; unsigned bytesAlloc; AsyncNotifySocketWrite write; + + NtOpSocketWrite() : queueTimeMs(0), bytesAlloc(0) { } }; struct NtOpSocketRead : Operation { @@ -121,7 +123,7 @@ struct NtSock : NtObject { NtOpSocketRead opRead; unsigned backlogAlloc; unsigned initTimeMs; - uint8_t buffer[kAsyncSocketBufferSize]; + uint8_t buffer[kAsyncSocketBufferSize]; NtSock (); ~NtSock (); @@ -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(kAsyncPerfSocketsTotal, 1); } @@ -406,7 +413,7 @@ static NtSock * SocketInitCommon (SOCKET hSocket) { LogMsg(kLogError, "setsockopt(recv) failed (set recv buffer size)"); // allocate a new socket - NtSock * sock = NEWZERO(NtSock); + NtSock * sock = new NtSock; sock->ioType = kNtSocket; sock->handle = (HANDLE) hSocket; sock->initTimeMs = TimeGetMs(); diff --git a/Sources/Plasma/NucleusLib/pnNetCli/pnNcCli.cpp b/Sources/Plasma/NucleusLib/pnNetCli/pnNcCli.cpp index ee941c87..2ecd793a 100644 --- a/Sources/Plasma/NucleusLib/pnNetCli/pnNcCli.cpp +++ b/Sources/Plasma/NucleusLib/pnNetCli/pnNcCli.cpp @@ -130,13 +130,13 @@ struct NetCli { const NetMsgField * recvField; unsigned recvFieldBytes; bool recvDispatch; - uint8_t * sendCurr; // points into sendBuffer + uint8_t * sendCurr; // points into sendBuffer CInputAccumulator input; // Message encryption ENetCliMode mode; FNetCliEncrypt encryptFcn; - uint8_t seed[kNetMaxSymmetricSeedBytes]; + uint8_t seed[kNetMaxSymmetricSeedBytes]; CryptKey * cryptIn; // nil if encrytpion is disabled CryptKey * cryptOut; // nil if encrytpion is disabled void * encryptParam; @@ -144,6 +144,16 @@ struct NetCli { // Message buffers uint8_t sendBuffer[kAsyncSocketBufferSize]; 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 { @@ -913,7 +923,7 @@ static NetCli * ConnCreate ( if (!channel) return nil; - NetCli * const cli = NEWZERO(NetCli); + NetCli * const cli = new NetCli; cli->sock = sock; cli->protocol = (ENetProtocol) protocol; cli->channel = channel; diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.cpp b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.cpp index fa3a7d9a..4e8b6cd1 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.cpp +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.cpp @@ -363,9 +363,18 @@ static void DeallocNodeFields (NetVaultNode * node) { } //============================================================================ -NetVaultNode::NetVaultNode () { - ASSERTMSG(!fieldFlags, "NetVaultNode instances must be allocated with NEWZERO"); -} +NetVaultNode::NetVaultNode () + : 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 () { diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtHash.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtHash.h index e734697d..6c5f34d5 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtHash.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtHash.h @@ -163,6 +163,8 @@ private: LINK(T) m_linkToSlot; public: + THashLink() : m_hash(0) { } + inline bool IsLinked () const; inline T * Next (); inline const T * Next () const; diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtList.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtList.h index f9a17bb1..0594f0c6 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtList.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtList.h @@ -105,7 +105,7 @@ class CBaseLink { protected: CBaseLink * volatile m_prevLink; - uint8_t * volatile m_next; + uint8_t * volatile m_next; inline int CalcLinkOffset () const; inline void InitializeLinks (); diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp index dc9de6fc..339a1512 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp @@ -934,7 +934,7 @@ void plClothingOutfit::WriteToVault(const ARRAY(plStateDataRecord*) & SDRs) node->DecRef(); // REF: Find } else { - RelVaultNode * templateNode = NEWZERO(RelVaultNode); + RelVaultNode * templateNode = new RelVaultNode; templateNode->SetNodeType(plVault::kNodeType_SDL); templates.Add(templateNode); node = templateNode; @@ -1571,7 +1571,7 @@ void plClothingMgr::AddItemsToCloset(hsTArray &items) plStateDataRecord rec(plClothingSDLModifier::GetClothingItemSDRName()); plClothingSDLModifier::PutSingleItemIntoSDR(&items[i], &rec); - RelVaultNode * templateNode = NEWZERO(RelVaultNode); + RelVaultNode * templateNode = new RelVaultNode; templateNode->IncRef(); templateNode->SetNodeType(plVault::kNodeType_SDL); @@ -1609,7 +1609,7 @@ void plClothingMgr::GetClosetItems(hsTArray &out) for (unsigned i = 0; i < nodes.Count(); ++i) { VaultSDLNode sdl(nodes[i]); - plStateDataRecord * rec = NEWZERO(plStateDataRecord); + plStateDataRecord * rec = new plStateDataRecord; if (sdl.GetStateDataRecord(rec, 0)) plClothingSDLModifier::HandleSingleSDR(rec, nil, &out[i]); delete rec; diff --git a/Sources/Plasma/PubUtilLib/plMessage/plNetClientMgrMsg.h b/Sources/Plasma/PubUtilLib/plMessage/plNetClientMgrMsg.h index 937f74f5..33e4295c 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plNetClientMgrMsg.h +++ b/Sources/Plasma/PubUtilLib/plMessage/plNetClientMgrMsg.h @@ -57,14 +57,25 @@ public: kNotifyRcvdAllSDLStates, kCmdDisableNet, }; - + unsigned type; char str[256]; bool yes; CLASSNAME_REGISTER(plNetClientMgrMsg); 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 Write (hsStream *, hsResMgr *) { FATAL("plNetClientMgrMsg::Write"); } }; diff --git a/Sources/Plasma/PubUtilLib/plMessage/plVaultNotifyMsg.h b/Sources/Plasma/PubUtilLib/plMessage/plVaultNotifyMsg.h index db3db9e5..52782d8a 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plVaultNotifyMsg.h +++ b/Sources/Plasma/PubUtilLib/plMessage/plVaultNotifyMsg.h @@ -48,9 +48,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com class plVaultNotifyMsg : public plMessage { - uint16_t fType; + uint16_t fType; plCreatableListHelper fArgs; - int8_t fResultCode; + int8_t fResultCode; public: enum VaultNotifyTypes @@ -73,9 +73,9 @@ public: GETINTERFACE_ANY_AUX( plVaultNotifyMsg, plMessage, plCreatableListHelper, fArgs ); uint16_t GetType() const { return fType; } - void SetType( uint16_t v ) { fType=v; } + void SetType( uint16_t v ) { fType=v; } - int8_t GetResultCode() const { return fResultCode; } + int8_t GetResultCode() const { return fResultCode; } void SetResultCode( int8_t v ) { fResultCode=v; } plCreatableListHelper * GetArgs() { return &fArgs; } diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetCliAgeJoiner.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetCliAgeJoiner.cpp index 06a9bba1..13f5c20f 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetCliAgeJoiner.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetCliAgeJoiner.cpp @@ -102,7 +102,7 @@ struct plNCAgeJoiner { bool complete; plOperationProgress* progressBar; - + plNCAgeJoiner ( const NetCommAge & age, FNCAgeJoinerCallback callback, @@ -163,6 +163,7 @@ plNCAgeJoiner::plNCAgeJoiner ( , age(age) , callback(callback) , userState(userState) +, complete(false) , progressBar(nil) { } @@ -475,7 +476,7 @@ void NCAgeJoinerCreate ( ASSERT(callback); plNCAgeJoiner * joiner; - *pjoiner = joiner = NEWZERO(plNCAgeJoiner)( + *pjoiner = joiner = new plNCAgeJoiner( age, callback, userState diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetCliAgeLeaver.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetCliAgeLeaver.cpp index 6a2eb6a8..843d74c7 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetCliAgeLeaver.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetCliAgeLeaver.cpp @@ -78,13 +78,13 @@ struct plNCAgeLeaver { kUnloadAge, kNotifyAgeUnloaded, }; - + NextOp nextOp; bool quitting; bool complete; FNCAgeLeaverCallback callback; void * userState; - + plNCAgeLeaver ( bool quitting, FNCAgeLeaverCallback callback, @@ -271,7 +271,7 @@ void NCAgeLeaverCreate ( ASSERT(callback); plNCAgeLeaver * leaver; - *pleaver = leaver = NEWZERO(plNCAgeLeaver)( + *pleaver = leaver = new plNCAgeLeaver( quitting, callback, userState diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.cpp index 4d0d66b1..b058b53f 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.cpp @@ -1139,8 +1139,7 @@ void plNetClientMgr::IncNumInitialSDLStates() void plNetClientMgr::NotifyRcvdAllSDLStates() { DebugMsg( "Got all initial SDL states" ); - plNetClientMgrMsg * msg = new plNetClientMgrMsg(); - msg->type = plNetClientMgrMsg::kNotifyRcvdAllSDLStates; + plNetClientMgrMsg * msg = new plNetClientMgrMsg(plNetClientMgrMsg::kNotifyRcvdAllSDLStates); msg->SetBCastFlag(plMessage::kBCastByType); msg->Send(); } @@ -1303,11 +1302,8 @@ void plNetClientMgr::MakeCCRInvisible(plKey avKey, int level) void plNetClientMgr::QueueDisableNet (bool showDlg, const char str[]) { - plNetClientMgrMsg * msg = NEWZERO(plNetClientMgrMsg); - msg->type = plNetClientMgrMsg::kCmdDisableNet; - msg->yes = showDlg; - if (str) - StrCopy(msg->str, str, arrsize(msg->str)); + plNetClientMgrMsg * msg = new plNetClientMgrMsg(plNetClientMgrMsg::kCmdDisableNet, + showDlg, str); #if 0 msg->Send(GetKey()); diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp index 23c4fc72..2c631a7f 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp @@ -109,7 +109,7 @@ struct NlmJoinAgeOp : NlmOp { struct NlmLeaveAgeOp : NlmOp { bool quitting; NlmLeaveAgeOp () - : NlmOp(kNlmOpLeaveAgeOp) + : NlmOp(kNlmOpLeaveAgeOp), quitting(false) { } }; @@ -231,7 +231,7 @@ void plNetLinkingMgr::ExecNextOp () { ASSERT(!s_ageLeaver); // Insert a wait operation into the exec queue - NlmOpWaitOp * waitOp = NEWZERO(NlmOpWaitOp); + NlmOpWaitOp * waitOp = new NlmOpWaitOp; QueueOp(waitOp, true); NlmJoinAgeOp * joinAgeOp = (NlmJoinAgeOp *)op; @@ -249,7 +249,7 @@ void plNetLinkingMgr::ExecNextOp () { ASSERT(!s_ageLeaver); // Insert a wait operation into the exec queue - NlmOpWaitOp * waitOp = NEWZERO(NlmOpWaitOp); + NlmOpWaitOp * waitOp = new NlmOpWaitOp; QueueOp(waitOp, true); lm->SetEnabled(false); @@ -413,12 +413,12 @@ void plNetLinkingMgr::IDoLink(plLinkToAgeMsg* msg) avMod->SetLinkInAnim(msg->GetLinkInAnimName()); } // Queue leave op - NlmLeaveAgeOp * leaveAgeOp = NEWZERO(NlmLeaveAgeOp); + NlmLeaveAgeOp * leaveAgeOp = new NlmLeaveAgeOp; QueueOp(leaveAgeOp); } - // Queue join op - NlmJoinAgeOp * joinAgeOp = NEWZERO(NlmJoinAgeOp); + // Queue join op + NlmJoinAgeOp * joinAgeOp = new NlmJoinAgeOp; joinAgeOp->age.ageInstId = *GetAgeLink()->GetAgeInfo()->GetAgeInstanceGuid(); StrCopy( joinAgeOp->age.ageDatasetName, @@ -1118,7 +1118,7 @@ uint8_t plNetLinkingMgr::IPreProcessLink(void) //////////////////////////////////////////////////////////////////// void plNetLinkingMgr::LeaveAge (bool quitting) { // Queue leave op - NlmLeaveAgeOp * leaveAgeOp = NEWZERO(NlmLeaveAgeOp); + NlmLeaveAgeOp * leaveAgeOp = new NlmLeaveAgeOp; leaveAgeOp->quitting = quitting; QueueOp(leaveAgeOp); diff --git a/Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.cpp b/Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.cpp index a8c70264..d7cad66a 100644 --- a/Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.cpp @@ -158,9 +158,8 @@ static void INetErrorCallback ( ) { NetClientDestroy(false); - plNetClientMgrMsg * msg = NEWZERO(plNetClientMgrMsg); - msg->type = plNetClientMgrMsg::kCmdDisableNet; - msg->yes = true; + plNetClientMgrMsg * msg = new plNetClientMgrMsg(plNetClientMgrMsg::kCmdDisableNet, + true, nil); msg->AddReceiver(plNetClientApp::GetInstance()->GetKey()); switch (error) @@ -259,7 +258,7 @@ static void INotifyAuthConnectedCallback () { if (!hsgResMgr::ResMgr()) return; - plNetCommAuthConnectedMsg * msg = NEWZERO(plNetCommAuthConnectedMsg); + plNetCommAuthConnectedMsg * msg = new plNetCommAuthConnectedMsg; msg->Send(); } @@ -535,7 +534,7 @@ static void INetCliAuthGetPublicAgeListCallback ( ) { NetCommParam * cp = (NetCommParam *) param; - plNetCommPublicAgeListMsg * msg = NEWZERO(plNetCommPublicAgeListMsg); + plNetCommPublicAgeListMsg * msg = new plNetCommPublicAgeListMsg; msg->result = result; msg->param = cp->param; msg->ptype = cp->type; diff --git a/Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.h b/Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.h index 99152bc9..fdacb391 100644 --- a/Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.h +++ b/Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.h @@ -80,7 +80,7 @@ struct NetCommPlayer { struct NetCommAccount { plUUID accountUuid; - wchar_t accountName[kMaxAccountNameLength]; + wchar_t accountName[kMaxAccountNameLength]; ShaDigest accountNamePassHash; char accountNameAnsi[kMaxAccountNameLength]; unsigned accountFlags; @@ -92,6 +92,12 @@ struct NetCommAge { unsigned ageVaultId; char ageDatasetName[kMaxAgeNameLength]; char spawnPtName[64]; + + NetCommAge() : ageVaultId(0) + { + memset(ageDatasetName, 0, sizeof(ageDatasetName)); + memset(spawnPtName, 0, sizeof(spawnPtName)); + } }; const NetCommAge * NetCommGetAge (); diff --git a/Sources/Plasma/PubUtilLib/plNetCommon/plNetCommonHelpers.h b/Sources/Plasma/PubUtilLib/plNetCommon/plNetCommonHelpers.h index 86935e10..47413798 100644 --- a/Sources/Plasma/PubUtilLib/plNetCommon/plNetCommonHelpers.h +++ b/Sources/Plasma/PubUtilLib/plNetCommon/plNetCommonHelpers.h @@ -91,8 +91,8 @@ class plCreatableListHelper : public plCreatable kCompressed = 1<<1, kWritten = 1<<2, }; - uint8_t fFlags; - std::map fItems; + uint8_t fFlags; + std::map fItems; mutable std::vector fManagedItems; uint32_t fCompressionThreshold; // NOT WRITTEN std::string fWritten; diff --git a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.cpp b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.cpp index 0e82c23f..91c84cda 100644 --- a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.cpp +++ b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.cpp @@ -659,7 +659,7 @@ struct VaultFetchNodeRefsTrans : NetAuthTrans { unsigned m_nodeId; FNetCliAuthVaultNodeRefsFetched m_callback; void * m_param; - + ARRAY(NetVaultNodeRef) m_refs; VaultFetchNodeRefsTrans ( @@ -667,7 +667,7 @@ struct VaultFetchNodeRefsTrans : NetAuthTrans { FNetCliAuthVaultNodeRefsFetched callback, void * param ); - + bool Send (); void Post (); bool Recv ( @@ -685,16 +685,16 @@ struct VaultInitAgeTrans : NetAuthTrans { plUUID m_ageInstId; plUUID m_parentAgeInstId; - wchar_t * m_ageFilename; - wchar_t * m_ageInstName; - wchar_t * m_ageUserName; - wchar_t * m_ageDesc; + wchar_t * m_ageFilename; + wchar_t * m_ageInstName; + wchar_t * m_ageUserName; + wchar_t * m_ageDesc; unsigned m_ageSequenceNumber; unsigned m_ageLanguage; - + unsigned m_ageId; unsigned m_ageInfoId; - + VaultInitAgeTrans( FNetCliAuthAgeInitCallback callback, // optional void * param, // optional @@ -801,10 +801,10 @@ struct VaultSaveNodeTrans : NetAuthTrans { unsigned m_nodeId; plUUID m_revisionId; - ARRAY(uint8_t) m_buffer; + ARRAY(uint8_t) m_buffer; FNetCliAuthVaultNodeSaveCallback m_callback; void * m_param; - + VaultSaveNodeTrans ( unsigned nodeId, const plUUID& revisionId, @@ -858,7 +858,7 @@ struct VaultRemoveNodeTrans : NetAuthTrans { unsigned m_childId; FNetCliAuthVaultNodeRemoveCallback m_callback; void * m_param; - + VaultRemoveNodeTrans ( unsigned parentId, unsigned childId, @@ -1532,7 +1532,7 @@ static void Connect ( ) { ASSERT(s_running); - CliAuConn * conn = NEWZERO(CliAuConn); + CliAuConn * conn = new CliAuConn; conn->addr = addr; conn->seq = ConnNextSequence(); 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); } @@ -3750,7 +3757,7 @@ VaultFetchNodeRefsTrans::VaultFetchNodeRefsTrans ( , m_param(param) { } - + //============================================================================ bool VaultFetchNodeRefsTrans::Send () { if (!AcquireConn()) @@ -3824,6 +3831,8 @@ VaultInitAgeTrans::VaultInitAgeTrans ( , m_ageDesc(StrDup(ageDesc ? ageDesc : L"")) , m_ageSequenceNumber(ageSequenceNumber) , m_ageLanguage(ageLanguage) +, m_ageId(0) +, m_ageInfoId(0) { } @@ -3901,6 +3910,7 @@ VaultFetchNodeTrans::VaultFetchNodeTrans ( , m_nodeId(nodeId) , m_callback(callback) , m_param(param) +, m_node(nil) { } @@ -3939,7 +3949,7 @@ bool VaultFetchNodeTrans::Recv ( const Auth2Cli_VaultNodeFetched & reply = *(const Auth2Cli_VaultNodeFetched *) msg; 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->IncRef("Recv"); } @@ -3963,9 +3973,9 @@ VaultFindNodeTrans::VaultFindNodeTrans ( FNetCliAuthVaultNodeFind callback, void * param ) : NetAuthTrans(kVaultFindNodeTrans) -, m_node(templateNode) , m_callback(callback) , m_param(param) +, m_node(templateNode) { m_node->IncRef(); } @@ -4041,6 +4051,7 @@ VaultCreateNodeTrans::VaultCreateNodeTrans ( , m_templateNode(templateNode) , m_callback(callback) , m_param(param) +, m_nodeId(0) { m_templateNode->IncRef(); } @@ -5560,7 +5571,7 @@ void NetCliAuthVaultNodeCreate ( FNetCliAuthVaultNodeCreated callback, void * param ) { - VaultCreateNodeTrans * trans = NEWZERO(VaultCreateNodeTrans)( + VaultCreateNodeTrans * trans = new VaultCreateNodeTrans( templateNode, callback, param @@ -5574,7 +5585,7 @@ void NetCliAuthVaultNodeFetch ( FNetCliAuthVaultNodeFetched callback, void * param ) { - VaultFetchNodeTrans * trans = NEWZERO(VaultFetchNodeTrans)( + VaultFetchNodeTrans * trans = new VaultFetchNodeTrans( nodeId, callback, param @@ -5588,7 +5599,7 @@ void NetCliAuthVaultNodeFind ( FNetCliAuthVaultNodeFind callback, void * param ) { - VaultFindNodeTrans * trans = NEWZERO(VaultFindNodeTrans)( + VaultFindNodeTrans * trans = new VaultFindNodeTrans( templateNode, callback, param @@ -5629,7 +5640,7 @@ unsigned NetCliAuthVaultNodeSave ( ARRAY(uint8_t) buffer; unsigned bytes = node->Write_LCS(&buffer, NetVaultNode::kRwDirtyOnly | NetVaultNode::kRwUpdateDirty); - VaultSaveNodeTrans * trans = NEWZERO(VaultSaveNodeTrans)( + VaultSaveNodeTrans * trans = new VaultSaveNodeTrans( node->nodeId, node->revisionId, buffer.Count(), @@ -5656,7 +5667,7 @@ void NetCliAuthVaultNodeAdd ( FNetCliAuthVaultNodeAddCallback callback, void * param ) { - VaultAddNodeTrans * trans = NEWZERO(VaultAddNodeTrans)( + VaultAddNodeTrans * trans = new VaultAddNodeTrans( parentId, childId, ownerId, @@ -5673,7 +5684,7 @@ void NetCliAuthVaultNodeRemove ( FNetCliAuthVaultNodeRemoveCallback callback, void * param ) { - VaultRemoveNodeTrans * trans = NEWZERO(VaultRemoveNodeTrans)( + VaultRemoveNodeTrans * trans = new VaultRemoveNodeTrans( parentId, childId, callback, @@ -5688,7 +5699,7 @@ void NetCliAuthVaultFetchNodeRefs ( FNetCliAuthVaultNodeRefsFetched callback, void * param ) { - VaultFetchNodeRefsTrans * trans = NEWZERO(VaultFetchNodeRefsTrans)( + VaultFetchNodeRefsTrans * trans = new VaultFetchNodeRefsTrans( nodeId, callback, param @@ -5742,16 +5753,16 @@ void NetCliAuthVaultSendNode ( void NetCliAuthVaultInitAge ( const plUUID& ageInstId, // optional. is used in match const plUUID& parentAgeInstId, // optional. is used in match - const wchar_t ageFilename[], // optional. is used in match - const wchar_t ageInstName[], // optional. not used in match - const wchar_t ageUserName[], // optional. not used in match - const wchar_t ageDesc[], // optional. not used in match + const wchar_t ageFilename[], // optional. is used in match + const wchar_t ageInstName[], // optional. not used in match + const wchar_t ageUserName[], // optional. not used in match + const wchar_t ageDesc[], // optional. not used in match unsigned ageSequenceNumber, // optional. not used in match unsigned ageLanguage, // optional. not used in match FNetCliAuthAgeInitCallback callback, // optional void * param // optional ) { - VaultInitAgeTrans * trans = NEWZERO(VaultInitAgeTrans)( + VaultInitAgeTrans * trans = new VaultInitAgeTrans( callback, param, ageInstId, diff --git a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglFile.cpp b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglFile.cpp index eddb3971..be9fff03 100644 --- a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglFile.cpp +++ b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglFile.cpp @@ -67,7 +67,7 @@ struct CliFileConn : AtomicRef { char name[MAX_PATH]; plNetAddress addr; unsigned seq; - ARRAY(uint8_t) recvBuffer; + ARRAY(uint8_t) recvBuffer; AsyncCancelId cancelId; bool abandoned; unsigned buildId; @@ -544,7 +544,7 @@ static void Connect ( ) { ASSERT(s_running); - CliFileConn * conn = NEWZERO(CliFileConn); + CliFileConn * conn = new CliFileConn; strncpy(conn->name, name, arrsize(conn->name)); conn->addr = addr; 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); } diff --git a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGame.cpp b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGame.cpp index ef0eb673..05ed2cd9 100644 --- a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGame.cpp +++ b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGame.cpp @@ -356,7 +356,7 @@ static bool SocketNotifyCallback ( static void Connect ( const plNetAddress& addr ) { - CliGmConn * conn = NEWZERO(CliGmConn); + CliGmConn * conn = new CliGmConn; conn->addr = addr; conn->seq = ConnNextSequence(); 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); } @@ -579,11 +582,11 @@ JoinAgeRequestTrans::JoinAgeRequestTrans ( FNetCliGameJoinAgeRequestCallback callback, void * param ) : NetGameTrans(kJoinAgeRequestTrans) +, m_callback(callback) +, m_param(param) , m_ageMcpId(ageMcpId) , m_accountUuid(accountUuid) , m_playerInt(playerInt) -, m_callback(callback) -, m_param(param) { } @@ -822,7 +825,7 @@ void NetCliGameJoinAgeRequest ( FNetCliGameJoinAgeRequestCallback callback, void * param ) { - JoinAgeRequestTrans * trans = NEWZERO(JoinAgeRequestTrans)( + JoinAgeRequestTrans * trans = new JoinAgeRequestTrans( ageMcpId, accountUuid, playerInt, diff --git a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGateKeeper.cpp b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGateKeeper.cpp index 86c30fa9..2d275151 100644 --- a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGateKeeper.cpp +++ b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglGateKeeper.cpp @@ -63,7 +63,7 @@ struct CliGkConn : AtomicRef { // Reconnection AsyncTimer * reconnectTimer; unsigned reconnectStartMs; - + // Ping AsyncTimer * pingTimer; unsigned pingSendTimeMs; @@ -77,12 +77,12 @@ struct CliGkConn : AtomicRef { void StopAutoReconnect (); // call before destruction void StartAutoReconnect (); void TimerReconnect (); - + // ping void AutoPing (); void StopAutoPing (); void TimerPing (); - + void Send (const uintptr_t fields[], unsigned count); CCritSect critsect; @@ -468,7 +468,7 @@ static void Connect ( ) { ASSERT(s_running); - CliGkConn * conn = NEWZERO(CliGkConn); + CliGkConn * conn = new CliGkConn; conn->addr = addr; conn->seq = ConnNextSequence(); 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); } diff --git a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglTrans.cpp b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglTrans.cpp index cd953251..da3a16d8 100644 --- a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglTrans.cpp +++ b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglTrans.cpp @@ -123,6 +123,7 @@ NetTrans::NetTrans (ENetProtocol protocol, ETransType transType) , m_connId(0) , m_protocol(protocol) , m_hasSubTrans(false) +, m_timeoutAtMs(0) , m_transType(transType) { AtomicAdd(&s_perf[kPerfCurrTransactions], 1); diff --git a/Sources/Plasma/PubUtilLib/plSDL/plSDL.h b/Sources/Plasma/PubUtilLib/plSDL/plSDL.h index 207cb3f2..d02d2365 100644 --- a/Sources/Plasma/PubUtilLib/plSDL/plSDL.h +++ b/Sources/Plasma/PubUtilLib/plSDL/plSDL.h @@ -433,9 +433,9 @@ public: plStateDataRecord(const plString& sdName, int version=plSDL::kLatestVersion); plStateDataRecord(plStateDescriptor* sd); plStateDataRecord(const plStateDataRecord &other, uint32_t writeOptions=0 ):fFlags(0) { CopyFrom(other, writeOptions); } - plStateDataRecord():fFlags(0) {} + plStateDataRecord() : fDescriptor(nil), fFlags(0) {} ~plStateDataRecord(); - + bool ConvertTo(plStateDescriptor* other, bool force=false ); bool operator==(const plStateDataRecord &other) const; // assumes matching state descriptors diff --git a/Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp b/Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp index c39a3f97..f53eec13 100644 --- a/Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp +++ b/Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp @@ -76,7 +76,7 @@ struct INotifyAfterDownload : THashKeyVal { struct DeviceInbox : CHashKeyStr { HASHLINK(DeviceInbox) link; - wchar_t inboxName[kMaxVaultNodeStringLength]; + wchar_t inboxName[kMaxVaultNodeStringLength]; DeviceInbox (const wchar_t device[], const wchar_t inbox[]) : CHashKeyStr(device) @@ -95,9 +95,9 @@ struct RelVaultNodeLink : THashKeyVal { RelVaultNodeLink (bool seen, unsigned ownerId, unsigned nodeId, RelVaultNode * node) : THashKeyVal(nodeId) - , seen(seen) - , ownerId(ownerId) , node(node) + , ownerId(ownerId) + , seen(seen) { node->IncRef(); } @@ -137,10 +137,18 @@ struct VaultCreateNodeTrans { FVaultCreateNodeCallback callback; void * state; void * param; - + unsigned nodeId; 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 ( ENetError result, void * param, @@ -151,7 +159,7 @@ struct VaultCreateNodeTrans { void * param, NetVaultNode * node ); - + void Complete (ENetError result); }; @@ -159,7 +167,12 @@ struct VaultCreateNodeTrans { struct VaultFindNodeTrans { FVaultFindNodeCallback callback; void * param; - + + VaultFindNodeTrans () : callback(nil), param(nil) { } + + VaultFindNodeTrans (FVaultFindNodeCallback _callback, void * _param) + : callback(_callback), param(_param) { } + static void VaultNodeFound ( ENetError result, void * param, @@ -174,15 +187,32 @@ struct VaultDownloadTrans { void * cbParam; FVaultProgressCallback progressCallback; void * cbProgressParam; - - wchar_t tag[MAX_PATH]; + + wchar_t tag[MAX_PATH]; unsigned nodeCount; unsigned nodesLeft; unsigned vaultId; 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 ( ENetError result, void * param, @@ -201,6 +231,13 @@ struct VaultAgeInitTrans { void * cbState; 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 ( ENetError result, void * param, @@ -214,7 +251,13 @@ struct AddChildNodeFetchTrans { void * cbParam; ENetError result; 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 ( ENetError result, void * param, @@ -338,7 +381,7 @@ static void BuildNodeTree ( RelVaultNodeLink * parentLink = s_nodes.Find(refs[i].parentId); if (!parentLink) { 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 s_nodes.Add(parentLink); } @@ -348,7 +391,7 @@ static void BuildNodeTree ( RelVaultNodeLink * childLink = s_nodes.Find(refs[i].childId); if (!childLink) { 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 s_nodes.Add(childLink); } @@ -366,14 +409,14 @@ static void BuildNodeTree ( if (!isImmediateParent) { // 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); LogMsg(kLogDebug, L"Added relationship: p:%u,c:%u", refs[i].parentId, refs[i].childId); } if (!isImmediateChild) { // 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); if (notifyNow || childNode->nodeType != 0) { @@ -382,7 +425,7 @@ static void BuildNodeTree ( cb->cb->AddedChildNode(parentNode, childNode); } else { - INotifyAfterDownload* notify = NEWZERO(INotifyAfterDownload)(parentNode->nodeId, childNode->nodeId); + INotifyAfterDownload* notify = new INotifyAfterDownload(parentNode->nodeId, childNode->nodeId); s_notifyAfterDownload.Add(notify); } } @@ -413,7 +456,7 @@ static void FetchRefOwners ( ownerIds.Add(ownerId); } QSORT(unsigned, ownerIds.Ptr(), ownerIds.Count(), elem1 < elem2); - RelVaultNode * templateNode = NEWZERO(RelVaultNode); + RelVaultNode * templateNode = new RelVaultNode; templateNode->IncRef(); templateNode->SetNodeType(plVault::kNodeType_PlayerInfo); { unsigned prevId = 0; @@ -518,7 +561,7 @@ static void VaultNodeFetched ( // Add to global node table RelVaultNodeLink * link = s_nodes.Find(node->nodeId); 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 s_nodes.Add(link); } @@ -609,7 +652,7 @@ static void VaultNodeAdded ( // Fetch the nodes that do not yet have a nodetype unsigned prevId = 0; unsigned i = 0; - {for (; i < nodeIds.Count(); ++i) { + for (; i < nodeIds.Count(); ++i) { RelVaultNodeLink * link = s_nodes.Find(nodeIds[i]); if (link->node->nodeType != 0) continue; @@ -625,7 +668,7 @@ static void VaultNodeAdded ( nil, nil ); - }} + } if (parentId == inboxId) { if (i > 0) @@ -831,11 +874,6 @@ void VaultFindNodeTrans::VaultNodeFound ( * ***/ -//============================================================================ -VaultDownloadTrans::VaultDownloadTrans () { - ASSERT(!nodeCount); // must be alloced with -} - //============================================================================ void VaultDownloadTrans::VaultNodeFetched ( ENetError result, @@ -1091,7 +1129,7 @@ void IRelVaultNode::Unlink (RelVaultNode * other) { //============================================================================ RelVaultNode::RelVaultNode () { - state = NEWZERO(IRelVaultNode)(this); + state = new IRelVaultNode(this); } //============================================================================ @@ -1233,7 +1271,7 @@ RelVaultNode * RelVaultNode::GetChildNodeIncRef ( unsigned nodeType, unsigned maxDepth ) { - NetVaultNode * templateNode = NEWZERO(NetVaultNode); + NetVaultNode * templateNode = new NetVaultNode; templateNode->IncRef(); templateNode->SetNodeType(nodeType); RelVaultNode * result = GetChildNodeIncRef(templateNode, maxDepth); @@ -1246,7 +1284,7 @@ RelVaultNode * RelVaultNode::GetChildFolderNodeIncRef ( unsigned folderType, unsigned maxDepth ) { - NetVaultNode * templateNode = NEWZERO(NetVaultNode); + NetVaultNode * templateNode = new NetVaultNode; templateNode->IncRef(); templateNode->SetNodeType(plVault::kNodeType_Folder); VaultFolderNode folder(templateNode); @@ -1261,7 +1299,7 @@ RelVaultNode * RelVaultNode::GetChildPlayerInfoListNodeIncRef ( unsigned folderType, unsigned maxDepth ) { - NetVaultNode * templateNode = NEWZERO(NetVaultNode); + NetVaultNode * templateNode = new NetVaultNode; templateNode->IncRef(); templateNode->SetNodeType(plVault::kNodeType_PlayerInfoList); VaultPlayerInfoListNode access(templateNode); @@ -1276,7 +1314,7 @@ RelVaultNode * RelVaultNode::GetChildAgeInfoListNodeIncRef ( unsigned folderType, unsigned maxDepth ) { - NetVaultNode * templateNode = NEWZERO(NetVaultNode); + NetVaultNode * templateNode = new NetVaultNode; templateNode->IncRef(); templateNode->SetNodeType(plVault::kNodeType_AgeInfoList); VaultAgeInfoListNode access(templateNode); @@ -1333,7 +1371,7 @@ void RelVaultNode::GetChildNodesIncRef ( unsigned maxDepth, ARRAY(RelVaultNode*) * nodes ) { - NetVaultNode * templateNode = NEWZERO(NetVaultNode); + NetVaultNode * templateNode = new NetVaultNode; templateNode->IncRef(); templateNode->SetNodeType(nodeType); GetChildNodesIncRef( @@ -1350,7 +1388,7 @@ void RelVaultNode::GetChildFolderNodesIncRef ( unsigned maxDepth, ARRAY(RelVaultNode*) * nodes ) { - NetVaultNode * templateNode = NEWZERO(NetVaultNode); + NetVaultNode * templateNode = new NetVaultNode; templateNode->IncRef(); templateNode->SetNodeType(plVault::kNodeType_Folder); VaultFolderNode fldr(templateNode); @@ -1442,7 +1480,7 @@ RelVaultNode * RelVaultNode::GetParentAgeLinkIncRef () { RelVaultNode * result = nil; - NetVaultNode * templateNode = NEWZERO(NetVaultNode); + NetVaultNode * templateNode = new NetVaultNode; templateNode->IncRef(); templateNode->SetNodeType(plVault::kNodeType_AgeLink); @@ -1606,7 +1644,7 @@ void VaultAddChildNode ( if (RelVaultNodeLink * parentLink = s_nodes.Find(parentId)) { RelVaultNodeLink * childLink = s_nodes.Find(childId); 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 s_nodes.Add(childLink); } @@ -1644,9 +1682,7 @@ void VaultAddChildNode ( if (!childLink->node->nodeType || !parentLink->node->nodeType) { // One or more nodes need to be fetched before the callback is made - AddChildNodeFetchTrans * trans = NEWZERO(AddChildNodeFetchTrans); - trans->callback = callback; - trans->cbParam = param; + AddChildNodeFetchTrans * trans = new AddChildNodeFetchTrans(callback, param); if (!childLink->node->nodeType) { AtomicAdd(&trans->opCount, 1); NetCliAuthVaultNodeFetch( @@ -1845,10 +1881,7 @@ void VaultCreateNode ( void * state, void * param ) { - VaultCreateNodeTrans * trans = NEWZERO(VaultCreateNodeTrans); - trans->callback = callback; - trans->state = state; - trans->param = param; + VaultCreateNodeTrans * trans = new VaultCreateNodeTrans(callback, state, param); if (RelVaultNode * age = VaultGetAgeNodeIncRef()) { VaultAgeNode access(age); @@ -1873,7 +1906,7 @@ void VaultCreateNode ( void * state, void * param ) { - RelVaultNode * templateNode = NEWZERO(RelVaultNode); + RelVaultNode * templateNode = new RelVaultNode; templateNode->IncRef(); templateNode->SetNodeType(nodeType); @@ -1943,7 +1976,7 @@ RelVaultNode * VaultCreateNodeAndWaitIncRef ( ENetError * result ) { RelVaultNode * node; - RelVaultNode * templateNode = NEWZERO(RelVaultNode); + RelVaultNode * templateNode = new RelVaultNode; templateNode->IncRef(); templateNode->SetNodeType(nodeType); @@ -1998,9 +2031,7 @@ void VaultFindNodes ( FVaultFindNodeCallback callback, void * param ) { - VaultFindNodeTrans * trans = NEWZERO(VaultFindNodeTrans); - trans->callback = callback; - trans->param = param; + VaultFindNodeTrans * trans = new VaultFindNodeTrans(callback, param); NetCliAuthVaultNodeFind( templateNode, @@ -2120,11 +2151,8 @@ void VaultInitAge ( void * state, void * param ) { - VaultAgeInitTrans * trans = NEWZERO(VaultAgeInitTrans); - trans->callback = callback; - trans->cbState = state; - trans->cbParam = param; - + VaultAgeInitTrans * trans = new VaultAgeInitTrans(callback, state, param); + wchar_t ageFilename[MAX_PATH]; wchar_t ageInstName[MAX_PATH]; wchar_t ageUserName[MAX_PATH]; @@ -2157,7 +2185,7 @@ void VaultInitAge ( //============================================================================ static RelVaultNode * GetPlayerNode () { - NetVaultNode * templateNode = NEWZERO(NetVaultNode); + NetVaultNode * templateNode = new NetVaultNode; templateNode->IncRef(); templateNode->SetNodeType(plVault::kNodeType_VNodeMgrPlayer); if (NetCommGetPlayer()) @@ -2189,7 +2217,7 @@ RelVaultNode * VaultGetPlayerInfoNodeIncRef () { if (!rvnPlr) return nil; - NetVaultNode * templateNode = NEWZERO(NetVaultNode); + NetVaultNode * templateNode = new NetVaultNode; templateNode->IncRef(); templateNode->SetNodeType(plVault::kNodeType_PlayerInfo); VaultPlayerInfoNode plrInfo(templateNode); @@ -2254,7 +2282,7 @@ bool VaultGetLinkToMyNeighborhood (plAgeLinkStruct * link) { if (!rvnFldr) return false; - NetVaultNode * templateNode = NEWZERO(NetVaultNode); + NetVaultNode * templateNode = new NetVaultNode; templateNode->IncRef(); templateNode->SetNodeType(plVault::kNodeType_AgeInfo); @@ -2281,7 +2309,7 @@ bool VaultGetLinkToMyPersonalAge (plAgeLinkStruct * link) { if (!rvnFldr) return false; - NetVaultNode * templateNode = NEWZERO(NetVaultNode); + NetVaultNode * templateNode = new NetVaultNode; templateNode->IncRef(); templateNode->SetNodeType(plVault::kNodeType_AgeInfo); @@ -2308,7 +2336,7 @@ bool VaultGetLinkToCity (plAgeLinkStruct * link) { if (!rvnFldr) return false; - NetVaultNode * templateNode = NEWZERO(NetVaultNode); + NetVaultNode * templateNode = new NetVaultNode; templateNode->IncRef(); templateNode->SetNodeType(plVault::kNodeType_AgeInfo); @@ -2336,7 +2364,7 @@ RelVaultNode * VaultGetOwnedAgeLinkIncRef (const plAgeInfoStruct * info) { if (RelVaultNode * rvnFldr = VaultGetAgesIOwnFolderIncRef()) { - NetVaultNode * templateNode = NEWZERO(NetVaultNode); + NetVaultNode * templateNode = new NetVaultNode; templateNode->IncRef(); templateNode->SetNodeType(plVault::kNodeType_AgeInfo); @@ -2371,7 +2399,7 @@ RelVaultNode * VaultGetOwnedAgeInfoIncRef (const plAgeInfoStruct * info) { if (RelVaultNode * rvnFldr = VaultGetAgesIOwnFolderIncRef()) { - NetVaultNode * templateNode = NEWZERO(NetVaultNode); + NetVaultNode * templateNode = new NetVaultNode; templateNode->IncRef(); templateNode->SetNodeType(plVault::kNodeType_AgeInfo); @@ -2436,7 +2464,7 @@ bool VaultAddOwnedAgeSpawnPoint (const plUUID& ageInstId, const plSpawnPointInfo ARRAY(unsigned) nodeIds; fldr->GetChildNodeIds(&nodeIds, 1); - NetVaultNode * templateNode = NEWZERO(NetVaultNode); + NetVaultNode * templateNode = new NetVaultNode; templateNode->IncRef(); templateNode->SetNodeType(plVault::kNodeType_AgeInfo); VaultAgeInfoNode access(templateNode); @@ -2478,7 +2506,7 @@ bool VaultSetOwnedAgePublicAndWait (const plAgeInfoStruct * info, bool publicOrN char ageName[MAX_PATH]; StrToAnsi(ageName, access.ageFilename, arrsize(ageName)); - plVaultNotifyMsg * msg = NEWZERO(plVaultNotifyMsg); + plVaultNotifyMsg * msg = new plVaultNotifyMsg; if (publicOrNot) msg->SetType(plVaultNotifyMsg::kPublicAgeCreated); else @@ -2500,7 +2528,7 @@ RelVaultNode * VaultGetVisitAgeLinkIncRef (const plAgeInfoStruct * info) { if (RelVaultNode * rvnFldr = VaultGetAgesICanVisitFolderIncRef()) { - NetVaultNode * templateNode = NEWZERO(NetVaultNode); + NetVaultNode * templateNode = new NetVaultNode; templateNode->IncRef(); templateNode->SetNodeType(plVault::kNodeType_AgeInfo); @@ -2789,7 +2817,7 @@ bool VaultRegisterOwnedAgeAndWait (const plAgeLinkStruct * link) { break; } - plVaultNotifyMsg * msg = NEWZERO(plVaultNotifyMsg); + plVaultNotifyMsg * msg = new plVaultNotifyMsg; msg->SetType(plVaultNotifyMsg::kRegisteredOwnedAge); msg->SetResultCode(result); msg->GetArgs()->AddInt(plNetCommon::VaultTaskArgs::kAgeLinkNode, ageLinkId); @@ -2855,7 +2883,7 @@ namespace _VaultRegisterOwnedAge { } // Fire off vault callbacks - plVaultNotifyMsg* msg = NEWZERO(plVaultNotifyMsg); + plVaultNotifyMsg* msg = new plVaultNotifyMsg; msg->SetType(plVaultNotifyMsg::kRegisteredOwnedAge); msg->SetResultCode(result); msg->GetArgs()->AddInt(plNetCommon::VaultTaskArgs::kAgeLinkNode, node->nodeId); @@ -3162,7 +3190,7 @@ bool VaultRegisterVisitAgeAndWait (const plAgeLinkStruct * link) { break; } - plVaultNotifyMsg * msg = NEWZERO(plVaultNotifyMsg); + plVaultNotifyMsg * msg = new plVaultNotifyMsg; msg->SetType(plVaultNotifyMsg::kRegisteredVisitAge); msg->SetResultCode(result); msg->GetArgs()->AddInt(plNetCommon::VaultTaskArgs::kAgeLinkNode, ageLinkId); @@ -3214,7 +3242,7 @@ namespace _VaultRegisterVisitAge { access.AddSpawnPoint(*p->fSpawn); // Send out the VaultNotify msg - plVaultNotifyMsg * msg = NEWZERO(plVaultNotifyMsg); + plVaultNotifyMsg * msg = new plVaultNotifyMsg; msg->SetType(plVaultNotifyMsg::kRegisteredVisitAge); msg->SetResultCode(true); msg->GetArgs()->AddInt(plNetCommon::VaultTaskArgs::kAgeLinkNode, node->nodeId); @@ -3333,7 +3361,7 @@ bool VaultUnregisterOwnedAgeAndWait (const plAgeInfoStruct * info) { break; } - plVaultNotifyMsg * msg = NEWZERO(plVaultNotifyMsg); + plVaultNotifyMsg * msg = new plVaultNotifyMsg; msg->SetType(plVaultNotifyMsg::kUnRegisteredOwnedAge); msg->SetResultCode(result); msg->GetArgs()->AddInt(plNetCommon::VaultTaskArgs::kAgeLinkNode, ageLinkId); @@ -3397,7 +3425,7 @@ bool VaultUnregisterVisitAgeAndWait (const plAgeInfoStruct * info) { break; } - plVaultNotifyMsg * msg = NEWZERO(plVaultNotifyMsg); + plVaultNotifyMsg * msg = new plVaultNotifyMsg; msg->SetType(plVaultNotifyMsg::kUnRegisteredVisitAge); msg->SetResultCode(result); msg->GetArgs()->AddInt(plNetCommon::VaultTaskArgs::kAgeLinkNode, ageLinkId); @@ -3411,7 +3439,7 @@ RelVaultNode * VaultFindChronicleEntryIncRef (const wchar_t entryName[], int ent RelVaultNode * result = nil; if (RelVaultNode * rvnFldr = GetChildFolderNode(GetPlayerNode(), plVault::kChronicleFolder, 1)) { - NetVaultNode * templateNode = NEWZERO(NetVaultNode); + NetVaultNode * templateNode = new NetVaultNode; templateNode->IncRef(); templateNode->SetNodeType(plVault::kNodeType_Chronicle); VaultChronicleNode chrn(templateNode); @@ -3445,7 +3473,7 @@ void VaultAddChronicleEntryAndWait ( chrnNode.SetEntryValue(entryValue); } else if (RelVaultNode * rvnFldr = GetChildFolderNode(GetPlayerNode(), plVault::kChronicleFolder, 1)) { - NetVaultNode * templateNode = NEWZERO(NetVaultNode); + NetVaultNode * templateNode = new NetVaultNode; templateNode->IncRef(); templateNode->SetNodeType(plVault::kNodeType_Chronicle); VaultChronicleNode chrnNode(templateNode); @@ -3467,7 +3495,7 @@ bool VaultAmIgnoringPlayer (unsigned playerId) { if (RelVaultNode * rvnFldr = GetChildPlayerInfoListNode(GetPlayerNode(), plVault::kIgnoreListFolder, 1)) { rvnFldr->IncRef(); - NetVaultNode * templateNode = NEWZERO(NetVaultNode); + NetVaultNode * templateNode = new NetVaultNode; templateNode->IncRef(); templateNode->SetNodeType(plVault::kNodeType_PlayerInfo); VaultPlayerInfoNode pinfoNode(templateNode); @@ -3704,7 +3732,7 @@ void VaultProcessPlayerInbox () { if (RelVaultNode * rvnInbox = VaultGetPlayerInboxFolderIncRef()) { { // Process new visit requests ARRAY(RelVaultNode*) visits; - RelVaultNode * templateNode = NEWZERO(RelVaultNode); + RelVaultNode * templateNode = new RelVaultNode; templateNode->IncRef(); templateNode->SetNodeType(plVault::kNodeType_TextNote); VaultTextNoteNode tmpAcc(templateNode); @@ -3727,7 +3755,7 @@ void VaultProcessPlayerInbox () { } { // Process new unvisit requests ARRAY(RelVaultNode*) unvisits; - RelVaultNode * templateNode = NEWZERO(RelVaultNode); + RelVaultNode * templateNode = new RelVaultNode; templateNode->IncRef(); templateNode->SetNodeType(plVault::kNodeType_TextNote); VaultTextNoteNode tmpAcc(templateNode); @@ -3762,7 +3790,7 @@ void VaultProcessPlayerInbox () { //============================================================================ static RelVaultNode * GetAgeNode () { - NetVaultNode * templateNode = NEWZERO(NetVaultNode); + NetVaultNode * templateNode = new NetVaultNode; templateNode->IncRef(); templateNode->SetNodeType(plVault::kNodeType_VNodeMgrAge); if (NetCommGetAge()) @@ -3775,7 +3803,7 @@ static RelVaultNode * GetAgeNode () { //============================================================================ RelVaultNode * VaultGetAgeNodeIncRef () { RelVaultNode * result = nil; - NetVaultNode * templateNode = NEWZERO(NetVaultNode); + NetVaultNode * templateNode = new NetVaultNode; templateNode->IncRef(); templateNode->SetNodeType(plVault::kNodeType_VNodeMgrAge); if (NetCommGetAge()) @@ -3793,7 +3821,7 @@ static RelVaultNode * GetAgeInfoNode () { return nil; RelVaultNode * result = nil; - NetVaultNode * templateNode = NEWZERO(NetVaultNode); + NetVaultNode * templateNode = new NetVaultNode; templateNode->IncRef(); templateNode->SetNodeType(plVault::kNodeType_AgeInfo); @@ -3817,7 +3845,7 @@ RelVaultNode * VaultGetAgeInfoNodeIncRef () { return nil; RelVaultNode * result = nil; - NetVaultNode * templateNode = NEWZERO(NetVaultNode); + NetVaultNode * templateNode = new NetVaultNode; templateNode->IncRef(); templateNode->SetNodeType(plVault::kNodeType_AgeInfo); templateNode->SetCreatorId(rvnAge->nodeId); @@ -3892,7 +3920,7 @@ RelVaultNode * VaultFindAgeSubAgeLinkIncRef (const plAgeInfoStruct * info) { if (RelVaultNode * rvnFldr = VaultGetAgeSubAgesFolderIncRef()) { - NetVaultNode * templateNode = NEWZERO(NetVaultNode); + NetVaultNode * templateNode = new NetVaultNode; templateNode->IncRef(); templateNode->SetNodeType(plVault::kNodeType_AgeInfo); @@ -3965,7 +3993,7 @@ RelVaultNode * VaultAgeAddDeviceAndWaitIncRef (const wchar_t deviceName[]) { //============================================================================ void VaultAgeRemoveDevice (const wchar_t deviceName[]) { if (RelVaultNode * folder = VaultGetAgeDevicesFolderIncRef()) { - NetVaultNode * templateNode = NEWZERO(NetVaultNode); + NetVaultNode * templateNode = new NetVaultNode; templateNode->IncRef(); templateNode->SetNodeType(plVault::kNodeType_TextNote); VaultTextNoteNode access(templateNode); @@ -3986,7 +4014,7 @@ void VaultAgeRemoveDevice (const wchar_t deviceName[]) { bool VaultAgeHasDevice (const wchar_t deviceName[]) { bool found = false; if (RelVaultNode * folder = VaultGetAgeDevicesFolderIncRef()) { - NetVaultNode * templateNode = NEWZERO(NetVaultNode); + NetVaultNode * templateNode = new NetVaultNode; templateNode->IncRef(); templateNode->SetNodeType(plVault::kNodeType_TextNote); VaultTextNoteNode access(templateNode); @@ -4005,7 +4033,7 @@ bool VaultAgeHasDevice (const wchar_t deviceName[]) { RelVaultNode * VaultAgeGetDeviceIncRef (const wchar_t deviceName[]) { RelVaultNode * result = nil; if (RelVaultNode * folder = VaultGetAgeDevicesFolderIncRef()) { - NetVaultNode * templateNode = NEWZERO(NetVaultNode); + NetVaultNode * templateNode = new NetVaultNode; templateNode->IncRef(); templateNode->SetNodeType(plVault::kNodeType_TextNote); VaultTextNoteNode access(templateNode); @@ -4025,7 +4053,7 @@ RelVaultNode * VaultAgeSetDeviceInboxAndWaitIncRef (const wchar_t deviceName[], StrCopy(devInbox->inboxName, inboxName, arrsize(devInbox->inboxName)); } else { - devInbox = NEWZERO(DeviceInbox)(deviceName, inboxName); + devInbox = new DeviceInbox(deviceName, inboxName); s_ageDeviceInboxes.Add(devInbox); } @@ -4077,7 +4105,7 @@ RelVaultNode * VaultAgeGetDeviceInboxIncRef (const wchar_t deviceName[]) { } if (parentNode) { - NetVaultNode * templateNode = NEWZERO(NetVaultNode); + NetVaultNode * templateNode = new NetVaultNode; templateNode->IncRef(); templateNode->SetNodeType(plVault::kNodeType_Folder); VaultFolderNode access(templateNode); @@ -4141,7 +4169,7 @@ RelVaultNode * VaultGetSubAgeLinkIncRef (const plAgeInfoStruct * info) { if (RelVaultNode * rvnFldr = VaultGetAgeSubAgesFolderIncRef()) { - NetVaultNode * templateNode = NEWZERO(NetVaultNode); + NetVaultNode * templateNode = new NetVaultNode; templateNode->IncRef(); templateNode->SetNodeType(plVault::kNodeType_AgeInfo); @@ -4426,7 +4454,7 @@ namespace _VaultCreateSubAge { LogMsg(kLogError, "CreateSubAge: Couldn't find SubAges folder (async)"); // Send the VaultNotify that the plNetLinkingMgr wants... - plVaultNotifyMsg * msg = NEWZERO(plVaultNotifyMsg); + plVaultNotifyMsg * msg = new plVaultNotifyMsg; msg->SetType(plVaultNotifyMsg::kRegisteredSubAgeLink); msg->SetResultCode(result); msg->GetArgs()->AddInt(plNetCommon::VaultTaskArgs::kAgeLinkNode, node->nodeId); @@ -4602,7 +4630,7 @@ bool VaultAgeFindOrCreateChildAgeLinkAndWait ( // Check for existing child age in folder RelVaultNode * rvnLink = nil; - NetVaultNode * templateNode = NEWZERO(NetVaultNode); + NetVaultNode * templateNode = new NetVaultNode; templateNode->IncRef(); templateNode->SetNodeType(plVault::kNodeType_AgeInfo); @@ -4788,7 +4816,7 @@ namespace _VaultCreateChildAge { VaultAddChildNode((uint32_t)((uintptr_t)p->fChildAgesFldr), node->nodeId, 0, nil, nil); // Send the VaultNotify that the plNetLinkingMgr wants... - plVaultNotifyMsg * msg = NEWZERO(plVaultNotifyMsg); + plVaultNotifyMsg * msg = new plVaultNotifyMsg; msg->SetType(plVaultNotifyMsg::kRegisteredChildAgeLink); msg->SetResultCode(result); msg->GetArgs()->AddInt(plNetCommon::VaultTaskArgs::kAgeLinkNode, node->nodeId); @@ -4867,7 +4895,7 @@ uint8_t VaultAgeFindOrCreateChildAgeLink( StrToUnicode(hack, ageName, arrsize(hack)); // Search for our age - NetVaultNode* temp = NEWZERO(NetVaultNode); + NetVaultNode* temp = new NetVaultNode; temp->SetNodeType(plVault::kNodeType_AgeInfo); VaultAgeInfoNode theAge(temp); theAge.SetAgeFilename(hack); @@ -4934,13 +4962,8 @@ void VaultDownload ( FVaultProgressCallback progressCallback, void * cbProgressParam ) { - VaultDownloadTrans * trans = NEWZERO(VaultDownloadTrans); - StrCopy(trans->tag, tag, arrsize(trans->tag)); - trans->callback = callback; - trans->cbParam = cbParam; - trans->progressCallback = progressCallback; - trans->cbProgressParam = cbProgressParam; - trans->vaultId = vaultId; + VaultDownloadTrans * trans = new VaultDownloadTrans(tag, callback, cbParam, + progressCallback, cbProgressParam, vaultId); NetCliAuthVaultFetchNodeRefs( vaultId, @@ -5032,7 +5055,7 @@ void VaultCull (unsigned vaultId) { RelVaultNode * VaultGetSystemNodeIncRef () { RelVaultNode * result = nil; if (RelVaultNode * player = VaultGetPlayerNodeIncRef()) { - NetVaultNode * templateNode = NEWZERO(NetVaultNode); + NetVaultNode * templateNode = new NetVaultNode; templateNode->IncRef(); templateNode->SetNodeType(plVault::kNodeType_System); if (RelVaultNode * systemNode = player->GetChildNodeIncRef(templateNode, 1)) @@ -5047,7 +5070,7 @@ RelVaultNode * VaultGetSystemNodeIncRef () { RelVaultNode * VaultGetGlobalInboxIncRef () { RelVaultNode * result = nil; if (RelVaultNode * system = VaultGetSystemNodeIncRef()) { - NetVaultNode * templateNode = NEWZERO(NetVaultNode); + NetVaultNode * templateNode = new NetVaultNode; templateNode->IncRef(); templateNode->SetNodeType(plVault::kNodeType_Folder); VaultFolderNode folder(templateNode); diff --git a/Sources/Plasma/PubUtilLib/plVault/plVaultNodeAccess.cpp b/Sources/Plasma/PubUtilLib/plVault/plVaultNodeAccess.cpp index b3eed74e..eac26f4c 100644 --- a/Sources/Plasma/PubUtilLib/plVault/plVaultNodeAccess.cpp +++ b/Sources/Plasma/PubUtilLib/plVault/plVaultNodeAccess.cpp @@ -579,7 +579,7 @@ void VaultSDLNode::SetStateDataRecord (const plStateDataRecord * rec, unsigned w #ifdef CLIENT void VaultSDLNode::InitStateDataRecord (const wchar_t sdlRecName[], unsigned writeOptions) { { - plStateDataRecord * rec = NEWZERO(plStateDataRecord); + plStateDataRecord * rec = new plStateDataRecord; bool exists = GetStateDataRecord(rec, 0); delete rec; if (exists)