(e3d158689) Fixed server not saving debug console logs when savedebugconsolelogs is set to true
This commit is contained in:
@@ -90,7 +90,16 @@ namespace Barotrauma
|
||||
while (queuedMessages.Count > 0)
|
||||
{
|
||||
ColoredText msg = queuedMessages.Dequeue();
|
||||
|
||||
if (GameSettings.SaveDebugConsoleLogs)
|
||||
{
|
||||
unsavedMessages.Add(msg);
|
||||
if (unsavedMessages.Count >= messagesPerFile)
|
||||
{
|
||||
SaveLogs();
|
||||
unsavedMessages.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
string msgTxt = msg.Text;
|
||||
|
||||
if (msg.IsCommand) commandMemory.Add(msgTxt);
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -366,13 +366,6 @@ namespace Barotrauma
|
||||
return Name;
|
||||
}
|
||||
|
||||
partial void InitProjSpecific();
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Name;
|
||||
}
|
||||
|
||||
public override MapEntity Clone()
|
||||
{
|
||||
var clone = new Structure(rect, Prefab, Submarine)
|
||||
|
||||
Reference in New Issue
Block a user