Example #1
0
        private static void GetPlayer(ClientInfo clientInfo, JObject jsonObject)
        {
            var gameIdToken          = jsonObject["gameId"];
            var playerSeatIndexToken = jsonObject["playerSeatIndex"];

            if ((gameIdToken == null) || (gameIdToken.Type != JTokenType.Integer) ||
                (playerSeatIndexToken == null) || (playerSeatIndexToken.Type != JTokenType.Integer))
            {
                throw new ArgumentException("Error: Parameters Mismatch at Get Player.");
            }

            var gameId          = (int)gameIdToken;
            var playerSeatIndex = (int)playerSeatIndexToken;

            SendMessage(clientInfo, new { response = sl.GetPlayer(gameId, playerSeatIndex) });
        }