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:
@ -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;
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user