| 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/manage/manage.cpp $ |
| 21 | * $Revision: 103 $ |
| 22 | * $Date: 10/10/01 11:32a $ |
| 23 | * $Author: Matt $ |
| 24 | * |
| 25 | * Jason should put something here |
| 26 | * |
| 27 | * $Log: /DescentIII/Main/manage/manage.cpp $ |
| 28 | * |
| 29 | * 103 10/10/01 11:32a Matt |
| 30 | * Added system to check for errors when reading in add-on data. |
| 31 | * |
| 32 | * 102 10/08/01 1:50p Matt |
| 33 | * Added a case for gamefile pagetype to avoid int3 |
| 34 | * |
| 35 | * 101 4/19/00 5:07p Matt |
| 36 | * From Duane for 1.4 |
| 37 | * Added checks, asserts, and fixes for bad return values |
| 38 | * |
| 39 | * 100 3/20/00 12:27p Matt |
| 40 | * Merge of Duane's post-1.3 changes. |
| 41 | * Mac pilot directory stuff. |
| 42 | * |
| 43 | * 99 10/26/99 3:30p Jeff |
| 44 | * handle extra.gam addon tablefile |
| 45 | * |
| 46 | * 98 10/20/99 6:27p Jeff |
| 47 | * sped up addon page popping (by saving page offsets) |
| 48 | * |
| 49 | * 97 10/19/99 9:14p Chris |
| 50 | * Fixed a memory free bug |
| 51 | * |
| 52 | * 96 8/11/99 5:32p Jeff |
| 53 | * changes to fix addon tablefile support so it works correctly |
| 54 | * |
| 55 | * 95 7/28/99 2:29p Kevin |
| 56 | * Added macintosh DLL extentions (msl) |
| 57 | * |
| 58 | * 94 5/14/99 12:45p Matt |
| 59 | * Removed yet more static data |
| 60 | * |
| 61 | * 93 5/14/99 12:33p Matt |
| 62 | * Fixed another case of too much local data for the Mac. |
| 63 | * |
| 64 | * 92 5/13/99 8:36p Matt |
| 65 | * Made some local variables global to get around the 32K local variable |
| 66 | * limit on the Mac. |
| 67 | * |
| 68 | * 91 5/12/99 3:01p Matt |
| 69 | * Declared one texpage structure statically for all the functions that |
| 70 | * need it, because the Mac limits local data to 32K. |
| 71 | * |
| 72 | * 90 4/30/99 8:53p Matt |
| 73 | * Added a "voice" directory for gamefiles. |
| 74 | * |
| 75 | * 89 4/22/99 3:26p Jason |
| 76 | * added transferring of pagelocks |
| 77 | * |
| 78 | * 88 4/20/99 12:06a Jeff |
| 79 | * added so files to data/scripts search path |
| 80 | * |
| 81 | * 87 4/15/99 5:21p Jason |
| 82 | * sped up table file loading |
| 83 | * |
| 84 | * 86 4/14/99 10:46a Kevin |
| 85 | * Removed OutrageMessageBox from release builds |
| 86 | * |
| 87 | * 85 4/14/99 1:33a Jeff |
| 88 | * fixed case mismatched #includes |
| 89 | * |
| 90 | * 84 4/12/99 3:05p Jason |
| 91 | * changes for 256 textures |
| 92 | * |
| 93 | * 83 3/05/99 10:42a Jason |
| 94 | * more deletion of pagelocls |
| 95 | * |
| 96 | * 82 3/04/99 1:46p Jason |
| 97 | * fixed some manage problems |
| 98 | * |
| 99 | * 81 2/27/99 5:15p Jason |
| 100 | * fixed search path bug |
| 101 | * |
| 102 | * 80 2/17/99 12:11p Jason |
| 103 | * added music directory to searchable list |
| 104 | * |
| 105 | * 79 2/16/99 11:35a Samir |
| 106 | * added art directory. |
| 107 | * |
| 108 | * 78 2/10/99 3:47p Jason |
| 109 | * before doing a backup, makes sure that the tablefile version is the |
| 110 | * same on the net and on the local machine |
| 111 | * |
| 112 | * 77 1/29/99 6:29p Jason |
| 113 | * first pass at adding bumpmaps |
| 114 | * |
| 115 | * 76 1/21/99 11:16p Jeff |
| 116 | * pulled out some structs and defines from header files and moved them |
| 117 | * into seperate header files so that multiplayer dlls don't require major |
| 118 | * game headers, just those new headers. Side effect is a shorter build |
| 119 | * time. Also cleaned up some header file #includes that weren't needed. |
| 120 | * This affected polymodel.h, object.h, player.h, vecmat.h, room.h, |
| 121 | * manage.h and multi.h |
| 122 | * |
| 123 | * 75 1/13/99 2:49p Jeff |
| 124 | * added .msg to the search path for data\scripts |
| 125 | * |
| 126 | * 74 1/13/99 7:08a Jeff |
| 127 | * put some #ifdef's around some window's specific code (really only used |
| 128 | * in the editor, but EDITOR is never defined when building manage) so it |
| 129 | * builds in linux |
| 130 | * |
| 131 | * 73 12/30/98 6:52p Matt |
| 132 | * Fixed compile warnings |
| 133 | * |
| 134 | * 72 12/29/98 4:30p Jason |
| 135 | * added add-on data functionality |
| 136 | * |
| 137 | * 71 12/13/98 7:51p Jeff |
| 138 | * only check the script directory for cpp,dll and def files |
| 139 | * |
| 140 | * 70 12/11/98 5:50p Jeff |
| 141 | * implemented and added changes regarding Level&Scripting manage system |
| 142 | * and compiler interface |
| 143 | * |
| 144 | * 69 11/28/98 2:19p Jason |
| 145 | * fixed stupid filecopy bug |
| 146 | * |
| 147 | * 68 11/18/98 11:02a Jason |
| 148 | * temp fix for table problems |
| 149 | * |
| 150 | * 67 11/16/98 3:49p Jason |
| 151 | * changes for manage system |
| 152 | * |
| 153 | * 66 11/16/98 2:43p Jason |
| 154 | * better file checking for old files |
| 155 | * |
| 156 | * 65 11/13/98 12:30p Jason |
| 157 | * fixed reordered pages bug |
| 158 | * |
| 159 | * 64 11/13/98 12:30p Jason |
| 160 | * changes for weapons |
| 161 | * |
| 162 | * 63 11/06/98 6:00p Josh |
| 163 | * fixed dumb bug |
| 164 | * |
| 165 | * 62 11/06/98 5:28p Josh |
| 166 | * FROM JASON:upped tracklock limit |
| 167 | * |
| 168 | * 61 11/06/98 12:35p Jason |
| 169 | * more speedups for manage system |
| 170 | * |
| 171 | * 60 11/05/98 7:55p Jason |
| 172 | * changes for new manage system |
| 173 | * |
| 174 | * 59 11/04/98 11:02a Jason |
| 175 | * added levels and briefing directories to new "old files" update method |
| 176 | * |
| 177 | * 58 11/02/98 6:35p Jason |
| 178 | * changes for filter |
| 179 | * |
| 180 | * 57 11/02/98 6:02p Jason |
| 181 | * made yes network updates much faster |
| 182 | * |
| 183 | * 56 10/15/98 8:48a Matt |
| 184 | * Changed some errors to use Error() instead of OutrageMessageBox() |
| 185 | * |
| 186 | * 55 10/14/98 5:15p Jason |
| 187 | * added version checking to the table file |
| 188 | * |
| 189 | * 54 10/12/98 11:38p Jeff |
| 190 | * wrapped all the Object_info[].description whenever freed...trying to |
| 191 | * find an obscure bug. Added icon_name to manage page of Generic |
| 192 | * |
| 193 | * 53 10/12/98 10:31a Jason |
| 194 | * don't seach data directories if release |
| 195 | * |
| 196 | * 52 10/09/98 4:39p Jason |
| 197 | * fixed local table file message |
| 198 | * |
| 199 | * 51 10/09/98 2:27p Jason |
| 200 | * reorganized table file system |
| 201 | * |
| 202 | * 50 10/09/98 2:40a Jason |
| 203 | * fixed table file issues with demo |
| 204 | * |
| 205 | * 49 10/08/98 10:03p Jason |
| 206 | * more filtered table file stuff |
| 207 | * |
| 208 | * 48 10/08/98 7:05p Jason |
| 209 | * added file filter support |
| 210 | * |
| 211 | * 47 9/28/98 6:53p Kevin |
| 212 | * localized some multiplayer menus |
| 213 | * |
| 214 | * 46 9/25/98 4:37p Jason |
| 215 | * fixed dedicated server printing out progress messages |
| 216 | * |
| 217 | * 45 9/25/98 2:53p Jason |
| 218 | * added progress bar |
| 219 | * |
| 220 | * 44 9/25/98 12:24p Samir |
| 221 | * fixed bugs for release version. |
| 222 | * |
| 223 | * 43 9/24/98 6:22p Jason |
| 224 | * fixed RELEASE version asking to update network files |
| 225 | * |
| 226 | * 42 9/18/98 3:58p Jason |
| 227 | * change weapon reordering to do countermeasure weapons after generics |
| 228 | * |
| 229 | * 41 9/15/98 4:31p Jason |
| 230 | * added more functionality for the dedicated server |
| 231 | * |
| 232 | * 40 9/14/98 6:28p Jason |
| 233 | * first pass at getting dedicated server working |
| 234 | * |
| 235 | * 39 8/25/98 3:42p Jason |
| 236 | * fixed generic object problems |
| 237 | * |
| 238 | * 38 8/25/98 3:25p Jason |
| 239 | * turned off fast load trick |
| 240 | * |
| 241 | * 37 8/17/98 4:00p Jason |
| 242 | * Added mprintf |
| 243 | * |
| 244 | * 36 8/15/98 5:17p Matt |
| 245 | * Added new Base_directory variable. Got rid of D3_LOCAL check and |
| 246 | * 'local directory' registry variable. |
| 247 | * |
| 248 | * 35 8/13/98 6:34p Jason |
| 249 | * made table file loading much faster |
| 250 | * |
| 251 | * 34 8/10/98 1:49p Samir |
| 252 | * added music directory. |
| 253 | * |
| 254 | * 33 8/03/98 6:44p Jason |
| 255 | * set custom graphics in the search path |
| 256 | * |
| 257 | * 32 7/27/98 6:25p Jeff |
| 258 | * added creation of custom directories |
| 259 | * |
| 260 | * 31 6/23/98 2:43p Matt |
| 261 | * Changed calls to OutrageMessageBox() & Debug_MessageBox() to deal with |
| 262 | * int return value (instead of bool). |
| 263 | * |
| 264 | * 30 6/12/98 1:06p Jason |
| 265 | * added smart loading from local table file |
| 266 | * |
| 267 | * 29 5/04/98 5:00p Keneta |
| 268 | * FROM JASON:Fixed copyfile bug |
| 269 | * |
| 270 | * 28 5/04/98 4:42p Jason |
| 271 | * even better error checking |
| 272 | * |
| 273 | * 26 5/04/98 4:24p Jason |
| 274 | * upped MAX_TRIES |
| 275 | * |
| 276 | * 25 5/04/98 4:18p Jason |
| 277 | * added assert to prevent table file problems |
| 278 | * |
| 279 | * 24 3/31/98 3:49p Jason |
| 280 | * added memory lib |
| 281 | * |
| 282 | * 23 3/19/98 3:51p Samir |
| 283 | * added misc data directory. |
| 284 | * |
| 285 | * 22 2/23/98 2:00p Jason |
| 286 | * Pop up a message box when table file couldn't be opened |
| 287 | * |
| 288 | * 21 2/06/98 12:15p Jason |
| 289 | * upped max times program will try to delete the table file before |
| 290 | * bailing |
| 291 | * |
| 292 | * 20 2/04/98 11:47a Jason |
| 293 | * added dynamic description field to generic pages |
| 294 | * |
| 295 | * 19 1/26/98 11:32a Jason |
| 296 | * upped the number of times the system will try to delete a table file |
| 297 | * |
| 298 | * 18 1/22/98 2:49p Samir |
| 299 | * Added D3 Local Dir to the search path. |
| 300 | * |
| 301 | * 17 1/15/98 6:22p Jason |
| 302 | * added safety checks so the network won't copy over a primitive you have |
| 303 | * held locally |
| 304 | * |
| 305 | * 16 1/15/98 4:54p Mark |
| 306 | * FROM JASON:Do switcheroo a few times before giving up |
| 307 | * |
| 308 | * 15 12/22/97 3:50p Chris |
| 309 | * |
| 310 | * 14 11/17/97 4:16p Jason |
| 311 | * added briefings directory |
| 312 | * |
| 313 | * 13 9/09/97 4:07p Matt |
| 314 | * Added mprintf() |
| 315 | * |
| 316 | * 12 9/04/97 2:53p Samir |
| 317 | * Added gamefile and generic page strings to PageNames array. |
| 318 | * |
| 319 | * 11 8/12/97 12:47p Matt |
| 320 | * Only copy pagefile from net if different from local copy. |
| 321 | * When loading pages, print different char for each type |
| 322 | * Show how long it took to load the pagefile |
| 323 | * |
| 324 | * 10 8/11/97 1:54p Matt |
| 325 | * Ripped out robot & powerup pages, and added generic page |
| 326 | * |
| 327 | * 9 8/08/97 5:17p Jason |
| 328 | * made it so that when you update from the network it doesn't halt other |
| 329 | * users |
| 330 | * |
| 331 | * 8 8/08/97 3:44p Jason |
| 332 | * added code to support new generic page |
| 333 | * |
| 334 | * 7 8/08/97 1:57p Matt |
| 335 | * Took out error message now handled by mng_MakeLocker() |
| 336 | * |
| 337 | * 6 7/29/97 12:07p Jason |
| 338 | * added gamefile page for auto retrieval of non-standard page types |
| 339 | * |
| 340 | * 50 6/27/97 3:11p Jason |
| 341 | * added room directories |
| 342 | * |
| 343 | * |
| 344 | * 49 6/11/97 1:07p Samir |
| 345 | * The removal of gameos and replaced with oeApplication, oeDatabase |
| 346 | * |
| 347 | * 48 6/10/97 5:08p Jason |
| 348 | * added reorderpages menu item |
| 349 | * |
| 350 | * 47 6/05/97 2:52p Jason |
| 351 | * added megacell functions |
| 352 | * |
| 353 | * 46 5/30/97 11:41a Jason |
| 354 | * made a better error message if someone already has the table file |
| 355 | * locked upon startup |
| 356 | * |
| 357 | * 45 5/22/97 3:08p Jason |
| 358 | * added the ReorderPage function |
| 359 | * |
| 360 | * 44 5/16/97 3:53p Jason |
| 361 | * added filepage dialog |
| 362 | * |
| 363 | * 43 5/15/97 5:56 PM Jeremy |
| 364 | * made initlocaltable files check if the file exists by using cfexist |
| 365 | * rather than trying to open the file and checking the error code |
| 366 | * |
| 367 | * 42 5/14/97 6:38p Jason |
| 368 | * fixed a plethora of potential problems by locking the table file when |
| 369 | * someone is starting up. |
| 370 | * |
| 371 | * 41 5/14/97 6:44 PM Jeremy |
| 372 | * fixed a bug where local dir backup directory was not being set |
| 373 | * correctly in init local table files |
| 374 | * |
| 375 | * 40 5/13/97 3:41p Jason |
| 376 | * made all manage code work with the new device independant database |
| 377 | * |
| 378 | * 39 5/08/97 12:41p Jason |
| 379 | * made manage system work with device dependant path names |
| 380 | * |
| 381 | * 38 4/29/97 5:07p Samir |
| 382 | * Added levels directory to search path |
| 383 | * |
| 384 | * 37 4/25/97 6:16p Jason |
| 385 | * added switcheroo function |
| 386 | * |
| 387 | * 36 4/01/97 2:13p Jason |
| 388 | * changes for sound page functionality |
| 389 | * |
| 390 | * 35 3/31/97 4:35p Jason |
| 391 | * added player ship and weapon pages |
| 392 | * |
| 393 | * 34 3/25/97 3:10p Jason |
| 394 | * added robots and robot page functionality |
| 395 | * |
| 396 | * 33 3/17/97 4:27p Jason |
| 397 | * added sounds directory to path list |
| 398 | * |
| 399 | * 32 3/14/97 7:18p Matt |
| 400 | * Added missing include |
| 401 | * |
| 402 | * 31 3/14/97 6:13 PM Jeremy |
| 403 | * changed calls to windows "MessageBox" to OutrageMessageBox, changed |
| 404 | * call of GetUserName to os_database->get_user_name, #included descent.h |
| 405 | * in order to refer to the OS_database object, unincluded <windows.h> and |
| 406 | * <direct.h> |
| 407 | * |
| 408 | * 30 3/13/97 7:39p Matt |
| 409 | * Changed code to use getenv() (ANSI-standard) instead of |
| 410 | * GetEnvironmentVariable() |
| 411 | * |
| 412 | * 29 3/13/97 12:34p Matt |
| 413 | * Changed code to not leave directory changed after checking for presence |
| 414 | * of a directory. |
| 415 | * |
| 416 | * 28 3/13/97 11:37a Samir |
| 417 | * Changed os file functions to ddio file functions |
| 418 | * |
| 419 | * 27 3/10/97 2:23p Jason |
| 420 | * added auto creation of models directory |
| 421 | * |
| 422 | * 26 3/07/97 1:02p Jason |
| 423 | * Now uses Samir's OS specific directory functions |
| 424 | * |
| 425 | * 25 3/05/97 3:10p Jason |
| 426 | * added more door functionality |
| 427 | * |
| 428 | * 24 3/05/97 12:16p Jason |
| 429 | * added code to support our new 3d doors |
| 430 | * |
| 431 | * 23 3/03/97 6:21p Matt |
| 432 | * Changed cfile functions to use D3 naming convention |
| 433 | * |
| 434 | * $NoKeywords: $ |
| 435 | */ |
| 436 | |
| 437 | #include <cerrno> |
| 438 | #include <cstdarg> |
| 439 | #include <cstdio> |
| 440 | #include <cstdlib> |
| 441 | #include <cstring> |
| 442 | #include <filesystem> |
| 443 | |
| 444 | #if defined(POSIXcxx . . $ `<built-in>:478:9`!) |
| 445 | #include "linux_fix.h"cxx . . $ `<file>/linux/linux_fix.h`/ |
| 446 | #endif |
| 447 | #include "descent.h"cxx . . $ `<file>/Descent3/descent.h`/ |
| 448 | #include "manage.h"cxx . . $ `<file>/lib/manage.h`/ |
| 449 | #include "pserror.h"cxx . . $ `<file>/misc/pserror.h`/ |
| 450 | #include "gametexture.h"cxx . . $ `<file>/Descent3/gametexture.h`/ |
| 451 | #include "texpage.h"cxx . . $ `<file>/manage/texpage.h`/ |
| 452 | #include "doorpage.h"cxx . . $ `<file>/manage/doorpage.h`/ |
| 453 | #include "soundpage.h"cxx . . $ `<file>/manage/soundpage.h`/ |
| 454 | #include "megapage.h"cxx . . $ `<file>/manage/megapage.h`/ |
| 455 | #include "shippage.h"cxx . . $ `<file>/manage/shippage.h`/ |
| 456 | #include "weaponpage.h"cxx . . $ `<file>/manage/weaponpage.h`/ |
| 457 | #include "gamefilepage.h"cxx . . $ `<file>/manage/gamefilepage.h`/ |
| 458 | #include "mono.h"cxx . . $ `<file>/ddebug/mono.h`/ |
| 459 | #include "object.h"cxx . . $ `<file>/Descent3/object.h`/ |
| 460 | #include "ddio.h"cxx . . $ `<file>/ddio/ddio.h`/ |
| 461 | #include "cfile.h"cxx . . $ `<file>/cfile/cfile.h`/ |
| 462 | #include "appdatabase.h"cxx . . $ `<file>/lib/appdatabase.h`/ |
| 463 | #include "genericpage.h"cxx . . $ `<file>/manage/genericpage.h`/ |
| 464 | #include "mem.h"cxx . . $ `<file>/mem/mem.h`/ |
| 465 | #include "dedicated_server.h"cxx . . $ `<file>/lib/dedicated_server.h`/ |
| 466 | #include "AppConsole.h"cxx . . $ `<file>/lib/AppConsole.h`/ |
| 467 | #include "init.h"cxx . . $ `<file>/Descent3/init.h`/ |
| 468 | #include "stringtable.h"cxx . . $ `<file>/Descent3/stringtable.h`/ |
| 469 | #include "args.h"cxx . . $ `<file>/Descent3/args.h`/ |
| 470 | #include "vclip.h"cxx . . $ `<file>/Descent3/vclip.h`/ |
| 471 | #include "polymodel.h"cxx . . $ `<file>/model/polymodel.h`/ |
| 472 | int Old_table_methodcxx . . $ Old_table_method. = 0; |
| 473 | void mng_WriteNewUnknownPagecxx . . $ mng_WriteNewUnknownPage(3639e799710acb68).(CFILEcxx . . $ CFILE# *outfile); |
| 474 | // This is for levels |
| 475 | char LocalLevelsDircxx . . $ LocalLevelsDir.[TABLE_NAME_LENcxx . . $ `lib/manage.h:43:9`!]; |
| 476 | // This is for pages |
| 477 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::pathcxx . . $ std/filesystem/__cxx11/path# TableLockFilenamecxx . . $ TableLockFilename.; |
| 478 | char TableFilenamecxx . . $ TableFilename.[TABLE_NAME_LENcxx . . $ `lib/manage.h:43:9`!]; |
| 479 | char TempTableLockFilenamecxx . . $ TempTableLockFilename.[TABLE_NAME_LENcxx . . $ `lib/manage.h:43:9`!], TempTableFilenamecxx . . $ TempTableFilename.[TABLE_NAME_LENcxx . . $ `lib/manage.h:43:9`!]; |
| 480 | char LocalTableFilenamecxx . . $ LocalTableFilename.[TABLE_NAME_LENcxx . . $ `lib/manage.h:43:9`!], LocalTempTableFilenamecxx . . $ LocalTempTableFilename.[TABLE_NAME_LENcxx . . $ `lib/manage.h:43:9`!]; |
| 481 | char BackupTableFilenamecxx . . $ BackupTableFilename.[TABLE_NAME_LENcxx . . $ `lib/manage.h:43:9`!], BackupLockFilenamecxx . . $ BackupLockFilename.[TABLE_NAME_LENcxx . . $ `lib/manage.h:43:9`!]; |
| 482 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::pathcxx . . $ std/filesystem/__cxx11/path# ManageGraphicsDircxx . . $ ManageGraphicsDir., LocalManageGraphicsDircxx . . $ LocalManageGraphicsDir.; |
| 483 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::pathcxx . . $ std/filesystem/__cxx11/path# LocalModelsDircxx . . $ LocalModelsDir., NetModelsDircxx . . $ NetModelsDir.; |
| 484 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::pathcxx . . $ std/filesystem/__cxx11/path# LocalSoundsDircxx . . $ LocalSoundsDir., NetSoundsDircxx . . $ NetSoundsDir.; |
| 485 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::pathcxx . . $ std/filesystem/__cxx11/path# LocalRoomsDircxx . . $ LocalRoomsDir., NetRoomsDircxx . . $ NetRoomsDir.; |
| 486 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::pathcxx . . $ std/filesystem/__cxx11/path# LocalBriefingDircxx . . $ LocalBriefingDir., NetBriefingDircxx . . $ NetBriefingDir.; |
| 487 | char LocalScriptDircxx . . $ LocalScriptDir.[TABLE_NAME_LENcxx . . $ `lib/manage.h:43:9`!], NetScriptDircxx . . $ NetScriptDir.[TABLE_NAME_LENcxx . . $ `lib/manage.h:43:9`!]; |
| 488 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::pathcxx . . $ std/filesystem/__cxx11/path# LocalMiscDircxx . . $ LocalMiscDir., NetMiscDircxx . . $ NetMiscDir.; |
| 489 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::pathcxx . . $ std/filesystem/__cxx11/path# LocalArtDircxx . . $ LocalArtDir., NetArtDircxx . . $ NetArtDir.; |
| 490 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::pathcxx . . $ std/filesystem/__cxx11/path# LocalMusicDircxx . . $ LocalMusicDir., NetMusicDircxx . . $ NetMusicDir.; |
| 491 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::pathcxx . . $ std/filesystem/__cxx11/path# LocalVoiceDircxx . . $ LocalVoiceDir., NetVoiceDircxx . . $ NetVoiceDir.; |
| 492 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::pathcxx . . $ std/filesystem/__cxx11/path# NetTableDircxx . . $ NetTableDir., LocalTableDircxx . . $ LocalTableDir.; |
| 493 | char LocalD3Dircxx . . $ LocalD3Dir.[TABLE_NAME_LENcxx . . $ `lib/manage.h:43:9`!], NetD3Dircxx . . $ NetD3Dir.[TABLE_NAME_LENcxx . . $ `lib/manage.h:43:9`!]; |
| 494 | char LocalCustomGraphicsDircxx . . $ LocalCustomGraphicsDir.[TABLE_NAME_LENcxx . . $ `lib/manage.h:43:9`!]; |
| 495 | char LocalCustomSoundsDircxx . . $ LocalCustomSoundsDir.[TABLE_NAME_LENcxx . . $ `lib/manage.h:43:9`!]; |
| 496 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::pathcxx . . $ std/filesystem/__cxx11/path# LockerFilecxx . . $ LockerFile.; |
| 497 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::pathcxx . . $ std/filesystem/__cxx11/path# VersionFilecxx . . $ VersionFile.; |
| 498 | char TableUsercxx . . $ TableUser.[TABLE_NAME_LENcxx . . $ `lib/manage.h:43:9`!]; |
| 499 | char ErrorStringcxx . . $ ErrorString.[INFO_STRING_LENcxx . . $ `lib/manage.h:44:9`!], InfoStringcxx . . $ InfoString.[INFO_STRING_LENcxx . . $ `lib/manage.h:44:9`!]; |
| 500 | mngs_track_lockcxx . . $ mngs_track_lock# GlobalTrackLockscxx . . $ GlobalTrackLocks.[MAX_TRACKLOCKScxx . . $ `lib/manage.h:46:9`!]; |
| 501 | bool Use_old_update_methodcxx . . $ Use_old_update_method. = false; |
| 502 | char *TablefileNameOverridecxx . . $ TablefileNameOverride. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 503 | // Only valid when first starting the editor |
| 504 | #define MAX_LOCKLIST_ELEMENTScxx . . $ `manage/manage.cpp:504:9`! 1000 |
| 505 | mngs_Pagelockcxx . . $ mngs_Pagelock# *LockListcxx . . $ LockList.; |
| 506 | int Num_locklistcxx . . $ Num_locklist., Starting_editorcxx . . $ Starting_editor. = 0, Loading_localscxx . . $ Loading_locals. = 0, Fast_load_trickcxx . . $ Fast_load_trick. = 0; |
| 507 | #define PRIMTYPE_OOFcxx . . $ `manage/manage.cpp:507:9`! 0 |
| 508 | #define PRIMTYPE_OGFcxx . . $ `manage/manage.cpp:508:9`! 1 |
| 509 | #define PRIMTYPE_WAVcxx . . $ `manage/manage.cpp:509:9`! 2 |
| 510 | #define PRIMTYPE_OAFcxx . . $ `manage/manage.cpp:510:9`! 3 |
| 511 | #define PRIMTYPE_FILEcxx . . $ `manage/manage.cpp:511:9`! 4 |
| 512 | #if defined(WIN32) |
| 513 | FILETIME TableTimeThreshold; |
| 514 | // Builds a list of old files so we know which ones to update |
| 515 | // Searches through all our netdirectories for old files |
| 516 | void BuildOldFileList(FILETIME threshold); |
| 517 | #endif |
| 518 | struct old_filecxx . . $ old_file# { |
| 519 | uint8_tcxx . . $ uint8_t# typecxx . . $ old_file#type.; |
| 520 | char namecxx . . $ old_file#name.[PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!]; |
| 521 | }; |
| 522 | #define MAX_OLDFILE_ELEMENTScxx . . $ `manage/manage.cpp:522:9`! 10000 |
| 523 | int Num_old_filescxx . . $ Num_old_files. = 0; |
| 524 | old_filecxx . . $ old_file# *OldFilescxx . . $ OldFiles.; |
| 525 | const char *PageNamescxx . . $ PageNames.[] = {"Unknown", "Texture", "Weapon", "Robot", "Powerup", "Door", |
| 526 | "Player ship", "Sound", "Megacell", "Files", "Generic objects"}; |
| 527 | #ifndef RELEASE |
| 528 | int Network_upcxx . . $ Network_up. = 1; |
| 529 | int Stand_alonecxx . . $ Stand_alone. = 0; |
| 530 | #else |
| 531 | int Network_up = 0; |
| 532 | int Stand_alone = 1; |
| 533 | #endif |
| 534 | void mng_BackupTableFilecxx . . $ mng_BackupTableFile(49f6e7a06ebc5aa8).(); |
| 535 | |
| 536 | // returns 1 if network is up, 0 if down |
| 537 | int mng_IsNetworkUpcxx . . $ mng_IsNetworkUp(b126dc7c1de90089).() { |
| 538 | char dir[100]; |
| 539 | if (Stand_alonecxx . . $ Stand_alone.) |
| 540 | return 0; |
| 541 | |
| 542 | char net_dir[255] = {0}; |
| 543 | int dirlen = 255; |
| 544 | Databasecxx . . $ Database.->readcxx . . $ oeAppDatabase#read(3bcbb53201fcdcb8).("net directory", net_dir, &dirlen); |
| 545 | if (net_dir[0] == 0) |
| 546 | return 0; |
| 547 | ddio_MakePathcxx . . $ ddio_MakePath(9ad4b0815420a85).(dir, net_dir, "data", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); |
| 548 | |
| 549 | stdcxx . . $ std/::error_codecxx . . $ std/error_code# eccxx . . $ std/error_code#error_code(ced63f7c635d850d).; |
| 550 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::create_directoriescxx . . $ std/filesystem/create_directories(d743b8a22d0b5f99).(dircxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., ec); |
| 551 | if (!ec) { |
| 552 | char old_dir[100]; |
| 553 | ddio_GetWorkingDircxx . . $ ddio_GetWorkingDir(a07d8cccb7673f5a).(old_dir, 100); |
| 554 | if (!ddio_SetWorkingDircxx . . $ ddio_SetWorkingDir(c5f7da30cbc0f4e9).(dir)) |
| 555 | return 0; // network down |
| 556 | else { |
| 557 | ddio_SetWorkingDircxx . . $ ddio_SetWorkingDir(c5f7da30cbc0f4e9).(old_dir); // restore directory |
| 558 | return 1; // directory is already there |
| 559 | } |
| 560 | } |
| 561 | |
| 562 | return 1; |
| 563 | } |
| 564 | void ReorderPagescxx . . $ ReorderPages(d4f767463ce0a6b3).(int); |
| 565 | // #define JASONS_REORDERING |
| 566 | void Read256TextureNamescxx . . $ Read256TextureNames(49f6e7a06ebc5aa8).(); |
| 567 | // Sets up our table files, get their filenames, etc. |
| 568 | // Returns 1 on success, zero on error |
| 569 | int mng_InitTableFilescxx . . $ mng_InitTableFiles(b126dc7c1de90089).() { |
| 570 | size_t size = TABLE_NAME_LENcxx . . $ `lib/manage.h:43:9`!; |
| 571 | int answer; |
| 572 | Databasecxx . . $ Database.->get_user_namecxx . . $ oeAppDatabase#get_user_name(5edd826d049e7804).(TableUsercxx . . $ TableUser., &size); |
| 573 | if (FindArgcxx . . $ FindArg(5c4306d8553b3696).("-filter")) |
| 574 | Use_old_update_methodcxx . . $ Use_old_update_method. = true; |
| 575 | // Read256TextureNames (); |
| 576 | |
| 577 | if (FindArgcxx . . $ FindArg(5c4306d8553b3696).("-oldmethod")) |
| 578 | Use_old_update_methodcxx . . $ Use_old_update_method. = true; |
| 579 | if (mng_IsNetworkUpcxx . . $ mng_IsNetworkUp(b126dc7c1de90089).()) { |
| 580 | #ifndef RELEASE |
| 581 | answer = OutrageMessageBoxcxx . . $ OutrageMessageBox(811d273381043e7b).(MBOX_YESNOcxx . . $ `misc/pserror.h:165:9`!, "Do you wish to update your data files from the network?\n(If NO is " |
| 582 | "selected then you will have to restart to use networking functions)"); |
| 583 | #else |
| 584 | answer = IDNO; |
| 585 | #endif |
| 586 | if (answer == IDNOcxx . . $ `ddebug/debug.h:133:9`!) |
| 587 | Network_upcxx . . $ Network_up. = 0; |
| 588 | else { |
| 589 | Network_upcxx . . $ Network_up. = 1; |
| 590 | #ifndef RELEASE |
| 591 | #if defined(WIN32) |
| 592 | if (cfexist("c:\\edload")) |
| 593 | Use_old_update_method = true; |
| 594 | else { |
| 595 | CFILE *fp = cfopen("c:\\edload", "wt"); |
| 596 | cfclose(fp); |
| 597 | } |
| 598 | #endif |
| 599 | #endif |
| 600 | } |
| 601 | } else { |
| 602 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Network is down...\n"); |
| 603 | Network_upcxx . . $ Network_up. = 0; |
| 604 | } |
| 605 | |
| 606 | if (Network_upcxx . . $ Network_up. == 0) { |
| 607 | mng_InitLocalTablescxx . . $ mng_InitLocalTables(b126dc7c1de90089).(); |
| 608 | mng_InitLocalDirectoriescxx . . $ mng_InitLocalDirectories(49f6e7a06ebc5aa8).(); |
| 609 | mng_CheckToCreateLocalTablescxx . . $ mng_CheckToCreateLocalTables(49f6e7a06ebc5aa8).(); |
| 610 | mng_InitTrackLockscxx . . $ mng_InitTrackLocks(49f6e7a06ebc5aa8).(); |
| 611 | } else { |
| 612 | // Do locals |
| 613 | mng_InitLocalTablescxx . . $ mng_InitLocalTables(b126dc7c1de90089).(); |
| 614 | mng_InitLocalDirectoriescxx . . $ mng_InitLocalDirectories(49f6e7a06ebc5aa8).(); |
| 615 | mng_CheckToCreateLocalTablescxx . . $ mng_CheckToCreateLocalTables(49f6e7a06ebc5aa8).(); |
| 616 | |
| 617 | // Do network |
| 618 | mng_InitNetTablescxx . . $ mng_InitNetTables(b126dc7c1de90089).(); |
| 619 | mng_InitNetDirectoriescxx . . $ mng_InitNetDirectories(49f6e7a06ebc5aa8).(); |
| 620 | mng_CheckToCreateNetTablescxx . . $ mng_CheckToCreateNetTables(49f6e7a06ebc5aa8).(); |
| 621 | mng_BackupTableFilecxx . . $ mng_BackupTableFile(49f6e7a06ebc5aa8).(); |
| 622 | mng_InitPagelockscxx . . $ mng_InitPagelocks(49f6e7a06ebc5aa8).(); |
| 623 | mng_InitTrackLockscxx . . $ mng_InitTrackLocks(49f6e7a06ebc5aa8).(); |
| 624 | #ifdef JASONS_REORDERING |
| 625 | ReorderPages(0); |
| 626 | return 0; |
| 627 | #endif |
| 628 | } |
| 629 | return 1; |
| 630 | } |
| 631 | // Loads our tables |
| 632 | int mng_LoadTableFilescxx . . $ mng_LoadTableFiles(7864480464b09eea).(int show_progress) { |
| 633 | if (Network_upcxx . . $ Network_up.) { |
| 634 | LockListcxx . . $ LockList. = (mngs_Pagelockcxx . . $ mngs_Pagelock# *)mem_malloccxx . . $ `mem/mem.h:79:9`!(MAX_LOCKLIST_ELEMENTScxx . . $ `manage/manage.cpp:504:9`! * sizeof(mngs_Pagelock)); |
| 635 | Num_locklistcxx . . $ Num_locklist. = mng_GetListOfLockscxx . . $ mng_GetListOfLocks(1efb1472e1428b14).(LockListcxx . . $ LockList., MAX_LOCKLIST_ELEMENTScxx . . $ `manage/manage.cpp:504:9`!, TableUsercxx . . $ TableUser.); |
| 636 | OldFilescxx . . $ OldFiles. = (old_filecxx . . $ old_file# *)mem_malloccxx . . $ `mem/mem.h:79:9`!(MAX_OLDFILE_ELEMENTScxx . . $ `manage/manage.cpp:522:9`! * sizeof(old_file)); |
| 637 | Num_old_filescxx . . $ Num_old_files. = 0; |
| 638 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(OldFiles); |
| 639 | #if defined(WIN32) |
| 640 | if (TableTimeThreshold.dwHighDateTime != -1) |
| 641 | BuildOldFileList(TableTimeThreshold); |
| 642 | #endif |
| 643 | |
| 644 | Starting_editorcxx . . $ Starting_editor. = 1; |
| 645 | } |
| 646 | int ret1, ret2; |
| 647 | if (Fast_load_trickcxx . . $ Fast_load_trick. && !FindArgcxx . . $ FindArg(5c4306d8553b3696).("-filter")) |
| 648 | Network_upcxx . . $ Network_up. = 0; |
| 649 | |
| 650 | ret1 = mng_LoadNetPagescxx . . $ mng_LoadNetPages(7864480464b09eea).(show_progress); |
| 651 | if (Fast_load_trickcxx . . $ Fast_load_trick.) { |
| 652 | Network_upcxx . . $ Network_up. = 1; |
| 653 | Fast_load_trickcxx . . $ Fast_load_trick. = 0; |
| 654 | } |
| 655 | ret2 = mng_LoadLocalPagescxx . . $ mng_LoadLocalPages(b126dc7c1de90089).(); |
| 656 | if (Network_upcxx . . $ Network_up.) { |
| 657 | Starting_editorcxx . . $ Starting_editor. = 0; |
| 658 | Num_locklistcxx . . $ Num_locklist. = 0; |
| 659 | Num_old_filescxx . . $ Num_old_files. = 0; |
| 660 | mem_freecxx . . $ `mem/mem.h:80:9`!(OldFiles); |
| 661 | mem_freecxx . . $ `mem/mem.h:80:9`!(LockList); |
| 662 | #ifndef RELEASE |
| 663 | #if defined(WIN32) |
| 664 | remove("c:\\edload"); |
| 665 | #endif |
| 666 | #endif |
| 667 | } |
| 668 | RemapEverythingcxx . . $ RemapEverything(49f6e7a06ebc5aa8).(); |
| 669 | |
| 670 | if (!ret1 || !ret2) |
| 671 | return 0; |
| 672 | return 1; |
| 673 | } |
| 674 | // This is for initting tables on STAND_ALONE, if the network is down, or if |
| 675 | // the user doesn't want network support |
| 676 | int mng_InitLocalTablescxx . . $ mng_InitLocalTables(b126dc7c1de90089).() { |
| 677 | // Set the local table directory from the base directory |
| 678 | strcpy(LocalD3Dircxx . . $ LocalD3Dir., Base_directorycxx . . $ Base_directory.); |
| 679 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(1, "Local dir:%s\n", LocalD3Dir); |
| 680 | |
| 681 | // Make the CFILE system first look at our local directories. If the goods aren't |
| 682 | // found there, try out on the network |
| 683 | // TODO: temp variable until LocalD3Dir will be std::fs::path |
| 684 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::pathcxx . . $ std/filesystem/__cxx11/path# localdir = stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::pathcxx . . $ std/filesystem/__cxx11/path#(LocalD3Dircxx . . $ LocalD3Dir.); |
| 685 | LocalTableDircxx . . $ LocalTableDir. =cxx . . $ std/filesystem/__cxx11/path#`operator=`(9c9aa2f17f237d0f). localdir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "data"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "tables"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).; |
| 686 | LocalManageGraphicsDircxx . . $ LocalManageGraphicsDir. =cxx . . $ std/filesystem/__cxx11/path#`operator=`(9c9aa2f17f237d0f). localdir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "data"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "graphics"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).; |
| 687 | LocalModelsDircxx . . $ LocalModelsDir. =cxx . . $ std/filesystem/__cxx11/path#`operator=`(9c9aa2f17f237d0f). localdir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "data"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "models"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).; |
| 688 | LocalSoundsDircxx . . $ LocalSoundsDir. =cxx . . $ std/filesystem/__cxx11/path#`operator=`(9c9aa2f17f237d0f). localdir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "data"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "sounds"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).; |
| 689 | ddio_MakePathcxx . . $ ddio_MakePath(9ad4b0815420a85).(LocalCustomSoundsDircxx . . $ LocalCustomSoundsDir., LocalD3Dircxx . . $ LocalD3Dir., "custom", "sounds", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); |
| 690 | ddio_MakePathcxx . . $ ddio_MakePath(9ad4b0815420a85).(LocalCustomGraphicsDircxx . . $ LocalCustomGraphicsDir., LocalD3Dircxx . . $ LocalD3Dir., "custom", "graphics", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); |
| 691 | LocalRoomsDircxx . . $ LocalRoomsDir. =cxx . . $ std/filesystem/__cxx11/path#`operator=`(9c9aa2f17f237d0f). localdir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "data"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "rooms"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).; |
| 692 | LocalBriefingDircxx . . $ LocalBriefingDir. =cxx . . $ std/filesystem/__cxx11/path#`operator=`(9c9aa2f17f237d0f). localdir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "data"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "briefings"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).; |
| 693 | ddio_MakePathcxx . . $ ddio_MakePath(9ad4b0815420a85).(LocalScriptDircxx . . $ LocalScriptDir., LocalD3Dircxx . . $ LocalD3Dir., "data", "scripts", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); |
| 694 | LocalMiscDircxx . . $ LocalMiscDir. =cxx . . $ std/filesystem/__cxx11/path#`operator=`(9c9aa2f17f237d0f). localdir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "data"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "misc"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).; |
| 695 | LocalArtDircxx . . $ LocalArtDir. =cxx . . $ std/filesystem/__cxx11/path#`operator=`(9c9aa2f17f237d0f). localdir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "data"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "art"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).; |
| 696 | LocalMusicDircxx . . $ LocalMusicDir. =cxx . . $ std/filesystem/__cxx11/path#`operator=`(9c9aa2f17f237d0f). localdir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "data"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "music"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).; |
| 697 | LocalVoiceDircxx . . $ LocalVoiceDir. =cxx . . $ std/filesystem/__cxx11/path#`operator=`(9c9aa2f17f237d0f). localdir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "data"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "voice"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).; |
| 698 | ddio_MakePathcxx . . $ ddio_MakePath(9ad4b0815420a85).(LocalLevelsDircxx . . $ LocalLevelsDir., LocalD3Dircxx . . $ LocalD3Dir., "data", "levels", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); |
| 699 | cf_SetSearchPathcxx . . $ cf_SetSearchPath(29ebe24842deaaf3).(LocalD3Dircxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).); |
| 700 | #ifndef RELEASE |
| 701 | cf_SetSearchPathcxx . . $ cf_SetSearchPath(29ebe24842deaaf3).(LocalLevelsDircxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).); |
| 702 | cf_SetSearchPathcxx . . $ cf_SetSearchPath(29ebe24842deaaf3).(LocalTableDircxx . . $ LocalTableDir.); // Local table directory |
| 703 | |
| 704 | cf_SetSearchPathcxx . . $ cf_SetSearchPath(29ebe24842deaaf3).(LocalManageGraphicsDircxx . . $ LocalManageGraphicsDir.); |
| 705 | cf_SetSearchPathcxx . . $ cf_SetSearchPath(29ebe24842deaaf3).(LocalModelsDircxx . . $ LocalModelsDir.); |
| 706 | cf_SetSearchPathcxx . . $ cf_SetSearchPath(29ebe24842deaaf3).(LocalSoundsDircxx . . $ LocalSoundsDir.); |
| 707 | cf_SetSearchPathcxx . . $ cf_SetSearchPath(29ebe24842deaaf3).(LocalRoomsDircxx . . $ LocalRoomsDir.); |
| 708 | cf_SetSearchPathcxx . . $ cf_SetSearchPath(29ebe24842deaaf3).(LocalBriefingDircxx . . $ LocalBriefingDir.); |
| 709 | cf_SetSearchPathcxx . . $ cf_SetSearchPath(29ebe24842deaaf3).(LocalScriptDircxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., {cxx . . $ std/vector#vector(9619226211e5a241).".cpp", ".dll", ".def", ".msg", ".so", ".msl", ".dylib"}); |
| 710 | cf_SetSearchPathcxx . . $ cf_SetSearchPath(29ebe24842deaaf3).(LocalMiscDircxx . . $ LocalMiscDir.); |
| 711 | cf_SetSearchPathcxx . . $ cf_SetSearchPath(29ebe24842deaaf3).(LocalArtDircxx . . $ LocalArtDir.); |
| 712 | cf_SetSearchPathcxx . . $ cf_SetSearchPath(29ebe24842deaaf3).(LocalMusicDircxx . . $ LocalMusicDir.); |
| 713 | cf_SetSearchPathcxx . . $ cf_SetSearchPath(29ebe24842deaaf3).(LocalVoiceDircxx . . $ LocalVoiceDir.); |
| 714 | #endif |
| 715 | |
| 716 | if (Network_upcxx . . $ Network_up.) { |
| 717 | ddio_MakePathcxx . . $ ddio_MakePath(9ad4b0815420a85).(LocalTableFilenamecxx . . $ LocalTableFilename., LocalTableDircxx . . $ LocalTableDir..u8stringcxx . . $ std/filesystem/__cxx11/path#u8string(219584694fe2b248).().c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(), LOCAL_TABLEcxx . . $ `lib/manage.h:33:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); |
| 718 | ddio_MakePathcxx . . $ ddio_MakePath(9ad4b0815420a85).(LocalTempTableFilenamecxx . . $ LocalTempTableFilename., LocalTableDircxx . . $ LocalTableDir..u8stringcxx . . $ std/filesystem/__cxx11/path#u8string(219584694fe2b248).().c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(), TEMP_LOCAL_TABLEcxx . . $ `lib/manage.h:34:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); |
| 719 | } else { |
| 720 | strcpy(LocalTableFilenamecxx . . $ LocalTableFilename., LOCAL_TABLEcxx . . $ `lib/manage.h:33:9`!); |
| 721 | strcpy(LocalTempTableFilenamecxx . . $ LocalTempTableFilename., TEMP_LOCAL_TABLEcxx . . $ `lib/manage.h:34:9`!); |
| 722 | } |
| 723 | |
| 724 | return 1; |
| 725 | } |
| 726 | int mng_InitNetTablescxx . . $ mng_InitNetTables(b126dc7c1de90089).() { |
| 727 | char dir[255]; |
| 728 | int dirlen = 255; |
| 729 | Databasecxx . . $ Database.->readcxx . . $ oeAppDatabase#read(3bcbb53201fcdcb8).("net directory", dir, &dirlen); |
| 730 | if (dir[0] == 0) |
| 731 | Errorcxx . . $ Error(326aeb464d16410c).("D3_DIR environment variable not set."); |
| 732 | |
| 733 | strcpy(NetD3Dircxx . . $ NetD3Dir., dir); |
| 734 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(1, "Net dir:%s\n", NetD3Dir); |
| 735 | // TODO: temp variable until NetD3Dir will be std::fs::path |
| 736 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::pathcxx . . $ std/filesystem/__cxx11/path# netdir = stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::pathcxx . . $ std/filesystem/__cxx11/path#(NetD3Dircxx . . $ NetD3Dir.); |
| 737 | |
| 738 | NetModelsDircxx . . $ NetModelsDir. =cxx . . $ std/filesystem/__cxx11/path#`operator=`(9c9aa2f17f237d0f). netdir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "data"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "models"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).; |
| 739 | NetSoundsDircxx . . $ NetSoundsDir. =cxx . . $ std/filesystem/__cxx11/path#`operator=`(9c9aa2f17f237d0f). netdir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "data"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "sounds"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).; |
| 740 | NetRoomsDircxx . . $ NetRoomsDir. =cxx . . $ std/filesystem/__cxx11/path#`operator=`(9c9aa2f17f237d0f). netdir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "data"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "rooms"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).; |
| 741 | NetBriefingDircxx . . $ NetBriefingDir. =cxx . . $ std/filesystem/__cxx11/path#`operator=`(9c9aa2f17f237d0f). netdir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "data"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "briefings"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).; |
| 742 | ddio_MakePathcxx . . $ ddio_MakePath(9ad4b0815420a85).(NetScriptDircxx . . $ NetScriptDir., NetD3Dircxx . . $ NetD3Dir., "data", "scripts", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); |
| 743 | NetMiscDircxx . . $ NetMiscDir. =cxx . . $ std/filesystem/__cxx11/path#`operator=`(9c9aa2f17f237d0f). netdir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "data"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "misc"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).; |
| 744 | ManageGraphicsDircxx . . $ ManageGraphicsDir. =cxx . . $ std/filesystem/__cxx11/path#`operator=`(9c9aa2f17f237d0f). netdir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "data"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "graphics"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).; |
| 745 | NetTableDircxx . . $ NetTableDir. =cxx . . $ std/filesystem/__cxx11/path#`operator=`(9c9aa2f17f237d0f). netdir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "data"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "tables"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).; |
| 746 | NetArtDircxx . . $ NetArtDir. =cxx . . $ std/filesystem/__cxx11/path#`operator=`(9c9aa2f17f237d0f). netdir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "data"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "art"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).; |
| 747 | NetMusicDircxx . . $ NetMusicDir. =cxx . . $ std/filesystem/__cxx11/path#`operator=`(9c9aa2f17f237d0f). netdir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "data"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "music"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).; |
| 748 | NetVoiceDircxx . . $ NetVoiceDir. =cxx . . $ std/filesystem/__cxx11/path#`operator=`(9c9aa2f17f237d0f). netdir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "data"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "voice"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).; |
| 749 | TableLockFilenamecxx . . $ TableLockFilename. =cxx . . $ std/filesystem/__cxx11/path#`operator=`(9c9aa2f17f237d0f). NetTableDircxx . . $ NetTableDir. /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "table.lok"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).; |
| 750 | ddio_MakePathcxx . . $ ddio_MakePath(9ad4b0815420a85).(BackupLockFilenamecxx . . $ BackupLockFilename., NetTableDircxx . . $ NetTableDir..u8stringcxx . . $ std/filesystem/__cxx11/path#u8string(219584694fe2b248).().c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(), "tablelok.bak", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); |
| 751 | ddio_MakePathcxx . . $ ddio_MakePath(9ad4b0815420a85).(BackupTableFilenamecxx . . $ BackupTableFilename., NetTableDircxx . . $ NetTableDir..u8stringcxx . . $ std/filesystem/__cxx11/path#u8string(219584694fe2b248).().c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(), "table.bak", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); |
| 752 | ddio_MakePathcxx . . $ ddio_MakePath(9ad4b0815420a85).(TableFilenamecxx . . $ TableFilename., NetTableDircxx . . $ NetTableDir..u8stringcxx . . $ std/filesystem/__cxx11/path#u8string(219584694fe2b248).().c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(), NET_TABLEcxx . . $ `lib/manage.h:36:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); |
| 753 | ddio_MakePathcxx . . $ ddio_MakePath(9ad4b0815420a85).(TempTableLockFilenamecxx . . $ TempTableLockFilename., NetTableDircxx . . $ NetTableDir..u8stringcxx . . $ std/filesystem/__cxx11/path#u8string(219584694fe2b248).().c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(), "lock.tmp", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); |
| 754 | ddio_MakePathcxx . . $ ddio_MakePath(9ad4b0815420a85).(TempTableFilenamecxx . . $ TempTableFilename., NetTableDircxx . . $ NetTableDir..u8stringcxx . . $ std/filesystem/__cxx11/path#u8string(219584694fe2b248).().c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).(), TEMP_NET_TABLEcxx . . $ `lib/manage.h:37:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); |
| 755 | LockerFilecxx . . $ LockerFile. =cxx . . $ std/filesystem/__cxx11/path#`operator=`(9c9aa2f17f237d0f). NetTableDircxx . . $ NetTableDir. /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "locker"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).; |
| 756 | VersionFilecxx . . $ VersionFile. =cxx . . $ std/filesystem/__cxx11/path#`operator=`(9c9aa2f17f237d0f). NetTableDircxx . . $ NetTableDir. /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "TableVersion"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).; |
| 757 | |
| 758 | cf_SetSearchPathcxx . . $ cf_SetSearchPath(29ebe24842deaaf3).(ManageGraphicsDircxx . . $ ManageGraphicsDir.); |
| 759 | cf_SetSearchPathcxx . . $ cf_SetSearchPath(29ebe24842deaaf3).(NetModelsDircxx . . $ NetModelsDir.); |
| 760 | cf_SetSearchPathcxx . . $ cf_SetSearchPath(29ebe24842deaaf3).(NetSoundsDircxx . . $ NetSoundsDir.); |
| 761 | cf_SetSearchPathcxx . . $ cf_SetSearchPath(29ebe24842deaaf3).(NetRoomsDircxx . . $ NetRoomsDir.); |
| 762 | cf_SetSearchPathcxx . . $ cf_SetSearchPath(29ebe24842deaaf3).(NetMiscDircxx . . $ NetMiscDir.); |
| 763 | cf_SetSearchPathcxx . . $ cf_SetSearchPath(29ebe24842deaaf3).(NetMusicDircxx . . $ NetMusicDir.); |
| 764 | cf_SetSearchPathcxx . . $ cf_SetSearchPath(29ebe24842deaaf3).(NetVoiceDircxx . . $ NetVoiceDir.); |
| 765 | return 1; |
| 766 | } |
| 767 | void mng_CheckToCreateNetTablescxx . . $ mng_CheckToCreateNetTables(49f6e7a06ebc5aa8).() { |
| 768 | CFILEcxx . . $ CFILE# *infile, *outfile; |
| 769 | |
| 770 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(Stand_alone != 1); |
| 771 | |
| 772 | infile = (CFILEcxx . . $ CFILE# *)cfopencxx . . $ cfopen(7c7b94e455f1ae56).(TableFilenamecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., "rb"); |
| 773 | if (infile == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) { |
| 774 | if (errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`! == ENOENTcxx . . $ `<external>/8987895939074593727/errno-base.h:6:9`!) { |
| 775 | outfile = (CFILEcxx . . $ CFILE# *)cfopencxx . . $ cfopen(7c7b94e455f1ae56).(TableFilenamecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., "wb"); |
| 776 | if (!outfile) { |
| 777 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Error creating table file! The network must be down...\n"); |
| 778 | Network_upcxx . . $ Network_up. = 0; |
| 779 | } else { |
| 780 | mng_WriteNewUnknownPagecxx . . $ mng_WriteNewUnknownPage(3639e799710acb68).(outfile); |
| 781 | cfclosecxx . . $ cfclose(3639e799710acb68).(outfile); |
| 782 | } |
| 783 | } else { |
| 784 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Error creating table file! The network must be down...\n"); |
| 785 | Network_upcxx . . $ Network_up. = 0; |
| 786 | } |
| 787 | } |
| 788 | |
| 789 | if (infile) |
| 790 | cfclosecxx . . $ cfclose(3639e799710acb68).(infile); |
| 791 | } |
| 792 | // Checks to see if there is a table file...if not, create one with a dummy page |
| 793 | void mng_CheckToCreateLocalTablescxx . . $ mng_CheckToCreateLocalTables(49f6e7a06ebc5aa8).() { |
| 794 | CFILEcxx . . $ CFILE# *outfile; |
| 795 | |
| 796 | if (!Network_upcxx . . $ Network_up.) { |
| 797 | strcpy(TableFilenamecxx . . $ TableFilename., NET_TABLEcxx . . $ `lib/manage.h:36:9`!); |
| 798 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "table filename = %s\n", TableFilename); |
| 799 | return; |
| 800 | } |
| 801 | |
| 802 | if (!cfexistcxx . . $ cfexist(293b0826c8d9cb54).(LocalTableFilenamecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).)) { |
| 803 | outfile = (CFILEcxx . . $ CFILE# *)cfopencxx . . $ cfopen(7c7b94e455f1ae56).(LocalTableFilenamecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., "wb"); |
| 804 | if (!outfile) { |
| 805 | Errorcxx . . $ Error(326aeb464d16410c).("Error creating local table file!"); |
| 806 | return; |
| 807 | } else { |
| 808 | mng_WriteNewUnknownPagecxx . . $ mng_WriteNewUnknownPage(3639e799710acb68).(outfile); |
| 809 | cfclosecxx . . $ cfclose(3639e799710acb68).(outfile); |
| 810 | } |
| 811 | } |
| 812 | } |
| 813 | // Creates directories if needed |
| 814 | void mng_InitLocalDirectoriescxx . . $ mng_InitLocalDirectories(49f6e7a06ebc5aa8).() { |
| 815 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::pathcxx . . $ std/filesystem/__cxx11/path# dir = LocalD3Dircxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).; |
| 816 | stdcxx . . $ std/::error_codecxx . . $ std/error_code# eccxx . . $ std/error_code#error_code(ced63f7c635d850d).; |
| 817 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::create_directoriescxx . . $ std/filesystem/create_directories(d743b8a22d0b5f99).(dir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "custom"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., ec); |
| 818 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::create_directoriescxx . . $ std/filesystem/create_directories(d743b8a22d0b5f99).(dir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "custom"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "graphics"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., ec); |
| 819 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::create_directoriescxx . . $ std/filesystem/create_directories(d743b8a22d0b5f99).(dir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "custom"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "sounds"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., ec); |
| 820 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::create_directoriescxx . . $ std/filesystem/create_directories(d743b8a22d0b5f99).(dir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "custom"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "settings"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., ec); |
| 821 | |
| 822 | cf_SetSearchPathcxx . . $ cf_SetSearchPath(29ebe24842deaaf3).(LocalCustomGraphicsDircxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).); |
| 823 | cf_SetSearchPathcxx . . $ cf_SetSearchPath(29ebe24842deaaf3).(LocalCustomSoundsDircxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).); |
| 824 | |
| 825 | if (Network_upcxx . . $ Network_up.) { |
| 826 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::create_directoriescxx . . $ std/filesystem/create_directories(d743b8a22d0b5f99).(dir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "data"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., ec); |
| 827 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::create_directoriescxx . . $ std/filesystem/create_directories(d743b8a22d0b5f99).(dir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "data"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "tables"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., ec); |
| 828 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::create_directoriescxx . . $ std/filesystem/create_directories(d743b8a22d0b5f99).(dir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "data"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "graphics"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., ec); |
| 829 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::create_directoriescxx . . $ std/filesystem/create_directories(d743b8a22d0b5f99).(dir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "data"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "sounds"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., ec); |
| 830 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::create_directoriescxx . . $ std/filesystem/create_directories(d743b8a22d0b5f99).(dir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "data"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "rooms"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., ec); |
| 831 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::create_directoriescxx . . $ std/filesystem/create_directories(d743b8a22d0b5f99).(dir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "data"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "levels"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., ec); |
| 832 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::create_directoriescxx . . $ std/filesystem/create_directories(d743b8a22d0b5f99).(dir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "data"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "models"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., ec); |
| 833 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::create_directoriescxx . . $ std/filesystem/create_directories(d743b8a22d0b5f99).(dir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "data"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "briefings"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., ec); |
| 834 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::create_directoriescxx . . $ std/filesystem/create_directories(d743b8a22d0b5f99).(dir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "data"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "scripts"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., ec); |
| 835 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::create_directoriescxx . . $ std/filesystem/create_directories(d743b8a22d0b5f99).(dir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "data"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "misc"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., ec); |
| 836 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::create_directoriescxx . . $ std/filesystem/create_directories(d743b8a22d0b5f99).(dir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "data"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "art"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., ec); |
| 837 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::create_directoriescxx . . $ std/filesystem/create_directories(d743b8a22d0b5f99).(dir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "data"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "music"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., ec); |
| 838 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::create_directoriescxx . . $ std/filesystem/create_directories(d743b8a22d0b5f99).(dir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "data"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "voice"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., ec); |
| 839 | } |
| 840 | } |
| 841 | |
| 842 | void mng_InitNetDirectoriescxx . . $ mng_InitNetDirectories(49f6e7a06ebc5aa8).() { |
| 843 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::pathcxx . . $ std/filesystem/__cxx11/path# dir = NetD3Dircxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).; |
| 844 | stdcxx . . $ std/::error_codecxx . . $ std/error_code# eccxx . . $ std/error_code#error_code(ced63f7c635d850d).; |
| 845 | |
| 846 | if (Stand_alonecxx . . $ Stand_alone.) |
| 847 | return; |
| 848 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::create_directoriescxx . . $ std/filesystem/create_directories(d743b8a22d0b5f99).(dir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "data"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., ec); |
| 849 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::create_directoriescxx . . $ std/filesystem/create_directories(d743b8a22d0b5f99).(dir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "data"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "tables"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., ec); |
| 850 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::create_directoriescxx . . $ std/filesystem/create_directories(d743b8a22d0b5f99).(dir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "data"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "graphics"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., ec); |
| 851 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::create_directoriescxx . . $ std/filesystem/create_directories(d743b8a22d0b5f99).(dir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "data"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "sounds"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., ec); |
| 852 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::create_directoriescxx . . $ std/filesystem/create_directories(d743b8a22d0b5f99).(dir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "data"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "rooms"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., ec); |
| 853 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::create_directoriescxx . . $ std/filesystem/create_directories(d743b8a22d0b5f99).(dir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "data"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "levels"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., ec); |
| 854 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::create_directoriescxx . . $ std/filesystem/create_directories(d743b8a22d0b5f99).(dir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "data"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "models"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., ec); |
| 855 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::create_directoriescxx . . $ std/filesystem/create_directories(d743b8a22d0b5f99).(dir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "data"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "briefings"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., ec); |
| 856 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::create_directoriescxx . . $ std/filesystem/create_directories(d743b8a22d0b5f99).(dir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "data"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "scripts"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., ec); |
| 857 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::create_directoriescxx . . $ std/filesystem/create_directories(d743b8a22d0b5f99).(dir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "data"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "misc"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., ec); |
| 858 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::create_directoriescxx . . $ std/filesystem/create_directories(d743b8a22d0b5f99).(dir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "data"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "art"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., ec); |
| 859 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::create_directoriescxx . . $ std/filesystem/create_directories(d743b8a22d0b5f99).(dir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "data"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "music"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., ec); |
| 860 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::create_directoriescxx . . $ std/filesystem/create_directories(d743b8a22d0b5f99).(dir /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "data"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d). /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). "voice"cxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., ec); |
| 861 | } |
| 862 | |
| 863 | extern int TableVersionCurrentcxx . . $ TableVersionCurrent(b126dc7c1de90089).(); |
| 864 | #if !defined(WIN32) |
| 865 | void mng_BackupTableFilecxx . . $ mng_BackupTableFile(49f6e7a06ebc5aa8).() {} |
| 866 | #else |
| 867 | void mng_BackupTableFile() { |
| 868 | Fast_load_trick = 0; |
| 869 | if (!TableVersionCurrent()) { |
| 870 | Error("You must do a source update and recompile. The data on the network is newer that your sourcecode."); |
| 871 | return; |
| 872 | } |
| 873 | |
| 874 | std::filesystem::path str = LocalTableDir / NET_TABLE; |
| 875 | if (!cfexist(str)) { |
| 876 | TableTimeThreshold.dwHighDateTime = 0; |
| 877 | TableTimeThreshold.dwLowDateTime = 0; |
| 878 | } else { |
| 879 | WIN32_FIND_DATA filedata; |
| 880 | HANDLE filehandle = FindFirstFile(str.u8string().c_str(), &filedata); |
| 881 | if (filehandle == INVALID_HANDLE_VALUE) { |
| 882 | Error("Couldn't open net table file for some reason!"); |
| 883 | return; |
| 884 | } |
| 885 | TableTimeThreshold = filedata.ftLastWriteTime; |
| 886 | FindClose(filehandle); |
| 887 | } |
| 888 | |
| 889 | if (!cfexist(str) || cf_Diff(str, TableFilename)) { |
| 890 | mprintf(0, "Making local copy of table file.\n"); |
| 891 | |
| 892 | if (!cf_CopyFile(str, TableFilename, 1)) |
| 893 | Error("There was an error making a backup copy of the table file.\n"); |
| 894 | str = LocalTableDir / "tablelok.loc"; |
| 895 | if (!cf_CopyFile(str, TableLockFilename, 1)) |
| 896 | Error("There was an error making a backup copy of the locker table file.\n"); |
| 897 | } else { |
| 898 | mprintf(0, "Local table file same as network copy.\n"); |
| 899 | TableTimeThreshold.dwHighDateTime = -1; |
| 900 | Fast_load_trick = 1; |
| 901 | } |
| 902 | } |
| 903 | #endif |
| 904 | void mng_WriteUnknownPagecxx . . $ mng_WriteUnknownPage(3639e799710acb68).(CFILEcxx . . $ CFILE# *outfile) { |
| 905 | // Function for writing out "undefined" page...useful for placeholding |
| 906 | cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, PAGETYPE_UNKNOWNcxx . . $ `lib/manage.h:48:9`!); |
| 907 | } |
| 908 | void mng_WriteNewUnknownPagecxx . . $ mng_WriteNewUnknownPage(3639e799710acb68).(CFILEcxx . . $ CFILE# *outfile) { |
| 909 | // Function for writing out "undefined" page...useful for placeholding |
| 910 | int offset = StartManagePagecxx . . $ StartManagePage(d1801a78c3072b68).(outfile, PAGETYPE_UNKNOWNcxx . . $ `lib/manage.h:48:9`!); |
| 911 | EndManagePagecxx . . $ EndManagePage(966989f25543eb13).(outfile, offset); |
| 912 | } |
| 913 | // Clear out tracklocks |
| 914 | void mng_InitTrackLockscxx . . $ mng_InitTrackLocks(49f6e7a06ebc5aa8).() { |
| 915 | for (int i = 0; i < MAX_TRACKLOCKScxx . . $ `lib/manage.h:46:9`!; i++) { |
| 916 | GlobalTrackLockscxx . . $ GlobalTrackLocks.[i].usedcxx . . $ mngs_track_lock#used. = 0; |
| 917 | GlobalTrackLockscxx . . $ GlobalTrackLocks.[i].pagetypecxx . . $ mngs_track_lock#pagetype. = PAGETYPE_UNKNOWNcxx . . $ `lib/manage.h:48:9`!; |
| 918 | GlobalTrackLockscxx . . $ GlobalTrackLocks.[i].namecxx . . $ mngs_track_lock#name.[0] = 0; |
| 919 | } |
| 920 | } |
| 921 | // Given a name, returns the index of the tracklock with that name |
| 922 | // -1 indicates that it wasn't found |
| 923 | int mng_FindTrackLockcxx . . $ mng_FindTrackLock(6abd07ddb1a912f0).(char *name, int pagetype) { |
| 924 | int i; |
| 925 | for (i = 0; i < MAX_TRACKLOCKScxx . . $ `lib/manage.h:46:9`!; i++) { |
| 926 | if (GlobalTrackLockscxx . . $ GlobalTrackLocks.[i].usedcxx . . $ mngs_track_lock#used. && GlobalTrackLockscxx . . $ GlobalTrackLocks.[i].pagetypecxx . . $ mngs_track_lock#pagetype. == pagetype && |
| 927 | !stricmpcxx . . $ `linux/linux_fix.h:43:9`!(name, GlobalTrackLocks[i].name)) |
| 928 | return i; |
| 929 | } |
| 930 | return -1; |
| 931 | } |
| 932 | // Searches through global array of tracklocks and returns first free one |
| 933 | // Sets the tracklock to be named "name" and its type "pagetype" |
| 934 | // returns -1 if none free |
| 935 | int mng_AllocTrackLockcxx . . $ mng_AllocTrackLock(6abd07ddb1a912f0).(char *name, int pagetype) { |
| 936 | int i; |
| 937 | for (i = 0; i < MAX_TRACKLOCKScxx . . $ `lib/manage.h:46:9`!; i++) |
| 938 | if (GlobalTrackLockscxx . . $ GlobalTrackLocks.[i].usedcxx . . $ mngs_track_lock#used. == 0) { |
| 939 | strcpy(GlobalTrackLockscxx . . $ GlobalTrackLocks.[i].namecxx . . $ mngs_track_lock#name., name); |
| 940 | GlobalTrackLockscxx . . $ GlobalTrackLocks.[i].pagetypecxx . . $ mngs_track_lock#pagetype. = pagetype; |
| 941 | GlobalTrackLockscxx . . $ GlobalTrackLocks.[i].usedcxx . . $ mngs_track_lock#used. = 1; |
| 942 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Tracklock %s allocated.\n", name); |
| 943 | return i; |
| 944 | } |
| 945 | Errorcxx . . $ Error(326aeb464d16410c).("Couldn't get a free tracklock!"); |
| 946 | return -1; |
| 947 | } |
| 948 | // Frees a tracklock |
| 949 | void mng_FreeTrackLockcxx . . $ mng_FreeTrackLock(d4f767463ce0a6b3).(int n) { |
| 950 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Tracklock %s freed.\n", GlobalTrackLocks[n].name); |
| 951 | GlobalTrackLockscxx . . $ GlobalTrackLocks.[n].pagetypecxx . . $ mngs_track_lock#pagetype. = PAGETYPE_UNKNOWNcxx . . $ `lib/manage.h:48:9`!; |
| 952 | GlobalTrackLockscxx . . $ GlobalTrackLocks.[n].usedcxx . . $ mngs_track_lock#used. = 0; |
| 953 | GlobalTrackLockscxx . . $ GlobalTrackLocks.[n].namecxx . . $ mngs_track_lock#name.[0] = 0; |
| 954 | } |
| 955 | // Displays all the network locks of "name" |
| 956 | void mng_DisplayLockListcxx . . $ mng_DisplayLockList(fda57c8427c60377).(char *name) { |
| 957 | mngs_Pagelockcxx . . $ mngs_Pagelock# list[100]; |
| 958 | char temp[200]; |
| 959 | int max = 100; |
| 960 | int num, i; |
| 961 | int length = 0; |
| 962 | char str[5000]; |
| 963 | #ifndef RELEASE |
| 964 | // Get the list |
| 965 | if ((num = mng_GetListOfLockscxx . . $ mng_GetListOfLocks(1efb1472e1428b14).(list, max, name)) < 0) { |
| 966 | OutrageMessageBoxcxx . . $ OutrageMessageBox(811d273381043e7b).(MBOX_OKcxx . . $ `misc/pserror.h:164:9`!, ErrorStringcxx . . $ ErrorString.); |
| 967 | return; |
| 968 | } else if (num == 0) { |
| 969 | OutrageMessageBoxcxx . . $ OutrageMessageBox(811d273381043e7b).(MBOX_OKcxx . . $ `misc/pserror.h:164:9`!, "User has no pages locked."); |
| 970 | return; |
| 971 | } |
| 972 | |
| 973 | // Make a large string with all the info in it |
| 974 | snprintf(str, sizeof(str), "User %s has the following pages locked:\n\n", TableUsercxx . . $ TableUser.); |
| 975 | for (i = 0; i < num; i++) { |
| 976 | snprintf(temp, sizeof(temp), "%s:%s", PageNamescxx . . $ PageNames.[list[i].pagetypecxx . . $ mngs_Pagelock#pagetype.], list[i].namecxx . . $ mngs_Pagelock#name.); |
| 977 | strncat(str, temp, sizeof(str) - strlen(str) - 1); |
| 978 | strncat(str, "\n", sizeof(str) - strlen(str) - 1); |
| 979 | length += strlen(temp); |
| 980 | if (length > 5000 - 100) |
| 981 | break; |
| 982 | } |
| 983 | // Display that string |
| 984 | OutrageMessageBoxcxx . . $ OutrageMessageBox(811d273381043e7b).(MBOX_OKcxx . . $ `misc/pserror.h:164:9`!, str); |
| 985 | #endif |
| 986 | } |
| 987 | // Declare these here because it's too big to put on the stack on the Mac |
| 988 | static mngs_texture_pagecxx . . $ mngs_texture_page# texpagecxx . . $ texpage.; |
| 989 | static mngs_door_pagecxx . . $ mngs_door_page# doorpagecxx . . $ doorpage.; |
| 990 | static mngs_generic_pagecxx . . $ mngs_generic_page# genericpagecxx . . $ genericpage.; |
| 991 | static mngs_sound_pagecxx . . $ mngs_sound_page# soundpagecxx . . $ soundpage.; |
| 992 | static mngs_megacell_pagecxx . . $ mngs_megacell_page# megacellpagecxx . . $ megacellpage.; |
| 993 | static mngs_ship_pagecxx . . $ mngs_ship_page# shippagecxx . . $ shippage.; |
| 994 | static mngs_weapon_pagecxx . . $ mngs_weapon_page# weaponpagecxx . . $ weaponpage.; |
| 995 | static mngs_gamefile_pagecxx . . $ mngs_gamefile_page# gamefilepagecxx . . $ gamefilepage.; |
| 996 | // IF YOU ADD ANY NEW PAGETYPE YOU MUST CHANGE THE FUNCTIONS LISTED UNDER THIS LINE |
| 997 | // TO DEAL WITH YOUR PAGE TYPE. IF YOU FORGET, YOU CAN CORRUPT THE PAGEFILE!!!!! |
| 998 | //------------------------------------------------------------------------------ |
| 999 | // Given a pagetype, reads it in but discards it. Useful for parsing. |
| 1000 | void mng_ReadDummyPagecxx . . $ mng_ReadDummyPage(7b459838246254f2).(CFILEcxx . . $ CFILE# *infile, uint8_tcxx . . $ uint8_t# pagetype) { |
| 1001 | switch (pagetype) { |
| 1002 | case PAGETYPE_TEXTUREcxx . . $ `lib/manage.h:49:9`!: |
| 1003 | mng_ReadNewTexturePagecxx . . $ mng_ReadNewTexturePage(3fd8847e45b480a6).(infile, &texpagecxx . . $ texpage.); |
| 1004 | break; |
| 1005 | case PAGETYPE_POWERUPcxx . . $ `lib/manage.h:52:9`!: |
| 1006 | case PAGETYPE_ROBOTcxx . . $ `lib/manage.h:51:9`!: |
| 1007 | Errorcxx . . $ Error(326aeb464d16410c).("Your local table file is invalid. You must update from the network."); |
| 1008 | break; |
| 1009 | case PAGETYPE_DOORcxx . . $ `lib/manage.h:53:9`!: |
| 1010 | mng_ReadNewDoorPagecxx . . $ mng_ReadNewDoorPage(8049f1a86201f7be).(infile, &doorpagecxx . . $ doorpage.); |
| 1011 | break; |
| 1012 | case PAGETYPE_GENERICcxx . . $ `lib/manage.h:58:9`!: |
| 1013 | mng_ReadNewGenericPagecxx . . $ mng_ReadNewGenericPage(c2b96e49a8bfd41d).(infile, &genericpagecxx . . $ genericpage.); |
| 1014 | if (genericpagecxx . . $ genericpage..objinfo_structcxx . . $ mngs_generic_page#objinfo_struct..descriptioncxx . . $ object_info#description. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) { |
| 1015 | mem_freecxx . . $ `mem/mem.h:80:9`!(genericpage.objinfo_struct.description); |
| 1016 | genericpagecxx . . $ genericpage..objinfo_structcxx . . $ mngs_generic_page#objinfo_struct..descriptioncxx . . $ object_info#description. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 1017 | } |
| 1018 | break; |
| 1019 | case PAGETYPE_GAMEFILEcxx . . $ `lib/manage.h:57:9`!: |
| 1020 | mng_ReadNewGamefilePagecxx . . $ mng_ReadNewGamefilePage(6ed3275c23aad507).(infile, &gamefilepagecxx . . $ gamefilepage.); |
| 1021 | break; |
| 1022 | case PAGETYPE_SOUNDcxx . . $ `lib/manage.h:55:9`!: |
| 1023 | mng_ReadNewSoundPagecxx . . $ mng_ReadNewSoundPage(155713602bc6d21).(infile, &soundpagecxx . . $ soundpage.); |
| 1024 | break; |
| 1025 | case PAGETYPE_SHIPcxx . . $ `lib/manage.h:54:9`!: |
| 1026 | mng_ReadNewShipPagecxx . . $ mng_ReadNewShipPage(ec0053c10eec018b).(infile, &shippagecxx . . $ shippage.); |
| 1027 | break; |
| 1028 | case PAGETYPE_WEAPONcxx . . $ `lib/manage.h:50:9`!: |
| 1029 | mng_ReadNewWeaponPagecxx . . $ mng_ReadNewWeaponPage(9414407c63411fdc).(infile, &weaponpagecxx . . $ weaponpage.); |
| 1030 | break; |
| 1031 | case PAGETYPE_MEGACELLcxx . . $ `lib/manage.h:56:9`!: |
| 1032 | mng_ReadNewMegacellPagecxx . . $ mng_ReadNewMegacellPage(5dec59790525c329).(infile, &megacellpagecxx . . $ megacellpage.); |
| 1033 | break; |
| 1034 | case PAGETYPE_UNKNOWNcxx . . $ `lib/manage.h:48:9`!: |
| 1035 | break; |
| 1036 | default: |
| 1037 | Int3cxx . . $ `misc/pserror.h:247:9`!(); // unrecognized pagetype |
| 1038 | break; |
| 1039 | } |
| 1040 | } |
| 1041 | // Reads a page in that we don't care about, and writes it right back out |
| 1042 | // This is useful for replacing a specific page in a file but ignoring others |
| 1043 | void mng_ReadWriteDummyPagecxx . . $ mng_ReadWriteDummyPage(3a9ef30e80ec550).(CFILEcxx . . $ CFILE# *infile, CFILEcxx . . $ CFILE# *outfile, uint8_tcxx . . $ uint8_t# pagetype) { |
| 1044 | switch (pagetype) { |
| 1045 | case PAGETYPE_TEXTUREcxx . . $ `lib/manage.h:49:9`!: |
| 1046 | // Read it in, write it out. |
| 1047 | mng_ReadNewTexturePagecxx . . $ mng_ReadNewTexturePage(3fd8847e45b480a6).(infile, &texpagecxx . . $ texpage.); |
| 1048 | mng_WriteNewTexturePagecxx . . $ mng_WriteNewTexturePage(ba0e418ed632d802).(outfile, &texpagecxx . . $ texpage.); |
| 1049 | break; |
| 1050 | case PAGETYPE_DOORcxx . . $ `lib/manage.h:53:9`!: |
| 1051 | // Read it in, write it out. |
| 1052 | mng_ReadNewDoorPagecxx . . $ mng_ReadNewDoorPage(8049f1a86201f7be).(infile, &doorpagecxx . . $ doorpage.); |
| 1053 | mng_WriteNewDoorPagecxx . . $ mng_WriteNewDoorPage(6856a7589499e64e).(outfile, &doorpagecxx . . $ doorpage.); |
| 1054 | break; |
| 1055 | case PAGETYPE_GENERICcxx . . $ `lib/manage.h:58:9`!: |
| 1056 | // Read it in, write it out. |
| 1057 | mng_ReadNewGenericPagecxx . . $ mng_ReadNewGenericPage(c2b96e49a8bfd41d).(infile, &genericpagecxx . . $ genericpage.); |
| 1058 | mng_WriteNewGenericPagecxx . . $ mng_WriteNewGenericPage(431eacc5074b70a8).(outfile, &genericpagecxx . . $ genericpage.); |
| 1059 | if (genericpagecxx . . $ genericpage..objinfo_structcxx . . $ mngs_generic_page#objinfo_struct..descriptioncxx . . $ object_info#description. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) { |
| 1060 | mem_freecxx . . $ `mem/mem.h:80:9`!(genericpage.objinfo_struct.description); |
| 1061 | genericpagecxx . . $ genericpage..objinfo_structcxx . . $ mngs_generic_page#objinfo_struct..descriptioncxx . . $ object_info#description. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 1062 | } |
| 1063 | break; |
| 1064 | case PAGETYPE_GAMEFILEcxx . . $ `lib/manage.h:57:9`!: |
| 1065 | // Read it in, write it out. |
| 1066 | mng_ReadNewGamefilePagecxx . . $ mng_ReadNewGamefilePage(6ed3275c23aad507).(infile, &gamefilepagecxx . . $ gamefilepage.); |
| 1067 | mng_WriteNewGamefilePagecxx . . $ mng_WriteNewGamefilePage(a65e5c267f491e9e).(outfile, &gamefilepagecxx . . $ gamefilepage.); |
| 1068 | break; |
| 1069 | case PAGETYPE_SOUNDcxx . . $ `lib/manage.h:55:9`!: |
| 1070 | // Read it in, write it out. |
| 1071 | mng_ReadNewSoundPagecxx . . $ mng_ReadNewSoundPage(155713602bc6d21).(infile, &soundpagecxx . . $ soundpage.); |
| 1072 | mng_WriteNewSoundPagecxx . . $ mng_WriteNewSoundPage(43d39fc2bcaa809).(outfile, &soundpagecxx . . $ soundpage.); |
| 1073 | break; |
| 1074 | case PAGETYPE_MEGACELLcxx . . $ `lib/manage.h:56:9`!: |
| 1075 | // Read it in, write it out. |
| 1076 | mng_ReadNewMegacellPagecxx . . $ mng_ReadNewMegacellPage(5dec59790525c329).(infile, &megacellpagecxx . . $ megacellpage.); |
| 1077 | mng_WriteNewMegacellPagecxx . . $ mng_WriteNewMegacellPage(7620e86f5f7cdcdf).(outfile, &megacellpagecxx . . $ megacellpage.); |
| 1078 | break; |
| 1079 | case PAGETYPE_SHIPcxx . . $ `lib/manage.h:54:9`!: |
| 1080 | // Read it in, write it out. |
| 1081 | mng_ReadNewShipPagecxx . . $ mng_ReadNewShipPage(ec0053c10eec018b).(infile, &shippagecxx . . $ shippage.); |
| 1082 | mng_WriteNewShipPagecxx . . $ mng_WriteNewShipPage(d82cdf4b89141491).(outfile, &shippagecxx . . $ shippage.); |
| 1083 | break; |
| 1084 | case PAGETYPE_WEAPONcxx . . $ `lib/manage.h:50:9`!: |
| 1085 | // Read it in, write it out. |
| 1086 | mng_ReadNewWeaponPagecxx . . $ mng_ReadNewWeaponPage(9414407c63411fdc).(infile, &weaponpagecxx . . $ weaponpage.); |
| 1087 | mng_WriteNewWeaponPagecxx . . $ mng_WriteNewWeaponPage(72f3989a7102bdce).(outfile, &weaponpagecxx . . $ weaponpage.); |
| 1088 | break; |
| 1089 | case PAGETYPE_UNKNOWNcxx . . $ `lib/manage.h:48:9`!: |
| 1090 | mng_WriteNewUnknownPagecxx . . $ mng_WriteNewUnknownPage(3639e799710acb68).(outfile); |
| 1091 | break; |
| 1092 | default: |
| 1093 | Int3cxx . . $ `misc/pserror.h:247:9`!(); // unrecognized pagetype |
| 1094 | break; |
| 1095 | } |
| 1096 | } |
| 1097 | // Renames a page on the network |
| 1098 | // This function is called when you rename your object, regardless if you check |
| 1099 | // it in |
| 1100 | int mng_RenamePagecxx . . $ mng_RenamePage(60b24ab836da28f5).(char *oldname, char *newname, int pagetype) { |
| 1101 | int l, i; |
| 1102 | mngs_Pagelockcxx . . $ mngs_Pagelock# pl; |
| 1103 | char oname[PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!]; |
| 1104 | |
| 1105 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Renaming %s to %s...\n", oldname, newname); |
| 1106 | strcpy(oname, oldname); |
| 1107 | strcpy(pl.namecxx . . $ mngs_Pagelock#name., oname); |
| 1108 | pl.pagetypecxx . . $ mngs_Pagelock#pagetype. = pagetype; |
| 1109 | // Make sure we own it |
| 1110 | l = mng_CheckIfPageOwnedcxx . . $ mng_CheckIfPageOwned(36c4fbc4bece4f16).(&pl, TableUsercxx . . $ TableUser.); |
| 1111 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(l == 1); |
| 1112 | strcpy(pl.namecxx . . $ mngs_Pagelock#name., newname); |
| 1113 | strcpy(pl.holdercxx . . $ mngs_Pagelock#holder., TableUsercxx . . $ TableUser.); |
| 1114 | |
| 1115 | // First, change the name of the network pagelock |
| 1116 | l = mng_ReplacePagelockcxx . . $ mng_ReplacePagelock(6129c99dc712daa0).(oname, &pl); |
| 1117 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(l == 1); |
| 1118 | switch (pagetype) { |
| 1119 | // Find the page type with this name and rename it |
| 1120 | case PAGETYPE_TEXTUREcxx . . $ `lib/manage.h:49:9`!: |
| 1121 | i = FindTextureNamecxx . . $ FindTextureName(5c4306d8553b3696).(oname); |
| 1122 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(i != -1); |
| 1123 | strcpy(GameTexturescxx . . $ GameTextures.[i].namecxx . . $ texture#name., newname); |
| 1124 | |
| 1125 | l = mng_ReplacePagecxx . . $ mng_ReplacePage(80ec76f00b6174b2).(oname, GameTexturescxx . . $ GameTextures.[i].namecxx . . $ texture#name., i, PAGETYPE_TEXTUREcxx . . $ `lib/manage.h:49:9`!, 0); |
| 1126 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(l == 1); |
| 1127 | if (mng_FindTrackLockcxx . . $ mng_FindTrackLock(6abd07ddb1a912f0).(oname, PAGETYPE_TEXTUREcxx . . $ `lib/manage.h:49:9`!) != -1) |
| 1128 | mng_ReplacePagecxx . . $ mng_ReplacePage(80ec76f00b6174b2).(oname, GameTexturescxx . . $ GameTextures.[i].namecxx . . $ texture#name., i, PAGETYPE_TEXTUREcxx . . $ `lib/manage.h:49:9`!, 1); |
| 1129 | |
| 1130 | break; |
| 1131 | case PAGETYPE_DOORcxx . . $ `lib/manage.h:53:9`!: |
| 1132 | i = FindDoorNamecxx . . $ FindDoorName(5c4306d8553b3696).(oname); |
| 1133 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(i != -1); |
| 1134 | strcpy(Doorscxx . . $ Doors.[i].namecxx . . $ door#name., newname); |
| 1135 | l = mng_ReplacePagecxx . . $ mng_ReplacePage(80ec76f00b6174b2).(oname, Doorscxx . . $ Doors.[i].namecxx . . $ door#name., i, PAGETYPE_DOORcxx . . $ `lib/manage.h:53:9`!, 0); |
| 1136 | if (mng_FindTrackLockcxx . . $ mng_FindTrackLock(6abd07ddb1a912f0).(oname, PAGETYPE_DOORcxx . . $ `lib/manage.h:53:9`!) != -1) |
| 1137 | mng_ReplacePagecxx . . $ mng_ReplacePage(80ec76f00b6174b2).(oname, Doorscxx . . $ Doors.[i].namecxx . . $ door#name., i, PAGETYPE_DOORcxx . . $ `lib/manage.h:53:9`!, 1); |
| 1138 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(l == 1); |
| 1139 | break; |
| 1140 | case PAGETYPE_GENERICcxx . . $ `lib/manage.h:58:9`!: |
| 1141 | i = FindObjectIDNamecxx . . $ FindObjectIDName(5c4306d8553b3696).(oname); |
| 1142 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(i != -1); |
| 1143 | strcpy(Object_infocxx . . $ Object_info.[i].namecxx . . $ object_info#name., newname); |
| 1144 | |
| 1145 | l = mng_ReplacePagecxx . . $ mng_ReplacePage(80ec76f00b6174b2).(oname, Object_infocxx . . $ Object_info.[i].namecxx . . $ object_info#name., i, PAGETYPE_GENERICcxx . . $ `lib/manage.h:58:9`!, 0); |
| 1146 | |
| 1147 | if (mng_FindTrackLockcxx . . $ mng_FindTrackLock(6abd07ddb1a912f0).(oname, PAGETYPE_GENERICcxx . . $ `lib/manage.h:58:9`!) != -1) |
| 1148 | mng_ReplacePagecxx . . $ mng_ReplacePage(80ec76f00b6174b2).(oname, Object_infocxx . . $ Object_info.[i].namecxx . . $ object_info#name., i, PAGETYPE_GENERICcxx . . $ `lib/manage.h:58:9`!, 1); |
| 1149 | |
| 1150 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(l == 1); |
| 1151 | break; |
| 1152 | case PAGETYPE_GAMEFILEcxx . . $ `lib/manage.h:57:9`!: |
| 1153 | i = FindGamefileNamecxx . . $ FindGamefileName(1ef8e6ec083aabb9).(oname); |
| 1154 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(i != -1); |
| 1155 | strcpy(Gamefilescxx . . $ Gamefiles.[i].namecxx . . $ gamefile#name., newname); |
| 1156 | |
| 1157 | l = mng_ReplacePagecxx . . $ mng_ReplacePage(80ec76f00b6174b2).(oname, Gamefilescxx . . $ Gamefiles.[i].namecxx . . $ gamefile#name., i, PAGETYPE_GAMEFILEcxx . . $ `lib/manage.h:57:9`!, 0); |
| 1158 | if (mng_FindTrackLockcxx . . $ mng_FindTrackLock(6abd07ddb1a912f0).(oname, PAGETYPE_GAMEFILEcxx . . $ `lib/manage.h:57:9`!) != -1) |
| 1159 | mng_ReplacePagecxx . . $ mng_ReplacePage(80ec76f00b6174b2).(oname, Gamefilescxx . . $ Gamefiles.[i].namecxx . . $ gamefile#name., i, PAGETYPE_GAMEFILEcxx . . $ `lib/manage.h:57:9`!, 1); |
| 1160 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(l == 1); |
| 1161 | break; |
| 1162 | case PAGETYPE_SOUNDcxx . . $ `lib/manage.h:55:9`!: |
| 1163 | i = FindSoundNamecxx . . $ FindSoundName(5c4306d8553b3696).(oname); |
| 1164 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(i != -1); |
| 1165 | strcpy(Soundscxx . . $ Sounds.[i].namecxx . . $ sound_info#name., newname); |
| 1166 | l = mng_ReplacePagecxx . . $ mng_ReplacePage(80ec76f00b6174b2).(oname, Soundscxx . . $ Sounds.[i].namecxx . . $ sound_info#name., i, PAGETYPE_SOUNDcxx . . $ `lib/manage.h:55:9`!, 0); |
| 1167 | if (mng_FindTrackLockcxx . . $ mng_FindTrackLock(6abd07ddb1a912f0).(oname, PAGETYPE_SOUNDcxx . . $ `lib/manage.h:55:9`!) != -1) |
| 1168 | mng_ReplacePagecxx . . $ mng_ReplacePage(80ec76f00b6174b2).(oname, Soundscxx . . $ Sounds.[i].namecxx . . $ sound_info#name., i, PAGETYPE_SOUNDcxx . . $ `lib/manage.h:55:9`!, 1); |
| 1169 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(l == 1); |
| 1170 | break; |
| 1171 | case PAGETYPE_MEGACELLcxx . . $ `lib/manage.h:56:9`!: |
| 1172 | i = FindMegacellNamecxx . . $ FindMegacellName(1ef8e6ec083aabb9).(oname); |
| 1173 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(i != -1); |
| 1174 | strcpy(Megacellscxx . . $ Megacells.[i].namecxx . . $ megacell#name., newname); |
| 1175 | l = mng_ReplacePagecxx . . $ mng_ReplacePage(80ec76f00b6174b2).(oname, Megacellscxx . . $ Megacells.[i].namecxx . . $ megacell#name., i, PAGETYPE_MEGACELLcxx . . $ `lib/manage.h:56:9`!, 0); |
| 1176 | |
| 1177 | if (mng_FindTrackLockcxx . . $ mng_FindTrackLock(6abd07ddb1a912f0).(oname, PAGETYPE_MEGACELLcxx . . $ `lib/manage.h:56:9`!) != -1) |
| 1178 | mng_ReplacePagecxx . . $ mng_ReplacePage(80ec76f00b6174b2).(oname, Megacellscxx . . $ Megacells.[i].namecxx . . $ megacell#name., i, PAGETYPE_MEGACELLcxx . . $ `lib/manage.h:56:9`!, 1); |
| 1179 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(l == 1); |
| 1180 | break; |
| 1181 | case PAGETYPE_SHIPcxx . . $ `lib/manage.h:54:9`!: |
| 1182 | i = FindShipNamecxx . . $ FindShipName(5c4306d8553b3696).(oname); |
| 1183 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(i != -1); |
| 1184 | strcpy(Shipscxx . . $ Ships.[i].namecxx . . $ ship#name., newname); |
| 1185 | |
| 1186 | l = mng_ReplacePagecxx . . $ mng_ReplacePage(80ec76f00b6174b2).(oname, Shipscxx . . $ Ships.[i].namecxx . . $ ship#name., i, PAGETYPE_SHIPcxx . . $ `lib/manage.h:54:9`!, 0); |
| 1187 | if (mng_FindTrackLockcxx . . $ mng_FindTrackLock(6abd07ddb1a912f0).(oname, PAGETYPE_SHIPcxx . . $ `lib/manage.h:54:9`!) != -1) |
| 1188 | mng_ReplacePagecxx . . $ mng_ReplacePage(80ec76f00b6174b2).(oname, Shipscxx . . $ Ships.[i].namecxx . . $ ship#name., i, PAGETYPE_SHIPcxx . . $ `lib/manage.h:54:9`!, 1); |
| 1189 | |
| 1190 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(l == 1); |
| 1191 | break; |
| 1192 | case PAGETYPE_WEAPONcxx . . $ `lib/manage.h:50:9`!: |
| 1193 | i = FindWeaponNamecxx . . $ FindWeaponName(5c4306d8553b3696).(oname); |
| 1194 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(i != -1); |
| 1195 | strcpy(Weaponscxx . . $ Weapons.[i].namecxx . . $ weapon#name., newname); |
| 1196 | |
| 1197 | l = mng_ReplacePagecxx . . $ mng_ReplacePage(80ec76f00b6174b2).(oname, Weaponscxx . . $ Weapons.[i].namecxx . . $ weapon#name., i, PAGETYPE_WEAPONcxx . . $ `lib/manage.h:50:9`!, 0); |
| 1198 | if (mng_FindTrackLockcxx . . $ mng_FindTrackLock(6abd07ddb1a912f0).(oname, PAGETYPE_WEAPONcxx . . $ `lib/manage.h:50:9`!) != -1) |
| 1199 | mng_ReplacePagecxx . . $ mng_ReplacePage(80ec76f00b6174b2).(oname, Weaponscxx . . $ Weapons.[i].namecxx . . $ weapon#name., i, PAGETYPE_WEAPONcxx . . $ `lib/manage.h:50:9`!, 1); |
| 1200 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(l == 1); |
| 1201 | break; |
| 1202 | default: |
| 1203 | Int3cxx . . $ `misc/pserror.h:247:9`!(); // Unknown type, get Jason |
| 1204 | break; |
| 1205 | } |
| 1206 | return 1; |
| 1207 | } |
| 1208 | #define PROGRESS_PERCENTAGE_THRESHOLDcxx . . $ `manage/manage.cpp:1208:9`! 20 |
| 1209 | // This is the function that opens the table files and reads in the individual pages |
| 1210 | // If you want your data to be in the game, it must hook into this function |
| 1211 | int mng_LoadNetPagescxx . . $ mng_LoadNetPages(7864480464b09eea).(int show_progress) { |
| 1212 | CFILEcxx . . $ CFILE# *infile; |
| 1213 | uint8_tcxx . . $ uint8_t# pagetype; |
| 1214 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::pathcxx . . $ std/filesystem/__cxx11/path# tablenamecxx . . $ std/filesystem/__cxx11/path#path(ced63f7c635d850d).; |
| 1215 | float start_time; |
| 1216 | int n_pages = 0; |
| 1217 | int total_bytes; |
| 1218 | int current_byte; |
| 1219 | float progress; |
| 1220 | int int_progress = 0; |
| 1221 | int len; |
| 1222 | |
| 1223 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Loading pages..."); |
| 1224 | if (Dedicated_servercxx . . $ Dedicated_server.) |
| 1225 | show_progress = 0; // turn off progress meter for dedicated server |
| 1226 | // If the network is up we still want to read from the local table because it |
| 1227 | // will allow others to start the game at the same time |
| 1228 | if (Network_upcxx . . $ Network_up.) { |
| 1229 | int farg = FindArgcxx . . $ FindArg(5c4306d8553b3696).("-filter"); |
| 1230 | if (farg) |
| 1231 | tablename =cxx . . $ std/filesystem/__cxx11/path#`operator=`(d30197541d75bb9a). GameArgscxx . . $ GameArgs.[farg + 1]; |
| 1232 | else { |
| 1233 | tablename =cxx . . $ std/filesystem/__cxx11/path#`operator=`(9c9aa2f17f237d0f). LocalTableDircxx . . $ LocalTableDir. /cxx . . $ std/filesystem/__cxx11/`operator/`(578e0438ad5f0e7e). NET_TABLEcxx . . $ `lib/manage.h:36:9`!; |
| 1234 | } |
| 1235 | infile = cfopencxx . . $ cfopen(7c7b94e455f1ae56).(tablename, "rb"); |
| 1236 | } else |
| 1237 | infile = cfopencxx . . $ cfopen(7c7b94e455f1ae56).(TableFilenamecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., "rb"); |
| 1238 | if (!infile) { |
| 1239 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Couldn't open table file (%s) to read pages!\n", TableFilename); |
| 1240 | Errorcxx . . $ Error(326aeb464d16410c).("Cannot open table file <%s>", TableFilenamecxx . . $ TableFilename.); |
| 1241 | return 0; |
| 1242 | } |
| 1243 | if (show_progress) { |
| 1244 | cfseekcxx . . $ cfseek(f9992d249f032805).(infile, 0, SEEK_ENDcxx . . $ `<external>/14710646456994434043/fcntl.h:139:10`!); |
| 1245 | total_bytes = cftellcxx . . $ cftell(65b457210a6528a1).(infile); |
| 1246 | cfseekcxx . . $ cfseek(f9992d249f032805).(infile, 0, SEEK_SETcxx . . $ `<external>/14710646456994434043/fcntl.h:137:10`!); |
| 1247 | } |
| 1248 | start_time = timer_GetTimecxx . . $ `ddio/ddio.h:236:9`!(); |
| 1249 | while (!cfeofcxx . . $ cfeof(413716a422df0036).(infile)) { |
| 1250 | // Read in a pagetype. If its a page we recognize, load it |
| 1251 | // mprintf(0,"."); |
| 1252 | if (show_progress) { |
| 1253 | |
| 1254 | current_byte = cftellcxx . . $ cftell(65b457210a6528a1).(infile); |
| 1255 | progress = (float)current_byte / (float)total_bytes; |
| 1256 | progress *= PROGRESS_PERCENTAGE_THRESHOLDcxx . . $ `manage/manage.cpp:1208:9`!; |
| 1257 | int temp_int_progress = progress; |
| 1258 | if (temp_int_progress > int_progress) { |
| 1259 | int_progress = temp_int_progress; |
| 1260 | InitMessagecxx . . $ InitMessage(42eacfea086a5352).(TXT_INITDATAcxx . . $ `Descent3/stringtable.h:154:9`!, progress / PROGRESS_PERCENTAGE_THRESHOLDcxx . . $ `manage/manage.cpp:1208:9`!); |
| 1261 | } |
| 1262 | } |
| 1263 | pagetype = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile); |
| 1264 | if (!Old_table_methodcxx . . $ Old_table_method.) |
| 1265 | len = cf_ReadIntcxx . . $ cf_ReadInt(d60d6f5e30f0c96a).(infile); |
| 1266 | switch (pagetype) { |
| 1267 | case PAGETYPE_TEXTUREcxx . . $ `lib/manage.h:49:9`!: |
| 1268 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "T"); |
| 1269 | |
| 1270 | PrintDedicatedMessagecxx . . $ PrintDedicatedMessage(326aeb464d16410c).("T"); |
| 1271 | mng_LoadNetTexturePagecxx . . $ mng_LoadNetTexturePage(5a5441f2f69caf20).(infile); |
| 1272 | break; |
| 1273 | case PAGETYPE_POWERUPcxx . . $ `lib/manage.h:52:9`!: |
| 1274 | case PAGETYPE_ROBOTcxx . . $ `lib/manage.h:51:9`!: |
| 1275 | Errorcxx . . $ Error(326aeb464d16410c).("Your local table file is invalid. You must update from the network."); |
| 1276 | break; |
| 1277 | case PAGETYPE_DOORcxx . . $ `lib/manage.h:53:9`!: |
| 1278 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "D"); |
| 1279 | PrintDedicatedMessagecxx . . $ PrintDedicatedMessage(326aeb464d16410c).("D"); |
| 1280 | mng_LoadNetDoorPagecxx . . $ mng_LoadNetDoorPage(5a5441f2f69caf20).(infile); |
| 1281 | break; |
| 1282 | case PAGETYPE_GENERICcxx . . $ `lib/manage.h:58:9`!: |
| 1283 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "G"); |
| 1284 | PrintDedicatedMessagecxx . . $ PrintDedicatedMessage(326aeb464d16410c).("G"); |
| 1285 | mng_LoadNetGenericPagecxx . . $ mng_LoadNetGenericPage(5a5441f2f69caf20).(infile); |
| 1286 | break; |
| 1287 | case PAGETYPE_GAMEFILEcxx . . $ `lib/manage.h:57:9`!: |
| 1288 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "F"); |
| 1289 | PrintDedicatedMessagecxx . . $ PrintDedicatedMessage(326aeb464d16410c).("F"); |
| 1290 | mng_LoadNetGamefilePagecxx . . $ mng_LoadNetGamefilePage(5a5441f2f69caf20).(infile); |
| 1291 | break; |
| 1292 | case PAGETYPE_SOUNDcxx . . $ `lib/manage.h:55:9`!: |
| 1293 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "S"); |
| 1294 | PrintDedicatedMessagecxx . . $ PrintDedicatedMessage(326aeb464d16410c).("S"); |
| 1295 | mng_LoadNetSoundPagecxx . . $ mng_LoadNetSoundPage(5a5441f2f69caf20).(infile); |
| 1296 | break; |
| 1297 | case PAGETYPE_SHIPcxx . . $ `lib/manage.h:54:9`!: |
| 1298 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "P"); |
| 1299 | PrintDedicatedMessagecxx . . $ PrintDedicatedMessage(326aeb464d16410c).("P"); |
| 1300 | mng_LoadNetShipPagecxx . . $ mng_LoadNetShipPage(5a5441f2f69caf20).(infile); |
| 1301 | break; |
| 1302 | case PAGETYPE_WEAPONcxx . . $ `lib/manage.h:50:9`!: |
| 1303 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "W"); |
| 1304 | PrintDedicatedMessagecxx . . $ PrintDedicatedMessage(326aeb464d16410c).("W"); |
| 1305 | mng_LoadNetWeaponPagecxx . . $ mng_LoadNetWeaponPage(5a5441f2f69caf20).(infile); |
| 1306 | break; |
| 1307 | case PAGETYPE_MEGACELLcxx . . $ `lib/manage.h:56:9`!: |
| 1308 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "M"); |
| 1309 | PrintDedicatedMessagecxx . . $ PrintDedicatedMessage(326aeb464d16410c).("M"); |
| 1310 | mng_LoadNetMegacellPagecxx . . $ mng_LoadNetMegacellPage(3639e799710acb68).(infile); |
| 1311 | break; |
| 1312 | case PAGETYPE_UNKNOWNcxx . . $ `lib/manage.h:48:9`!: |
| 1313 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "?"); |
| 1314 | break; |
| 1315 | default: |
| 1316 | Int3cxx . . $ `misc/pserror.h:247:9`!(); // Unrecognized pagetype, possible corrupt data following |
| 1317 | return 0; |
| 1318 | break; |
| 1319 | } |
| 1320 | n_pages++; |
| 1321 | } |
| 1322 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "\n%d pages read in %.1f seconds.\n", n_pages, timer_GetTime() - start_time); |
| 1323 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "\n"); |
| 1324 | PrintDedicatedMessagecxx . . $ PrintDedicatedMessage(326aeb464d16410c).((0, "\nPage reading completed.\n")); |
| 1325 | |
| 1326 | cfclosecxx . . $ cfclose(3639e799710acb68).(infile); |
| 1327 | |
| 1328 | // attempt to load extra.gam if found |
| 1329 | char name_override[256]; |
| 1330 | strcpy(name_override, "extra.gam"); |
| 1331 | infile = cfopencxx . . $ cfopen(7c7b94e455f1ae56).(name_overridecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., "rb"); |
| 1332 | if (!infile) |
| 1333 | return 1; |
| 1334 | |
| 1335 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "==================================================\n"); |
| 1336 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, " Loading extra.gam \n"); |
| 1337 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "==================================================\n"); |
| 1338 | PrintDedicatedMessagecxx . . $ PrintDedicatedMessage(326aeb464d16410c).("\nLoading extra.gam.....\n"); |
| 1339 | n_pages = 0; |
| 1340 | |
| 1341 | TablefileNameOverridecxx . . $ TablefileNameOverride. = name_override; |
| 1342 | |
| 1343 | while (!cfeofcxx . . $ cfeof(413716a422df0036).(infile)) { |
| 1344 | pagetype = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile); |
| 1345 | len = cf_ReadIntcxx . . $ cf_ReadInt(d60d6f5e30f0c96a).(infile); |
| 1346 | switch (pagetype) { |
| 1347 | case PAGETYPE_TEXTUREcxx . . $ `lib/manage.h:49:9`!: |
| 1348 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "T"); |
| 1349 | PrintDedicatedMessagecxx . . $ PrintDedicatedMessage(326aeb464d16410c).("T"); |
| 1350 | mng_LoadNetTexturePagecxx . . $ mng_LoadNetTexturePage(5a5441f2f69caf20).(infile, true); |
| 1351 | break; |
| 1352 | case PAGETYPE_DOORcxx . . $ `lib/manage.h:53:9`!: |
| 1353 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "D"); |
| 1354 | PrintDedicatedMessagecxx . . $ PrintDedicatedMessage(326aeb464d16410c).("D"); |
| 1355 | mng_LoadNetDoorPagecxx . . $ mng_LoadNetDoorPage(5a5441f2f69caf20).(infile, true); |
| 1356 | break; |
| 1357 | case PAGETYPE_GENERICcxx . . $ `lib/manage.h:58:9`!: |
| 1358 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "G"); |
| 1359 | PrintDedicatedMessagecxx . . $ PrintDedicatedMessage(326aeb464d16410c).("G"); |
| 1360 | mng_LoadNetGenericPagecxx . . $ mng_LoadNetGenericPage(5a5441f2f69caf20).(infile, true); |
| 1361 | break; |
| 1362 | case PAGETYPE_GAMEFILEcxx . . $ `lib/manage.h:57:9`!: |
| 1363 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "F"); |
| 1364 | PrintDedicatedMessagecxx . . $ PrintDedicatedMessage(326aeb464d16410c).("F"); |
| 1365 | mng_LoadNetGamefilePagecxx . . $ mng_LoadNetGamefilePage(5a5441f2f69caf20).(infile, true); |
| 1366 | break; |
| 1367 | case PAGETYPE_SOUNDcxx . . $ `lib/manage.h:55:9`!: |
| 1368 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "S"); |
| 1369 | PrintDedicatedMessagecxx . . $ PrintDedicatedMessage(326aeb464d16410c).("S"); |
| 1370 | mng_LoadNetSoundPagecxx . . $ mng_LoadNetSoundPage(5a5441f2f69caf20).(infile, true); |
| 1371 | break; |
| 1372 | case PAGETYPE_SHIPcxx . . $ `lib/manage.h:54:9`!: |
| 1373 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "P"); |
| 1374 | PrintDedicatedMessagecxx . . $ PrintDedicatedMessage(326aeb464d16410c).("P"); |
| 1375 | mng_LoadNetShipPagecxx . . $ mng_LoadNetShipPage(5a5441f2f69caf20).(infile, true); |
| 1376 | break; |
| 1377 | case PAGETYPE_WEAPONcxx . . $ `lib/manage.h:50:9`!: |
| 1378 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "W"); |
| 1379 | PrintDedicatedMessagecxx . . $ PrintDedicatedMessage(326aeb464d16410c).("W"); |
| 1380 | mng_LoadNetWeaponPagecxx . . $ mng_LoadNetWeaponPage(5a5441f2f69caf20).(infile, true); |
| 1381 | break; |
| 1382 | case PAGETYPE_UNKNOWNcxx . . $ `lib/manage.h:48:9`!: |
| 1383 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "?"); |
| 1384 | break; |
| 1385 | default: |
| 1386 | Int3cxx . . $ `misc/pserror.h:247:9`!(); // Unrecognized pagetype, possible corrupt data following |
| 1387 | cfclosecxx . . $ cfclose(3639e799710acb68).(infile); |
| 1388 | TablefileNameOverridecxx . . $ TablefileNameOverride. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 1389 | return 0; |
| 1390 | break; |
| 1391 | } |
| 1392 | n_pages++; |
| 1393 | } |
| 1394 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "\n%d extra pages read.\n", n_pages); |
| 1395 | TablefileNameOverridecxx . . $ TablefileNameOverride. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 1396 | cfclosecxx . . $ cfclose(3639e799710acb68).(infile); |
| 1397 | return 1; |
| 1398 | } |
| 1399 | // Loads and allocs all pages found locally |
| 1400 | int mng_LoadLocalPagescxx . . $ mng_LoadLocalPages(b126dc7c1de90089).() { |
| 1401 | CFILEcxx . . $ CFILE# *infile; |
| 1402 | uint8_tcxx . . $ uint8_t# pagetype; |
| 1403 | int len; |
| 1404 | |
| 1405 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Overlaying local pages..."); |
| 1406 | infile = cfopencxx . . $ cfopen(7c7b94e455f1ae56).(LocalTableFilenamecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., "rb"); |
| 1407 | if (!infile) { |
| 1408 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Couldn't open local table file (%s) to read pages!\n", LocalTableFilename); |
| 1409 | return 1; |
| 1410 | } |
| 1411 | Loading_localscxx . . $ Loading_locals. = 1; |
| 1412 | while (!cfeofcxx . . $ cfeof(413716a422df0036).(infile)) { |
| 1413 | // Read in a pagetype. If its a page we recognize, load it |
| 1414 | |
| 1415 | pagetype = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile); |
| 1416 | if (!Old_table_methodcxx . . $ Old_table_method.) |
| 1417 | len = cf_ReadIntcxx . . $ cf_ReadInt(d60d6f5e30f0c96a).(infile); |
| 1418 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "."); |
| 1419 | switch (pagetype) { |
| 1420 | case PAGETYPE_TEXTUREcxx . . $ `lib/manage.h:49:9`!: |
| 1421 | mng_LoadLocalTexturePagecxx . . $ mng_LoadLocalTexturePage(3639e799710acb68).(infile); |
| 1422 | break; |
| 1423 | case PAGETYPE_POWERUPcxx . . $ `lib/manage.h:52:9`!: |
| 1424 | case PAGETYPE_ROBOTcxx . . $ `lib/manage.h:51:9`!: |
| 1425 | Errorcxx . . $ Error(326aeb464d16410c).("Your local table file is invalid. You must update from the network."); |
| 1426 | break; |
| 1427 | case PAGETYPE_DOORcxx . . $ `lib/manage.h:53:9`!: |
| 1428 | mng_LoadLocalDoorPagecxx . . $ mng_LoadLocalDoorPage(3639e799710acb68).(infile); |
| 1429 | break; |
| 1430 | case PAGETYPE_GENERICcxx . . $ `lib/manage.h:58:9`!: |
| 1431 | mng_LoadLocalGenericPagecxx . . $ mng_LoadLocalGenericPage(3639e799710acb68).(infile); |
| 1432 | break; |
| 1433 | case PAGETYPE_GAMEFILEcxx . . $ `lib/manage.h:57:9`!: |
| 1434 | mng_LoadLocalGamefilePagecxx . . $ mng_LoadLocalGamefilePage(3639e799710acb68).(infile); |
| 1435 | break; |
| 1436 | case PAGETYPE_SOUNDcxx . . $ `lib/manage.h:55:9`!: |
| 1437 | mng_LoadLocalSoundPagecxx . . $ mng_LoadLocalSoundPage(3639e799710acb68).(infile); |
| 1438 | break; |
| 1439 | case PAGETYPE_SHIPcxx . . $ `lib/manage.h:54:9`!: |
| 1440 | mng_LoadLocalShipPagecxx . . $ mng_LoadLocalShipPage(3639e799710acb68).(infile); |
| 1441 | break; |
| 1442 | case PAGETYPE_WEAPONcxx . . $ `lib/manage.h:50:9`!: |
| 1443 | mng_LoadLocalWeaponPagecxx . . $ mng_LoadLocalWeaponPage(3639e799710acb68).(infile); |
| 1444 | break; |
| 1445 | case PAGETYPE_MEGACELLcxx . . $ `lib/manage.h:56:9`!: |
| 1446 | mng_LoadLocalMegacellPagecxx . . $ mng_LoadLocalMegacellPage(3639e799710acb68).(infile); |
| 1447 | break; |
| 1448 | case PAGETYPE_UNKNOWNcxx . . $ `lib/manage.h:48:9`!: |
| 1449 | break; |
| 1450 | default: |
| 1451 | Int3cxx . . $ `misc/pserror.h:247:9`!(); // Unrecognized pagetype, possible corrupt data following |
| 1452 | return 0; |
| 1453 | break; |
| 1454 | } |
| 1455 | } |
| 1456 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "\n"); |
| 1457 | cfclosecxx . . $ cfclose(3639e799710acb68).(infile); |
| 1458 | Loading_localscxx . . $ Loading_locals. = 0; |
| 1459 | return 1; |
| 1460 | } |
| 1461 | #define MAX_TRIEScxx . . $ `manage/manage.cpp:1461:9`! 10000 |
| 1462 | // Removes a file, then renames another file to be the removed file. Get it? |
| 1463 | // Returns 1 on success, else 0 on fail |
| 1464 | int SwitcherooFilescxx . . $ SwitcherooFiles(2f051e3560ff300f).(const char *name, char *tempname) { |
| 1465 | /*// If we're changing the net table file, make a backup first! |
| 1466 | if ((!stricmp (name,TableFilename))) |
| 1467 | { |
| 1468 | cf_CopyFile (BackupTableFilename,TableFilename); |
| 1469 | cf_CopyFile (BackupLockFilename,TableLockFilename); |
| 1470 | }*/ |
| 1471 | int num_tries = 0; |
| 1472 | while (!ddio_DeleteFilecxx . . $ ddio_DeleteFile(5c4306d8553b3696).(name) && num_tries < MAX_TRIEScxx . . $ `manage/manage.cpp:1461:9`!) { |
| 1473 | Sleepcxx . . $ Sleep(d4f767463ce0a6b3).(100); |
| 1474 | num_tries++; |
| 1475 | } |
| 1476 | if (num_tries >= MAX_TRIEScxx . . $ `manage/manage.cpp:1461:9`!) { |
| 1477 | strcpy(ErrorStringcxx . . $ ErrorString., "MANAGE:There was a problem deleting the table file."); |
| 1478 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(0); // GET JASON IMMEDIATELY |
| 1479 | Int3cxx . . $ `misc/pserror.h:247:9`!(); |
| 1480 | return (0); |
| 1481 | } |
| 1482 | num_tries = 0; |
| 1483 | while ((rename(tempname, name)) && num_tries <= MAX_TRIEScxx . . $ `manage/manage.cpp:1461:9`!) { |
| 1484 | Sleepcxx . . $ Sleep(d4f767463ce0a6b3).(100); |
| 1485 | num_tries++; |
| 1486 | } |
| 1487 | if (num_tries >= MAX_TRIEScxx . . $ `manage/manage.cpp:1461:9`!) { |
| 1488 | strcpy(ErrorStringcxx . . $ ErrorString., "MANAGE:There was a problem renaming the temp file."); |
| 1489 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(0); // Get JASON IMMEDIATELY |
| 1490 | Int3cxx . . $ `misc/pserror.h:247:9`!(); |
| 1491 | return (0); |
| 1492 | } |
| 1493 | |
| 1494 | return 1; |
| 1495 | } |
| 1496 | |
| 1497 | void mng_TransferPagescxx . . $ mng_TransferPages(49f6e7a06ebc5aa8).() { |
| 1498 | CFILEcxx . . $ CFILE# *infile, *outfile; |
| 1499 | int pagetype; |
| 1500 | int num_tracklocks = 0; |
| 1501 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Transferring pages, please wait...\n"); |
| 1502 | if (!mng_MakeLockercxx . . $ mng_MakeLocker(b126dc7c1de90089).()) |
| 1503 | return; |
| 1504 | infile = cfopencxx . . $ cfopen(7c7b94e455f1ae56).(TableFilenamecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., "rb"); |
| 1505 | |
| 1506 | if (!infile) { |
| 1507 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Couldn't open table file to transfer!\n"); |
| 1508 | Int3cxx . . $ `misc/pserror.h:247:9`!(); |
| 1509 | return; |
| 1510 | } |
| 1511 | mngs_track_lockcxx . . $ mngs_track_lock# *local_tracklocks = (mngs_track_lockcxx . . $ mngs_track_lock# *)mem_malloccxx . . $ `mem/mem.h:79:9`!(sizeof(*local_tracklocks) * 5000); |
| 1512 | // Do textures |
| 1513 | int done = 0; |
| 1514 | while (!done) { |
| 1515 | if (cfeofcxx . . $ cfeof(413716a422df0036).(infile)) { |
| 1516 | done = 1; |
| 1517 | continue; |
| 1518 | } |
| 1519 | pagetype = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile); |
| 1520 | int len = cf_ReadIntcxx . . $ cf_ReadInt(d60d6f5e30f0c96a).(infile); |
| 1521 | switch (pagetype) { |
| 1522 | case PAGETYPE_TEXTUREcxx . . $ `lib/manage.h:49:9`!: |
| 1523 | mng_ReadNewTexturePagecxx . . $ mng_ReadNewTexturePage(3fd8847e45b480a6).(infile, &texpagecxx . . $ texpage.); |
| 1524 | strcpy(local_tracklocks[num_tracklocks].namecxx . . $ mngs_track_lock#name., texpagecxx . . $ texpage..tex_structcxx . . $ mngs_texture_page#tex_struct..namecxx . . $ texture#name.); |
| 1525 | local_tracklocks[num_tracklocks].pagetypecxx . . $ mngs_track_lock#pagetype. = PAGETYPE_TEXTUREcxx . . $ `lib/manage.h:49:9`!; |
| 1526 | num_tracklocks++; |
| 1527 | |
| 1528 | break; |
| 1529 | case PAGETYPE_SOUNDcxx . . $ `lib/manage.h:55:9`!: |
| 1530 | mng_ReadNewSoundPagecxx . . $ mng_ReadNewSoundPage(155713602bc6d21).(infile, &soundpagecxx . . $ soundpage.); |
| 1531 | strcpy(local_tracklocks[num_tracklocks].namecxx . . $ mngs_track_lock#name., soundpagecxx . . $ soundpage..sound_structcxx . . $ mngs_sound_page#sound_struct..namecxx . . $ sound_info#name.); |
| 1532 | local_tracklocks[num_tracklocks].pagetypecxx . . $ mngs_track_lock#pagetype. = PAGETYPE_SOUNDcxx . . $ `lib/manage.h:55:9`!; |
| 1533 | num_tracklocks++; |
| 1534 | break; |
| 1535 | case PAGETYPE_WEAPONcxx . . $ `lib/manage.h:50:9`!: |
| 1536 | mng_ReadNewWeaponPagecxx . . $ mng_ReadNewWeaponPage(9414407c63411fdc).(infile, &weaponpagecxx . . $ weaponpage.); |
| 1537 | strcpy(local_tracklocks[num_tracklocks].namecxx . . $ mngs_track_lock#name., weaponpagecxx . . $ weaponpage..weapon_structcxx . . $ mngs_weapon_page#weapon_struct..namecxx . . $ weapon#name.); |
| 1538 | local_tracklocks[num_tracklocks].pagetypecxx . . $ mngs_track_lock#pagetype. = PAGETYPE_WEAPONcxx . . $ `lib/manage.h:50:9`!; |
| 1539 | num_tracklocks++; |
| 1540 | break; |
| 1541 | case PAGETYPE_GENERICcxx . . $ `lib/manage.h:58:9`!: |
| 1542 | mng_ReadNewGenericPagecxx . . $ mng_ReadNewGenericPage(c2b96e49a8bfd41d).(infile, &genericpagecxx . . $ genericpage.); |
| 1543 | strcpy(local_tracklocks[num_tracklocks].namecxx . . $ mngs_track_lock#name., genericpagecxx . . $ genericpage..objinfo_structcxx . . $ mngs_generic_page#objinfo_struct..namecxx . . $ object_info#name.); |
| 1544 | local_tracklocks[num_tracklocks].pagetypecxx . . $ mngs_track_lock#pagetype. = PAGETYPE_GENERICcxx . . $ `lib/manage.h:58:9`!; |
| 1545 | num_tracklocks++; |
| 1546 | break; |
| 1547 | case PAGETYPE_DOORcxx . . $ `lib/manage.h:53:9`!: |
| 1548 | mng_ReadNewDoorPagecxx . . $ mng_ReadNewDoorPage(8049f1a86201f7be).(infile, &doorpagecxx . . $ doorpage.); |
| 1549 | strcpy(local_tracklocks[num_tracklocks].namecxx . . $ mngs_track_lock#name., doorpagecxx . . $ doorpage..door_structcxx . . $ mngs_door_page#door_struct..namecxx . . $ door#name.); |
| 1550 | local_tracklocks[num_tracklocks].pagetypecxx . . $ mngs_track_lock#pagetype. = PAGETYPE_DOORcxx . . $ `lib/manage.h:53:9`!; |
| 1551 | num_tracklocks++; |
| 1552 | break; |
| 1553 | case PAGETYPE_SHIPcxx . . $ `lib/manage.h:54:9`!: |
| 1554 | mng_ReadNewShipPagecxx . . $ mng_ReadNewShipPage(ec0053c10eec018b).(infile, &shippagecxx . . $ shippage.); |
| 1555 | strcpy(local_tracklocks[num_tracklocks].namecxx . . $ mngs_track_lock#name., shippagecxx . . $ shippage..ship_structcxx . . $ mngs_ship_page#ship_struct..namecxx . . $ ship#name.); |
| 1556 | local_tracklocks[num_tracklocks].pagetypecxx . . $ mngs_track_lock#pagetype. = PAGETYPE_SHIPcxx . . $ `lib/manage.h:54:9`!; |
| 1557 | num_tracklocks++; |
| 1558 | break; |
| 1559 | case PAGETYPE_GAMEFILEcxx . . $ `lib/manage.h:57:9`!: |
| 1560 | mng_ReadNewGamefilePagecxx . . $ mng_ReadNewGamefilePage(6ed3275c23aad507).(infile, &gamefilepagecxx . . $ gamefilepage.); |
| 1561 | strcpy(local_tracklocks[num_tracklocks].namecxx . . $ mngs_track_lock#name., gamefilepagecxx . . $ gamefilepage..gamefile_structcxx . . $ mngs_gamefile_page#gamefile_struct..namecxx . . $ gamefile#name.); |
| 1562 | local_tracklocks[num_tracklocks].pagetypecxx . . $ mngs_track_lock#pagetype. = PAGETYPE_GAMEFILEcxx . . $ `lib/manage.h:57:9`!; |
| 1563 | num_tracklocks++; |
| 1564 | break; |
| 1565 | case PAGETYPE_MEGACELLcxx . . $ `lib/manage.h:56:9`!: |
| 1566 | Int3cxx . . $ `misc/pserror.h:247:9`!(); // huh? |
| 1567 | break; |
| 1568 | default: |
| 1569 | break; |
| 1570 | } |
| 1571 | } |
| 1572 | cfclosecxx . . $ cfclose(3639e799710acb68).(infile); |
| 1573 | // Now go through and filter out all unused lock files |
| 1574 | infile = (CFILEcxx . . $ CFILE# *)cfopencxx . . $ cfopen(7c7b94e455f1ae56).(TableLockFilenamecxx . . $ TableLockFilename., "rb"); |
| 1575 | if (!infile) { |
| 1576 | strcpy(ErrorStringcxx . . $ ErrorString., "Couldn't open Table lock file!"); |
| 1577 | goto done; |
| 1578 | } |
| 1579 | outfile = (CFILEcxx . . $ CFILE# *)cfopencxx . . $ cfopen(7c7b94e455f1ae56).(TempTableLockFilenamecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., "wb"); |
| 1580 | if (!outfile) { |
| 1581 | cfclosecxx . . $ cfclose(3639e799710acb68).(infile); |
| 1582 | strcpy(ErrorStringcxx . . $ ErrorString., "Couldn't open temporary table lock file!"); |
| 1583 | goto done; |
| 1584 | } |
| 1585 | done = 0; |
| 1586 | mngs_Pagelockcxx . . $ mngs_Pagelock# temp_pl; |
| 1587 | while (!done) { |
| 1588 | if (cfeofcxx . . $ cfeof(413716a422df0036).(infile)) { |
| 1589 | done = 1; |
| 1590 | continue; |
| 1591 | } |
| 1592 | if (mng_ReadPagelockcxx . . $ mng_ReadPagelock(3ecdf56edd8e796c).(infile, &temp_pl)) { |
| 1593 | int found = -1; |
| 1594 | for (int i = 0; i < num_tracklocks && found == -1; i++) { |
| 1595 | if (local_tracklocks[i].pagetypecxx . . $ mngs_track_lock#pagetype. == temp_pl.pagetypecxx . . $ mngs_Pagelock#pagetype. && !stricmpcxx . . $ `linux/linux_fix.h:43:9`!(local_tracklocks[i].name, temp_pl.name)) { |
| 1596 | found = i; |
| 1597 | } |
| 1598 | } |
| 1599 | if (found != -1) |
| 1600 | mng_WritePagelockcxx . . $ mng_WritePagelock(ff2922c737f3239c).(outfile, &temp_pl); |
| 1601 | else { |
| 1602 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Found unused lock file %s\n", temp_pl.name); |
| 1603 | } |
| 1604 | |
| 1605 | } else |
| 1606 | done = 1; |
| 1607 | } |
| 1608 | cfclosecxx . . $ cfclose(3639e799710acb68).(infile); |
| 1609 | cfclosecxx . . $ cfclose(3639e799710acb68).(outfile); |
| 1610 | |
| 1611 | if (removecxx . . $ std/filesystem/remove(c53a6ef3278968b1).(TableLockFilenamecxx . . $ TableLockFilename.)) { |
| 1612 | snprintf(ErrorStringcxx . . $ ErrorString., sizeof(ErrorStringcxx . . $ ErrorString.), "There was a problem deleting the temp file - errno %d", errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!); |
| 1613 | goto done; |
| 1614 | } |
| 1615 | if (rename(TempTableLockFilenamecxx . . $ TempTableLockFilename., TableLockFilenamecxx . . $ TableLockFilename..u8stringcxx . . $ std/filesystem/__cxx11/path#u8string(219584694fe2b248).().c_strcxx . . $ std/__cxx11/basic_string#c_str(8e614c7de0b1573e).())) { |
| 1616 | snprintf(ErrorStringcxx . . $ ErrorString., sizeof(ErrorStringcxx . . $ ErrorString.), "There was a problem renaming the temp file - errno %d", errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`!); |
| 1617 | |
| 1618 | goto done; |
| 1619 | } |
| 1620 | mng_EraseLockercxx . . $ mng_EraseLocker(49f6e7a06ebc5aa8).(); |
| 1621 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Done transferring pages...good luck!\n"); |
| 1622 | done:; |
| 1623 | mem_freecxx . . $ `mem/mem.h:80:9`!(local_tracklocks); |
| 1624 | } |
| 1625 | // #define DELETING_PAGELOCKS 1 |
| 1626 | // #define CLEANING_PAGELOCKS 1 |
| 1627 | // Given a list of names and a pagetype, unlocks the ones already inside the lock file |
| 1628 | int mng_UnlockPagelockSeriescxx . . $ mng_UnlockPagelockSeries(5362d03810990486).(const char *names[], int *pagetypes, int num); |
| 1629 | // Goes through the pagelock table and deletes all duplicate entries |
| 1630 | int mng_DeleteDuplicatePagelockscxx . . $ mng_DeleteDuplicatePagelocks(b126dc7c1de90089).(); |
| 1631 | void ReorderPagelockscxx . . $ ReorderPagelocks(49f6e7a06ebc5aa8).() { |
| 1632 | const char *names[] = {"Lava"}; |
| 1633 | int types[] = {PAGETYPE_SOUNDcxx . . $ `lib/manage.h:55:9`!}; |
| 1634 | if (!mng_MakeLockercxx . . $ mng_MakeLocker(b126dc7c1de90089).()) |
| 1635 | return; |
| 1636 | mng_UnlockPagelockSeriescxx . . $ mng_UnlockPagelockSeries(5362d03810990486).(names, types, 1); |
| 1637 | |
| 1638 | // mng_DeleteDuplicatePagelocks (); |
| 1639 | |
| 1640 | mng_EraseLockercxx . . $ mng_EraseLocker(49f6e7a06ebc5aa8).(); |
| 1641 | } |
| 1642 | // THIS IS A SPECIAL FUNCTION THAT YOU SHOULD ONLY USE IF YOU KNOW WHAT YOU ARE |
| 1643 | // DOING...it simply reorders the table file so that the "primitives" are first. |
| 1644 | // This helps in the load time of a table file. |
| 1645 | void ReorderPagescxx . . $ ReorderPages(d4f767463ce0a6b3).(int local) { |
| 1646 | CFILEcxx . . $ CFILE# *infile, *outfile; |
| 1647 | uint8_tcxx . . $ uint8_t# pagetype; |
| 1648 | int done = 0; |
| 1649 | int len; |
| 1650 | #ifdef CLEANING_PAGELOCKS |
| 1651 | mng_TransferPages(); |
| 1652 | return; |
| 1653 | #endif |
| 1654 | #ifdef DELETING_PAGELOCKS |
| 1655 | ReorderPagelocks(); |
| 1656 | return; |
| 1657 | #endif |
| 1658 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Reordering pages, please wait...\n"); |
| 1659 | if (local) |
| 1660 | infile = cfopencxx . . $ cfopen(7c7b94e455f1ae56).(LocalTableFilenamecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., "rb"); |
| 1661 | else { |
| 1662 | if (!mng_MakeLockercxx . . $ mng_MakeLocker(b126dc7c1de90089).()) |
| 1663 | return; |
| 1664 | infile = cfopencxx . . $ cfopen(7c7b94e455f1ae56).(TableFilenamecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., "rb"); |
| 1665 | } |
| 1666 | if (!infile) { |
| 1667 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Couldn't open table file to reorder!\n"); |
| 1668 | Int3cxx . . $ `misc/pserror.h:247:9`!(); |
| 1669 | return; |
| 1670 | } |
| 1671 | if (local) |
| 1672 | outfile = cfopencxx . . $ cfopen(7c7b94e455f1ae56).(LocalTempTableFilenamecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., "wb"); |
| 1673 | else |
| 1674 | outfile = cfopencxx . . $ cfopen(7c7b94e455f1ae56).(TempTableFilenamecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., "wb"); |
| 1675 | if (!outfile) { |
| 1676 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Couldn't open temp table file to reorder!\n"); |
| 1677 | cfclosecxx . . $ cfclose(3639e799710acb68).(infile); |
| 1678 | Int3cxx . . $ `misc/pserror.h:247:9`!(); |
| 1679 | return; |
| 1680 | } |
| 1681 | // Do textures |
| 1682 | while (!done) { |
| 1683 | if (cfeofcxx . . $ cfeof(413716a422df0036).(infile)) { |
| 1684 | done = 1; |
| 1685 | continue; |
| 1686 | } |
| 1687 | pagetype = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile); |
| 1688 | len = cf_ReadIntcxx . . $ cf_ReadInt(d60d6f5e30f0c96a).(infile); |
| 1689 | // If not a door page, just read it in and ignore it |
| 1690 | if (pagetype != PAGETYPE_TEXTUREcxx . . $ `lib/manage.h:49:9`!) { |
| 1691 | cfseekcxx . . $ cfseek(f9992d249f032805).(infile, len - 4, SEEK_CURcxx . . $ `<external>/14710646456994434043/fcntl.h:138:10`!); |
| 1692 | continue; |
| 1693 | } |
| 1694 | mng_ReadNewTexturePagecxx . . $ mng_ReadNewTexturePage(3fd8847e45b480a6).(infile, &texpagecxx . . $ texpage.); |
| 1695 | mng_WriteNewTexturePagecxx . . $ mng_WriteNewTexturePage(ba0e418ed632d802).(outfile, &texpagecxx . . $ texpage.); |
| 1696 | } |
| 1697 | // Do sounds |
| 1698 | done = 0; |
| 1699 | cfseekcxx . . $ cfseek(f9992d249f032805).(infile, 0, SEEK_SETcxx . . $ `<external>/14710646456994434043/fcntl.h:137:10`!); |
| 1700 | while (!done) { |
| 1701 | if (cfeofcxx . . $ cfeof(413716a422df0036).(infile)) { |
| 1702 | done = 1; |
| 1703 | continue; |
| 1704 | } |
| 1705 | pagetype = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile); |
| 1706 | len = cf_ReadIntcxx . . $ cf_ReadInt(d60d6f5e30f0c96a).(infile); |
| 1707 | // If not a door page, just read it in and ignore it |
| 1708 | if (pagetype != PAGETYPE_SOUNDcxx . . $ `lib/manage.h:55:9`!) { |
| 1709 | cfseekcxx . . $ cfseek(f9992d249f032805).(infile, len - 4, SEEK_CURcxx . . $ `<external>/14710646456994434043/fcntl.h:138:10`!); |
| 1710 | continue; |
| 1711 | } |
| 1712 | mng_ReadNewSoundPagecxx . . $ mng_ReadNewSoundPage(155713602bc6d21).(infile, &soundpagecxx . . $ soundpage.); |
| 1713 | mng_WriteNewSoundPagecxx . . $ mng_WriteNewSoundPage(43d39fc2bcaa809).(outfile, &soundpagecxx . . $ soundpage.); |
| 1714 | } |
| 1715 | // Do weapons |
| 1716 | done = 0; |
| 1717 | cfseekcxx . . $ cfseek(f9992d249f032805).(infile, 0, SEEK_SETcxx . . $ `<external>/14710646456994434043/fcntl.h:137:10`!); |
| 1718 | while (!done) { |
| 1719 | if (cfeofcxx . . $ cfeof(413716a422df0036).(infile)) { |
| 1720 | done = 1; |
| 1721 | continue; |
| 1722 | } |
| 1723 | pagetype = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile); |
| 1724 | len = cf_ReadIntcxx . . $ cf_ReadInt(d60d6f5e30f0c96a).(infile); |
| 1725 | // If not a door page, just read it in and ignore it |
| 1726 | if (pagetype != PAGETYPE_WEAPONcxx . . $ `lib/manage.h:50:9`!) { |
| 1727 | cfseekcxx . . $ cfseek(f9992d249f032805).(infile, len - 4, SEEK_CURcxx . . $ `<external>/14710646456994434043/fcntl.h:138:10`!); |
| 1728 | continue; |
| 1729 | } |
| 1730 | mng_ReadNewWeaponPagecxx . . $ mng_ReadNewWeaponPage(9414407c63411fdc).(infile, &weaponpagecxx . . $ weaponpage.); |
| 1731 | // Ignore counter measure weapons |
| 1732 | if (!(weaponpagecxx . . $ weaponpage..weapon_structcxx . . $ mngs_weapon_page#weapon_struct..flagscxx . . $ weapon#flags. & WF_SPAWNS_ROBOTcxx . . $ `Descent3/weapon.h:242:9`!)) |
| 1733 | mng_WriteNewWeaponPagecxx . . $ mng_WriteNewWeaponPage(72f3989a7102bdce).(outfile, &weaponpagecxx . . $ weaponpage.); |
| 1734 | } |
| 1735 | // Do powerup generics |
| 1736 | done = 0; |
| 1737 | cfseekcxx . . $ cfseek(f9992d249f032805).(infile, 0, SEEK_SETcxx . . $ `<external>/14710646456994434043/fcntl.h:137:10`!); |
| 1738 | while (!done) { |
| 1739 | if (cfeofcxx . . $ cfeof(413716a422df0036).(infile)) { |
| 1740 | done = 1; |
| 1741 | continue; |
| 1742 | } |
| 1743 | pagetype = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile); |
| 1744 | len = cf_ReadIntcxx . . $ cf_ReadInt(d60d6f5e30f0c96a).(infile); |
| 1745 | // If not a door page, just read it in and ignore it |
| 1746 | if (pagetype != PAGETYPE_GENERICcxx . . $ `lib/manage.h:58:9`!) { |
| 1747 | cfseekcxx . . $ cfseek(f9992d249f032805).(infile, len - 4, SEEK_CURcxx . . $ `<external>/14710646456994434043/fcntl.h:138:10`!); |
| 1748 | continue; |
| 1749 | } |
| 1750 | mng_ReadNewGenericPagecxx . . $ mng_ReadNewGenericPage(c2b96e49a8bfd41d).(infile, &genericpagecxx . . $ genericpage.); |
| 1751 | if (genericpagecxx . . $ genericpage..objinfo_structcxx . . $ mngs_generic_page#objinfo_struct..typecxx . . $ object_info#type. == OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`!) |
| 1752 | mng_WriteNewGenericPagecxx . . $ mng_WriteNewGenericPage(431eacc5074b70a8).(outfile, &genericpagecxx . . $ genericpage.); |
| 1753 | if (genericpagecxx . . $ genericpage..objinfo_structcxx . . $ mngs_generic_page#objinfo_struct..descriptioncxx . . $ object_info#description. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) { |
| 1754 | mem_freecxx . . $ `mem/mem.h:80:9`!(genericpage.objinfo_struct.description); |
| 1755 | genericpagecxx . . $ genericpage..objinfo_structcxx . . $ mngs_generic_page#objinfo_struct..descriptioncxx . . $ object_info#description. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 1756 | } |
| 1757 | } |
| 1758 | // Do standard generics |
| 1759 | done = 0; |
| 1760 | cfseekcxx . . $ cfseek(f9992d249f032805).(infile, 0, SEEK_SETcxx . . $ `<external>/14710646456994434043/fcntl.h:137:10`!); |
| 1761 | while (!done) { |
| 1762 | if (cfeofcxx . . $ cfeof(413716a422df0036).(infile)) { |
| 1763 | done = 1; |
| 1764 | continue; |
| 1765 | } |
| 1766 | pagetype = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile); |
| 1767 | len = cf_ReadIntcxx . . $ cf_ReadInt(d60d6f5e30f0c96a).(infile); |
| 1768 | // If not a door page, just read it in and ignore it |
| 1769 | if (pagetype != PAGETYPE_GENERICcxx . . $ `lib/manage.h:58:9`!) { |
| 1770 | cfseekcxx . . $ cfseek(f9992d249f032805).(infile, len - 4, SEEK_CURcxx . . $ `<external>/14710646456994434043/fcntl.h:138:10`!); |
| 1771 | continue; |
| 1772 | } |
| 1773 | mng_ReadNewGenericPagecxx . . $ mng_ReadNewGenericPage(c2b96e49a8bfd41d).(infile, &genericpagecxx . . $ genericpage.); |
| 1774 | if (genericpagecxx . . $ genericpage..objinfo_structcxx . . $ mngs_generic_page#objinfo_struct..typecxx . . $ object_info#type. != OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`!) |
| 1775 | mng_WriteNewGenericPagecxx . . $ mng_WriteNewGenericPage(431eacc5074b70a8).(outfile, &genericpagecxx . . $ genericpage.); |
| 1776 | if (genericpagecxx . . $ genericpage..objinfo_structcxx . . $ mngs_generic_page#objinfo_struct..descriptioncxx . . $ object_info#description. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) { |
| 1777 | mem_freecxx . . $ `mem/mem.h:80:9`!(genericpage.objinfo_struct.description); |
| 1778 | genericpagecxx . . $ genericpage..objinfo_structcxx . . $ mngs_generic_page#objinfo_struct..descriptioncxx . . $ object_info#description. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 1779 | } |
| 1780 | } |
| 1781 | // Do countermeasure weapons |
| 1782 | done = 0; |
| 1783 | cfseekcxx . . $ cfseek(f9992d249f032805).(infile, 0, SEEK_SETcxx . . $ `<external>/14710646456994434043/fcntl.h:137:10`!); |
| 1784 | while (!done) { |
| 1785 | if (cfeofcxx . . $ cfeof(413716a422df0036).(infile)) { |
| 1786 | done = 1; |
| 1787 | continue; |
| 1788 | } |
| 1789 | pagetype = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile); |
| 1790 | len = cf_ReadIntcxx . . $ cf_ReadInt(d60d6f5e30f0c96a).(infile); |
| 1791 | // If not a door page, just read it in and ignore it |
| 1792 | if (pagetype != PAGETYPE_WEAPONcxx . . $ `lib/manage.h:50:9`!) { |
| 1793 | cfseekcxx . . $ cfseek(f9992d249f032805).(infile, len - 4, SEEK_CURcxx . . $ `<external>/14710646456994434043/fcntl.h:138:10`!); |
| 1794 | continue; |
| 1795 | } |
| 1796 | mng_ReadNewWeaponPagecxx . . $ mng_ReadNewWeaponPage(9414407c63411fdc).(infile, &weaponpagecxx . . $ weaponpage.); |
| 1797 | if ((weaponpagecxx . . $ weaponpage..weapon_structcxx . . $ mngs_weapon_page#weapon_struct..flagscxx . . $ weapon#flags. & WF_SPAWNS_ROBOTcxx . . $ `Descent3/weapon.h:242:9`!)) |
| 1798 | mng_WriteNewWeaponPagecxx . . $ mng_WriteNewWeaponPage(72f3989a7102bdce).(outfile, &weaponpagecxx . . $ weaponpage.); |
| 1799 | } |
| 1800 | |
| 1801 | // Do doors |
| 1802 | done = 0; |
| 1803 | cfseekcxx . . $ cfseek(f9992d249f032805).(infile, 0, SEEK_SETcxx . . $ `<external>/14710646456994434043/fcntl.h:137:10`!); |
| 1804 | while (!done) { |
| 1805 | if (cfeofcxx . . $ cfeof(413716a422df0036).(infile)) { |
| 1806 | done = 1; |
| 1807 | continue; |
| 1808 | } |
| 1809 | pagetype = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile); |
| 1810 | len = cf_ReadIntcxx . . $ cf_ReadInt(d60d6f5e30f0c96a).(infile); |
| 1811 | // If not a door page, just read it in and ignore it |
| 1812 | if (pagetype != PAGETYPE_DOORcxx . . $ `lib/manage.h:53:9`!) { |
| 1813 | cfseekcxx . . $ cfseek(f9992d249f032805).(infile, len - 4, SEEK_CURcxx . . $ `<external>/14710646456994434043/fcntl.h:138:10`!); |
| 1814 | continue; |
| 1815 | } |
| 1816 | mng_ReadNewDoorPagecxx . . $ mng_ReadNewDoorPage(8049f1a86201f7be).(infile, &doorpagecxx . . $ doorpage.); |
| 1817 | mng_WriteNewDoorPagecxx . . $ mng_WriteNewDoorPage(6856a7589499e64e).(outfile, &doorpagecxx . . $ doorpage.); |
| 1818 | } |
| 1819 | // Do player ships |
| 1820 | done = 0; |
| 1821 | cfseekcxx . . $ cfseek(f9992d249f032805).(infile, 0, SEEK_SETcxx . . $ `<external>/14710646456994434043/fcntl.h:137:10`!); |
| 1822 | while (!done) { |
| 1823 | if (cfeofcxx . . $ cfeof(413716a422df0036).(infile)) { |
| 1824 | done = 1; |
| 1825 | continue; |
| 1826 | } |
| 1827 | pagetype = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile); |
| 1828 | len = cf_ReadIntcxx . . $ cf_ReadInt(d60d6f5e30f0c96a).(infile); |
| 1829 | // If not a door page, just read it in and ignore it |
| 1830 | if (pagetype != PAGETYPE_SHIPcxx . . $ `lib/manage.h:54:9`!) { |
| 1831 | cfseekcxx . . $ cfseek(f9992d249f032805).(infile, len - 4, SEEK_CURcxx . . $ `<external>/14710646456994434043/fcntl.h:138:10`!); |
| 1832 | continue; |
| 1833 | } |
| 1834 | mng_ReadNewShipPagecxx . . $ mng_ReadNewShipPage(ec0053c10eec018b).(infile, &shippagecxx . . $ shippage.); |
| 1835 | mng_WriteNewShipPagecxx . . $ mng_WriteNewShipPage(d82cdf4b89141491).(outfile, &shippagecxx . . $ shippage.); |
| 1836 | } |
| 1837 | // Do gamefiles |
| 1838 | done = 0; |
| 1839 | cfseekcxx . . $ cfseek(f9992d249f032805).(infile, 0, SEEK_SETcxx . . $ `<external>/14710646456994434043/fcntl.h:137:10`!); |
| 1840 | while (!done) { |
| 1841 | if (cfeofcxx . . $ cfeof(413716a422df0036).(infile)) { |
| 1842 | done = 1; |
| 1843 | continue; |
| 1844 | } |
| 1845 | pagetype = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile); |
| 1846 | len = cf_ReadIntcxx . . $ cf_ReadInt(d60d6f5e30f0c96a).(infile); |
| 1847 | // If not a door page, just read it in and ignore it |
| 1848 | if (pagetype != PAGETYPE_GAMEFILEcxx . . $ `lib/manage.h:57:9`!) { |
| 1849 | cfseekcxx . . $ cfseek(f9992d249f032805).(infile, len - 4, SEEK_CURcxx . . $ `<external>/14710646456994434043/fcntl.h:138:10`!); |
| 1850 | continue; |
| 1851 | } |
| 1852 | mng_ReadNewGamefilePagecxx . . $ mng_ReadNewGamefilePage(6ed3275c23aad507).(infile, &gamefilepagecxx . . $ gamefilepage.); |
| 1853 | mng_WriteNewGamefilePagecxx . . $ mng_WriteNewGamefilePage(a65e5c267f491e9e).(outfile, &gamefilepagecxx . . $ gamefilepage.); |
| 1854 | } |
| 1855 | // Do megacells |
| 1856 | done = 0; |
| 1857 | cfseekcxx . . $ cfseek(f9992d249f032805).(infile, 0, SEEK_SETcxx . . $ `<external>/14710646456994434043/fcntl.h:137:10`!); |
| 1858 | while (!done) { |
| 1859 | if (cfeofcxx . . $ cfeof(413716a422df0036).(infile)) { |
| 1860 | done = 1; |
| 1861 | continue; |
| 1862 | } |
| 1863 | pagetype = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile); |
| 1864 | len = cf_ReadIntcxx . . $ cf_ReadInt(d60d6f5e30f0c96a).(infile); |
| 1865 | // If not a door page, just read it in and ignore it |
| 1866 | if (pagetype != PAGETYPE_MEGACELLcxx . . $ `lib/manage.h:56:9`!) { |
| 1867 | cfseekcxx . . $ cfseek(f9992d249f032805).(infile, len - 4, SEEK_CURcxx . . $ `<external>/14710646456994434043/fcntl.h:138:10`!); |
| 1868 | continue; |
| 1869 | } |
| 1870 | mng_ReadNewMegacellPagecxx . . $ mng_ReadNewMegacellPage(5dec59790525c329).(infile, &megacellpagecxx . . $ megacellpage.); |
| 1871 | mng_WriteNewMegacellPagecxx . . $ mng_WriteNewMegacellPage(7620e86f5f7cdcdf).(outfile, &megacellpagecxx . . $ megacellpage.); |
| 1872 | } |
| 1873 | |
| 1874 | cfclosecxx . . $ cfclose(3639e799710acb68).(infile); |
| 1875 | cfclosecxx . . $ cfclose(3639e799710acb68).(outfile); |
| 1876 | if (local) { |
| 1877 | SwitcherooFilescxx . . $ SwitcherooFiles(2f051e3560ff300f).(LocalTableFilenamecxx . . $ LocalTableFilename., LocalTempTableFilenamecxx . . $ LocalTempTableFilename.); |
| 1878 | } else { |
| 1879 | SwitcherooFilescxx . . $ SwitcherooFiles(2f051e3560ff300f).(TableFilenamecxx . . $ TableFilename., TempTableFilenamecxx . . $ TempTableFilename.); |
| 1880 | } |
| 1881 | mng_EraseLockercxx . . $ mng_EraseLocker(49f6e7a06ebc5aa8).(); |
| 1882 | } |
| 1883 | // Returns true if the passed in pagelock is in the LockList, else false |
| 1884 | bool InLockListcxx . . $ InLockList(73051fa1db1ebefd).(mngs_Pagelockcxx . . $ mngs_Pagelock# *pl) { |
| 1885 | if (Starting_editorcxx . . $ Starting_editor.) { |
| 1886 | for (int i = 0; i < Num_locklistcxx . . $ Num_locklist.; i++) { |
| 1887 | if (LockListcxx . . $ LockList.[i].pagetypecxx . . $ mngs_Pagelock#pagetype. == pl->pagetypecxx . . $ mngs_Pagelock#pagetype.) { |
| 1888 | if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(LockList[i].name, pl->name)) |
| 1889 | return true; |
| 1890 | } |
| 1891 | } |
| 1892 | } else { |
| 1893 | if ((mng_CheckIfPageOwnedcxx . . $ mng_CheckIfPageOwned(36c4fbc4bece4f16).(pl, TableUsercxx . . $ TableUser.)) > 0) // DAJ -1FIX |
| 1894 | return true; |
| 1895 | } |
| 1896 | return false; |
| 1897 | } |
| 1898 | // Given a filename, returns the type of primitive it is |
| 1899 | int GetPrimTypecxx . . $ GetPrimType(293b0826c8d9cb54).(const stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::pathcxx . . $ std/filesystem/__cxx11/path# &name) { |
| 1900 | int primtype; |
| 1901 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::pathcxx . . $ std/filesystem/__cxx11/path# ext = name.extensioncxx . . $ std/filesystem/__cxx11/path#extension(159787a050b29eb0).(); |
| 1902 | if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(".oof", ext.u8string().c_str())) |
| 1903 | primtype = PRIMTYPE_OOFcxx . . $ `manage/manage.cpp:507:9`!; |
| 1904 | else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(".ogf", ext.u8string().c_str())) |
| 1905 | primtype = PRIMTYPE_OGFcxx . . $ `manage/manage.cpp:508:9`!; |
| 1906 | else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(".oaf", ext.u8string().c_str())) |
| 1907 | primtype = PRIMTYPE_OAFcxx . . $ `manage/manage.cpp:510:9`!; |
| 1908 | else if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(".wav", ext.u8string().c_str())) |
| 1909 | primtype = PRIMTYPE_WAVcxx . . $ `manage/manage.cpp:509:9`!; |
| 1910 | else |
| 1911 | primtype = PRIMTYPE_FILEcxx . . $ `manage/manage.cpp:511:9`!; |
| 1912 | return primtype; |
| 1913 | } |
| 1914 | |
| 1915 | #if defined(WIN32) |
| 1916 | // Builds a list of old files in a path |
| 1917 | void BuildOldFilesForDirectory(const std::filesystem::path& path, FILETIME threshold) { |
| 1918 | HANDLE filehandle; |
| 1919 | WIN32_FIND_DATA filedata; |
| 1920 | std::filesystem::path newpath = path / "*.*"; |
| 1921 | filehandle = FindFirstFile(newpath.u8string().c_str(), &filedata); |
| 1922 | bool go_ahead = true; |
| 1923 | if (filehandle == INVALID_HANDLE_VALUE) |
| 1924 | go_ahead = false; |
| 1925 | while (go_ahead) { |
| 1926 | bool add_it = false; |
| 1927 | |
| 1928 | // if this file is newer than the last time we updated, add it to the list |
| 1929 | |
| 1930 | if (filedata.ftLastWriteTime.dwHighDateTime > threshold.dwHighDateTime) |
| 1931 | add_it = true; |
| 1932 | if (filedata.ftLastWriteTime.dwHighDateTime == threshold.dwHighDateTime) { |
| 1933 | if (filedata.ftLastWriteTime.dwLowDateTime > threshold.dwLowDateTime) |
| 1934 | add_it = true; |
| 1935 | } |
| 1936 | if (filedata.ftCreationTime.dwHighDateTime > threshold.dwHighDateTime) |
| 1937 | add_it = true; |
| 1938 | if (filedata.ftCreationTime.dwHighDateTime == threshold.dwHighDateTime) { |
| 1939 | if (filedata.ftCreationTime.dwLowDateTime > threshold.dwLowDateTime) |
| 1940 | add_it = true; |
| 1941 | } |
| 1942 | // Add it to the list! |
| 1943 | if (add_it) { |
| 1944 | int primtype = GetPrimType(filedata.cFileName); |
| 1945 | OldFiles[Num_old_files].type = primtype; |
| 1946 | strcpy(OldFiles[Num_old_files].name, filedata.cFileName); |
| 1947 | Num_old_files++; |
| 1948 | } |
| 1949 | go_ahead = (FindNextFile(filehandle, &filedata) != 0); |
| 1950 | } |
| 1951 | if (filehandle != INVALID_HANDLE_VALUE) |
| 1952 | FindClose(filehandle); |
| 1953 | } |
| 1954 | |
| 1955 | // Builds a list of old files so we know which ones to update |
| 1956 | // Searches through all our netdirectories for old files |
| 1957 | void BuildOldFileList(FILETIME threshold) { |
| 1958 | char str[_MAX_PATH]; |
| 1959 | mprintf(0, "Building old files list!\n"); |
| 1960 | BuildOldFilesForDirectory(NetModelsDir, threshold); |
| 1961 | BuildOldFilesForDirectory(NetSoundsDir, threshold); |
| 1962 | BuildOldFilesForDirectory(NetMiscDir, threshold); |
| 1963 | BuildOldFilesForDirectory(ManageGraphicsDir, threshold); |
| 1964 | BuildOldFilesForDirectory(NetArtDir, threshold); |
| 1965 | BuildOldFilesForDirectory(NetMusicDir, threshold); |
| 1966 | BuildOldFilesForDirectory(NetVoiceDir, threshold); |
| 1967 | ddio_MakePath(str, NetD3Dir, "data", "levels", NULL); |
| 1968 | BuildOldFilesForDirectory(str, threshold); |
| 1969 | ddio_MakePath(str, NetD3Dir, "data", "briefings", NULL); |
| 1970 | BuildOldFilesForDirectory(str, threshold); |
| 1971 | ddio_MakePath(str, NetD3Dir, "data", "scripts", NULL); |
| 1972 | BuildOldFilesForDirectory(str, threshold); |
| 1973 | mprintf(0, "Found %d old files.\n", Num_old_files); |
| 1974 | } |
| 1975 | #endif |
| 1976 | |
| 1977 | // Returns true if the passed in primitive is old (ie needs to be updated from the network) |
| 1978 | bool IsPrimitiveOldcxx . . $ IsPrimitiveOld(c6b7e35ff6de5671).(char *name) { |
| 1979 | int primtype = GetPrimTypecxx . . $ GetPrimType(293b0826c8d9cb54).(namecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).); |
| 1980 | for (int i = 0; i < Num_old_filescxx . . $ Num_old_files.; i++) { |
| 1981 | if (OldFilescxx . . $ OldFiles.[i].typecxx . . $ old_file#type. == primtype && !stricmpcxx . . $ `linux/linux_fix.h:43:9`!(OldFiles[i].name, name)) |
| 1982 | return true; |
| 1983 | } |
| 1984 | |
| 1985 | return false; |
| 1986 | } |
| 1987 | |
| 1988 | // Updates a primitive if needed |
| 1989 | // Localname = local version of the primname (with path) |
| 1990 | // Netname = Network version of the primname (with path) |
| 1991 | void UpdatePrimitivecxx . . $ UpdatePrimitive(563e7f6fc320b4cb).(const stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::pathcxx . . $ std/filesystem/__cxx11/path# &localname, const stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::pathcxx . . $ std/filesystem/__cxx11/path# &netname, char *primname, |
| 1992 | int pagetype, char *pagename) { |
| 1993 | bool update = false; |
| 1994 | if (Starting_editorcxx . . $ Starting_editor. && !Use_old_update_methodcxx . . $ Use_old_update_method.) { |
| 1995 | if (IsPrimitiveOldcxx . . $ IsPrimitiveOld(c6b7e35ff6de5671).(primname)) |
| 1996 | update = true; |
| 1997 | } else { |
| 1998 | if (!cfexistcxx . . $ cfexist(293b0826c8d9cb54).(localname) || (cfexistcxx . . $ cfexist(293b0826c8d9cb54).(netname) && cf_Diffcxx . . $ cf_Diff(1b1fb50d0437e4a5).(localname, netname))) |
| 1999 | update = true; |
| 2000 | } |
| 2001 | |
| 2002 | if (update) { |
| 2003 | mngs_Pagelockcxx . . $ mngs_Pagelock# temp_pl; |
| 2004 | temp_pl.pagetypecxx . . $ mngs_Pagelock#pagetype. = pagetype; |
| 2005 | strcpy(temp_pl.namecxx . . $ mngs_Pagelock#name., pagename); |
| 2006 | if (!InLockListcxx . . $ InLockList(73051fa1db1ebefd).(&temp_pl)) { |
| 2007 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Making a local copy of %s for next time.\n", primname); |
| 2008 | if (!cf_CopyFilecxx . . $ cf_CopyFile(773c05b60430b9f6).(localname, netname, 1)) { |
| 2009 | Int3cxx . . $ `misc/pserror.h:247:9`!(); // get Jason |
| 2010 | return; |
| 2011 | } |
| 2012 | } |
| 2013 | } |
| 2014 | } |
| 2015 | // Writes a chunk header. Writes chunk id & placeholder length. Returns chunk start pos |
| 2016 | int StartManagePagecxx . . $ StartManagePage(d1801a78c3072b68).(CFILEcxx . . $ CFILE# *ofile, uint8_tcxx . . $ uint8_t# pagetype) { |
| 2017 | int chunk_start_pos; |
| 2018 | // Write pagetype |
| 2019 | cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(ofile, pagetype); |
| 2020 | chunk_start_pos = cftellcxx . . $ cftell(65b457210a6528a1).(ofile); |
| 2021 | cf_WriteIntcxx . . $ cf_WriteInt(966989f25543eb13).(ofile, 0); // placeholder for chunk len |
| 2022 | |
| 2023 | return chunk_start_pos; |
| 2024 | } |
| 2025 | // Fill in page length when done writing |
| 2026 | void EndManagePagecxx . . $ EndManagePage(966989f25543eb13).(CFILEcxx . . $ CFILE# *ofile, int chunk_start_pos) { |
| 2027 | int save_pos = cftellcxx . . $ cftell(65b457210a6528a1).(ofile); |
| 2028 | int len = save_pos - chunk_start_pos; |
| 2029 | // seek back to len field and fill in value |
| 2030 | cfseekcxx . . $ cfseek(f9992d249f032805).(ofile, chunk_start_pos, SEEK_SETcxx . . $ `<external>/14710646456994434043/fcntl.h:137:10`!); |
| 2031 | cf_WriteIntcxx . . $ cf_WriteInt(966989f25543eb13).(ofile, len); // write chunk length |
| 2032 | // go back to end of file |
| 2033 | cfseekcxx . . $ cfseek(f9992d249f032805).(ofile, save_pos, SEEK_SETcxx . . $ `<external>/14710646456994434043/fcntl.h:137:10`!); |
| 2034 | } |
| 2035 | // Assigns a page to its appropriate structure and writes it out |
| 2036 | void mng_AssignAndWritePagecxx . . $ mng_AssignAndWritePage(35f1290d242e61e2).(int handle, int pagetype, CFILEcxx . . $ CFILE# *outfile) { |
| 2037 | switch (pagetype) { |
| 2038 | case PAGETYPE_TEXTUREcxx . . $ `lib/manage.h:49:9`!: |
| 2039 | mng_AssignTextureToTexPagecxx . . $ mng_AssignTextureToTexPage(a870206c076b2873).(handle, &texpagecxx . . $ texpage.); |
| 2040 | mng_WriteNewTexturePagecxx . . $ mng_WriteNewTexturePage(ba0e418ed632d802).(outfile, &texpagecxx . . $ texpage.); |
| 2041 | break; |
| 2042 | case PAGETYPE_SOUNDcxx . . $ `lib/manage.h:55:9`!: |
| 2043 | mng_AssignSoundToSoundPagecxx . . $ mng_AssignSoundToSoundPage(c2846f5ad1cf7394).(handle, &soundpagecxx . . $ soundpage.); |
| 2044 | mng_WriteNewSoundPagecxx . . $ mng_WriteNewSoundPage(43d39fc2bcaa809).(outfile, &soundpagecxx . . $ soundpage.); |
| 2045 | break; |
| 2046 | case PAGETYPE_WEAPONcxx . . $ `lib/manage.h:50:9`!: |
| 2047 | mng_AssignWeaponToWeaponPagecxx . . $ mng_AssignWeaponToWeaponPage(53da973e7b6e4fe3).(handle, &weaponpagecxx . . $ weaponpage.); |
| 2048 | mng_WriteNewWeaponPagecxx . . $ mng_WriteNewWeaponPage(72f3989a7102bdce).(outfile, &weaponpagecxx . . $ weaponpage.); |
| 2049 | break; |
| 2050 | case PAGETYPE_GENERICcxx . . $ `lib/manage.h:58:9`!: |
| 2051 | mng_AssignObjInfoToGenericPagecxx . . $ mng_AssignObjInfoToGenericPage(a68a84489d417e97).(handle, &genericpagecxx . . $ genericpage.); |
| 2052 | mng_WriteNewGenericPagecxx . . $ mng_WriteNewGenericPage(431eacc5074b70a8).(outfile, &genericpagecxx . . $ genericpage.); |
| 2053 | break; |
| 2054 | case PAGETYPE_DOORcxx . . $ `lib/manage.h:53:9`!: |
| 2055 | mng_AssignDoorToDoorPagecxx . . $ mng_AssignDoorToDoorPage(d9a46a4affc78c77).(handle, &doorpagecxx . . $ doorpage.); |
| 2056 | mng_WriteNewDoorPagecxx . . $ mng_WriteNewDoorPage(6856a7589499e64e).(outfile, &doorpagecxx . . $ doorpage.); |
| 2057 | break; |
| 2058 | case PAGETYPE_MEGACELLcxx . . $ `lib/manage.h:56:9`!: |
| 2059 | mng_AssignMegacellToMegacellPagecxx . . $ mng_AssignMegacellToMegacellPage(9daa74137d083c5a).(handle, &megacellpagecxx . . $ megacellpage.); |
| 2060 | mng_WriteNewMegacellPagecxx . . $ mng_WriteNewMegacellPage(7620e86f5f7cdcdf).(outfile, &megacellpagecxx . . $ megacellpage.); |
| 2061 | break; |
| 2062 | case PAGETYPE_SHIPcxx . . $ `lib/manage.h:54:9`!: |
| 2063 | mng_AssignShipToShipPagecxx . . $ mng_AssignShipToShipPage(6c9ae2d5ec570cce).(handle, &shippagecxx . . $ shippage.); |
| 2064 | mng_WriteNewShipPagecxx . . $ mng_WriteNewShipPage(d82cdf4b89141491).(outfile, &shippagecxx . . $ shippage.); |
| 2065 | break; |
| 2066 | case PAGETYPE_GAMEFILEcxx . . $ `lib/manage.h:57:9`!: |
| 2067 | mng_AssignGamefileToGamefilePagecxx . . $ mng_AssignGamefileToGamefilePage(d3c2d6055704c39b).(handle, &gamefilepagecxx . . $ gamefilepage.); |
| 2068 | mng_WriteNewGamefilePagecxx . . $ mng_WriteNewGamefilePage(a65e5c267f491e9e).(outfile, &gamefilepagecxx . . $ gamefilepage.); |
| 2069 | break; |
| 2070 | default: |
| 2071 | break; |
| 2072 | } |
| 2073 | } |
| 2074 | #define COPYBUFFER_SIZEcxx . . $ `manage/manage.cpp:2074:9`! 200000 |
| 2075 | // Given a texture handle, searches the table file and replaces the texture with the same name |
| 2076 | // If local=1, then does it to the users local copy |
| 2077 | // Returns 0 on error, else 1 if all is good |
| 2078 | int mng_ReplacePagecxx . . $ mng_ReplacePage(80ec76f00b6174b2).(char *srcname, char *destname, int handle, int dest_pagetype, int local) { |
| 2079 | CFILEcxx . . $ CFILE# *infile, *outfile; |
| 2080 | uint8_tcxx . . $ uint8_t# pagetype, replaced = 0; |
| 2081 | int done = 0, len; |
| 2082 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Replacing '%s' with '%s' (%s).\n", srcname, destname, local ? "locally" : "to network"); |
| 2083 | |
| 2084 | if (local) |
| 2085 | infile = cfopencxx . . $ cfopen(7c7b94e455f1ae56).(LocalTableFilenamecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., "rb"); |
| 2086 | else |
| 2087 | infile = cfopencxx . . $ cfopen(7c7b94e455f1ae56).(TableFilenamecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., "rb"); |
| 2088 | if (!infile) { |
| 2089 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Couldn't open table file to replace page %s!\n", srcname); |
| 2090 | Int3cxx . . $ `misc/pserror.h:247:9`!(); |
| 2091 | return 0; |
| 2092 | } |
| 2093 | if (local) |
| 2094 | outfile = cfopencxx . . $ cfopen(7c7b94e455f1ae56).(LocalTempTableFilenamecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., "wb"); |
| 2095 | else |
| 2096 | outfile = cfopencxx . . $ cfopen(7c7b94e455f1ae56).(TempTableFilenamecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., "wb"); |
| 2097 | if (!outfile) { |
| 2098 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Couldn't open temp table file to replace page %s!\n", srcname); |
| 2099 | cfclosecxx . . $ cfclose(3639e799710acb68).(infile); |
| 2100 | Int3cxx . . $ `misc/pserror.h:247:9`!(); |
| 2101 | return 0; |
| 2102 | } |
| 2103 | // Allocate memory for copying |
| 2104 | uint8_tcxx . . $ uint8_t# *copybuffer = (uint8_tcxx . . $ uint8_t# *)mem_malloccxx . . $ `mem/mem.h:79:9`!(COPYBUFFER_SIZEcxx . . $ `manage/manage.cpp:2074:9`!); |
| 2105 | if (!copybuffer) { |
| 2106 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Couldn't allocate memory to replace page %s!\n", srcname); |
| 2107 | cfclosecxx . . $ cfclose(3639e799710acb68).(infile); |
| 2108 | cfclosecxx . . $ cfclose(3639e799710acb68).(outfile); |
| 2109 | Int3cxx . . $ `misc/pserror.h:247:9`!(); |
| 2110 | return 0; |
| 2111 | } |
| 2112 | while (!done) { |
| 2113 | if (cfeofcxx . . $ cfeof(413716a422df0036).(infile)) { |
| 2114 | done = 1; |
| 2115 | continue; |
| 2116 | } |
| 2117 | pagetype = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile); |
| 2118 | len = cf_ReadIntcxx . . $ cf_ReadInt(d60d6f5e30f0c96a).(infile); |
| 2119 | // If not a texture page, just read it in and write it right back out |
| 2120 | if (pagetype != dest_pagetype) { |
| 2121 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(len < COPYBUFFER_SIZEcxx . . $ `manage/manage.cpp:2074:9`!); |
| 2122 | |
| 2123 | cf_ReadBytescxx . . $ cf_ReadBytes(de6325ef3380a744).(copybuffer, len - 4, infile); |
| 2124 | cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, pagetype); |
| 2125 | cf_WriteIntcxx . . $ cf_WriteInt(966989f25543eb13).(outfile, len); |
| 2126 | if (len - 4 > 0) |
| 2127 | cf_WriteBytescxx . . $ cf_WriteBytes(b35058f74b39c3a6).(copybuffer, len - 4, outfile); |
| 2128 | |
| 2129 | continue; |
| 2130 | } |
| 2131 | switch (pagetype) { |
| 2132 | case PAGETYPE_TEXTUREcxx . . $ `lib/manage.h:49:9`!: { |
| 2133 | mng_ReadNewTexturePagecxx . . $ mng_ReadNewTexturePage(3fd8847e45b480a6).(infile, &texpagecxx . . $ texpage.); |
| 2134 | if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(srcname, texpage.tex_struct.name)) { |
| 2135 | mng_AssignAndWritePagecxx . . $ mng_AssignAndWritePage(35f1290d242e61e2).(handle, pagetype, outfile); |
| 2136 | replaced = 1; |
| 2137 | } else { |
| 2138 | mng_WriteNewTexturePagecxx . . $ mng_WriteNewTexturePage(ba0e418ed632d802).(outfile, &texpagecxx . . $ texpage.); |
| 2139 | } |
| 2140 | break; |
| 2141 | } |
| 2142 | case PAGETYPE_SOUNDcxx . . $ `lib/manage.h:55:9`!: { |
| 2143 | mng_ReadNewSoundPagecxx . . $ mng_ReadNewSoundPage(155713602bc6d21).(infile, &soundpagecxx . . $ soundpage.); |
| 2144 | if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(srcname, soundpage.sound_struct.name)) { |
| 2145 | mng_AssignAndWritePagecxx . . $ mng_AssignAndWritePage(35f1290d242e61e2).(handle, pagetype, outfile); |
| 2146 | replaced = 1; |
| 2147 | } else { |
| 2148 | mng_WriteNewSoundPagecxx . . $ mng_WriteNewSoundPage(43d39fc2bcaa809).(outfile, &soundpagecxx . . $ soundpage.); |
| 2149 | } |
| 2150 | break; |
| 2151 | } |
| 2152 | case PAGETYPE_WEAPONcxx . . $ `lib/manage.h:50:9`!: { |
| 2153 | mng_ReadNewWeaponPagecxx . . $ mng_ReadNewWeaponPage(9414407c63411fdc).(infile, &weaponpagecxx . . $ weaponpage.); |
| 2154 | if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(srcname, weaponpage.weapon_struct.name)) { |
| 2155 | mng_AssignAndWritePagecxx . . $ mng_AssignAndWritePage(35f1290d242e61e2).(handle, pagetype, outfile); |
| 2156 | replaced = 1; |
| 2157 | } else { |
| 2158 | mng_WriteNewWeaponPagecxx . . $ mng_WriteNewWeaponPage(72f3989a7102bdce).(outfile, &weaponpagecxx . . $ weaponpage.); |
| 2159 | } |
| 2160 | break; |
| 2161 | } |
| 2162 | case PAGETYPE_GENERICcxx . . $ `lib/manage.h:58:9`!: { |
| 2163 | mng_ReadNewGenericPagecxx . . $ mng_ReadNewGenericPage(c2b96e49a8bfd41d).(infile, &genericpagecxx . . $ genericpage.); |
| 2164 | if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(srcname, genericpage.objinfo_struct.name)) { |
| 2165 | // This is the page we want to replace, so write the new one out. |
| 2166 | if (genericpagecxx . . $ genericpage..objinfo_structcxx . . $ mngs_generic_page#objinfo_struct..descriptioncxx . . $ object_info#description. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) { |
| 2167 | mem_freecxx . . $ `mem/mem.h:80:9`!(genericpage.objinfo_struct.description); |
| 2168 | genericpagecxx . . $ genericpage..objinfo_structcxx . . $ mngs_generic_page#objinfo_struct..descriptioncxx . . $ object_info#description. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 2169 | } |
| 2170 | genericpagecxx . . $ genericpage..objinfo_structcxx . . $ mngs_generic_page#objinfo_struct..icon_namecxx . . $ object_info#icon_name.[0] = '\0'; |
| 2171 | |
| 2172 | mng_AssignAndWritePagecxx . . $ mng_AssignAndWritePage(35f1290d242e61e2).(handle, pagetype, outfile); |
| 2173 | replaced = 1; |
| 2174 | } else { |
| 2175 | mng_WriteNewGenericPagecxx . . $ mng_WriteNewGenericPage(431eacc5074b70a8).(outfile, &genericpagecxx . . $ genericpage.); |
| 2176 | } |
| 2177 | break; |
| 2178 | } |
| 2179 | case PAGETYPE_DOORcxx . . $ `lib/manage.h:53:9`!: { |
| 2180 | mng_ReadNewDoorPagecxx . . $ mng_ReadNewDoorPage(8049f1a86201f7be).(infile, &doorpagecxx . . $ doorpage.); |
| 2181 | if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(srcname, doorpage.door_struct.name)) { |
| 2182 | mng_AssignAndWritePagecxx . . $ mng_AssignAndWritePage(35f1290d242e61e2).(handle, pagetype, outfile); |
| 2183 | replaced = 1; |
| 2184 | } else { |
| 2185 | mng_WriteNewDoorPagecxx . . $ mng_WriteNewDoorPage(6856a7589499e64e).(outfile, &doorpagecxx . . $ doorpage.); |
| 2186 | } |
| 2187 | break; |
| 2188 | } |
| 2189 | case PAGETYPE_MEGACELLcxx . . $ `lib/manage.h:56:9`!: { |
| 2190 | mng_ReadNewMegacellPagecxx . . $ mng_ReadNewMegacellPage(5dec59790525c329).(infile, &megacellpagecxx . . $ megacellpage.); |
| 2191 | if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(srcname, megacellpage.megacell_struct.name)) { |
| 2192 | mng_AssignAndWritePagecxx . . $ mng_AssignAndWritePage(35f1290d242e61e2).(handle, pagetype, outfile); |
| 2193 | replaced = 1; |
| 2194 | } else { |
| 2195 | mng_WriteNewMegacellPagecxx . . $ mng_WriteNewMegacellPage(7620e86f5f7cdcdf).(outfile, &megacellpagecxx . . $ megacellpage.); |
| 2196 | } |
| 2197 | break; |
| 2198 | } |
| 2199 | case PAGETYPE_SHIPcxx . . $ `lib/manage.h:54:9`!: { |
| 2200 | mng_ReadNewShipPagecxx . . $ mng_ReadNewShipPage(ec0053c10eec018b).(infile, &shippagecxx . . $ shippage.); |
| 2201 | if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(srcname, shippage.ship_struct.name)) { |
| 2202 | mng_AssignAndWritePagecxx . . $ mng_AssignAndWritePage(35f1290d242e61e2).(handle, pagetype, outfile); |
| 2203 | replaced = 1; |
| 2204 | } else { |
| 2205 | mng_WriteNewShipPagecxx . . $ mng_WriteNewShipPage(d82cdf4b89141491).(outfile, &shippagecxx . . $ shippage.); |
| 2206 | } |
| 2207 | break; |
| 2208 | } |
| 2209 | case PAGETYPE_GAMEFILEcxx . . $ `lib/manage.h:57:9`!: { |
| 2210 | mng_ReadNewGamefilePagecxx . . $ mng_ReadNewGamefilePage(6ed3275c23aad507).(infile, &gamefilepagecxx . . $ gamefilepage.); |
| 2211 | if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(srcname, gamefilepage.gamefile_struct.name)) { |
| 2212 | mng_AssignAndWritePagecxx . . $ mng_AssignAndWritePage(35f1290d242e61e2).(handle, pagetype, outfile); |
| 2213 | replaced = 1; |
| 2214 | } else { |
| 2215 | mng_WriteNewGamefilePagecxx . . $ mng_WriteNewGamefilePage(a65e5c267f491e9e).(outfile, &gamefilepagecxx . . $ gamefilepage.); |
| 2216 | } |
| 2217 | break; |
| 2218 | } |
| 2219 | default: |
| 2220 | break; |
| 2221 | } |
| 2222 | } |
| 2223 | |
| 2224 | if (!replaced) { |
| 2225 | // This is a new page, so append it to the end of file. |
| 2226 | mng_AssignAndWritePagecxx . . $ mng_AssignAndWritePage(35f1290d242e61e2).(handle, dest_pagetype, outfile); |
| 2227 | } |
| 2228 | if (replaced) |
| 2229 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Page replaced.\n"); |
| 2230 | else |
| 2231 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "New page added.\n"); |
| 2232 | cfclosecxx . . $ cfclose(3639e799710acb68).(infile); |
| 2233 | cfclosecxx . . $ cfclose(3639e799710acb68).(outfile); |
| 2234 | mem_freecxx . . $ `mem/mem.h:80:9`!(copybuffer); |
| 2235 | if (local) { |
| 2236 | if (!SwitcherooFilescxx . . $ SwitcherooFiles(2f051e3560ff300f).(LocalTableFilenamecxx . . $ LocalTableFilename., LocalTempTableFilenamecxx . . $ LocalTempTableFilename.)) |
| 2237 | return 0; |
| 2238 | } else { |
| 2239 | if (!SwitcherooFilescxx . . $ SwitcherooFiles(2f051e3560ff300f).(TableFilenamecxx . . $ TableFilename., TempTableFilenamecxx . . $ TempTableFilename.)) |
| 2240 | return 0; |
| 2241 | } |
| 2242 | return 1; // successful! |
| 2243 | } |
| 2244 | // Given a texture name, finds it in the table file and deletes it |
| 2245 | // If local is 1, deletes from the local table file |
| 2246 | int mng_DeletePagecxx . . $ mng_DeletePage(fa3df6d5de4c4541).(char *name, int dest_pagetype, int local) { |
| 2247 | CFILEcxx . . $ CFILE# *infile, *outfile; |
| 2248 | uint8_tcxx . . $ uint8_t# pagetype, replaced = 0; |
| 2249 | int done = 0; |
| 2250 | int deleted = 0; |
| 2251 | |
| 2252 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Deleting %s (%s).\n", name, local ? "locally" : "on network"); |
| 2253 | |
| 2254 | if (local) |
| 2255 | infile = cfopencxx . . $ cfopen(7c7b94e455f1ae56).(LocalTableFilenamecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., "rb"); |
| 2256 | else |
| 2257 | infile = cfopencxx . . $ cfopen(7c7b94e455f1ae56).(TableFilenamecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., "rb"); |
| 2258 | if (!infile) { |
| 2259 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Couldn't open table file to delete page!\n"); |
| 2260 | Int3cxx . . $ `misc/pserror.h:247:9`!(); |
| 2261 | return 0; |
| 2262 | } |
| 2263 | if (local) |
| 2264 | outfile = cfopencxx . . $ cfopen(7c7b94e455f1ae56).(LocalTempTableFilenamecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., "wb"); |
| 2265 | else |
| 2266 | outfile = cfopencxx . . $ cfopen(7c7b94e455f1ae56).(TempTableFilenamecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., "wb"); |
| 2267 | if (!outfile) { |
| 2268 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Couldn't open temp table file to delete page!\n"); |
| 2269 | cfclosecxx . . $ cfclose(3639e799710acb68).(infile); |
| 2270 | Int3cxx . . $ `misc/pserror.h:247:9`!(); |
| 2271 | return 0; |
| 2272 | } |
| 2273 | // Allocate memory for copying |
| 2274 | uint8_tcxx . . $ uint8_t# *copybuffer = (uint8_tcxx . . $ uint8_t# *)mem_malloccxx . . $ `mem/mem.h:79:9`!(COPYBUFFER_SIZEcxx . . $ `manage/manage.cpp:2074:9`!); |
| 2275 | if (!copybuffer) { |
| 2276 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Couldn't allocate memory to delete page!\n"); |
| 2277 | cfclosecxx . . $ cfclose(3639e799710acb68).(infile); |
| 2278 | cfclosecxx . . $ cfclose(3639e799710acb68).(outfile); |
| 2279 | Int3cxx . . $ `misc/pserror.h:247:9`!(); |
| 2280 | return 0; |
| 2281 | } |
| 2282 | while (!done) { |
| 2283 | if (cfeofcxx . . $ cfeof(413716a422df0036).(infile)) { |
| 2284 | done = 1; |
| 2285 | continue; |
| 2286 | } |
| 2287 | pagetype = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile); |
| 2288 | int len = cf_ReadIntcxx . . $ cf_ReadInt(d60d6f5e30f0c96a).(infile); |
| 2289 | if (pagetype != dest_pagetype) { |
| 2290 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(len < COPYBUFFER_SIZEcxx . . $ `manage/manage.cpp:2074:9`!); |
| 2291 | |
| 2292 | cf_ReadBytescxx . . $ cf_ReadBytes(de6325ef3380a744).(copybuffer, len - 4, infile); |
| 2293 | cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, pagetype); |
| 2294 | cf_WriteIntcxx . . $ cf_WriteInt(966989f25543eb13).(outfile, len); |
| 2295 | if (len - 4 > 0) |
| 2296 | cf_WriteBytescxx . . $ cf_WriteBytes(b35058f74b39c3a6).(copybuffer, len - 4, outfile); |
| 2297 | |
| 2298 | continue; |
| 2299 | } |
| 2300 | switch (pagetype) { |
| 2301 | |
| 2302 | case PAGETYPE_TEXTUREcxx . . $ `lib/manage.h:49:9`!: { |
| 2303 | mng_ReadNewTexturePagecxx . . $ mng_ReadNewTexturePage(3fd8847e45b480a6).(infile, &texpagecxx . . $ texpage.); |
| 2304 | if (stricmpcxx . . $ `linux/linux_fix.h:43:9`!(name, texpage.tex_struct.name)) |
| 2305 | mng_WriteNewTexturePagecxx . . $ mng_WriteNewTexturePage(ba0e418ed632d802).(outfile, &texpagecxx . . $ texpage.); |
| 2306 | else |
| 2307 | deleted = 1; // Don't write out the one we want to delete |
| 2308 | break; |
| 2309 | } |
| 2310 | case PAGETYPE_DOORcxx . . $ `lib/manage.h:53:9`!: { |
| 2311 | mng_ReadNewDoorPagecxx . . $ mng_ReadNewDoorPage(8049f1a86201f7be).(infile, &doorpagecxx . . $ doorpage.); |
| 2312 | if (stricmpcxx . . $ `linux/linux_fix.h:43:9`!(name, doorpage.door_struct.name)) |
| 2313 | mng_WriteNewDoorPagecxx . . $ mng_WriteNewDoorPage(6856a7589499e64e).(outfile, &doorpagecxx . . $ doorpage.); |
| 2314 | else |
| 2315 | deleted = 1; // Don't write out the one we want to delete |
| 2316 | break; |
| 2317 | } |
| 2318 | case PAGETYPE_GENERICcxx . . $ `lib/manage.h:58:9`!: { |
| 2319 | mng_ReadNewGenericPagecxx . . $ mng_ReadNewGenericPage(c2b96e49a8bfd41d).(infile, &genericpagecxx . . $ genericpage.); |
| 2320 | if (stricmpcxx . . $ `linux/linux_fix.h:43:9`!(name, genericpage.objinfo_struct.name)) |
| 2321 | mng_WriteNewGenericPagecxx . . $ mng_WriteNewGenericPage(431eacc5074b70a8).(outfile, &genericpagecxx . . $ genericpage.); |
| 2322 | else |
| 2323 | deleted = 1; // Don't write out the one we want to delete |
| 2324 | if (genericpagecxx . . $ genericpage..objinfo_structcxx . . $ mngs_generic_page#objinfo_struct..descriptioncxx . . $ object_info#description. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) { |
| 2325 | mem_freecxx . . $ `mem/mem.h:80:9`!(genericpage.objinfo_struct.description); |
| 2326 | genericpagecxx . . $ genericpage..objinfo_structcxx . . $ mngs_generic_page#objinfo_struct..descriptioncxx . . $ object_info#description. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 2327 | } |
| 2328 | genericpagecxx . . $ genericpage..objinfo_structcxx . . $ mngs_generic_page#objinfo_struct..icon_namecxx . . $ object_info#icon_name.[0] = '\0'; |
| 2329 | break; |
| 2330 | } |
| 2331 | case PAGETYPE_SOUNDcxx . . $ `lib/manage.h:55:9`!: { |
| 2332 | mng_ReadNewSoundPagecxx . . $ mng_ReadNewSoundPage(155713602bc6d21).(infile, &soundpagecxx . . $ soundpage.); |
| 2333 | if (stricmpcxx . . $ `linux/linux_fix.h:43:9`!(name, soundpage.sound_struct.name)) |
| 2334 | mng_WriteNewSoundPagecxx . . $ mng_WriteNewSoundPage(43d39fc2bcaa809).(outfile, &soundpagecxx . . $ soundpage.); |
| 2335 | else |
| 2336 | deleted = 1; // Don't write out the one we want to delete |
| 2337 | break; |
| 2338 | } |
| 2339 | case PAGETYPE_SHIPcxx . . $ `lib/manage.h:54:9`!: { |
| 2340 | mng_ReadNewShipPagecxx . . $ mng_ReadNewShipPage(ec0053c10eec018b).(infile, &shippagecxx . . $ shippage.); |
| 2341 | if (stricmpcxx . . $ `linux/linux_fix.h:43:9`!(name, shippage.ship_struct.name)) |
| 2342 | mng_WriteNewShipPagecxx . . $ mng_WriteNewShipPage(d82cdf4b89141491).(outfile, &shippagecxx . . $ shippage.); |
| 2343 | else |
| 2344 | deleted = 1; // Don't write out the one we want to delete |
| 2345 | break; |
| 2346 | } |
| 2347 | case PAGETYPE_WEAPONcxx . . $ `lib/manage.h:50:9`!: { |
| 2348 | mng_ReadNewWeaponPagecxx . . $ mng_ReadNewWeaponPage(9414407c63411fdc).(infile, &weaponpagecxx . . $ weaponpage.); |
| 2349 | if (stricmpcxx . . $ `linux/linux_fix.h:43:9`!(name, weaponpage.weapon_struct.name)) |
| 2350 | mng_WriteNewWeaponPagecxx . . $ mng_WriteNewWeaponPage(72f3989a7102bdce).(outfile, &weaponpagecxx . . $ weaponpage.); |
| 2351 | else |
| 2352 | deleted = 1; // Don't write out the one we want to delete |
| 2353 | break; |
| 2354 | } |
| 2355 | case PAGETYPE_MEGACELLcxx . . $ `lib/manage.h:56:9`!: { |
| 2356 | mng_ReadNewMegacellPagecxx . . $ mng_ReadNewMegacellPage(5dec59790525c329).(infile, &megacellpagecxx . . $ megacellpage.); |
| 2357 | if (stricmpcxx . . $ `linux/linux_fix.h:43:9`!(name, megacellpage.megacell_struct.name)) |
| 2358 | mng_WriteNewMegacellPagecxx . . $ mng_WriteNewMegacellPage(7620e86f5f7cdcdf).(outfile, &megacellpagecxx . . $ megacellpage.); |
| 2359 | else |
| 2360 | deleted = 1; // Don't write out the one we want to delete |
| 2361 | break; |
| 2362 | } |
| 2363 | case PAGETYPE_GAMEFILEcxx . . $ `lib/manage.h:57:9`!: { |
| 2364 | mng_ReadNewGamefilePagecxx . . $ mng_ReadNewGamefilePage(6ed3275c23aad507).(infile, &gamefilepagecxx . . $ gamefilepage.); |
| 2365 | if (stricmpcxx . . $ `linux/linux_fix.h:43:9`!(name, gamefilepage.gamefile_struct.name)) |
| 2366 | mng_WriteNewGamefilePagecxx . . $ mng_WriteNewGamefilePage(a65e5c267f491e9e).(outfile, &gamefilepagecxx . . $ gamefilepage.); |
| 2367 | else |
| 2368 | deleted = 1; // Don't write out the one we want to delete |
| 2369 | break; |
| 2370 | } |
| 2371 | default: |
| 2372 | break; |
| 2373 | } |
| 2374 | } |
| 2375 | |
| 2376 | if (!local) { |
| 2377 | // It's gotta be there if on the network |
| 2378 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(deleted == 1); |
| 2379 | } else { |
| 2380 | if (!deleted) { |
| 2381 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Not found locally?!\n"); |
| 2382 | } |
| 2383 | } |
| 2384 | cfclosecxx . . $ cfclose(3639e799710acb68).(infile); |
| 2385 | cfclosecxx . . $ cfclose(3639e799710acb68).(outfile); |
| 2386 | mem_freecxx . . $ `mem/mem.h:80:9`!(copybuffer); |
| 2387 | // Now, remove our table file and rename the temp file to be the table file |
| 2388 | if (local) { |
| 2389 | if (!SwitcherooFilescxx . . $ SwitcherooFiles(2f051e3560ff300f).(LocalTableFilenamecxx . . $ LocalTableFilename., LocalTempTableFilenamecxx . . $ LocalTempTableFilename.)) |
| 2390 | return 0; |
| 2391 | } else { |
| 2392 | if (!SwitcherooFilescxx . . $ SwitcherooFiles(2f051e3560ff300f).(TableFilenamecxx . . $ TableFilename., TempTableFilenamecxx . . $ TempTableFilename.)) |
| 2393 | return 0; |
| 2394 | } |
| 2395 | return 1; // successful! |
| 2396 | } |
| 2397 | // Reads in a physics chunk from an open file |
| 2398 | void mng_ReadPhysicsChunkcxx . . $ mng_ReadPhysicsChunk(94fabf1e8396697f).(physics_infocxx . . $ physics_info# *phys_info, CFILEcxx . . $ CFILE# *infile) { |
| 2399 | phys_info->masscxx . . $ physics_info#mass. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile); |
| 2400 | phys_info->dragcxx . . $ physics_info#drag. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile); |
| 2401 | phys_info->full_thrustcxx . . $ physics_info#$anonymous_type_3#full_thrust. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile); |
| 2402 | phys_info->flagscxx . . $ physics_info#flags. = cf_ReadIntcxx . . $ cf_ReadInt(d60d6f5e30f0c96a).(infile); |
| 2403 | phys_info->rotdragcxx . . $ physics_info#rotdrag. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile); |
| 2404 | phys_info->full_rotthrustcxx . . $ physics_info#$anonymous_type_4#full_rotthrust. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile); |
| 2405 | phys_info->num_bouncescxx . . $ physics_info#num_bounces. = cf_ReadIntcxx . . $ cf_ReadInt(d60d6f5e30f0c96a).(infile); |
| 2406 | phys_info->velocitycxx . . $ physics_info#velocity..zcxx . . $ vector#z. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile); |
| 2407 | phys_info->rotvelcxx . . $ physics_info#$anonymous_type_1#rotvel..xcxx . . $ vector#x. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile); |
| 2408 | phys_info->rotvelcxx . . $ physics_info#$anonymous_type_1#rotvel..ycxx . . $ vector#y. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile); |
| 2409 | phys_info->rotvelcxx . . $ physics_info#$anonymous_type_1#rotvel..zcxx . . $ vector#z. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile); |
| 2410 | phys_info->wiggle_amplitudecxx . . $ physics_info#wiggle_amplitude. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile); |
| 2411 | phys_info->wiggles_per_seccxx . . $ physics_info#wiggles_per_sec. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile); |
| 2412 | phys_info->coeff_restitutioncxx . . $ physics_info#coeff_restitution. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile); |
| 2413 | phys_info->hit_die_dotcxx . . $ physics_info#$anonymous_type_5#hit_die_dot. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile); |
| 2414 | phys_info->max_turnroll_ratecxx . . $ physics_info#max_turnroll_rate. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile); |
| 2415 | phys_info->turnroll_ratiocxx . . $ physics_info#turnroll_ratio. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile); |
| 2416 | } |
| 2417 | // Writes out a physics chunk to an open file |
| 2418 | void mng_WritePhysicsChunkcxx . . $ mng_WritePhysicsChunk(94fabf1e8396697f).(physics_infocxx . . $ physics_info# *phys_info, CFILEcxx . . $ CFILE# *outfile) { |
| 2419 | cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, phys_info->masscxx . . $ physics_info#mass.); |
| 2420 | cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, phys_info->dragcxx . . $ physics_info#drag.); |
| 2421 | cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, phys_info->full_thrustcxx . . $ physics_info#$anonymous_type_3#full_thrust.); |
| 2422 | cf_WriteIntcxx . . $ cf_WriteInt(966989f25543eb13).(outfile, phys_info->flagscxx . . $ physics_info#flags.); |
| 2423 | cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, phys_info->rotdragcxx . . $ physics_info#rotdrag.); |
| 2424 | cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, phys_info->full_rotthrustcxx . . $ physics_info#$anonymous_type_4#full_rotthrust.); |
| 2425 | cf_WriteIntcxx . . $ cf_WriteInt(966989f25543eb13).(outfile, phys_info->num_bouncescxx . . $ physics_info#num_bounces.); |
| 2426 | cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, phys_info->velocitycxx . . $ physics_info#velocity..zcxx . . $ vector#z.); |
| 2427 | cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, phys_info->rotvelcxx . . $ physics_info#$anonymous_type_1#rotvel..xcxx . . $ vector#x.); |
| 2428 | cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, phys_info->rotvelcxx . . $ physics_info#$anonymous_type_1#rotvel..ycxx . . $ vector#y.); |
| 2429 | cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, phys_info->rotvelcxx . . $ physics_info#$anonymous_type_1#rotvel..zcxx . . $ vector#z.); |
| 2430 | cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, phys_info->wiggle_amplitudecxx . . $ physics_info#wiggle_amplitude.); |
| 2431 | cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, phys_info->wiggles_per_seccxx . . $ physics_info#wiggles_per_sec.); |
| 2432 | cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, phys_info->coeff_restitutioncxx . . $ physics_info#coeff_restitution.); |
| 2433 | cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, phys_info->hit_die_dotcxx . . $ physics_info#$anonymous_type_5#hit_die_dot.); |
| 2434 | cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, phys_info->max_turnroll_ratecxx . . $ physics_info#max_turnroll_rate.); |
| 2435 | cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, phys_info->turnroll_ratiocxx . . $ physics_info#turnroll_ratio.); |
| 2436 | } |
| 2437 | // Writes out weapon battery info |
| 2438 | void mng_WriteWeaponBatteryChunkcxx . . $ mng_WriteWeaponBatteryChunk(ad20a081f57bd899).(otype_wb_infocxx . . $ otype_wb_info# *static_wb, CFILEcxx . . $ CFILE# *outfile) { |
| 2439 | int j; |
| 2440 | cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, static_wb->energy_usagecxx . . $ otype_wb_info#energy_usage.); |
| 2441 | cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, static_wb->ammo_usagecxx . . $ otype_wb_info#ammo_usage.); |
| 2442 | for (j = 0; j < MAX_WB_GUNPOINTScxx . . $ `lib/robotfirestruct_external.h:22:9`!; j++) { |
| 2443 | cf_WriteShortcxx . . $ cf_WriteShort(d7cf1a05aca96fe5).(outfile, static_wb->gp_weapon_indexcxx . . $ otype_wb_info#gp_weapon_index.[j]); |
| 2444 | } |
| 2445 | |
| 2446 | for (j = 0; j < MAX_WB_FIRING_MASKScxx . . $ `lib/robotfirestruct_external.h:23:9`!; j++) { |
| 2447 | cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, static_wb->gp_fire_maskscxx . . $ otype_wb_info#gp_fire_masks.[j]); |
| 2448 | cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, static_wb->gp_fire_waitcxx . . $ otype_wb_info#gp_fire_wait.[j]); |
| 2449 | cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, static_wb->anim_timecxx . . $ otype_wb_info#anim_time.[j]); |
| 2450 | cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, static_wb->anim_start_framecxx . . $ otype_wb_info#anim_start_frame.[j]); |
| 2451 | cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, static_wb->anim_fire_framecxx . . $ otype_wb_info#anim_fire_frame.[j]); |
| 2452 | cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, static_wb->anim_end_framecxx . . $ otype_wb_info#anim_end_frame.[j]); |
| 2453 | } |
| 2454 | cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, static_wb->num_maskscxx . . $ otype_wb_info#num_masks.); |
| 2455 | cf_WriteShortcxx . . $ cf_WriteShort(d7cf1a05aca96fe5).(outfile, static_wb->aiming_gp_indexcxx . . $ otype_wb_info#aiming_gp_index.); |
| 2456 | cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, static_wb->aiming_flagscxx . . $ otype_wb_info#aiming_flags.); |
| 2457 | cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, static_wb->aiming_3d_dotcxx . . $ otype_wb_info#aiming_3d_dot.); |
| 2458 | cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, static_wb->aiming_3d_distcxx . . $ otype_wb_info#aiming_3d_dist.); |
| 2459 | cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, static_wb->aiming_XZ_dotcxx . . $ otype_wb_info#aiming_XZ_dot.); |
| 2460 | cf_WriteShortcxx . . $ cf_WriteShort(d7cf1a05aca96fe5).(outfile, static_wb->flagscxx . . $ otype_wb_info#flags.); |
| 2461 | cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, static_wb->gp_quad_fire_maskcxx . . $ otype_wb_info#gp_quad_fire_mask.); |
| 2462 | } |
| 2463 | // Reads in weapon battery info |
| 2464 | void mng_ReadWeaponBatteryChunkcxx . . $ mng_ReadWeaponBatteryChunk(14ef5bf56b093803).(otype_wb_infocxx . . $ otype_wb_info# *static_wb, CFILEcxx . . $ CFILE# *infile, int version) { |
| 2465 | int j; |
| 2466 | |
| 2467 | static_wb->energy_usagecxx . . $ otype_wb_info#energy_usage. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile); |
| 2468 | static_wb->ammo_usagecxx . . $ otype_wb_info#ammo_usage. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile); |
| 2469 | |
| 2470 | for (j = 0; j < MAX_WB_GUNPOINTScxx . . $ `lib/robotfirestruct_external.h:22:9`!; j++) { |
| 2471 | static_wb->gp_weapon_indexcxx . . $ otype_wb_info#gp_weapon_index.[j] = cf_ReadShortcxx . . $ cf_ReadShort(30b00389b433b379).(infile); |
| 2472 | } |
| 2473 | |
| 2474 | for (j = 0; j < MAX_WB_FIRING_MASKScxx . . $ `lib/robotfirestruct_external.h:23:9`!; j++) { |
| 2475 | static_wb->gp_fire_maskscxx . . $ otype_wb_info#gp_fire_masks.[j] = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile); |
| 2476 | static_wb->gp_fire_waitcxx . . $ otype_wb_info#gp_fire_wait.[j] = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile); |
| 2477 | static_wb->anim_timecxx . . $ otype_wb_info#anim_time.[j] = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile); |
| 2478 | static_wb->anim_start_framecxx . . $ otype_wb_info#anim_start_frame.[j] = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile); |
| 2479 | static_wb->anim_fire_framecxx . . $ otype_wb_info#anim_fire_frame.[j] = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile); |
| 2480 | static_wb->anim_end_framecxx . . $ otype_wb_info#anim_end_frame.[j] = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile); |
| 2481 | } |
| 2482 | static_wb->num_maskscxx . . $ otype_wb_info#num_masks. = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile); |
| 2483 | static_wb->aiming_gp_indexcxx . . $ otype_wb_info#aiming_gp_index. = cf_ReadShortcxx . . $ cf_ReadShort(30b00389b433b379).(infile); |
| 2484 | static_wb->aiming_flagscxx . . $ otype_wb_info#aiming_flags. = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile); |
| 2485 | static_wb->aiming_3d_dotcxx . . $ otype_wb_info#aiming_3d_dot. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile); |
| 2486 | static_wb->aiming_3d_distcxx . . $ otype_wb_info#aiming_3d_dist. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile); |
| 2487 | static_wb->aiming_XZ_dotcxx . . $ otype_wb_info#aiming_XZ_dot. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile); |
| 2488 | if (version >= 2) |
| 2489 | static_wb->flagscxx . . $ otype_wb_info#flags. = cf_ReadShortcxx . . $ cf_ReadShort(30b00389b433b379).(infile); |
| 2490 | else |
| 2491 | static_wb->flagscxx . . $ otype_wb_info#flags. = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile); |
| 2492 | static_wb->gp_quad_fire_maskcxx . . $ otype_wb_info#gp_quad_fire_mask. = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile); |
| 2493 | } |
| 2494 | // Writes a lighting chunk in from an open file |
| 2495 | void mng_WriteLightingChunkcxx . . $ mng_WriteLightingChunk(6f2d036b5b312dd3).(light_infocxx . . $ light_info# *lighting_info, CFILEcxx . . $ CFILE# *outfile) { |
| 2496 | cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, lighting_info->light_distancecxx . . $ light_info#light_distance.); |
| 2497 | cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, lighting_info->red_light1cxx . . $ light_info#red_light1.); |
| 2498 | cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, lighting_info->green_light1cxx . . $ light_info#green_light1.); |
| 2499 | cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, lighting_info->blue_light1cxx . . $ light_info#blue_light1.); |
| 2500 | cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, lighting_info->time_intervalcxx . . $ light_info#time_interval.); |
| 2501 | cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, lighting_info->flicker_distancecxx . . $ light_info#flicker_distance.); |
| 2502 | cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, lighting_info->directional_dotcxx . . $ light_info#directional_dot.); |
| 2503 | cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, lighting_info->red_light2cxx . . $ light_info#red_light2.); |
| 2504 | cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, lighting_info->green_light2cxx . . $ light_info#green_light2.); |
| 2505 | cf_WriteFloatcxx . . $ cf_WriteFloat(c51c6cf5f6d5270c).(outfile, lighting_info->blue_light2cxx . . $ light_info#blue_light2.); |
| 2506 | cf_WriteIntcxx . . $ cf_WriteInt(966989f25543eb13).(outfile, lighting_info->flagscxx . . $ light_info#flags.); |
| 2507 | cf_WriteIntcxx . . $ cf_WriteInt(966989f25543eb13).(outfile, lighting_info->timebitscxx . . $ light_info#timebits.); |
| 2508 | cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, lighting_info->anglecxx . . $ light_info#angle.); |
| 2509 | cf_WriteBytecxx . . $ cf_WriteByte(17377ebd5835367f).(outfile, lighting_info->lighting_render_typecxx . . $ light_info#lighting_render_type.); |
| 2510 | } |
| 2511 | // Reads a lighting chunk in from an open file |
| 2512 | void mng_ReadLightingChunkcxx . . $ mng_ReadLightingChunk(6f2d036b5b312dd3).(light_infocxx . . $ light_info# *lighting_info, CFILEcxx . . $ CFILE# *infile) { |
| 2513 | lighting_info->light_distancecxx . . $ light_info#light_distance. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile); |
| 2514 | lighting_info->red_light1cxx . . $ light_info#red_light1. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile); |
| 2515 | lighting_info->green_light1cxx . . $ light_info#green_light1. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile); |
| 2516 | lighting_info->blue_light1cxx . . $ light_info#blue_light1. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile); |
| 2517 | lighting_info->time_intervalcxx . . $ light_info#time_interval. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile); |
| 2518 | lighting_info->flicker_distancecxx . . $ light_info#flicker_distance. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile); |
| 2519 | lighting_info->directional_dotcxx . . $ light_info#directional_dot. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile); |
| 2520 | lighting_info->red_light2cxx . . $ light_info#red_light2. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile); |
| 2521 | lighting_info->green_light2cxx . . $ light_info#green_light2. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile); |
| 2522 | lighting_info->blue_light2cxx . . $ light_info#blue_light2. = cf_ReadFloatcxx . . $ cf_ReadFloat(9a03a00aead0d542).(infile); |
| 2523 | lighting_info->flagscxx . . $ light_info#flags. = cf_ReadIntcxx . . $ cf_ReadInt(d60d6f5e30f0c96a).(infile); |
| 2524 | lighting_info->timebitscxx . . $ light_info#timebits. = cf_ReadIntcxx . . $ cf_ReadInt(d60d6f5e30f0c96a).(infile); |
| 2525 | lighting_info->anglecxx . . $ light_info#angle. = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile); |
| 2526 | lighting_info->lighting_render_typecxx . . $ light_info#lighting_render_type. = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile); |
| 2527 | } |
| 2528 | |
| 2529 | // Record keeping |
| 2530 | AddOnTablefilecxx . . $ AddOnTablefile# AddOnDataTablescxx . . $ AddOnDataTables.[MAX_ADDON_TABLEScxx . . $ `lib/manage.h:78:9`!]; |
| 2531 | |
| 2532 | // the number of addon tables currently in memory |
| 2533 | int Num_addon_tablescxx . . $ Num_addon_tables. = 0; |
| 2534 | |
| 2535 | // if not -1, then it is the addon table we are working with |
| 2536 | int Loading_addon_tablecxx . . $ Loading_addon_table. = -1; |
| 2537 | |
| 2538 | //---------------------- |
| 2539 | // Add-on data routines |
| 2540 | //---------------------- |
| 2541 | // Frees all the primitives associated with an page |
| 2542 | void mng_FreePagetypePrimitivescxx . . $ mng_FreePagetypePrimitives(99469d7ff9a1485a).(int pagetype, char *name, int freetype) { |
| 2543 | int n; |
| 2544 | switch (pagetype) { |
| 2545 | case PAGETYPE_TEXTUREcxx . . $ `lib/manage.h:49:9`!: |
| 2546 | n = FindTextureNamecxx . . $ FindTextureName(5c4306d8553b3696).(name); |
| 2547 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(n >= 0); |
| 2548 | if (GameTexturescxx . . $ GameTextures.[n].flagscxx . . $ texture#flags. & TF_ANIMATEDcxx . . $ `Descent3/gametexture.h:207:9`!) |
| 2549 | FreeVClipcxx . . $ FreeVClip(d4f767463ce0a6b3).(GameTexturescxx . . $ GameTextures.[n].bm_handlecxx . . $ texture#bm_handle.); |
| 2550 | else |
| 2551 | bm_FreeBitmapcxx . . $ bm_FreeBitmap(d4f767463ce0a6b3).(GameTexturescxx . . $ GameTextures.[n].bm_handlecxx . . $ texture#bm_handle.); |
| 2552 | if (GameTexturescxx . . $ GameTextures.[n].flagscxx . . $ texture#flags. & TF_DESTROYABLEcxx . . $ `Descent3/gametexture.h:208:9`! && GameTexturescxx . . $ GameTextures.[n].destroy_handlecxx . . $ texture#destroy_handle. >= 0 && |
| 2553 | GameTexturescxx . . $ GameTextures.[n].destroy_handlecxx . . $ texture#destroy_handle. != n) { |
| 2554 | int oldn = n; |
| 2555 | n = GameTexturescxx . . $ GameTextures.[n].destroy_handlecxx . . $ texture#destroy_handle.; |
| 2556 | if (GameTexturescxx . . $ GameTextures.[n].flagscxx . . $ texture#flags. & TF_ANIMATEDcxx . . $ `Descent3/gametexture.h:207:9`!) |
| 2557 | FreeVClipcxx . . $ FreeVClip(d4f767463ce0a6b3).(GameTexturescxx . . $ GameTextures.[n].bm_handlecxx . . $ texture#bm_handle.); |
| 2558 | else |
| 2559 | bm_FreeBitmapcxx . . $ bm_FreeBitmap(d4f767463ce0a6b3).(GameTexturescxx . . $ GameTextures.[n].bm_handlecxx . . $ texture#bm_handle.); |
| 2560 | n = oldn; |
| 2561 | } |
| 2562 | if (freetype) |
| 2563 | FreeTexturecxx . . $ FreeTexture(d4f767463ce0a6b3).(n); |
| 2564 | |
| 2565 | break; |
| 2566 | case PAGETYPE_SOUNDcxx . . $ `lib/manage.h:55:9`!: |
| 2567 | n = FindSoundNamecxx . . $ FindSoundName(5c4306d8553b3696).(name); |
| 2568 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(n >= 0); |
| 2569 | FreeSoundFilecxx . . $ FreeSoundFile(d4f767463ce0a6b3).(Soundscxx . . $ Sounds.[n].sample_indexcxx . . $ sound_info#sample_index.); |
| 2570 | if (freetype) |
| 2571 | FreeSoundcxx . . $ FreeSound(d4f767463ce0a6b3).(n); |
| 2572 | break; |
| 2573 | case PAGETYPE_WEAPONcxx . . $ `lib/manage.h:50:9`!: |
| 2574 | n = FindWeaponNamecxx . . $ FindWeaponName(5c4306d8553b3696).(name); |
| 2575 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(n >= 0); |
| 2576 | // Free weapon images |
| 2577 | if (Weaponscxx . . $ Weapons.[n].flagscxx . . $ weapon#flags. & WF_HUD_ANIMATEDcxx . . $ `Descent3/weapon.h:218:9`!) |
| 2578 | FreeVClipcxx . . $ FreeVClip(d4f767463ce0a6b3).(Weaponscxx . . $ Weapons.[n].hud_image_handlecxx . . $ weapon#hud_image_handle.); |
| 2579 | else |
| 2580 | bm_FreeBitmapcxx . . $ bm_FreeBitmap(d4f767463ce0a6b3).(Weaponscxx . . $ Weapons.[n].hud_image_handlecxx . . $ weapon#hud_image_handle.); |
| 2581 | if (Weaponscxx . . $ Weapons.[n].fire_image_handlecxx . . $ weapon#fire_image_handle. != -1) { |
| 2582 | if (Weaponscxx . . $ Weapons.[n].flagscxx . . $ weapon#flags. & WF_IMAGE_BITMAPcxx . . $ `Descent3/weapon.h:219:9`!) |
| 2583 | bm_FreeBitmapcxx . . $ bm_FreeBitmap(d4f767463ce0a6b3).(Weaponscxx . . $ Weapons.[n].fire_image_handlecxx . . $ weapon#fire_image_handle.); |
| 2584 | else if (Weaponscxx . . $ Weapons.[n].flagscxx . . $ weapon#flags. & WF_IMAGE_VCLIPcxx . . $ `Descent3/weapon.h:223:9`!) |
| 2585 | FreeVClipcxx . . $ FreeVClip(d4f767463ce0a6b3).(Weaponscxx . . $ Weapons.[n].fire_image_handlecxx . . $ weapon#fire_image_handle.); |
| 2586 | else |
| 2587 | FreePolyModelcxx . . $ FreePolyModel(d4f767463ce0a6b3).(Weaponscxx . . $ Weapons.[n].fire_image_handlecxx . . $ weapon#fire_image_handle.); |
| 2588 | } |
| 2589 | if (freetype) |
| 2590 | FreeWeaponcxx . . $ FreeWeapon(d4f767463ce0a6b3).(n); |
| 2591 | break; |
| 2592 | case PAGETYPE_SHIPcxx . . $ `lib/manage.h:54:9`!: |
| 2593 | n = FindShipNamecxx . . $ FindShipName(5c4306d8553b3696).(name); |
| 2594 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(n >= 0); |
| 2595 | FreePolyModelcxx . . $ FreePolyModel(d4f767463ce0a6b3).(Shipscxx . . $ Ships.[n].model_handlecxx . . $ ship#model_handle.); |
| 2596 | if (Shipscxx . . $ Ships.[n].dying_model_handlecxx . . $ ship#dying_model_handle. != -1) |
| 2597 | FreePolyModelcxx . . $ FreePolyModel(d4f767463ce0a6b3).(Shipscxx . . $ Ships.[n].dying_model_handlecxx . . $ ship#dying_model_handle.); |
| 2598 | if (Shipscxx . . $ Ships.[n].med_render_handlecxx . . $ ship#med_render_handle. != -1) |
| 2599 | FreePolyModelcxx . . $ FreePolyModel(d4f767463ce0a6b3).(Shipscxx . . $ Ships.[n].med_render_handlecxx . . $ ship#med_render_handle.); |
| 2600 | if (Shipscxx . . $ Ships.[n].lo_render_handlecxx . . $ ship#lo_render_handle. != -1) |
| 2601 | FreePolyModelcxx . . $ FreePolyModel(d4f767463ce0a6b3).(Shipscxx . . $ Ships.[n].lo_render_handlecxx . . $ ship#lo_render_handle.); |
| 2602 | if (freetype) |
| 2603 | FreeShipcxx . . $ FreeShip(d4f767463ce0a6b3).(n); |
| 2604 | break; |
| 2605 | case PAGETYPE_GENERICcxx . . $ `lib/manage.h:58:9`!: |
| 2606 | n = FindObjectIDNamecxx . . $ FindObjectIDName(5c4306d8553b3696).(name); |
| 2607 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(n >= 0); |
| 2608 | |
| 2609 | FreePolyModelcxx . . $ FreePolyModel(d4f767463ce0a6b3).(Object_infocxx . . $ Object_info.[n].render_handlecxx . . $ object_info#render_handle.); |
| 2610 | if (Object_infocxx . . $ Object_info.[n].med_render_handlecxx . . $ object_info#med_render_handle. != -1) |
| 2611 | FreePolyModelcxx . . $ FreePolyModel(d4f767463ce0a6b3).(Object_infocxx . . $ Object_info.[n].med_render_handlecxx . . $ object_info#med_render_handle.); |
| 2612 | if (Object_infocxx . . $ Object_info.[n].lo_render_handlecxx . . $ object_info#lo_render_handle. != -1) |
| 2613 | FreePolyModelcxx . . $ FreePolyModel(d4f767463ce0a6b3).(Object_infocxx . . $ Object_info.[n].lo_render_handlecxx . . $ object_info#lo_render_handle.); |
| 2614 | if (freetype) |
| 2615 | FreeObjectIDcxx . . $ FreeObjectID(d4f767463ce0a6b3).(n); |
| 2616 | break; |
| 2617 | case PAGETYPE_DOORcxx . . $ `lib/manage.h:53:9`!: |
| 2618 | n = FindDoorNamecxx . . $ FindDoorName(5c4306d8553b3696).(name); |
| 2619 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(n >= 0); |
| 2620 | FreePolyModelcxx . . $ FreePolyModel(d4f767463ce0a6b3).(Doorscxx . . $ Doors.[n].model_handlecxx . . $ door#model_handle.); |
| 2621 | if (freetype) |
| 2622 | FreeDoorcxx . . $ FreeDoor(d4f767463ce0a6b3).(n); |
| 2623 | break; |
| 2624 | default: |
| 2625 | break; |
| 2626 | } |
| 2627 | } |
| 2628 | // Takes our addon pages and frees/restores our data to the appropriate pages |
| 2629 | void mng_PopAddonPagescxx . . $ mng_PopAddonPages(49f6e7a06ebc5aa8).() { |
| 2630 | int i, n, ok; |
| 2631 | |
| 2632 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(Num_addon_tables > 0); |
| 2633 | if (Num_addon_tablescxx . . $ Num_addon_tables. <= 0) |
| 2634 | return; // no addon pages to pop off |
| 2635 | |
| 2636 | Num_addon_tablescxx . . $ Num_addon_tables.--; |
| 2637 | Loading_localscxx . . $ Loading_locals. = 0; |
| 2638 | AddOnTablefilecxx . . $ AddOnTablefile# *addondata = &AddOnDataTablescxx . . $ AddOnDataTables.[Num_addon_tablescxx . . $ Num_addon_tables.]; |
| 2639 | |
| 2640 | for (i = 0; i < addondata->Num_addon_tracklockscxx . . $ AddOnTablefile#Num_addon_tracklocks.; i++) { |
| 2641 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Freeing addon page %s [%s].\n", addondata->Addon_tracklocks[i].name, addondata->AddOnTableFilename); |
| 2642 | |
| 2643 | // set the Loading_addon_table to the appropriate value... |
| 2644 | // it depends on if we are overlaying from a previous tablefile |
| 2645 | // or this isn't an overlay at all |
| 2646 | // overlay = 0 (not an overlay of anything) |
| 2647 | // overlay = 1 (overlay of main tablefile) |
| 2648 | // overlay > 1 (overlay of addon table [overlay-2]) |
| 2649 | if (addondata->Addon_tracklockscxx . . $ AddOnTablefile#Addon_tracklocks.[i].overlaycxx . . $ mngs_track_lock#overlay. > 1) { |
| 2650 | // this is an overlay of another table file |
| 2651 | Loading_addon_tablecxx . . $ Loading_addon_table. = addondata->Addon_tracklockscxx . . $ AddOnTablefile#Addon_tracklocks.[i].overlaycxx . . $ mngs_track_lock#overlay. - 2; |
| 2652 | } else { |
| 2653 | // this is an overlay of the main table file |
| 2654 | // or not an overlay at all |
| 2655 | Loading_addon_tablecxx . . $ Loading_addon_table. = -1; |
| 2656 | } |
| 2657 | |
| 2658 | if (addondata->Addon_tracklockscxx . . $ AddOnTablefile#Addon_tracklocks.[i].overlaycxx . . $ mngs_track_lock#overlay. > 0) { |
| 2659 | // Free this data, then read the old stuff back in |
| 2660 | mng_FreePagetypePrimitivescxx . . $ mng_FreePagetypePrimitives(99469d7ff9a1485a).(addondata->Addon_tracklockscxx . . $ AddOnTablefile#Addon_tracklocks.[i].pagetypecxx . . $ mngs_track_lock#pagetype., addondata->Addon_tracklockscxx . . $ AddOnTablefile#Addon_tracklocks.[i].namecxx . . $ mngs_track_lock#name., 0); |
| 2661 | char *name = addondata->Addon_tracklockscxx . . $ AddOnTablefile#Addon_tracklocks.[i].namecxx . . $ mngs_track_lock#name.; |
| 2662 | switch (addondata->Addon_tracklockscxx . . $ AddOnTablefile#Addon_tracklocks.[i].pagetypecxx . . $ mngs_track_lock#pagetype.) { |
| 2663 | case PAGETYPE_TEXTUREcxx . . $ `lib/manage.h:49:9`!: { |
| 2664 | n = FindTextureNamecxx . . $ FindTextureName(5c4306d8553b3696).(name); |
| 2665 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(n >= 0); |
| 2666 | ok = mng_FindSpecificTexPagecxx . . $ mng_FindSpecificTexPage(c515c31a8f24d4fa).(name, &texpagecxx . . $ texpage., addondata->Addon_tracklockscxx . . $ AddOnTablefile#Addon_tracklocks.[i].stack_fileposcxx . . $ mngs_track_lock#stack_filepos.); |
| 2667 | if (ok) { |
| 2668 | ok = mng_AssignTexPageToTexturecxx . . $ mng_AssignTexPageToTexture(728768d0b263a36e).(&texpagecxx . . $ texpage., n); |
| 2669 | if (!ok) |
| 2670 | Errorcxx . . $ Error(326aeb464d16410c).("Error 1 restoring page %s from addon data!", name); |
| 2671 | } else |
| 2672 | Errorcxx . . $ Error(326aeb464d16410c).("Error 2 restoring page %s from addon data!", name); |
| 2673 | break; |
| 2674 | } |
| 2675 | case PAGETYPE_SOUNDcxx . . $ `lib/manage.h:55:9`!: { |
| 2676 | n = FindSoundNamecxx . . $ FindSoundName(5c4306d8553b3696).(name); |
| 2677 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(n >= 0); |
| 2678 | ok = mng_FindSpecificSoundPagecxx . . $ mng_FindSpecificSoundPage(c64564f188fd7954).(name, &soundpagecxx . . $ soundpage., addondata->Addon_tracklockscxx . . $ AddOnTablefile#Addon_tracklocks.[i].stack_fileposcxx . . $ mngs_track_lock#stack_filepos.); |
| 2679 | if (ok) { |
| 2680 | ok = mng_AssignSoundPageToSoundcxx . . $ mng_AssignSoundPageToSound(cdeba9935b75dec1).(&soundpagecxx . . $ soundpage., n); |
| 2681 | if (!ok) |
| 2682 | Errorcxx . . $ Error(326aeb464d16410c).("Error 1 restoring page %s from addon data!", name); |
| 2683 | } else |
| 2684 | Errorcxx . . $ Error(326aeb464d16410c).("Error 2 restoring page %s from addon data!", name); |
| 2685 | break; |
| 2686 | } |
| 2687 | case PAGETYPE_DOORcxx . . $ `lib/manage.h:53:9`!: { |
| 2688 | n = FindDoorNamecxx . . $ FindDoorName(5c4306d8553b3696).(name); |
| 2689 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(n >= 0); |
| 2690 | ok = mng_FindSpecificDoorPagecxx . . $ mng_FindSpecificDoorPage(bd14268a190b7548).(name, &doorpagecxx . . $ doorpage., addondata->Addon_tracklockscxx . . $ AddOnTablefile#Addon_tracklocks.[i].stack_fileposcxx . . $ mngs_track_lock#stack_filepos.); |
| 2691 | if (ok) { |
| 2692 | ok = mng_AssignDoorPageToDoorcxx . . $ mng_AssignDoorPageToDoor(b7d58baade482006).(&doorpagecxx . . $ doorpage., n); |
| 2693 | if (!ok) |
| 2694 | Errorcxx . . $ Error(326aeb464d16410c).("Error 1 restoring page %s from addon data!", name); |
| 2695 | } else |
| 2696 | Errorcxx . . $ Error(326aeb464d16410c).("Error 2 restoring page %s from addon data!", name); |
| 2697 | break; |
| 2698 | } |
| 2699 | case PAGETYPE_GENERICcxx . . $ `lib/manage.h:58:9`!: { |
| 2700 | n = FindObjectIDNamecxx . . $ FindObjectIDName(5c4306d8553b3696).(name); |
| 2701 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(n >= 0); |
| 2702 | ok = mng_FindSpecificGenericPagecxx . . $ mng_FindSpecificGenericPage(158cbe609199a065).(name, &genericpagecxx . . $ genericpage., addondata->Addon_tracklockscxx . . $ AddOnTablefile#Addon_tracklocks.[i].stack_fileposcxx . . $ mngs_track_lock#stack_filepos.); |
| 2703 | if (ok) { |
| 2704 | ok = mng_AssignGenericPageToObjInfocxx . . $ mng_AssignGenericPageToObjInfo(3644dbb5e8d55c40).(&genericpagecxx . . $ genericpage., n); |
| 2705 | if (!ok) |
| 2706 | Errorcxx . . $ Error(326aeb464d16410c).("Error 1 restoring page %s from addon data!", name); |
| 2707 | } else |
| 2708 | Errorcxx . . $ Error(326aeb464d16410c).("Error 2 restoring page %s from addon data!", name); |
| 2709 | break; |
| 2710 | } |
| 2711 | case PAGETYPE_SHIPcxx . . $ `lib/manage.h:54:9`!: { |
| 2712 | n = FindShipNamecxx . . $ FindShipName(5c4306d8553b3696).(name); |
| 2713 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(n >= 0); |
| 2714 | ok = mng_FindSpecificShipPagecxx . . $ mng_FindSpecificShipPage(e928a488c1cbedd4).(name, &shippagecxx . . $ shippage., addondata->Addon_tracklockscxx . . $ AddOnTablefile#Addon_tracklocks.[i].stack_fileposcxx . . $ mngs_track_lock#stack_filepos.); |
| 2715 | if (ok) { |
| 2716 | ok = mng_AssignShipPageToShipcxx . . $ mng_AssignShipPageToShip(9d5a2a40285cb110).(&shippagecxx . . $ shippage., n); |
| 2717 | if (!ok) |
| 2718 | Errorcxx . . $ Error(326aeb464d16410c).("Error 1 restoring page %s from addon data!", name); |
| 2719 | } else |
| 2720 | Errorcxx . . $ Error(326aeb464d16410c).("Error 2 restoring page %s from addon data!", name); |
| 2721 | break; |
| 2722 | } |
| 2723 | case PAGETYPE_WEAPONcxx . . $ `lib/manage.h:50:9`!: { |
| 2724 | n = FindWeaponNamecxx . . $ FindWeaponName(5c4306d8553b3696).(name); |
| 2725 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(n >= 0); |
| 2726 | ok = mng_FindSpecificWeaponPagecxx . . $ mng_FindSpecificWeaponPage(9bcb3fffd810bcc3).(name, &weaponpagecxx . . $ weaponpage., addondata->Addon_tracklockscxx . . $ AddOnTablefile#Addon_tracklocks.[i].stack_fileposcxx . . $ mngs_track_lock#stack_filepos.); |
| 2727 | if (ok) { |
| 2728 | ok = mng_AssignWeaponPageToWeaponcxx . . $ mng_AssignWeaponPageToWeapon(df9c7c9906e0e14e).(&weaponpagecxx . . $ weaponpage., n); |
| 2729 | if (!ok) |
| 2730 | Errorcxx . . $ Error(326aeb464d16410c).("Error 1 restoring page %s from addon data!", name); |
| 2731 | } else |
| 2732 | Errorcxx . . $ Error(326aeb464d16410c).("Error 2 restoring page %s from addon data!", name); |
| 2733 | break; |
| 2734 | } |
| 2735 | case PAGETYPE_GAMEFILEcxx . . $ `lib/manage.h:57:9`!: |
| 2736 | // I don't think there's anything we need to do here |
| 2737 | break; |
| 2738 | default: |
| 2739 | Int3cxx . . $ `misc/pserror.h:247:9`!(); // bad type in list? Get Jason |
| 2740 | break; |
| 2741 | } |
| 2742 | |
| 2743 | } else { |
| 2744 | // Not overlay, just free this data |
| 2745 | mng_FreePagetypePrimitivescxx . . $ mng_FreePagetypePrimitives(99469d7ff9a1485a).(addondata->Addon_tracklockscxx . . $ AddOnTablefile#Addon_tracklocks.[i].pagetypecxx . . $ mngs_track_lock#pagetype., addondata->Addon_tracklockscxx . . $ AddOnTablefile#Addon_tracklocks.[i].namecxx . . $ mngs_track_lock#name., 1); |
| 2746 | } |
| 2747 | } |
| 2748 | |
| 2749 | Loading_addon_tablecxx . . $ Loading_addon_table. = -1; |
| 2750 | } |
| 2751 | // Simply sets no addon data to be loaded |
| 2752 | void mng_ClearAddonTablescxx . . $ mng_ClearAddonTables(49f6e7a06ebc5aa8).() { |
| 2753 | int count = Num_addon_tablescxx . . $ Num_addon_tables.; |
| 2754 | while (count > 0) { |
| 2755 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(count == Num_addon_tables); |
| 2756 | |
| 2757 | if (AddOnDataTablescxx . . $ AddOnDataTables.[count - 1].Addon_tracklockscxx . . $ AddOnTablefile#Addon_tracklocks.) { |
| 2758 | mng_PopAddonPagescxx . . $ mng_PopAddonPages(49f6e7a06ebc5aa8).(); |
| 2759 | mem_freecxx . . $ `mem/mem.h:80:9`!(AddOnDataTables[count - 1].Addon_tracklocks); |
| 2760 | AddOnDataTablescxx . . $ AddOnDataTables.[count - 1].Addon_tracklockscxx . . $ AddOnTablefile#Addon_tracklocks. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 2761 | AddOnDataTablescxx . . $ AddOnDataTables.[count - 1].Num_addon_tracklockscxx . . $ AddOnTablefile#Num_addon_tracklocks. = 0; |
| 2762 | } |
| 2763 | |
| 2764 | count--; |
| 2765 | } |
| 2766 | } |
| 2767 | // Push the given table file as an addon table file |
| 2768 | // returns true on success |
| 2769 | bool mng_SetAddonTablecxx . . $ mng_SetAddonTable(c6b7e35ff6de5671).(char *name) { |
| 2770 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(Num_addon_tables < MAX_ADDON_TABLEScxx . . $ `lib/manage.h:78:9`!); |
| 2771 | if (Num_addon_tablescxx . . $ Num_addon_tables. >= MAX_ADDON_TABLEScxx . . $ `lib/manage.h:78:9`!) |
| 2772 | return false; |
| 2773 | |
| 2774 | // make sure the table file exists! |
| 2775 | if (!cfexistcxx . . $ cfexist(293b0826c8d9cb54).(namecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).)) |
| 2776 | return false; |
| 2777 | |
| 2778 | strcpy(AddOnDataTablescxx . . $ AddOnDataTables.[Num_addon_tablescxx . . $ Num_addon_tables.].AddOnTableFilenamecxx . . $ AddOnTablefile#AddOnTableFilename., name); |
| 2779 | AddOnDataTablescxx . . $ AddOnDataTables.[Num_addon_tablescxx . . $ Num_addon_tables.].Addon_tracklockscxx . . $ AddOnTablefile#Addon_tracklocks. = |
| 2780 | (mngs_track_lockcxx . . $ mngs_track_lock# *)mem_malloccxx . . $ `mem/mem.h:79:9`!(MAX_ADDON_TRACKLOCKScxx . . $ `lib/manage.h:77:9`! * sizeof(mngs_track_lock)); |
| 2781 | AddOnDataTablescxx . . $ AddOnDataTables.[Num_addon_tablescxx . . $ Num_addon_tables.].Num_addon_tracklockscxx . . $ AddOnTablefile#Num_addon_tracklocks. = 0; |
| 2782 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(AddOnDataTables[Num_addon_tables].Addon_tracklocks); |
| 2783 | memset(AddOnDataTablescxx . . $ AddOnDataTables.[Num_addon_tablescxx . . $ Num_addon_tables.].Addon_tracklockscxx . . $ AddOnTablefile#Addon_tracklocks., 0, MAX_ADDON_TRACKLOCKScxx . . $ `lib/manage.h:77:9`! * sizeof(mngs_track_lockcxx . . $ mngs_track_lock#)); |
| 2784 | |
| 2785 | Num_addon_tablescxx . . $ Num_addon_tables.++; |
| 2786 | return true; |
| 2787 | } |
| 2788 | |
| 2789 | // Pushes an addon pack onto the stack so we can keep track of it |
| 2790 | void mng_PushAddonPagecxx . . $ mng_PushAddonPage(99469d7ff9a1485a).(int pagetype, char *name, int overlay) { |
| 2791 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(Loading_addon_table >= 0 && Loading_addon_table < MAX_ADDON_TABLEScxx . . $ `lib/manage.h:78:9`!); |
| 2792 | |
| 2793 | AddOnTablefilecxx . . $ AddOnTablefile# *addon = &AddOnDataTablescxx . . $ AddOnDataTables.[Loading_addon_tablecxx . . $ Loading_addon_table.]; |
| 2794 | |
| 2795 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(addon->Num_addon_tracklocks < MAX_ADDON_TRACKLOCKScxx . . $ `lib/manage.h:77:9`!); |
| 2796 | |
| 2797 | // First check to see if this is a redundant page |
| 2798 | for (int i = 0; i < addon->Num_addon_tracklockscxx . . $ AddOnTablefile#Num_addon_tracklocks.; i++) { |
| 2799 | if (addon->Addon_tracklockscxx . . $ AddOnTablefile#Addon_tracklocks.[i].usedcxx . . $ mngs_track_lock#used. && addon->Addon_tracklockscxx . . $ AddOnTablefile#Addon_tracklocks.[i].pagetypecxx . . $ mngs_track_lock#pagetype. == pagetype) { |
| 2800 | if (!stricmpcxx . . $ `linux/linux_fix.h:43:9`!(addon->Addon_tracklocks[i].name, name)) { |
| 2801 | Int3cxx . . $ `misc/pserror.h:247:9`!(); |
| 2802 | Errorcxx . . $ Error(326aeb464d16410c).("Redundant addon page '%s' loaded...", name); |
| 2803 | return; |
| 2804 | } |
| 2805 | } |
| 2806 | } |
| 2807 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Adding addon page %s [%s] to list.\n", name, addon->AddOnTableFilename); |
| 2808 | addon->Addon_tracklockscxx . . $ AddOnTablefile#Addon_tracklocks.[addon->Num_addon_tracklockscxx . . $ AddOnTablefile#Num_addon_tracklocks.].usedcxx . . $ mngs_track_lock#used. = 1; |
| 2809 | addon->Addon_tracklockscxx . . $ AddOnTablefile#Addon_tracklocks.[addon->Num_addon_tracklockscxx . . $ AddOnTablefile#Num_addon_tracklocks.].pagetypecxx . . $ mngs_track_lock#pagetype. = pagetype; |
| 2810 | addon->Addon_tracklockscxx . . $ AddOnTablefile#Addon_tracklocks.[addon->Num_addon_tracklockscxx . . $ AddOnTablefile#Num_addon_tracklocks.].overlaycxx . . $ mngs_track_lock#overlay. = overlay; |
| 2811 | addon->Addon_tracklockscxx . . $ AddOnTablefile#Addon_tracklocks.[addon->Num_addon_tracklockscxx . . $ AddOnTablefile#Num_addon_tracklocks.].stack_fileposcxx . . $ mngs_track_lock#stack_filepos. = 0; |
| 2812 | strcpy(addon->Addon_tracklockscxx . . $ AddOnTablefile#Addon_tracklocks.[addon->Num_addon_tracklockscxx . . $ AddOnTablefile#Num_addon_tracklocks.].namecxx . . $ mngs_track_lock#name., name); |
| 2813 | addon->Num_addon_tracklockscxx . . $ AddOnTablefile#Num_addon_tracklocks.++; |
| 2814 | } |
| 2815 | |
| 2816 | // Compiles the addon pages. By looking at all the addon pages (after they have been |
| 2817 | // loaded) and does some compiling and saving of information to speed up addon page |
| 2818 | // freeing |
| 2819 | void mng_CompileAddonPagescxx . . $ mng_CompileAddonPages(49f6e7a06ebc5aa8).(void) { |
| 2820 | if (Num_addon_tablescxx . . $ Num_addon_tables. <= 0) |
| 2821 | return; // no addon pages to pop off |
| 2822 | |
| 2823 | int curr_tablefile, i, tf, pagetype, len, next_pos, page_pos; |
| 2824 | CFILEcxx . . $ CFILE# *file; |
| 2825 | char pagename[256]; |
| 2826 | bool found_page; |
| 2827 | |
| 2828 | for (curr_tablefile = 1; curr_tablefile <= Num_addon_tablescxx . . $ Num_addon_tables.; curr_tablefile++) { |
| 2829 | // find all the pages that are loaded from this tablefile |
| 2830 | // overlay = 0 (not from any tablefile) |
| 2831 | // overlay = 1 (from main tablefile) |
| 2832 | // overlay > 1 (from addontable[overlay-2] |
| 2833 | if (curr_tablefile == 1) { |
| 2834 | file = cfopencxx . . $ cfopen(7c7b94e455f1ae56).(TableFilenamecxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d)., "rb"); |
| 2835 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Compiling addon pages of %s\n", TableFilename); |
| 2836 | } else { |
| 2837 | file = cfopencxx . . $ cfopen(7c7b94e455f1ae56).(AddOnDataTablescxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).[curr_tablefile - 2].AddOnTableFilenamecxx . . $ AddOnTablefile#AddOnTableFilename., "rb"); |
| 2838 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Compiling addon pages of %s\n", AddOnDataTables[curr_tablefile - 2].AddOnTableFilename); |
| 2839 | } |
| 2840 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(file != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); |
| 2841 | |
| 2842 | // start reading the pages from this tablefile |
| 2843 | // as we come across each page, check to see if it was |
| 2844 | // ever overlayed. |
| 2845 | while (!cfeofcxx . . $ cfeof(413716a422df0036).(file)) { |
| 2846 | // Read in a pagetype. If its a page we recognize, load it |
| 2847 | page_pos = cftellcxx . . $ cftell(65b457210a6528a1).(file); |
| 2848 | pagetype = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(file); |
| 2849 | len = cf_ReadIntcxx . . $ cf_ReadInt(d60d6f5e30f0c96a).(file); |
| 2850 | next_pos = (page_pos + 1) + len; |
| 2851 | |
| 2852 | // get the name of the page |
| 2853 | switch (pagetype) { |
| 2854 | case PAGETYPE_TEXTUREcxx . . $ `lib/manage.h:49:9`!: |
| 2855 | cf_ReadShortcxx . . $ cf_ReadShort(30b00389b433b379).(file); // version |
| 2856 | cf_ReadStringcxx . . $ cf_ReadString(38cd788e4423eff6).(pagename, PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!, file); |
| 2857 | break; |
| 2858 | case PAGETYPE_DOORcxx . . $ `lib/manage.h:53:9`!: |
| 2859 | cf_ReadShortcxx . . $ cf_ReadShort(30b00389b433b379).(file); // version |
| 2860 | cf_ReadStringcxx . . $ cf_ReadString(38cd788e4423eff6).(pagename, PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!, file); |
| 2861 | break; |
| 2862 | case PAGETYPE_GENERICcxx . . $ `lib/manage.h:58:9`!: |
| 2863 | cf_ReadShortcxx . . $ cf_ReadShort(30b00389b433b379).(file); // version |
| 2864 | cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(file); // type |
| 2865 | cf_ReadStringcxx . . $ cf_ReadString(38cd788e4423eff6).(pagename, PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!, file); |
| 2866 | break; |
| 2867 | case PAGETYPE_GAMEFILEcxx . . $ `lib/manage.h:57:9`!: |
| 2868 | cf_ReadShortcxx . . $ cf_ReadShort(30b00389b433b379).(file); // version |
| 2869 | cf_ReadStringcxx . . $ cf_ReadString(38cd788e4423eff6).(pagename, PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!, file); |
| 2870 | break; |
| 2871 | case PAGETYPE_SOUNDcxx . . $ `lib/manage.h:55:9`!: |
| 2872 | cf_ReadShortcxx . . $ cf_ReadShort(30b00389b433b379).(file); // version |
| 2873 | cf_ReadStringcxx . . $ cf_ReadString(38cd788e4423eff6).(pagename, PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!, file); |
| 2874 | break; |
| 2875 | case PAGETYPE_SHIPcxx . . $ `lib/manage.h:54:9`!: |
| 2876 | cf_ReadShortcxx . . $ cf_ReadShort(30b00389b433b379).(file); // version |
| 2877 | cf_ReadStringcxx . . $ cf_ReadString(38cd788e4423eff6).(pagename, PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!, file); |
| 2878 | break; |
| 2879 | case PAGETYPE_WEAPONcxx . . $ `lib/manage.h:50:9`!: |
| 2880 | cf_ReadShortcxx . . $ cf_ReadShort(30b00389b433b379).(file); // version |
| 2881 | cf_ReadStringcxx . . $ cf_ReadString(38cd788e4423eff6).(pagename, PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!, file); |
| 2882 | break; |
| 2883 | case PAGETYPE_UNKNOWNcxx . . $ `lib/manage.h:48:9`!: |
| 2884 | continue; |
| 2885 | break; |
| 2886 | default: |
| 2887 | Int3cxx . . $ `misc/pserror.h:247:9`!(); // Unrecognized pagetype, possible corrupt data following |
| 2888 | break; |
| 2889 | } |
| 2890 | |
| 2891 | // now look for all the places where this page is overlayed |
| 2892 | found_page = false; |
| 2893 | for (tf = 0; tf < Num_addon_tablescxx . . $ Num_addon_tables.; tf++) { |
| 2894 | for (i = 0; i < AddOnDataTablescxx . . $ AddOnDataTables.[tf].Num_addon_tracklockscxx . . $ AddOnTablefile#Num_addon_tracklocks.; i++) { |
| 2895 | if (!AddOnDataTablescxx . . $ AddOnDataTables.[tf].Addon_tracklockscxx . . $ AddOnTablefile#Addon_tracklocks.[i].usedcxx . . $ mngs_track_lock#used.) |
| 2896 | continue; |
| 2897 | if (AddOnDataTablescxx . . $ AddOnDataTables.[tf].Addon_tracklockscxx . . $ AddOnTablefile#Addon_tracklocks.[i].overlaycxx . . $ mngs_track_lock#overlay. != curr_tablefile) |
| 2898 | continue; |
| 2899 | if (AddOnDataTablescxx . . $ AddOnDataTables.[tf].Addon_tracklockscxx . . $ AddOnTablefile#Addon_tracklocks.[i].pagetypecxx . . $ mngs_track_lock#pagetype. != pagetype) |
| 2900 | continue; |
| 2901 | if (stricmpcxx . . $ `linux/linux_fix.h:43:9`!(pagename, AddOnDataTables[tf].Addon_tracklocks[i].name)) |
| 2902 | continue; |
| 2903 | |
| 2904 | // this is it! |
| 2905 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "***Compiling: %s[%s] to %d\n", AddOnDataTables[tf].Addon_tracklocks[i].name, |
| 2906 | (curr_tablefile == 1) ? TableFilename : AddOnDataTables[curr_tablefile - 2].AddOnTableFilename, |
| 2907 | page_pos); |
| 2908 | ASSERTcxx . . $ `misc/pserror.h:246:9`!(AddOnDataTables[tf].Addon_tracklocks[i].stack_filepos == 0); |
| 2909 | AddOnDataTablescxx . . $ AddOnDataTables.[tf].Addon_tracklockscxx . . $ AddOnTablefile#Addon_tracklocks.[i].stack_fileposcxx . . $ mngs_track_lock#stack_filepos. = page_pos; |
| 2910 | found_page = true; |
| 2911 | break; |
| 2912 | } |
| 2913 | |
| 2914 | if (found_page) |
| 2915 | break; |
| 2916 | } |
| 2917 | |
| 2918 | // move on to the next page |
| 2919 | cfseekcxx . . $ cfseek(f9992d249f032805).(file, next_pos, SEEK_SETcxx . . $ `<external>/14710646456994434043/fcntl.h:137:10`!); |
| 2920 | } |
| 2921 | |
| 2922 | // done with this tablefile |
| 2923 | cfclosecxx . . $ cfclose(3639e799710acb68).(file); |
| 2924 | } |
| 2925 | } |
| 2926 | |
| 2927 | // Error checking variables |
| 2928 | bool Loading_addoncxx . . $ Loading_addon. = false; |
| 2929 | int Data_error_countcxx . . $ Data_error_count. = 0; |
| 2930 | FILE *Data_error_filecxx . . $ Data_error_file. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; |
| 2931 | char *Addon_filenamecxx . . $ Addon_filename.; |
| 2932 | |
| 2933 | // Loads and allocs all pages found locally |
| 2934 | void mng_LoadAddonPagescxx . . $ mng_LoadAddonPages(49f6e7a06ebc5aa8).() { |
| 2935 | CFILEcxx . . $ CFILE# *infile; |
| 2936 | uint8_tcxx . . $ uint8_t# pagetype; |
| 2937 | int len; |
| 2938 | |
| 2939 | // Set flag & Clear error count |
| 2940 | Loading_addoncxx . . $ Loading_addon. = true; |
| 2941 | Data_error_countcxx . . $ Data_error_count. = 0; |
| 2942 | |
| 2943 | if (Num_addon_tablescxx . . $ Num_addon_tables. == 0) |
| 2944 | return; // No addons to load |
| 2945 | |
| 2946 | Loading_localscxx . . $ Loading_locals. = 0; |
| 2947 | |
| 2948 | int c; |
| 2949 | AddOnTablefilecxx . . $ AddOnTablefile# *addon; |
| 2950 | |
| 2951 | for (c = 0; c < Num_addon_tablescxx . . $ Num_addon_tables.; c++) { |
| 2952 | addon = &AddOnDataTablescxx . . $ AddOnDataTables.[c]; |
| 2953 | |
| 2954 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "------------------------------------\nLoading addon pages for %s....\n", addon->AddOnTableFilename); |
| 2955 | Addon_filenamecxx . . $ Addon_filename. = addon->AddOnTableFilenamecxx . . $ AddOnTablefile#AddOnTableFilename.; |
| 2956 | infile = cfopencxx . . $ cfopen(7c7b94e455f1ae56).(addoncxx . . $ std/filesystem/__cxx11/path#path(835bc3a16b770d4d).->AddOnTableFilenamecxx . . $ AddOnTablefile#AddOnTableFilename., "rb"); |
| 2957 | if (!infile) { |
| 2958 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "Couldn't addon table file (%s) to read pages!\n", addon->AddOnTableFilename); |
| 2959 | return; |
| 2960 | } |
| 2961 | Loading_addon_tablecxx . . $ Loading_addon_table. = c; |
| 2962 | while (!cfeofcxx . . $ cfeof(413716a422df0036).(infile)) { |
| 2963 | // Read in a pagetype. If its a page we recognize, load it |
| 2964 | pagetype = cf_ReadBytecxx . . $ cf_ReadByte(dcbbf0b0e13758ec).(infile); |
| 2965 | len = cf_ReadIntcxx . . $ cf_ReadInt(d60d6f5e30f0c96a).(infile); |
| 2966 | |
| 2967 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "."); |
| 2968 | switch (pagetype) { |
| 2969 | case PAGETYPE_TEXTUREcxx . . $ `lib/manage.h:49:9`!: |
| 2970 | mng_LoadLocalTexturePagecxx . . $ mng_LoadLocalTexturePage(3639e799710acb68).(infile); |
| 2971 | break; |
| 2972 | case PAGETYPE_POWERUPcxx . . $ `lib/manage.h:52:9`!: |
| 2973 | case PAGETYPE_ROBOTcxx . . $ `lib/manage.h:51:9`!: |
| 2974 | Errorcxx . . $ Error(326aeb464d16410c).("Your local table file is invalid. You must update from the network."); |
| 2975 | break; |
| 2976 | case PAGETYPE_DOORcxx . . $ `lib/manage.h:53:9`!: |
| 2977 | mng_LoadLocalDoorPagecxx . . $ mng_LoadLocalDoorPage(3639e799710acb68).(infile); |
| 2978 | break; |
| 2979 | case PAGETYPE_GENERICcxx . . $ `lib/manage.h:58:9`!: |
| 2980 | mng_LoadLocalGenericPagecxx . . $ mng_LoadLocalGenericPage(3639e799710acb68).(infile); |
| 2981 | break; |
| 2982 | case PAGETYPE_GAMEFILEcxx . . $ `lib/manage.h:57:9`!: |
| 2983 | mng_LoadLocalGamefilePagecxx . . $ mng_LoadLocalGamefilePage(3639e799710acb68).(infile); |
| 2984 | break; |
| 2985 | case PAGETYPE_SOUNDcxx . . $ `lib/manage.h:55:9`!: |
| 2986 | mng_LoadLocalSoundPagecxx . . $ mng_LoadLocalSoundPage(3639e799710acb68).(infile); |
| 2987 | break; |
| 2988 | case PAGETYPE_SHIPcxx . . $ `lib/manage.h:54:9`!: |
| 2989 | mng_LoadLocalShipPagecxx . . $ mng_LoadLocalShipPage(3639e799710acb68).(infile); |
| 2990 | break; |
| 2991 | case PAGETYPE_WEAPONcxx . . $ `lib/manage.h:50:9`!: |
| 2992 | mng_LoadLocalWeaponPagecxx . . $ mng_LoadLocalWeaponPage(3639e799710acb68).(infile); |
| 2993 | break; |
| 2994 | case PAGETYPE_MEGACELLcxx . . $ `lib/manage.h:56:9`!: |
| 2995 | mng_LoadLocalMegacellPagecxx . . $ mng_LoadLocalMegacellPage(3639e799710acb68).(infile); |
| 2996 | break; |
| 2997 | case PAGETYPE_UNKNOWNcxx . . $ `lib/manage.h:48:9`!: |
| 2998 | break; |
| 2999 | default: |
| 3000 | Int3cxx . . $ `misc/pserror.h:247:9`!(); // Unrecognized pagetype, possible corrupt data following |
| 3001 | break; |
| 3002 | } |
| 3003 | } |
| 3004 | mprintfcxx . . $ `ddebug/mono.h:82:9`!(0, "------------------------------------\n"); |
| 3005 | cfclosecxx . . $ cfclose(3639e799710acb68).(infile); |
| 3006 | } |
| 3007 | |
| 3008 | Loading_localscxx . . $ Loading_locals. = 0; |
| 3009 | Loading_addon_tablecxx . . $ Loading_addon_table. = -1; |
| 3010 | |
| 3011 | mng_CompileAddonPagescxx . . $ mng_CompileAddonPages(49f6e7a06ebc5aa8).(); |
| 3012 | |
| 3013 | // Close error file |
| 3014 | if (Data_error_filecxx . . $ Data_error_file. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) { |
| 3015 | fprintf(Data_error_filecxx . . $ Data_error_file., "\nTotal errors: %d", Data_error_countcxx . . $ Data_error_count.); |
| 3016 | fclose(Data_error_filecxx . . $ Data_error_file.); |
| 3017 | } |
| 3018 | |
| 3019 | // Clear flag |
| 3020 | Loading_addoncxx . . $ Loading_addon. = false; |
| 3021 | } |
| 3022 | /* |
| 3023 | #define MAX_256s 200 |
| 3024 | int Num_256s=0; |
| 3025 | char Texture256Names[MAX_256s][80]; |
| 3026 | void Read256TextureNames () |
| 3027 | { |
| 3028 | int n=FindArg ("-File256"); |
| 3029 | if (!n) |
| 3030 | return; |
| 3031 | CFILE *infile; |
| 3032 | infile=(CFILE *)cfopen (GameArgs[n+1],"rt"); |
| 3033 | if (!infile) |
| 3034 | { |
| 3035 | mprintf(0,"Couldn't open 256 file!\n"); |
| 3036 | return; |
| 3037 | } |
| 3038 | |
| 3039 | char curline[200]; |
| 3040 | int done=0; |
| 3041 | while (!done) |
| 3042 | { |
| 3043 | if (cfeof(infile)) |
| 3044 | { |
| 3045 | done=1; |
| 3046 | continue; |
| 3047 | } |
| 3048 | |
| 3049 | // Read a line and parse it |
| 3050 | cf_ReadString (curline,200,infile); |
| 3051 | if (curline[0]==';' || curline[1]==';' || curline[0]==' ' || curline[1]==' ') |
| 3052 | continue; |
| 3053 | if (!(isalnum(curline[0]))) |
| 3054 | continue; |
| 3055 | strcpy (Texture256Names[Num_256s],curline); |
| 3056 | Num_256s++; |
| 3057 | } |
| 3058 | cfclose (infile); |
| 3059 | }*/ |
| 3060 | |
| 3061 | void DataErrorcxx . . $ DataError(326aeb464d16410c).(const char *fmt, ...) { |
| 3062 | // Got a data error! |
| 3063 | // Int3(); |
| 3064 | |
| 3065 | // Ignore this if not loading add-on data |
| 3066 | if (!Loading_addoncxx . . $ Loading_addon.) |
| 3067 | return; |
| 3068 | |
| 3069 | // Increment error count |
| 3070 | Data_error_countcxx . . $ Data_error_count.++; |
| 3071 | |
| 3072 | // Write to file if switch specified |
| 3073 | if (FindArgcxx . . $ FindArg(5c4306d8553b3696).("-datacheck")) { |
| 3074 | static char last_filename[_MAX_PATHcxx . . $ `linux/linux_fix.h:34:9`!]; |
| 3075 | stdcxx . . $ std/::va_listcxx . . $ std/va_list# arglist; |
| 3076 | char buf[1024]; |
| 3077 | |
| 3078 | va_startcxx . . $ `<external>/8105065126723003039/stdarg.h:50:9`!(arglist, fmt); |
| 3079 | stdcxx . . $ std/::vsnprintfcxx . . $ std/vsnprintf(348eb892742d8727).(buf, sizeof(buf), fmt, arglist); |
| 3080 | va_endcxx . . $ `<external>/8105065126723003039/stdarg.h:52:9`!(arglist); |
| 3081 | |
| 3082 | // Open file if not already open |
| 3083 | if (Data_error_filecxx . . $ Data_error_file. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) { |
| 3084 | Data_error_filecxx . . $ Data_error_file. = fopen("datacheck.out", "wt"); |
| 3085 | |
| 3086 | if (Data_error_filecxx . . $ Data_error_file. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!) |
| 3087 | return; |
| 3088 | |
| 3089 | last_filename[0] = 0; |
| 3090 | } |
| 3091 | |
| 3092 | // If this is a new addon file, print the name |
| 3093 | if (strcmp(last_filename, Addon_filenamecxx . . $ Addon_filename.)) { |
| 3094 | if (last_filename[0]) |
| 3095 | fprintf(Data_error_filecxx . . $ Data_error_file., "\n\n"); |
| 3096 | fprintf(Data_error_filecxx . . $ Data_error_file., "Errors in addon file <%s>:\n\n", Addon_filenamecxx . . $ Addon_filename.); |
| 3097 | strcpy(last_filename, Addon_filenamecxx . . $ Addon_filename.); |
| 3098 | } |
| 3099 | |
| 3100 | // Print the message |
| 3101 | fprintf(Data_error_filecxx . . $ Data_error_file., " "); |
| 3102 | fprintf(Data_error_filecxx . . $ Data_error_file., "%s", buf); |
| 3103 | } |
| 3104 | } |