1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 15:20:48 -05:00

game log reader reads async now.

should have done that a long time ago
update profile page to have a bit better space usage
This commit is contained in:
RaidMax
2019-03-09 10:28:04 -06:00
parent 98fba114f5
commit 86bc3a42ac
11 changed files with 110 additions and 114 deletions

View File

@ -8,7 +8,7 @@ namespace SharedLibraryCore.Configuration
public class ServerConfiguration : IBaseConfiguration
{
public string IPAddress { get; set; }
public ushort Port { get; set; }
public int Port { get; set; }
public string Password { get; set; }
public IList<string> Rules { get; set; }
public IList<string> AutoMessages { get; set; }
@ -27,8 +27,15 @@ namespace SharedLibraryCore.Configuration
eventParsers = new List<IEventParser>();
}
public void AddRConParser(IRConParser parser) => rconParsers.Add(parser);
public void AddEventParser(IEventParser parser) => eventParsers.Add(parser);
public void AddRConParser(IRConParser parser)
{
rconParsers.Add(parser);
}
public void AddEventParser(IEventParser parser)
{
eventParsers.Add(parser);
}
public void ModifyParsers()
{
@ -65,26 +72,26 @@ namespace SharedLibraryCore.Configuration
string input = Utilities.PromptString(loc["SETUP_SERVER_IP"]);
if (System.Net.IPAddress.TryParse(input, out System.Net.IPAddress ip))
{
IPAddress = input;
}
}
while(Port < 1)
{
string input = Utilities.PromptString(loc["SETUP_SERVER_PORT"]);
if (UInt16.TryParse(input, System.Globalization.NumberStyles.Integer, System.Globalization.CultureInfo.CurrentCulture, out ushort port))
Port = port;
}
Port = Utilities.PromptInt(Utilities.PromptString(loc["SETUP_SERVER_PORT"]), null, 1, ushort.MaxValue);
Password = Utilities.PromptString(loc["SETUP_SERVER_RCON"]);
AutoMessages = new List<string>();
Rules = new List<string>();
ReservedSlotNumber = loc["SETUP_SERVER_RESERVEDSLOT"].PromptInt(null, 0, 32);
ManualLogPath = null;
ModifyParsers();
return this;
}
public string Name() => "ServerConfiguration";
public string Name()
{
return "ServerConfiguration";
}
}
}

View File

@ -87,7 +87,7 @@ namespace SharedLibraryCore.Services
//entity.CurrentServer.Logger.WriteDebug($"Updating alias link for {entity}");
await context.SaveChangesAsync();
foreach (var alias in aliases.Union(new List<EFAlias>() { entity.CurrentAlias })
foreach (var alias in aliases.Append(entity.CurrentAlias)
.Where(_alias => !_alias.Active ||
_alias.LinkId != aliasLink.AliasLinkId))
{

View File

@ -58,7 +58,7 @@ namespace SharedLibraryCore.Services
/// <returns></returns>
public async Task<EFMeta> GetPersistentMeta(string metaKey, EFClient client)
{
using (var ctx = new DatabaseContext(disableTracking:true))
using (var ctx = new DatabaseContext(disableTracking: true))
{
return await ctx.EFMeta
.Where(_meta => _meta.Key == metaKey)