Exemple #1
0
        // called when the client identifies himself
        public void ConnexionPlayer(TBSEngine.Controllers.Player player)
        {
            Console.WriteLine(player.Name + " joined");

            m_player = player;
            SetRoom(new PrincipalMenuRoom());
        }
Exemple #2
0
        public void ConnexionUser(string username, string password)
        {
            Console.WriteLine("Function called : ConnexionPlayer");

            TBSEngine.Controllers.Player player = null;

            string token = null;

            if ((token = TBS.APICore.APIManager.Instance.GetTokenSync(username, password)) == null)
            {
                //Console.WriteLine("Error : player " + username + " not found !");
                //m_client.SendFunction.Error("No player founded with this playerName !");
                m_client.SendFunction.ConnexionUser("null");
                return;
            }

            // If Player credentials exist
            player = TBSEngine.Database.Players.Find(x => x.Name == username);
            m_client.ConnexionPlayer(player);
            m_client.SendFunction.ConnexionUser(token);
        }