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

Function doMessages

src/clientbase/playing.cpp:2207–2228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2205//
2206
2207void doMessages() {
2208 const int millisecToBlock = 0;
2209 if (!serverLink || serverError) {
2210 return;
2211 }
2212 char msgBuf[MaxPacketLen];
2213 while (true) {
2214 uint16_t len, code;
2215 const int status = serverLink->read(code, len, msgBuf, millisecToBlock);
2216 if (status == -2) {
2217 showError("Server communication error");
2218 serverError = true;
2219 break;
2220 }
2221 else if (status == 1) {
2222 handleServerMessage(true, code, len, msgBuf); // FIMXE: human = true ?
2223 }
2224 else {
2225 break;
2226 }
2227 }
2228}
2229
2230
2231void addMessage(const Player* player, const std::string& msg,

Callers 2

playingLoopFunction · 0.85
playingLoopFunction · 0.85

Calls 3

handleServerMessageFunction · 0.85
showErrorFunction · 0.50
readMethod · 0.45

Tested by

no test coverage detected