| 185 | } |
| 186 | |
| 187 | void StdClientProcessList::onTickObject( ProcessObject *obj ) |
| 188 | { |
| 189 | PROFILE_SCOPE( StdClientProcessList_OnTickObject ); |
| 190 | |
| 191 | // In case the object deletes itself during its processTick. |
| 192 | SimObjectPtr<SceneObject> safePtr = static_cast<SceneObject*>( obj ); |
| 193 | |
| 194 | // Each object is either advanced a single tick, or if it's |
| 195 | // being controlled by a client, ticked once for each pending move. |
| 196 | Move* movePtr; |
| 197 | U32 numMoves; |
| 198 | GameConnection* con = obj->getControllingClient(); |
| 199 | if ( con && con->getControlObject() == obj ) |
| 200 | { |
| 201 | con->mMoveList->getMoves( &movePtr, &numMoves ); |
| 202 | if ( numMoves ) |
| 203 | { |
| 204 | // Note: should only have a single move at this point |
| 205 | AssertFatal(numMoves==1,"ClientProccessList::onTickObject: more than one move in queue"); |
| 206 | |
| 207 | #ifdef TORQUE_DEBUG_NET_MOVES |
| 208 | U32 sum = Move::ChecksumMask & obj->getPacketDataChecksum(obj->getControllingClient()); |
| 209 | #endif |
| 210 | |
| 211 | if ( obj->isTicking() ) |
| 212 | obj->processTick( movePtr ); |
| 213 | |
| 214 | if ( bool(safePtr) && obj->getControllingClient() ) |
| 215 | { |
| 216 | U32 newsum = Move::ChecksumMask & obj->getPacketDataChecksum( obj->getControllingClient() ); |
| 217 | |
| 218 | // set checksum if not set or check against stored value if set |
| 219 | movePtr->checksum = newsum; |
| 220 | |
| 221 | #ifdef TORQUE_DEBUG_NET_MOVES |
| 222 | Con::printf("move checksum: %i, (start %i), (move %f %f %f)", |
| 223 | movePtr->checksum,sum,movePtr->yaw,movePtr->y,movePtr->z); |
| 224 | #endif |
| 225 | } |
| 226 | con->mMoveList->clearMoves( 1 ); |
| 227 | } |
| 228 | } |
| 229 | else if ( obj->isTicking() ) |
| 230 | obj->processTick( 0 ); |
| 231 | } |
| 232 | |
| 233 | void StdClientProcessList::advanceObjects() |
| 234 | { |
nothing calls this directly
no test coverage detected