| 849 | |
| 850 | |
| 851 | void 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 | |
| 870 | void ServerLink::sendShotBegin(const FiringInfo& info) { |
no test coverage detected