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

Method processTick

Engine/source/T3D/gameBase/gameBase.cpp:354–407  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

352//----------------------------------------------------------------------------
353
354void GameBase::processTick(const Move * move)
355{
356#ifdef TORQUE_DEBUG_NET_MOVES
357 if (!move)
358 mTicksSinceLastMove++;
359
360 const char * srv = isClientObject() ? "client" : "server";
361 const char * who = "";
362 if (isClientObject())
363 {
364 if (this == (GameBase*)GameConnection::getConnectionToServer()->getControlObject())
365 who = " player";
366 else
367 who = " ghost";
368 if (mIsAiControlled)
369 who = " ai";
370 }
371 if (isServerObject())
372 {
373 if (dynamic_cast<AIConnection*>(getControllingClient()))
374 {
375 who = " ai";
376 mIsAiControlled = true;
377 }
378 else if (getControllingClient())
379 {
380 who = " player";
381 mIsAiControlled = false;
382 }
383 else
384 {
385 who = "";
386 mIsAiControlled = false;
387 }
388 }
389 U32 moveid = mLastMoveId+mTicksSinceLastMove;
390 if (move)
391 moveid = move->id;
392
393 if (getTypeMask() & GameBaseHiFiObjectType)
394 {
395 if (move)
396 Con::printf("Processing (%s%s id %i) move %i",srv,who,getId(), move->id);
397 else
398 Con::printf("Processing (%s%s id %i) move %i (%i)",srv,who,getId(),mLastMoveId+mTicksSinceLastMove,mTicksSinceLastMove);
399 }
400
401 if (move)
402 {
403 mLastMoveId = move->id;
404 mTicksSinceLastMove=0;
405 }
406#endif
407}
408
409void GameBase::interpolateTick(F32 dt)
410{

Callers 6

onTickObjectMethod · 0.45
clientCatchupMethod · 0.45
onTickObjectMethod · 0.45
clientCatchupMethod · 0.45
onTickObjectMethod · 0.45
clientCatchupMethod · 0.45

Calls 2

printfFunction · 0.85
getControlObjectMethod · 0.45

Tested by

no test coverage detected