1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 23:31:13 -05:00

added chat history stuff

This commit is contained in:
RaidMax
2017-11-02 17:20:10 -05:00
parent 9699f7c3f1
commit 308427e662
10 changed files with 219 additions and 2 deletions

View File

@ -99,6 +99,7 @@ namespace StatsPlugin
public static SharedLibrary.Interfaces.IManager ManagerInstance;
public static int MAX_KILLEVENTS = 1000;
public static Dictionary<int, ServerStatInfo> ServerStats { get; private set; }
public static ChatDatabase ChatDB { get; private set; }
public class ServerStatInfo
{
@ -197,10 +198,15 @@ namespace StatsPlugin
WebService.PageList.Add(new StatsPage());
WebService.PageList.Add(new KillStatsJSON());
WebService.PageList.Add(new Chat.WordCloudJSON());
WebService.PageList.Add(new Chat.ClientChatJSON());
WebService.PageList.Add(new Chat.ChatPage());
ManagerInstance.GetMessageTokens().Add(new MessageToken("TOTALKILLS", GetTotalKills));
ManagerInstance.GetMessageTokens().Add(new MessageToken("TOTALPLAYTIME", GetTotalPlaytime));
ChatDB = new ChatDatabase("Database/ChatHistory.rm");
try
{
var minimapConfig = MinimapConfig.Read("Config/minimaps.cfg");
@ -354,6 +360,11 @@ namespace StatsPlugin
await Victim.Tell(MessageOnStreak(curServer.killStreaks[Victim.ClientID], curServer.deathStreaks[Victim.ClientID]));
}
if (E.Type == Event.GType.Say)
{
ChatDB.AddChatHistory(E.Origin.DatabaseID, E.Owner.GetPort(), E.Data);
}
}
public static string GetTotalKills()