1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 15:20:48 -05:00

Fixed GetClientByName to match portions again.

Player specification can include "quotes"
This commit is contained in:
RaidMax
2017-06-16 17:35:51 -04:00
parent 2dc8f55e7c
commit 622a0a8ddc
5 changed files with 173 additions and 182 deletions

View File

@ -26,7 +26,7 @@ namespace SharedLibrary
Players = new List<Player>(new Player[18]);
events = new Queue<Event>();
Reports = new List<Report>();
PlayerHistory = new Queue<SharedLibrary.Helpers.PlayerHistory>();
PlayerHistory = new Queue<Helpers.PlayerHistory>();
ChatHistory = new List<Chat>();
lastWebChat = DateTime.Now;
nextMessage = 0;
@ -138,7 +138,10 @@ namespace SharedLibrary
/// <returns>Matching player if found</returns>
public Player GetClientByName(String pName)
{
return Players.FirstOrDefault(p => p != null && p.Name.ToLower() == pName.ToLower());
string[] QuoteSplit = pName.Split('"');
if (QuoteSplit.Length > 1)
pName = QuoteSplit[1];
return Players.FirstOrDefault(p => p != null && p.Name.ToLower().Contains(pName.ToLower()));
}
/// <summary>