packet-size-checking -- Methods for querying packet-size settings. Used for detecting when spells or effects overrun the packet buffer from networked dynamic field usage.

scope-tracking -- changes related to the tracking of AFX constraint objects as they move in and out of scope.
This commit is contained in:
Marc Chapman 2017-07-27 00:09:36 +01:00
parent eb5d3cc749
commit b17b45edbb
6 changed files with 93 additions and 4 deletions

View file

@ -24,6 +24,7 @@
// Arcane-FX for MIT Licensed Open Source version of Torque 3D from GarageGames
// Copyright (C) 2015 Faust Logic, Inc.
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
#include "platform/platform.h"
#include "T3D/gameBase/gameBase.h"
#include "console/consoleTypes.h"
@ -40,6 +41,7 @@
#include "T3D/aiConnection.h"
#endif
#include "afx/arcaneFX.h"
//----------------------------------------------------------------------------
// Ghost update relative priority values
@ -254,6 +256,8 @@ GameBase::GameBase()
GameBase::~GameBase()
{
if (scope_registered)
arcaneFX::unregisterScopedObject(this);
}
@ -266,8 +270,16 @@ bool GameBase::onAdd()
// Datablock must be initialized on the server.
// Client datablock are initialized by the initial update.
if ( isServerObject() && mDataBlock && !onNewDataBlock( mDataBlock, false ) )
return false;
if (isClientObject())
{
if (scope_id > 0 && !scope_registered)
arcaneFX::registerScopedObject(this);
}
else
{
if ( mDataBlock && !onNewDataBlock( mDataBlock, false ) )
return false;
}
setProcessTick( true );
@ -276,6 +288,8 @@ bool GameBase::onAdd()
void GameBase::onRemove()
{
if (scope_registered)
arcaneFX::unregisterScopedObject(this);
// EDITOR FEATURE: Remove us from the reload signal of our datablock.
if ( mDataBlock )
mDataBlock->mReloadSignal.remove( this, &GameBase::_onDatablockModified );
@ -556,6 +570,11 @@ U32 GameBase::packUpdate( NetConnection *connection, U32 mask, BitStream *stream
stream->writeFlag(mIsAiControlled);
#endif
if (stream->writeFlag(mask & ScopeIdMask))
{
if (stream->writeFlag(scope_refs > 0))
stream->writeInt(scope_id, SCOPE_ID_BITS);
}
return retMask;
}
@ -594,6 +613,11 @@ void GameBase::unpackUpdate(NetConnection *con, BitStream *stream)
mTicksSinceLastMove = 0;
mIsAiControlled = stream->readFlag();
#endif
if (stream->readFlag())
{
scope_id = (stream->readFlag()) ? (U16) stream->readInt(SCOPE_ID_BITS) : 0;
scope_refs = 0;
}
}
void GameBase::onMount( SceneObject *obj, S32 node )