remove create proxy as it's not even used anymore
more fixes for alias stuff hopefully fix rare bug where client activity cshtml loop goes oob add URLProtocol format to event parsers to allow connecting through webfront
This commit is contained in:
parent
863ba8b096
commit
8667532d24
@ -6,7 +6,7 @@
|
|||||||
<RuntimeFrameworkVersion>2.2.2</RuntimeFrameworkVersion>
|
<RuntimeFrameworkVersion>2.2.2</RuntimeFrameworkVersion>
|
||||||
<MvcRazorExcludeRefAssembliesFromPublish>false</MvcRazorExcludeRefAssembliesFromPublish>
|
<MvcRazorExcludeRefAssembliesFromPublish>false</MvcRazorExcludeRefAssembliesFromPublish>
|
||||||
<PackageId>RaidMax.IW4MAdmin.Application</PackageId>
|
<PackageId>RaidMax.IW4MAdmin.Application</PackageId>
|
||||||
<Version>2.2.5.9</Version>
|
<Version>2.2.6.0</Version>
|
||||||
<Authors>RaidMax</Authors>
|
<Authors>RaidMax</Authors>
|
||||||
<Company>Forever None</Company>
|
<Company>Forever None</Company>
|
||||||
<Product>IW4MAdmin</Product>
|
<Product>IW4MAdmin</Product>
|
||||||
@ -31,8 +31,8 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ServerGarbageCollection>true</ServerGarbageCollection>
|
<ServerGarbageCollection>true</ServerGarbageCollection>
|
||||||
<TieredCompilation>true</TieredCompilation>
|
<TieredCompilation>true</TieredCompilation>
|
||||||
<AssemblyVersion>2.2.5.9</AssemblyVersion>
|
<AssemblyVersion>2.2.6.0</AssemblyVersion>
|
||||||
<FileVersion>2.2.5.8</FileVersion>
|
<FileVersion>2.2.6.0</FileVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -73,6 +73,8 @@ namespace IW4MAdmin.Application.EventParsers
|
|||||||
|
|
||||||
public Game GameName { get; set; } = Game.COD;
|
public Game GameName { get; set; } = Game.COD;
|
||||||
|
|
||||||
|
public string URLProtocolFormat { get; set; } = "CoD://{{ip}}:{{port}}";
|
||||||
|
|
||||||
public virtual GameEvent GetEvent(Server server, string logLine)
|
public virtual GameEvent GetEvent(Server server, string logLine)
|
||||||
{
|
{
|
||||||
logLine = Regex.Replace(logLine, @"([0-9]+:[0-9]+ |^[0-9]+ )", "").Trim();
|
logLine = Regex.Replace(logLine, @"([0-9]+:[0-9]+ |^[0-9]+ )", "").Trim();
|
||||||
|
@ -45,19 +45,16 @@ namespace IW4MAdmin
|
|||||||
if (client == null)
|
if (client == null)
|
||||||
{
|
{
|
||||||
Logger.WriteDebug($"Client {clientFromLog} first time connecting");
|
Logger.WriteDebug($"Client {clientFromLog} first time connecting");
|
||||||
|
clientFromLog.CurrentServer = this;
|
||||||
client = await Manager.GetClientService().Create(clientFromLog);
|
client = await Manager.GetClientService().Create(clientFromLog);
|
||||||
}
|
}
|
||||||
|
|
||||||
// client has connected in the past
|
/// this is only a temporary version until the IPAddress is transmitted
|
||||||
else
|
client.CurrentAlias = new EFAlias()
|
||||||
{
|
{
|
||||||
// this is only a temporary version until the IPAddress is transmitted
|
Name = clientFromLog.Name,
|
||||||
client.CurrentAlias = new EFAlias
|
IPAddress = clientFromLog.IPAddress
|
||||||
{
|
};
|
||||||
Name = clientFromLog.Name,
|
|
||||||
IPAddress = clientFromLog.IPAddress
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
Logger.WriteInfo($"Client {client} connected...");
|
Logger.WriteInfo($"Client {client} connected...");
|
||||||
|
|
||||||
@ -209,16 +206,18 @@ namespace IW4MAdmin
|
|||||||
// they're already connected
|
// they're already connected
|
||||||
if (existingClient != null)
|
if (existingClient != null)
|
||||||
{
|
{
|
||||||
|
Logger.WriteWarning($"detected preconnect for {E.Origin}, but they are already connected");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
CONNECT:
|
CONNECT:
|
||||||
// we can go ahead and put them in
|
|
||||||
if (Clients[E.Origin.ClientNumber] == null)
|
if (Clients[E.Origin.ClientNumber] == null)
|
||||||
{
|
{
|
||||||
#if DEBUG == true
|
#if DEBUG == true
|
||||||
Logger.WriteDebug($"Begin PreConnect for {E.Origin}");
|
Logger.WriteDebug($"Begin PreConnect for {E.Origin}");
|
||||||
#endif
|
#endif
|
||||||
|
// we can go ahead and put them in so that they don't get re added
|
||||||
|
Clients[E.Origin.ClientNumber] = E.Origin;
|
||||||
await OnClientConnected(E.Origin);
|
await OnClientConnected(E.Origin);
|
||||||
|
|
||||||
ChatHistory.Add(new ChatInfo()
|
ChatHistory.Add(new ChatInfo()
|
||||||
@ -314,28 +313,6 @@ namespace IW4MAdmin
|
|||||||
await Warn(E.Data, E.Target, E.Origin);
|
await Warn(E.Data, E.Target, E.Origin);
|
||||||
}
|
}
|
||||||
|
|
||||||
//else if (E.Type == GameEvent.EventType.Quit)
|
|
||||||
//{
|
|
||||||
// var origin = GetClientsAsList().FirstOrDefault(_client => _client.NetworkId.Equals(E.Origin));
|
|
||||||
|
|
||||||
// if (origin != null)
|
|
||||||
// {
|
|
||||||
// var e = new GameEvent()
|
|
||||||
// {
|
|
||||||
// Type = GameEvent.EventType.Disconnect,
|
|
||||||
// Origin = origin,
|
|
||||||
// Owner = this
|
|
||||||
// };
|
|
||||||
|
|
||||||
// Manager.GetEventHandler().AddEvent(e);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// return false;
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
else if (E.Type == GameEvent.EventType.Disconnect)
|
else if (E.Type == GameEvent.EventType.Disconnect)
|
||||||
{
|
{
|
||||||
ChatHistory.Add(new ChatInfo()
|
ChatHistory.Add(new ChatInfo()
|
||||||
@ -351,13 +328,6 @@ namespace IW4MAdmin
|
|||||||
|
|
||||||
else if (E.Type == GameEvent.EventType.PreDisconnect)
|
else if (E.Type == GameEvent.EventType.PreDisconnect)
|
||||||
{
|
{
|
||||||
//if ((DateTime.UtcNow - SessionStart).TotalSeconds < 30)
|
|
||||||
//{
|
|
||||||
// Logger.WriteInfo($"Cancelling pre disconnect for {E.Origin} as it occured too close to map end");
|
|
||||||
// E.FailReason = GameEvent.EventFailReason.Invalid;
|
|
||||||
// return false;
|
|
||||||
//}
|
|
||||||
|
|
||||||
// predisconnect comes from minimal rcon polled players and minimal log players
|
// predisconnect comes from minimal rcon polled players and minimal log players
|
||||||
// so we need to disconnect the "full" version of the client
|
// so we need to disconnect the "full" version of the client
|
||||||
var client = GetClientsAsList().FirstOrDefault(_client => _client.Equals(E.Origin));
|
var client = GetClientsAsList().FirstOrDefault(_client => _client.Equals(E.Origin));
|
||||||
@ -375,7 +345,7 @@ namespace IW4MAdmin
|
|||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Logger.WriteDebug($"Client {E.Origin} detected as disconnecting, but could not find them in the player list");
|
Logger.WriteWarning($"Client {E.Origin} detected as disconnecting, but could not find them in the player list");
|
||||||
Logger.WriteDebug($"Expected {E.Origin} but found {GetClientsAsList().FirstOrDefault(_client => _client.ClientNumber == E.Origin.ClientNumber)}");
|
Logger.WriteDebug($"Expected {E.Origin} but found {GetClientsAsList().FirstOrDefault(_client => _client.ClientNumber == E.Origin.ClientNumber)}");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -488,9 +458,9 @@ namespace IW4MAdmin
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Task OnClientUpdate(EFClient origin)
|
private async Task OnClientUpdate(EFClient origin)
|
||||||
{
|
{
|
||||||
var client = Clients[origin.ClientNumber];
|
var client = Clients.FirstOrDefault(_client => _client.Equals(origin));
|
||||||
|
|
||||||
if (client != null)
|
if (client != null)
|
||||||
{
|
{
|
||||||
@ -500,11 +470,9 @@ namespace IW4MAdmin
|
|||||||
// update their IP if it hasn't been set yet
|
// update their IP if it hasn't been set yet
|
||||||
if (client.IPAddress == null && !client.IsBot)
|
if (client.IPAddress == null && !client.IsBot)
|
||||||
{
|
{
|
||||||
return client.OnJoin(origin.IPAddress);
|
await client.OnJoin(origin.IPAddress);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return Task.CompletedTask;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -582,7 +550,7 @@ namespace IW4MAdmin
|
|||||||
|
|
||||||
foreach (var disconnectingClient in polledClients[1])
|
foreach (var disconnectingClient in polledClients[1])
|
||||||
{
|
{
|
||||||
if (disconnectingClient.State == EFClient.ClientState.Disconnecting)
|
if (disconnectingClient.State == ClientState.Disconnecting)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@ var eventParser;
|
|||||||
|
|
||||||
var plugin = {
|
var plugin = {
|
||||||
author: 'FrenchFry, RaidMax',
|
author: 'FrenchFry, RaidMax',
|
||||||
version: 0.2,
|
version: 0.3,
|
||||||
name: 'CoD4x Parser',
|
name: 'CoD4x Parser',
|
||||||
isParser: true,
|
isParser: true,
|
||||||
|
|
||||||
@ -27,6 +27,7 @@ var plugin = {
|
|||||||
eventParser.Configuration.GameDirectory = 'main';
|
eventParser.Configuration.GameDirectory = 'main';
|
||||||
eventParser.Version = 'CoD4 X 1.8 win_mingw-x86 build 2055 May 2 2017';
|
eventParser.Version = 'CoD4 X 1.8 win_mingw-x86 build 2055 May 2 2017';
|
||||||
eventParser.GameName = 1; // IW3
|
eventParser.GameName = 1; // IW3
|
||||||
|
eventParser.URLProtocolFormat = 'cod4://{{ip}}:{{port}}';
|
||||||
},
|
},
|
||||||
|
|
||||||
onUnloadAsync: function () {
|
onUnloadAsync: function () {
|
||||||
|
@ -3,7 +3,7 @@ var eventParser;
|
|||||||
|
|
||||||
var plugin = {
|
var plugin = {
|
||||||
author: 'RaidMax',
|
author: 'RaidMax',
|
||||||
version: 0.2,
|
version: 0.3,
|
||||||
name: 'IW4 Parser',
|
name: 'IW4 Parser',
|
||||||
isParser: true,
|
isParser: true,
|
||||||
|
|
||||||
@ -25,6 +25,7 @@ var plugin = {
|
|||||||
rconParser.GameName = 2; // IW4x
|
rconParser.GameName = 2; // IW4x
|
||||||
eventParser.Version = 'IW4x (v0.6.0)';
|
eventParser.Version = 'IW4x (v0.6.0)';
|
||||||
eventParser.GameName = 2; // IW4x
|
eventParser.GameName = 2; // IW4x
|
||||||
|
eventParser.URLProtocolFormat = 'iw4x://{{ip}}:{{port}}';
|
||||||
},
|
},
|
||||||
|
|
||||||
onUnloadAsync: function () {
|
onUnloadAsync: function () {
|
||||||
|
@ -4,7 +4,7 @@ using System.ComponentModel.DataAnnotations.Schema;
|
|||||||
|
|
||||||
namespace SharedLibraryCore.Database.Models
|
namespace SharedLibraryCore.Database.Models
|
||||||
{
|
{
|
||||||
public class EFAlias : SharedEntity
|
public partial class EFAlias : SharedEntity
|
||||||
{
|
{
|
||||||
[Key]
|
[Key]
|
||||||
public int AliasId { get; set; }
|
public int AliasId { get; set; }
|
||||||
|
@ -11,19 +11,10 @@ namespace SharedLibraryCore.Helpers
|
|||||||
{
|
{
|
||||||
DateTime t = DateTime.UtcNow;
|
DateTime t = DateTime.UtcNow;
|
||||||
When = new DateTime(t.Year, t.Month, t.Day, t.Hour, Math.Min(59, UpdateInterval * (int)Math.Round(t.Minute / (float)UpdateInterval)), 0);
|
When = new DateTime(t.Year, t.Month, t.Day, t.Hour, Math.Min(59, UpdateInterval * (int)Math.Round(t.Minute / (float)UpdateInterval)), 0);
|
||||||
PlayerCount = cNum;
|
y = cNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if DEBUG
|
|
||||||
public PlayerHistory(DateTime t, int cNum)
|
|
||||||
{
|
|
||||||
When = new DateTime(t.Year, t.Month, t.Day, t.Hour, Math.Min(59, UpdateInterval * (int)Math.Round(t.Minute / (float)UpdateInterval)), 0);
|
|
||||||
PlayerCount = cNum;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
private DateTime When;
|
private DateTime When;
|
||||||
private int PlayerCount;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Used by CanvasJS as a point on the x axis
|
/// Used by CanvasJS as a point on the x axis
|
||||||
@ -36,16 +27,9 @@ namespace SharedLibraryCore.Helpers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Used by CanvasJS as a point on the y axis
|
/// Used by CanvasJS as a point on the y axis
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int y
|
public int y { get; }
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return PlayerCount;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,5 +27,10 @@ namespace SharedLibraryCore.Interfaces
|
|||||||
/// specifies the game name (usually the internal studio iteration ie: IW4, T5 etc...)
|
/// specifies the game name (usually the internal studio iteration ie: IW4, T5 etc...)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Game GameName { get; set; }
|
Game GameName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// specifies the connect URI used to join game servers via web browser
|
||||||
|
/// </summary>
|
||||||
|
string URLProtocolFormat { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace SharedLibraryCore.Objects
|
|
||||||
{
|
|
||||||
public class Alias : Database.Models.EFAlias
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
7
SharedLibraryCore/Objects/EFAlias.cs
Normal file
7
SharedLibraryCore/Objects/EFAlias.cs
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
namespace SharedLibraryCore.Database.Models
|
||||||
|
{
|
||||||
|
public partial class EFAlias
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -80,13 +80,12 @@ namespace SharedLibraryCore.Database.Models
|
|||||||
{
|
{
|
||||||
{ "_reportCount", 0 }
|
{ "_reportCount", 0 }
|
||||||
};
|
};
|
||||||
CurrentAlias = new EFAlias();
|
|
||||||
ReceivedPenalties = new List<EFPenalty>();
|
ReceivedPenalties = new List<EFPenalty>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
return $"{Name}::{NetworkId}";
|
return $"{CurrentAlias?.Name ?? "--"}::{NetworkId}";
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -17,27 +17,6 @@ namespace SharedLibraryCore.Services
|
|||||||
public async Task<EFAlias> Create(EFAlias entity)
|
public async Task<EFAlias> Create(EFAlias entity)
|
||||||
{
|
{
|
||||||
throw await Task.FromResult(new Exception());
|
throw await Task.FromResult(new Exception());
|
||||||
/*using (var context = new DatabaseContext())
|
|
||||||
{
|
|
||||||
var alias = new EFAlias()
|
|
||||||
{
|
|
||||||
Active = true,
|
|
||||||
DateAdded = DateTime.UtcNow,
|
|
||||||
IPAddress = entity.IPAddress,
|
|
||||||
Name = entity.Name
|
|
||||||
};
|
|
||||||
|
|
||||||
entity.Link = await context.AliasLinks
|
|
||||||
.FirstAsync(a => a.AliasLinkId == entity.Link.AliasLinkId);
|
|
||||||
context.Aliases.Add(entity);
|
|
||||||
await context.SaveChangesAsync();
|
|
||||||
return entity;
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
|
|
||||||
public Task<EFAlias> CreateProxy()
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<EFAlias> Delete(EFAlias entity)
|
public async Task<EFAlias> Delete(EFAlias entity)
|
||||||
|
@ -28,9 +28,12 @@ namespace SharedLibraryCore.Services
|
|||||||
|
|
||||||
if (existingAlias != null)
|
if (existingAlias != null)
|
||||||
{
|
{
|
||||||
|
entity.CurrentServer.Logger.WriteDebug($"[create] client with new GUID {entity} has existing link {existingAlias.LinkId}");
|
||||||
|
|
||||||
linkId = existingAlias.LinkId;
|
linkId = existingAlias.LinkId;
|
||||||
if (existingAlias.Name == entity.Name)
|
if (existingAlias.Name == entity.Name)
|
||||||
{
|
{
|
||||||
|
entity.CurrentServer.Logger.WriteDebug($"[create] client with new GUID {entity} has existing alias {existingAlias.AliasId}");
|
||||||
aliasId = existingAlias.AliasId;
|
aliasId = existingAlias.AliasId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -44,9 +47,12 @@ namespace SharedLibraryCore.Services
|
|||||||
NetworkId = entity.NetworkId
|
NetworkId = entity.NetworkId
|
||||||
};
|
};
|
||||||
|
|
||||||
|
context.Clients.Add(client);
|
||||||
|
|
||||||
// they're just using a new GUID
|
// they're just using a new GUID
|
||||||
if (aliasId.HasValue)
|
if (aliasId.HasValue)
|
||||||
{
|
{
|
||||||
|
entity.CurrentServer.Logger.WriteDebug($"[create] setting {entity}'s alias id and linkid to ({aliasId.Value}, {linkId.Value})");
|
||||||
client.CurrentAliasId = aliasId.Value;
|
client.CurrentAliasId = aliasId.Value;
|
||||||
client.AliasLinkId = linkId.Value;
|
client.AliasLinkId = linkId.Value;
|
||||||
}
|
}
|
||||||
@ -54,8 +60,9 @@ namespace SharedLibraryCore.Services
|
|||||||
// link was found but they don't have an exact alias
|
// link was found but they don't have an exact alias
|
||||||
else if (!aliasId.HasValue && linkId.HasValue)
|
else if (!aliasId.HasValue && linkId.HasValue)
|
||||||
{
|
{
|
||||||
|
entity.CurrentServer.Logger.WriteDebug($"[create] setting {entity}'s linkid to {linkId.Value}, but creating new alias");
|
||||||
client.AliasLinkId = linkId.Value;
|
client.AliasLinkId = linkId.Value;
|
||||||
client.CurrentAlias = new Alias()
|
client.CurrentAlias = new EFAlias()
|
||||||
{
|
{
|
||||||
Name = entity.Name,
|
Name = entity.Name,
|
||||||
DateAdded = DateTime.UtcNow,
|
DateAdded = DateTime.UtcNow,
|
||||||
@ -67,18 +74,22 @@ namespace SharedLibraryCore.Services
|
|||||||
// brand new players (supposedly)
|
// brand new players (supposedly)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
client.AliasLink = new EFAliasLink();
|
entity.CurrentServer.Logger.WriteDebug($"[create] creating new Link and Alias for {entity}");
|
||||||
|
var link = new EFAliasLink();
|
||||||
client.CurrentAlias = new Alias()
|
var alias = new EFAlias()
|
||||||
{
|
{
|
||||||
Name = entity.Name,
|
Name = entity.Name,
|
||||||
DateAdded = DateTime.UtcNow,
|
DateAdded = DateTime.UtcNow,
|
||||||
IPAddress = entity.IPAddress,
|
IPAddress = entity.IPAddress,
|
||||||
Link = client.AliasLink,
|
Link = link
|
||||||
};
|
};
|
||||||
|
|
||||||
|
link.Children.Add(alias);
|
||||||
|
|
||||||
|
client.AliasLink = link;
|
||||||
|
client.CurrentAlias = alias;
|
||||||
}
|
}
|
||||||
|
|
||||||
context.Clients.Add(client);
|
|
||||||
await context.SaveChangesAsync();
|
await context.SaveChangesAsync();
|
||||||
|
|
||||||
return client;
|
return client;
|
||||||
@ -474,11 +485,6 @@ namespace SharedLibraryCore.Services
|
|||||||
.CountAsync();
|
.CountAsync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Task<EFClient> CreateProxy()
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -68,11 +68,6 @@ namespace SharedLibraryCore.Services
|
|||||||
return newEntity;
|
return newEntity;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Task<EFPenalty> CreateProxy()
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Task<EFPenalty> Delete(EFPenalty entity)
|
public Task<EFPenalty> Delete(EFPenalty entity)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
|
@ -8,7 +8,6 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@ -716,6 +715,20 @@ namespace SharedLibraryCore
|
|||||||
return Assembly.GetCallingAssembly().GetName().Version.ToString();
|
return Assembly.GetCallingAssembly().GetName().Version.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string FormatExt(this string input, params object[] values)
|
||||||
|
{
|
||||||
|
var matches = Regex.Matches(Regex.Unescape(input), @"{{\w+}}");
|
||||||
|
string output = input;
|
||||||
|
int index = 0;
|
||||||
|
foreach (Match match in matches)
|
||||||
|
{
|
||||||
|
output = output.Replace(match.Value.ToString(), $"{{{index.ToString()}}}");
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return string.Format(output, values);
|
||||||
|
}
|
||||||
|
|
||||||
#if DEBUG == true
|
#if DEBUG == true
|
||||||
|
|
||||||
private static readonly TypeInfo QueryCompilerTypeInfo = typeof(QueryCompiler).GetTypeInfo();
|
private static readonly TypeInfo QueryCompilerTypeInfo = typeof(QueryCompiler).GetTypeInfo();
|
||||||
|
@ -11,7 +11,7 @@ namespace WebfrontCore.Controllers
|
|||||||
[ResponseCache(NoStore = true, Duration = 0)]
|
[ResponseCache(NoStore = true, Duration = 0)]
|
||||||
public IActionResult ClientActivity(long id)
|
public IActionResult ClientActivity(long id)
|
||||||
{
|
{
|
||||||
var s = Manager.GetServers().FirstOrDefault(s2 => s2.EndPoint == id);
|
var s = Manager.GetServers().FirstOrDefault(_server => _server.EndPoint == id);
|
||||||
|
|
||||||
if (s == null)
|
if (s == null)
|
||||||
{
|
{
|
||||||
|
@ -36,6 +36,10 @@
|
|||||||
@{
|
@{
|
||||||
for (int i = 0; i < half; i++)
|
for (int i = 0; i < half; i++)
|
||||||
{
|
{
|
||||||
|
if (i > Model.Players.Count - 1)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
string levelColorClass = !ViewBag.Authorized ? "" : $"level-color-{Model.Players[i].LevelInt}";
|
string levelColorClass = !ViewBag.Authorized ? "" : $"level-color-{Model.Players[i].LevelInt}";
|
||||||
<span>@Html.ActionLink(Model.Players[i].Name, "ProfileAsync", "Client", new { id = Model.Players[i].ClientId }, new { @class = levelColorClass })</span><br />
|
<span>@Html.ActionLink(Model.Players[i].Name, "ProfileAsync", "Client", new { id = Model.Players[i].ClientId }, new { @class = levelColorClass })</span><br />
|
||||||
}
|
}
|
||||||
@ -45,6 +49,10 @@
|
|||||||
@{
|
@{
|
||||||
for (int i = half; i < Math.Min(Model.ClientCount, Model.Players.Count); i++)
|
for (int i = half; i < Math.Min(Model.ClientCount, Model.Players.Count); i++)
|
||||||
{
|
{
|
||||||
|
if (i > Model.Players.Count - 1)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
string levelColorClass = !ViewBag.Authorized ? "" : $"level-color-{Model.Players[i].LevelInt}";
|
string levelColorClass = !ViewBag.Authorized ? "" : $"level-color-{Model.Players[i].LevelInt}";
|
||||||
<span>@Html.ActionLink(Model.Players[i].Name, "ProfileAsync", "Client", new { id = Model.Players[i].ClientId }, new { @class = levelColorClass })</span><br />
|
<span>@Html.ActionLink(Model.Players[i].Name, "ProfileAsync", "Client", new { id = Model.Players[i].ClientId }, new { @class = levelColorClass })</span><br />
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
|
@model SharedLibraryCore.Dtos.ServerInfo
|
||||||
@model SharedLibraryCore.Dtos.ServerInfo
|
|
||||||
|
|
||||||
@{
|
@{
|
||||||
Layout = null;
|
Layout = null;
|
||||||
}
|
}
|
||||||
@ -12,7 +10,12 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="server_clientactivity_@Model.ID" class="bg-dark row server-activity pt-2 pb-2">
|
<div id="server_clientactivity_@Model.ID" class="bg-dark row server-activity pt-2 pb-2">
|
||||||
@await Html.PartialAsync("../Server/_ClientActivity", Model)
|
<div class="col-4">
|
||||||
|
<div class="oi oi-play-circle h1"></div>
|
||||||
|
</div>
|
||||||
|
<div class="col-8">
|
||||||
|
@await Html.PartialAsync("../Server/_ClientActivity", Model)
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row server-history mb-4">
|
<div class="row server-history mb-4">
|
||||||
|
Loading…
Reference in New Issue
Block a user