MCPcopy Create free account
hub / github.com/bwapi/bwapi / update

Method update

bwapi/BWAPI/Source/BWAPI/Server.cpp:225–258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

223 LocalFree(this->pSD);
224 }
225 void Server::update()
226 {
227 // Reset data coming in to server
228 data->stringCount = 0;
229 data->commandCount = 0;
230 data->unitCommandCount = 0;
231 data->shapeCount = 0;
232 if (gameTable && gameTableIndex >= 0)
233 {
234 gameTable->gameInstances[gameTableIndex].lastKeepAliveTime = GetTickCount();
235 gameTable->gameInstances[gameTableIndex].isConnected = connected;
236 }
237 if (connected)
238 {
239 // Update BWAPI Client
240 updateSharedMemory();
241 auto const onFrameStart = GetTickCount();
242 callOnFrame();
243 BroodwarImpl.setLastEventTime(GetTickCount() - onFrameStart);
244 processCommands();
245 }
246 else
247 {
248 // Update BWAPI DLL
249 BroodwarImpl.processEvents();
250
251 BroodwarImpl.events.clear();
252 if (!BroodwarImpl.startedClient)
253 checkForConnections();
254 }
255 // Reset data going out to client
256 data->eventCount = 0;
257 data->eventStringCount = 0;
258 }
259 bool Server::isConnected() const
260 {
261 return connected;

Callers 2

onGameEndMethod · 0.45
onMenuFrameMethod · 0.45

Calls 3

setLastEventTimeMethod · 0.80
processEventsMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected