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

use correct EFClient return time for ScriptPluginExtensions and provide IPAddress on game interface data

This commit is contained in:
RaidMax
2024-07-12 22:08:23 -05:00
parent ee0b40d657
commit 135fc98e1c
2 changed files with 4 additions and 3 deletions

View File

@ -1,8 +1,8 @@
using System.Collections.Generic;
using System.Linq;
using Data.Models.Client;
using Data.Models.Client.Stats;
using Microsoft.EntityFrameworkCore;
using SharedLibraryCore.Database.Models;
using SharedLibraryCore.Interfaces;
namespace IW4MAdmin.Application.Extensions;
@ -29,7 +29,7 @@ public static class ScriptPluginExtensions
}
public static EFClient GetClientByNumber(this IGameServer server, int clientNumber) =>
server.ConnectedClients.FirstOrDefault(client => client.ClientNumber == clientNumber);
server.ConnectedClients.FirstOrDefault(client => client.ClientNumber >= 0 && client.ClientNumber == clientNumber);
public static EFClient GetClientByGuid(this IGameServer server, string clientGuid) =>
server.ConnectedClients.FirstOrDefault(client => client?.GuidString == clientGuid?.Trim().ToLower());