| 743 | |
| 744 | |
| 745 | void 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 | |
| 773 | bool ServerLink::readEnter(std::string& reason, |
no test coverage detected