Example #1
0
        public static string SetInitRole(string playerHash, string roomHash)
        {
            CRoom r = CRoom.GetRoom(roomHash);

            if (r == null)
            {
                return(null);
            }

            r.UpdatePlayerRoles(playerHash);
            return("OK");
        }
Example #2
0
        public static string GetGameEndStatus(string roomHash)
        {
            CRoom r = CRoom.GetRoom(roomHash);

            if (r == null)
            {
                return(null);
            }
            string answer = r.GetGameResponses();

            return(answer);
        }
Example #3
0
        public static string GetGameSettings(string roomHash)
        {
            CRoom r = CRoom.GetRoom(roomHash);

            if (r == null)
            {
                return(null);
            }

            var json = new JavaScriptSerializer().Serialize(r.GetGameSettings());

            return(json);
        }
Example #4
0
        public static string GetActiveGameUsers(string playerhash, string roomHash)
        {
            CRoom r = CRoom.GetRoom(roomHash);

            if (r == null)
            {
                return(null);
            }
            InGamePlayer[] allPlayers = r.GetAllGamesPlayers(playerhash).ToArray();


            var json = new JavaScriptSerializer().Serialize(allPlayers);

            return(json);
        }
Example #5
0
        public static string SetResponse(string playerHash, string roomHash, string response)
        {
            CRoom r = CRoom.GetRoom(roomHash);

            if (r == null)
            {
                return(null);
            }
            if (r.UpdatePlayerResponse(roomHash, playerHash, response))
            {
                return("OK");
            }
            else
            {
                return("NotOK");
            }
        }