(afc093585) Removed leftover debug message from whitelist

This commit is contained in:
Joonas Rikkonen
2019-06-13 11:46:23 +03:00
parent 40aac0de8f
commit 2b5e828716
2 changed files with 41 additions and 1 deletions

View File

@@ -210,7 +210,6 @@ namespace Barotrauma.Networking
{
ip = "IP concealed by host";
}
DebugConsole.NewMessage("nerd: " + name, Color.Lime);
whitelistedPlayers.Add(new WhiteListedPlayer(name, uniqueIdentifier, ip));
}

View File

@@ -894,6 +894,47 @@ namespace Barotrauma
return configFile;
}
private static IEnumerable<string> characterConfigFiles;
private static IEnumerable<string> CharacterConfigFiles
{
#if SERVER
if (GameMain.Server != null && IsRemotePlayer)
{
if (characterConfigFiles == null)
{
characterConfigFiles = GameMain.Instance.GetFilesOfType(ContentType.Character);
}
return characterConfigFiles;
}
}
/// <summary>
/// Searches for a character config file from all currently selected content packages,
/// or from a specific package if the contentPackage parameter is given.
/// </summary>
public static string GetConfigFile(string speciesName, ContentPackage contentPackage = null)
{
string configFile = null;
if (contentPackage == null)
{
configFile = GameMain.Instance.GetFilesOfType(ContentType.Character)
.FirstOrDefault(c => Path.GetFileName(c).ToLowerInvariant() == $"{speciesName.ToLowerInvariant()}.xml");
}
else
{
configFile = contentPackage.GetFilesOfType(ContentType.Character)?
.FirstOrDefault(c => Path.GetFileName(c).ToLowerInvariant() == $"{speciesName.ToLowerInvariant()}.xml");
}
if (configFile == null)
{
DebugConsole.ThrowError($"Couldn't find a config file for {speciesName} from the selected content packages!");
DebugConsole.ThrowError($"(The config file must end with \"{speciesName}.xml\")");
return string.Empty;
}
return configFile;
}
private static IEnumerable<string> characterConfigFiles;
private static IEnumerable<string> CharacterConfigFiles
{