Skip to content

Commit 1fed963

Browse files
committed
updates
Fixed streaming logic to only happen when we are not editing a mission, also some issues with objects that cannot be streamed eg camera, and player. Reverted limits
1 parent eecc2bd commit 1fed963

5 files changed

Lines changed: 37 additions & 23 deletions

File tree

Engine/source/console/sim.cpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -267,17 +267,3 @@ DefineEngineFunction( isValidObjectName, bool, (const char * name), , "( string
267267
268268
ConsoleFunctionGroupEnd( SimFunctions );
269269
270-
void SceneStreaming::processTick()
271-
{
272-
if (smStreaming)
273-
{
274-
for (U32 i = 0; i < mMaxObjects && !smPendingRegister.empty(); i++)
275-
{
276-
SimObject* obj = smPendingRegister.first();
277-
smPendingRegister.pop_front();
278-
279-
if (!obj->onAdd())
280-
obj->unregisterObject();
281-
}
282-
}
283-
}

Engine/source/console/simManager.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,3 +628,23 @@ void SimDataBlockGroup::sort()
628628
dQsort(mObjectList.address(), mObjectList.size(),sizeof(SimObject *),compareModifiedKey);
629629
}
630630
}
631+
632+
void SceneStreaming::processTick()
633+
{
634+
if (true)
635+
{
636+
for (U32 i = 0; i < mMaxObjects && !smPendingRegister.empty(); i++)
637+
{
638+
SimObject* obj = smPendingRegister.first();
639+
smPendingRegister.pop_front();
640+
641+
Sim::gIdDictionary->insert(obj);
642+
643+
Sim::gNameDictionary->insert(obj);
644+
645+
646+
if (!obj->onAdd())
647+
obj->unregisterObject();
648+
}
649+
}
650+
}

Engine/source/console/simObject.cpp

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
4444

4545
#include "sim/netObject.h"
4646
#include "scene/sceneObject.h"
47+
#include "T3D/camera.h"
48+
#include "T3D/player.h"
4749

4850
ImplementBitfieldType(GameTypeMasksType,
4951
"The type of animation effect to apply to this material.\n"
@@ -114,7 +116,7 @@ namespace Sim
114116
extern SimIdDictionary *gIdDictionary;
115117
extern U32 gNextObjectId;
116118
}
117-
119+
extern bool gEditingMission;
118120

119121
//-----------------------------------------------------------------------------
120122

@@ -723,15 +725,21 @@ bool SimObject::registerObject()
723725
AssertFatal(Sim::gIdDictionary && Sim::gNameDictionary,
724726
"SimObject::registerObject - tried to register an object before Sim::init()!");
725727

726-
Sim::gIdDictionary->insert(this);
727-
728-
Sim::gNameDictionary->insert(this);
729-
730-
if (Sim::sgStreamingInstance->smStreaming && dynamic_cast<SceneObject*>(this))
728+
729+
if (true && dynamic_cast<SceneObject*>(this) &&
730+
!(dynamic_cast<Camera*>(this) || dynamic_cast<Player*>(this)) &&
731+
!gEditingMission
732+
)
731733
{
732734
Sim::sgStreamingInstance->smPendingRegister.push_back(this);
733735
return true; // pretend success
734736
}
737+
else
738+
{
739+
Sim::gIdDictionary->insert(this);
740+
741+
Sim::gNameDictionary->insert(this);
742+
}
735743

736744
// Notify object
737745
bool ret = onAdd();

Engine/source/sim/netConnection.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ U32 NetConnection::getSequence()
215215
static U32 gPacketRateToServer = 32;
216216
static U32 gPacketUpdateDelayToServer = 32;
217217
static U32 gPacketRateToClient = 10;
218-
static U32 gPacketSize = 1500;
218+
static U32 gPacketSize = 508;
219219

220220
void NetConnection::consoleInit()
221221
{
@@ -319,7 +319,7 @@ void NetConnection::checkMaxRate()
319319
// These changes introduced in T3D 1.1 Preview reduce the packet headroom which leads
320320
// to some spells and effects running out of room when dynamic variables are used
321321
// to send launch-time parameters to clients.
322-
packetSize = 1500;
322+
packetSize = 512;
323323
}
324324

325325
gPacketUpdateDelayToServer = 1024 / packetRateToServer;

Engine/source/sim/netGhost.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ void NetConnection::ghostWritePacket(BitStream *bstream, PacketNotify *notify)
425425
bstream->writeInt(sendSize - 3, GhostIndexBitSize);
426426

427427
S32 bytesThisPacket = 0;
428-
U32 maxBytesPerPacket = mGhostByteBudget;
428+
U32 maxBytesPerPacket = mMaxRate.packetSize;
429429
//
430430
for(i = mGhostZeroUpdateIndex - 1; i >= 0 && !bstream->isFull(); i--)
431431
{

0 commit comments

Comments
 (0)