| 339 | |
| 340 | |
| 341 | void FGameConfigFile::DoGameSetup (const char *gamename) |
| 342 | { |
| 343 | const char *key; |
| 344 | const char *value; |
| 345 | |
| 346 | sublen = countof(section) - 1 - mysnprintf (section, countof(section), "%s.", gamename); |
| 347 | subsection = section + countof(section) - sublen - 1; |
| 348 | section[countof(section) - 1] = '\0'; |
| 349 | |
| 350 | strncpy (subsection, "UnknownConsoleVariables", sublen); |
| 351 | if (SetSection (section)) |
| 352 | { |
| 353 | ReadCVars (0); |
| 354 | } |
| 355 | |
| 356 | strncpy (subsection, "ConsoleVariables", sublen); |
| 357 | if (SetSection (section)) |
| 358 | { |
| 359 | ReadCVars (0); |
| 360 | } |
| 361 | |
| 362 | // The NetServerInfo section will be read and override anything loaded |
| 363 | // here when it's determined that a netgame is being played. |
| 364 | strncpy (subsection, "LocalServerInfo", sublen); |
| 365 | if (SetSection (section)) |
| 366 | { |
| 367 | ReadCVars (0); |
| 368 | } |
| 369 | |
| 370 | strncpy (subsection, "Player", sublen); |
| 371 | if (SetSection (section)) |
| 372 | { |
| 373 | ReadCVars (0); |
| 374 | } |
| 375 | strncpy(subsection, "ConsoleAliases", sublen); |
| 376 | if (SetSection(section)) |
| 377 | { |
| 378 | const char* name = NULL; |
| 379 | while (NextInSection(key, value)) |
| 380 | { |
| 381 | if (stricmp(key, "Name") == 0) |
| 382 | { |
| 383 | name = value; |
| 384 | } |
| 385 | else if (stricmp(key, "Command") == 0 && name != NULL) |
| 386 | { |
| 387 | C_SetAlias(name, value); |
| 388 | name = NULL; |
| 389 | } |
| 390 | } |
| 391 | } |
| 392 | } |
| 393 | |
| 394 | // Moved from DoGameSetup so that it can happen after wads are loaded |
| 395 | void FGameConfigFile::DoKeySetup(const char *gamename) |
no test coverage detected