mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 15:20:48 -05:00
upgrade packages, and delete a few unneeded ones
fix search for client resulting in invalid GUID parse simplify output from dvar not being found make sure to prompt if not all servers could be reached
This commit is contained in:
@ -1119,8 +1119,8 @@ namespace SharedLibraryCore.Commands
|
||||
E.Origin.PasswordSalt = hashedPassword[1];
|
||||
|
||||
// update the password for the client in privileged
|
||||
E.Owner.Manager.PrivilegedClients[E.Origin.ClientId].Password = hashedPassword[0];
|
||||
E.Owner.Manager.PrivilegedClients[E.Origin.ClientId].PasswordSalt = hashedPassword[1];
|
||||
//E.Owner.Manager.PrivilegedClients[E.Origin.ClientId].Password = hashedPassword[0];
|
||||
//E.Owner.Manager.PrivilegedClients[E.Origin.ClientId].PasswordSalt = hashedPassword[1];
|
||||
|
||||
await E.Owner.Manager.GetClientService().Update(E.Origin);
|
||||
E.Origin.Tell(Utilities.CurrentLocalization.LocalizationIndex["COMMANDS_PASSWORD_SUCCESS"]);
|
||||
|
@ -24,7 +24,6 @@ namespace SharedLibraryCore.Interfaces
|
||||
ClientService GetClientService();
|
||||
AliasService GetAliasService();
|
||||
PenaltyService GetPenaltyService();
|
||||
IDictionary<int, EFClient> PrivilegedClients { get; }
|
||||
/// <summary>
|
||||
/// Get the event handlers
|
||||
/// </summary>
|
||||
|
@ -413,7 +413,7 @@ namespace SharedLibraryCore.Services
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<List<EFClient>> GetPrivilegedClients()
|
||||
public async Task<List<EFClient>> GetPrivilegedClients(bool includeName = true)
|
||||
{
|
||||
using (var context = new DatabaseContext(disableTracking: true))
|
||||
{
|
||||
@ -451,7 +451,13 @@ namespace SharedLibraryCore.Services
|
||||
|
||||
using (var context = new DatabaseContext(disableTracking: true))
|
||||
{
|
||||
long networkId = identifier.ConvertGuidToLong();
|
||||
long? networkId = null;
|
||||
try
|
||||
{
|
||||
networkId = identifier.ConvertGuidToLong();
|
||||
}
|
||||
catch { }
|
||||
|
||||
int? ipAddress = identifier.ConvertToIP();
|
||||
|
||||
IQueryable<EFAlias> iqLinkIds = context.Aliases.Where(_alias => _alias.Active);
|
||||
@ -477,10 +483,11 @@ namespace SharedLibraryCore.Services
|
||||
var iqClients = context.Clients
|
||||
.Where(_client => _client.Active);
|
||||
|
||||
if (networkId != long.MinValue)
|
||||
if (networkId.HasValue)
|
||||
{
|
||||
iqClients = iqClients.Where(_client => networkId == _client.NetworkId);
|
||||
iqClients = iqClients.Where(_client => networkId.Value == _client.NetworkId);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
iqClients = iqClients.Where(_client => linkIds.Contains(_client.AliasLinkId));
|
||||
|
@ -24,9 +24,9 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Jint" Version="2.11.58" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.2.2" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.2" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.2.2">
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.2.4" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.4" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.2.4">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||
</PackageReference>
|
||||
@ -35,8 +35,8 @@
|
||||
<PackageReference Include="Microsoft.Extensions.Localization" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="2.2.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
|
||||
<PackageReference Include="Npgsql" Version="4.0.4" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
|
||||
<PackageReference Include="Npgsql" Version="4.0.6" />
|
||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="2.2.0" />
|
||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="2.2.0" />
|
||||
<PackageReference Include="SimpleCrypto.NetCore" Version="1.0.0" />
|
||||
|
@ -299,7 +299,7 @@ namespace SharedLibraryCore
|
||||
|
||||
public static int? ConvertToIP(this string str)
|
||||
{
|
||||
bool success = System.Net.IPAddress.TryParse(str, out System.Net.IPAddress ip);
|
||||
bool success = IPAddress.TryParse(str, out IPAddress ip);
|
||||
return success && ip.GetAddressBytes().Count(_byte => _byte == 0) != 4 ?
|
||||
(int?)BitConverter.ToInt32(ip.GetAddressBytes(), 0) :
|
||||
null;
|
||||
@ -307,7 +307,7 @@ namespace SharedLibraryCore
|
||||
|
||||
public static string ConvertIPtoString(this int? ip)
|
||||
{
|
||||
return !ip.HasValue ? "" : new System.Net.IPAddress(BitConverter.GetBytes(ip.Value)).ToString();
|
||||
return !ip.HasValue ? "" : new IPAddress(BitConverter.GetBytes(ip.Value)).ToString();
|
||||
}
|
||||
|
||||
public static string GetTimePassed(DateTime start)
|
||||
|
Reference in New Issue
Block a user