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

Function DoMTGameOver

netcon/mtclient/mtclient.cpp:2280–2318  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2278}
2279
2280void DoMTGameOver(void) {
2281 int i;
2282
2283 DLLShowProgressScreen(TXT_PXO_WRITINGGAMESTATS, nullptr);
2284
2285 if (DLLNetgame->local_role != LR_SERVER) {
2286 return;
2287 }
2288 // Send all player info to the mastertracker
2289 for (i = 0; i < MAX_NET_PLAYERS; i++) {
2290 if ((DLLMNetPlayers[i].flags & NPF_CONNECTED) || (DLLMNetPlayers[i].flags & NPF_MT_WRITING_PILOT)) {
2291 if (!(DLLMNetPlayers[i].flags & NPF_MT_READING_PILOT)) {
2292 if (DLLMNetPlayers[i].flags & NPF_MT_HAS_PILOT_DATA) // Security will do this for us
2293 {
2294 strcpy(DLLMTPilotinfo[i].tracker_id, DLLMPlayers[i].tracker_id);
2295 strcpy(DLLMTPilotinfo[i].pilot_name, DLLMPlayers[i].callsign);
2296 DLLMTPilotinfo[i].kills = DLLMPlayers[i].kills;
2297 DLLMTPilotinfo[i].deaths = DLLMPlayers[i].deaths;
2298 DLLMTPilotinfo[i].suicides = DLLMPlayers[i].suicides;
2299 DLLMTPilotinfo[i].rank = DLLMPlayers[i].rank * 65536.0;
2300 DLLMTPilotinfo[i].lateral_thrust = DLLMPlayers[i].lateral_thrust;
2301 DLLMTPilotinfo[i].rotational_thrust = DLLMPlayers[i].rotational_thrust;
2302 DLLMTPilotinfo[i].online_time += DLLtimer_GetTime() - DLLMPlayers[i].time_in_game;
2303 DLLMTPilotinfo[i].sliding_pct = 0; // FIXME
2304 DLLmprintf(0, "Sending User info to the Mastertracker for Player[%d] %s (tid=%s).\n", i,
2305 DLLMTPilotinfo[i].pilot_name, DLLMTPilotinfo[i].tracker_id);
2306 DLLmprintf(0, "Sending pilot %d rank of %f\n", i, DLLMTPilotinfo[i].rank / 65536.0);
2307 SendD3PilotData(&DLLMTPilotinfo[i]);
2308 while (SendD3PilotData(nullptr) == 0) {
2309 DLLDescentDefer();
2310 }
2311 }
2312 }
2313 }
2314 }
2315 DLLShowProgressScreen(TXT_PXO_SENDINGGAMEOVER, nullptr);
2316 while (!SendGameOver())
2317 DLLDescentDefer();
2318}
2319
2320int MTVersionCheck() {
2321#ifdef WIN32

Callers 1

DLLFUNCCALL DLLMultiCallFunction · 0.85

Calls 2

SendD3PilotDataFunction · 0.85
SendGameOverFunction · 0.85

Tested by

no test coverage detected