| 352 | //---------------------------------------------------------------------------- |
| 353 | |
| 354 | void 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 | |
| 409 | void GameBase::interpolateTick(F32 dt) |
| 410 | { |
no test coverage detected