Esempio n. 1
0
        public int login(String username, String password) 
        {
            //MessageBox.Show("LoginSession?uname=" + username + "&passhash=" + MD5hash.GetHashString(password));


            String pwHash = MD5hash.GetHashString(password).ToLower();
            

            String json = Request("LoginSession?uname=" + username + "&passhash=" + pwHash, Method.GET);
            ResponseObject response = new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize<ResponseObject>(json);
            //int wird returnt
            if (response.isOk())
                return Int32.Parse(response.data.ToString());
            throw new Exception(response.errormsg);
        }
Esempio n. 2
0
        public RekrutEventList CurrentRekrutEvents(int dorfId, int session)
        {
            String json = Request("CurrentRekrutEvents?dorfId=" + dorfId + "&sessionid=" + session, Method.GET);
            ResponseObject response = new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize<ResponseObject>(json);

            if (response.isOk())
            {
                return new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize<RekrutEventList>(this.getDataJsonStrignFromROStrign(json));
            }
            throw new Exception(response.errormsg);

        }
Esempio n. 3
0
        public DorfMap DorfDetailMap(int dorfId) 
        {
            String json = Request("DorfDetailMap?id=" + dorfId , Method.GET);
            ResponseObject response = new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize<ResponseObject>(json);

            if (response.isOk())
            {
                return new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize<DorfMap>(this.getDataJsonStrignFromROStrign(json));
            }
            throw new Exception(response.errormsg);
        }
Esempio n. 4
0
        internal void BuildCommand(int id, string gebTyp, int session)
        {
            String json = Request("BuildCommand?dorfid=" + id + "&GebTyp="+gebTyp +"&sessionid=" + session, Method.GET);
            ResponseObject response = new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize<ResponseObject>(json);

            if (!response.isOk())
                throw new Exception(response.errormsg);

        }
Esempio n. 5
0
        public MapDorfCollection getDorfCoordinates() {
            String json = Request("Map", Method.GET);
            
            ResponseObject response = new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize<ResponseObject>(json);


            if (response.isOk())
            {
             

                //MessageBox.Show(this.getDataJsonStrignFromROStrign(json));
                MapDorfCollection mdc = new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize<MapDorfCollection>(this.getDataJsonStrignFromROStrign(json));

                foreach (DorfMap d in mdc.doerfer) {
                    Console.WriteLine("----" + d.id);
                }

                return mdc;
               
            }

           throw new Exception(response.errormsg);
        }
Esempio n. 6
0
        public Dorf getDorfDetial(int dorfid, int session)
        {
            String json = Request("DorfDetailFull?id=" + dorfid + "&sessionid="+session, Method.GET);

            ResponseObject response = new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize<ResponseObject>(json);

            if (response.isOk())
            {
                return new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize<Dorf>(this.getDataJsonStrignFromROStrign(json)); 
            }
            throw new Exception(response.errormsg);
        }
Esempio n. 7
0
        public Spieler getSpielerDetial(String username)
        {
            String json = Request("SpielerDetail?username=" + username, Method.GET);
            ResponseObject response = new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize<ResponseObject>(json);

            if (response.isOk())
            {
                return new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize<Spieler>(this.getDataJsonStrignFromROStrign(json)); 
            }
            throw new Exception(response.errormsg);
        }
Esempio n. 8
0
        public String register(String username, String password) 
        {
            //MessageBox.Show("Credentials?username="******"&password_md5=" + MD5hash.GetHashString(password));
            String pwHash = MD5hash.GetHashString(password).ToLower();

            String ret = Request("Credentials?username="******"&password_md5=" + pwHash, Method.PUT);

            ResponseObject response = new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize<ResponseObject>(ret);

            if (response.isOk())
                return (String)response.data;
            throw new Exception(response.errormsg);
        }