public bool CreateRoom()
        {
            JSONClass json = new JSONClass();

            json.Add("id", REQUEST_ROOM_NUMBER);
            json.Add("pw", "");
            string recData = UXRestConnect.Request("launchers/token", UXRestConnect.REST_METHOD_POST, json.ToString());

            if (recData == null)
            {
                return(false);
            }
            var  N      = JSON.Parse(recData);
            int  rec    = N["gp_ack"].AsInt;
            bool result = (rec == UXRoomConnect.ACK_RESULT_OK);

            if (result == true)
            {
                launcherCode = N["l_code"].AsInt;
            }
            else
            {
                return(false);
            }
            return(result);
        }
        public string getGameInfo(int gameCode)
        {
            JSONClass json    = new JSONClass();
            string    recData = UXRestConnect.Request("/games/desc/?game_uid=" + gameCode + "&launcher_uid=" + launcherCode, UXRestConnect.REST_METHOD_GET, json.ToString());

            return(recData);
        }
        public string getGameList()
        {
            JSONClass json    = new JSONClass();
            string    recData = UXRestConnect.Request("/games?type=download&launcher_uid=" + launcherCode + "&start_idx=0&offset=100", UXRestConnect.REST_METHOD_GET, json.ToString());

            return(recData);
        }
예제 #4
0
        public int GetUserCodeFromServer()
        {
            string recData = UXRestConnect.Request("user/uuid", UXRestConnect.REST_METHOD_GET, "");

            Debug.Log(recData);

            var N = JSON.Parse(recData);

            code = N["uuid"].AsInt;

            isUserLogin = true;

            return(UXRestConnect.RESULT_TRUE);
        }
예제 #5
0
        /*** REST를 통해 방을 생성함. ***/
        public bool CreateRoom(string package, int maxClient)
        {
            UXConnectController.SetMode(UXConnectController.Mode.Host);

            string recData = UXRestConnect.Request("room/create?package=" + package + "&max_client=" + maxClient, UXRestConnect.REST_METHOD_GET, "");             //room/create:방만드는애

            if (recData == null)
            {
                return(false);
            }

            var N = JSON.Parse(recData);

            RoomNumber = int.Parse(N["roomNumber"]).ToString("00000");
            player.SetCode(N ["uuid"].AsInt);

            return(true);
        }