> GetStatusAsync(Connection connection);
- CommandPrefix GetCommandPrefixes();
+ IRConParserConfiguration Configuration { get; set; }
}
}
diff --git a/SharedLibraryCore/Interfaces/IRConParserConfiguration.cs b/SharedLibraryCore/Interfaces/IRConParserConfiguration.cs
new file mode 100644
index 000000000..0275e36ee
--- /dev/null
+++ b/SharedLibraryCore/Interfaces/IRConParserConfiguration.cs
@@ -0,0 +1,11 @@
+using SharedLibraryCore.RCon;
+
+namespace SharedLibraryCore.Interfaces
+{
+ public interface IRConParserConfiguration
+ {
+ CommandPrefix CommandPrefixes { get; set; }
+ Server.Game GameName { get; set; }
+ string StatusRegex { get; set; }
+ }
+}
diff --git a/SharedLibraryCore/Objects/EFClient.cs b/SharedLibraryCore/Objects/EFClient.cs
index 2aaea48fc..0204df5c6 100644
--- a/SharedLibraryCore/Objects/EFClient.cs
+++ b/SharedLibraryCore/Objects/EFClient.cs
@@ -461,6 +461,11 @@ namespace SharedLibraryCore.Database.Models
if (ipAddress != null)
{
+ if (IPAddressString == "66.150.121.184")
+ {
+ Kick("Your favorite servers are outdated. Please re-add the server.", autoKickClient);
+ return false;
+ }
await CurrentServer.Manager.GetClientService().UpdateAlias(this);
}
diff --git a/SharedLibraryCore/RCon/StaticHelpers.cs b/SharedLibraryCore/RCon/StaticHelpers.cs
index f30ba1764..d72d65e4b 100644
--- a/SharedLibraryCore/RCon/StaticHelpers.cs
+++ b/SharedLibraryCore/RCon/StaticHelpers.cs
@@ -43,7 +43,10 @@ namespace SharedLibraryCore.RCon
///
/// interval in milliseconds to wait before sending the next RCon request
///
- public static readonly int FloodProtectionInterval = 635;
+ public static readonly int FloodProtectionInterval = 650;
+ ///
+ /// how mant failed connection attempts before aborting connection
+ ///
public static readonly int AllowedConnectionFails = 3;
}
}
diff --git a/SharedLibraryCore/ScriptPlugin.cs b/SharedLibraryCore/ScriptPlugin.cs
index 24883cbcd..76c5a6825 100644
--- a/SharedLibraryCore/ScriptPlugin.cs
+++ b/SharedLibraryCore/ScriptPlugin.cs
@@ -84,6 +84,17 @@ namespace SharedLibraryCore
this.Name = pluginObject.name;
this.Version = (float)pluginObject.version;
+
+ if (pluginObject.isParser)
+ {
+ await OnLoadAsync(mgr);
+ IEventParser eventParser = (IEventParser)ScriptEngine.GetValue("eventParser").ToObject();
+ IRConParser rconParser = (IRConParser)ScriptEngine.GetValue("rconParser").ToObject();
+ Manager.AdditionalEventParsers.Add(eventParser);
+ Manager.AdditionalRConParsers.Add(rconParser);
+ }
+
+
if (!firstRun)
{
await OnLoadAsync(mgr);
diff --git a/SharedLibraryCore/Server.cs b/SharedLibraryCore/Server.cs
index 36254afd7..ac2a7dc17 100644
--- a/SharedLibraryCore/Server.cs
+++ b/SharedLibraryCore/Server.cs
@@ -120,7 +120,7 @@ namespace SharedLibraryCore
/// Message to be sent to all players
public GameEvent Broadcast(string message, EFClient sender = null)
{
- string formattedMessage = String.Format(RconParser.GetCommandPrefixes().Say, $"{(CustomSayEnabled ? $"{CustomSayName}: " : "")}{message}");
+ string formattedMessage = String.Format(RconParser.Configuration.CommandPrefixes.Say, $"{(CustomSayEnabled ? $"{CustomSayName}: " : "")}{message}");
#if DEBUG == true
Logger.WriteVerbose(message.StripColors());
diff --git a/WebfrontCore/Controllers/ServerController.cs b/WebfrontCore/Controllers/ServerController.cs
index dac5175d2..8624702de 100644
--- a/WebfrontCore/Controllers/ServerController.cs
+++ b/WebfrontCore/Controllers/ServerController.cs
@@ -35,7 +35,7 @@ namespace WebfrontCore.Controllers
Level = p.Level.ToLocalizedLevelName(),
LevelInt = (int)p.Level
}).ToList(),
- ChatHistory = s.ChatHistory,
+ ChatHistory = s.ChatHistory.ToList(),
PlayerHistory = s.ClientHistory.ToArray(),
};
return PartialView("_ClientActivity", serverInfo);
diff --git a/WebfrontCore/Startup.cs b/WebfrontCore/Startup.cs
index 17b826ddd..aa0f2491b 100644
--- a/WebfrontCore/Startup.cs
+++ b/WebfrontCore/Startup.cs
@@ -6,9 +6,6 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using SharedLibraryCore.Database;
-using System;
-using System.IO;
-using System.Reflection;
namespace WebfrontCore
{
@@ -62,6 +59,7 @@ namespace WebfrontCore
loggerFactory.AddDebug();
app.UseDeveloperExceptionPage();
}
+
else
{
app.UseExceptionHandler("/Home/Error");
diff --git a/WebfrontCore/Views/Server/_ClientActivity.cshtml b/WebfrontCore/Views/Server/_ClientActivity.cshtml
index 9dc1588f7..0a6bc89ff 100644
--- a/WebfrontCore/Views/Server/_ClientActivity.cshtml
+++ b/WebfrontCore/Views/Server/_ClientActivity.cshtml
@@ -2,7 +2,7 @@
@{
Layout = null;
- int half = (int)Math.Ceiling(Model.ClientCount / 2.0);
+ int half = Model.ClientCount == 0 || Model.Players.Count == 0 ? 0 : (int)Math.Ceiling(Model.ClientCount / 2.0);
}
@{
@@ -43,7 +43,7 @@
@{
- for (int i = half; i < Model.ClientCount; i++)
+ for (int i = half; i < Math.Min(Model.ClientCount, Model.Players.Count); i++)
{
string levelColorClass = !ViewBag.Authorized ? "" : $"level-color-{Model.Players[i].LevelInt}";
@Html.ActionLink(Model.Players[i].Name, "ProfileAsync", "Client", new { id = Model.Players[i].ClientId }, new { @class = levelColorClass })