Exemple #1
0
        /// <summary>
        /// Get opponent client from matching queue.
        /// </summary>
        /// <param name="client"> Client who request matching. </param>
        public static void MatchingRequest(Client client)
        {
            var oppoClient = MatchingManager.MatchProcess(client);

            if (oppoClient == null)
                return;

            oppoClient.BeginSend("OnSucceedMatching", client.MatchingData);
            client.BeginSend("OnSucceedMatching", oppoClient.MatchingData);
        }
Exemple #2
0
        /// <summary>
        /// Get client info from DB whis has same device ID.
        /// </summary>
        /// <param name="client"> Accepted client. </param>
        public static void LoginRequest(Client client)
        {
            //DatabaseManager.GetClientInfo(client);

            // Write code to get Login Information from DB (now temporary)
            var nick = "Ragdoll";
            var wins = 10;
            var loses = 5;
            // ...

            client.LoginData = new ProfilePacket
            {
                NickName = nick,
                Wins = wins,
                Loses = loses
            };
            client.BeginSend("OnSucceedLogin", client.LoginData);
        }