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