Debian Codegraph @

netgames/roboanarchy/roboanarchy.cpp

raw symbols SCIP
1 /*
2 * Descent 3
3 * Copyright (C) 2024 Parallax Software
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 --- HISTORICAL COMMENTS FOLLOW ---
19
20 * $Logfile: /DescentIII/Main/roboanarchy/roboanarchy.cpp $
21 * $Revision: 1.1.1.1 $
22 * $Date: 2003/08/26 03:59:03 $
23 * $Author: kevinb $
24 *
25 * <insert description of file here>
26 *
27 * $Log: roboanarchy.cpp,v $
28 * Revision 1.1.1.1 2003/08/26 03:59:03 kevinb
29 * initial 1.5 import
30 *
31 *
32 * 43 10/21/99 3:20p Kevin
33 * Macintosh merge
34 *
35 * 42 7/12/99 1:22p Jeff
36 * updated for new netflags
37 *
38 * 41 7/11/99 6:45p Jeff
39 * cleaner plr if the list is too long
40 *
41 * 40 5/23/99 3:04a Jason
42 * fixed bug with player rankings not being updated correctly
43 *
44 * 39 5/12/99 11:28a Jeff
45 * added sourcesafe comment block
46 *
47 * $NoKeywords: $
48 */
49
50 #include <string.h>
51 #include <stdio.h>
52 #include <stdlib.h>
53 #include "idmfc.h"cxx . . $ `<file>/netgames/includes/idmfc.h`/
54 #include "roboAnarchy.h"cxx . . $ `<file>/netgames/roboanarchy/roboAnarchy.h`/
55 #include "roboanarchystr.h"cxx . . $ `<file>/netgames/roboanarchy/roboanarchystr.h`/
56
57 #include <algorithm>
58
59 IDMFCcxx . . $ IDMFC# *DMFCBasecxx . . $ DMFCBase. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
60 static IDmfcStatscxx . . $ IDmfcStats# *dstatcxx . . $ dstat. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
61
62 static int SortedPlayerscxx . . $ SortedPlayers.[MAX_PLAYER_RECORDScxx . . $ `netgames/includes/DMFC.h:526:9`!]; // sorted player nums
63 static bool DisplayScoreScreencxx . . $ DisplayScoreScreen.;
64 static int Highlight_bmpcxx . . $ Highlight_bmp. = -1;
65
66 #define AHD_NONEcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:66:9`! 0
67 #define AHD_SCOREcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:67:9`! 1
68 #define AHD_EFFICIENCYcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:68:9`! 2
69 #define ACM_PLAYERCOLORcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:69:9`! 0
70 #define ACM_NORMALcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:70:9`! 1
71 static uint8_tcxx . . $ uint8_t# Anarchy_hud_displaycxx . . $ Anarchy_hud_display. = AHD_SCOREcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:67:9`!;
72 static uint8_tcxx . . $ uint8_t# HUD_color_modelcxx . . $ HUD_color_model. = ACM_PLAYERCOLORcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:69:9`!;
73 static bool display_my_welcomecxx . . $ display_my_welcome. = false;
74
75 static void DisplayHUDScorescxx . . $ DisplayHUDScores(c7a20e4e05358911).(struct tHUDItemcxx . . $ tHUDItem# *hitem);
76 static void DisplayScorescxx . . $ DisplayScores(49f6e7a06ebc5aa8).(void);
77 static void DisplayWelcomeMessagecxx . . $ DisplayWelcomeMessage(d4f767463ce0a6b3).(int player_num);
78 static void SaveStatsToFilecxx . . $ SaveStatsToFile(fda57c8427c60377).(char *filename);
79 static void SwitchHUDColorcxx . . $ SwitchHUDColor(d4f767463ce0a6b3).(int i);
80 static void SwitchAnarchyScorescxx . . $ SwitchAnarchyScores(d4f767463ce0a6b3).(int i);
81
82 ///////////////////////////////////////////////
83 // localization info
84 static char **StringTablecxx . . $ StringTable.;
85 static int StringTableSizecxx . . $ StringTableSize. = 0;
86 static const char *_ErrorStringcxx . . $ _ErrorString. = "Missing String";
87 const char *GetStringcxx . . $ GetString(f7ae7e56280f18ae).(int d) {
88 if ((d < 0) || (d >= StringTableSizecxx . . $ StringTableSize.))
89 return _ErrorStringcxx . . $ _ErrorString.;
90 else
91 return StringTablecxx . . $ StringTable.[d];
92 }
93 ///////////////////////////////////////////////
94
95 void SwitchAnarchyScorescxx . . $ SwitchAnarchyScores(d4f767463ce0a6b3).(int i) {
96 if (i < 0)
97 i = 0;
98 if (i > 2)
99 i = 2;
100
101 Anarchy_hud_displaycxx . . $ Anarchy_hud_display. = i;
102
103 switch (i) {
104 case AHD_NONEcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:66:9`!:
105 DLLAddHUDMessage(TXT_HUDD_NONEcxx . . $ `netgames/roboanarchy/roboanarchystr.h:49:9`!);
106 break;
107 case AHD_SCOREcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:67:9`!:
108 DLLAddHUDMessage(TXT_HUDD_SCOREScxx . . $ `netgames/roboanarchy/roboanarchystr.h:50:9`!);
109 break;
110 case AHD_EFFICIENCYcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:68:9`!:
111 DLLAddHUDMessage(TXT_HUDD_EFFICcxx . . $ `netgames/roboanarchy/roboanarchystr.h:51:9`!);
112 break;
113 };
114 }
115
116 // This function gets called by the game when it wants to learn some info about the game
117 void DLLFUNCCALLcxx . . $ `lib/module.h:93:10`! DLLGetGameInfocxx . . $ DLLGetGameInfo(e5c6dce1fbda187a).(tDLLOptionscxx . . $ tDLLOptions# *options) {
118 options->flagscxx . . $ tDLLOptions#flags. = DOF_MAXTEAMScxx . . $ `netgames/includes/gamedll_header.h:105:9`!;
119 options->max_teamscxx . . $ tDLLOptions#max_teams. = 1;
120 strcpy(options->game_namecxx . . $ tDLLOptions#game_name., "Anarchy");
121 strcpy(options->requirementscxx . . $ tDLLOptions#requirements., "COOP");
122 }
123
124 // Initializes the game function pointers
125 void DLLFUNCCALLcxx . . $ `lib/module.h:93:10`! DLLGameInitcxx . . $ DLLGameInit(937c1f75cb8fa6b1).(int *api_func, uint8_tcxx . . $ uint8_t# *all_ok, int num_teams_to_use) {
126 *all_ok = 1;
127 DMFCBasecxx . . $ DMFCBase. = CreateDMFC();
128 if (!DMFCBasecxx . . $ DMFCBase.) {
129 *all_ok = 0;
130 return;
131 }
132
133 dstatcxx . . $ dstat. = CreateDmfcStats();
134 if (!dstatcxx . . $ dstat.) {
135 *all_ok = 0;
136 return;
137 }
138
139 DMFCBasecxx . . $ DMFCBase.->LoadFunctionscxx . . $ IDMFC#LoadFunctions(11b0e290e57a7e53).(api_func);
140
141 // Setup the event handlers that we handle
142 DMFCBasecxx . . $ DMFCBase.->Set_OnKeypresscxx . . $ IDMFC#Set_OnKeypress(94eb4457dc8d4d10).(OnKeypresscxx . . $ OnKeypress(d4f767463ce0a6b3).);
143 DMFCBasecxx . . $ DMFCBase.->Set_OnHUDIntervalcxx . . $ IDMFC#Set_OnHUDInterval(964b12a25712bdc3).(OnHUDIntervalcxx . . $ OnHUDInterval(49f6e7a06ebc5aa8).);
144 DMFCBasecxx . . $ DMFCBase.->Set_OnIntervalcxx . . $ IDMFC#Set_OnInterval(964b12a25712bdc3).(OnIntervalcxx . . $ OnInterval(49f6e7a06ebc5aa8).);
145 DMFCBasecxx . . $ DMFCBase.->Set_OnClientPlayerKilledcxx . . $ IDMFC#Set_OnClientPlayerKilled(7da43329b4117518).(OnClientPlayerKilledcxx . . $ OnClientPlayerKilled(766a1b7183ffa4b4).);
146 DMFCBasecxx . . $ DMFCBase.->Set_OnClientPlayerEntersGamecxx . . $ IDMFC#Set_OnClientPlayerEntersGame(94eb4457dc8d4d10).(OnClientPlayerEntersGamecxx . . $ OnClientPlayerEntersGame(d4f767463ce0a6b3).);
147 DMFCBasecxx . . $ DMFCBase.->Set_OnClientLevelStartcxx . . $ IDMFC#Set_OnClientLevelStart(964b12a25712bdc3).(OnClientLevelStartcxx . . $ OnClientLevelStart(49f6e7a06ebc5aa8).);
148 DMFCBasecxx . . $ DMFCBase.->Set_OnClientLevelEndcxx . . $ IDMFC#Set_OnClientLevelEnd(964b12a25712bdc3).(OnClientLevelEndcxx . . $ OnClientLevelEnd(49f6e7a06ebc5aa8).);
149 DMFCBasecxx . . $ DMFCBase.->Set_OnServerGameCreatedcxx . . $ IDMFC#Set_OnServerGameCreated(964b12a25712bdc3).(OnServerGameCreatedcxx . . $ OnServerGameCreated(49f6e7a06ebc5aa8).);
150 DMFCBasecxx . . $ DMFCBase.->Set_OnPLRIntervalcxx . . $ IDMFC#Set_OnPLRInterval(964b12a25712bdc3).(OnPLRIntervalcxx . . $ OnPLRInterval(49f6e7a06ebc5aa8).);
151 DMFCBasecxx . . $ DMFCBase.->Set_OnPLRInitcxx . . $ IDMFC#Set_OnPLRInit(964b12a25712bdc3).(OnPLRInitcxx . . $ OnPLRInit(49f6e7a06ebc5aa8).);
152 DMFCBasecxx . . $ DMFCBase.->Set_OnSaveStatsToFilecxx . . $ IDMFC#Set_OnSaveStatsToFile(964b12a25712bdc3).(OnSaveStatsToFilecxx . . $ OnSaveStatsToFile(49f6e7a06ebc5aa8).);
153 DMFCBasecxx . . $ DMFCBase.->Set_OnLevelEndSaveStatsToFilecxx . . $ IDMFC#Set_OnLevelEndSaveStatsToFile(964b12a25712bdc3).(OnLevelEndSaveStatsToFilecxx . . $ OnLevelEndSaveStatsToFile(49f6e7a06ebc5aa8).);
154 DMFCBasecxx . . $ DMFCBase.->Set_OnDisconnectSaveStatsToFilecxx . . $ IDMFC#Set_OnDisconnectSaveStatsToFile(964b12a25712bdc3).(OnDisconnectSaveStatsToFilecxx . . $ OnDisconnectSaveStatsToFile(49f6e7a06ebc5aa8).);
155 DMFCBasecxx . . $ DMFCBase.->Set_OnPrintScorescxx . . $ IDMFC#Set_OnPrintScores(94eb4457dc8d4d10).(OnPrintScorescxx . . $ OnPrintScores(d4f767463ce0a6b3).);
156
157 DLLCreateStringTable("Anarchy.str", &StringTablecxx . . $ StringTable., &StringTableSizecxx . . $ StringTableSize.);
158 mprintfcxx . . $ `netgames/includes/DMFC.h:423:9`!(0, "%d strings loaded from string table\n", StringTableSize);
159 if (!StringTableSizecxx . . $ StringTableSize.) {
160 *all_ok = 0;
161 return;
162 }
163
164 AnarchyGameInitcxx . . $ AnarchyGameInit(d4f767463ce0a6b3).(1);
165
166 // add the death and suicide messages
167 DMFCBasecxx . . $ DMFCBase.->AddDeathMessagecxx . . $ IDMFC#AddDeathMessage(90ef5b561fbcb8de).(TXT_DEATH1cxx . . $ `netgames/roboanarchy/roboanarchystr.h:24:9`!, true);
168 DMFCBasecxx . . $ DMFCBase.->AddDeathMessagecxx . . $ IDMFC#AddDeathMessage(90ef5b561fbcb8de).(TXT_DEATH2cxx . . $ `netgames/roboanarchy/roboanarchystr.h:25:9`!, true);
169 DMFCBasecxx . . $ DMFCBase.->AddDeathMessagecxx . . $ IDMFC#AddDeathMessage(90ef5b561fbcb8de).(TXT_DEATH3cxx . . $ `netgames/roboanarchy/roboanarchystr.h:26:9`!, false);
170 DMFCBasecxx . . $ DMFCBase.->AddDeathMessagecxx . . $ IDMFC#AddDeathMessage(90ef5b561fbcb8de).(TXT_DEATH4cxx . . $ `netgames/roboanarchy/roboanarchystr.h:27:9`!, false);
171 DMFCBasecxx . . $ DMFCBase.->AddDeathMessagecxx . . $ IDMFC#AddDeathMessage(90ef5b561fbcb8de).(TXT_DEATH5cxx . . $ `netgames/roboanarchy/roboanarchystr.h:28:9`!, true);
172 DMFCBasecxx . . $ DMFCBase.->AddDeathMessagecxx . . $ IDMFC#AddDeathMessage(90ef5b561fbcb8de).(TXT_DEATH6cxx . . $ `netgames/roboanarchy/roboanarchystr.h:29:9`!, true);
173 DMFCBasecxx . . $ DMFCBase.->AddDeathMessagecxx . . $ IDMFC#AddDeathMessage(90ef5b561fbcb8de).(TXT_DEATH7cxx . . $ `netgames/roboanarchy/roboanarchystr.h:30:9`!, false);
174 DMFCBasecxx . . $ DMFCBase.->AddDeathMessagecxx . . $ IDMFC#AddDeathMessage(90ef5b561fbcb8de).(TXT_DEATH8cxx . . $ `netgames/roboanarchy/roboanarchystr.h:31:9`!, true);
175 DMFCBasecxx . . $ DMFCBase.->AddDeathMessagecxx . . $ IDMFC#AddDeathMessage(90ef5b561fbcb8de).(TXT_DEATH9cxx . . $ `netgames/roboanarchy/roboanarchystr.h:32:9`!, true);
176 DMFCBasecxx . . $ DMFCBase.->AddDeathMessagecxx . . $ IDMFC#AddDeathMessage(90ef5b561fbcb8de).(TXT_DEATH10cxx . . $ `netgames/roboanarchy/roboanarchystr.h:33:9`!, true);
177
178 DMFCBasecxx . . $ DMFCBase.->AddSuicideMessagecxx . . $ IDMFC#AddSuicideMessage(85c52e162fed56f9).(TXT_SUICIDE1cxx . . $ `netgames/roboanarchy/roboanarchystr.h:34:9`!);
179 DMFCBasecxx . . $ DMFCBase.->AddSuicideMessagecxx . . $ IDMFC#AddSuicideMessage(85c52e162fed56f9).(TXT_SUICIDE2cxx . . $ `netgames/roboanarchy/roboanarchystr.h:35:9`!);
180 DMFCBasecxx . . $ DMFCBase.->AddSuicideMessagecxx . . $ IDMFC#AddSuicideMessage(85c52e162fed56f9).(TXT_SUICIDE3cxx . . $ `netgames/roboanarchy/roboanarchystr.h:36:9`!);
181 DMFCBasecxx . . $ DMFCBase.->AddSuicideMessagecxx . . $ IDMFC#AddSuicideMessage(85c52e162fed56f9).(TXT_SUICIDE4cxx . . $ `netgames/roboanarchy/roboanarchystr.h:37:9`!);
182 DMFCBasecxx . . $ DMFCBase.->AddSuicideMessagecxx . . $ IDMFC#AddSuicideMessage(85c52e162fed56f9).(TXT_SUICIDE5cxx . . $ `netgames/roboanarchy/roboanarchystr.h:38:9`!);
183 DMFCBasecxx . . $ DMFCBase.->AddSuicideMessagecxx . . $ IDMFC#AddSuicideMessage(85c52e162fed56f9).(TXT_SUICIDE6cxx . . $ `netgames/roboanarchy/roboanarchystr.h:39:9`!);
184
185 DMFCBasecxx . . $ DMFCBase.->SetNumberOfTeamscxx . . $ IDMFC#SetNumberOfTeams(d4f767463ce0a6b3).(1);
186
187 netgame_infocxx . . $ netgame_info# *Netgame = DMFCBasecxx . . $ DMFCBase.->GetNetgameInfocxx . . $ IDMFC#GetNetgameInfo(242e78cd5130aa12).();
188 Netgame->flagscxx . . $ netgame_info#flags. |= (NF_DAMAGE_FRIENDLYcxx . . $ `Descent3/multi_external.h:235:9`! | NF_USE_ROBOTScxx . . $ `Descent3/multi_external.h:228:9`! | NF_TRACK_RANKcxx . . $ `Descent3/multi_external.h:243:9`!);
189
190 Highlight_bmpcxx . . $ Highlight_bmp. = DLLbm_AllocBitmap(32, 32, 0);
191 if (Highlight_bmpcxx . . $ Highlight_bmp. > BAD_BITMAP_HANDLEcxx . . $ `lib/bitmap.h:42:9`!) {
192 uint16_tcxx . . $ uint16_t# *data = DLLbm_data(Highlight_bmpcxx . . $ Highlight_bmp., 0);
193 if (!data) {
194 // bail on out of here
195 *all_ok = 0;
196 return;
197 }
198 for (int x = 0; x < 32 * 32; x++) {
199 data[x] = GR_RGB16cxx . . $ GR_RGB16(6461fafb79bad5b9).(50, 50, 50) | OPAQUE_FLAGcxx . . $ `lib/grdefs.h:72:9`!;
200 }
201 }
202
203 DMFCBasecxx . . $ DMFCBase.->AddHUDItemCallbackcxx . . $ IDMFC#AddHUDItemCallback(97c9b33f56b4265c).(HI_TEXTcxx . . $ `netgames/includes/DMFC.h:440:9`!, DisplayHUDScorescxx . . $ DisplayHUDScores(c7a20e4e05358911).);
204
205 DisplayScoreScreencxx . . $ DisplayScoreScreen. = false;
206 }
207 // Called when the DLL is shutdown
208 void DLLFUNCCALLcxx . . $ `lib/module.h:93:10`! DLLGameClosecxx . . $ DLLGameClose(49f6e7a06ebc5aa8).() {
209 if (Highlight_bmpcxx . . $ Highlight_bmp. > BAD_BITMAP_HANDLEcxx . . $ `lib/bitmap.h:42:9`!)
210 DLLbm_FreeBitmap(Highlight_bmpcxx . . $ Highlight_bmp.);
211
212 DLLDestroyStringTable(StringTablecxx . . $ StringTable., StringTableSizecxx . . $ StringTableSize.);
213
214 if (dstatcxx . . $ dstat.) {
215 dstatcxx . . $ dstat.->DestroyPointercxx . . $ IObject#DestroyPointer(49f6e7a06ebc5aa8).();
216 dstatcxx . . $ dstat. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
217 }
218
219 if (DMFCBasecxx . . $ DMFCBase.) {
220 AnarchyGameClosecxx . . $ AnarchyGameClose(49f6e7a06ebc5aa8).();
221 DMFCBasecxx . . $ DMFCBase.->GameClosecxx . . $ IDMFC#GameClose(49f6e7a06ebc5aa8).();
222 DMFCBasecxx . . $ DMFCBase.->DestroyPointercxx . . $ IObject#DestroyPointer(49f6e7a06ebc5aa8).();
223 DMFCBasecxx . . $ DMFCBase. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
224 }
225 }
226
227 void DetermineScorecxx . . $ DetermineScore(74c02bb7c84e7fae).(int precord_num, int column_num, char *buffer, int buffer_size) {
228 player_recordcxx . . $ player_record# *pr = DMFCBasecxx . . $ DMFCBase.->GetPlayerRecordcxx . . $ IDMFC#GetPlayerRecord(6359c6f28dd028ae).(precord_num);
229 if (!pr || pr->statecxx . . $ player_record#state. == STATE_EMPTYcxx . . $ STATE_EMPTY.) {
230 buffer[0] = '\0';
231 return;
232 }
233
234 snprintf(buffer, buffer_size, "%d", pr->dstatscxx . . $ player_record#dstats..killscxx . . $ t_dstat#kills.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!] - pr->dstatscxx . . $ player_record#dstats..suicidescxx . . $ t_dstat#suicides.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!]);
235 }
236
237 void AnarchyGameClosecxx . . $ AnarchyGameClose(49f6e7a06ebc5aa8).(void) {}
238
239 // DMFCApp::GameInit
240 //
241 // Sets up all the DLL functions and pointers and preps the class for use. This ABSOLUTLY must be
242 // called, so if you override DMFCApp::GameInit, make sure that you put a call to this somewhere in
243 // the override.
244 void AnarchyGameInitcxx . . $ AnarchyGameInit(d4f767463ce0a6b3).(int teams) {
245 // add the anarchy menu/submenus
246 IMenuItemcxx . . $ IMenuItem# *lev1, *lev2;
247
248 lev1 = CreateMenuItemWArgs("Anarchy", MIT_NORMALcxx . . $ `netgames/includes/DMFC.h:513:9`!, 0, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
249
250 lev2 = CreateMenuItemWArgs(TXT_MNU_HUDSTYLEcxx . . $ `netgames/roboanarchy/roboanarchystr.h:52:9`!, MIT_STATEcxx . . $ `netgames/includes/DMFC.h:515:9`!, 0, SwitchAnarchyScorescxx . . $ SwitchAnarchyScores(d4f767463ce0a6b3).);
251 lev2->SetStateItemListcxx . . $ IMenuItem#SetStateItemList(d49b86907ad5c83b).(3, TXT_NONEcxx . . $ `netgames/roboanarchy/roboanarchystr.h:53:9`!, TXT_SCOREHDcxx . . $ `netgames/roboanarchy/roboanarchystr.h:54:9`!, TXT_EFFICIENCYcxx . . $ `netgames/roboanarchy/roboanarchystr.h:55:9`!);
252 lev2->SetStatecxx . . $ IMenuItem#SetState(d4f767463ce0a6b3).(1);
253 lev1->AddSubMenucxx . . $ IMenuItem#AddSubMenu(7cad07ba2f70ae18).(lev2);
254
255 lev2 = CreateMenuItemWArgs(TXT_MNU_HUDCOLORcxx . . $ `netgames/roboanarchy/roboanarchystr.h:56:9`!, MIT_STATEcxx . . $ `netgames/includes/DMFC.h:515:9`!, 0, SwitchHUDColorcxx . . $ SwitchHUDColor(d4f767463ce0a6b3).);
256 lev2->SetStateItemListcxx . . $ IMenuItem#SetStateItemList(d49b86907ad5c83b).(2, TXT_PLAYERCOLORScxx . . $ `netgames/roboanarchy/roboanarchystr.h:57:9`!, TXT_NORMALcxx . . $ `netgames/roboanarchy/roboanarchystr.h:58:9`!);
257 lev2->SetStatecxx . . $ IMenuItem#SetState(d4f767463ce0a6b3).(HUD_color_modelcxx . . $ HUD_color_model.);
258 lev1->AddSubMenucxx . . $ IMenuItem#AddSubMenu(7cad07ba2f70ae18).(lev2);
259
260 lev2 = DMFCBasecxx . . $ DMFCBase.->GetOnScreenMenucxx . . $ IDMFC#GetOnScreenMenu(8efbf9c7cdf9c614).();
261 lev2->AddSubMenucxx . . $ IMenuItem#AddSubMenu(7cad07ba2f70ae18).(lev1);
262
263 DMFCBasecxx . . $ DMFCBase.->GameInitcxx . . $ IDMFC#GameInit(d4f767463ce0a6b3).(teams);
264
265 // Initialize the Stats Manager
266 // ----------------------------
267
268 tDmfcStatsInitcxx . . $ tDmfcStatsInit# tsi;
269 tDmfcStatsColumnInfocxx . . $ tDmfcStatsColumnInfo# pl_col[6];
270 char gname[20];
271 strcpy(gname, "Anarchy");
272
273 tsi.flagscxx . . $ tDmfcStatsInit#flags. = DSIF_SHOW_PICcxx . . $ `netgames/includes/DMFC.h:619:9`! | DSIF_SHOW_OBSERVERICONcxx . . $ `netgames/includes/DMFC.h:627:9`!;
274 tsi.cColumnCountDetailedcxx . . $ tDmfcStatsInit#cColumnCountDetailed. = 0;
275 tsi.cColumnCountPlayerListcxx . . $ tDmfcStatsInit#cColumnCountPlayerList. = 6;
276 tsi.clbDetailedColumncxx . . $ tDmfcStatsInit#clbDetailedColumn. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
277 tsi.clbDetailedColumnBMPcxx . . $ tDmfcStatsInit#clbDetailedColumnBMP. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
278 tsi.clbPlayerColumncxx . . $ tDmfcStatsInit#clbPlayerColumn. = DetermineScorecxx . . $ DetermineScore(74c02bb7c84e7fae).;
279 tsi.clbPlayerColumnBMPcxx . . $ tDmfcStatsInit#clbPlayerColumnBMP. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
280 tsi.DetailedColumnscxx . . $ tDmfcStatsInit#DetailedColumns. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
281 tsi.GameNamecxx . . $ tDmfcStatsInit#GameName. = gname;
282 tsi.MaxNumberDisplayedcxx . . $ tDmfcStatsInit#MaxNumberDisplayed. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
283 tsi.PlayerListColumnscxx . . $ tDmfcStatsInit#PlayerListColumns. = pl_col;
284 tsi.SortedPlayerRecordscxx . . $ tDmfcStatsInit#SortedPlayerRecords. = SortedPlayerscxx . . $ SortedPlayers.;
285
286 pl_col[0].color_typecxx . . $ tDmfcStatsColumnInfo#color_type. = DSCOLOR_SHIPCOLORcxx . . $ DSCOLOR_SHIPCOLOR.;
287 strcpy(pl_col[0].titlecxx . . $ tDmfcStatsColumnInfo#title., TXT_PILOTcxx . . $ `netgames/roboanarchy/roboanarchystr.h:40:9`!);
288 pl_col[0].typecxx . . $ tDmfcStatsColumnInfo#type. = DSCOL_PILOT_NAMEcxx . . $ DSCOL_PILOT_NAME.;
289 pl_col[0].widthcxx . . $ tDmfcStatsColumnInfo#width. = 120;
290
291 pl_col[1].color_typecxx . . $ tDmfcStatsColumnInfo#color_type. = DSCOLOR_SHIPCOLORcxx . . $ DSCOLOR_SHIPCOLOR.;
292 strcpy(pl_col[1].titlecxx . . $ tDmfcStatsColumnInfo#title., TXT_SCOREcxx . . $ `netgames/roboanarchy/roboanarchystr.h:44:9`!);
293 pl_col[1].typecxx . . $ tDmfcStatsColumnInfo#type. = DSCOL_CUSTOMcxx . . $ DSCOL_CUSTOM.;
294 pl_col[1].widthcxx . . $ tDmfcStatsColumnInfo#width. = 50;
295
296 pl_col[2].color_typecxx . . $ tDmfcStatsColumnInfo#color_type. = DSCOLOR_SHIPCOLORcxx . . $ DSCOLOR_SHIPCOLOR.;
297 strcpy(pl_col[2].titlecxx . . $ tDmfcStatsColumnInfo#title., TXT_KILLS_SHORTcxx . . $ `netgames/roboanarchy/roboanarchystr.h:69:9`!);
298 pl_col[2].typecxx . . $ tDmfcStatsColumnInfo#type. = DSCOL_KILLS_LEVELcxx . . $ DSCOL_KILLS_LEVEL.;
299 pl_col[2].widthcxx . . $ tDmfcStatsColumnInfo#width. = 50;
300
301 pl_col[3].color_typecxx . . $ tDmfcStatsColumnInfo#color_type. = DSCOLOR_SHIPCOLORcxx . . $ DSCOLOR_SHIPCOLOR.;
302 strcpy(pl_col[3].titlecxx . . $ tDmfcStatsColumnInfo#title., TXT_DEATHS_SHORTcxx . . $ `netgames/roboanarchy/roboanarchystr.h:70:9`!);
303 pl_col[3].typecxx . . $ tDmfcStatsColumnInfo#type. = DSCOL_DEATHS_LEVELcxx . . $ DSCOL_DEATHS_LEVEL.;
304 pl_col[3].widthcxx . . $ tDmfcStatsColumnInfo#width. = 60;
305
306 pl_col[4].color_typecxx . . $ tDmfcStatsColumnInfo#color_type. = DSCOLOR_SHIPCOLORcxx . . $ DSCOLOR_SHIPCOLOR.;
307 strcpy(pl_col[4].titlecxx . . $ tDmfcStatsColumnInfo#title., TXT_SUICIDES_SHORTcxx . . $ `netgames/roboanarchy/roboanarchystr.h:71:9`!);
308 pl_col[4].typecxx . . $ tDmfcStatsColumnInfo#type. = DSCOL_SUICIDES_LEVELcxx . . $ DSCOL_SUICIDES_LEVEL.;
309 pl_col[4].widthcxx . . $ tDmfcStatsColumnInfo#width. = 65;
310
311 pl_col[5].color_typecxx . . $ tDmfcStatsColumnInfo#color_type. = DSCOLOR_SHIPCOLORcxx . . $ DSCOLOR_SHIPCOLOR.;
312 strcpy(pl_col[5].titlecxx . . $ tDmfcStatsColumnInfo#title., TXT_PINGcxx . . $ `netgames/roboanarchy/roboanarchystr.h:59:9`!);
313 pl_col[5].typecxx . . $ tDmfcStatsColumnInfo#type. = DSCOL_PINGcxx . . $ DSCOL_PING.;
314 pl_col[5].widthcxx . . $ tDmfcStatsColumnInfo#width. = 40;
315
316 dstatcxx . . $ dstat.->Initializecxx . . $ IDmfcStats#Initialize(645910a8ad01b658).(&tsi);
317 }
318
319 void OnHUDIntervalcxx . . $ OnHUDInterval(49f6e7a06ebc5aa8).(void) {
320 dstatcxx . . $ dstat.->DoFramecxx . . $ IDmfcStats#DoFrame(49f6e7a06ebc5aa8).();
321 DMFCBasecxx . . $ DMFCBase.->DisplayOutrageLogocxx . . $ IDMFC#DisplayOutrageLogo(49f6e7a06ebc5aa8).();
322 DMFCBasecxx . . $ DMFCBase.->OnHUDIntervalcxx . . $ IDMFC#OnHUDInterval(49f6e7a06ebc5aa8).();
323 }
324
325 void OnIntervalcxx . . $ OnInterval(49f6e7a06ebc5aa8).(void) {
326 DMFCBasecxx . . $ DMFCBase.->GetSortedPlayerSlotscxx . . $ IDMFC#GetSortedPlayerSlots(621ccea12ecf5b06).(SortedPlayerscxx . . $ SortedPlayers., MAX_PLAYER_RECORDScxx . . $ `netgames/includes/DMFC.h:526:9`!);
327 DMFCBasecxx . . $ DMFCBase.->OnIntervalcxx . . $ IDMFC#OnInterval(49f6e7a06ebc5aa8).();
328 }
329
330 void OnKeypresscxx . . $ OnKeypress(d4f767463ce0a6b3).(int key) {
331 dllinfocxx . . $ dllinfo# *Data = DMFCBasecxx . . $ DMFCBase.->GetDLLInfoCallDatacxx . . $ IDMFC#GetDLLInfoCallData(4458c5bdce97a5c3).();
332
333 switch (key) {
334 case K_F7cxx . . $ `netgames/includes/DMFCKeyCodes.h:118:9`!:
335 DisplayScoreScreencxx . . $ DisplayScoreScreen. = !DisplayScoreScreencxx . . $ DisplayScoreScreen.;
336 DMFCBasecxx . . $ DMFCBase.->EnableOnScreenMenucxx . . $ IDMFC#EnableOnScreenMenu(b45ddcbc8423892c).(false);
337 dstatcxx . . $ dstat.->Enablecxx . . $ IDmfcStats#Enable(b45ddcbc8423892c).(DisplayScoreScreencxx . . $ DisplayScoreScreen.);
338 break;
339 case K_PAGEDOWNcxx . . $ `netgames/includes/DMFCKeyCodes.h:147:9`!:
340 if (DisplayScoreScreencxx . . $ DisplayScoreScreen.) {
341 dstatcxx . . $ dstat.->ScrollDowncxx . . $ IDmfcStats#ScrollDown(49f6e7a06ebc5aa8).();
342 Data->iRetcxx . . $ dllinfo#$anonymous_type_0#iRet. = 1;
343 }
344 break;
345 case K_PAGEUPcxx . . $ `netgames/includes/DMFCKeyCodes.h:144:9`!:
346 if (DisplayScoreScreencxx . . $ DisplayScoreScreen.) {
347 dstatcxx . . $ dstat.->ScrollUpcxx . . $ IDmfcStats#ScrollUp(49f6e7a06ebc5aa8).();
348 Data->iRetcxx . . $ dllinfo#$anonymous_type_0#iRet. = 1;
349 }
350 break;
351 case K_F6cxx . . $ `netgames/includes/DMFCKeyCodes.h:117:9`!:
352 DisplayScoreScreencxx . . $ DisplayScoreScreen. = false;
353 dstatcxx . . $ dstat.->Enablecxx . . $ IDmfcStats#Enable(b45ddcbc8423892c).(false);
354 break;
355 case K_ESCcxx . . $ `netgames/includes/DMFCKeyCodes.h:97:9`!:
356 if (DisplayScoreScreencxx . . $ DisplayScoreScreen.) {
357 dstatcxx . . $ dstat.->Enablecxx . . $ IDmfcStats#Enable(b45ddcbc8423892c).(false);
358 DisplayScoreScreencxx . . $ DisplayScoreScreen. = false;
359 Data->iRetcxx . . $ dllinfo#$anonymous_type_0#iRet. = 1;
360 }
361 break;
362 }
363
364 DMFCBasecxx . . $ DMFCBase.->OnKeypresscxx . . $ IDMFC#OnKeypress(d4f767463ce0a6b3).(key);
365 }
366
367 // The server has just started, so clear out all the stats and game info
368 void OnServerGameCreatedcxx . . $ OnServerGameCreated(49f6e7a06ebc5aa8).(void) { DMFCBasecxx . . $ DMFCBase.->OnServerGameCreatedcxx . . $ IDMFC#OnServerGameCreated(49f6e7a06ebc5aa8).(); }
369
370 // The server has started a new level, so clear out any scores needed to be reset
371 void OnClientLevelStartcxx . . $ OnClientLevelStart(49f6e7a06ebc5aa8).(void) {
372 for (int i = 0; i < MAX_PLAYER_RECORDScxx . . $ `netgames/includes/DMFC.h:526:9`!; i++) {
373 SortedPlayerscxx . . $ SortedPlayers.[i] = -1;
374 }
375
376 DMFCBasecxx . . $ DMFCBase.->OnClientLevelStartcxx . . $ IDMFC#OnClientLevelStart(49f6e7a06ebc5aa8).();
377 }
378
379 void OnClientLevelEndcxx . . $ OnClientLevelEnd(49f6e7a06ebc5aa8).(void) { DMFCBasecxx . . $ DMFCBase.->OnClientLevelEndcxx . . $ IDMFC#OnClientLevelEnd(49f6e7a06ebc5aa8).(); }
380
381 // A new player has entered the game, zero their stats out
382 void OnClientPlayerEntersGamecxx . . $ OnClientPlayerEntersGame(d4f767463ce0a6b3).(int player_num) {
383 DMFCBasecxx . . $ DMFCBase.->OnClientPlayerEntersGamecxx . . $ IDMFC#OnClientPlayerEntersGame(d4f767463ce0a6b3).(player_num);
384
385 if (player_num != DMFCBasecxx . . $ DMFCBase.->GetPlayerNumcxx . . $ IDMFC#GetPlayerNum(b126dc7c1de90089).())
386 DisplayWelcomeMessagecxx . . $ DisplayWelcomeMessage(d4f767463ce0a6b3).(player_num);
387 else
388 display_my_welcomecxx . . $ display_my_welcome. = true;
389 }
390
391 // We need to adjust the scores
392 void OnClientPlayerKilledcxx . . $ OnClientPlayerKilled(766a1b7183ffa4b4).(objectcxx . . $ object# *killer_obj, int victim_pnum) {
393 DMFCBasecxx . . $ DMFCBase.->OnClientPlayerKilledcxx . . $ IDMFC#OnClientPlayerKilled(766a1b7183ffa4b4).(killer_obj, victim_pnum);
394 player_recordcxx . . $ player_record# *kpr;
395
396 int kpnum;
397
398 if (killer_obj) {
399 if ((killer_obj->typecxx . . $ object#type. == OBJ_PLAYERcxx . . $ `Descent3/object_external.h:164:9`!) || (killer_obj->typecxx . . $ object#type. == OBJ_GHOSTcxx . . $ `Descent3/object_external.h:172:9`!))
400 kpnum = killer_obj->idcxx . . $ object#id.;
401 else if (killer_obj->typecxx . . $ object#type. == OBJ_ROBOTcxx . . $ `Descent3/object_external.h:162:9`! || killer_obj->typecxx . . $ object#type. == OBJ_BUILDINGcxx . . $ `Descent3/object_external.h:176:9`!) {
402 // countermeasure kill
403 kpnum = DMFCBasecxx . . $ DMFCBase.->GetCounterMeasureOwnercxx . . $ IDMFC#GetCounterMeasureOwner(2da2a862cad4c994).(killer_obj);
404 } else {
405 kpnum = -1;
406 }
407 } else {
408 kpnum = -1;
409 }
410
411 kpr = DMFCBasecxx . . $ DMFCBase.->GetPlayerRecordByPnumcxx . . $ IDMFC#GetPlayerRecordByPnum(6359c6f28dd028ae).(kpnum);
412 if (kpr) {
413 int goal;
414 if (DMFCBasecxx . . $ DMFCBase.->GetScoreLimitcxx . . $ IDMFC#GetScoreLimit(18a3c31ed0aa5760).(&goal)) {
415 int score = kpr->dstatscxx . . $ player_record#dstats..killscxx . . $ t_dstat#kills.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!] - kpr->dstatscxx . . $ player_record#dstats..suicidescxx . . $ t_dstat#suicides.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!];
416 if (score >= goal) {
417 DMFCBasecxx . . $ DMFCBase.->EndLevelcxx . . $ IDMFC#EndLevel(49f6e7a06ebc5aa8).();
418 }
419 }
420 }
421 }
422
423 bool compare_slotscxx . . $ compare_slots(cf9ef193275fa6d8).(int a, int b) {
424 int ascore, bscore;
425 player_recordcxx . . $ player_record# *apr, *bpr;
426 apr = DMFCBasecxx . . $ DMFCBase.->GetPlayerRecordcxx . . $ IDMFC#GetPlayerRecord(6359c6f28dd028ae).(a);
427 bpr = DMFCBasecxx . . $ DMFCBase.->GetPlayerRecordcxx . . $ IDMFC#GetPlayerRecord(6359c6f28dd028ae).(b);
428 if (!apr)
429 return true;
430 if (!bpr)
431 return false;
432 if (apr->statecxx . . $ player_record#state. == STATE_EMPTYcxx . . $ STATE_EMPTY.)
433 return true;
434 if (bpr->statecxx . . $ player_record#state. == STATE_EMPTYcxx . . $ STATE_EMPTY.)
435 return false;
436 if ((apr->statecxx . . $ player_record#state. == STATE_INGAMEcxx . . $ STATE_INGAME.) && (bpr->statecxx . . $ player_record#state. == STATE_INGAMEcxx . . $ STATE_INGAME.)) {
437 // both players were in the game
438 ascore = apr->dstatscxx . . $ player_record#dstats..killscxx . . $ t_dstat#kills.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!] - apr->dstatscxx . . $ player_record#dstats..suicidescxx . . $ t_dstat#suicides.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!];
439 bscore = bpr->dstatscxx . . $ player_record#dstats..killscxx . . $ t_dstat#kills.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!] - bpr->dstatscxx . . $ player_record#dstats..suicidescxx . . $ t_dstat#suicides.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!];
440 return (ascore < bscore);
441 }
442 if ((apr->statecxx . . $ player_record#state. == STATE_INGAMEcxx . . $ STATE_INGAME.) && (bpr->statecxx . . $ player_record#state. == STATE_DISCONNECTEDcxx . . $ STATE_DISCONNECTED.)) {
443 // apr gets priority since he was in the game on exit
444 return false;
445 }
446 if ((apr->statecxx . . $ player_record#state. == STATE_DISCONNECTEDcxx . . $ STATE_DISCONNECTED.) && (bpr->statecxx . . $ player_record#state. == STATE_INGAMEcxx . . $ STATE_INGAME.)) {
447 // bpr gets priority since he was in the game on exit
448 return true;
449 }
450 // if we got here then both players were disconnected
451 ascore = apr->dstatscxx . . $ player_record#dstats..killscxx . . $ t_dstat#kills.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!] - apr->dstatscxx . . $ player_record#dstats..suicidescxx . . $ t_dstat#suicides.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!];
452 bscore = bpr->dstatscxx . . $ player_record#dstats..killscxx . . $ t_dstat#kills.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!] - bpr->dstatscxx . . $ player_record#dstats..suicidescxx . . $ t_dstat#suicides.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!];
453 return (ascore < bscore);
454 }
455
456 void OnPLRInitcxx . . $ OnPLRInit(49f6e7a06ebc5aa8).(void) {
457 int tempsort[MAX_PLAYER_RECORDScxx . . $ `netgames/includes/DMFC.h:526:9`!];
458 int i, t, j;
459
460 for (i = 0; i < MAX_PLAYER_RECORDScxx . . $ `netgames/includes/DMFC.h:526:9`!; i++) {
461 tempsort[i] = i;
462 }
463
464 for (i = 1; i <= MAX_PLAYER_RECORDScxx . . $ `netgames/includes/DMFC.h:526:9`! - 1; i++) {
465 t = tempsort[i];
466 // Shift elements down until
467 // insertion point found.
468 for (j = i - 1; j >= 0 && compare_slotscxx . . $ compare_slots(cf9ef193275fa6d8).(tempsort[j], t); j--) {
469 tempsort[j + 1] = tempsort[j];
470 }
471 // insert
472 tempsort[j + 1] = t;
473 }
474
475 // copy the array over
476 memcpy(SortedPlayerscxx . . $ SortedPlayers., tempsort, DLLMAX_PLAYERScxx . . $ `netgames/includes/DMFC.h:425:9`! * sizeof(int));
477
478 DMFCBasecxx . . $ DMFCBase.->OnPLRInitcxx . . $ IDMFC#OnPLRInit(49f6e7a06ebc5aa8).();
479 }
480
481 void OnPLRIntervalcxx . . $ OnPLRInterval(49f6e7a06ebc5aa8).(void) {
482 #define PLAYERS_COLcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:482:9`! 130
483 #define SCORE_COLcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:483:9`! 280
484 #define DEATHS_COLcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:484:9`! 330
485 #define SUICIDES_COLcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:485:9`! 390
486 #define TOTAL_COLcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:486:9`! 460
487
488 DMFCBasecxx . . $ DMFCBase.->OnPLRIntervalcxx . . $ IDMFC#OnPLRInterval(49f6e7a06ebc5aa8).();
489
490 int y = 40;
491
492 int height = DLLgrfont_GetHeight((DMFCBasecxx . . $ DMFCBase.->GetGameFontTranslateArraycxx . . $ IDMFC#GetGameFontTranslateArray(a7741f82f5fc3640).())[SMALL_UI_FONT_INDEXcxx . . $ `Descent3/gamefont.h:99:9`!]) + 1;
493 DLLgrtext_SetFont((DMFCBasecxx . . $ DMFCBase.->GetGameFontTranslateArraycxx . . $ IDMFC#GetGameFontTranslateArray(a7741f82f5fc3640).())[SMALL_UI_FONT_INDEXcxx . . $ `Descent3/gamefont.h:99:9`!]);
494
495 // print out header
496 DLLgrtext_SetColor(GR_RGBcxx . . $ GR_RGB(530956271a9518a5).(255, 255, 150));
497 DLLgrtext_Printf(PLAYERS_COLcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:482:9`!, y, TXT_PILOTcxx . . $ `netgames/roboanarchy/roboanarchystr.h:40:9`!);
498 DLLgrtext_Printf(SCORE_COLcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:483:9`!, y, TXT_KILLS_SHORTcxx . . $ `netgames/roboanarchy/roboanarchystr.h:69:9`!);
499 DLLgrtext_Printf(DEATHS_COLcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:484:9`!, y, TXT_DEATHS_SHORTcxx . . $ `netgames/roboanarchy/roboanarchystr.h:70:9`!);
500 DLLgrtext_Printf(SUICIDES_COLcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:485:9`!, y, TXT_SUICIDES_SHORTcxx . . $ `netgames/roboanarchy/roboanarchystr.h:71:9`!);
501 DLLgrtext_Printf(TOTAL_COLcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:486:9`!, y, TXT_SCOREcxx . . $ `netgames/roboanarchy/roboanarchystr.h:44:9`!);
502 y += height;
503
504 // print out player stats
505 int rank = 1;
506 int slot, pnum;
507 player_recordcxx . . $ player_record# *pr;
508
509 for (int i = 0; i < DLLMAX_PLAYERScxx . . $ `netgames/includes/DMFC.h:425:9`!; i++) {
510 slot = SortedPlayerscxx . . $ SortedPlayers.[i];
511 pr = DMFCBasecxx . . $ DMFCBase.->GetPlayerRecordcxx . . $ IDMFC#GetPlayerRecord(6359c6f28dd028ae).(slot);
512 if ((pr) && (pr->statecxx . . $ player_record#state. != STATE_EMPTYcxx . . $ STATE_EMPTY.)) {
513
514 if (DMFCBasecxx . . $ DMFCBase.->IsPlayerDedicatedServercxx . . $ IDMFC#IsPlayerDedicatedServer(6a9c0d4ad435bebf).(pr))
515 continue; // skip a dedicated server
516
517 pnum = DMFCBasecxx . . $ DMFCBase.->WasPlayerInGameAtLevelEndcxx . . $ IDMFC#WasPlayerInGameAtLevelEnd(7864480464b09eea).(slot);
518 if (pnum != -1) {
519 DLLgrtext_SetColor((DMFCBasecxx . . $ DMFCBase.->GetPlayerColorscxx . . $ IDMFC#GetPlayerColors(ac695d451f96e4aa).())[pnum]);
520 } else {
521 DLLgrtext_SetColor(GR_RGBcxx . . $ GR_RGB(530956271a9518a5).(128, 128, 128));
522 }
523
524 char temp[100];
525 snprintf(temp, sizeof(temp), "%d)%s", rank, pr->callsigncxx . . $ player_record#callsign.);
526 DMFCBasecxx . . $ DMFCBase.->ClipStringcxx . . $ IDMFC#ClipString(8677479218165cd4).(SCORE_COLcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:483:9`! - PLAYERS_COLcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:482:9`! - 10, temp, true);
527 DLLgrtext_Printf(PLAYERS_COLcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:482:9`!, y, "%s", temp);
528
529 DLLgrtext_Printf(SCORE_COLcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:483:9`!, y, "%d", pr->dstatscxx . . $ player_record#dstats..killscxx . . $ t_dstat#kills.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!]);
530 DLLgrtext_Printf(DEATHS_COLcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:484:9`!, y, "%d", pr->dstatscxx . . $ player_record#dstats..deathscxx . . $ t_dstat#deaths.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!]);
531 DLLgrtext_Printf(SUICIDES_COLcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:485:9`!, y, "%d", pr->dstatscxx . . $ player_record#dstats..suicidescxx . . $ t_dstat#suicides.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!]);
532 DLLgrtext_Printf(TOTAL_COLcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:486:9`!, y, "%d", pr->dstatscxx . . $ player_record#dstats..killscxx . . $ t_dstat#kills.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!] - pr->dstatscxx . . $ player_record#dstats..suicidescxx . . $ t_dstat#suicides.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!]);
533 y += height;
534 rank++;
535
536 if (y >= 440)
537 goto quick_exit;
538 }
539 }
540
541 quick_exit:;
542 }
543
544 void SaveStatsToFilecxx . . $ SaveStatsToFile(fda57c8427c60377).(char *filename) {
545 CFILEcxx . . $ CFILE# *file;
546 DLLOpenCFILE(&file, filenamecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., "wt");
547 if (!file) {
548 mprintfcxx . . $ `netgames/includes/DMFC.h:423:9`!(0, "Unable to open output file\n");
549 return;
550 }
551
552 // write out game stats
553 #define BUFSIZEcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:553:9`! 150
554 char buffer[BUFSIZEcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:553:9`!];
555 char tempbuffer[25];
556 int sortedslots[MAX_PLAYER_RECORDScxx . . $ `netgames/includes/DMFC.h:526:9`!];
557 player_recordcxx . . $ player_record# *pr, *dpr;
558 tPInfoStatcxx . . $ tPInfoStat# stat;
559 int count, p;
560
561 // sort the stats
562 DMFCBasecxx . . $ DMFCBase.->GetSortedPlayerSlotscxx . . $ IDMFC#GetSortedPlayerSlots(621ccea12ecf5b06).(sortedslots, MAX_PLAYER_RECORDScxx . . $ `netgames/includes/DMFC.h:526:9`!);
563 count = 1;
564
565 snprintf(buffer, sizeof(buffer), TXT_SAVE_HEADERcxx . . $ `netgames/roboanarchy/roboanarchystr.h:60:9`!, (DMFCBasecxx . . $ DMFCBase.->GetNetgameInfocxx . . $ IDMFC#GetNetgameInfo(242e78cd5130aa12).())->namecxx . . $ netgame_info#name.,
566 (DMFCBasecxx . . $ DMFCBase.->GetCurrentMissioncxx . . $ IDMFC#GetCurrentMission(d7a4f7ca6f9cb411).())->cur_levelcxx . . $ tMission#cur_level.);
567 DLLcf_WriteString(file, buffer);
568
569 snprintf(buffer, sizeof(buffer), "%s", TXT_SAVE_HEADERBcxx . . $ `netgames/roboanarchy/roboanarchystr.h:61:9`!);
570 DLLcf_WriteString(file, buffer);
571 strcpy(buffer, "-----------------------------------------------------------------------------------------------");
572 DLLcf_WriteString(file, buffer);
573
574 for (int s = 0; s < MAX_PLAYER_RECORDScxx . . $ `netgames/includes/DMFC.h:526:9`!; s++) {
575 p = sortedslots[s];
576 pr = DMFCBasecxx . . $ DMFCBase.->GetPlayerRecordcxx . . $ IDMFC#GetPlayerRecord(6359c6f28dd028ae).(p);
577 if (pr && pr->statecxx . . $ player_record#state. != STATE_EMPTYcxx . . $ STATE_EMPTY.) {
578
579 if (DMFCBasecxx . . $ DMFCBase.->IsPlayerDedicatedServercxx . . $ IDMFC#IsPlayerDedicatedServer(6a9c0d4ad435bebf).(pr))
580 continue; // skip dedicated server
581
582 memset(buffer, ' ', BUFSIZEcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:553:9`!);
583
584 snprintf(tempbuffer, sizeof(tempbuffer), "%d)", count);
585 memcpy(&buffer[0], tempbuffer, strlen(tempbuffer));
586
587 snprintf(tempbuffer, sizeof(tempbuffer), "%s%s", (pr->statecxx . . $ player_record#state. == STATE_INGAMEcxx . . $ STATE_INGAME.) ? "" : "*", pr->callsigncxx . . $ player_record#callsign.);
588 memcpy(&buffer[7], tempbuffer, strlen(tempbuffer));
589
590 snprintf(tempbuffer, sizeof(tempbuffer), "%d[%d]",
591 pr->dstatscxx . . $ player_record#dstats..killscxx . . $ t_dstat#kills.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!] - pr->dstatscxx . . $ player_record#dstats..suicidescxx . . $ t_dstat#suicides.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!],
592 pr->dstatscxx . . $ player_record#dstats..killscxx . . $ t_dstat#kills.[DSTAT_OVERALLcxx . . $ `netgames/includes/DMFC.h:528:9`!] - pr->dstatscxx . . $ player_record#dstats..suicidescxx . . $ t_dstat#suicides.[DSTAT_OVERALLcxx . . $ `netgames/includes/DMFC.h:528:9`!]);
593 memcpy(&buffer[36], tempbuffer, strlen(tempbuffer));
594
595 snprintf(tempbuffer, sizeof(tempbuffer), "%d[%d]", pr->dstatscxx . . $ player_record#dstats..killscxx . . $ t_dstat#kills.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!],
596 pr->dstatscxx . . $ player_record#dstats..killscxx . . $ t_dstat#kills.[DSTAT_OVERALLcxx . . $ `netgames/includes/DMFC.h:528:9`!]);
597 memcpy(&buffer[48], tempbuffer, strlen(tempbuffer));
598
599 snprintf(tempbuffer, sizeof(tempbuffer), "%d[%d]", pr->dstatscxx . . $ player_record#dstats..deathscxx . . $ t_dstat#deaths.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!],
600 pr->dstatscxx . . $ player_record#dstats..deathscxx . . $ t_dstat#deaths.[DSTAT_OVERALLcxx . . $ `netgames/includes/DMFC.h:528:9`!]);
601 memcpy(&buffer[60], tempbuffer, strlen(tempbuffer));
602
603 snprintf(tempbuffer, sizeof(tempbuffer), "%d[%d]", pr->dstatscxx . . $ player_record#dstats..suicidescxx . . $ t_dstat#suicides.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!],
604 pr->dstatscxx . . $ player_record#dstats..suicidescxx . . $ t_dstat#suicides.[DSTAT_OVERALLcxx . . $ `netgames/includes/DMFC.h:528:9`!]);
605 memcpy(&buffer[71], tempbuffer, strlen(tempbuffer));
606
607 strcpy(tempbuffer, DMFCBasecxx . . $ DMFCBase.->GetTimeStringcxx . . $ IDMFC#GetTimeString(3b344d7a46e3c2ff).(DMFCBasecxx . . $ DMFCBase.->GetTimeInGamecxx . . $ IDMFC#GetTimeInGame(5cde91ea12d43f46).(p)));
608 memcpy(&buffer[82], tempbuffer, strlen(tempbuffer));
609
610 size_t pos = 82 + strlen(tempbuffer) + 1;
611 if (pos < BUFSIZEcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:553:9`!)
612 buffer[pos] = '\0';
613
614 buffer[BUFSIZEcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:553:9`! - 1] = '\0';
615 DLLcf_WriteString(file, buffer);
616 count++;
617 }
618 }
619
620 DLLcf_WriteString(file, TXT_SAVE_HEADERCcxx . . $ `netgames/roboanarchy/roboanarchystr.h:63:9`!);
621
622 count = 1;
623 for (p = 0; p < MAX_PLAYER_RECORDScxx . . $ `netgames/includes/DMFC.h:526:9`!; p++) {
624 pr = DMFCBasecxx . . $ DMFCBase.->GetPlayerRecordcxx . . $ IDMFC#GetPlayerRecord(6359c6f28dd028ae).(p);
625 if (pr && pr->statecxx . . $ player_record#state. != STATE_EMPTYcxx . . $ STATE_EMPTY.) {
626
627 if (DMFCBasecxx . . $ DMFCBase.->IsPlayerDedicatedServercxx . . $ IDMFC#IsPlayerDedicatedServer(6a9c0d4ad435bebf).(pr))
628 continue; // skip dedicated server
629
630 // Write out header
631 snprintf(buffer, sizeof(buffer), "%d) %s%s", count, (pr->statecxx . . $ player_record#state. == STATE_INGAMEcxx . . $ STATE_INGAME.) ? "" : "*", pr->callsigncxx . . $ player_record#callsign.);
632 DLLcf_WriteString(file, buffer);
633 size_t length = strlen(buffer);
634 memset(buffer, '=', length);
635 buffer[length] = '\0';
636 DLLcf_WriteString(file, buffer);
637
638 // time in game
639 snprintf(buffer, sizeof(buffer), TXT_SAVE_TIMEINGAMEcxx . . $ `netgames/roboanarchy/roboanarchystr.h:64:9`!, DMFCBasecxx . . $ DMFCBase.->GetTimeStringcxx . . $ IDMFC#GetTimeString(3b344d7a46e3c2ff).(DMFCBasecxx . . $ DMFCBase.->GetTimeInGamecxx . . $ IDMFC#GetTimeInGame(5cde91ea12d43f46).(p)));
640 DLLcf_WriteString(file, buffer);
641
642 if (DMFCBasecxx . . $ DMFCBase.->FindPInfoStatFirstcxx . . $ IDMFC#FindPInfoStatFirst(e8124cb919632806).(p, &stat)) {
643 snprintf(buffer, sizeof(buffer), "%s", TXT_SAVE_KILLERLISTcxx . . $ `netgames/roboanarchy/roboanarchystr.h:65:9`!);
644 DLLcf_WriteString(file, buffer);
645
646 if (stat.slotcxx . . $ tPInfoStat#slot. != p) {
647 memset(buffer, ' ', BUFSIZEcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:553:9`!);
648 dpr = DMFCBasecxx . . $ DMFCBase.->GetPlayerRecordcxx . . $ IDMFC#GetPlayerRecord(6359c6f28dd028ae).(stat.slotcxx . . $ tPInfoStat#slot.);
649
650 ASSERTcxx . . $ `netgames/includes/DMFC.h:370:9`!(dpr != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
651 if (dpr) {
652 strcpy(tempbuffer, dpr->callsigncxx . . $ player_record#callsign.);
653 memcpy(buffer, tempbuffer, strlen(tempbuffer));
654
655 snprintf(tempbuffer, sizeof(tempbuffer), "%d", stat.killscxx . . $ tPInfoStat#kills.);
656 memcpy(&buffer[30], tempbuffer, strlen(tempbuffer));
657
658 snprintf(tempbuffer, sizeof(tempbuffer), "%d", stat.deathscxx . . $ tPInfoStat#deaths.);
659 memcpy(&buffer[40], tempbuffer, strlen(tempbuffer));
660
661 size_t pos = 40 + strlen(tempbuffer) + 1;
662 if (pos < BUFSIZEcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:553:9`!)
663 buffer[pos] = '\0';
664
665 buffer[BUFSIZEcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:553:9`! - 1] = '\0';
666 DLLcf_WriteString(file, buffer);
667 }
668 }
669
670 while (DMFCBasecxx . . $ DMFCBase.->FindPInfoStatNextcxx . . $ IDMFC#FindPInfoStatNext(4ead3766c292904).(&stat)) {
671 if (stat.slotcxx . . $ tPInfoStat#slot. != p) {
672 memset(buffer, ' ', BUFSIZEcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:553:9`!);
673 dpr = DMFCBasecxx . . $ DMFCBase.->GetPlayerRecordcxx . . $ IDMFC#GetPlayerRecord(6359c6f28dd028ae).(stat.slotcxx . . $ tPInfoStat#slot.);
674
675 if (dpr) {
676 strcpy(tempbuffer, dpr->callsigncxx . . $ player_record#callsign.);
677 memcpy(buffer, tempbuffer, strlen(tempbuffer));
678
679 snprintf(tempbuffer, sizeof(tempbuffer), "%d", stat.killscxx . . $ tPInfoStat#kills.);
680 memcpy(&buffer[30], tempbuffer, strlen(tempbuffer));
681
682 snprintf(tempbuffer, sizeof(tempbuffer), "%d", stat.deathscxx . . $ tPInfoStat#deaths.);
683 memcpy(&buffer[40], tempbuffer, strlen(tempbuffer));
684
685 size_t pos = 40 + strlen(tempbuffer) + 1;
686 if (pos < BUFSIZEcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:553:9`!)
687 buffer[pos] = '\0';
688
689 buffer[BUFSIZEcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:553:9`! - 1] = '\0';
690 DLLcf_WriteString(file, buffer);
691 }
692 }
693 }
694 }
695 DMFCBasecxx . . $ DMFCBase.->FindPInfoStatClosecxx . . $ IDMFC#FindPInfoStatClose(49f6e7a06ebc5aa8).();
696 DLLcf_WriteString(file, ""); // skip a line
697 count++;
698 }
699 }
700
701 // done writing stats
702 DLLcfclose(file);
703 DLLAddHUDMessage(TXT_MSG_SAVESTATScxx . . $ `netgames/roboanarchy/roboanarchystr.h:66:9`!);
704 }
705
706 #define ROOTFILENAMEcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:706:9`! "Anarchy"
707 void OnSaveStatsToFilecxx . . $ OnSaveStatsToFile(49f6e7a06ebc5aa8).(void) {
708 char filename[256];
709 DMFCBasecxx . . $ DMFCBase.->GenerateStatFilenamecxx . . $ IDMFC#GenerateStatFilename(4d4dad76095ad7d8).(filename, ROOTFILENAMEcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:706:9`!, false);
710 SaveStatsToFilecxx . . $ SaveStatsToFile(fda57c8427c60377).(filename);
711 }
712
713 void OnLevelEndSaveStatsToFilecxx . . $ OnLevelEndSaveStatsToFile(49f6e7a06ebc5aa8).(void) {
714 char filename[256];
715 DMFCBasecxx . . $ DMFCBase.->GenerateStatFilenamecxx . . $ IDMFC#GenerateStatFilename(4d4dad76095ad7d8).(filename, ROOTFILENAMEcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:706:9`!, true);
716 SaveStatsToFilecxx . . $ SaveStatsToFile(fda57c8427c60377).(filename);
717 }
718
719 void OnDisconnectSaveStatsToFilecxx . . $ OnDisconnectSaveStatsToFile(49f6e7a06ebc5aa8).(void) {
720 char filename[256];
721 DMFCBasecxx . . $ DMFCBase.->GenerateStatFilenamecxx . . $ IDMFC#GenerateStatFilename(4d4dad76095ad7d8).(filename, ROOTFILENAMEcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:706:9`!, false);
722 SaveStatsToFilecxx . . $ SaveStatsToFile(fda57c8427c60377).(filename);
723 }
724
725 void OnPrintScorescxx . . $ OnPrintScores(d4f767463ce0a6b3).(int level) {
726 char buffer[256];
727 char name[50];
728 memset(buffer, ' ', 256);
729
730 size_t t;
731 size_t pos[6];
732 size_t len[6];
733 pos[0] = 0;
734 t = len[0] = 20; // give ample room for pilot name
735 pos[1] = pos[0] + t + 1;
736 t = len[1] = strlen(TXT_POINTScxx . . $ `netgames/roboanarchy/roboanarchystr.h:48:9`!);
737 pos[2] = pos[1] + t + 1;
738 t = len[2] = strlen(TXT_KILLS_SHORTcxx . . $ `netgames/roboanarchy/roboanarchystr.h:69:9`!);
739 pos[3] = pos[2] + t + 1;
740 t = len[3] = strlen(TXT_DEATHS_SHORTcxx . . $ `netgames/roboanarchy/roboanarchystr.h:70:9`!);
741 pos[4] = pos[3] + t + 1;
742 t = len[4] = strlen(TXT_SUICIDES_SHORTcxx . . $ `netgames/roboanarchy/roboanarchystr.h:71:9`!);
743 pos[5] = pos[4] + t + 1;
744 t = len[5] = strlen(TXT_PINGcxx . . $ `netgames/roboanarchy/roboanarchystr.h:59:9`!);
745
746 memcpy(&buffer[pos[0]], TXT_PILOTcxx . . $ `netgames/roboanarchy/roboanarchystr.h:40:9`!, strlen(TXT_PILOTcxx . . $ `netgames/roboanarchy/roboanarchystr.h:40:9`!));
747 memcpy(&buffer[pos[1]], TXT_POINTScxx . . $ `netgames/roboanarchy/roboanarchystr.h:48:9`!, len[1]);
748 memcpy(&buffer[pos[2]], TXT_KILLS_SHORTcxx . . $ `netgames/roboanarchy/roboanarchystr.h:69:9`!, len[2]);
749 memcpy(&buffer[pos[3]], TXT_DEATHS_SHORTcxx . . $ `netgames/roboanarchy/roboanarchystr.h:70:9`!, len[3]);
750 memcpy(&buffer[pos[4]], TXT_SUICIDES_SHORTcxx . . $ `netgames/roboanarchy/roboanarchystr.h:71:9`!, len[4]);
751 memcpy(&buffer[pos[5]], TXT_PINGcxx . . $ `netgames/roboanarchy/roboanarchystr.h:59:9`!, len[5]);
752 buffer[pos[5] + len[5] + 1] = '\n';
753 buffer[pos[5] + len[5] + 2] = '\0';
754 DPrintf(buffer);
755
756 int slot;
757 player_recordcxx . . $ player_record# *pr;
758 int pcount;
759
760 if (level < 0 || level >= MAX_PLAYER_RECORDScxx . . $ `netgames/includes/DMFC.h:526:9`!)
761 pcount = MAX_PLAYER_RECORDScxx . . $ `netgames/includes/DMFC.h:526:9`!;
762 else
763 pcount = level;
764
765 int sortedplayers[MAX_PLAYER_RECORDScxx . . $ `netgames/includes/DMFC.h:526:9`!];
766 DMFCBasecxx . . $ DMFCBase.->GetSortedPlayerSlotscxx . . $ IDMFC#GetSortedPlayerSlots(621ccea12ecf5b06).(sortedplayers, MAX_PLAYER_RECORDScxx . . $ `netgames/includes/DMFC.h:526:9`!);
767
768 for (int i = 0; i < pcount; i++) {
769 slot = sortedplayers[i];
770 pr = DMFCBasecxx . . $ DMFCBase.->GetPlayerRecordcxx . . $ IDMFC#GetPlayerRecord(6359c6f28dd028ae).(slot);
771 if ((pr) && (pr->statecxx . . $ player_record#state. != STATE_EMPTYcxx . . $ STATE_EMPTY.)) {
772
773 if (DMFCBasecxx . . $ DMFCBase.->IsPlayerDedicatedServercxx . . $ IDMFC#IsPlayerDedicatedServer(6a9c0d4ad435bebf).(pr))
774 continue; // skip dedicated server
775
776 snprintf(name, sizeof(name), "%s%s:", (pr->statecxx . . $ player_record#state. == STATE_DISCONNECTEDcxx . . $ STATE_DISCONNECTED.) ? "*" : "", pr->callsigncxx . . $ player_record#callsign.);
777 name[19] = '\0';
778
779 memset(buffer, ' ', 256);
780 t = strlen(name);
781 memcpy(&buffer[pos[0]], name, (t < len[0]) ? t : len[0]);
782 snprintf(name, sizeof(name), "%d", pr->dstatscxx . . $ player_record#dstats..killscxx . . $ t_dstat#kills.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!] - pr->dstatscxx . . $ player_record#dstats..suicidescxx . . $ t_dstat#suicides.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!]);
783 t = strlen(name);
784 memcpy(&buffer[pos[1]], name, (t < len[1]) ? t : len[1]);
785 snprintf(name, sizeof(name), "%d", pr->dstatscxx . . $ player_record#dstats..killscxx . . $ t_dstat#kills.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!]);
786 t = strlen(name);
787 memcpy(&buffer[pos[2]], name, (t < len[2]) ? t : len[2]);
788 snprintf(name, sizeof(name), "%d", pr->dstatscxx . . $ player_record#dstats..deathscxx . . $ t_dstat#deaths.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!]);
789 t = strlen(name);
790 memcpy(&buffer[pos[3]], name, (t < len[3]) ? t : len[3]);
791 snprintf(name, sizeof(name), "%d", pr->dstatscxx . . $ player_record#dstats..suicidescxx . . $ t_dstat#suicides.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!]);
792 t = strlen(name);
793 memcpy(&buffer[pos[4]], name, (t < len[4]) ? t : len[4]);
794
795 if (pr->statecxx . . $ player_record#state. == STATE_INGAMEcxx . . $ STATE_INGAME.)
796 snprintf(name, sizeof(name), "%.0f", (DMFCBasecxx . . $ DMFCBase.->GetNetPlayerscxx . . $ IDMFC#GetNetPlayers(d09959b2d64446dd).())[pr->pnumcxx . . $ player_record#pnum.].ping_timecxx . . $ netplayer#ping_time. * 1000.0f);
797 else
798 strcpy(name, "---");
799 t = strlen(name);
800 memcpy(&buffer[pos[5]], name, (t < len[5]) ? t : len[5]);
801 buffer[pos[5] + len[5] + 1] = '\n';
802 buffer[pos[5] + len[5] + 2] = '\0';
803 DPrintf(buffer);
804 }
805 }
806 }
807
808 void DisplayHUDScorescxx . . $ DisplayHUDScores(c7a20e4e05358911).(struct tHUDItemcxx . . $ tHUDItem# *hitem) {
809 if (display_my_welcomecxx . . $ display_my_welcome.) {
810 DisplayWelcomeMessagecxx . . $ DisplayWelcomeMessage(d4f767463ce0a6b3).(DMFCBasecxx . . $ DMFCBase.->GetPlayerNumcxx . . $ IDMFC#GetPlayerNum(b126dc7c1de90089).());
811 display_my_welcomecxx . . $ display_my_welcome. = false;
812 }
813
814 if (DisplayScoreScreencxx . . $ DisplayScoreScreen.)
815 return;
816
817 int height = DLLgrfont_GetHeight((DMFCBasecxx . . $ DMFCBase.->GetGameFontTranslateArraycxx . . $ IDMFC#GetGameFontTranslateArray(a7741f82f5fc3640).())[HUD_FONT_INDEXcxx . . $ `Descent3/gamefont.h:97:9`!]) + 3;
818 uint8_tcxx . . $ uint8_t# alpha = DMFCBasecxx . . $ DMFCBase.->ConvertHUDAlphacxx . . $ IDMFC#ConvertHUDAlpha(50106d451684defa).((uint8_tcxx . . $ uint8_t#)((DisplayScoreScreencxx . . $ DisplayScoreScreen.) ? 128 : 255));
819 int y = (DMFCBasecxx . . $ DMFCBase.->GetGameWindowHcxx . . $ IDMFC#GetGameWindowH(b126dc7c1de90089).() / 2) - ((height * 5) / 2);
820 int x = 520;
821 ddgr_colorcxx . . $ ddgr_color# color;
822
823 int rank = 1;
824 player_recordcxx . . $ player_record# *pr;
825
826 // Display your Kills & Deaths on the top corners of the screen
827 pr = DMFCBasecxx . . $ DMFCBase.->GetPlayerRecordByPnumcxx . . $ IDMFC#GetPlayerRecordByPnum(6359c6f28dd028ae).(DMFCBasecxx . . $ DMFCBase.->GetPlayerNumcxx . . $ IDMFC#GetPlayerNum(b126dc7c1de90089).());
828 if (pr) {
829 int y = 25, x;
830 int lwidth;
831 char buffer[20];
832
833 int w_kill, w_death, max_w;
834 w_kill = DLLgrtext_GetTextLineWidth(TXT_KILLScxx . . $ `netgames/roboanarchy/roboanarchystr.h:41:9`!);
835 w_death = DLLgrtext_GetTextLineWidth(TXT_DEATHScxx . . $ `netgames/roboanarchy/roboanarchystr.h:42:9`!);
836 max_w = stdcxx . . $ std/::maxcxx . . $ std/max(2a338fce5842aa6a).(w_kill, w_death);
837
838 x = DMFCBasecxx . . $ DMFCBase.->GetGameWindowWcxx . . $ IDMFC#GetGameWindowW(b126dc7c1de90089).() - DMFCBasecxx . . $ DMFCBase.->GetGameWindowWcxx . . $ IDMFC#GetGameWindowW(b126dc7c1de90089).() * 0.0078125f;
839 DLLgrtext_SetColor(GR_GREENcxx . . $ GR_GREEN.);
840 DLLgrtext_SetAlpha(alpha);
841 DLLgrtext_Printf(x - (max_w / 2) - (w_kill / 2), y, TXT_KILLScxx . . $ `netgames/roboanarchy/roboanarchystr.h:41:9`!);
842 y += height;
843
844 snprintf(buffer, sizeof(buffer), "%d", pr->dstatscxx . . $ player_record#dstats..killscxx . . $ t_dstat#kills.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!]);
845 lwidth = DLLgrtext_GetTextLineWidth(buffer);
846 DLLgrtext_SetColor(GR_GREENcxx . . $ GR_GREEN.);
847 DLLgrtext_SetAlpha(alpha);
848 DLLgrtext_Printf(x - (max_w / 2) - (lwidth / 2), y, buffer);
849 y += height + 3;
850
851 DLLgrtext_SetColor(GR_GREENcxx . . $ GR_GREEN.);
852 DLLgrtext_SetAlpha(alpha);
853 DLLgrtext_Printf(x - (max_w / 2) - (w_death / 2), y, TXT_DEATHScxx . . $ `netgames/roboanarchy/roboanarchystr.h:42:9`!);
854 y += height;
855
856 snprintf(buffer, sizeof(buffer), "%d", pr->dstatscxx . . $ player_record#dstats..deathscxx . . $ t_dstat#deaths.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!]);
857 lwidth = DLLgrtext_GetTextLineWidth(buffer);
858 DLLgrtext_SetColor(GR_GREENcxx . . $ GR_GREEN.);
859 DLLgrtext_SetAlpha(alpha);
860 DLLgrtext_Printf(x - (max_w / 2) - (lwidth / 2), y, buffer);
861 }
862
863 int ESortedPlayers[DLLMAX_PLAYERScxx . . $ `netgames/includes/DMFC.h:425:9`!] = {};
864
865 switch (Anarchy_hud_displaycxx . . $ Anarchy_hud_display.) {
866 case AHD_NONEcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:66:9`!:
867 return;
868 break;
869 case AHD_EFFICIENCYcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:68:9`!:
870 DMFCBasecxx . . $ DMFCBase.->GetSortedPlayerSlotscxx . . $ IDMFC#GetSortedPlayerSlots(621ccea12ecf5b06).(ESortedPlayers, DLLMAX_PLAYERScxx . . $ `netgames/includes/DMFC.h:425:9`!);
871 break;
872 }
873
874 char name[30];
875
876 // determine coordinates to use here
877 // we'll use a virtual width of 85 pixels on a 640x480 screen
878 // so first determine the new width
879 int name_width = 85.0f * DMFCBasecxx . . $ DMFCBase.->GetHudAspectXcxx . . $ IDMFC#GetHudAspectX(9b8c9e39889c762c).();
880 int score_width = DLLgrtext_GetTextLineWidth("888");
881 int name_x = DMFCBasecxx . . $ DMFCBase.->GetGameWindowWcxx . . $ IDMFC#GetGameWindowW(b126dc7c1de90089).() - name_width - score_width - 10;
882 int score_x = DMFCBasecxx . . $ DMFCBase.->GetGameWindowWcxx . . $ IDMFC#GetGameWindowW(b126dc7c1de90089).() - score_width - 5;
883
884 for (int i = 0; i < DLLMAX_PLAYERScxx . . $ `netgames/includes/DMFC.h:425:9`!; i++) {
885 int slot;
886
887 if (Anarchy_hud_displaycxx . . $ Anarchy_hud_display. == AHD_EFFICIENCYcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:68:9`!)
888 slot = ESortedPlayers[i];
889 else
890 slot = SortedPlayerscxx . . $ SortedPlayers.[i];
891
892 pr = DMFCBasecxx . . $ DMFCBase.->GetPlayerRecordcxx . . $ IDMFC#GetPlayerRecord(6359c6f28dd028ae).(slot);
893
894 if ((pr) && (pr->statecxx . . $ player_record#state. != STATE_EMPTYcxx . . $ STATE_EMPTY.)) {
895
896 if (DMFCBasecxx . . $ DMFCBase.->IsPlayerDedicatedServercxx . . $ IDMFC#IsPlayerDedicatedServer(6a9c0d4ad435bebf).(pr))
897 continue; // skip dedicated server
898
899 if ((pr->statecxx . . $ player_record#state. == STATE_DISCONNECTEDcxx . . $ STATE_DISCONNECTED.) || (pr->statecxx . . $ player_record#state. == STATE_INGAMEcxx . . $ STATE_INGAME. && !DMFCBasecxx . . $ DMFCBase.->IsPlayerObservercxx . . $ IDMFC#IsPlayerObserver(83c267b20bac841a).(pr->pnumcxx . . $ player_record#pnum.))) {
900
901 if (pr->pnumcxx . . $ player_record#pnum. == DMFCBasecxx . . $ DMFCBase.->GetPlayerNumcxx . . $ IDMFC#GetPlayerNum(b126dc7c1de90089).()) {
902
903 switch (HUD_color_modelcxx . . $ HUD_color_model.) {
904 case ACM_PLAYERCOLORcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:69:9`!:
905 color = (DMFCBasecxx . . $ DMFCBase.->GetPlayerColorscxx . . $ IDMFC#GetPlayerColors(ac695d451f96e4aa).())[pr->pnumcxx . . $ player_record#pnum.];
906 break;
907 case ACM_NORMALcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:70:9`!:
908 color = GR_RGBcxx . . $ GR_RGB(530956271a9518a5).(40, 255, 40);
909 break;
910 };
911
912 if (Highlight_bmpcxx . . $ Highlight_bmp. > BAD_BITMAP_HANDLEcxx . . $ `lib/bitmap.h:42:9`!) {
913 // draw the highlite bar in the background
914 DLLrend_SetAlphaValue(alpha * 0.50f);
915 DLLrend_SetZBufferState(0);
916 DLLrend_SetTextureType(TT_LINEARcxx . . $ TT_LINEAR.);
917 DLLrend_SetLighting(LS_NONEcxx . . $ LS_NONE.);
918 DLLrend_SetAlphaType(AT_CONSTANT_TEXTUREcxx . . $ `lib/renderer.h:402:9`!);
919 DLLrend_DrawScaledBitmap(name_x - 2, y - 2, score_x + score_width + 2, y + height - 1, Highlight_bmpcxx . . $ Highlight_bmp., 0, 0,
920 1, 1, 1.0, -1, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
921 DLLrend_SetZBufferState(1);
922 }
923
924 strcpy(name, pr->callsigncxx . . $ player_record#callsign.);
925 DMFCBasecxx . . $ DMFCBase.->ClipStringcxx . . $ IDMFC#ClipString(8677479218165cd4).(name_width, name, true);
926
927 DLLgrtext_SetAlpha(alpha);
928 DLLgrtext_SetColor(color);
929 DLLgrtext_Printf(name_x, y, "%s", name);
930
931 if (Anarchy_hud_displaycxx . . $ Anarchy_hud_display. == AHD_EFFICIENCYcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:68:9`!) {
932 float t = pr->dstatscxx . . $ player_record#dstats..killscxx . . $ t_dstat#kills.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!] + pr->dstatscxx . . $ player_record#dstats..suicidescxx . . $ t_dstat#suicides.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!] + pr->dstatscxx . . $ player_record#dstats..deathscxx . . $ t_dstat#deaths.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!];
933 float value = (float)(pr->dstatscxx . . $ player_record#dstats..killscxx . . $ t_dstat#kills.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!]) / ((t) ? t : 0.0000001f);
934 DLLgrtext_Printf(score_x, y, "%.1f", value);
935 } else {
936 DLLgrtext_Printf(score_x, y, "%d", pr->dstatscxx . . $ player_record#dstats..killscxx . . $ t_dstat#kills.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!] - pr->dstatscxx . . $ player_record#dstats..suicidescxx . . $ t_dstat#suicides.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!]);
937 }
938
939 y += height;
940 } else if (rank < 6) {
941
942 if (pr->statecxx . . $ player_record#state. == STATE_DISCONNECTEDcxx . . $ STATE_DISCONNECTED.) {
943 color = GR_GREYcxx . . $ `netgames/includes/DMFC.h:432:9`!;
944 } else {
945 switch (HUD_color_modelcxx . . $ HUD_color_model.) {
946 case ACM_PLAYERCOLORcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:69:9`!:
947 color = (DMFCBasecxx . . $ DMFCBase.->GetPlayerColorscxx . . $ IDMFC#GetPlayerColors(ac695d451f96e4aa).())[pr->pnumcxx . . $ player_record#pnum.];
948 break;
949 case ACM_NORMALcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:70:9`!:
950 color = GR_RGBcxx . . $ GR_RGB(530956271a9518a5).(40, 255, 40);
951 break;
952 };
953 }
954 strcpy(name, pr->callsigncxx . . $ player_record#callsign.);
955 DMFCBasecxx . . $ DMFCBase.->ClipStringcxx . . $ IDMFC#ClipString(8677479218165cd4).(name_width, name, true);
956
957 DLLgrtext_SetAlpha(alpha);
958 DLLgrtext_SetColor(color);
959 DLLgrtext_Printf(name_x, y, "%s", name);
960
961 if (Anarchy_hud_displaycxx . . $ Anarchy_hud_display. == AHD_EFFICIENCYcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:68:9`!) {
962 float t = pr->dstatscxx . . $ player_record#dstats..killscxx . . $ t_dstat#kills.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!] + pr->dstatscxx . . $ player_record#dstats..suicidescxx . . $ t_dstat#suicides.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!] + pr->dstatscxx . . $ player_record#dstats..deathscxx . . $ t_dstat#deaths.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!];
963 float value = (float)(pr->dstatscxx . . $ player_record#dstats..killscxx . . $ t_dstat#kills.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!]) / ((t) ? t : 0.0000001f);
964 DLLgrtext_Printf(score_x, y, "%.1f", value);
965 } else {
966 DLLgrtext_Printf(score_x, y, "%d", pr->dstatscxx . . $ player_record#dstats..killscxx . . $ t_dstat#kills.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!] - pr->dstatscxx . . $ player_record#dstats..suicidescxx . . $ t_dstat#suicides.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!]);
967 }
968
969 y += height;
970 }
971 rank++;
972 }
973 }
974 }
975 }
976
977 void DisplayWelcomeMessagecxx . . $ DisplayWelcomeMessage(d4f767463ce0a6b3).(int player_num) {
978 char name_buffer[64];
979 strcpy(name_buffer, (DMFCBasecxx . . $ DMFCBase.->GetPlayerscxx . . $ IDMFC#GetPlayers(51ff8e716a252304).())[player_num].callsigncxx . . $ player#callsign.);
980
981 if (player_num == DMFCBasecxx . . $ DMFCBase.->GetPlayerNumcxx . . $ IDMFC#GetPlayerNum(b126dc7c1de90089).()) {
982 DLLAddHUDMessage(TXT_WELCOMEcxx . . $ `netgames/roboanarchy/roboanarchystr.h:46:9`!, name_buffer);
983 } else {
984 DLLAddHUDMessage(TXT_JOINEDcxx . . $ `netgames/roboanarchy/roboanarchystr.h:47:9`!, name_buffer);
985 }
986 }
987
988 void SwitchHUDColorcxx . . $ SwitchHUDColor(d4f767463ce0a6b3).(int i) {
989 if (i < 0 || i > 1)
990 return;
991 HUD_color_modelcxx . . $ HUD_color_model. = i;
992
993 switch (HUD_color_modelcxx . . $ HUD_color_model.) {
994 case ACM_PLAYERCOLORcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:69:9`!:
995 DLLAddHUDMessage(TXT_MSG_COLORPLRcxx . . $ `netgames/roboanarchy/roboanarchystr.h:67:9`!);
996 break;
997 case ACM_NORMALcxx . . $ `netgames/roboanarchy/roboanarchy.cpp:70:9`!:
998 DLLAddHUDMessage(TXT_MSG_COLORNORMcxx . . $ `netgames/roboanarchy/roboanarchystr.h:68:9`!);
999 break;
1000 };
1001 }