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

Method unpackUpdate

Engine/source/T3D/player.cpp:6239–6411  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6237}
6238
6239void Player::unpackUpdate(NetConnection *con, BitStream *stream)
6240{
6241 Parent::unpackUpdate(con,stream);
6242
6243 if (stream->readFlag())
6244 mImpactSound = stream->readInt(PlayerData::ImpactBits);
6245
6246 // Server specified action animation
6247 if (stream->readFlag()) {
6248 U32 action = stream->readInt(PlayerData::ActionAnimBits);
6249 bool hold = stream->readFlag();
6250 bool atEnd = stream->readFlag();
6251 bool fsp = stream->readFlag();
6252
6253 F32 animPos = -1.0f;
6254 if (!atEnd && stream->readFlag())
6255 animPos = stream->readSignedFloat(6);
6256
6257 if (isProperlyAdded()) {
6258 setActionThread(action,true,hold,true,fsp);
6259 bool inDeath = inDeathAnim();
6260 if (atEnd)
6261 {
6262 mShapeInstance->clearTransition(mActionAnimation.thread);
6263 mShapeInstance->setPos(mActionAnimation.thread,
6264 mActionAnimation.forward? 1: 0);
6265 if (inDeath)
6266 mDeath.lastPos = 1.0f;
6267 }
6268 else if (animPos > 0) {
6269 mShapeInstance->setPos(mActionAnimation.thread, animPos);
6270 if (inDeath)
6271 mDeath.lastPos = animPos;
6272 }
6273
6274 // mMountPending suppresses tickDelay countdown so players will sit until
6275 // their mount, or another animation, comes through (or 13 seconds elapses).
6276 mMountPending = (S32) (inSittingAnim() ? sMountPendingTickWait : 0);
6277 }
6278 else {
6279 mActionAnimation.action = action;
6280 mActionAnimation.holdAtEnd = hold;
6281 mActionAnimation.atEnd = atEnd;
6282 mActionAnimation.firstPerson = fsp;
6283 }
6284 }
6285
6286 // Server specified arm animation
6287 if (stream->readFlag()) {
6288 U32 action = stream->readInt(PlayerData::ActionAnimBits);
6289 if (isProperlyAdded())
6290 setArmThread(action);
6291 else
6292 mArmAnimation.action = action;
6293 }
6294
6295 // Done if controlled by client ( and not initial update )
6296 if(stream->readFlag())

Callers

nothing calls this directly

Calls 15

getMaxFunction · 0.85
mFloorFunction · 0.85
mFabsFunction · 0.85
setPositionFunction · 0.85
readFlagMethod · 0.80
readIntMethod · 0.80
readSignedFloatMethod · 0.80
clearTransitionMethod · 0.80
setPosMethod · 0.80
readCompressedPointMethod · 0.80
readNormalVectorMethod · 0.80
readFloatMethod · 0.80

Tested by

no test coverage detected