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

Method readPacketData

Engine/source/T3D/player.cpp:6237–6305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6235
6236
6237void Player::readPacketData(GameConnection *connection, BitStream *stream)
6238{
6239 Parent::readPacketData(connection, stream);
6240
6241 mState = (ActionState)stream->readInt(NumStateBits);
6242 if (stream->readFlag())
6243 mRecoverTicks = stream->readInt(PlayerData::RecoverDelayBits);
6244 if (stream->readFlag())
6245 mJumpDelay = stream->readInt(PlayerData::JumpDelayBits);
6246 else
6247 mJumpDelay = 0;
6248
6249 Point3F pos,rot;
6250 if (stream->readFlag()) {
6251 // Only written if we are not mounted
6252 stream->read(&pos.x);
6253 stream->read(&pos.y);
6254 stream->read(&pos.z);
6255 stream->read(&mVelocity.x);
6256 stream->read(&mVelocity.y);
6257 stream->read(&mVelocity.z);
6258 stream->setCompressionPoint(pos);
6259 mDelta.pos = pos;
6260 mJumpSurfaceLastContact = stream->readInt(4);
6261
6262 if (stream->readFlag())
6263 {
6264 mAllowJumping = stream->readFlag();
6265 mAllowJetJumping = stream->readFlag();
6266 mAllowSprinting = stream->readFlag();
6267 mAllowCrouching = stream->readFlag();
6268 mAllowProne = stream->readFlag();
6269 mAllowSwimming = stream->readFlag();
6270 }
6271 else
6272 {
6273 mAllowJumping = true;
6274 mAllowJetJumping = true;
6275 mAllowSprinting = true;
6276 mAllowCrouching = true;
6277 mAllowProne = true;
6278 mAllowSwimming = true;
6279 }
6280 }
6281 else
6282 pos = mDelta.pos;
6283 stream->read(&mHead.x);
6284 if(stream->readFlag())
6285 {
6286 // Include mHead.y to allow for camera banking
6287 stream->read(&mHead.y);
6288 }
6289 stream->read(&mHead.z);
6290 stream->read(&rot.z);
6291 rot.x = rot.y = 0;
6292 if (!ignore_updates)
6293 setPosition(pos,rot);
6294 mDelta.head = mHead;

Callers

nothing calls this directly

Calls 6

readIntMethod · 0.80
readFlagMethod · 0.80
setCompressionPointMethod · 0.80
resolveGhostMethod · 0.80
setPositionFunction · 0.50
readMethod · 0.45

Tested by

no test coverage detected