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

create shared integration for performance-based autobalance support

This commit is contained in:
RaidMax
2022-10-23 13:29:01 -05:00
parent b427a51c59
commit 34cafc4066
8 changed files with 630 additions and 45 deletions

View File

@ -1,6 +1,8 @@
using System.Collections.Generic;
using System.Linq;
using Data.Models.Client.Stats;
using Microsoft.EntityFrameworkCore;
using SharedLibraryCore;
namespace IW4MAdmin.Application.Extensions;
@ -18,4 +20,15 @@ public static class ScriptPluginExtensions
client.NetworkId
}).ToList();
}
public static IEnumerable<object> GetClientsStatData(this DbSet<EFClientStatistics> set, int[] clientIds,
double serverId)
{
return set.Where(stat => clientIds.Contains(stat.ClientId) && stat.ServerId == (long)serverId).ToList();
}
public static object GetId(this Server server)
{
return server.GetIdForServer().GetAwaiter().GetResult();
}
}