MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / MultiDoFrame

Function MultiDoFrame

Descent3/multi.cpp:2234–2269  ·  view source on GitHub ↗

called once a frame on client and server. NOTE: only servers (game masters) check for listen connections.

Source from the content-addressed store, hash-verified

2232// called once a frame on client and server. NOTE: only servers (game masters) check for
2233// listen connections.
2234void MultiDoFrame() {
2235 if (!(Game_mode & GM_MULTI))
2236 return;
2237
2238 ScoreAPIFrameInterval();
2239
2240 static int debug_id = -2;
2241 static float last_game_time = 99999999.9f;
2242
2243 CallGameDLL(EVT_GAME_INTERVAL, &DLLInfo);
2244
2245 if (Netgame.local_role == LR_SERVER)
2246 MultiDoServerFrame();
2247 else {
2248 if (debug_id == -2) {
2249 debug_id = DebugGraph_Add(0.0f, 10000.0f, "Ping", DGF_MULTIPLAYER);
2250 }
2251 if (debug_id >= 0) {
2252 if (last_game_time > Gametime) {
2253 // reset last_game_time, we must have started a new level
2254 last_game_time = Gametime;
2255 }
2256
2257 float next_time = last_game_time + 0.3f; // update every 1/3 second
2258 if (Gametime >= next_time) {
2259 last_game_time = Gametime;
2260 if (NetPlayers[Player_num].flags & NPF_CONNECTED && NetPlayers[Player_num].sequence == NETSEQ_PLAYING) {
2261 DebugGraph_Update(debug_id, NetPlayers[Player_num].ping_time * 1000.0f);
2262 }
2263 }
2264 }
2265
2266 MultiDoClientFrame();
2267 // Verify object list
2268 }
2269}
2270
2271// Returns to the slot number of the player that the passed in address belongs to
2272int MultiMatchPlayerToAddress(network_address *from_addr) {

Callers 1

GameFrameFunction · 0.85

Calls 6

ScoreAPIFrameIntervalFunction · 0.85
CallGameDLLFunction · 0.85
MultiDoServerFrameFunction · 0.85
DebugGraph_AddFunction · 0.85
DebugGraph_UpdateFunction · 0.85
MultiDoClientFrameFunction · 0.85

Tested by

no test coverage detected