Example #1
0
        /// <summary>
        /// Handler for player cards request
        /// </summary>
        /// <param name="netMsg"></param>
        private void OnPlayerCardsRequest(NetworkMessage netMsg)
        {
            var userId    = SessionManager.GetPlayerId(netMsg.Sender);
            var userDecks = PlayerDeckCards.GetPlayerDecks(userId);

            if (userDecks.Count > 0)
            {
                Server.SendToClient(netMsg.Sender, LoginEvent.PLAYER_CARDS_SUCCESS, userDecks);
            }
            else
            {
                Server.SendToClient(netMsg.Sender, LoginEvent.PLAYER_CARDS_FAIL, null);
            }
        }
Example #2
0
        /// <summary>
        /// Handler for player cards request
        /// </summary>
        /// <param name="netMsg"></param>
        private void OnPlayerCardsRequest(NetworkMessage netMsg)
        {
            var userId    = SessionManager.GetPlayerId(netMsg.Sender);
            var userDecks = PlayerDeckCards.GetPlayerDecks(userId);

            if (userDecks.Count > 0)
            {
                server.SendToClient(netMsg.Sender, NetworkEvents.PLAYER_CARDS_SUCCESS, userDecks);
            }
            else
            {
                Debug.Warning("Notify him soon");
                server.SendToClient(netMsg.Sender, NetworkEvents.PLAYER_CARDS_FAIL, null);
            }
        }