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

Method readPacketData

Engine/source/T3D/player.cpp:6094–6161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6092
6093
6094void Player::readPacketData(GameConnection *connection, BitStream *stream)
6095{
6096 Parent::readPacketData(connection, stream);
6097
6098 mState = (ActionState)stream->readInt(NumStateBits);
6099 if (stream->readFlag())
6100 mRecoverTicks = stream->readInt(PlayerData::RecoverDelayBits);
6101 if (stream->readFlag())
6102 mJumpDelay = stream->readInt(PlayerData::JumpDelayBits);
6103 else
6104 mJumpDelay = 0;
6105
6106 Point3F pos,rot;
6107 if (stream->readFlag()) {
6108 // Only written if we are not mounted
6109 stream->read(&pos.x);
6110 stream->read(&pos.y);
6111 stream->read(&pos.z);
6112 stream->read(&mVelocity.x);
6113 stream->read(&mVelocity.y);
6114 stream->read(&mVelocity.z);
6115 stream->setCompressionPoint(pos);
6116 delta.pos = pos;
6117 mJumpSurfaceLastContact = stream->readInt(4);
6118
6119 if (stream->readFlag())
6120 {
6121 mAllowJumping = stream->readFlag();
6122 mAllowJetJumping = stream->readFlag();
6123 mAllowSprinting = stream->readFlag();
6124 mAllowCrouching = stream->readFlag();
6125 mAllowProne = stream->readFlag();
6126 mAllowSwimming = stream->readFlag();
6127 }
6128 else
6129 {
6130 mAllowJumping = true;
6131 mAllowJetJumping = true;
6132 mAllowSprinting = true;
6133 mAllowCrouching = true;
6134 mAllowProne = true;
6135 mAllowSwimming = true;
6136 }
6137 }
6138 else
6139 pos = delta.pos;
6140 stream->read(&mHead.x);
6141 if(stream->readFlag())
6142 {
6143 // Include mHead.y to allow for camera banking
6144 stream->read(&mHead.y);
6145 }
6146 stream->read(&mHead.z);
6147 stream->read(&rot.z);
6148 rot.x = rot.y = 0;
6149 setPosition(pos,rot);
6150 delta.head = mHead;
6151 delta.rot = rot;

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected