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

Method sendEnter

src/clientbase/ServerLink.cpp:745–770  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

743
744
745void ServerLink::sendEnter(PlayerId _id, PlayerType type, NetworkUpdates updates, TeamColor team,
746 const char* name,
747 const char* token,
748 const char* referrer) {
749 joinCallsign = name;
750
751 if (state != Okay) { return; }
752 char msg[MaxPacketLen] = {0};
753 void* buf = msg;
754
755 buf = nboPackUInt8(buf, uint8_t(_id));
756 buf = nboPackUInt16(buf, uint16_t(type));
757 buf = nboPackUInt16(buf, uint16_t(updates));
758 buf = nboPackInt16(buf, int16_t(team));
759
760 ::strncpy((char*)buf, name, CallSignLen - 1);
761 buf = (void*)((char*)buf + CallSignLen);
762 ::strncpy((char*)buf, token, TokenLen - 1);
763 buf = (void*)((char*)buf + TokenLen);
764 ::strncpy((char*)buf, getAppVersion(), VersionLen - 1);
765 buf = (void*)((char*)buf + VersionLen);
766 ::strncpy((char*)buf, referrer, ReferrerLen - 1);
767 buf = (void*)((char*)buf + ReferrerLen);
768
769 send(MsgEnter, (uint16_t)((char*)buf - msg), msg);
770}
771
772
773bool ServerLink::readEnter(std::string& reason,

Callers 5

handleNewPlayerFunction · 0.80
joinInternetGame2Function · 0.80
BZAdminClientMethod · 0.80
handleNewPlayerFunction · 0.80
joinInternetGame2Function · 0.80

Calls 4

nboPackUInt8Function · 0.85
nboPackUInt16Function · 0.85
nboPackInt16Function · 0.85
getAppVersionFunction · 0.85

Tested by

no test coverage detected