Esempio n. 1
0
        public static bool isValidPlayer(out Player player, string login, string pass)
        {
            opensudokuDataSet.playerRow pr = DAO.AccessDAO.getPlayerInfos(login, pass);
            if (pr !=null)
            {
                player = new Player((uint)pr.id, pr.login, pr.email, pr.score);

                return true;
            }
            else
            {
                player = null;
                return false;
            }
        }
Esempio n. 2
0
 public PlayerEventArgs(Player player)
 {
     m_player = player;
 }
Esempio n. 3
0
 public PlayerNewTableEventArgs(Player player, GameLevel difficulty, UInt16 numPlayer)
     : base(player)
 {
     m_difficulty = difficulty;
     m_numPlayer = numPlayer;
 }
Esempio n. 4
0
 public UpdateTableCellEventArgs(Player player, uint tableID, UInt16 cellNum, UInt16 cellValue)
     : base(player, tableID)
 {
     m_cellNum = cellNum;
     m_cellValue = cellValue;
 }
Esempio n. 5
0
 public PlayerTableEventArgs(Player player, uint tableID)
     : base(player)
 {
     m_tableID = tableID;
 }
Esempio n. 6
0
 public PlayerTableChatSendEventArgs(Player player, uint tableID, string message)
     : base(player, tableID)
 {
     m_message = message;
 }
Esempio n. 7
0
 public PlayerPublicChatSendEventArgs(Player player, string message)
     : base(player)
 {
     m_message = message;
 }
Esempio n. 8
0
        private void PlayerLoginReceived(PDAuthentification pdReceived)
        {
            bool succeeded;
            Player player = null;

            if (Player.isValidPlayer(out player, pdReceived.Login, pdReceived.Pass))
            {
                succeeded = true;
                m_player = player;

                m_authentified = succeeded;
                PDAuthentificationResp pd = new PDAuthentificationResp(player.PlayerID, player.Login, player.Email, player.Score);
                m_socketClient.sendPacket(pd);

                if (PlayerConectedEvent != null)
                {
                    PlayerConectedEvent(this, new PlayerEventArgs(player));
                }
            #if DEBUG
                Console.WriteLine("PlayerLoginReceived " + player);
            #endif
            }
            else
            {
                succeeded = false;

                m_authentified = succeeded;
                PDAuthentificationResp pd = new PDAuthentificationResp(succeeded);
                m_socketClient.sendPacket(pd);
            #if DEBUG
                Console.WriteLine("PlayerLoginReceived invalid user : "******"@" + pdReceived.Pass);
            #endif
            }
        }