1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-09 23:00:57 -05:00

updated portuguese translation

fixed issue with locale when no config present
changed kick color on webfront
aliased owner to iamgod (for b3 familiar users)
hopefully fixed stats issue
added T5M (V2 BO2) support
made dvar grab at beginning minimal to prevent throttling on older CODS
This commit is contained in:
RaidMax
2018-04-26 19:19:42 -05:00
parent 8476112626
commit 677b163a1e
14 changed files with 124 additions and 71 deletions

View File

@ -27,7 +27,7 @@ namespace SharedLibraryCore.Commands
public class COwner : Command
{
public COwner() :
base("owner", Utilities.CurrentLocalization.LocalizationSet["COMMANDS_OWNER_DESC"], "o", Player.Permission.User, false)
base("owner", Utilities.CurrentLocalization.LocalizationSet["COMMANDS_OWNER_DESC"], "iamgod", Player.Permission.User, false)
{ }
public override async Task ExecuteAsync(GameEvent E)

View File

@ -163,9 +163,9 @@ namespace SharedLibraryCore.RCon
public async Task<string[]> SendQueryAsync(StaticHelpers.QueryType type, string parameters = "", bool waitForResponse = true)
{
// will this really prevent flooding?
if ((DateTime.Now - LastQuery).TotalMilliseconds < 35)
if ((DateTime.Now - LastQuery).TotalMilliseconds < 150)
{
await Task.Delay(35);
await Task.Delay(150);
}
LastQuery = DateTime.Now;

View File

@ -13,6 +13,6 @@ namespace SharedLibraryCore.RCon
}
public static char SeperatorChar = (char)int.Parse("0a", System.Globalization.NumberStyles.AllowHexSpecifier);
public static readonly TimeSpan SocketTimeout = new TimeSpan(0, 0, 10);
public static readonly TimeSpan SocketTimeout = new TimeSpan(0, 0, 2);
}
}

View File

@ -109,10 +109,7 @@ namespace SharedLibraryCore
/// <returns></returns>
abstract public Task<Command> ValidateCommand(GameEvent E);
virtual public Task<bool> ProcessUpdatesAsync(CancellationToken cts)
{
return null;
}
virtual public Task<bool> ProcessUpdatesAsync(CancellationToken cts) => (Task<bool>)Task.CompletedTask;
/// <summary>
/// Process any server event

View File

@ -7,6 +7,7 @@ using SharedLibraryCore.Database;
using SharedLibraryCore.Database.Models;
using SharedLibraryCore.Dtos;
using Microsoft.EntityFrameworkCore;
using SharedLibraryCore.Objects;
namespace SharedLibraryCore.Services
{
@ -135,16 +136,17 @@ namespace SharedLibraryCore.Services
{
if (victim)
{
context.ChangeTracker.AutoDetectChangesEnabled = false;
var now = DateTime.UtcNow;
var iqPenalties = from penalty in context.Penalties.AsNoTracking()
where penalty.OffenderId == clientId
join victimClient in context.Clients.AsNoTracking()
on penalty.OffenderId equals victimClient.ClientId
join victimAlias in context.Aliases
join victimAlias in context.Aliases.AsNoTracking()
on victimClient.CurrentAliasId equals victimAlias.AliasId
join punisherClient in context.Clients
join punisherClient in context.Clients.AsNoTracking()
on penalty.PunisherId equals punisherClient.ClientId
join punisherAlias in context.Aliases
join punisherAlias in context.Aliases.AsNoTracking()
on punisherClient.CurrentAliasId equals punisherAlias.AliasId
//orderby penalty.When descending
select new ProfileMeta()
@ -170,6 +172,9 @@ namespace SharedLibraryCore.Services
var pi = ((PenaltyInfo)p.Value);
if (pi.TimeRemaining.Length > 0)
pi.TimeRemaining = (DateTime.Parse(((PenaltyInfo)p.Value).TimeRemaining) - now).TimeSpanText();
// todo: why does this have to be done?
if (pi.Type.Length > 2)
pi.Type = ((Penalty.PenaltyType)Convert.ToInt32(pi.Type)).ToString();
}
);
return list;
@ -203,7 +208,16 @@ namespace SharedLibraryCore.Services
When = penalty.When
};
// fixme: is this good and fast?
return await iqPenalties.ToListAsync();
var list = await iqPenalties.ToListAsync();
list.ForEach(p =>
{
// todo: why does this have to be done?
if (((PenaltyInfo)p.Value).Type.Length < 2)
((PenaltyInfo)p.Value).Type = ((Penalty.PenaltyType)Convert.ToInt32(((PenaltyInfo)p.Value).Type)).ToString();
});
return list;
}