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

Method sendCustomData

src/clientbase/ServerLink.cpp:971–982  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

969
970
971void ServerLink::sendCustomData(const std::string& key, const std::string& value) {
972 if (key.size() + value.size() >= MaxPacketLen) {
973 return;
974 }
975
976 char msg[MaxPacketLen];
977 void* buf = msg;
978 buf = nboPackUInt8(buf, uint8_t(getId()));
979 buf = nboPackStdString(buf, key);
980 buf = nboPackStdString(buf, value);
981 send(MsgPlayerData, (uint16_t)((char*)buf - msg), msg);
982}
983
984
985bool ServerLink::sendLuaData(PlayerId srcPlayerID, int16_t srcScriptID,

Callers 3

joinInternetGame2Function · 0.45
BZAdminClientMethod · 0.45
SetPlayerCustomDataMethod · 0.45

Calls 3

nboPackUInt8Function · 0.85
nboPackStdStringFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected