MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / writeDemoStartBlock

Method writeDemoStartBlock

Engine/source/T3D/gameBase/gameConnection.cpp:955–1034  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

953}
954
955void GameConnection::writeDemoStartBlock(ResizeBitStream *stream)
956{
957 // write all the data blocks to the stream:
958
959 for(SimObjectId i = DataBlockObjectIdFirst; i <= DataBlockObjectIdLast; i++)
960 {
961 SimDataBlock *data;
962 if(Sim::findObject(i, data))
963 {
964 stream->writeFlag(true);
965 SimDataBlockEvent evt(data);
966 evt.pack(this, stream);
967 stream->validate();
968 }
969 }
970 stream->writeFlag(false);
971 stream->write(mFirstPerson);
972 stream->write(mCameraPos);
973 stream->write(mCameraSpeed);
974
975 // Control scheme
976 stream->write(mAbsoluteRotation);
977 stream->write(mAddYawToAbsRot);
978 stream->write(mAddPitchToAbsRot);
979
980 stream->writeString(Con::getVariable("$Client::MissionFile"));
981
982 mMoveList->writeDemoStartBlock(stream);
983
984 // dump all the "demo" vars associated with this connection:
985 SimFieldDictionaryIterator itr(getFieldDictionary());
986
987 SimFieldDictionary::Entry *entry;
988 while((entry = *itr) != NULL)
989 {
990 if(!dStrnicmp(entry->slotName, "demo", 4))
991 {
992 stream->writeFlag(true);
993 stream->writeString(entry->slotName + 4);
994 stream->writeString(entry->value);
995 stream->validate();
996 }
997 ++itr;
998 }
999 stream->writeFlag(false);
1000 Parent::writeDemoStartBlock(stream);
1001
1002 stream->validate();
1003
1004 // dump out the control object ghost id
1005 S32 idx = mControlObject ? getGhostIndex(mControlObject) : -1;
1006 stream->write(idx);
1007 if(mControlObject)
1008 {
1009#ifdef TORQUE_NET_STATS
1010 U32 beginPos = stream->getBitPosition();
1011#endif
1012 mControlObject->writePacketData(this, stream);

Callers

nothing calls this directly

Calls 12

getVariableFunction · 0.85
dStrnicmpFunction · 0.85
getBitPositionMethod · 0.80
getClassRepMethod · 0.80
findObjectFunction · 0.50
writeFlagMethod · 0.45
packMethod · 0.45
validateMethod · 0.45
writeMethod · 0.45
writeStringMethod · 0.45
writePacketDataMethod · 0.45

Tested by

no test coverage detected