MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / sendPlayerUpdate

Method sendPlayerUpdate

src/clientbase/ServerLink.cpp:851–867  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

849
850
851void ServerLink::sendPlayerUpdate(Player* player) {
852 // Send the time frozen at each start of scene iteration, as all
853 // dead reckoning use that
854 char msg[PlayerUpdatePLenMax];
855 void* buf = msg;
856 buf = nboPackUInt8(buf, player->getId());
857 buf = nboPackDouble(buf, GameTime::getStepTime());
858
859 // code will be MsgPlayerUpdate or MsgPlayerUpdateSmall
860 uint16_t code;
861 buf = player->pack(buf, code);
862
863 // variable length
864 const int len = (const int)((char*)buf - (char*)msg);
865
866 send(code, len, msg);
867}
868
869
870void ServerLink::sendShotBegin(const FiringInfo& info) {

Callers 6

doUpdateMotionMethod · 0.80
fireShotMethod · 0.80
sendRobotUpdatesFunction · 0.80
doNetworkStuffFunction · 0.80
checkEnvironmentFunction · 0.80
operator()Method · 0.80

Calls 4

nboPackUInt8Function · 0.85
nboPackDoubleFunction · 0.85
getIdMethod · 0.80
packMethod · 0.45

Tested by

no test coverage detected