adjusts submasters loading to not be so bad

This commit is contained in:
Madpeter 2020-09-06 18:45:49 +01:00
parent e48df2e2aa
commit 5f716e1cfe

View file

@ -80,16 +80,21 @@ namespace BetterSecondBotShared.bottypes
} }
if (helpers.notempty(myconfig.Security_SubMasters) == true) if (helpers.notempty(myconfig.Security_SubMasters) == true)
{ {
string[] master_names = myconfig.Security_SubMasters.Split(",", StringSplitOptions.RemoveEmptyEntries); SubMasters.Clear();
foreach (string a in master_names) string[] submaster_names = myconfig.Security_SubMasters.Split(",", StringSplitOptions.RemoveEmptyEntries);
foreach (string a in submaster_names)
{
if (a.Length > 3)
{ {
bits = a.Split(' ', StringSplitOptions.RemoveEmptyEntries).ToList(); bits = a.Split(' ', StringSplitOptions.RemoveEmptyEntries).ToList();
if (bits.Count == 1) if (bits.Count == 1)
{ {
bits.Add("Resident"); bits.Add("Resident");
} }
SubMasters.Add(String.Join(" ", bits)); string namesubmaster = String.Join(" ", bits);
ConsoleLog.Info("Sub-Master: " + myconfig.Security_MasterUsername); SubMasters.Add(namesubmaster);
ConsoleLog.Info("Sub-Master: " + namesubmaster);
}
} }
} }
ConsoleLog.Info("Build: " + version); ConsoleLog.Info("Build: " + version);