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

@ -316,7 +316,10 @@ void NetConnection::checkMaxRate()
{
packetRateToServer = 128;
packetRateToClient = 128;
packetSize = 1024;
// These changes introduced in T3D 1.1 Preview reduce the packet headroom which leads
// to some spells and effects running out of room when dynamic variables are used
// to send launch-time parameters to clients.
packetSize = 512;
}
gPacketUpdateDelayToServer = 1024 / packetRateToServer;

View file

@ -20,6 +20,11 @@
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
// Arcane-FX for MIT Licensed Open Source version of Torque 3D from GarageGames
// Copyright (C) 2015 Faust Logic, Inc.
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
#ifndef _NETCONNECTION_H_
#define _NETCONNECTION_H_
@ -1050,6 +1055,9 @@ public:
virtual bool readDemoStartBlock(BitStream *stream);
virtual void demoPlaybackComplete();
/// @}
public:
S32 getCurRatePacketSize() const { return mCurRate.packetSize; }
S32 getMaxRatePacketSize() const { return mMaxRate.packetSize; }
};

View file

@ -20,6 +20,11 @@
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
// Arcane-FX for MIT Licensed Open Source version of Torque 3D from GarageGames
// Copyright (C) 2015 Faust Logic, Inc.
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
#include "platform/platform.h"
#include "console/simBase.h"
#include "core/dnet.h"
@ -28,6 +33,8 @@
#include "console/consoleTypes.h"
#include "console/engineAPI.h"
#include "afx/arcaneFX.h"
IMPLEMENT_CONOBJECT(NetObject);
// More information can be found in the Torque Manual (CHM)
@ -46,6 +53,9 @@ NetObject::NetObject()
mPrevDirtyList = NULL;
mNextDirtyList = NULL;
mDirtyMaskBits = 0;
scope_id = 0;
scope_refs = 0;
scope_registered = false;
}
NetObject::~NetObject()
@ -460,3 +470,26 @@ DefineEngineMethod( NetObject, isServerObject, bool, (),,
//{
// return object->isServerObject();
//}
U16 NetObject::addScopeRef()
{
if (scope_refs == 0)
{
scope_id = arcaneFX::generateScopeId();
onScopeIdChange();
}
scope_refs++;
return scope_id;
}
void NetObject::removeScopeRef()
{
if (scope_refs == 0)
return;
scope_refs--;
if (scope_refs == 0)
{
scope_id = 0;
onScopeIdChange();
}
}

View file

@ -20,6 +20,11 @@
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
// Arcane-FX for MIT Licensed Open Source version of Torque 3D from GarageGames
// Copyright (C) 2015 Faust Logic, Inc.
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
#ifndef _NETOBJECT_H_
#define _NETOBJECT_H_
@ -405,6 +410,18 @@ public:
static T* getClientObject( T *netObj ) { return static_cast<T*>( netObj->getClientObject() ); }
/// @}
protected:
U16 scope_id;
U16 scope_refs;
bool scope_registered;
virtual void onScopeIdChange() { }
public:
enum { SCOPE_ID_BITS = 14 };
U16 getScopeId() const { return scope_id; }
U16 addScopeRef();
void removeScopeRef();
void setScopeRegistered(bool flag) { scope_registered = flag; }
bool getScopeRegistered() const { return scope_registered; }
};
//-----------------------------------------------------------------------------