Example #1
0
        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);
        }