public void HandleClientName(NetIncomingMessage msg) { string name = msg.ReadString(); ClientList[msg.SenderConnection].PlayerName = name; string fixedname = name.Trim(); if (fixedname.Length < 3) { fixedname = "Player"; } IPlayerSession p = IoCManager.Resolve <IPlayerManager>().GetSessionByConnection(msg.SenderConnection); p.SetName(fixedname); }