Debian Codegraph @

netgames/entropy/EntropyBase.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/entropy/EntropyBase.cpp $
21 * $Revision: 1.1.1.1 $
22 * $Date: 2003/08/26 03:57:41 $
23 * $Author: kevinb $
24 *
25 * <insert description of file here>
26 *
27 * $Log: EntropyBase.cpp,v $
28 * Revision 1.1.1.1 2003/08/26 03:57:41 kevinb
29 * initial 1.5 import
30 *
31 *
32 * 59 9/24/01 2:28p Matt
33 * Allowed room for longer team name on results screen.
34 *
35 * 58 9/13/01 5:31p Matt
36 * Added a team member list to the stats display.
37 * Fixed a non-terminated string bug.
38 *
39 * 57 10/21/99 9:27p Jeff
40 * B.A. Macintosh code merge
41 *
42 * 56 9/03/99 5:27p Jeff
43 * fixed energy bug (going into an energy center with >100 energy)
44 *
45 * 55 8/17/99 5:53p Jeff
46 * track ranks on PXO
47 *
48 * 54 7/23/99 2:31p Jeff
49 * fixed bug where if the killer is not known, a player would still be
50 * able to carry virus after dying.
51 *
52 * 53 7/15/99 1:18a Jeff
53 * fixed up $scores
54 *
55 * 52 7/15/99 1:01a Jeff
56 * added $scores support
57 *
58 * 51 7/13/99 12:11p Jeff
59 * added some specific text taunt token decoding
60 *
61 * 50 7/12/99 2:27p Jeff
62 * fixed PLR to only display the team label for the disconnected list if
63 * there are people in the list. Play fanfare and print out a message is
64 * someone takes over the last base
65 *
66 * 49 7/11/99 6:54p Jeff
67 * fixed PLR so it doesn't go off the screen on long lists and active
68 * players in the game are shown first
69 *
70 * 48 6/08/99 7:08p Jeff
71 * begining to comment for SDK release
72 *
73 * 47 5/23/99 3:04a Jason
74 * fixed bug with player rankings not being updated correctly
75 *
76 * 46 5/23/99 2:22a Jeff
77 * added countdown. fixed takeover time...off by .5 seconds
78 *
79 * 45 5/22/99 1:12a Jeff
80 * play a sound on the server when picking up a virus
81 *
82 * 44 5/21/99 10:30p Jason
83 * made some rule changes to make more fun
84 *
85 * 43 5/21/99 10:03a Jeff
86 * hopefully filled in any remaining gaps related to have more than you
87 * can carry virus loads
88 *
89 * 42 5/12/99 11:04p Jeff
90 * dmfc and multiplayer games now have endian friendly packets (*whew*)
91 *
92 * 41 5/12/99 11:28a Jeff
93 * when a player scores, dont remove all virii, just what they used
94 *
95 * $NoKeywords: $
96 */
97
98 #include "gamedll_header.h"cxx . . $ `<file>/netgames/includes/gamedll_header.h`/ //included by all mods, it includes all needed headers, etc.
99 #include <string.h>
100 #include "idmfc.h"cxx . . $ `<file>/netgames/includes/idmfc.h`/ //dmfc! (required)
101 #include "Entropy.h"cxx . . $ `<file>/netgames/entropy/Entropy.h`/
102 #include "Entropystr.h"cxx . . $ `<file>/netgames/entropy/Entropystr.h`/ //our string table for Entropy
103 #include "EntropyAux.h"cxx . . $ `<file>/netgames/entropy/EntropyAux.h`/
104
105 // the DMFC object, used throughout, and required by all mods
106 IDMFCcxx . . $ IDMFC# *DMFCBasecxx . . $ DMFCBase. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
107 // our DmfcStats object, used for the F7 screen
108 static IDmfcStatscxx . . $ IDmfcStats# *dstatcxx . . $ dstat. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
109 // these are some helper pointers, so we don't have to constantly query
110 // DMFC for these arrays, we can query once and just save it for just future use.
111 objectcxx . . $ object# *dObjectscxx . . $ dObjects.;
112 static playercxx . . $ player# *dPlayerscxx . . $ dPlayers.;
113 roomcxx . . $ room# *dRoomscxx . . $ dRooms.;
114
115 ////////////////////////////////////////////////////
116 // Customization flags
117 // These are 'the rules' to Entropy basically
118
119 // scoring
120 #define SCORE_PLYR_TAKEOVER_ROOMcxx . . $ `netgames/entropy/EntropyBase.cpp:120:9`! 5 // num points for a player when he/she takes over a room
121 #define SCORE_TEAM_WINSGAMEcxx . . $ `netgames/entropy/EntropyBase.cpp:121:9`! 10 // num points for a team when they win a round
122 #define SCORE_TEAM_TAKEOVER_ROOMcxx . . $ `netgames/entropy/EntropyBase.cpp:122:9`! 3 // num points for a team when a teammate of their's takes over a room
123
124 // rates
125 #define REPAIR_RATEcxx . . $ `netgames/entropy/EntropyBase.cpp:125:9`! 5.0f // units/sec of the repair room
126 #define ENERGY_RATEcxx . . $ `netgames/entropy/EntropyBase.cpp:126:9`! 5.0f // units/sec of the energy room
127 #define DAMAGE_RATEcxx . . $ `netgames/entropy/EntropyBase.cpp:127:9`! 5.0f // units/sec of damage when in an enemy room
128 #define ENERGY_CAPcxx . . $ `netgames/entropy/EntropyBase.cpp:128:9`! 100.0f // max energy given to a player via an Energy room
129 #define SHIELD_CAPcxx . . $ `netgames/entropy/EntropyBase.cpp:129:9`! 100.0f // max shields given to a player via a Repair room
130 #define VIRUS_SPEWcxx . . $ `netgames/entropy/EntropyBase.cpp:130:9`! 20.0f // How long it takes for a lab to spew a virus
131 #define VIRUS_PER_KILLcxx . . $ `netgames/entropy/EntropyBase.cpp:131:9`! 2.0f // How many virii a player can carry per kill-in-a-row.
132
133 #define MINIMUM_VIRUS_COUNTcxx . . $ `netgames/entropy/EntropyBase.cpp:133:9`! 5 // Minimum number of virii needed to take over a room
134 #define TAKEOVER_TIMEcxx . . $ `netgames/entropy/EntropyBase.cpp:134:9`! 3.0f // How long a player must stand still to take over a room
135
136 ////////////////////////////////////////////////////
137 struct tPlayerPoscxx . . $ tPlayerPos# {
138 float total_timecxx . . $ tPlayerPos#total_time.;
139 vectorcxx . . $ vector# last_poscxx . . $ tPlayerPos#last_pos.;
140 };
141
142 struct tPlayerStatcxx . . $ tPlayerStat# { // Overall scores (throughout the game)
143 int Scorecxx . . $ tPlayerStat#Score.[2];
144 };
145 static int pack_pstatcxx . . $ pack_pstat(60b9885aab282f36).(tPlayerStatcxx . . $ tPlayerStat# *user_info, uint8_tcxx . . $ uint8_t# *data);
146 static int unpack_pstatcxx . . $ unpack_pstat(60b9885aab282f36).(tPlayerStatcxx . . $ tPlayerStat# *user_info, uint8_tcxx . . $ uint8_t# *data);
147 int pack_pstatcxx . . $ pack_pstat(60b9885aab282f36).(tPlayerStatcxx . . $ tPlayerStat# *user_info, uint8_tcxx . . $ uint8_t# *data) {
148 int count = 0;
149 MultiAddIntcxx . . $ MultiAddInt(49f79918a3afee3).(user_info->Scorecxx . . $ tPlayerStat#Score.[0], data, &count);
150 MultiAddIntcxx . . $ MultiAddInt(49f79918a3afee3).(user_info->Scorecxx . . $ tPlayerStat#Score.[1], data, &count);
151 return count;
152 }
153
154 int unpack_pstatcxx . . $ unpack_pstat(60b9885aab282f36).(tPlayerStatcxx . . $ tPlayerStat# *user_info, uint8_tcxx . . $ uint8_t# *data) {
155 int count = 0;
156 user_info->Scorecxx . . $ tPlayerStat#Score.[0] = MultiGetIntcxx . . $ MultiGetInt(7337501fe74387bd).(data, &count);
157 user_info->Scorecxx . . $ tPlayerStat#Score.[1] = MultiGetIntcxx . . $ MultiGetInt(7337501fe74387bd).(data, &count);
158 return count;
159 }
160
161 int TeamOwnedRoomscxx . . $ TeamOwnedRooms.[NUM_TEAMScxx . . $ `netgames/entropy/EntropyAux.h:41:9`!];
162 static int TeamViriicxx . . $ TeamVirii.[NUM_TEAMScxx . . $ `netgames/entropy/EntropyAux.h:41:9`!][MAX_VIRIIcxx . . $ `netgames/entropy/EntropyAux.h:39:9`!];
163 int NumberOfKillsSinceLastDeathcxx . . $ NumberOfKillsSinceLastDeath.[DLLMAX_PLAYERScxx . . $ `netgames/includes/DMFC.h:425:9`!];
164 static int SortedPLRPlayerscxx . . $ SortedPLRPlayers.[NUM_TEAMScxx . . $ `netgames/entropy/EntropyAux.h:41:9`!][MAX_PLAYER_RECORDScxx . . $ `netgames/includes/DMFC.h:526:9`!];
165 int TeamScorecxx . . $ TeamScore.[NUM_TEAMScxx . . $ `netgames/entropy/EntropyAux.h:41:9`!];
166 static int SortedTeamscxx . . $ SortedTeams.[NUM_TEAMScxx . . $ `netgames/entropy/EntropyAux.h:41:9`!];
167 static int SortedPlayerscxx . . $ SortedPlayers.[MAX_PLAYER_RECORDScxx . . $ `netgames/includes/DMFC.h:526:9`!];
168 int EnergyTextcxx . . $ EnergyText.[NUM_TEAMScxx . . $ `netgames/entropy/EntropyAux.h:41:9`!];
169 int RepairTextcxx . . $ RepairText.[NUM_TEAMScxx . . $ `netgames/entropy/EntropyAux.h:41:9`!];
170 int LabTextcxx . . $ LabText.[NUM_TEAMScxx . . $ `netgames/entropy/EntropyAux.h:41:9`!];
171 static tPlayerPoscxx . . $ tPlayerPos# TimeInRoomcxx . . $ TimeInRoom.[DLLMAX_PLAYERScxx . . $ `netgames/includes/DMFC.h:425:9`!];
172 static bool DisplayScoreScreencxx . . $ DisplayScoreScreen.;
173 int virus_idcxx . . $ virus_id. = -1;
174 int *RoomListcxx . . $ RoomList. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
175 int RoomCountcxx . . $ RoomCount.;
176 static int Highlight_bmpcxx . . $ Highlight_bmp. = -1;
177 static bool display_my_welcomecxx . . $ display_my_welcome. = false;
178 static float Server_last_play_damage_soundcxx . . $ Server_last_play_damage_sound. = 0;
179 static int Player_who_took_over_last_basecxx . . $ Player_who_took_over_last_base. = -1;
180
181 static int snd_repair_centercxx . . $ snd_repair_center. = -1;
182 static int snd_energy_centercxx . . $ snd_energy_center. = -1;
183 static int snd_scorecxx . . $ snd_score. = -1;
184 static int snd_virus_destroycxx . . $ snd_virus_destroy. = -1;
185 static int snd_damagecxx . . $ snd_damage. = -1;
186 static int snd_virus_pickupcxx . . $ snd_virus_pickup. = -1;
187
188 // void DisplayScores(void);
189 static void DisplayHUDScorescxx . . $ DisplayHUDScores(c7a20e4e05358911).(struct tHUDItemcxx . . $ tHUDItem# *hitem);
190 static void DisplayWelcomeMessagecxx . . $ DisplayWelcomeMessage(d4f767463ce0a6b3).(int player_num);
191 static void SortTeamScorescxx . . $ SortTeamScores(ce8f7825f8908cfa).(int *sortedindex, int *scores);
192 static void SaveStatsToFilecxx . . $ SaveStatsToFile(fda57c8427c60377).(char *filename);
193 static void OnLabSpewTimercxx . . $ OnLabSpewTimer(49f6e7a06ebc5aa8).(void);
194 void RemoveVirusFromPlayercxx . . $ RemoveVirusFromPlayer(918ebd27a9ddbad3).(int player_num, bool remove_all);
195 static bool ScanForLaboratorycxx . . $ ScanForLaboratory(4acd69fbb01c1943).(int team, int *newlab);
196 static bool CompareDistanceTravelcxx . . $ CompareDistanceTravel(73e76fc48bf5de61).(vectorcxx . . $ vector# *curr_pos, vectorcxx . . $ vector# *last_pos);
197 static void OnDisconnectSaveStatsToFilecxx . . $ OnDisconnectSaveStatsToFile(49f6e7a06ebc5aa8).(void);
198 static void OnLevelEndSaveStatsToFilecxx . . $ OnLevelEndSaveStatsToFile(49f6e7a06ebc5aa8).(void);
199 static void OnGetTokenStringcxx . . $ OnGetTokenString(655c4eff246c5519).(char *src, char *dest, int dest_size);
200 // Player in special room functions
201 static void DoIntervalPlayerFramecxx . . $ DoIntervalPlayerFrame(49f6e7a06ebc5aa8).(void);
202 static void DoPlayerInLabcxx . . $ DoPlayerInLab(43c79ee2f1b9aefe).(int pnum, float time);
203 static void DoPlayerInEnergycxx . . $ DoPlayerInEnergy(43c79ee2f1b9aefe).(int pnum, float time);
204 static void DoPlayerInRepaircxx . . $ DoPlayerInRepair(43c79ee2f1b9aefe).(int pnum, float time);
205 static void DoPlayerInEnemycxx . . $ DoPlayerInEnemy(43c79ee2f1b9aefe).(int pnum, float time);
206
207 extern void DoServerConfigureDialogcxx . . $ DoServerConfigureDialog(49f6e7a06ebc5aa8).(void);
208 static void OnPrintScorescxx . . $ OnPrintScores(d4f767463ce0a6b3).(int level);
209
210 ///////////////////////////////////////////////
211 // localization info
212 static char **StringTablecxx . . $ StringTable.;
213 static int StringTableSizecxx . . $ StringTableSize. = 0;
214 static const char *_ErrorStringcxx . . $ _ErrorString. = "Missing String";
215 const char *GetStringFromTablecxx . . $ GetStringFromTable(f7ae7e56280f18ae).(int d) {
216 if ((d < 0) || (d >= StringTableSizecxx . . $ StringTableSize.))
217 return _ErrorStringcxx . . $ _ErrorString.;
218 else
219 return StringTablecxx . . $ StringTable.[d];
220 }
221 ///////////////////////////////////////////////
222
223 // This function gets called by the game when it wants to learn some info about the game
224 void DLLFUNCCALLcxx . . $ `lib/module.h:93:10`! DLLGetGameInfocxx . . $ DLLGetGameInfo(e5c6dce1fbda187a).(tDLLOptionscxx . . $ tDLLOptions# *options) {
225 options->flagscxx . . $ tDLLOptions#flags. = DOF_MAXTEAMScxx . . $ `netgames/includes/gamedll_header.h:105:9`! | DOF_MINTEAMScxx . . $ `netgames/includes/gamedll_header.h:106:9`!;
226 options->max_teamscxx . . $ tDLLOptions#max_teams. = NUM_TEAMScxx . . $ `netgames/entropy/EntropyAux.h:41:9`!;
227 options->min_teamscxx . . $ tDLLOptions#min_teams. = NUM_TEAMScxx . . $ `netgames/entropy/EntropyAux.h:41:9`!;
228 strcpy(options->game_namecxx . . $ tDLLOptions#game_name., TXT_GAMENAMEcxx . . $ `netgames/entropy/Entropystr.h:31:9`!);
229 strcpy(options->requirementscxx . . $ tDLLOptions#requirements., "ENTROPY");
230 }
231
232 void DetermineScorecxx . . $ DetermineScore(74c02bb7c84e7fae).(int precord_num, int column_num, char *buffer, int buffer_size) {
233 player_recordcxx . . $ player_record# *pr = DMFCBasecxx . . $ DMFCBase.->GetPlayerRecordcxx . . $ IDMFC#GetPlayerRecord(6359c6f28dd028ae).(precord_num);
234 if (!pr || pr->statecxx . . $ player_record#state. == STATE_EMPTYcxx . . $ STATE_EMPTY.) {
235 buffer[0] = '\0';
236 return;
237 }
238
239 tPlayerStatcxx . . $ tPlayerStat# *stat = (tPlayerStatcxx . . $ tPlayerStat# *)pr->user_infocxx . . $ player_record#user_info.;
240 snprintf(buffer, buffer_size, "%d[%d]", (stat) ? stat->Scorecxx . . $ tPlayerStat#Score.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!] : 0,
241 (stat) ? stat->Scorecxx . . $ tPlayerStat#Score.[DSTAT_OVERALLcxx . . $ `netgames/includes/DMFC.h:528:9`!] : 0);
242 }
243
244 void TeamScoreCallbackcxx . . $ TeamScoreCallback(99469d7ff9a1485a).(int team, char *buffer, int buffer_size) {
245 ASSERTcxx . . $ `netgames/includes/DMFC.h:370:9`!(team >= 0 && team < NUM_TEAMScxx . . $ `netgames/entropy/EntropyAux.h:41:9`!);
246
247 snprintf(buffer, buffer_size, " %d", TeamScorecxx . . $ TeamScore.[team]);
248 }
249
250 // Initializes the game function pointers
251 void DLLFUNCCALLcxx . . $ `lib/module.h:93:10`! DLLGameInitcxx . . $ DLLGameInit(937c1f75cb8fa6b1).(int *api_func, uint8_tcxx . . $ uint8_t# *all_ok, int num_teams_to_use) {
252 *all_ok = 1;
253 DMFCBasecxx . . $ DMFCBase. = CreateDMFC();
254 if (!DMFCBasecxx . . $ DMFCBase.) {
255 *all_ok = 0;
256 return;
257 }
258
259 dstatcxx . . $ dstat. = CreateDmfcStats();
260 if (!dstatcxx . . $ dstat.) {
261 *all_ok = 0;
262 return;
263 }
264
265 DMFCBasecxx . . $ DMFCBase.->LoadFunctionscxx . . $ IDMFC#LoadFunctions(11b0e290e57a7e53).(api_func);
266
267 // Setup event handlers
268 DMFCBasecxx . . $ DMFCBase.->Set_OnGameStateRequestcxx . . $ IDMFC#Set_OnGameStateRequest(94eb4457dc8d4d10).(OnGameStateRequestcxx . . $ OnGameStateRequest(d4f767463ce0a6b3).);
269 DMFCBasecxx . . $ DMFCBase.->Set_OnClientPlayerKilledcxx . . $ IDMFC#Set_OnClientPlayerKilled(7da43329b4117518).(OnClientPlayerKilledcxx . . $ OnClientPlayerKilled(766a1b7183ffa4b4).);
270 DMFCBasecxx . . $ DMFCBase.->Set_OnServerGameCreatedcxx . . $ IDMFC#Set_OnServerGameCreated(964b12a25712bdc3).(OnServerGameCreatedcxx . . $ OnServerGameCreated(49f6e7a06ebc5aa8).);
271 DMFCBasecxx . . $ DMFCBase.->Set_OnClientLevelStartcxx . . $ IDMFC#Set_OnClientLevelStart(964b12a25712bdc3).(OnClientLevelStartcxx . . $ OnClientLevelStart(49f6e7a06ebc5aa8).);
272 DMFCBasecxx . . $ DMFCBase.->Set_OnClientLevelEndcxx . . $ IDMFC#Set_OnClientLevelEnd(964b12a25712bdc3).(OnClientLevelEndcxx . . $ OnClientLevelEnd(49f6e7a06ebc5aa8).);
273 DMFCBasecxx . . $ DMFCBase.->Set_OnClientPlayerEntersGamecxx . . $ IDMFC#Set_OnClientPlayerEntersGame(94eb4457dc8d4d10).(OnClientPlayerEntersGamecxx . . $ OnClientPlayerEntersGame(d4f767463ce0a6b3).);
274 DMFCBasecxx . . $ DMFCBase.->Set_OnIntervalcxx . . $ IDMFC#Set_OnInterval(964b12a25712bdc3).(OnIntervalcxx . . $ OnInterval(49f6e7a06ebc5aa8).);
275 DMFCBasecxx . . $ DMFCBase.->Set_OnHUDIntervalcxx . . $ IDMFC#Set_OnHUDInterval(964b12a25712bdc3).(OnHUDIntervalcxx . . $ OnHUDInterval(49f6e7a06ebc5aa8).);
276 DMFCBasecxx . . $ DMFCBase.->Set_OnKeypresscxx . . $ IDMFC#Set_OnKeypress(94eb4457dc8d4d10).(OnKeypresscxx . . $ OnKeypress(d4f767463ce0a6b3).);
277 DMFCBasecxx . . $ DMFCBase.->Set_OnPLRIntervalcxx . . $ IDMFC#Set_OnPLRInterval(964b12a25712bdc3).(OnPLRIntervalcxx . . $ OnPLRInterval(49f6e7a06ebc5aa8).);
278 DMFCBasecxx . . $ DMFCBase.->Set_OnPLRInitcxx . . $ IDMFC#Set_OnPLRInit(964b12a25712bdc3).(OnPLRInitcxx . . $ OnPLRInit(49f6e7a06ebc5aa8).);
279 DMFCBasecxx . . $ DMFCBase.->Set_OnSaveStatsToFilecxx . . $ IDMFC#Set_OnSaveStatsToFile(964b12a25712bdc3).(OnSaveStatsToFilecxx . . $ OnSaveStatsToFile(49f6e7a06ebc5aa8).);
280 DMFCBasecxx . . $ DMFCBase.->Set_OnLevelEndSaveStatsToFilecxx . . $ IDMFC#Set_OnLevelEndSaveStatsToFile(964b12a25712bdc3).(OnLevelEndSaveStatsToFilecxx . . $ OnLevelEndSaveStatsToFile(49f6e7a06ebc5aa8).);
281 DMFCBasecxx . . $ DMFCBase.->Set_OnDisconnectSaveStatsToFilecxx . . $ IDMFC#Set_OnDisconnectSaveStatsToFile(964b12a25712bdc3).(OnDisconnectSaveStatsToFilecxx . . $ OnDisconnectSaveStatsToFile(49f6e7a06ebc5aa8).);
282 DMFCBasecxx . . $ DMFCBase.->Set_OnClientPlayerDisconnectcxx . . $ IDMFC#Set_OnClientPlayerDisconnect(94eb4457dc8d4d10).(OnClientPlayerDisconnectcxx . . $ OnClientPlayerDisconnect(d4f767463ce0a6b3).);
283 DMFCBasecxx . . $ DMFCBase.->Set_OnServerPlayerChangeSegmentcxx . . $ IDMFC#Set_OnServerPlayerChangeSegment(d20c6d03e4c9e417).(OnServerPlayerChangeSegmentcxx . . $ OnServerPlayerChangeSegment(b1146eedae1e1d0b).);
284 DMFCBasecxx . . $ DMFCBase.->Set_OnClientPlayerChangeSegmentcxx . . $ IDMFC#Set_OnClientPlayerChangeSegment(d20c6d03e4c9e417).(OnClientPlayerChangeSegmentcxx . . $ OnClientPlayerChangeSegment(b1146eedae1e1d0b).);
285 DMFCBasecxx . . $ DMFCBase.->Set_OnServerCollidecxx . . $ IDMFC#Set_OnServerCollide(74ea2c9f51d3637e).(OnServerCollidecxx . . $ OnServerCollide(6273fa812ac58a8).);
286 DMFCBasecxx . . $ DMFCBase.->Set_OnControlMessagecxx . . $ IDMFC#Set_OnControlMessage(38191377d105579d).(OnControlMessagecxx . . $ OnControlMessage(d5cb1b1d97598ec6).);
287 DMFCBasecxx . . $ DMFCBase.->Set_OnClientShowUIcxx . . $ IDMFC#Set_OnClientShowUI(5275d8c1b1c0b8a7).(OnClientShowUIcxx . . $ OnClientShowUI(6ca3d68f5c5f0975).);
288 DMFCBasecxx . . $ DMFCBase.->Set_OnGetTokenStringcxx . . $ IDMFC#Set_OnGetTokenString(723abb0b76eae20f).(OnGetTokenStringcxx . . $ OnGetTokenString(655c4eff246c5519).);
289 DMFCBasecxx . . $ DMFCBase.->Set_OnPrintScorescxx . . $ IDMFC#Set_OnPrintScores(94eb4457dc8d4d10).(OnPrintScorescxx . . $ OnPrintScores(d4f767463ce0a6b3).);
290
291 // Setup arrays for easier to read code
292 dObjectscxx . . $ dObjects. = DMFCBasecxx . . $ DMFCBase.->GetObjectscxx . . $ IDMFC#GetObjects(26f25deff401d7e4).();
293 dPlayerscxx . . $ dPlayers. = DMFCBasecxx . . $ DMFCBase.->GetPlayerscxx . . $ IDMFC#GetPlayers(51ff8e716a252304).();
294 dRoomscxx . . $ dRooms. = DMFCBasecxx . . $ DMFCBase.->GetRoomscxx . . $ IDMFC#GetRooms(80f895f1fc5a89de).();
295
296 netgame_infocxx . . $ netgame_info# *Netgame = DMFCBasecxx . . $ DMFCBase.->GetNetgameInfocxx . . $ IDMFC#GetNetgameInfo(242e78cd5130aa12).();
297 Netgame->flagscxx . . $ netgame_info#flags. |= (NF_TRACK_RANKcxx . . $ `Descent3/multi_external.h:243:9`!);
298
299 DMFCBasecxx . . $ DMFCBase.->GameInitcxx . . $ IDMFC#GameInit(d4f767463ce0a6b3).(NUM_TEAMScxx . . $ `netgames/entropy/EntropyAux.h:41:9`!);
300 DLLCreateStringTable("entropy.str", &StringTablecxx . . $ StringTable., &StringTableSizecxx . . $ StringTableSize.);
301 DLLmprintfcxx . . $ `netgames/includes/DMFC.h:343:9`!(0, "%d strings loaded from string table\n", StringTableSize);
302 if (!StringTableSizecxx . . $ StringTableSize.) {
303 *all_ok = 0;
304 return;
305 }
306
307 // add the death and suicide messages
308 DMFCBasecxx . . $ DMFCBase.->AddDeathMessagecxx . . $ IDMFC#AddDeathMessage(90ef5b561fbcb8de).(TXT_KILLAcxx . . $ `netgames/entropy/Entropystr.h:32:9`!, true);
309
310 DMFCBasecxx . . $ DMFCBase.->AddSuicideMessagecxx . . $ IDMFC#AddSuicideMessage(85c52e162fed56f9).(TXT_SUICIDEAcxx . . $ `netgames/entropy/Entropystr.h:33:9`!);
311
312 // register special packet receivers
313 DMFCBasecxx . . $ DMFCBase.->RegisterPacketReceivercxx . . $ IDMFC#RegisterPacketReceiver(6efe5766e3bef270).(SPID_NEWPLAYERcxx . . $ `netgames/entropy/EntropyAux.h:27:9`!, GetGameStartPacketcxx . . $ GetGameStartPacket(f25546b61a629de7).);
314 DMFCBasecxx . . $ DMFCBase.->RegisterPacketReceivercxx . . $ IDMFC#RegisterPacketReceiver(6efe5766e3bef270).(SPID_TAKEOVERcxx . . $ `netgames/entropy/EntropyAux.h:28:9`!, ReceiveTakeOverPacketcxx . . $ ReceiveTakeOverPacket(f25546b61a629de7).);
315 DMFCBasecxx . . $ DMFCBase.->RegisterPacketReceivercxx . . $ IDMFC#RegisterPacketReceiver(6efe5766e3bef270).(SPID_ROOMINFOcxx . . $ `netgames/entropy/EntropyAux.h:30:9`!, ReceiveRoomInfocxx . . $ ReceiveRoomInfo(f25546b61a629de7).);
316 DMFCBasecxx . . $ DMFCBase.->RegisterPacketReceivercxx . . $ IDMFC#RegisterPacketReceiver(6efe5766e3bef270).(SPID_PICKUPVIRUScxx . . $ `netgames/entropy/EntropyAux.h:31:9`!, ReceivePickupViruscxx . . $ ReceivePickupVirus(f25546b61a629de7).);
317 DMFCBasecxx . . $ DMFCBase.->RegisterPacketReceivercxx . . $ IDMFC#RegisterPacketReceiver(6efe5766e3bef270).(SPID_VIRUSCREATEcxx . . $ `netgames/entropy/EntropyAux.h:32:9`!, DoVirusCreatecxx . . $ DoVirusCreate(f25546b61a629de7).);
318
319 DMFCBasecxx . . $ DMFCBase.->SetNumberOfTeamscxx . . $ IDMFC#SetNumberOfTeams(d4f767463ce0a6b3).(NUM_TEAMScxx . . $ `netgames/entropy/EntropyAux.h:41:9`!);
320
321 DMFCBasecxx . . $ DMFCBase.->AddHUDItemCallbackcxx . . $ IDMFC#AddHUDItemCallback(97c9b33f56b4265c).(HI_TEXTcxx . . $ `netgames/includes/DMFC.h:440:9`!, DisplayHUDScorescxx . . $ DisplayHUDScores(c7a20e4e05358911).);
322
323 EnergyTextcxx . . $ EnergyText.[RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`!] = DLLFindTextureName("RedEnergy");
324 EnergyTextcxx . . $ EnergyText.[BLUE_TEAMcxx . . $ `netgames/includes/DMFC.h:428:9`!] = DLLFindTextureName("BlueEnergy");
325 RepairTextcxx . . $ RepairText.[RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`!] = DLLFindTextureName("RedRepair");
326 RepairTextcxx . . $ RepairText.[BLUE_TEAMcxx . . $ `netgames/includes/DMFC.h:428:9`!] = DLLFindTextureName("BlueRepair");
327 LabTextcxx . . $ LabText.[RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`!] = DLLFindTextureName("RedLab");
328 LabTextcxx . . $ LabText.[BLUE_TEAMcxx . . $ `netgames/includes/DMFC.h:428:9`!] = DLLFindTextureName("BlueLab");
329
330 snd_repair_centercxx . . $ snd_repair_center. = DLLFindSoundName("EntropyRepair");
331 snd_energy_centercxx . . $ snd_energy_center. = DLLFindSoundName("EntropyEnergy");
332 snd_scorecxx . . $ snd_score. = DLLFindSoundName("EntropyScore");
333 snd_virus_destroycxx . . $ snd_virus_destroy. = DLLFindSoundName("EntropyDestroy");
334 snd_damagecxx . . $ snd_damage. = DLLFindSoundName("HitEnergy");
335 snd_virus_pickupcxx . . $ snd_virus_pickup. = DLLFindSoundName("Powerup pickup");
336
337 DMFCBasecxx . . $ DMFCBase.->SetupPlayerRecordcxx . . $ IDMFC#SetupPlayerRecord(7df49e8a00e47932).(sizeof(tPlayerStatcxx . . $ tPlayerStat#), (int (*)(void *, uint8_tcxx . . $ uint8_t# *))pack_pstatcxx . . $ pack_pstat(60b9885aab282f36).,
338 (int (*)(void *, uint8_tcxx . . $ uint8_t# *))unpack_pstatcxx . . $ unpack_pstat(60b9885aab282f36).);
339
340 virus_idcxx . . $ virus_id. = DLLFindObjectIDName("EntropyVirus");
341
342 DisplayScoreScreencxx . . $ DisplayScoreScreen. = false;
343
344 Highlight_bmpcxx . . $ Highlight_bmp. = DLLbm_AllocBitmap(32, 32, 0);
345 if (Highlight_bmpcxx . . $ Highlight_bmp. > BAD_BITMAP_HANDLEcxx . . $ `lib/bitmap.h:42:9`!) {
346 uint16_tcxx . . $ uint16_t# *data = DLLbm_data(Highlight_bmpcxx . . $ Highlight_bmp., 0);
347 if (!data) {
348 // bail on out of here
349 *all_ok = 0;
350 return;
351 }
352 for (int x = 0; x < 32 * 32; x++) {
353 data[x] = GR_RGB16cxx . . $ GR_RGB16(6461fafb79bad5b9).(50, 50, 50) | OPAQUE_FLAGcxx . . $ `lib/grdefs.h:72:9`!;
354 }
355 }
356
357 // Initialize the Stats Manager
358 // ----------------------------
359 tDmfcStatsInitcxx . . $ tDmfcStatsInit# tsi;
360 tDmfcStatsColumnInfocxx . . $ tDmfcStatsColumnInfo# pl_col[6];
361 char gname[20];
362 strcpy(gname, TXT_STATSGAMENAMEcxx . . $ `netgames/entropy/Entropystr.h:61:9`!);
363
364 tsi.flagscxx . . $ tDmfcStatsInit#flags. = DSIF_SHOW_PICcxx . . $ `netgames/includes/DMFC.h:619:9`! | DSIF_SHOW_OBSERVERICONcxx . . $ `netgames/includes/DMFC.h:627:9`! | DSIF_SEPERATE_BY_TEAMcxx . . $ `netgames/includes/DMFC.h:615:9`!;
365 tsi.cColumnCountDetailedcxx . . $ tDmfcStatsInit#cColumnCountDetailed. = 0;
366 tsi.cColumnCountPlayerListcxx . . $ tDmfcStatsInit#cColumnCountPlayerList. = 6;
367 tsi.clbDetailedColumnBMPcxx . . $ tDmfcStatsInit#clbDetailedColumnBMP. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
368 tsi.clbDetailedColumncxx . . $ tDmfcStatsInit#clbDetailedColumn. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
369 tsi.clbPlayerColumncxx . . $ tDmfcStatsInit#clbPlayerColumn. = DetermineScorecxx . . $ DetermineScore(74c02bb7c84e7fae).;
370 tsi.clbPlayerColumnBMPcxx . . $ tDmfcStatsInit#clbPlayerColumnBMP. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
371 tsi.DetailedColumnscxx . . $ tDmfcStatsInit#DetailedColumns. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
372 tsi.GameNamecxx . . $ tDmfcStatsInit#GameName. = gname;
373 tsi.MaxNumberDisplayedcxx . . $ tDmfcStatsInit#MaxNumberDisplayed. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
374 tsi.PlayerListColumnscxx . . $ tDmfcStatsInit#PlayerListColumns. = pl_col;
375 tsi.SortedPlayerRecordscxx . . $ tDmfcStatsInit#SortedPlayerRecords. = SortedPlayerscxx . . $ SortedPlayers.;
376 tsi.clTeamLinecxx . . $ tDmfcStatsInit#clTeamLine. = TeamScoreCallbackcxx . . $ TeamScoreCallback(99469d7ff9a1485a).;
377
378 pl_col[0].color_typecxx . . $ tDmfcStatsColumnInfo#color_type. = DSCOLOR_TEAMcxx . . $ DSCOLOR_TEAM.;
379 strcpy(pl_col[0].titlecxx . . $ tDmfcStatsColumnInfo#title., TXT_PILOTcxx . . $ `netgames/entropy/Entropystr.h:34:9`!);
380 pl_col[0].typecxx . . $ tDmfcStatsColumnInfo#type. = DSCOL_PILOT_NAMEcxx . . $ DSCOL_PILOT_NAME.;
381 pl_col[0].widthcxx . . $ tDmfcStatsColumnInfo#width. = 120;
382
383 pl_col[1].color_typecxx . . $ tDmfcStatsColumnInfo#color_type. = DSCOLOR_TEAMcxx . . $ DSCOLOR_TEAM.;
384 strcpy(pl_col[1].titlecxx . . $ tDmfcStatsColumnInfo#title., TXT_SCOREcxx . . $ `netgames/entropy/Entropystr.h:35:9`!);
385 pl_col[1].typecxx . . $ tDmfcStatsColumnInfo#type. = DSCOL_CUSTOMcxx . . $ DSCOL_CUSTOM.;
386 pl_col[1].widthcxx . . $ tDmfcStatsColumnInfo#width. = 47;
387
388 pl_col[2].color_typecxx . . $ tDmfcStatsColumnInfo#color_type. = DSCOLOR_TEAMcxx . . $ DSCOLOR_TEAM.;
389 strcpy(pl_col[2].titlecxx . . $ tDmfcStatsColumnInfo#title., TXT_KILLScxx . . $ `netgames/entropy/Entropystr.h:36:9`!);
390 pl_col[2].typecxx . . $ tDmfcStatsColumnInfo#type. = DSCOL_KILLS_LEVELcxx . . $ DSCOL_KILLS_LEVEL.;
391 pl_col[2].widthcxx . . $ tDmfcStatsColumnInfo#width. = 47;
392
393 pl_col[3].color_typecxx . . $ tDmfcStatsColumnInfo#color_type. = DSCOLOR_TEAMcxx . . $ DSCOLOR_TEAM.;
394 strcpy(pl_col[3].titlecxx . . $ tDmfcStatsColumnInfo#title., TXT_DEATHScxx . . $ `netgames/entropy/Entropystr.h:37:9`!);
395 pl_col[3].typecxx . . $ tDmfcStatsColumnInfo#type. = DSCOL_DEATHS_LEVELcxx . . $ DSCOL_DEATHS_LEVEL.;
396 pl_col[3].widthcxx . . $ tDmfcStatsColumnInfo#width. = 57;
397
398 pl_col[4].color_typecxx . . $ tDmfcStatsColumnInfo#color_type. = DSCOLOR_TEAMcxx . . $ DSCOLOR_TEAM.;
399 strcpy(pl_col[4].titlecxx . . $ tDmfcStatsColumnInfo#title., TXT_SUICIDEScxx . . $ `netgames/entropy/Entropystr.h:38:9`!);
400 pl_col[4].typecxx . . $ tDmfcStatsColumnInfo#type. = DSCOL_SUICIDES_LEVELcxx . . $ DSCOL_SUICIDES_LEVEL.;
401 pl_col[4].widthcxx . . $ tDmfcStatsColumnInfo#width. = 62;
402
403 pl_col[5].color_typecxx . . $ tDmfcStatsColumnInfo#color_type. = DSCOLOR_TEAMcxx . . $ DSCOLOR_TEAM.;
404 strcpy(pl_col[5].titlecxx . . $ tDmfcStatsColumnInfo#title., TXT_PINGcxx . . $ `netgames/entropy/Entropystr.h:39:9`!);
405 pl_col[5].typecxx . . $ tDmfcStatsColumnInfo#type. = DSCOL_PINGcxx . . $ DSCOL_PING.;
406 pl_col[5].widthcxx . . $ tDmfcStatsColumnInfo#width. = 40;
407
408 dstatcxx . . $ dstat.->Initializecxx . . $ IDmfcStats#Initialize(645910a8ad01b658).(&tsi);
409 }
410 // Called when the DLL is shutdown
411 void DLLFUNCCALLcxx . . $ `lib/module.h:93:10`! DLLGameClosecxx . . $ DLLGameClose(49f6e7a06ebc5aa8).() {
412 if (Highlight_bmpcxx . . $ Highlight_bmp. > BAD_BITMAP_HANDLEcxx . . $ `lib/bitmap.h:42:9`!)
413 DLLbm_FreeBitmap(Highlight_bmpcxx . . $ Highlight_bmp.);
414
415 if (RoomListcxx . . $ RoomList.) {
416 freecxx . . $ free(bd21765a0afc8e3c).(RoomListcxx . . $ RoomList.);
417 RoomListcxx . . $ RoomList. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
418 }
419
420 DLLDestroyStringTable(StringTablecxx . . $ StringTable., StringTableSizecxx . . $ StringTableSize.);
421
422 if (dstatcxx . . $ dstat.) {
423 dstatcxx . . $ dstat.->DestroyPointercxx . . $ IObject#DestroyPointer(49f6e7a06ebc5aa8).();
424 dstatcxx . . $ dstat. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
425 }
426
427 if (DMFCBasecxx . . $ DMFCBase.) {
428 DMFCBasecxx . . $ DMFCBase.->GameClosecxx . . $ IDMFC#GameClose(49f6e7a06ebc5aa8).();
429 DMFCBasecxx . . $ DMFCBase.->DestroyPointercxx . . $ IObject#DestroyPointer(49f6e7a06ebc5aa8).();
430 DMFCBasecxx . . $ DMFCBase. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
431 }
432 }
433
434 // The server has just started, so clear out all the stats and game info
435 void OnServerGameCreatedcxx . . $ OnServerGameCreated(49f6e7a06ebc5aa8).(void) {
436 DMFCBasecxx . . $ DMFCBase.->OnServerGameCreatedcxx . . $ IDMFC#OnServerGameCreated(49f6e7a06ebc5aa8).();
437
438 tPlayerStatcxx . . $ tPlayerStat# *stat;
439 player_recordcxx . . $ player_record# *pr;
440 int i;
441
442 for (i = 0; i < MAX_PLAYER_RECORDScxx . . $ `netgames/includes/DMFC.h:526:9`!; i++) {
443 pr = DMFCBasecxx . . $ DMFCBase.->GetPlayerRecordcxx . . $ IDMFC#GetPlayerRecord(6359c6f28dd028ae).(i);
444 if (pr) {
445 stat = (tPlayerStatcxx . . $ tPlayerStat# *)pr->user_infocxx . . $ player_record#user_info.;
446 if (stat) {
447 stat->Scorecxx . . $ tPlayerStat#Score.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!] = 0;
448 stat->Scorecxx . . $ tPlayerStat#Score.[DSTAT_OVERALLcxx . . $ `netgames/includes/DMFC.h:528:9`!] = 0;
449 }
450 }
451 }
452 for (i = 0; i < NUM_TEAMScxx . . $ `netgames/entropy/EntropyAux.h:41:9`!; i++) {
453 TeamScorecxx . . $ TeamScore.[i] = 0;
454 }
455 }
456
457 // The server has started a new level, so clear out level scores
458 void OnClientLevelStartcxx . . $ OnClientLevelStart(49f6e7a06ebc5aa8).(void) {
459 DMFCBasecxx . . $ DMFCBase.->OnClientLevelStartcxx . . $ IDMFC#OnClientLevelStart(49f6e7a06ebc5aa8).();
460 int i;
461
462 for (i = 0; i < NUM_TEAMScxx . . $ `netgames/entropy/EntropyAux.h:41:9`!; i++) {
463 TeamOwnedRoomscxx . . $ TeamOwnedRooms.[i] = 0;
464 for (int v = 0; v < MAX_VIRIIcxx . . $ `netgames/entropy/EntropyAux.h:39:9`!; v++)
465 TeamViriicxx . . $ TeamVirii.[i][v] = -1;
466 }
467
468 tPlayerStatcxx . . $ tPlayerStat# *stat;
469 player_recordcxx . . $ player_record# *pr;
470 for (i = 0; i < MAX_PLAYER_RECORDScxx . . $ `netgames/includes/DMFC.h:526:9`!; i++) {
471 pr = DMFCBasecxx . . $ DMFCBase.->GetPlayerRecordcxx . . $ IDMFC#GetPlayerRecord(6359c6f28dd028ae).(i);
472 if (pr) {
473 stat = (tPlayerStatcxx . . $ tPlayerStat# *)pr->user_infocxx . . $ player_record#user_info.;
474 if (stat) {
475 stat->Scorecxx . . $ tPlayerStat#Score.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!] = 0;
476 }
477 }
478 }
479
480 // reset damage timer
481 Server_last_play_damage_soundcxx . . $ Server_last_play_damage_sound. = 0;
482
483 // reset the id to -1, so we are ready for the new level
484 Player_who_took_over_last_basecxx . . $ Player_who_took_over_last_base. = -1;
485
486 if (DMFCBasecxx . . $ DMFCBase.->GetLocalRolecxx . . $ IDMFC#GetLocalRole(b126dc7c1de90089).() == LR_SERVERcxx . . $ `Descent3/multi_external.h:129:9`!) {
487 DMFCBasecxx . . $ DMFCBase.->SetTimerIntervalcxx . . $ IDMFC#SetTimerInterval(695c251031f3a34d).(OnLabSpewTimercxx . . $ OnLabSpewTimer(49f6e7a06ebc5aa8)., VIRUS_SPEWcxx . . $ `netgames/entropy/EntropyBase.cpp:130:9`!, -1.0f);
488 }
489
490 if (RoomListcxx . . $ RoomList.) {
491 freecxx . . $ free(bd21765a0afc8e3c).(RoomListcxx . . $ RoomList.);
492 RoomListcxx . . $ RoomList. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
493 }
494 RoomCountcxx . . $ RoomCount. = 0;
495 int r;
496 for (r = 0; r <= DMFCBasecxx . . $ DMFCBase.->GetHighestRoomIndexcxx . . $ IDMFC#GetHighestRoomIndex(b126dc7c1de90089).(); r++) {
497 if (dRoomscxx . . $ dRooms.[r].usedcxx . . $ room#used.) {
498 int flags = dRoomscxx . . $ dRooms.[r].flagscxx . . $ room#flags.;
499 if (flags & RF_SPECIAL1cxx . . $ `Descent3/room_external.h:185:9`! || flags & RF_SPECIAL2cxx . . $ `Descent3/room_external.h:186:9`! || flags & RF_SPECIAL3cxx . . $ `Descent3/room_external.h:187:9`! || flags & RF_SPECIAL4cxx . . $ `Descent3/room_external.h:188:9`! ||
500 flags & RF_SPECIAL5cxx . . $ `Descent3/room_external.h:189:9`! || flags & RF_SPECIAL6cxx . . $ `Descent3/room_external.h:190:9`!) {
501 RoomCountcxx . . $ RoomCount.++;
502 }
503 }
504 }
505
506 if (RoomCountcxx . . $ RoomCount. == 0) {
507 FatalError("No Special Rooms Defined");
508 return;
509 }
510
511 RoomListcxx . . $ RoomList. = (int *)malloccxx . . $ malloc(9f008b2a9698428b).(sizeof(int) * RoomCountcxx . . $ RoomCount.);
512 if (!RoomListcxx . . $ RoomList.) {
513 FatalError("Out of memory");
514 return;
515 }
516
517 bool room_used_already;
518 int special_room_index = 0;
519
520 for (r = 0; r <= DMFCBasecxx . . $ DMFCBase.->GetHighestRoomIndexcxx . . $ IDMFC#GetHighestRoomIndex(b126dc7c1de90089).(); r++) {
521 if (dRoomscxx . . $ dRooms.[r].usedcxx . . $ room#used.) {
522 if (dRoomscxx . . $ dRooms.[r].flagscxx . . $ room#flags. & RF_FUELCENcxx . . $ `Descent3/room_external.h:175:9`!) {
523 dRoomscxx . . $ dRooms.[r].flagscxx . . $ room#flags. &= ~RF_FUELCENcxx . . $ `Descent3/room_external.h:175:9`!;
524 dRoomscxx . . $ dRooms.[r].room_change_flagscxx . . $ room#room_change_flags. |= RCF_GOALSPECIAL_FLAGScxx . . $ `Descent3/multi_world_state.h:62:9`!;
525 }
526
527 room_used_already = false;
528 if (dRoomscxx . . $ dRooms.[r].flagscxx . . $ room#flags. & RF_SPECIAL1cxx . . $ `Descent3/room_external.h:185:9`!) { // Red Team Laboratory
529 TeamOwnedRoomscxx . . $ TeamOwnedRooms.[RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`!]++;
530 room_used_already = true;
531 PaintRoomWithTexturecxx . . $ PaintRoomWithTexture(cf9ef193275fa6d8).(LabTextcxx . . $ LabText.[RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`!], r);
532 RoomListcxx . . $ RoomList.[special_room_index] = r;
533 special_room_index++;
534 }
535 if (dRoomscxx . . $ dRooms.[r].flagscxx . . $ room#flags. & RF_SPECIAL4cxx . . $ `Descent3/room_external.h:188:9`!) { // Blue Team Laboratory
536 if (room_used_already) {
537 dRoomscxx . . $ dRooms.[r].flagscxx . . $ room#flags. &= ~RF_SPECIAL4cxx . . $ `Descent3/room_external.h:188:9`!;
538 dRoomscxx . . $ dRooms.[r].room_change_flagscxx . . $ room#room_change_flags. |= RCF_GOALSPECIAL_FLAGScxx . . $ `Descent3/multi_world_state.h:62:9`!;
539 } else {
540 TeamOwnedRoomscxx . . $ TeamOwnedRooms.[BLUE_TEAMcxx . . $ `netgames/includes/DMFC.h:428:9`!]++;
541 room_used_already = true;
542 PaintRoomWithTexturecxx . . $ PaintRoomWithTexture(cf9ef193275fa6d8).(LabTextcxx . . $ LabText.[BLUE_TEAMcxx . . $ `netgames/includes/DMFC.h:428:9`!], r);
543 RoomListcxx . . $ RoomList.[special_room_index] = r;
544 special_room_index++;
545 }
546 }
547 if (dRoomscxx . . $ dRooms.[r].flagscxx . . $ room#flags. & RF_SPECIAL2cxx . . $ `Descent3/room_external.h:186:9`!) { // Red Team Energy Room
548 if (room_used_already) {
549 dRoomscxx . . $ dRooms.[r].flagscxx . . $ room#flags. &= ~RF_SPECIAL2cxx . . $ `Descent3/room_external.h:186:9`!;
550 dRoomscxx . . $ dRooms.[r].room_change_flagscxx . . $ room#room_change_flags. |= RCF_GOALSPECIAL_FLAGScxx . . $ `Descent3/multi_world_state.h:62:9`!;
551 } else {
552 TeamOwnedRoomscxx . . $ TeamOwnedRooms.[RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`!]++;
553 room_used_already = true;
554 PaintRoomWithTexturecxx . . $ PaintRoomWithTexture(cf9ef193275fa6d8).(EnergyTextcxx . . $ EnergyText.[RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`!], r);
555 RoomListcxx . . $ RoomList.[special_room_index] = r;
556 special_room_index++;
557 }
558 }
559 if (dRoomscxx . . $ dRooms.[r].flagscxx . . $ room#flags. & RF_SPECIAL5cxx . . $ `Descent3/room_external.h:189:9`!) { // Blue Team Energy Room
560 if (room_used_already) {
561 dRoomscxx . . $ dRooms.[r].flagscxx . . $ room#flags. &= ~RF_SPECIAL5cxx . . $ `Descent3/room_external.h:189:9`!;
562 dRoomscxx . . $ dRooms.[r].room_change_flagscxx . . $ room#room_change_flags. |= RCF_GOALSPECIAL_FLAGScxx . . $ `Descent3/multi_world_state.h:62:9`!;
563 } else {
564 TeamOwnedRoomscxx . . $ TeamOwnedRooms.[BLUE_TEAMcxx . . $ `netgames/includes/DMFC.h:428:9`!]++;
565 room_used_already = true;
566 PaintRoomWithTexturecxx . . $ PaintRoomWithTexture(cf9ef193275fa6d8).(EnergyTextcxx . . $ EnergyText.[BLUE_TEAMcxx . . $ `netgames/includes/DMFC.h:428:9`!], r);
567 RoomListcxx . . $ RoomList.[special_room_index] = r;
568 special_room_index++;
569 }
570 }
571 if (dRoomscxx . . $ dRooms.[r].flagscxx . . $ room#flags. & RF_SPECIAL3cxx . . $ `Descent3/room_external.h:187:9`!) { // Red Team Repair Room
572 if (room_used_already) {
573 dRoomscxx . . $ dRooms.[r].flagscxx . . $ room#flags. &= ~RF_SPECIAL3cxx . . $ `Descent3/room_external.h:187:9`!;
574 dRoomscxx . . $ dRooms.[r].room_change_flagscxx . . $ room#room_change_flags. |= RCF_GOALSPECIAL_FLAGScxx . . $ `Descent3/multi_world_state.h:62:9`!;
575 } else {
576 TeamOwnedRoomscxx . . $ TeamOwnedRooms.[RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`!]++;
577 room_used_already = true;
578 PaintRoomWithTexturecxx . . $ PaintRoomWithTexture(cf9ef193275fa6d8).(RepairTextcxx . . $ RepairText.[RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`!], r);
579 RoomListcxx . . $ RoomList.[special_room_index] = r;
580 special_room_index++;
581 }
582 }
583 if (dRoomscxx . . $ dRooms.[r].flagscxx . . $ room#flags. & RF_SPECIAL6cxx . . $ `Descent3/room_external.h:190:9`!) { // Blue Team Repair Room
584 if (room_used_already) {
585 dRoomscxx . . $ dRooms.[r].flagscxx . . $ room#flags. &= ~RF_SPECIAL6cxx . . $ `Descent3/room_external.h:190:9`!;
586 dRoomscxx . . $ dRooms.[r].room_change_flagscxx . . $ room#room_change_flags. |= RCF_GOALSPECIAL_FLAGScxx . . $ `Descent3/multi_world_state.h:62:9`!;
587 } else {
588 TeamOwnedRoomscxx . . $ TeamOwnedRooms.[BLUE_TEAMcxx . . $ `netgames/includes/DMFC.h:428:9`!]++;
589 room_used_already = true;
590 PaintRoomWithTexturecxx . . $ PaintRoomWithTexture(cf9ef193275fa6d8).(RepairTextcxx . . $ RepairText.[BLUE_TEAMcxx . . $ `netgames/includes/DMFC.h:428:9`!], r);
591 RoomListcxx . . $ RoomList.[special_room_index] = r;
592 special_room_index++;
593 }
594 }
595 }
596 }
597
598 // zero out other arrays
599 for (i = 0; i < DLLMAX_PLAYERScxx . . $ `netgames/includes/DMFC.h:425:9`!; i++) {
600 NumberOfKillsSinceLastDeathcxx . . $ NumberOfKillsSinceLastDeath.[i] = 0;
601 TimeInRoomcxx . . $ TimeInRoom.[i].total_timecxx . . $ tPlayerPos#total_time. = 0;
602 RemoveVirusFromPlayercxx . . $ RemoveVirusFromPlayer(918ebd27a9ddbad3).(i, true);
603 }
604
605 if (DMFCBasecxx . . $ DMFCBase.->GetLocalRolecxx . . $ IDMFC#GetLocalRole(b126dc7c1de90089).() == LR_SERVERcxx . . $ `Descent3/multi_external.h:129:9`!) {
606 // spew 3 virii in each lab
607 for (i = 0; i < 3; i++)
608 OnLabSpewTimercxx . . $ OnLabSpewTimer(49f6e7a06ebc5aa8).();
609 }
610
611 DMFCBasecxx . . $ DMFCBase.->RequestGameStatecxx . . $ IDMFC#RequestGameState(49f6e7a06ebc5aa8).();
612 }
613
614 void OnClientLevelEndcxx . . $ OnClientLevelEnd(49f6e7a06ebc5aa8).(void) { DMFCBasecxx . . $ DMFCBase.->OnClientLevelEndcxx . . $ IDMFC#OnClientLevelEnd(49f6e7a06ebc5aa8).(); }
615
616 // A New Player has entered the game, so we want to send him a game status packet that
617 // has information about the game
618 void OnGameStateRequestcxx . . $ OnGameStateRequest(d4f767463ce0a6b3).(int player_num) {
619 SendGameStartPacketcxx . . $ SendGameStartPacket(d4f767463ce0a6b3).(player_num);
620 DMFCBasecxx . . $ DMFCBase.->OnGameStateRequestcxx . . $ IDMFC#OnGameStateRequest(d4f767463ce0a6b3).(player_num);
621 }
622
623 // A new player has entered the game, zero there stats out
624 void OnClientPlayerEntersGamecxx . . $ OnClientPlayerEntersGame(d4f767463ce0a6b3).(int player_num) {
625 DMFCBasecxx . . $ DMFCBase.->OnClientPlayerEntersGamecxx . . $ IDMFC#OnClientPlayerEntersGame(d4f767463ce0a6b3).(player_num);
626 if (player_num != DMFCBasecxx . . $ DMFCBase.->GetPlayerNumcxx . . $ IDMFC#GetPlayerNum(b126dc7c1de90089).())
627 DisplayWelcomeMessagecxx . . $ DisplayWelcomeMessage(d4f767463ce0a6b3).(player_num);
628 else
629 display_my_welcomecxx . . $ display_my_welcome. = true;
630
631 if (player_num != -1) {
632 NumberOfKillsSinceLastDeathcxx . . $ NumberOfKillsSinceLastDeath.[player_num] = 0;
633 }
634 TimeInRoomcxx . . $ TimeInRoom.[player_num].total_timecxx . . $ tPlayerPos#total_time. = 0;
635 RemoveVirusFromPlayercxx . . $ RemoveVirusFromPlayer(918ebd27a9ddbad3).(player_num, true);
636 }
637
638 void OnServerPlayerChangeSegmentcxx . . $ OnServerPlayerChangeSegment(b1146eedae1e1d0b).(int player_num, int newseg, int oldseg) {
639 if (player_num == -1) {
640 DMFCBasecxx . . $ DMFCBase.->OnServerPlayerChangeSegmentcxx . . $ IDMFC#OnServerPlayerChangeSegment(b1146eedae1e1d0b).(player_num, newseg, oldseg);
641 return;
642 }
643
644 // check to make sure it is an 'indoor' room and not terrain
645 if (!ROOMNUM_OUTSIDEcxx . . $ `lib/object_external_struct.h:127:9`!(newseg)) {
646 // Check the room flags, see if we entered a special room
647 roomcxx . . $ room# *rp = &dRoomscxx . . $ dRooms.[newseg];
648 if (rp->flagscxx . . $ room#flags. & RF_EXTERNALcxx . . $ `Descent3/room_external.h:177:9`!) {
649 DMFCBasecxx . . $ DMFCBase.->OnServerPlayerChangeSegmentcxx . . $ IDMFC#OnServerPlayerChangeSegment(b1146eedae1e1d0b).(player_num, newseg, oldseg);
650 return;
651 }
652
653 if ((rp->flagscxx . . $ room#flags. & RF_SPECIAL1cxx . . $ `Descent3/room_external.h:185:9`!) || (rp->flagscxx . . $ room#flags. & RF_SPECIAL2cxx . . $ `Descent3/room_external.h:186:9`!) || (rp->flagscxx . . $ room#flags. & RF_SPECIAL3cxx . . $ `Descent3/room_external.h:187:9`!) ||
654 (rp->flagscxx . . $ room#flags. & RF_SPECIAL4cxx . . $ `Descent3/room_external.h:188:9`!) || (rp->flagscxx . . $ room#flags. & RF_SPECIAL5cxx . . $ `Descent3/room_external.h:189:9`!) || (rp->flagscxx . . $ room#flags. & RF_SPECIAL6cxx . . $ `Descent3/room_external.h:190:9`!)) {
655 DMFCBasecxx . . $ DMFCBase.->CallClientEventcxx . . $ IDMFC#CallClientEvent(d7a7761809021567).(EVT_CLIENT_GAMEPLAYERCHANGESEGcxx . . $ `lib/d3events.h:97:9`!, DMFCBasecxx . . $ DMFCBase.->GetMeObjNumcxx . . $ IDMFC#GetMeObjNum(b126dc7c1de90089).(), DMFCBasecxx . . $ DMFCBase.->GetItObjNumcxx . . $ IDMFC#GetItObjNum(b126dc7c1de90089).(), -1);
656 DMFCBasecxx . . $ DMFCBase.->CallOnClientPlayerChangeSegmentcxx . . $ IDMFC#CallOnClientPlayerChangeSegment(b1146eedae1e1d0b).(player_num, newseg, oldseg);
657 }
658 }
659
660 DMFCBasecxx . . $ DMFCBase.->OnServerPlayerChangeSegmentcxx . . $ IDMFC#OnServerPlayerChangeSegment(b1146eedae1e1d0b).(player_num, newseg, oldseg);
661 }
662
663 void OnClientPlayerChangeSegmentcxx . . $ OnClientPlayerChangeSegment(b1146eedae1e1d0b).(int player_num, int newseg, int oldseg) {
664 // someone has entered a special room
665 TimeInRoomcxx . . $ TimeInRoom.[player_num].total_timecxx . . $ tPlayerPos#total_time. = 0;
666
667 DMFCBasecxx . . $ DMFCBase.->OnClientPlayerChangeSegmentcxx . . $ IDMFC#OnClientPlayerChangeSegment(b1146eedae1e1d0b).(player_num, newseg, oldseg);
668 }
669
670 // We need to adjust the scores
671 void OnClientPlayerKilledcxx . . $ OnClientPlayerKilled(766a1b7183ffa4b4).(objectcxx . . $ object# *killer_obj, int victim_pnum) {
672 int kpnum;
673
674 if (victim_pnum != -1)
675 RemoveVirusFromPlayercxx . . $ RemoveVirusFromPlayer(918ebd27a9ddbad3).(victim_pnum, true);
676
677 if (killer_obj) {
678 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`!))
679 kpnum = killer_obj->idcxx . . $ object#id.;
680 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`! && killer_obj->ai_infocxx . . $ object#ai_info.)) {
681 // countermeasure kill
682 kpnum = DMFCBasecxx . . $ DMFCBase.->GetCounterMeasureOwnercxx . . $ IDMFC#GetCounterMeasureOwner(2da2a862cad4c994).(killer_obj);
683 } else {
684 kpnum = -1;
685 }
686 } else
687 kpnum = -1;
688
689 if (kpnum != -1) {
690 if (kpnum == victim_pnum) {
691 NumberOfKillsSinceLastDeathcxx . . $ NumberOfKillsSinceLastDeath.[kpnum] = 0;
692 } else {
693 NumberOfKillsSinceLastDeathcxx . . $ NumberOfKillsSinceLastDeath.[kpnum]++;
694
695 if (victim_pnum != -1)
696 NumberOfKillsSinceLastDeathcxx . . $ NumberOfKillsSinceLastDeath.[victim_pnum] = 0;
697 }
698 } else {
699 // this would be the case if the room killed a player
700 if (victim_pnum != -1)
701 NumberOfKillsSinceLastDeathcxx . . $ NumberOfKillsSinceLastDeath.[victim_pnum] = 0;
702 }
703
704 // TODO: Handle a kill if killed by a room
705 DMFCBasecxx . . $ DMFCBase.->OnClientPlayerKilledcxx . . $ IDMFC#OnClientPlayerKilled(766a1b7183ffa4b4).(killer_obj, victim_pnum);
706 }
707
708 void OnHUDIntervalcxx . . $ OnHUDInterval(49f6e7a06ebc5aa8).(void) {
709 dstatcxx . . $ dstat.->DoFramecxx . . $ IDmfcStats#DoFrame(49f6e7a06ebc5aa8).();
710 DMFCBasecxx . . $ DMFCBase.->DisplayOutrageLogocxx . . $ IDMFC#DisplayOutrageLogo(49f6e7a06ebc5aa8).();
711
712 DMFCBasecxx . . $ DMFCBase.->OnHUDIntervalcxx . . $ IDMFC#OnHUDInterval(49f6e7a06ebc5aa8).();
713 }
714
715 void OnIntervalcxx . . $ OnInterval(49f6e7a06ebc5aa8).(void) {
716 SortTeamScorescxx . . $ SortTeamScores(ce8f7825f8908cfa).(SortedTeamscxx . . $ SortedTeams., TeamScorecxx . . $ TeamScore.);
717 // TODO: Correct Sorting based on score
718 DMFCBasecxx . . $ DMFCBase.->GetSortedPlayerSlotscxx . . $ IDMFC#GetSortedPlayerSlots(621ccea12ecf5b06).(SortedPlayerscxx . . $ SortedPlayers., MAX_PLAYER_RECORDScxx . . $ `netgames/includes/DMFC.h:526:9`!);
719 DoIntervalPlayerFramecxx . . $ DoIntervalPlayerFrame(49f6e7a06ebc5aa8).();
720 DMFCBasecxx . . $ DMFCBase.->OnIntervalcxx . . $ IDMFC#OnInterval(49f6e7a06ebc5aa8).();
721 }
722
723 void OnClientPlayerDisconnectcxx . . $ OnClientPlayerDisconnect(d4f767463ce0a6b3).(int pnum) {
724 if (pnum != -1) {
725 NumberOfKillsSinceLastDeathcxx . . $ NumberOfKillsSinceLastDeath.[pnum] = 0;
726 }
727 DMFCBasecxx . . $ DMFCBase.->OnClientPlayerDisconnectcxx . . $ IDMFC#OnClientPlayerDisconnect(d4f767463ce0a6b3).(pnum);
728 }
729
730 void OnKeypresscxx . . $ OnKeypress(d4f767463ce0a6b3).(int key) {
731 dllinfocxx . . $ dllinfo# *Data = DMFCBasecxx . . $ DMFCBase.->GetDLLInfoCallDatacxx . . $ IDMFC#GetDLLInfoCallData(4458c5bdce97a5c3).();
732 switch (key) {
733 case K_F7cxx . . $ `netgames/includes/DMFCKeyCodes.h:118:9`!:
734 DisplayScoreScreencxx . . $ DisplayScoreScreen. = !DisplayScoreScreencxx . . $ DisplayScoreScreen.;
735 DMFCBasecxx . . $ DMFCBase.->EnableOnScreenMenucxx . . $ IDMFC#EnableOnScreenMenu(b45ddcbc8423892c).(false);
736 dstatcxx . . $ dstat.->Enablecxx . . $ IDmfcStats#Enable(b45ddcbc8423892c).(DisplayScoreScreencxx . . $ DisplayScoreScreen.);
737 break;
738 case K_PAGEDOWNcxx . . $ `netgames/includes/DMFCKeyCodes.h:147:9`!:
739 if (DisplayScoreScreencxx . . $ DisplayScoreScreen.) {
740 dstatcxx . . $ dstat.->ScrollDowncxx . . $ IDmfcStats#ScrollDown(49f6e7a06ebc5aa8).();
741 Data->iRetcxx . . $ dllinfo#$anonymous_type_0#iRet. = 1;
742 }
743 break;
744 case K_PAGEUPcxx . . $ `netgames/includes/DMFCKeyCodes.h:144:9`!:
745 if (DisplayScoreScreencxx . . $ DisplayScoreScreen.) {
746 dstatcxx . . $ dstat.->ScrollUpcxx . . $ IDmfcStats#ScrollUp(49f6e7a06ebc5aa8).();
747 Data->iRetcxx . . $ dllinfo#$anonymous_type_0#iRet. = 1;
748 }
749 break;
750 case K_F6cxx . . $ `netgames/includes/DMFCKeyCodes.h:117:9`!:
751 DisplayScoreScreencxx . . $ DisplayScoreScreen. = false;
752 dstatcxx . . $ dstat.->Enablecxx . . $ IDmfcStats#Enable(b45ddcbc8423892c).(false);
753 break;
754 case K_ESCcxx . . $ `netgames/includes/DMFCKeyCodes.h:97:9`!:
755 if (DisplayScoreScreencxx . . $ DisplayScoreScreen.) {
756 dstatcxx . . $ dstat.->Enablecxx . . $ IDmfcStats#Enable(b45ddcbc8423892c).(false);
757 DisplayScoreScreencxx . . $ DisplayScoreScreen. = false;
758 Data->iRetcxx . . $ dllinfo#$anonymous_type_0#iRet. = 1;
759 }
760 break;
761 }
762
763 // if(key==K_E && DMFCBase->GetLocalRole()==LR_SERVER){
764 // DMFCBase->StartUIWindow(1);
765 //}
766
767 DMFCBasecxx . . $ DMFCBase.->OnKeypresscxx . . $ IDMFC#OnKeypress(d4f767463ce0a6b3).(key);
768 }
769
770 void OnClientShowUIcxx . . $ OnClientShowUI(6ca3d68f5c5f0975).(int id, void *user_data) {
771 if (id == 1)
772 DoServerConfigureDialogcxx . . $ DoServerConfigureDialog(49f6e7a06ebc5aa8).();
773 DMFCBasecxx . . $ DMFCBase.->OnClientShowUIcxx . . $ IDMFC#OnClientShowUI(6ca3d68f5c5f0975).(id, user_data);
774 }
775
776 void OnServerCollidecxx . . $ OnServerCollide(6273fa812ac58a8).(objectcxx . . $ object# *me_obj, objectcxx . . $ object# *it_obj) {
777 if (!me_obj || !it_obj)
778 return;
779
780 if (virus_idcxx . . $ virus_id. == -1) {
781 FatalError("Unable to find Virus Object");
782 return;
783 }
784
785 if ((me_obj->typecxx . . $ object#type. == OBJ_PLAYERcxx . . $ `Descent3/object_external.h:164:9`!) && (it_obj->typecxx . . $ object#type. == OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`!) && (it_obj->idcxx . . $ object#id. == virus_idcxx . . $ virus_id.)) {
786 // determine what to do with this collision
787 int virus_objnum = it_obj - dObjectscxx . . $ dObjects.;
788 int virus_team = -1;
789 int virus_index = -1;
790 int player_num = me_obj->idcxx . . $ object#id.;
791
792 // find which team the virus belongs to
793 for (int v = 0; v < MAX_VIRIIcxx . . $ `netgames/entropy/EntropyAux.h:39:9`!; v++) {
794 if (virus_objnum == TeamViriicxx . . $ TeamVirii.[RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`!][v]) {
795 virus_team = RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`!;
796 virus_index = v;
797 break;
798 }
799 if (virus_objnum == TeamViriicxx . . $ TeamVirii.[BLUE_TEAMcxx . . $ `netgames/includes/DMFC.h:428:9`!][v]) {
800 virus_team = BLUE_TEAMcxx . . $ `netgames/includes/DMFC.h:428:9`!;
801 virus_index = v;
802 break;
803 }
804 }
805 if (virus_team == -1) {
806 // hey! we hit a virus that doesn't belong to any team!!
807 DLLmprintfcxx . . $ `netgames/includes/DMFC.h:343:9`!(0, "Virus (%d) doesn't belong to any team, removing...\n", virus_objnum);
808 DMFCBasecxx . . $ DMFCBase.->OnServerCollidecxx . . $ IDMFC#OnServerCollide(6273fa812ac58a8).(me_obj, it_obj);
809 DLLSetObjectDeadFlag(it_obj, true, false);
810 return;
811 }
812
813 int curr_count = DLLInvGetTypeIDCount(player_num, OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`!, it_obj->idcxx . . $ object#id.);
814 if (dPlayerscxx . . $ dPlayers.[player_num].teamcxx . . $ player#team. == virus_team) {
815 // a player has collided with a virus from his team
816 // see if the player has enough kills to pick up this virus
817 int max_carry = NumberOfKillsSinceLastDeathcxx . . $ NumberOfKillsSinceLastDeath.[player_num] * VIRUS_PER_KILLcxx . . $ `netgames/entropy/EntropyBase.cpp:131:9`!;
818 if (curr_count + 1 > max_carry) {
819 // the player can't carry another virii yet
820 if (player_num == DMFCBasecxx . . $ DMFCBase.->GetPlayerNumcxx . . $ IDMFC#GetPlayerNum(b126dc7c1de90089).()) {
821 DLLAddHUDMessage(TXT_CANTCARRYcxx . . $ `netgames/entropy/Entropystr.h:40:9`!);
822 } else {
823 DMFCBasecxx . . $ DMFCBase.->SendControlMessageToPlayercxx . . $ IDMFC#SendControlMessageToPlayer(9633529ce3c4ff50).(player_num, VIRUS_NOTENOUGHKILLScxx . . $ `netgames/entropy/EntropyAux.h:44:9`!);
824 }
825 } else {
826 // pick this guy up
827 TeamViriicxx . . $ TeamVirii.[virus_team][virus_index] = -1;
828 SendClientPickupViruscxx . . $ SendClientPickupVirus(d4f767463ce0a6b3).(player_num);
829 DLLSetObjectDeadFlag(it_obj, true, true);
830 if (snd_virus_pickupcxx . . $ snd_virus_pickup. != -1) {
831 DLLPlay2dSound(snd_virus_pickupcxx . . $ snd_virus_pickup., MAX_GAME_VOLUMEcxx . . $ `netgames/includes/gamedll_header.h:59:9`!);
832 }
833 }
834 } else {
835 // a player has collided with a virus from another team
836 // kill this object
837 TeamViriicxx . . $ TeamVirii.[virus_team][virus_index] = -1;
838 DLLSetObjectDeadFlag(it_obj, true, false);
839 if (player_num == DMFCBasecxx . . $ DMFCBase.->GetPlayerNumcxx . . $ IDMFC#GetPlayerNum(b126dc7c1de90089).()) {
840 DLLAddHUDMessage(TXT_VIRUSDESTROYEDcxx . . $ `netgames/entropy/Entropystr.h:41:9`!);
841 if (snd_virus_destroycxx . . $ snd_virus_destroy. != -1) {
842 DLLPlay2dSound(snd_virus_destroycxx . . $ snd_virus_destroy., MAX_GAME_VOLUMEcxx . . $ `netgames/includes/gamedll_header.h:59:9`!);
843 }
844 } else {
845 DMFCBasecxx . . $ DMFCBase.->SendControlMessageToPlayercxx . . $ IDMFC#SendControlMessageToPlayer(9633529ce3c4ff50).(player_num, VIRUS_DESTROYEDcxx . . $ `netgames/entropy/EntropyAux.h:46:9`!);
846 }
847 }
848 }
849
850 DMFCBasecxx . . $ DMFCBase.->OnServerCollidecxx . . $ IDMFC#OnServerCollide(6273fa812ac58a8).(me_obj, it_obj);
851 }
852
853 void TakeOverRoomcxx . . $ TakeOverRoom(748afa4755bc9595).(int newteam, int oldteam, int roomnum, int victor) {
854 if (ROOMNUM_OUTSIDEcxx . . $ `lib/object_external_struct.h:127:9`!(roomnum)) {
855 Int3cxx . . $ `netgames/includes/DMFC.h:378:9`!();
856 return;
857 }
858
859 bool server = false;
860 bool success = false;
861 if (DMFCBasecxx . . $ DMFCBase.->GetLocalRolecxx . . $ IDMFC#GetLocalRole(b126dc7c1de90089).() == LR_SERVERcxx . . $ `Descent3/multi_external.h:129:9`!)
862 server = true;
863
864 TeamOwnedRoomscxx . . $ TeamOwnedRooms.[newteam]++;
865 TeamOwnedRoomscxx . . $ TeamOwnedRooms.[oldteam]--;
866
867 tPlayerStatcxx . . $ tPlayerStat# *stat = (tPlayerStatcxx . . $ tPlayerStat# *)DMFCBasecxx . . $ DMFCBase.->GetPlayerRecordDatacxx . . $ IDMFC#GetPlayerRecordData(d1680a912d714170).(victor);
868 if (stat) {
869 stat->Scorecxx . . $ tPlayerStat#Score.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!] += SCORE_PLYR_TAKEOVER_ROOMcxx . . $ `netgames/entropy/EntropyBase.cpp:120:9`!;
870 stat->Scorecxx . . $ tPlayerStat#Score.[DSTAT_OVERALLcxx . . $ `netgames/includes/DMFC.h:528:9`!] += SCORE_PLYR_TAKEOVER_ROOMcxx . . $ `netgames/entropy/EntropyBase.cpp:120:9`!;
871 TeamScorecxx . . $ TeamScore.[DMFCBasecxx . . $ DMFCBase.->GetPlayerTeamcxx . . $ IDMFC#GetPlayerTeam(7864480464b09eea).(victor)] += SCORE_TEAM_TAKEOVER_ROOMcxx . . $ `netgames/entropy/EntropyBase.cpp:122:9`!;
872
873 if (snd_scorecxx . . $ snd_score. != -1) {
874 DLLPlay2dSound(snd_scorecxx . . $ snd_score., MAX_GAME_VOLUMEcxx . . $ `netgames/includes/gamedll_header.h:59:9`!);
875 }
876 }
877
878 char room_buf[40];
879
880 roomcxx . . $ room# *rp = &dRoomscxx . . $ dRooms.[roomnum];
881
882 if (oldteam == RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`!) {
883 if (rp->flagscxx . . $ room#flags. & RF_SPECIAL1cxx . . $ `Descent3/room_external.h:185:9`!) {
884 rp->flagscxx . . $ room#flags. &= ~RF_SPECIAL1cxx . . $ `Descent3/room_external.h:185:9`!;
885 rp->flagscxx . . $ room#flags. |= RF_SPECIAL4cxx . . $ `Descent3/room_external.h:188:9`!;
886 rp->room_change_flagscxx . . $ room#room_change_flags. |= RCF_GOALSPECIAL_FLAGScxx . . $ `Descent3/multi_world_state.h:62:9`!;
887 PaintRoomWithTexturecxx . . $ PaintRoomWithTexture(cf9ef193275fa6d8).(LabTextcxx . . $ LabText.[BLUE_TEAMcxx . . $ `netgames/includes/DMFC.h:428:9`!], roomnum);
888 if (server)
889 SendTakeOverPacketcxx . . $ SendTakeOverPacket(748afa4755bc9595).(newteam, oldteam, roomnum, victor);
890 strcpy(room_buf, "Laboratory");
891 success = true;
892 }
893 if (rp->flagscxx . . $ room#flags. & RF_SPECIAL2cxx . . $ `Descent3/room_external.h:186:9`!) {
894 rp->flagscxx . . $ room#flags. &= ~RF_SPECIAL2cxx . . $ `Descent3/room_external.h:186:9`!;
895 rp->flagscxx . . $ room#flags. |= RF_SPECIAL5cxx . . $ `Descent3/room_external.h:189:9`!;
896 rp->room_change_flagscxx . . $ room#room_change_flags. |= RCF_GOALSPECIAL_FLAGScxx . . $ `Descent3/multi_world_state.h:62:9`!;
897 PaintRoomWithTexturecxx . . $ PaintRoomWithTexture(cf9ef193275fa6d8).(EnergyTextcxx . . $ EnergyText.[BLUE_TEAMcxx . . $ `netgames/includes/DMFC.h:428:9`!], roomnum);
898 if (server)
899 SendTakeOverPacketcxx . . $ SendTakeOverPacket(748afa4755bc9595).(newteam, oldteam, roomnum, victor);
900 strcpy(room_buf, "Energy");
901 success = true;
902 }
903 if (rp->flagscxx . . $ room#flags. & RF_SPECIAL3cxx . . $ `Descent3/room_external.h:187:9`!) {
904 rp->flagscxx . . $ room#flags. &= ~RF_SPECIAL3cxx . . $ `Descent3/room_external.h:187:9`!;
905 rp->flagscxx . . $ room#flags. |= RF_SPECIAL6cxx . . $ `Descent3/room_external.h:190:9`!;
906 rp->room_change_flagscxx . . $ room#room_change_flags. |= RCF_GOALSPECIAL_FLAGScxx . . $ `Descent3/multi_world_state.h:62:9`!;
907 PaintRoomWithTexturecxx . . $ PaintRoomWithTexture(cf9ef193275fa6d8).(RepairTextcxx . . $ RepairText.[BLUE_TEAMcxx . . $ `netgames/includes/DMFC.h:428:9`!], roomnum);
908 if (server)
909 SendTakeOverPacketcxx . . $ SendTakeOverPacket(748afa4755bc9595).(newteam, oldteam, roomnum, victor);
910 strcpy(room_buf, "Repair");
911 success = true;
912 }
913 } else {
914 if (rp->flagscxx . . $ room#flags. & RF_SPECIAL4cxx . . $ `Descent3/room_external.h:188:9`!) {
915 rp->flagscxx . . $ room#flags. &= ~RF_SPECIAL4cxx . . $ `Descent3/room_external.h:188:9`!;
916 rp->flagscxx . . $ room#flags. |= RF_SPECIAL1cxx . . $ `Descent3/room_external.h:185:9`!;
917 rp->room_change_flagscxx . . $ room#room_change_flags. |= RCF_GOALSPECIAL_FLAGScxx . . $ `Descent3/multi_world_state.h:62:9`!;
918 PaintRoomWithTexturecxx . . $ PaintRoomWithTexture(cf9ef193275fa6d8).(LabTextcxx . . $ LabText.[RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`!], roomnum);
919 if (server)
920 SendTakeOverPacketcxx . . $ SendTakeOverPacket(748afa4755bc9595).(newteam, oldteam, roomnum, victor);
921 strcpy(room_buf, "Laboratory");
922 success = true;
923 }
924 if (rp->flagscxx . . $ room#flags. & RF_SPECIAL5cxx . . $ `Descent3/room_external.h:189:9`!) {
925 rp->flagscxx . . $ room#flags. &= ~RF_SPECIAL5cxx . . $ `Descent3/room_external.h:189:9`!;
926 rp->flagscxx . . $ room#flags. |= RF_SPECIAL2cxx . . $ `Descent3/room_external.h:186:9`!;
927 rp->room_change_flagscxx . . $ room#room_change_flags. |= RCF_GOALSPECIAL_FLAGScxx . . $ `Descent3/multi_world_state.h:62:9`!;
928 PaintRoomWithTexturecxx . . $ PaintRoomWithTexture(cf9ef193275fa6d8).(EnergyTextcxx . . $ EnergyText.[RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`!], roomnum);
929 if (server)
930 SendTakeOverPacketcxx . . $ SendTakeOverPacket(748afa4755bc9595).(newteam, oldteam, roomnum, victor);
931 strcpy(room_buf, "Energy");
932 success = true;
933 }
934 if (rp->flagscxx . . $ room#flags. & RF_SPECIAL6cxx . . $ `Descent3/room_external.h:190:9`!) {
935 rp->flagscxx . . $ room#flags. &= ~RF_SPECIAL6cxx . . $ `Descent3/room_external.h:190:9`!;
936 rp->flagscxx . . $ room#flags. |= RF_SPECIAL3cxx . . $ `Descent3/room_external.h:187:9`!;
937 rp->room_change_flagscxx . . $ room#room_change_flags. |= RCF_GOALSPECIAL_FLAGScxx . . $ `Descent3/multi_world_state.h:62:9`!;
938 PaintRoomWithTexturecxx . . $ PaintRoomWithTexture(cf9ef193275fa6d8).(RepairTextcxx . . $ RepairText.[RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`!], roomnum);
939 if (server)
940 SendTakeOverPacketcxx . . $ SendTakeOverPacket(748afa4755bc9595).(newteam, oldteam, roomnum, victor);
941 strcpy(room_buf, "Repair");
942 success = true;
943 }
944 }
945
946 if (!success) {
947 DLLmprintfcxx . . $ `netgames/includes/DMFC.h:343:9`!(0, "Invalid Takeover!!!!!!!\n");
948 return;
949 }
950
951 // print out hud message (and sound?)
952 char buffer[256];
953 DLLmprintfcxx . . $ `netgames/includes/DMFC.h:343:9`!(0, "old=%d new=%d\n", oldteam, newteam);
954 snprintf(buffer, sizeof(buffer), TXT_TAKEOVERcxx . . $ `netgames/entropy/Entropystr.h:43:9`!, (victor != -1) ? dPlayerscxx . . $ dPlayers.[victor].callsigncxx . . $ player#callsign. : TXT_NONAMEcxx . . $ `netgames/entropy/Entropystr.h:44:9`!,
955 DMFCBasecxx . . $ DMFCBase.->GetTeamStringcxx . . $ IDMFC#GetTeamString(f7ae7e56280f18ae).(oldteam), room_buf);
956 DLLAddHUDMessage(buffer);
957 if (victor != -1)
958 RemoveVirusFromPlayercxx . . $ RemoveVirusFromPlayer(918ebd27a9ddbad3).(victor, false);
959
960 if (TeamOwnedRoomscxx . . $ TeamOwnedRooms.[oldteam] <= 0) {
961 TeamScorecxx . . $ TeamScore.[newteam] += SCORE_TEAM_WINSGAMEcxx . . $ `netgames/entropy/EntropyBase.cpp:121:9`!;
962 Player_who_took_over_last_basecxx . . $ Player_who_took_over_last_base. = victor;
963 if (server) {
964 DMFCBasecxx . . $ DMFCBase.->EndLevelcxx . . $ IDMFC#EndLevel(49f6e7a06ebc5aa8).();
965 }
966 }
967
968 int newlab;
969 if (!ScanForLaboratorycxx . . $ ScanForLaboratory(4acd69fbb01c1943).(oldteam, &newlab)) {
970 // we need to turn newlab into a new laboratory
971 int flag = 0;
972 roomcxx . . $ room# *rp = &dRoomscxx . . $ dRooms.[newlab];
973 if (oldteam == RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`!) {
974 rp->flagscxx . . $ room#flags. &= ~RF_SPECIAL2cxx . . $ `Descent3/room_external.h:186:9`!;
975 rp->flagscxx . . $ room#flags. &= ~RF_SPECIAL3cxx . . $ `Descent3/room_external.h:187:9`!;
976 flag = RF_SPECIAL1cxx . . $ `Descent3/room_external.h:185:9`!;
977 } else {
978 rp->flagscxx . . $ room#flags. &= ~RF_SPECIAL5cxx . . $ `Descent3/room_external.h:189:9`!;
979 rp->flagscxx . . $ room#flags. &= ~RF_SPECIAL6cxx . . $ `Descent3/room_external.h:190:9`!;
980 flag = RF_SPECIAL4cxx . . $ `Descent3/room_external.h:188:9`!;
981 }
982 rp->flagscxx . . $ room#flags. |= flag;
983 rp->room_change_flagscxx . . $ room#room_change_flags. |= RCF_GOALSPECIAL_FLAGScxx . . $ `Descent3/multi_world_state.h:62:9`!;
984 PaintRoomWithTexturecxx . . $ PaintRoomWithTexture(cf9ef193275fa6d8).(LabTextcxx . . $ LabText.[oldteam], newlab);
985 }
986 }
987
988 void DoPlayerInLabcxx . . $ DoPlayerInLab(43c79ee2f1b9aefe).(int pnum, float time) {
989 // nothing to do in here
990 }
991
992 void DoPlayerInEnergycxx . . $ DoPlayerInEnergy(43c79ee2f1b9aefe).(int pnum, float time) {
993 // restore player's energy
994 float amount = REPAIR_RATEcxx . . $ `netgames/entropy/EntropyBase.cpp:125:9`! * time;
995
996 if (dPlayerscxx . . $ dPlayers.[pnum].energycxx . . $ player#energy. >= ENERGY_CAPcxx . . $ `netgames/entropy/EntropyBase.cpp:128:9`!)
997 return;
998
999 if (dPlayerscxx . . $ dPlayers.[pnum].energycxx . . $ player#energy. + amount > ENERGY_CAPcxx . . $ `netgames/entropy/EntropyBase.cpp:128:9`!)
1000 dPlayerscxx . . $ dPlayers.[pnum].energycxx . . $ player#energy. = ENERGY_CAPcxx . . $ `netgames/entropy/EntropyBase.cpp:128:9`!;
1001 else
1002 dPlayerscxx . . $ dPlayers.[pnum].energycxx . . $ player#energy. += amount;
1003
1004 if (dPlayerscxx . . $ dPlayers.[pnum].energycxx . . $ player#energy. < ENERGY_CAPcxx . . $ `netgames/entropy/EntropyBase.cpp:128:9`! && pnum == DMFCBasecxx . . $ DMFCBase.->GetPlayerNumcxx . . $ IDMFC#GetPlayerNum(b126dc7c1de90089).() && snd_energy_centercxx . . $ snd_energy_center. >= 0) {
1005 DLLPlay2dSound(snd_energy_centercxx . . $ snd_energy_center., 1);
1006 }
1007 }
1008
1009 void DoPlayerInRepaircxx . . $ DoPlayerInRepair(43c79ee2f1b9aefe).(int pnum, float time) {
1010 // restore player's shields, give at a rate of 3 per second
1011 float amount = REPAIR_RATEcxx . . $ `netgames/entropy/EntropyBase.cpp:125:9`! * time;
1012 float curr_shields = dObjectscxx . . $ dObjects.[dPlayerscxx . . $ dPlayers.[pnum].objnumcxx . . $ player#objnum.].shieldscxx . . $ object#shields.;
1013 float max_amount = SHIELD_CAPcxx . . $ `netgames/entropy/EntropyBase.cpp:129:9`! - curr_shields;
1014 if (amount > max_amount)
1015 amount = max_amount;
1016 if (curr_shields >= SHIELD_CAPcxx . . $ `netgames/entropy/EntropyBase.cpp:129:9`!)
1017 return;
1018
1019 DMFCBasecxx . . $ DMFCBase.->DoDamageToPlayercxx . . $ IDMFC#DoDamageToPlayer(c583259905cf10b6).(pnum, PD_ENERGY_WEAPONcxx . . $ `Descent3/damage_external.h:24:9`!, -amount);
1020
1021 if (amount > 0 && pnum == DMFCBasecxx . . $ DMFCBase.->GetPlayerNumcxx . . $ IDMFC#GetPlayerNum(b126dc7c1de90089).() && snd_repair_centercxx . . $ snd_repair_center. >= 0) {
1022 DLLPlay2dSound(snd_repair_centercxx . . $ snd_repair_center., MAX_GAME_VOLUMEcxx . . $ `netgames/includes/gamedll_header.h:59:9`! * 0.75f);
1023 }
1024 }
1025
1026 void DoPlayerInEnemycxx . . $ DoPlayerInEnemy(43c79ee2f1b9aefe).(int pnum, float time) {
1027 float damage_amount = DAMAGE_RATEcxx . . $ `netgames/entropy/EntropyBase.cpp:127:9`! * time;
1028
1029 if (dPlayerscxx . . $ dPlayers.[pnum].flagscxx . . $ player#flags. & PLAYER_FLAGS_DYINGcxx . . $ `Descent3/player_external.h:80:9`! || dPlayerscxx . . $ dPlayers.[pnum].flagscxx . . $ player#flags. & PLAYER_FLAGS_DEADcxx . . $ `Descent3/player_external.h:81:9`!)
1030 return;
1031
1032 // only play sound if player is a client, else do our own sound
1033 // so it isn't framerate dependant
1034 if (DMFCBasecxx . . $ DMFCBase.->GetLocalRolecxx . . $ IDMFC#GetLocalRole(b126dc7c1de90089).() == LR_SERVERcxx . . $ `Descent3/multi_external.h:129:9`!) {
1035 if (pnum != DMFCBasecxx . . $ DMFCBase.->GetPlayerNumcxx . . $ IDMFC#GetPlayerNum(b126dc7c1de90089).()) {
1036 DMFCBasecxx . . $ DMFCBase.->DoDamageToPlayercxx . . $ IDMFC#DoDamageToPlayer(c583259905cf10b6).(pnum, PD_ENERGY_WEAPONcxx . . $ `Descent3/damage_external.h:24:9`!, damage_amount, true);
1037 } else {
1038 DMFCBasecxx . . $ DMFCBase.->DoDamageToPlayercxx . . $ IDMFC#DoDamageToPlayer(c583259905cf10b6).(pnum, PD_ENERGY_WEAPONcxx . . $ `Descent3/damage_external.h:24:9`!, damage_amount, false);
1039 // time to play sound?
1040 float gt = DMFCBasecxx . . $ DMFCBase.->GetGametimecxx . . $ IDMFC#GetGametime(9b8c9e39889c762c).();
1041 if (gt - Server_last_play_damage_soundcxx . . $ Server_last_play_damage_sound. > (1.0f / 5.0f)) // fake 5pps
1042 {
1043 // time to play sound
1044 Server_last_play_damage_soundcxx . . $ Server_last_play_damage_sound. = gt;
1045 if (snd_damagecxx . . $ snd_damage. != -1) {
1046 DLLPlay2dSound(snd_damagecxx . . $ snd_damage., 1);
1047 }
1048 }
1049 }
1050 }
1051
1052 // check to see if the player has 5 virii in his inventory, if he does, he's
1053 // trying to take over this room
1054 if (DLLInvGetTypeIDCount(pnum, OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`!, virus_idcxx . . $ virus_id.) < MINIMUM_VIRUS_COUNTcxx . . $ `netgames/entropy/EntropyBase.cpp:133:9`!)
1055 return;
1056
1057 if (TimeInRoomcxx . . $ TimeInRoom.[pnum].total_timecxx . . $ tPlayerPos#total_time. == 0) {
1058 // update player position
1059 memcpy(&TimeInRoomcxx . . $ TimeInRoom.[pnum].last_poscxx . . $ tPlayerPos#last_pos., &dObjectscxx . . $ dObjects.[dPlayerscxx . . $ dPlayers.[pnum].objnumcxx . . $ player#objnum.].poscxx . . $ object#pos., sizeof(vectorcxx . . $ vector#));
1060 }
1061
1062 vectorcxx . . $ vector# curr_pos;
1063 memcpy(&curr_pos, &dObjectscxx . . $ dObjects.[dPlayerscxx . . $ dPlayers.[pnum].objnumcxx . . $ player#objnum.].poscxx . . $ object#pos., sizeof(vectorcxx . . $ vector#));
1064
1065 if (!CompareDistanceTravelcxx . . $ CompareDistanceTravel(73e76fc48bf5de61).(&curr_pos, &TimeInRoomcxx . . $ TimeInRoom.[pnum].last_poscxx . . $ tPlayerPos#last_pos.)) {
1066 // the player has moved!!!
1067 TimeInRoomcxx . . $ TimeInRoom.[pnum].total_timecxx . . $ tPlayerPos#total_time. = 0;
1068 } else {
1069 // still standing still
1070 TimeInRoomcxx . . $ TimeInRoom.[pnum].total_timecxx . . $ tPlayerPos#total_time. += time;
1071 }
1072
1073 float time_remaining = (TAKEOVER_TIMEcxx . . $ `netgames/entropy/EntropyBase.cpp:134:9`! - TimeInRoomcxx . . $ TimeInRoom.[pnum].total_timecxx . . $ tPlayerPos#total_time.);
1074
1075 if (time_remaining <= 0) {
1076 // Take over the room!!!!
1077 if (DMFCBasecxx . . $ DMFCBase.->GetLocalRolecxx . . $ IDMFC#GetLocalRole(b126dc7c1de90089).() == LR_SERVERcxx . . $ `Descent3/multi_external.h:129:9`!) {
1078 int newteam = DMFCBasecxx . . $ DMFCBase.->GetPlayerTeamcxx . . $ IDMFC#GetPlayerTeam(7864480464b09eea).(pnum);
1079 int oldteam = (newteam == RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`!) ? BLUE_TEAMcxx . . $ `netgames/includes/DMFC.h:428:9`! : RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`!;
1080 int room = dObjectscxx . . $ dObjects.[dPlayerscxx . . $ dPlayers.[pnum].objnumcxx . . $ player#objnum.].roomnumcxx . . $ object#roomnum.;
1081 TakeOverRoomcxx . . $ TakeOverRoom(748afa4755bc9595).(newteam, oldteam, room, pnum);
1082 }
1083 }
1084 }
1085
1086 void DoIntervalPlayerFramecxx . . $ DoIntervalPlayerFrame(49f6e7a06ebc5aa8).(void) {
1087 static float last_frametime = 0;
1088 static bool update_this_frame = false;
1089 float frametime = 0;
1090
1091 if (update_this_frame) {
1092 frametime = last_frametime + DMFCBasecxx . . $ DMFCBase.->GetFrametimecxx . . $ IDMFC#GetFrametime(9b8c9e39889c762c).();
1093 last_frametime = 0;
1094 update_this_frame = false;
1095 } else {
1096 last_frametime = DMFCBasecxx . . $ DMFCBase.->GetFrametimecxx . . $ IDMFC#GetFrametime(9b8c9e39889c762c).();
1097 update_this_frame = true;
1098 return;
1099 }
1100
1101 for (int i = 0; i < DLLMAX_PLAYERScxx . . $ `netgames/includes/DMFC.h:425:9`!; i++) {
1102 if (DMFCBasecxx . . $ DMFCBase.->CheckPlayerNumcxx . . $ IDMFC#CheckPlayerNum(83c267b20bac841a).(i)) {
1103 if (i == DMFCBasecxx . . $ DMFCBase.->GetPlayerNumcxx . . $ IDMFC#GetPlayerNum(b126dc7c1de90089).() || DMFCBasecxx . . $ DMFCBase.->GetLocalRolecxx . . $ IDMFC#GetLocalRole(b126dc7c1de90089).() == LR_SERVERcxx . . $ `Descent3/multi_external.h:129:9`!) {
1104
1105 if (dObjectscxx . . $ dObjects.[dPlayerscxx . . $ dPlayers.[i].objnumcxx . . $ player#objnum.].typecxx . . $ object#type. != OBJ_PLAYERcxx . . $ `Descent3/object_external.h:164:9`!)
1106 continue; // only work with OBJ_PLAYERS...this automatically handles observers,dedicated server
1107
1108 // only need to be here if we are the player that has to do with this
1109 // or we are the server
1110
1111 // first check to see if this player is in a special room
1112 if (ROOMNUM_OUTSIDEcxx . . $ `lib/object_external_struct.h:127:9`!(dObjects[dPlayers[i].objnum].roomnum))
1113 continue;
1114
1115 int team = DMFCBasecxx . . $ DMFCBase.->GetPlayerTeamcxx . . $ IDMFC#GetPlayerTeam(7864480464b09eea).(i);
1116 roomcxx . . $ room# *rp = &dRoomscxx . . $ dRooms.[dObjectscxx . . $ dObjects.[dPlayerscxx . . $ dPlayers.[i].objnumcxx . . $ player#objnum.].roomnumcxx . . $ object#roomnum.];
1117 if (rp->flagscxx . . $ room#flags. & RF_SPECIAL1cxx . . $ `Descent3/room_external.h:185:9`!) {
1118 if (team == RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`!)
1119 DoPlayerInLabcxx . . $ DoPlayerInLab(43c79ee2f1b9aefe).(i, frametime);
1120 else
1121 DoPlayerInEnemycxx . . $ DoPlayerInEnemy(43c79ee2f1b9aefe).(i, frametime);
1122 }
1123 if (rp->flagscxx . . $ room#flags. & RF_SPECIAL2cxx . . $ `Descent3/room_external.h:186:9`!) {
1124 if (team == RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`!)
1125 DoPlayerInEnergycxx . . $ DoPlayerInEnergy(43c79ee2f1b9aefe).(i, frametime);
1126 else
1127 DoPlayerInEnemycxx . . $ DoPlayerInEnemy(43c79ee2f1b9aefe).(i, frametime);
1128 }
1129 if (rp->flagscxx . . $ room#flags. & RF_SPECIAL3cxx . . $ `Descent3/room_external.h:187:9`!) {
1130 if (team == RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`!)
1131 DoPlayerInRepaircxx . . $ DoPlayerInRepair(43c79ee2f1b9aefe).(i, frametime);
1132 else
1133 DoPlayerInEnemycxx . . $ DoPlayerInEnemy(43c79ee2f1b9aefe).(i, frametime);
1134 }
1135 if (rp->flagscxx . . $ room#flags. & RF_SPECIAL4cxx . . $ `Descent3/room_external.h:188:9`!) {
1136 if (team == BLUE_TEAMcxx . . $ `netgames/includes/DMFC.h:428:9`!)
1137 DoPlayerInLabcxx . . $ DoPlayerInLab(43c79ee2f1b9aefe).(i, frametime);
1138 else
1139 DoPlayerInEnemycxx . . $ DoPlayerInEnemy(43c79ee2f1b9aefe).(i, frametime);
1140 }
1141 if (rp->flagscxx . . $ room#flags. & RF_SPECIAL5cxx . . $ `Descent3/room_external.h:189:9`!) {
1142 if (team == BLUE_TEAMcxx . . $ `netgames/includes/DMFC.h:428:9`!)
1143 DoPlayerInEnergycxx . . $ DoPlayerInEnergy(43c79ee2f1b9aefe).(i, frametime);
1144 else
1145 DoPlayerInEnemycxx . . $ DoPlayerInEnemy(43c79ee2f1b9aefe).(i, frametime);
1146 }
1147 if (rp->flagscxx . . $ room#flags. & RF_SPECIAL6cxx . . $ `Descent3/room_external.h:190:9`!) {
1148 if (team == BLUE_TEAMcxx . . $ `netgames/includes/DMFC.h:428:9`!)
1149 DoPlayerInRepaircxx . . $ DoPlayerInRepair(43c79ee2f1b9aefe).(i, frametime);
1150 else
1151 DoPlayerInEnemycxx . . $ DoPlayerInEnemy(43c79ee2f1b9aefe).(i, frametime);
1152 }
1153 }
1154 }
1155 }
1156 }
1157
1158 bool compare_slotscxx . . $ compare_slots(cf9ef193275fa6d8).(int a, int b) {
1159 int ascore, bscore;
1160 player_recordcxx . . $ player_record# *apr, *bpr;
1161 tPlayerStatcxx . . $ tPlayerStat# *as, *bs;
1162
1163 apr = DMFCBasecxx . . $ DMFCBase.->GetPlayerRecordcxx . . $ IDMFC#GetPlayerRecord(6359c6f28dd028ae).(a);
1164 bpr = DMFCBasecxx . . $ DMFCBase.->GetPlayerRecordcxx . . $ IDMFC#GetPlayerRecord(6359c6f28dd028ae).(b);
1165 if (!apr)
1166 return true;
1167 if (!bpr)
1168 return false;
1169 as = (tPlayerStatcxx . . $ tPlayerStat# *)apr->user_infocxx . . $ player_record#user_info.;
1170 bs = (tPlayerStatcxx . . $ tPlayerStat# *)bpr->user_infocxx . . $ player_record#user_info.;
1171 if (!as)
1172 return true;
1173 if (!bs)
1174 return false;
1175
1176 if (apr->statecxx . . $ player_record#state. == STATE_EMPTYcxx . . $ STATE_EMPTY.)
1177 return true;
1178 if (bpr->statecxx . . $ player_record#state. == STATE_EMPTYcxx . . $ STATE_EMPTY.)
1179 return false;
1180 if ((apr->statecxx . . $ player_record#state. == STATE_INGAMEcxx . . $ STATE_INGAME.) && (bpr->statecxx . . $ player_record#state. == STATE_INGAMEcxx . . $ STATE_INGAME.)) {
1181 // both players were in the game
1182 ascore = as->Scorecxx . . $ tPlayerStat#Score.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!];
1183 bscore = bs->Scorecxx . . $ tPlayerStat#Score.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!];
1184 return (ascore < bscore);
1185 }
1186 if ((apr->statecxx . . $ player_record#state. == STATE_INGAMEcxx . . $ STATE_INGAME.) && (bpr->statecxx . . $ player_record#state. == STATE_DISCONNECTEDcxx . . $ STATE_DISCONNECTED.)) {
1187 // apr gets priority since he was in the game on exit
1188 return false;
1189 }
1190 if ((apr->statecxx . . $ player_record#state. == STATE_DISCONNECTEDcxx . . $ STATE_DISCONNECTED.) && (bpr->statecxx . . $ player_record#state. == STATE_INGAMEcxx . . $ STATE_INGAME.)) {
1191 // bpr gets priority since he was in the game on exit
1192 return true;
1193 }
1194 // if we got here then both players were disconnected
1195 ascore = as->Scorecxx . . $ tPlayerStat#Score.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!];
1196 bscore = bs->Scorecxx . . $ tPlayerStat#Score.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!];
1197 return (ascore < bscore);
1198 }
1199
1200 void OnPLRInitcxx . . $ OnPLRInit(49f6e7a06ebc5aa8).(void) {
1201 int tempsort[MAX_PLAYER_RECORDScxx . . $ `netgames/includes/DMFC.h:526:9`!];
1202 int i, t, j;
1203
1204 for (i = 0; i < MAX_PLAYER_RECORDScxx . . $ `netgames/includes/DMFC.h:526:9`!; i++) {
1205 tempsort[i] = i;
1206 }
1207
1208 for (i = 1; i <= MAX_PLAYER_RECORDScxx . . $ `netgames/includes/DMFC.h:526:9`! - 1; i++) {
1209 t = tempsort[i];
1210 // Shift elements down until
1211 // insertion point found.
1212 for (j = i - 1; j >= 0 && compare_slotscxx . . $ compare_slots(cf9ef193275fa6d8).(tempsort[j], t); j--) {
1213 tempsort[j + 1] = tempsort[j];
1214 }
1215 // insert
1216 tempsort[j + 1] = t;
1217 }
1218
1219 // copy the array over
1220 memcpy(SortedPlayerscxx . . $ SortedPlayers., tempsort, MAX_PLAYER_RECORDScxx . . $ `netgames/includes/DMFC.h:526:9`! * sizeof(int));
1221
1222 // Now fill in the final structure of sorted names
1223 int TeamCount[NUM_TEAMScxx . . $ `netgames/entropy/EntropyAux.h:41:9`!];
1224 int team;
1225 for (i = 0; i < NUM_TEAMScxx . . $ `netgames/entropy/EntropyAux.h:41:9`!; i++)
1226 TeamCount[i] = 0;
1227 for (i = 0; i < MAX_PLAYER_RECORDScxx . . $ `netgames/includes/DMFC.h:526:9`!; i++) {
1228 int slot = SortedPlayerscxx . . $ SortedPlayers.[i];
1229 player_recordcxx . . $ player_record# *pr = DMFCBasecxx . . $ DMFCBase.->GetPlayerRecordcxx . . $ IDMFC#GetPlayerRecord(6359c6f28dd028ae).(slot);
1230 if (pr && pr->statecxx . . $ player_record#state. != STATE_EMPTYcxx . . $ STATE_EMPTY.) {
1231
1232 if (DMFCBasecxx . . $ DMFCBase.->IsPlayerDedicatedServercxx . . $ IDMFC#IsPlayerDedicatedServer(6a9c0d4ad435bebf).(pr))
1233 continue; // skip dedicated server
1234
1235 team = (pr->statecxx . . $ player_record#state. == STATE_INGAMEcxx . . $ STATE_INGAME.) ? dPlayerscxx . . $ dPlayers.[pr->pnumcxx . . $ player_record#pnum.].teamcxx . . $ player#team. : pr->teamcxx . . $ player_record#team.;
1236 SortedPLRPlayerscxx . . $ SortedPLRPlayers.[team][TeamCount[team]] = slot;
1237 TeamCount[team]++;
1238 }
1239 }
1240 for (i = 0; i < NUM_TEAMScxx . . $ `netgames/entropy/EntropyAux.h:41:9`!; i++) {
1241 if (TeamCount[i] < MAX_PLAYER_RECORDScxx . . $ `netgames/includes/DMFC.h:526:9`!)
1242 SortedPLRPlayerscxx . . $ SortedPLRPlayers.[i][TeamCount[i]] = -1;
1243 }
1244
1245 if (Player_who_took_over_last_basecxx . . $ Player_who_took_over_last_base. != -1) {
1246 // play a fanfare!
1247 if (snd_scorecxx . . $ snd_score. != -1) {
1248 DLLPlay2dSound(snd_scorecxx . . $ snd_score., MAX_GAME_VOLUMEcxx . . $ `netgames/includes/gamedll_header.h:59:9`!);
1249 }
1250 }
1251
1252 DMFCBasecxx . . $ DMFCBase.->OnPLRInitcxx . . $ IDMFC#OnPLRInit(49f6e7a06ebc5aa8).();
1253 }
1254
1255 void OnPLRIntervalcxx . . $ OnPLRInterval(49f6e7a06ebc5aa8).(void) {
1256 DMFCBasecxx . . $ DMFCBase.->OnPLRIntervalcxx . . $ IDMFC#OnPLRInterval(49f6e7a06ebc5aa8).();
1257
1258 int TeamCol = 35;
1259 int NameCol = 165;
1260 int KillsCol = 335;
1261 int DeathsCol = 375;
1262 int SuicidesCol = 425;
1263 int y = 40;
1264 int slot;
1265 player_recordcxx . . $ player_record# *pr;
1266
1267 DLLgrtext_SetFont((DMFCBasecxx . . $ DMFCBase.->GetGameFontTranslateArraycxx . . $ IDMFC#GetGameFontTranslateArray(a7741f82f5fc3640).())[SMALL_UI_FONT_INDEXcxx . . $ `Descent3/gamefont.h:99:9`!]);
1268 int height = DLLgrfont_GetHeight((DMFCBasecxx . . $ DMFCBase.->GetGameFontTranslateArraycxx . . $ IDMFC#GetGameFontTranslateArray(a7741f82f5fc3640).())[SMALL_UI_FONT_INDEXcxx . . $ `Descent3/gamefont.h:99:9`!]) + 1;
1269
1270 if (Player_who_took_over_last_basecxx . . $ Player_who_took_over_last_base. != -1) {
1271 // print out at the top who took over the last room
1272 int team = (DMFCBasecxx . . $ DMFCBase.->GetPlayerTeamcxx . . $ IDMFC#GetPlayerTeam(7864480464b09eea).(Player_who_took_over_last_basecxx . . $ Player_who_took_over_last_base.) == RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`!) ? BLUE_TEAMcxx . . $ `netgames/includes/DMFC.h:428:9`! : RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`!;
1273 DLLgrtext_SetColor(GR_RGBcxx . . $ GR_RGB(530956271a9518a5).(40, 255, 40));
1274 char message[384];
1275 snprintf(message, sizeof(message), "%s successfully took over %s team's last base!",
1276 dPlayerscxx . . $ dPlayers.[Player_who_took_over_last_basecxx . . $ Player_who_took_over_last_base.].callsigncxx . . $ player#callsign., DMFCBasecxx . . $ DMFCBase.->GetTeamStringcxx . . $ IDMFC#GetTeamString(f7ae7e56280f18ae).(team));
1277 DLLgrtext_CenteredPrintf(0, y, message);
1278 y += height;
1279 }
1280
1281 // print out header
1282 DLLgrtext_SetColor(GR_RGBcxx . . $ GR_RGB(530956271a9518a5).(255, 255, 150));
1283 DLLgrtext_Printf(NameCol, y, TXT_PILOTcxx . . $ `netgames/entropy/Entropystr.h:34:9`!);
1284 DLLgrtext_Printf(KillsCol, y, TXT_KILLScxx . . $ `netgames/entropy/Entropystr.h:36:9`!);
1285 DLLgrtext_Printf(DeathsCol, y, TXT_DEATHScxx . . $ `netgames/entropy/Entropystr.h:37:9`!);
1286 DLLgrtext_Printf(SuicidesCol, y, TXT_SUICIDEScxx . . $ `netgames/entropy/Entropystr.h:38:9`!);
1287 y += height;
1288
1289 tPlayerStatcxx . . $ tPlayerStat# *stat;
1290 bool has_members;
1291 bool doing_connected = true;
1292
1293 do_disconnected_folk:
1294
1295 for (int team = 0; team < NUM_TEAMScxx . . $ `netgames/entropy/EntropyAux.h:41:9`!; team++) {
1296 // process this team
1297 bool show_team_label;
1298 show_team_label = false;
1299
1300 if (!doing_connected) {
1301 int temp_idx;
1302 temp_idx = 0;
1303
1304 while (SortedPLRPlayerscxx . . $ SortedPLRPlayers.[team][temp_idx] != -1) {
1305 int pnum = DMFCBasecxx . . $ DMFCBase.->WasPlayerInGameAtLevelEndcxx . . $ IDMFC#WasPlayerInGameAtLevelEnd(7864480464b09eea).(SortedPLRPlayerscxx . . $ SortedPLRPlayers.[team][temp_idx]);
1306 if (pnum == -1) {
1307 show_team_label = true;
1308 break;
1309 }
1310 temp_idx++;
1311 }
1312 } else {
1313 show_team_label = true;
1314 }
1315
1316 if (show_team_label) {
1317 // is there anyone on this team?
1318 DLLgrtext_SetColor(DMFCBasecxx . . $ DMFCBase.->GetTeamColorcxx . . $ IDMFC#GetTeamColor(46cc46841198e427).(team));
1319 DLLgrtext_Printf(TeamCol, y, TXT_HUDDISPLAYcxx . . $ `netgames/entropy/Entropystr.h:45:9`!, DMFCBasecxx . . $ DMFCBase.->GetTeamStringcxx . . $ IDMFC#GetTeamString(f7ae7e56280f18ae).(team), TeamScorecxx . . $ TeamScore.[team]);
1320 }
1321 has_members = false;
1322
1323 for (int index = 0; index < MAX_PLAYER_RECORDScxx . . $ `netgames/includes/DMFC.h:526:9`!; index++) {
1324 // get the player num
1325 slot = SortedPLRPlayerscxx . . $ SortedPLRPlayers.[team][index];
1326 if (slot == -1) // we are done with this team
1327 break;
1328 pr = DMFCBasecxx . . $ DMFCBase.->GetPlayerRecordcxx . . $ IDMFC#GetPlayerRecord(6359c6f28dd028ae).(slot);
1329 if (pr && pr->statecxx . . $ player_record#state. != STATE_EMPTYcxx . . $ STATE_EMPTY.) {
1330
1331 if (DMFCBasecxx . . $ DMFCBase.->IsPlayerDedicatedServercxx . . $ IDMFC#IsPlayerDedicatedServer(6a9c0d4ad435bebf).(pr))
1332 continue; // dedicated server
1333
1334 int pnum = DMFCBasecxx . . $ DMFCBase.->WasPlayerInGameAtLevelEndcxx . . $ IDMFC#WasPlayerInGameAtLevelEnd(7864480464b09eea).(slot);
1335
1336 if ((doing_connected && pnum == -1) || (!doing_connected && pnum != -1))
1337 continue; // we're not handling them right now
1338
1339 if (pnum != -1) {
1340 DLLgrtext_SetColor(DMFCBasecxx . . $ DMFCBase.->GetTeamColorcxx . . $ IDMFC#GetTeamColor(46cc46841198e427).(team));
1341 } else {
1342 DLLgrtext_SetColor(GR_RGBcxx . . $ GR_RGB(530956271a9518a5).(128, 128, 128));
1343 }
1344
1345 stat = (tPlayerStatcxx . . $ tPlayerStat# *)pr->user_infocxx . . $ player_record#user_info.;
1346 // valid player
1347 DLLgrtext_Printf(NameCol, y, "%s %d[%d]", pr->callsigncxx . . $ player_record#callsign., (stat) ? stat->Scorecxx . . $ tPlayerStat#Score.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!] : 0,
1348 (stat) ? stat->Scorecxx . . $ tPlayerStat#Score.[DSTAT_OVERALLcxx . . $ `netgames/includes/DMFC.h:528:9`!] : 0);
1349 DLLgrtext_Printf(KillsCol, y, "%d[%d]", pr->dstatscxx . . $ player_record#dstats..killscxx . . $ t_dstat#kills.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!], pr->dstatscxx . . $ player_record#dstats..killscxx . . $ t_dstat#kills.[DSTAT_OVERALLcxx . . $ `netgames/includes/DMFC.h:528:9`!]);
1350 DLLgrtext_Printf(DeathsCol, y, "%d[%d]", pr->dstatscxx . . $ player_record#dstats..deathscxx . . $ t_dstat#deaths.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!], pr->dstatscxx . . $ player_record#dstats..deathscxx . . $ t_dstat#deaths.[DSTAT_OVERALLcxx . . $ `netgames/includes/DMFC.h:528:9`!]);
1351 DLLgrtext_Printf(SuicidesCol, y, "%d[%d]", pr->dstatscxx . . $ player_record#dstats..suicidescxx . . $ t_dstat#suicides.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!],
1352 pr->dstatscxx . . $ player_record#dstats..suicidescxx . . $ t_dstat#suicides.[DSTAT_OVERALLcxx . . $ `netgames/includes/DMFC.h:528:9`!]);
1353 y += height;
1354 has_members = true;
1355
1356 if (y >= 440)
1357 goto quick_exit;
1358 }
1359 } // end for
1360 // on to the next team
1361
1362 if (!has_members)
1363 y += height; // on to the next line
1364
1365 if (y >= 440)
1366 goto quick_exit;
1367 } // end for
1368
1369 if (doing_connected) {
1370 doing_connected = false;
1371 goto do_disconnected_folk;
1372 }
1373
1374 quick_exit:;
1375 }
1376
1377 void OnControlMessagecxx . . $ OnControlMessage(d5cb1b1d97598ec6).(uint8_tcxx . . $ uint8_t# msg, int from_pnum) {
1378 switch (msg) {
1379 case VIRUS_NOTENOUGHKILLScxx . . $ `netgames/entropy/EntropyAux.h:44:9`!:
1380 DLLAddHUDMessage(TXT_CANTCARRYcxx . . $ `netgames/entropy/Entropystr.h:40:9`!);
1381 break;
1382 case VIRUS_CANTKILLcxx . . $ `netgames/entropy/EntropyAux.h:45:9`!:
1383 DLLAddHUDMessage(TXT_CANTKILLVIRUScxx . . $ `netgames/entropy/Entropystr.h:42:9`!);
1384 break;
1385 case VIRUS_DESTROYEDcxx . . $ `netgames/entropy/EntropyAux.h:46:9`!:
1386 DLLAddHUDMessage(TXT_VIRUSDESTROYEDcxx . . $ `netgames/entropy/Entropystr.h:41:9`!);
1387 if (snd_virus_destroycxx . . $ snd_virus_destroy. != -1) {
1388 DLLPlay2dSound(snd_virus_destroycxx . . $ snd_virus_destroy., MAX_GAME_VOLUMEcxx . . $ `netgames/includes/gamedll_header.h:59:9`!);
1389 }
1390 break;
1391 default:
1392 DMFCBasecxx . . $ DMFCBase.->OnControlMessagecxx . . $ IDMFC#OnControlMessage(d5cb1b1d97598ec6).(msg, from_pnum);
1393 break;
1394 }
1395 }
1396
1397 void SaveStatsToFilecxx . . $ SaveStatsToFile(fda57c8427c60377).(char *filename) {
1398 CFILEcxx . . $ CFILE# *file;
1399 DLLOpenCFILE(&file, filenamecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., "wt");
1400 if (!file) {
1401 DLLmprintfcxx . . $ `netgames/includes/DMFC.h:343:9`!(0, "Unable to open output file\n");
1402 return;
1403 }
1404
1405 // write out game stats
1406 #define BUFSIZEcxx . . $ `netgames/entropy/EntropyBase.cpp:1406:9`! 150
1407 char buffer[BUFSIZEcxx . . $ `netgames/entropy/EntropyBase.cpp:1406:9`!];
1408 char tempbuffer[25];
1409 int sortedslots[MAX_PLAYER_RECORDScxx . . $ `netgames/includes/DMFC.h:526:9`!];
1410 player_recordcxx . . $ player_record# *pr, *dpr;
1411 tPInfoStatcxx . . $ tPInfoStat# stat;
1412 tPlayerStatcxx . . $ tPlayerStat# *st;
1413 int count, p;
1414
1415 // sort the stats
1416 DMFCBasecxx . . $ DMFCBase.->GetSortedPlayerSlotscxx . . $ IDMFC#GetSortedPlayerSlots(621ccea12ecf5b06).(sortedslots, MAX_PLAYER_RECORDScxx . . $ `netgames/includes/DMFC.h:526:9`!);
1417 SortTeamScorescxx . . $ SortTeamScores(ce8f7825f8908cfa).(SortedTeamscxx . . $ SortedTeams., TeamScorecxx . . $ TeamScore.);
1418 count = 1;
1419
1420 snprintf(buffer, sizeof(buffer), TXT_SAVESTATSAcxx . . $ `netgames/entropy/Entropystr.h:46:9`!, (DMFCBasecxx . . $ DMFCBase.->GetNetgameInfocxx . . $ IDMFC#GetNetgameInfo(242e78cd5130aa12).())->namecxx . . $ netgame_info#name.,
1421 (DMFCBasecxx . . $ DMFCBase.->GetCurrentMissioncxx . . $ IDMFC#GetCurrentMission(d7a4f7ca6f9cb411).())->cur_levelcxx . . $ tMission#cur_level.);
1422 DLLcf_WriteString(file, buffer);
1423
1424 for (p = 0; p < NUM_TEAMScxx . . $ `netgames/entropy/EntropyAux.h:41:9`!; p++) {
1425 int team_i = SortedTeamscxx . . $ SortedTeams.[p];
1426 memset(buffer, ' ', BUFSIZEcxx . . $ `netgames/entropy/EntropyBase.cpp:1406:9`!);
1427 snprintf(tempbuffer, sizeof(tempbuffer), TXT_TEAMINFOcxx . . $ `netgames/entropy/Entropystr.h:47:9`!, DMFCBasecxx . . $ DMFCBase.->GetTeamStringcxx . . $ IDMFC#GetTeamString(f7ae7e56280f18ae).(team_i));
1428 memcpy(&buffer[0], tempbuffer, strlen(tempbuffer));
1429 snprintf(tempbuffer, sizeof(tempbuffer), "[%d]", TeamScorecxx . . $ TeamScore.[team_i]);
1430 memcpy(&buffer[20], tempbuffer, strlen(tempbuffer));
1431 buffer[20 + strlen(tempbuffer)] = '\0';
1432 DLLcf_WriteString(file, buffer);
1433 }
1434
1435 // Write team members
1436 DLLcf_WriteString(file, ""); // blank line
1437 for (int t = 0; t < NUM_TEAMScxx . . $ `netgames/entropy/EntropyAux.h:41:9`!; t++) {
1438 int team_i = SortedTeamscxx . . $ SortedTeams.[t];
1439
1440 snprintf(buffer, sizeof(buffer), TXT_TEAMINFOcxx . . $ `netgames/entropy/Entropystr.h:47:9`!, DMFCBasecxx . . $ DMFCBase.->GetTeamStringcxx . . $ IDMFC#GetTeamString(f7ae7e56280f18ae).(team_i));
1441 strncat(buffer, ":", sizeof(buffer) - strlen(buffer) - 1);
1442 DLLcf_WriteString(file, buffer);
1443
1444 for (p = 0; p < MAX_PLAYER_RECORDScxx . . $ `netgames/includes/DMFC.h:526:9`!; p++) {
1445 pr = DMFCBasecxx . . $ DMFCBase.->GetPlayerRecordcxx . . $ IDMFC#GetPlayerRecord(6359c6f28dd028ae).(sortedslots[p]);
1446 if (pr && pr->statecxx . . $ player_record#state. != STATE_EMPTYcxx . . $ STATE_EMPTY.) {
1447
1448 if (DMFCBasecxx . . $ DMFCBase.->IsPlayerDedicatedServercxx . . $ IDMFC#IsPlayerDedicatedServer(6a9c0d4ad435bebf).(pr))
1449 continue; // skip dedicated server
1450
1451 if (pr->teamcxx . . $ player_record#team. == team_i) { // Check if current team
1452 snprintf(buffer, sizeof(buffer), " %s", pr->callsigncxx . . $ player_record#callsign.);
1453 DLLcf_WriteString(file, buffer);
1454 }
1455 }
1456 }
1457 }
1458 DLLcf_WriteString(file, ""); // blank line
1459
1460 snprintf(buffer, sizeof(buffer), "%s", TXT_CURRRANKINGScxx . . $ `netgames/entropy/Entropystr.h:48:9`!);
1461 DLLcf_WriteString(file, buffer);
1462
1463 snprintf(buffer, sizeof(buffer), "%s", TXT_SAVESTATSBcxx . . $ `netgames/entropy/Entropystr.h:49:9`!);
1464 DLLcf_WriteString(file, buffer);
1465 strcpy(buffer, "-----------------------------------------------------------------------------");
1466 DLLcf_WriteString(file, buffer);
1467
1468 for (p = 0; p < MAX_PLAYER_RECORDScxx . . $ `netgames/includes/DMFC.h:526:9`!; p++) {
1469 pr = DMFCBasecxx . . $ DMFCBase.->GetPlayerRecordcxx . . $ IDMFC#GetPlayerRecord(6359c6f28dd028ae).(sortedslots[p]);
1470 if (pr && pr->statecxx . . $ player_record#state. != STATE_EMPTYcxx . . $ STATE_EMPTY.) {
1471
1472 if (DMFCBasecxx . . $ DMFCBase.->IsPlayerDedicatedServercxx . . $ IDMFC#IsPlayerDedicatedServer(6a9c0d4ad435bebf).(pr))
1473 continue; // skip dedicated server
1474
1475 st = (tPlayerStatcxx . . $ tPlayerStat# *)pr->user_infocxx . . $ player_record#user_info.;
1476 memset(buffer, ' ', BUFSIZEcxx . . $ `netgames/entropy/EntropyBase.cpp:1406:9`!);
1477
1478 snprintf(tempbuffer, sizeof(tempbuffer), "%d)", count);
1479 memcpy(&buffer[0], tempbuffer, strlen(tempbuffer));
1480
1481 snprintf(tempbuffer, sizeof(tempbuffer), "%s%s", (pr->statecxx . . $ player_record#state. == STATE_INGAMEcxx . . $ STATE_INGAME.) ? "" : "*", pr->callsigncxx . . $ player_record#callsign.);
1482 memcpy(&buffer[5], tempbuffer, strlen(tempbuffer));
1483
1484 snprintf(tempbuffer, sizeof(tempbuffer), "%d[%d]", (st) ? st->Scorecxx . . $ tPlayerStat#Score.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!] : 0,
1485 (st) ? st->Scorecxx . . $ tPlayerStat#Score.[DSTAT_OVERALLcxx . . $ `netgames/includes/DMFC.h:528:9`!] : 0);
1486 memcpy(&buffer[34], tempbuffer, strlen(tempbuffer));
1487
1488 snprintf(tempbuffer, sizeof(tempbuffer), "%d[%d]", pr->dstatscxx . . $ player_record#dstats..killscxx . . $ t_dstat#kills.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!],
1489 pr->dstatscxx . . $ player_record#dstats..killscxx . . $ t_dstat#kills.[DSTAT_OVERALLcxx . . $ `netgames/includes/DMFC.h:528:9`!]);
1490 memcpy(&buffer[46], tempbuffer, strlen(tempbuffer));
1491
1492 snprintf(tempbuffer, sizeof(tempbuffer), "%d[%d]", pr->dstatscxx . . $ player_record#dstats..deathscxx . . $ t_dstat#deaths.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!],
1493 pr->dstatscxx . . $ player_record#dstats..deathscxx . . $ t_dstat#deaths.[DSTAT_OVERALLcxx . . $ `netgames/includes/DMFC.h:528:9`!]);
1494 memcpy(&buffer[58], tempbuffer, strlen(tempbuffer));
1495
1496 snprintf(tempbuffer, sizeof(tempbuffer), "%d[%d]", pr->dstatscxx . . $ player_record#dstats..suicidescxx . . $ t_dstat#suicides.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!],
1497 pr->dstatscxx . . $ player_record#dstats..suicidescxx . . $ t_dstat#suicides.[DSTAT_OVERALLcxx . . $ `netgames/includes/DMFC.h:528:9`!]);
1498 memcpy(&buffer[69], tempbuffer, strlen(tempbuffer));
1499
1500 size_t pos = 69 + strlen(tempbuffer) + 1;
1501 if (pos < BUFSIZEcxx . . $ `netgames/entropy/EntropyBase.cpp:1406:9`!)
1502 buffer[pos] = '\0';
1503
1504 buffer[BUFSIZEcxx . . $ `netgames/entropy/EntropyBase.cpp:1406:9`! - 1] = '\0';
1505 DLLcf_WriteString(file, buffer);
1506 count++;
1507 }
1508 }
1509
1510 DLLcf_WriteString(file, TXT_SAVESTATSCcxx . . $ `netgames/entropy/Entropystr.h:50:9`!);
1511
1512 count = 1;
1513 for (p = 0; p < MAX_PLAYER_RECORDScxx . . $ `netgames/includes/DMFC.h:526:9`!; p++) {
1514 pr = DMFCBasecxx . . $ DMFCBase.->GetPlayerRecordcxx . . $ IDMFC#GetPlayerRecord(6359c6f28dd028ae).(p);
1515 if (pr && pr->statecxx . . $ player_record#state. != STATE_EMPTYcxx . . $ STATE_EMPTY.) {
1516
1517 if (DMFCBasecxx . . $ DMFCBase.->IsPlayerDedicatedServercxx . . $ IDMFC#IsPlayerDedicatedServer(6a9c0d4ad435bebf).(pr))
1518 continue; // skip dedicated server
1519
1520 // Write out header
1521 snprintf(buffer, sizeof(buffer), "%d) %s%s", count, (pr->statecxx . . $ player_record#state. == STATE_INGAMEcxx . . $ STATE_INGAME.) ? "" : "*", pr->callsigncxx . . $ player_record#callsign.);
1522 DLLcf_WriteString(file, buffer);
1523 size_t length = strlen(buffer);
1524 memset(buffer, '=', length);
1525 buffer[length] = '\0';
1526 DLLcf_WriteString(file, buffer);
1527
1528 // time in game
1529 snprintf(buffer, sizeof(buffer), TXT_TIMEINGAMEcxx . . $ `netgames/entropy/Entropystr.h:51:9`!, DMFCBasecxx . . $ DMFCBase.->GetTimeStringcxx . . $ IDMFC#GetTimeString(3b344d7a46e3c2ff).(DMFCBasecxx . . $ DMFCBase.->GetTimeInGamecxx . . $ IDMFC#GetTimeInGame(5cde91ea12d43f46).(p)));
1530 DLLcf_WriteString(file, buffer);
1531
1532 if (DMFCBasecxx . . $ DMFCBase.->FindPInfoStatFirstcxx . . $ IDMFC#FindPInfoStatFirst(e8124cb919632806).(p, &stat)) {
1533 snprintf(buffer, sizeof(buffer), "%s", TXT_SAVESTATSDcxx . . $ `netgames/entropy/Entropystr.h:52:9`!);
1534 DLLcf_WriteString(file, buffer);
1535
1536 if (stat.slotcxx . . $ tPInfoStat#slot. != p) {
1537 memset(buffer, ' ', BUFSIZEcxx . . $ `netgames/entropy/EntropyBase.cpp:1406:9`!);
1538 dpr = DMFCBasecxx . . $ DMFCBase.->GetPlayerRecordcxx . . $ IDMFC#GetPlayerRecord(6359c6f28dd028ae).(stat.slotcxx . . $ tPInfoStat#slot.);
1539
1540 if (dpr) {
1541 snprintf(tempbuffer, sizeof(tempbuffer), "%s", dpr->callsigncxx . . $ player_record#callsign.);
1542 memcpy(buffer, tempbuffer, strlen(tempbuffer));
1543
1544 snprintf(tempbuffer, sizeof(tempbuffer), "%d", stat.killscxx . . $ tPInfoStat#kills.);
1545 memcpy(&buffer[30], tempbuffer, strlen(tempbuffer));
1546
1547 snprintf(tempbuffer, sizeof(tempbuffer), "%d", stat.deathscxx . . $ tPInfoStat#deaths.);
1548 memcpy(&buffer[40], tempbuffer, strlen(tempbuffer));
1549
1550 size_t pos = 40 + strlen(tempbuffer) + 1;
1551 if (pos < BUFSIZEcxx . . $ `netgames/entropy/EntropyBase.cpp:1406:9`!)
1552 buffer[pos] = '\0';
1553
1554 buffer[BUFSIZEcxx . . $ `netgames/entropy/EntropyBase.cpp:1406:9`! - 1] = '\0';
1555 DLLcf_WriteString(file, buffer);
1556 }
1557 }
1558
1559 while (DMFCBasecxx . . $ DMFCBase.->FindPInfoStatNextcxx . . $ IDMFC#FindPInfoStatNext(4ead3766c292904).(&stat)) {
1560 if (stat.slotcxx . . $ tPInfoStat#slot. != p) {
1561 memset(buffer, ' ', BUFSIZEcxx . . $ `netgames/entropy/EntropyBase.cpp:1406:9`!);
1562 dpr = DMFCBasecxx . . $ DMFCBase.->GetPlayerRecordcxx . . $ IDMFC#GetPlayerRecord(6359c6f28dd028ae).(stat.slotcxx . . $ tPInfoStat#slot.);
1563
1564 if (dpr) {
1565 snprintf(tempbuffer, sizeof(tempbuffer), "%s", dpr->callsigncxx . . $ player_record#callsign.);
1566 memcpy(buffer, tempbuffer, strlen(tempbuffer));
1567
1568 snprintf(tempbuffer, sizeof(tempbuffer), "%d", stat.killscxx . . $ tPInfoStat#kills.);
1569 memcpy(&buffer[30], tempbuffer, strlen(tempbuffer));
1570
1571 snprintf(tempbuffer, sizeof(tempbuffer), "%d", stat.deathscxx . . $ tPInfoStat#deaths.);
1572 memcpy(&buffer[40], tempbuffer, strlen(tempbuffer));
1573
1574 size_t pos = 40 + strlen(tempbuffer) + 1;
1575 if (pos < BUFSIZEcxx . . $ `netgames/entropy/EntropyBase.cpp:1406:9`!)
1576 buffer[pos] = '\0';
1577
1578 buffer[BUFSIZEcxx . . $ `netgames/entropy/EntropyBase.cpp:1406:9`! - 1] = '\0';
1579 DLLcf_WriteString(file, buffer);
1580 }
1581 }
1582 }
1583 }
1584 DMFCBasecxx . . $ DMFCBase.->FindPInfoStatClosecxx . . $ IDMFC#FindPInfoStatClose(49f6e7a06ebc5aa8).();
1585 DLLcf_WriteString(file, ""); // skip a line
1586 count++;
1587 }
1588 }
1589
1590 // done writing stats
1591 DLLcfclose(file);
1592 DLLAddHUDMessage(TXT_SAVEDcxx . . $ `netgames/entropy/Entropystr.h:58:9`!);
1593 }
1594
1595 #define ROOTFILENAMEcxx . . $ `netgames/entropy/EntropyBase.cpp:1595:9`! "Entropy"
1596 void OnSaveStatsToFilecxx . . $ OnSaveStatsToFile(49f6e7a06ebc5aa8).(void) {
1597 char filename[256];
1598 DMFCBasecxx . . $ DMFCBase.->GenerateStatFilenamecxx . . $ IDMFC#GenerateStatFilename(4d4dad76095ad7d8).(filename, ROOTFILENAMEcxx . . $ `netgames/entropy/EntropyBase.cpp:1595:9`!, false);
1599 SaveStatsToFilecxx . . $ SaveStatsToFile(fda57c8427c60377).(filename);
1600 }
1601
1602 void OnLevelEndSaveStatsToFilecxx . . $ OnLevelEndSaveStatsToFile(49f6e7a06ebc5aa8).(void) {
1603 char filename[256];
1604 DMFCBasecxx . . $ DMFCBase.->GenerateStatFilenamecxx . . $ IDMFC#GenerateStatFilename(4d4dad76095ad7d8).(filename, ROOTFILENAMEcxx . . $ `netgames/entropy/EntropyBase.cpp:1595:9`!, true);
1605 SaveStatsToFilecxx . . $ SaveStatsToFile(fda57c8427c60377).(filename);
1606 }
1607
1608 void OnDisconnectSaveStatsToFilecxx . . $ OnDisconnectSaveStatsToFile(49f6e7a06ebc5aa8).(void) {
1609 char filename[256];
1610 DMFCBasecxx . . $ DMFCBase.->GenerateStatFilenamecxx . . $ IDMFC#GenerateStatFilename(4d4dad76095ad7d8).(filename, ROOTFILENAMEcxx . . $ `netgames/entropy/EntropyBase.cpp:1595:9`!, false);
1611 SaveStatsToFilecxx . . $ SaveStatsToFile(fda57c8427c60377).(filename);
1612 }
1613
1614 void DisplayHUDScorescxx . . $ DisplayHUDScores(c7a20e4e05358911).(struct tHUDItemcxx . . $ tHUDItem# *hitem) {
1615 if (display_my_welcomecxx . . $ display_my_welcome.) {
1616 DisplayWelcomeMessagecxx . . $ DisplayWelcomeMessage(d4f767463ce0a6b3).(DMFCBasecxx . . $ DMFCBase.->GetPlayerNumcxx . . $ IDMFC#GetPlayerNum(b126dc7c1de90089).());
1617 display_my_welcomecxx . . $ display_my_welcome. = false;
1618 }
1619
1620 if (DisplayScoreScreencxx . . $ DisplayScoreScreen.)
1621 return;
1622
1623 // Display the countdown if there should be one
1624 if (IsPlayerInEnemycxx . . $ IsPlayerInEnemy(83c267b20bac841a).(DMFCBasecxx . . $ DMFCBase.->GetPlayerNumcxx . . $ IDMFC#GetPlayerNum(b126dc7c1de90089).()) &&
1625 DLLInvGetTypeIDCount(DMFCBasecxx . . $ DMFCBase.->GetPlayerNumcxx . . $ IDMFC#GetPlayerNum(b126dc7c1de90089).(), OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`!, virus_idcxx . . $ virus_id.) >= MINIMUM_VIRUS_COUNTcxx . . $ `netgames/entropy/EntropyBase.cpp:133:9`!) {
1626 float time_remaining = (TAKEOVER_TIMEcxx . . $ `netgames/entropy/EntropyBase.cpp:134:9`! - TimeInRoomcxx . . $ TimeInRoom.[DMFCBasecxx . . $ DMFCBase.->GetPlayerNumcxx . . $ IDMFC#GetPlayerNum(b126dc7c1de90089).()].total_timecxx . . $ tPlayerPos#total_time.);
1627
1628 int font = (DMFCBasecxx . . $ DMFCBase.->GetGameFontTranslateArraycxx . . $ IDMFC#GetGameFontTranslateArray(a7741f82f5fc3640).())[BIG_FONT_INDEXcxx . . $ `Descent3/gamefont.h:96:9`!];
1629 DLLgrtext_SetFont(font);
1630 int fontheight = DLLgrfont_GetHeight(font);
1631
1632 char buffer[255];
1633 int max_w = DMFCBasecxx . . $ DMFCBase.->GetGameWindowWcxx . . $ IDMFC#GetGameWindowW(b126dc7c1de90089).();
1634 snprintf(buffer, sizeof(buffer), "T - %.1f", (time_remaining >= 0) ? time_remaining : 0);
1635 int lwidth = DLLgrtext_GetTextLineWidth(buffer);
1636 DLLgrtext_SetColor(GR_RGBcxx . . $ GR_RGB(530956271a9518a5).(40, 255, 40));
1637 DLLgrtext_SetAlpha(255);
1638 DLLgrtext_Printf((max_w / 2) - (lwidth / 2), fontheight * 5, buffer);
1639 }
1640
1641 int font = (DMFCBasecxx . . $ DMFCBase.->GetGameFontTranslateArraycxx . . $ IDMFC#GetGameFontTranslateArray(a7741f82f5fc3640).())[HUD_FONT_INDEXcxx . . $ `Descent3/gamefont.h:97:9`!];
1642 int height = DLLgrfont_GetHeight(font) + 3;
1643 DLLgrtext_SetFont(font);
1644
1645 int y = (DMFCBasecxx . . $ DMFCBase.->GetGameWindowHcxx . . $ IDMFC#GetGameWindowH(b126dc7c1de90089).() / 2) - ((height * 3) / 2);
1646 int x = 520;
1647 int team;
1648 uint8_tcxx . . $ uint8_t# alpha = DMFCBasecxx . . $ DMFCBase.->ConvertHUDAlphacxx . . $ IDMFC#ConvertHUDAlpha(50106d451684defa).((uint8_tcxx . . $ uint8_t#)((DisplayScoreScreencxx . . $ DisplayScoreScreen.) ? 128 : 255));
1649
1650 team = DMFCBasecxx . . $ DMFCBase.->GetMyTeamcxx . . $ IDMFC#GetMyTeam(b126dc7c1de90089).();
1651 DLLRenderHUDText(DMFCBasecxx . . $ DMFCBase.->GetTeamColorcxx . . $ IDMFC#GetTeamColor(46cc46841198e427).(team), alpha, 0, x, 0, TXT_TEAMINFOcxx . . $ `netgames/entropy/Entropystr.h:47:9`!, DMFCBasecxx . . $ DMFCBase.->GetTeamStringcxx . . $ IDMFC#GetTeamString(f7ae7e56280f18ae).(team));
1652
1653 // determine coordinates to use here
1654 // we'll use a virtual width of 85 pixels on a 640x480 screen
1655 // so first determine the new width
1656 int name_width = 100.0f * DMFCBasecxx . . $ DMFCBase.->GetHudAspectXcxx . . $ IDMFC#GetHudAspectX(9b8c9e39889c762c).();
1657 int score_width = DLLgrtext_GetTextLineWidth("888");
1658 int name_x = DMFCBasecxx . . $ DMFCBase.->GetGameWindowWcxx . . $ IDMFC#GetGameWindowW(b126dc7c1de90089).() - name_width - score_width - 10;
1659 int score_x = DMFCBasecxx . . $ DMFCBase.->GetGameWindowWcxx . . $ IDMFC#GetGameWindowW(b126dc7c1de90089).() - score_width - 5;
1660 char buffer[256];
1661
1662 for (int i = 0; i < NUM_TEAMScxx . . $ `netgames/entropy/EntropyAux.h:41:9`!; i++) {
1663 team = SortedTeamscxx . . $ SortedTeams.[i];
1664
1665 if (team == DMFCBasecxx . . $ DMFCBase.->GetMyTeamcxx . . $ IDMFC#GetMyTeam(b126dc7c1de90089).()) {
1666 if (Highlight_bmpcxx . . $ Highlight_bmp. > BAD_BITMAP_HANDLEcxx . . $ `lib/bitmap.h:42:9`!) {
1667 // draw the highlite bar in the background
1668 DLLrend_SetAlphaValue(alpha * 0.50f);
1669 DLLrend_SetZBufferState(0);
1670 DLLrend_SetTextureType(TT_LINEARcxx . . $ TT_LINEAR.);
1671 DLLrend_SetLighting(LS_NONEcxx . . $ LS_NONE.);
1672 DLLrend_SetAlphaType(AT_CONSTANT_TEXTUREcxx . . $ `lib/renderer.h:402:9`!);
1673 DLLrend_DrawScaledBitmap(name_x - 2, y - 2, score_x + score_width + 2, y + height - 1, Highlight_bmpcxx . . $ Highlight_bmp., 0, 0, 1,
1674 1, 1.0, -1, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
1675 DLLrend_SetZBufferState(1);
1676 }
1677 }
1678
1679 snprintf(buffer, sizeof(buffer), TXT_HUDSCOREcxx . . $ `netgames/entropy/Entropystr.h:53:9`!, DMFCBasecxx . . $ DMFCBase.->GetTeamStringcxx . . $ IDMFC#GetTeamString(f7ae7e56280f18ae).(team), TeamOwnedRoomscxx . . $ TeamOwnedRooms.[team]);
1680 DMFCBasecxx . . $ DMFCBase.->ClipStringcxx . . $ IDMFC#ClipString(8677479218165cd4).(name_width, buffer, true);
1681
1682 DLLgrtext_SetAlpha(alpha);
1683 DLLgrtext_SetColor(DMFCBasecxx . . $ DMFCBase.->GetTeamColorcxx . . $ IDMFC#GetTeamColor(46cc46841198e427).(team));
1684 DLLgrtext_Printf(name_x, y, buffer);
1685 DLLgrtext_Printf(score_x, y, "[%d]", TeamScorecxx . . $ TeamScore.[team]);
1686
1687 y += height;
1688 }
1689 DLLgrtext_SetColor(GR_WHITEcxx . . $ GR_WHITE.);
1690 DLLgrtext_Printf(name_x, y, TXT_VIRUSLOADcxx . . $ `netgames/entropy/Entropystr.h:54:9`!, DLLInvGetTypeIDCount(DMFCBasecxx . . $ DMFCBase.->GetPlayerNumcxx . . $ IDMFC#GetPlayerNum(b126dc7c1de90089).(), OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`!, virus_idcxx . . $ virus_id.),
1691 (int)(NumberOfKillsSinceLastDeathcxx . . $ NumberOfKillsSinceLastDeath.[DMFCBasecxx . . $ DMFCBase.->GetPlayerNumcxx . . $ IDMFC#GetPlayerNum(b126dc7c1de90089).()] * VIRUS_PER_KILLcxx . . $ `netgames/entropy/EntropyBase.cpp:131:9`!));
1692 y += height;
1693 }
1694
1695 // insert sort
1696 #define compGTcxx . . $ `netgames/entropy/EntropyBase.cpp:1696:9`!(a, b) (a < b)
1697 void SortTeamScorescxx . . $ SortTeamScores(ce8f7825f8908cfa).(int *sortedindex, int *scores) {
1698 int t;
1699 int i, j;
1700
1701 // copy scores into scoreinfo array
1702 for (i = 0; i < NUM_TEAMScxx . . $ `netgames/entropy/EntropyAux.h:41:9`!; i++) {
1703 sortedindex[i] = i;
1704 }
1705
1706 for (i = 1; i <= NUM_TEAMScxx . . $ `netgames/entropy/EntropyAux.h:41:9`! - 1; i++) {
1707 t = sortedindex[i];
1708
1709 /* Shift elements down until */
1710 /* insertion point found. */
1711 for (j = i - 1; j >= 0 && compGTcxx . . $ `netgames/entropy/EntropyBase.cpp:1696:9`!(scores[sortedindex[j]], scores[t]); j--) {
1712 sortedindex[j + 1] = sortedindex[j];
1713 }
1714
1715 /* insert */
1716 sortedindex[j + 1] = t;
1717 }
1718 }
1719
1720 void DisplayWelcomeMessagecxx . . $ DisplayWelcomeMessage(d4f767463ce0a6b3).(int player_num) {
1721 char name_buffer[64];
1722 strcpy(name_buffer, (DMFCBasecxx . . $ DMFCBase.->GetPlayerscxx . . $ IDMFC#GetPlayers(51ff8e716a252304).())[player_num].callsigncxx . . $ player#callsign.);
1723
1724 if (player_num == DMFCBasecxx . . $ DMFCBase.->GetPlayerNumcxx . . $ IDMFC#GetPlayerNum(b126dc7c1de90089).()) {
1725 int team = DMFCBasecxx . . $ DMFCBase.->GetMyTeamcxx . . $ IDMFC#GetMyTeam(b126dc7c1de90089).();
1726 if (team == -1)
1727 return;
1728
1729 DLLAddHUDMessage(TXT_WELCOMEcxx . . $ `netgames/entropy/Entropystr.h:55:9`!, name_buffer);
1730 DLLAddColoredHUDMessage(DMFCBasecxx . . $ DMFCBase.->GetTeamColorcxx . . $ IDMFC#GetTeamColor(46cc46841198e427).(team), TXT_TEAMJOINcxx . . $ `netgames/entropy/Entropystr.h:56:9`!, DMFCBasecxx . . $ DMFCBase.->GetTeamStringcxx . . $ IDMFC#GetTeamString(f7ae7e56280f18ae).(team));
1731 } else {
1732 int team = dPlayerscxx . . $ dPlayers.[player_num].teamcxx . . $ player#team.;
1733 if (team == -1)
1734 return;
1735
1736 DLLAddColoredHUDMessage(DMFCBasecxx . . $ DMFCBase.->GetTeamColorcxx . . $ IDMFC#GetTeamColor(46cc46841198e427).(team), TXT_JOINcxx . . $ `netgames/entropy/Entropystr.h:57:9`!, name_buffer, DMFCBasecxx . . $ DMFCBase.->GetTeamStringcxx . . $ IDMFC#GetTeamString(f7ae7e56280f18ae).(team));
1737 }
1738 }
1739
1740 void OnLabSpewTimercxx . . $ OnLabSpewTimer(49f6e7a06ebc5aa8).(void) {
1741 int max_rooms = DMFCBasecxx . . $ DMFCBase.->GetHighestRoomIndexcxx . . $ IDMFC#GetHighestRoomIndex(b126dc7c1de90089).() + 1;
1742 int objnum;
1743 int index;
1744 int virus_count;
1745
1746 for (int r = 0; r < RoomCountcxx . . $ RoomCount.; r++) {
1747 if (dRoomscxx . . $ dRooms.[RoomListcxx . . $ RoomList.[r]].flagscxx . . $ room#flags. & RF_SPECIAL1cxx . . $ `Descent3/room_external.h:185:9`!) {
1748 index = -1;
1749 virus_count = 0;
1750 for (int v = 0; v < MAX_VIRIIcxx . . $ `netgames/entropy/EntropyAux.h:39:9`!; v++) {
1751 if (TeamViriicxx . . $ TeamVirii.[RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`!][v] == -1) {
1752 // insert here
1753 index = v;
1754 } else {
1755 if (dObjectscxx . . $ dObjects.[TeamViriicxx . . $ TeamVirii.[RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`!][v]].roomnumcxx . . $ object#roomnum. == RoomListcxx . . $ RoomList.[r])
1756 virus_count++;
1757 }
1758 }
1759
1760 // only create virus if we found a slot and there are less than MAX_VIRII_PER_ROOM
1761 // in the room
1762 if (virus_count < MAX_VIRII_PER_ROOMcxx . . $ `netgames/entropy/EntropyAux.h:40:9`! && index != -1) {
1763 objnum = SpewObjectInRoomcxx . . $ SpewObjectInRoom(2326284602b0bb2d).(OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`!, virus_idcxx . . $ virus_id., RoomListcxx . . $ RoomList.[r]);
1764 TeamViriicxx . . $ TeamVirii.[RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`!][index] = objnum;
1765 }
1766 }
1767 if (dRoomscxx . . $ dRooms.[RoomListcxx . . $ RoomList.[r]].flagscxx . . $ room#flags. & RF_SPECIAL4cxx . . $ `Descent3/room_external.h:188:9`!) {
1768 index = -1;
1769 virus_count = 0;
1770 for (int v = 0; v < MAX_VIRIIcxx . . $ `netgames/entropy/EntropyAux.h:39:9`!; v++) {
1771 if (TeamViriicxx . . $ TeamVirii.[BLUE_TEAMcxx . . $ `netgames/includes/DMFC.h:428:9`!][v] == -1) {
1772 // insert here
1773 index = v;
1774 } else {
1775 if (dObjectscxx . . $ dObjects.[TeamViriicxx . . $ TeamVirii.[BLUE_TEAMcxx . . $ `netgames/includes/DMFC.h:428:9`!][v]].roomnumcxx . . $ object#roomnum. == RoomListcxx . . $ RoomList.[r])
1776 virus_count++;
1777 }
1778 }
1779 // only create virus if we found a slot and there are less than MAX_VIRII_PER_ROOM
1780 // in the room
1781 if (virus_count < MAX_VIRII_PER_ROOMcxx . . $ `netgames/entropy/EntropyAux.h:40:9`! && index != -1) {
1782 objnum = SpewObjectInRoomcxx . . $ SpewObjectInRoom(2326284602b0bb2d).(OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`!, virus_idcxx . . $ virus_id., RoomListcxx . . $ RoomList.[r]);
1783 TeamViriicxx . . $ TeamVirii.[BLUE_TEAMcxx . . $ `netgames/includes/DMFC.h:428:9`!][index] = objnum;
1784 }
1785 }
1786 }
1787 }
1788
1789 void RemoveVirusFromPlayercxx . . $ RemoveVirusFromPlayer(918ebd27a9ddbad3).(int player_num, bool remove_all) {
1790 int inv_count = DLLInvGetTypeIDCount(player_num, OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`!, virus_idcxx . . $ virus_id.);
1791
1792 if (!remove_all) {
1793 ASSERTcxx . . $ `netgames/includes/DMFC.h:370:9`!(inv_count >= MINIMUM_VIRUS_COUNTcxx . . $ `netgames/entropy/EntropyBase.cpp:133:9`!);
1794 inv_count = MINIMUM_VIRUS_COUNTcxx . . $ `netgames/entropy/EntropyBase.cpp:133:9`!;
1795 }
1796
1797 for (int i = 0; i < inv_count; i++) {
1798 DLLInvRemove(player_num, OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`!, virus_idcxx . . $ virus_id.);
1799 }
1800 }
1801
1802 // returns true if there is at least 1 lab, else returns the room which sould be a lab in newlab
1803 bool ScanForLaboratorycxx . . $ ScanForLaboratory(4acd69fbb01c1943).(int team, int *newlab) {
1804 *newlab = 0;
1805 int flag;
1806 int ef, rf;
1807 bool found = false;
1808
1809 flag = (team == RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`!) ? RF_SPECIAL1cxx . . $ `Descent3/room_external.h:185:9`! : RF_SPECIAL4cxx . . $ `Descent3/room_external.h:188:9`!;
1810 ef = (team == RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`!) ? RF_SPECIAL2cxx . . $ `Descent3/room_external.h:186:9`! : RF_SPECIAL5cxx . . $ `Descent3/room_external.h:189:9`!;
1811 rf = (team == RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`!) ? RF_SPECIAL3cxx . . $ `Descent3/room_external.h:187:9`! : RF_SPECIAL6cxx . . $ `Descent3/room_external.h:190:9`!;
1812
1813 for (int r = 0; r < RoomCountcxx . . $ RoomCount.; r++) {
1814 roomcxx . . $ room# *rp = &dRoomscxx . . $ dRooms.[RoomListcxx . . $ RoomList.[r]];
1815 if (rp->flagscxx . . $ room#flags. & flag) {
1816 // we found a lab
1817 return true;
1818 }
1819 if ((rp->flagscxx . . $ room#flags. & ef) && (!found)) {
1820 found = true;
1821 *newlab = RoomListcxx . . $ RoomList.[r];
1822 }
1823 if ((rp->flagscxx . . $ room#flags. & rf) && (!found)) {
1824 found = true;
1825 *newlab = RoomListcxx . . $ RoomList.[r];
1826 }
1827 }
1828 return false;
1829 }
1830
1831 bool CompareDistanceTravelcxx . . $ CompareDistanceTravel(73e76fc48bf5de61).(vectorcxx . . $ vector# *curr_pos, vectorcxx . . $ vector# *last_pos) {
1832 vectorcxx . . $ vector# result;
1833 float a, b, c, bc, dist;
1834
1835 result.xcxx . . $ vector#x. = curr_pos->xcxx . . $ vector#x. - last_pos->xcxx . . $ vector#x.;
1836 result.ycxx . . $ vector#y. = curr_pos->ycxx . . $ vector#y. - last_pos->ycxx . . $ vector#y.;
1837 result.zcxx . . $ vector#z. = curr_pos->zcxx . . $ vector#z. - last_pos->zcxx . . $ vector#z.;
1838
1839 a = fabscxx . . $ fabs(fbcf3211dfe1bfd1).(result.xcxx . . $ vector#x.);
1840 b = fabscxx . . $ fabs(fbcf3211dfe1bfd1).(result.ycxx . . $ vector#y.);
1841 c = fabscxx . . $ fabs(fbcf3211dfe1bfd1).(result.zcxx . . $ vector#z.);
1842
1843 if (a < b) {
1844 float t = a;
1845 a = b;
1846 b = t;
1847 }
1848
1849 if (b < c) {
1850 float t = b;
1851 b = c;
1852 c = t;
1853
1854 if (a < b) {
1855 float t = a;
1856 a = b;
1857 b = t;
1858 }
1859 }
1860
1861 bc = (b / 4) + (c / 8);
1862
1863 dist = a + bc + (bc / 2);
1864
1865 if (dist > 5) {
1866 memcpy(last_pos, curr_pos, sizeof(vectorcxx . . $ vector#));
1867 return false;
1868 } else {
1869 return true;
1870 }
1871 }
1872
1873 bool IsPlayerInEnemycxx . . $ IsPlayerInEnemy(83c267b20bac841a).(int pnum) {
1874 if (!DMFCBasecxx . . $ DMFCBase.->CheckPlayerNumcxx . . $ IDMFC#CheckPlayerNum(83c267b20bac841a).(pnum))
1875 return false;
1876
1877 if (dObjectscxx . . $ dObjects.[dPlayerscxx . . $ dPlayers.[pnum].objnumcxx . . $ player#objnum.].typecxx . . $ object#type. != OBJ_PLAYERcxx . . $ `Descent3/object_external.h:164:9`!)
1878 return false; // only work with OBJ_PLAYERS...this automatically handles observers,dedicated server
1879
1880 // first check to see if this player is in a special room
1881 if (ROOMNUM_OUTSIDEcxx . . $ `lib/object_external_struct.h:127:9`!(dObjects[dPlayers[pnum].objnum].roomnum))
1882 return false;
1883
1884 int team = DMFCBasecxx . . $ DMFCBase.->GetPlayerTeamcxx . . $ IDMFC#GetPlayerTeam(7864480464b09eea).(pnum);
1885 roomcxx . . $ room# *rp = &dRoomscxx . . $ dRooms.[dObjectscxx . . $ dObjects.[dPlayerscxx . . $ dPlayers.[pnum].objnumcxx . . $ player#objnum.].roomnumcxx . . $ object#roomnum.];
1886
1887 if (team != RED_TEAMcxx . . $ `netgames/includes/DMFC.h:427:9`!) {
1888 if ((rp->flagscxx . . $ room#flags. & RF_SPECIAL1cxx . . $ `Descent3/room_external.h:185:9`!) || (rp->flagscxx . . $ room#flags. & RF_SPECIAL2cxx . . $ `Descent3/room_external.h:186:9`!) || (rp->flagscxx . . $ room#flags. & RF_SPECIAL3cxx . . $ `Descent3/room_external.h:187:9`!)) {
1889 return true;
1890 }
1891 }
1892
1893 if (team != BLUE_TEAMcxx . . $ `netgames/includes/DMFC.h:428:9`!) {
1894 if ((rp->flagscxx . . $ room#flags. & RF_SPECIAL4cxx . . $ `Descent3/room_external.h:188:9`!) || (rp->flagscxx . . $ room#flags. & RF_SPECIAL5cxx . . $ `Descent3/room_external.h:189:9`!) || (rp->flagscxx . . $ room#flags. & RF_SPECIAL6cxx . . $ `Descent3/room_external.h:190:9`!)) {
1895 return true;
1896 }
1897 }
1898
1899 return false;
1900 }
1901
1902 void OnGetTokenStringcxx . . $ OnGetTokenString(655c4eff246c5519).(char *src, char *dest, int dest_size) {
1903 if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(src, "virus")) {
1904 int count = DLLInvGetTypeIDCount(DMFCBasecxx . . $ DMFCBase.->GetPlayerNumcxx . . $ IDMFC#GetPlayerNum(b126dc7c1de90089).(), OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`!, virus_idcxx . . $ virus_id.);
1905 char buffer[100];
1906 snprintf(buffer, sizeof(buffer), "%d", count);
1907 strncpy(dest, buffer, dest_size - 1);
1908 dest[dest_size - 1] = '\0';
1909 return;
1910 }
1911
1912 DMFCBasecxx . . $ DMFCBase.->OnGetTokenStringcxx . . $ IDMFC#OnGetTokenString(655c4eff246c5519).(src, dest, dest_size);
1913 }
1914
1915 void OnPrintScorescxx . . $ OnPrintScores(d4f767463ce0a6b3).(int level) {
1916 char buffer[256];
1917 char name[70];
1918 size_t t;
1919 size_t pos[6];
1920 size_t len[6];
1921
1922 netplayercxx . . $ netplayer# *dNetPlayers = DMFCBasecxx . . $ DMFCBase.->GetNetPlayerscxx . . $ IDMFC#GetNetPlayers(d09959b2d64446dd).();
1923
1924 for (int i = 0; i < NUM_TEAMScxx . . $ `netgames/entropy/EntropyAux.h:41:9`!; i++) {
1925 snprintf(buffer, sizeof(buffer), "%s:%d\n", DMFCBasecxx . . $ DMFCBase.->GetTeamStringcxx . . $ IDMFC#GetTeamString(f7ae7e56280f18ae).(i), TeamScorecxx . . $ TeamScore.[i]);
1926 DPrintf(buffer);
1927 }
1928
1929 memset(buffer, ' ', 256);
1930
1931 pos[0] = 0;
1932 t = len[0] = 30; // give ample room for pilot name
1933 pos[1] = pos[0] + t + 1;
1934 t = len[1] = strlen(TXT_SCOREcxx . . $ `netgames/entropy/Entropystr.h:35:9`!);
1935 pos[2] = pos[1] + t + 1;
1936 t = len[2] = strlen(TXT_KILLS_SHORTcxx . . $ `netgames/entropy/Entropystr.h:64:9`!);
1937 pos[3] = pos[2] + t + 1;
1938 t = len[3] = strlen(TXT_DEATHS_SHORTcxx . . $ `netgames/entropy/Entropystr.h:65:9`!);
1939 pos[4] = pos[3] + t + 1;
1940 t = len[4] = strlen(TXT_SUICIDES_SHORTcxx . . $ `netgames/entropy/Entropystr.h:66:9`!);
1941 pos[5] = pos[4] + t + 1;
1942 t = len[5] = strlen(TXT_PINGcxx . . $ `netgames/entropy/Entropystr.h:39:9`!);
1943
1944 memcpy(&buffer[pos[0]], TXT_PILOTcxx . . $ `netgames/entropy/Entropystr.h:34:9`!, strlen(TXT_PILOTcxx . . $ `netgames/entropy/Entropystr.h:34:9`!));
1945 memcpy(&buffer[pos[1]], TXT_SCOREcxx . . $ `netgames/entropy/Entropystr.h:35:9`!, len[1]);
1946 memcpy(&buffer[pos[2]], TXT_KILLS_SHORTcxx . . $ `netgames/entropy/Entropystr.h:64:9`!, len[2]);
1947 memcpy(&buffer[pos[3]], TXT_DEATHS_SHORTcxx . . $ `netgames/entropy/Entropystr.h:65:9`!, len[3]);
1948 memcpy(&buffer[pos[4]], TXT_SUICIDES_SHORTcxx . . $ `netgames/entropy/Entropystr.h:66:9`!, len[4]);
1949 memcpy(&buffer[pos[5]], TXT_PINGcxx . . $ `netgames/entropy/Entropystr.h:39:9`!, len[5]);
1950 buffer[pos[5] + len[5] + 1] = '\n';
1951 buffer[pos[5] + len[5] + 2] = '\0';
1952 DPrintf(buffer);
1953
1954 int slot;
1955 player_recordcxx . . $ player_record# *pr;
1956 int pcount;
1957
1958 if (level < 0 || level >= MAX_PLAYER_RECORDScxx . . $ `netgames/includes/DMFC.h:526:9`!)
1959 pcount = MAX_PLAYER_RECORDScxx . . $ `netgames/includes/DMFC.h:526:9`!;
1960 else
1961 pcount = level;
1962
1963 int sortedplayers[MAX_PLAYER_RECORDScxx . . $ `netgames/includes/DMFC.h:526:9`!];
1964
1965 DMFCBasecxx . . $ DMFCBase.->GetSortedPlayerSlotscxx . . $ IDMFC#GetSortedPlayerSlots(621ccea12ecf5b06).(sortedplayers, MAX_PLAYER_RECORDScxx . . $ `netgames/includes/DMFC.h:526:9`!);
1966
1967 for (int i = 0; i < pcount; i++) {
1968 slot = sortedplayers[i];
1969 pr = DMFCBasecxx . . $ DMFCBase.->GetPlayerRecordcxx . . $ IDMFC#GetPlayerRecord(6359c6f28dd028ae).(slot);
1970 if ((pr) && (pr->statecxx . . $ player_record#state. != STATE_EMPTYcxx . . $ STATE_EMPTY.)) {
1971
1972 if (DMFCBasecxx . . $ DMFCBase.->IsPlayerDedicatedServercxx . . $ IDMFC#IsPlayerDedicatedServer(6a9c0d4ad435bebf).(pr))
1973 continue; // skip dedicated server
1974
1975 snprintf(name, sizeof(name), "%s%s: %.8s", (pr->statecxx . . $ player_record#state. == STATE_DISCONNECTEDcxx . . $ STATE_DISCONNECTED.) ? "*" : "", pr->callsigncxx . . $ player_record#callsign.,
1976 DMFCBasecxx . . $ DMFCBase.->GetTeamStringcxx . . $ IDMFC#GetTeamString(f7ae7e56280f18ae).(pr->teamcxx . . $ player_record#team.));
1977 name[29] = '\0';
1978
1979 tPlayerStatcxx . . $ tPlayerStat# *stat;
1980 stat = (tPlayerStatcxx . . $ tPlayerStat# *)pr->user_infocxx . . $ player_record#user_info.;
1981
1982 memset(buffer, ' ', 256);
1983 t = strlen(name);
1984 memcpy(&buffer[pos[0]], name, (t < len[0]) ? t : len[0]);
1985 snprintf(name, sizeof(name), "%d", (stat) ? stat->Scorecxx . . $ tPlayerStat#Score.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!] : 0);
1986 t = strlen(name);
1987 memcpy(&buffer[pos[1]], name, (t < len[1]) ? t : len[1]);
1988 snprintf(name, sizeof(name), "%d", pr->dstatscxx . . $ player_record#dstats..killscxx . . $ t_dstat#kills.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!]);
1989 t = strlen(name);
1990 memcpy(&buffer[pos[2]], name, (t < len[2]) ? t : len[2]);
1991 snprintf(name, sizeof(name), "%d", pr->dstatscxx . . $ player_record#dstats..deathscxx . . $ t_dstat#deaths.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!]);
1992 t = strlen(name);
1993 memcpy(&buffer[pos[3]], name, (t < len[3]) ? t : len[3]);
1994 snprintf(name, sizeof(name), "%d", pr->dstatscxx . . $ player_record#dstats..suicidescxx . . $ t_dstat#suicides.[DSTAT_LEVELcxx . . $ `netgames/includes/DMFC.h:527:9`!]);
1995 t = strlen(name);
1996 memcpy(&buffer[pos[4]], name, (t < len[4]) ? t : len[4]);
1997
1998 if (pr->statecxx . . $ player_record#state. == STATE_INGAMEcxx . . $ STATE_INGAME.)
1999 snprintf(name, sizeof(name), "%.0f", dNetPlayers[pr->pnumcxx . . $ player_record#pnum.].ping_timecxx . . $ netplayer#ping_time. * 1000.0f);
2000 else
2001 strcpy(name, "---");
2002 t = strlen(name);
2003 memcpy(&buffer[pos[5]], name, (t < len[5]) ? t : len[5]);
2004 buffer[pos[5] + len[5] + 1] = '\n';
2005 buffer[pos[5] + len[5] + 2] = '\0';
2006 DPrintf(buffer);
2007 }
2008 }
2009 }