Skip to content
This repository has been archived by the owner on Nov 4, 2021. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/fixed_new_configuration_generating_npe'
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexMog committed Feb 23, 2021
2 parents ea922d1 + 3e32f6d commit c06ed4c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 2 additions & 0 deletions Longship/Managers/ConfigurationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ public override void Init()
"WARNING: This value WILL allow the server to use more bandwith. So be careful.\n" +
"Info: The value is in bytes (in this configuration, that means that the server is limited " +
"to ~250 Ko/s)");
Configuration.WorldName = _pluginConfigFile.Bind("Server", "WorldName", "Dedicated",
"Name of the world to use");
}
}
}
16 changes: 7 additions & 9 deletions Longship/Patches/PatchServerInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,14 @@ static void PatchZNetAwake(ref int ___m_serverPlayerLimit)
[HarmonyPatch(typeof(FejdStartup), "ParseServerArguments")]
static bool PatchFejdStartupParseServerArguments(FejdStartup __instance, ref bool __result)
{
string[] commandLineArgs = Environment.GetCommandLineArgs();
string name = Longship.Instance.ConfigurationManager.Configuration.WorldName.Value;
for (int index = 0; index < commandLineArgs.Length; ++index)
var commandLineArgs = Environment.GetCommandLineArgs();
var name = Longship.Instance.ConfigurationManager.Configuration.WorldName.Value;
for (var index = 0; index < commandLineArgs.Length; ++index)
{
string str1 = commandLineArgs[index];
if (str1 == "-savedir")
{
Utils.SetSaveDataPath(commandLineArgs[index + 1]);
++index;
}
var str1 = commandLineArgs[index];
if (str1 != "-savedir") continue;
Utils.SetSaveDataPath(commandLineArgs[index + 1]);
++index;
}
var createWorld = World.GetCreateWorld(name);
var password = Longship.Instance.ConfigurationManager.Configuration.ServerPassword.Value;
Expand Down

0 comments on commit c06ed4c

Please sign in to comment.