MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / TransferMsg

Method TransferMsg

engine/Poseidon/Network/Network.cpp:407–430  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

405}
406
407TMError NetworkObject::TransferMsg(NetworkMessageContext& ctx)
408{
409 if (ctx.IsSending())
410 {
411 // TESTING - Replace by PoseidonAssert
412 NET_ERROR(dynamic_cast<const IndicesNetworkObject*>(ctx.GetIndices()))
413 const IndicesNetworkObject* indices = static_cast<const IndicesNetworkObject*>(ctx.GetIndices());
414
415 NetworkId id = GetNetworkId();
416 TMCHECK(ctx.IdxTransfer(indices->objectCreator, id.creator))
417 TMCHECK(ctx.IdxTransfer(indices->objectId, id.id))
418 Vector3 position = GetCurrentPosition();
419 TMCHECK(ctx.IdxTransfer(indices->objectPosition, position))
420 }
421 else
422 {
423 if (ctx.GetClass() == NMCUpdatePosition)
424 {
425 _lastUpdateTime = Glob.time;
426 _maxPredictionTime = _lastUpdateTime + GetMaxPredictionTime(ctx);
427 }
428 }
429 return TMOK;
430}
431
432float NetworkObject::CalculateError(NetworkMessageContext& ctx)
433{

Callers 15

SendMsgMethod · 0.45
CreateObjectMethod · 0.45
UpdateObjectMethod · 0.45
CreateVehicleMethod · 0.45
CreateCommandMethod · 0.45
AssignPlayerMethod · 0.45
OnMessageMethod · 0.45
OnGameStateMessageMethod · 0.45
OnMessagePlayerRoleMethod · 0.45
OnMessageMethod · 0.45
OnSimulateMethod · 0.45
OnPlayerCreateMethod · 0.45

Calls 11

GetNetworkIdFunction · 0.85
TMCHECKFunction · 0.85
GetCurrentPositionFunction · 0.85
IsSendingMethod · 0.80
GetClassMethod · 0.80
GetCameraMethod · 0.80
IdxTransferRefMethod · 0.80
IdxTransferRefsMethod · 0.80
GetIndicesMethod · 0.45
IdxTransferMethod · 0.45
PositionMethod · 0.45

Tested by

no test coverage detected