Added ID check on ClientService.GetClientByName
This commit is contained in:
@@ -24,6 +24,13 @@ namespace reallife_gamemode.Server.Services
|
|||||||
name = name.ToLower();
|
name = name.ToLower();
|
||||||
|
|
||||||
List<Client> playerList = NAPI.Pools.GetAllPlayers();
|
List<Client> playerList = NAPI.Pools.GetAllPlayers();
|
||||||
|
|
||||||
|
if(int.TryParse(name, out int id))
|
||||||
|
{
|
||||||
|
toReturn = playerList.Find(p => p.Handle.Value == id);
|
||||||
|
return toReturn;
|
||||||
|
}
|
||||||
|
|
||||||
toReturn = playerList.Find(p => p.Name.ToLower() == name);
|
toReturn = playerList.Find(p => p.Name.ToLower() == name);
|
||||||
|
|
||||||
if(toReturn == null)
|
if(toReturn == null)
|
||||||
|
|||||||
Reference in New Issue
Block a user