This commit is contained in:
EntenKoeniq
2021-08-22 13:59:15 +02:00
parent d9ea3f426a
commit 72d8f9b92b
10 changed files with 131 additions and 79 deletions

View File

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using Lidgren.Network;
@ -124,6 +125,11 @@ namespace CoopServer
return Server.Players;
}
public static Entities.EntitiesPlayer GetPlayerByUsername(string username)
{
return Server.Players.FirstOrDefault(x => x.Value.Username == username).Value;
}
public static void KickPlayerByUsername(string username, string[] reason)
{
NetConnection userConnection = Util.GetConnectionByUsername(username);