Skip to content

Commit

Permalink
use correct EFClient return time for ScriptPluginExtensions and provi…
Browse files Browse the repository at this point in the history
…de IPAddress on game interface data
  • Loading branch information
RaidMax committed Jul 13, 2024
1 parent ee0b40d commit 135fc98
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Application/Extensions/ScriptPluginExtensions.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -29,7 +29,7 @@ public static IEnumerable<object> GetClientsStatData(this DbSet<EFClientStatisti
}

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());
Expand Down
3 changes: 2 additions & 1 deletion Plugins/ScriptPlugins/GameInterface.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,8 @@ const plugin = {
clientId: client.clientId,
lastConnection: client.timeSinceLastConnectionString,
tag: tagMeta?.value ?? '',
performance: clientStats?.performance ?? 200.0
performance: clientStats?.performance ?? 200.0,
ipAddress: client.ipAddressString
};
}

Expand Down

0 comments on commit 135fc98

Please sign in to comment.