MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / setGhostAlwaysObject

Method setGhostAlwaysObject

Engine/source/sim/netGhost.cpp:1069–1097  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1067}
1068
1069void NetConnection::setGhostAlwaysObject(NetObject *object, U32 index)
1070{
1071 if(!isGhostingTo())
1072 {
1073 object->deleteObject();
1074 setLastError("Invalid packet. (unexpected ghostalways)");
1075 return;
1076 }
1077 object->mNetFlags = NetObject::IsGhost;
1078 object->mNetIndex = index;
1079
1080 // while there's an object waiting...
1081 if ( isLocalConnection() )
1082 {
1083 object->mServerObject = mRemoteConnection->resolveObjectFromGhostIndex(index);
1084 if ( object->mServerObject )
1085 object->mServerObject->mClientObject = object;
1086 }
1087
1088 GhostSave sv;
1089 sv.ghost = object;
1090 sv.index = index;
1091 mGhostAlwaysSaveList.push_back(sv);
1092
1093 // check if we are already downloading files for a previous object:
1094 if(mGhostAlwaysSaveList.size() == 1)
1095 loadNextGhostAlwaysObject(true); // the initial call always has "new" files
1096
1097}
1098
1099void NetConnection::fileDownloadSegmentComplete()
1100{

Callers 2

processMethod · 0.80
activateGhostingMethod · 0.80

Calls 4

deleteObjectMethod · 0.45
push_backMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected