diff --git a/Release Build/lib/SharedLibary.dll b/Release Build/lib/SharedLibary.dll
index e2fd68cff..ce631ff94 100644
Binary files a/Release Build/lib/SharedLibary.dll and b/Release Build/lib/SharedLibary.dll differ
diff --git a/Release Build/plugins/SamplePlugin.dll b/Release Build/plugins/SamplePlugin.dll
index 01bc40695..df6183d27 100644
Binary files a/Release Build/plugins/SamplePlugin.dll and b/Release Build/plugins/SamplePlugin.dll differ
diff --git a/SamplePlugin/Main.cs b/SamplePlugin/Main.cs
index 79125739f..f1ec7207f 100644
--- a/SamplePlugin/Main.cs
+++ b/SamplePlugin/Main.cs
@@ -77,7 +77,7 @@ namespace SamplePlugin
}
}
- public class Stats : Notify
+ public class Stats : Plugin
{
public static StatsDB playerStats { get; private set; }
@@ -108,6 +108,7 @@ namespace SamplePlugin
victimStats.Deaths++;
victimStats.KDR = victimStats.Kills / victimStats.Deaths;
+
playerStats.updateStats(Victim, victimStats);
}
}
@@ -116,6 +117,16 @@ namespace SamplePlugin
{
playerStats = new StatsDB("stats.rm");
}
+
+ public override string Name
+ {
+ get { return "Basic Stats"; }
+ }
+
+ public override float Version
+ {
+ get { return 0.1f; }
+ }
}
public class StatsDB : Database
diff --git a/SharedLibary/Event.cs b/SharedLibary/Event.cs
index 3e8ce6f50..a5adc9a35 100644
--- a/SharedLibary/Event.cs
+++ b/SharedLibary/Event.cs
@@ -58,21 +58,15 @@ namespace SharedLibrary
public Command isValidCMD(List
list)
{
- if (this.Data.Substring(0, 1) == "!")
+ string[] cmd = this.Data.Substring(1, this.Data.Length - 1).Split(' ');
+
+ foreach (Command C in list)
{
- string[] cmd = this.Data.Substring(1, this.Data.Length - 1).Split(' ');
-
- foreach (Command C in list)
- {
- if (C.Name == cmd[0].ToLower() || C.Alias == cmd[0].ToLower())
- return C;
- }
-
- return null;
+ if (C.Name == cmd[0].ToLower() || C.Alias == cmd[0].ToLower())
+ return C;
}
- else
- return null;
+ return null;
}
public static Event requestEvent(String[] line, Server SV)
diff --git a/Admin/Helpers.cs b/SharedLibary/Miscellaneous.cs
similarity index 72%
rename from Admin/Helpers.cs
rename to SharedLibary/Miscellaneous.cs
index 461c05152..f6457672a 100644
--- a/Admin/Helpers.cs
+++ b/SharedLibary/Miscellaneous.cs
@@ -3,11 +3,11 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
-namespace IW4MAdmin
+namespace SharedLibrary
{
- class pHistory
+ public class PlayerHistory
{
- public pHistory(DateTime w, int cNum)
+ public PlayerHistory(DateTime w, int cNum)
{
When = w;
Players = cNum;
diff --git a/SharedLibary/Player.cs b/SharedLibary/Player.cs
index 98087df71..11d986fac 100644
--- a/SharedLibary/Player.cs
+++ b/SharedLibary/Player.cs
@@ -31,6 +31,7 @@ namespace SharedLibrary
SeniorAdmin = 4,
Owner = 5,
Creator = 6,
+ Console = 7,
}
public Player(string n, string id, int num, int l)
diff --git a/SharedLibary/Plugin.cs b/SharedLibary/Plugin.cs
index cb4a3ca67..d155c8f1b 100644
--- a/SharedLibary/Plugin.cs
+++ b/SharedLibary/Plugin.cs
@@ -8,10 +8,10 @@ namespace SharedLibrary
public abstract class Plugin
{
public abstract void onLoad();
- }
-
- public abstract class Notify : Plugin
- {
public abstract void onEvent(Event E);
+
+ //for logging purposes
+ public abstract string Name { get; }
+ public abstract float Version { get; }
}
}
diff --git a/SharedLibary/Server.cs b/SharedLibary/Server.cs
index 30c4c8803..7c67d5feb 100644
--- a/SharedLibary/Server.cs
+++ b/SharedLibary/Server.cs
@@ -29,6 +29,7 @@ namespace SharedLibrary
Macros = new Dictionary();
Reports = new List();
statusPlayers = new Dictionary();
+ playerHistory = new Queue();
chatHistory = new List();
lastWebChat = DateTime.Now;
nextMessage = 0;
@@ -240,6 +241,13 @@ namespace SharedLibrary
{
if (Target.clientID > -1)
executeCommand("tellraw " + Target.clientID + " " + Message + "^7");
+
+ if (Target.Level == Player.Permission.Console)
+ {
+ Console.ForegroundColor = ConsoleColor.Cyan;
+ Console.WriteLine(Utilities.stripColors(Message));
+ Console.ForegroundColor = ConsoleColor.Gray;
+ }
}
///
@@ -474,6 +482,7 @@ namespace SharedLibrary
public int totalKills = 0;
public List Reports;
public List chatHistory;
+ public Queue playerHistory { get; private set; }
//Info
protected String IP;
diff --git a/SharedLibary/SharedLibrary.csproj b/SharedLibary/SharedLibrary.csproj
index 909f93254..e056d8abc 100644
--- a/SharedLibary/SharedLibrary.csproj
+++ b/SharedLibary/SharedLibrary.csproj
@@ -55,6 +55,7 @@
+
diff --git a/SharedLibary/Utilities.cs b/SharedLibary/Utilities.cs
index a4ce52603..57c9c9a88 100644
--- a/SharedLibary/Utilities.cs
+++ b/SharedLibary/Utilities.cs
@@ -171,7 +171,15 @@ namespace SharedLibrary
{
String Match = M.Value;
String Identifier = M.Value.Substring(2, M.Length - 4);
- String Replacement = Dict[Identifier].ToString();
+ Object foundVal;
+ Dict.TryGetValue(Identifier, out foundVal);
+ String Replacement;
+
+ if (foundVal != null)
+ Replacement = foundVal.ToString();
+ else
+ Replacement = "";
+
str = str.Replace(Match, Replacement);
}
diff --git a/Webfront Plugin/Framework.cs b/Webfront Plugin/Framework.cs
index b166b62f8..285dfc3ad 100644
--- a/Webfront Plugin/Framework.cs
+++ b/Webfront Plugin/Framework.cs
@@ -367,6 +367,25 @@ namespace Webfront_Plugin
return Input.Replace(Macro, buffer.ToString());
}
+ if (Looking == "GRAPH")
+ {
+ StringBuilder buffer = new StringBuilder();
+ buffer.Append("");
+ buffer.Append("");
+ return Input.Replace(Macro, buffer.ToString());
+ }
+
if (Looking == "TITLE")
return Input.Replace(Macro, "IW4MAdmin by RaidMax");
@@ -399,7 +418,7 @@ namespace Webfront_Plugin
break;
case "graph":
requestedPage = new graph();
- break;
+ return processTemplate(requestedPage.Load(), request.QueryString);
case "stats":
requestedPage = new stats();
break;
diff --git a/Webfront Plugin/Main.cs b/Webfront Plugin/Main.cs
index 5d57812cf..c577b20bf 100644
--- a/Webfront Plugin/Main.cs
+++ b/Webfront Plugin/Main.cs
@@ -4,7 +4,7 @@ using System.Threading;
namespace Webfront_Plugin
{
- public class Webfront : Notify
+ public class Webfront : Plugin
{
private static Manager webManager;
@@ -33,5 +33,15 @@ namespace Webfront_Plugin
webManagerThread.Start();
}
+
+ public override String Name
+ {
+ get { return "Webfront"; }
+ }
+
+ public override float Version
+ {
+ get { return 0.1f; }
+ }
}
}
diff --git a/Webfront Plugin/Webfront Plugin.csproj b/Webfront Plugin/Webfront Plugin.csproj
index 524085258..5839e3523 100644
--- a/Webfront Plugin/Webfront Plugin.csproj
+++ b/Webfront Plugin/Webfront Plugin.csproj
@@ -52,7 +52,7 @@
- copy /Y "$(TargetDir)$(TargetName).dll" "$(SolutionDir)Admin\plugins\$(TargetName).dll"
+ copy /Y "$(TargetDir)$(TargetName).dll" "$(SolutionDir)Admin\plugins\WebfrontPlugin.dll"