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

fixes to get closer to a release

This commit is contained in:
RaidMax
2018-02-15 22:01:28 -06:00
parent 7a15980a0c
commit 89cfb80798
23 changed files with 287 additions and 181 deletions

View File

@ -19,7 +19,8 @@ namespace StatsPlugin.Commands
if (E.Origin.ClientNumber >= 0)
{
var svc = new SharedLibrary.Services.GenericRepository<EFClientStatistics>();
var stats = svc.Find(s => s.ClientId == E.Origin.ClientId).First();
int serverId = E.Origin.GetHashCode();
var stats = svc.Find(s => s.ClientId == E.Origin.ClientId && s.ServerId == serverId).First();
stats.Deaths = 0;
stats.Kills = 0;

View File

@ -17,7 +17,8 @@ namespace StatsPlugin.Commands
public override async Task ExecuteAsync(Event E)
{
var statsSvc = new GenericRepository<EFClientStatistics>();
var iqStats = statsSvc.GetQuery(cs => cs.Active);
int serverId = E.Origin.GetHashCode();
var iqStats = statsSvc.GetQuery(cs => cs.ServerId == serverId);
var topStats = iqStats.Where(cs => cs.Skill > 100)
.OrderByDescending(cs => cs.Skill)

View File

@ -41,16 +41,17 @@ namespace StatsPlugin.Commands
}
var clientStats = new GenericRepository<EFClientStatistics>();
int serverId = E.Owner.GetHashCode();
if (E.Target != null)
{
pStats = clientStats.Find(c => c.ClientId == E.Target.ClientId).First();
pStats = clientStats.Find(c => c.ServerId ==serverId && c.ClientId == E.Target.ClientId).First();
statLine = String.Format("^5{0} ^7KILLS | ^5{1} ^7DEATHS | ^5{2} ^7KDR | ^5{3} ^7SKILL", pStats.Kills, pStats.Deaths, pStats.KDR, pStats.Skill);
}
else
{
pStats = pStats = clientStats.Find(c => c.ClientId == E.Origin.ClientId).First();
pStats = pStats = clientStats.Find(c => c.ServerId == serverId && c.ClientId == E.Origin.ClientId).First();
statLine = String.Format("^5{0} ^7KILLS | ^5{1} ^7DEATHS | ^5{2} ^7KDR | ^5{3} ^7SKILL", pStats.Kills, pStats.Deaths, pStats.KDR, pStats.Skill);
}