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

use "world client" when recieving fall damage/damage

fix rare bug with GetClientByName
refactor some alias/ef stuff. still more to do
This commit is contained in:
RaidMax
2019-04-02 20:20:37 -05:00
parent 8a7c4e4cf0
commit 11dc020d7c
15 changed files with 358 additions and 315 deletions

View File

@ -87,6 +87,11 @@ namespace SharedLibraryCore
/// <returns>Matching player if found</returns>
public List<EFClient> GetClientByName(String pName)
{
if (string.IsNullOrEmpty(pName))
{
return new List<EFClient>();
}
string[] QuoteSplit = pName.Split('"');
bool literal = false;
if (QuoteSplit.Length > 1)
@ -95,9 +100,11 @@ namespace SharedLibraryCore
literal = true;
}
if (literal)
return Clients.Where(p => p != null && p.Name.ToLower().Equals(pName.ToLower())).ToList();
{
return GetClientsAsList().Where(p => p.Name?.ToLower() == pName.ToLower()).ToList();
}
return Clients.Where(p => p != null && p.Name.ToLower().Contains(pName.ToLower())).ToList();
return GetClientsAsList().Where(p => (p.Name?.ToLower() ?? "").Contains(pName.ToLower())).ToList();
}
virtual public Task<bool> ProcessUpdatesAsync(CancellationToken cts) => (Task<bool>)Task.CompletedTask;
@ -313,6 +320,7 @@ namespace SharedLibraryCore
// Internal
public string IP { get; protected set; }
public string Version { get; protected set; }
public bool IsInitialized { get; set; }
protected int Port;
protected string FSGame;