Browse Source

Deprecate and remove NEWZERO macro

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

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

@ -631,8 +631,7 @@ static void ProcessManifest (void * param) {
);
if (i < kMaxManifestFileRequests) {
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);

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

3
Sources/Plasma/CoreLib/HeadSpin.h

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

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

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

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

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

@ -796,7 +796,7 @@ bool pfGameUIInputInterface::InterpretInputEvent( plInputEventMsg *pMsg )
if ((keymap->GetKey1().IsSatisfiedBy(combo)) || (keymap->GetKey2().IsSatisfiedBy(combo)))
{
// 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);

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

@ -59,7 +59,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
struct IBlueSpiral {
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);
}
//============================================================================

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

@ -59,7 +59,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
struct IClimbingWall {
pfGmClimbingWall * gameCli;
IClimbingWall (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);
}
//============================================================================

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

@ -59,7 +59,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
struct IHeek {
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);
}
//============================================================================

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

@ -59,7 +59,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
struct IMarker {
pfGmMarker * gameCli;
IMarker (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);
}
//============================================================================

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

@ -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,7 +185,7 @@ 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);
}
//============================================================================

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

@ -59,7 +59,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
struct IVarSync {
pfGmVarSync * gameCli;
IVarSync (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);
}
//============================================================================

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

@ -209,7 +209,7 @@ void IGameMgr::RecvGameInstance (const Srv2Cli_GameMgr_GameInstance & msg, void
//============================================================================
void IGameMgr::RecvInviteReceived (const Srv2Cli_GameMgr_InviteReceived & msg, void * param) {
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<unsigned>(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);
}
//============================================================================

4
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);
@ -109,7 +109,7 @@ public:
GETINTERFACE_ANY(pfGameCliMsg, plMessage);
#pragma warning(pop)
pfGameCliMsg ();
pfGameCliMsg () : gameCli(nil), netMsg(nil) { }
~pfGameCliMsg ();
void Read(hsStream *, hsResMgr *) { FATAL("not impl"); }

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

@ -229,7 +229,7 @@ void pyAgeVault::AddChronicleEntry( const char * name, uint32_t type, const char
// Add a new device.
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;

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

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

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

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

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

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

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

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

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

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

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

4
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

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

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

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

@ -109,6 +109,13 @@ struct Operation {
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);
@ -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) { }
};

11
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 {
@ -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();

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

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

15
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 () {

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

6
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<plClosetItem> &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<plClosetItem> &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;

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

@ -65,6 +65,17 @@ public:
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"); }
};

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

@ -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

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

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

10
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());

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

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

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

@ -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 ();

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

@ -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);
}
@ -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
@ -5751,7 +5762,7 @@ void NetCliAuthVaultInitAge (
FNetCliAuthAgeInitCallback callback, // optional
void * param // optional
) {
VaultInitAgeTrans * trans = NEWZERO(VaultInitAgeTrans)(
VaultInitAgeTrans * trans = new VaultInitAgeTrans(
callback,
param,
ageInstId,

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

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

13
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,

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

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

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

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

@ -433,7 +433,7 @@ 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 );

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

@ -95,9 +95,9 @@ struct RelVaultNodeLink : THashKeyVal<unsigned> {
RelVaultNodeLink (bool seen, unsigned ownerId, unsigned nodeId, RelVaultNode * node)
: THashKeyVal<unsigned>(nodeId)
, seen(seen)
, ownerId(ownerId)
, node(node)
, ownerId(ownerId)
, seen(seen)
{
node->IncRef();
}
@ -141,6 +141,14 @@ struct VaultCreateNodeTrans {
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,
@ -160,6 +168,11 @@ 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,
@ -181,7 +194,24 @@ struct VaultDownloadTrans {
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,
@ -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,
@ -215,6 +252,12 @@ struct AddChildNodeFetchTrans {
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,10 +2151,7 @@ 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];
@ -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);

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

Loading…
Cancel
Save