Exemplo n.º 1
0
        //[TypeFilter(typeof(HyperMediaFilter))]
        public IActionResult Get(int heroeClass = (int)enHeroeClass.ALL)
        {
            //return new OkObjectResult(_mccBusiness.FindAll());

            var ret = _business.FindAll((enHeroeClass)heroeClass);

            if (ret == null)
            {
                return(NotFound());
            }
            ResponseVO <HeroeVO> vr = new ResponseVO <HeroeVO>();

            vr.serverResponse = ret;
            return(Ok(vr));
        }
Exemplo n.º 2
0
    public static JSONNode SignUpUser(string userName, string email, string password)
    {
        HttpWebRequest request = (HttpWebRequest)WebRequest.Create(String.Format("http://182.18.139.143/WITSCLOUD/DEVELOPMENT/dartweb/index.php/api/register?name={0}&username={1}&email={2}&password={3}", userName, email, email, password));

        //request.Timeout = 5000;
        request.Method = "POST";
        //request.ReadWriteTimeout = 5000;
        HttpWebResponse response     = (HttpWebResponse)request.GetResponse();
        StreamReader    reader       = new StreamReader(response.GetResponseStream());
        string          jsonResponse = reader.ReadToEnd();
        ResponseVO      info         = JsonUtility.FromJson <ResponseVO>(jsonResponse);
        JSONNode        jsonNode     = SimpleJSON.JSON.Parse(jsonResponse);

        //info.data = jsonNode["data"].ToString();
        //Debug.Log ("Department 0 "+ jsonNode[0].ToString());
        //UserInfo userDetails = JsonUtility.FromJson<UserInfo>(jsonNode["data"].ToString());

        return(jsonNode);
    }
Exemplo n.º 3
0
    public static ResponseVO ExitGameRoom(string game_id, string gameResult)
    {
        string requestString = String.Format("http://182.18.139.143:8282/public/webresources/app/api/v1/game/exit?user_id={0}&game_id={1}&game_data={2}", GameManager.userInfo.id, game_id, gameResult);
        // requestString = "http://182.18.139.143:8282/public/webresources/app/api/v1/game/start?user_id=102452&game_type=1&game_data=[]";
        HttpWebRequest request = (HttpWebRequest)WebRequest.Create(requestString);

        request.Headers.Add("Authorization", "Bearer " + GameManager.userToken);
        request.Timeout          = 9000;
        request.Method           = "POST";
        request.ReadWriteTimeout = 9000;
        HttpWebResponse response     = (HttpWebResponse)request.GetResponse();
        StreamReader    reader       = new StreamReader(response.GetResponseStream());
        string          jsonResponse = reader.ReadToEnd();
        ResponseVO      info         = JsonUtility.FromJson <ResponseVO>(jsonResponse);
        JSONNode        jsonNode     = SimpleJSON.JSON.Parse(jsonResponse);

        info.data = jsonNode["game"].ToString();

        return(info);
    }