Added and implemented a basic command-line parser.
This replaces the switch-case in HandleCommandLine and HandleCommandLinePostConfigLoad
This commit is contained in:
parent
047f9e7475
commit
fc7460c7d5
5 changed files with 600 additions and 202 deletions
|
|
@ -1166,6 +1166,32 @@ namespace TShockAPI
|
|||
return points;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Dumps information and optionally exits afterwards
|
||||
/// </summary>
|
||||
/// <param name="exit"></param>
|
||||
public void Dump(bool exit = true)
|
||||
{
|
||||
PrepareLangForDump();
|
||||
Lang.setLang(true);
|
||||
ConfigFile.DumpDescriptions();
|
||||
Permissions.DumpDescriptions();
|
||||
ServerSideCharacters.ServerSideConfig.DumpDescriptions();
|
||||
RestManager.DumpDescriptions();
|
||||
DumpBuffs("BuffList.txt");
|
||||
DumpItems("Items-1_0.txt", -48, 235);
|
||||
DumpItems("Items-1_1.txt", 235, 604);
|
||||
DumpItems("Items-1_2.txt", 604, 2749);
|
||||
DumpItems("Items-1_3.txt", 2749, Main.maxItemTypes);
|
||||
DumpNPCs("NPCs.txt");
|
||||
DumpProjectiles("Projectiles.txt");
|
||||
DumpPrefixes("Prefixes.txt");
|
||||
if (exit)
|
||||
{
|
||||
Environment.Exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
internal void PrepareLangForDump()
|
||||
{
|
||||
for(int i = 0; i < Main.recipe.Length; i++)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue