예제 #1
0
        public ReqRanking(string[] inames, Network.ResponseCallback response)
        {
            this.name = "btl/usedunit/multiple";
            StringBuilder stringBuilder = WebAPI.GetStringBuilder();

            stringBuilder.Append("\"inames\":[");
            for (int index = 0; index < inames.Length; ++index)
            {
                stringBuilder.Append("\"");
                stringBuilder.Append(JsonEscape.Escape(inames[index]));
                if (index == inames.Length - 1)
                {
                    stringBuilder.Append("\"]");
                }
                else
                {
                    stringBuilder.Append("\",");
                }
            }
            this.body     = stringBuilder.ToString();
            this.body     = WebAPI.GetRequestString(this.body);
            this.callback = response;
        }
예제 #2
0
        public ReqAbilityRankUp(Dictionary <long, int> abilities, Network.ResponseCallback response, string trophyprog = null, string bingoprog = null)
        {
            this.name = "unit/job/abil/lvup";
            StringBuilder stringBuilder = WebAPI.GetStringBuilder();

            stringBuilder.Append("\"aps\":[");
            string str = string.Empty;

            using (Dictionary <long, int> .Enumerator enumerator = abilities.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    KeyValuePair <long, int> current = enumerator.Current;
                    str += "{";
                    str  = str + "\"iid\":" + (object)current.Key + ",";
                    str  = str + "\"ap\":" + (object)current.Value;
                    str += "},";
                }
            }
            if (str.Length > 0)
            {
                stringBuilder.Append(str.Substring(0, str.Length - 1));
            }
            stringBuilder.Append("]");
            if (!string.IsNullOrEmpty(trophyprog))
            {
                stringBuilder.Append(",");
                stringBuilder.Append(trophyprog);
            }
            if (!string.IsNullOrEmpty(bingoprog))
            {
                stringBuilder.Append(",");
                stringBuilder.Append(bingoprog);
            }
            this.body     = WebAPI.GetRequestString(stringBuilder.ToString());
            this.callback = response;
        }
예제 #3
0
        public ReqGetAccessToken(string deviceid, string secretkey, Network.ResponseCallback response)
        {
            this.name = "gauth/accesstoken";
            this.body = "{";
            ReqGetAccessToken reqGetAccessToken1 = this;

            reqGetAccessToken1.body = reqGetAccessToken1.body + "\"ticket\":" + (object)Network.TicketID + ",";
            this.body += "\"access_token\":\"\",";
            this.body += "\"param\":{";
            ReqGetAccessToken reqGetAccessToken2 = this;

            reqGetAccessToken2.body = reqGetAccessToken2.body + "\"device_id\":\"" + deviceid + "\",";
            ReqGetAccessToken reqGetAccessToken3 = this;

            reqGetAccessToken3.body = reqGetAccessToken3.body + "\"secret_key\":\"" + secretkey + "\"";
            if (!string.IsNullOrEmpty(GameManager.GetIDFA))
            {
                ReqGetAccessToken reqGetAccessToken4 = this;
                reqGetAccessToken4.body = reqGetAccessToken4.body + ",\"idfa\":\"" + GameManager.GetIDFA + "\"";
            }
            this.body    += "}";
            this.body    += "}";
            this.callback = response;
        }
예제 #4
0
        public ReqUnitAwake(long iid, Network.ResponseCallback response, string trophyprog = null, string bingoprog = null, int awake_lv = 0)
        {
            this.name = "unit/plus/add";
            StringBuilder stringBuilder = WebAPI.GetStringBuilder();

            stringBuilder.Append("\"iid\":" + (object)iid);
            if (awake_lv > 0)
            {
                stringBuilder.Append(",");
                stringBuilder.Append("\"target_plus\":" + (object)awake_lv);
            }
            if (!string.IsNullOrEmpty(trophyprog))
            {
                stringBuilder.Append(",");
                stringBuilder.Append(trophyprog);
            }
            if (!string.IsNullOrEmpty(bingoprog))
            {
                stringBuilder.Append(",");
                stringBuilder.Append(bingoprog);
            }
            this.body     = WebAPI.GetRequestString(stringBuilder.ToString());
            this.callback = response;
        }
예제 #5
0
        public ReqVersusDraftSelect(string token, Network.ResponseCallback response)
        {
            GameManager instance = MonoSingleton <GameManager> .Instance;

            this.name = "vs/draft/select";
            List <ReqVersusDraftSelect.RequestDraftUnit> requestDraftUnitList = new List <ReqVersusDraftSelect.RequestDraftUnit>();
            List <VersusDraftUnitParam> versusDraftUnits = instance.GetVersusDraftUnits(instance.VSDraftId);

            for (int i = 0; i < VersusDraftList.VersusDraftUnitDataListPlayer.Count; ++i)
            {
                VersusDraftUnitParam versusDraftUnitParam = versusDraftUnits.Find((Predicate <VersusDraftUnitParam>)(vdup => vdup.DraftUnitId == VersusDraftList.VersusDraftUnitDataListPlayer[i].UniqueID));
                requestDraftUnitList.Add(new ReqVersusDraftSelect.RequestDraftUnit()
                {
                    id     = versusDraftUnitParam.DraftUnitId,
                    secret = !versusDraftUnitParam.IsHidden ? 0 : 1
                });
            }
            this.body = WebAPI.GetRequestString <ReqVersusDraftSelect.RequestParam>(new ReqVersusDraftSelect.RequestParam()
            {
                token        = token,
                draft_result = new ReqVersusDraftSelect.RequestDraftResult()
            });
            this.callback = response;
        }
예제 #6
0
        public ReqGetDeviceID(string secretkey, string udid, Network.ResponseCallback response)
        {
            this.name = "gauth/register";
            this.body = "{";
            ReqGetDeviceID reqGetDeviceId1 = this;

            reqGetDeviceId1.body = reqGetDeviceId1.body + "\"ticket\":" + (object)Network.TicketID + ",";
            this.body           += "\"access_token\":\"\",";
            this.body           += "\"param\":{";
            ReqGetDeviceID reqGetDeviceId2 = this;

            reqGetDeviceId2.body = reqGetDeviceId2.body + "\"secret_key\":\"" + secretkey + "\",";
            ReqGetDeviceID reqGetDeviceId3 = this;

            reqGetDeviceId3.body = reqGetDeviceId3.body + "\"udid\":\"" + udid + "\"";
            if (!string.IsNullOrEmpty(GameManager.GetIDFA))
            {
                ReqGetDeviceID reqGetDeviceId4 = this;
                reqGetDeviceId4.body = reqGetDeviceId4.body + ",\"idfa\":\"" + GameManager.GetIDFA + "\"";
            }
            this.body    += "}";
            this.body    += "}";
            this.callback = response;
        }
예제 #7
0
        public ReqPlayerCheck(string deviceid, string secretkey, Network.ResponseCallback response)
        {
            this.name = "player/chkplayer";
            this.body = "{";
            ReqPlayerCheck reqPlayerCheck1 = this;

            reqPlayerCheck1.body = reqPlayerCheck1.body + "\"ticket\":" + (object)Network.TicketID + ",";
            this.body           += "\"access_token\":\"\",";
            this.body           += "\"param\":{";
            ReqPlayerCheck reqPlayerCheck2 = this;

            reqPlayerCheck2.body = reqPlayerCheck2.body + "\"device_id\":\"" + deviceid + "\",";
            ReqPlayerCheck reqPlayerCheck3 = this;

            reqPlayerCheck3.body = reqPlayerCheck3.body + "\"secret_key\":\"" + secretkey + "\"";
            if (!string.IsNullOrEmpty(GameManager.GetIDFA))
            {
                ReqPlayerCheck reqPlayerCheck4 = this;
                reqPlayerCheck4.body = reqPlayerCheck4.body + ",\"idfa\":\"" + GameManager.GetIDFA + "\"";
            }
            this.body    += "}";
            this.body    += "}";
            this.callback = response;
        }
예제 #8
0
 public ReqDebugDataReset(Network.ResponseCallback response)
 {
     this.name     = "debug/reset";
     this.body     = WebAPI.GetRequestString((string)null);
     this.callback = response;
 }
예제 #9
0
        public ReqJobEquipV2(long iid_unit, string iname_jobset, long slot, bool is_cmn, Network.ResponseCallback response)
        {
            this.name = "unit/job/equip/set2";
            StringBuilder stringBuilder = WebAPI.GetStringBuilder();

            stringBuilder.Append("\"iid\":");
            stringBuilder.Append(iid_unit);
            stringBuilder.Append(",\"iname\":\"");
            stringBuilder.Append(iname_jobset);
            stringBuilder.Append("\"");
            stringBuilder.Append(",\"slot\":");
            stringBuilder.Append(slot);
            stringBuilder.Append(",\"is_cmn\":");
            stringBuilder.Append(!is_cmn ? 0 : 1);
            this.body     = WebAPI.GetRequestString(stringBuilder.ToString());
            this.callback = response;
        }
예제 #10
0
 public ReqItemAddStmPaid(Network.ResponseCallback response)
 {
     this.name     = "item/addstmpaid";
     this.body     = WebAPI.GetRequestString((string)null);
     this.callback = response;
 }
예제 #11
0
        public ReqVersusEnd(long btlid, BtlResultTypes result, string uid, string fuid, uint turn, int[] myhp, int[] enhp, int atk, int dmg, int heal, int beat, Network.ResponseCallback response, VERSUS_TYPE type, string trophyprog = null, string bingoprog = null)
        {
            StringBuilder stringBuilder = WebAPI.GetStringBuilder();

            stringBuilder.Append("vs/");
            stringBuilder.Append(type.ToString().ToLower());
            stringBuilder.Append("match/end");
            this.name            = stringBuilder.ToString();
            stringBuilder.Length = 0;
            stringBuilder.Append("\"btlid\":");
            stringBuilder.Append(btlid);
            stringBuilder.Append(',');
            stringBuilder.Append("\"btlendparam\":{");
            stringBuilder.Append("\"result\":\"");
            switch (result)
            {
            case BtlResultTypes.Win:
                stringBuilder.Append("win");
                break;

            case BtlResultTypes.Lose:
                stringBuilder.Append("lose");
                break;

            case BtlResultTypes.Retire:
                stringBuilder.Append("retire");
                break;

            case BtlResultTypes.Cancel:
                stringBuilder.Append("cancel");
                break;

            case BtlResultTypes.Draw:
                stringBuilder.Append("draw");
                break;
            }
            stringBuilder.Append("\",");
            stringBuilder.Append("\"token\":\"");
            stringBuilder.Append(JsonEscape.Escape(GlobalVars.SelectedMultiPlayRoomName));
            stringBuilder.Append("\",");
            stringBuilder.Append("\"turn\":\"");
            stringBuilder.Append(turn);
            stringBuilder.Append("\"");
            stringBuilder.Append(",");
            stringBuilder.Append("\"atk\":\"");
            stringBuilder.Append(atk);
            stringBuilder.Append("\"");
            stringBuilder.Append(",");
            stringBuilder.Append("\"dmg\":\"");
            stringBuilder.Append(dmg);
            stringBuilder.Append("\"");
            stringBuilder.Append(",");
            stringBuilder.Append("\"heal\":\"");
            stringBuilder.Append(heal);
            stringBuilder.Append("\"");
            stringBuilder.Append(",");
            stringBuilder.Append("\"beatcnt\":");
            stringBuilder.Append(beat);
            if (myhp != null)
            {
                stringBuilder.Append(',');
                stringBuilder.Append("\"myhp\":[");
                for (int index = 0; index < myhp.Length; ++index)
                {
                    if (index > 0)
                    {
                        stringBuilder.Append(',');
                    }
                    stringBuilder.Append(myhp[index].ToString());
                }
                stringBuilder.Append("]");
            }
            if (enhp != null)
            {
                stringBuilder.Append(',');
                stringBuilder.Append("\"enhp\":[");
                for (int index = 0; index < enhp.Length; ++index)
                {
                    if (index > 0)
                    {
                        stringBuilder.Append(',');
                    }
                    stringBuilder.Append(enhp[index].ToString());
                }
                stringBuilder.Append("]");
            }
            if ((int)stringBuilder[stringBuilder.Length - 1] == 44)
            {
                --stringBuilder.Length;
            }
            stringBuilder.Append("},");
            stringBuilder.Append("\"uid\":\"");
            stringBuilder.Append(uid);
            stringBuilder.Append("\",");
            stringBuilder.Append("\"fuid\":\"");
            stringBuilder.Append(fuid);
            stringBuilder.Append("\"");
            if (!string.IsNullOrEmpty(trophyprog))
            {
                stringBuilder.Append(",");
                stringBuilder.Append(trophyprog);
            }
            if (!string.IsNullOrEmpty(bingoprog))
            {
                stringBuilder.Append(",");
                stringBuilder.Append(bingoprog);
            }
            this.body     = WebAPI.GetRequestString(stringBuilder.ToString());
            this.callback = response;
        }
예제 #12
0
        public ReqAuthEmailRegister(string email, string password, string device_id, string secret_key, string udid, Network.ResponseCallback response)
        {
            this.name = "auth/email/register";
            this.body = "{";
            ReqAuthEmailRegister authEmailRegister1 = this;

            authEmailRegister1.body = authEmailRegister1.body + "\"ticket\":" + (object)Network.TicketID + ",";
            this.body += "\"access_token\":\"\",";
            ReqAuthEmailRegister authEmailRegister2 = this;

            authEmailRegister2.body = authEmailRegister2.body + "\"email\":\"" + email + "\",";
            ReqAuthEmailRegister authEmailRegister3 = this;

            authEmailRegister3.body = authEmailRegister3.body + "\"password\":\"" + password + "\",";
            this.body += "\"disable_validation_email\":true,";
            ReqAuthEmailRegister authEmailRegister4 = this;

            authEmailRegister4.body = authEmailRegister4.body + "\"device_id\":\"" + device_id + "\",";
            ReqAuthEmailRegister authEmailRegister5 = this;

            authEmailRegister5.body = authEmailRegister5.body + "\"secret_key\":\"" + secret_key + "\",";
            ReqAuthEmailRegister authEmailRegister6 = this;

            authEmailRegister6.body = authEmailRegister6.body + "\"udid\":\"" + udid + "\"";
            this.body    += "}";
            this.callback = response;
        }
예제 #13
0
        public ReqMPRoomMake(string iname, string comment, string passCode, bool isPrivate, bool limit, int unitlv, bool clear, Network.ResponseCallback response)
        {
            this.name = "btl/room/make";
            this.body = string.Empty;
            ReqMPRoomMake reqMpRoomMake1 = this;

            reqMpRoomMake1.body = reqMpRoomMake1.body + "\"iname\":\"" + JsonEscape.Escape(iname) + "\"";
            ReqMPRoomMake reqMpRoomMake2 = this;

            reqMpRoomMake2.body = reqMpRoomMake2.body + ",\"comment\":\"" + JsonEscape.Escape(comment) + "\"";
            ReqMPRoomMake reqMpRoomMake3 = this;

            reqMpRoomMake3.body = reqMpRoomMake3.body + ",\"pwd\":\"" + JsonEscape.Escape(passCode) + "\"";
            ReqMPRoomMake reqMpRoomMake4 = this;

            reqMpRoomMake4.body = reqMpRoomMake4.body + ",\"private\":" + (object)(!isPrivate ? 0 : 1);
            ReqMPRoomMake reqMpRoomMake5 = this;

            reqMpRoomMake5.body = reqMpRoomMake5.body + ",\"req_at\":" + (object)Network.GetServerTime();
            ReqMPRoomMake reqMpRoomMake6 = this;

            reqMpRoomMake6.body = reqMpRoomMake6.body + ",\"limit\":" + (object)(!limit ? 0 : 1);
            ReqMPRoomMake reqMpRoomMake7 = this;

            reqMpRoomMake7.body = reqMpRoomMake7.body + ",\"unitlv\":" + (object)unitlv;
            ReqMPRoomMake reqMpRoomMake8 = this;

            reqMpRoomMake8.body = reqMpRoomMake8.body + ",\"clear\":" + (object)(!clear ? 0 : 1);
            this.body           = WebAPI.GetRequestString(this.body);
            this.callback       = response;
        }
예제 #14
0
 public ReqTowerSupporter(Network.ResponseCallback response)
 {
     this.name     = "tower/supportlist";
     this.body     = WebAPI.GetRequestString((string)null);
     this.callback = response;
 }
예제 #15
0
        public ReqMPRoomMake(string iname, string comment, string passCode, bool isPrivate, Network.ResponseCallback response)
        {
            this.name = "btl/room/make";
            this.body = string.Empty;
            ReqMPRoomMake reqMpRoomMake1 = this;

            reqMpRoomMake1.body = reqMpRoomMake1.body + "\"iname\":\"" + JsonEscape.Escape(iname) + "\"";
            ReqMPRoomMake reqMpRoomMake2 = this;

            reqMpRoomMake2.body = reqMpRoomMake2.body + ",\"comment\":\"" + JsonEscape.Escape(comment) + "\"";
            ReqMPRoomMake reqMpRoomMake3 = this;

            reqMpRoomMake3.body = reqMpRoomMake3.body + ",\"pwd\":\"" + JsonEscape.Escape(passCode) + "\"";
            ReqMPRoomMake reqMpRoomMake4 = this;

            reqMpRoomMake4.body = reqMpRoomMake4.body + ",\"private\":" + (object)(!isPrivate ? 0 : 1);
            this.body           = WebAPI.GetRequestString(this.body);
            this.callback       = response;
        }
예제 #16
0
 public ReqFirstChargeBonus(Network.ResponseCallback _response)
 {
     this.name     = "charge/bonus/exec";
     this.body     = WebAPI.GetRequestString((string)null);
     this.callback = _response;
 }
예제 #17
0
        public ReqVersusMake(VERSUS_TYPE type, string comment, string iname, bool isLine = false, Network.ResponseCallback response = null)
        {
            this.name = "vs/" + type.ToString().ToLower() + "match/make";
            this.body = string.Empty;
            ReqVersusMake reqVersusMake1 = this;

            reqVersusMake1.body = reqVersusMake1.body + "\"comment\":\"" + JsonEscape.Escape(comment) + "\",";
            ReqVersusMake reqVersusMake2 = this;

            reqVersusMake2.body = reqVersusMake2.body + "\"iname\":\"" + JsonEscape.Escape(iname) + "\",";
            ReqVersusMake reqVersusMake3 = this;

            reqVersusMake3.body = reqVersusMake3.body + "\"Line\":" + (object)(!isLine ? 0 : 1);
            this.body           = WebAPI.GetRequestString(this.body);
            this.callback       = response;
        }
예제 #18
0
        public ReqEquipExpAdd(long iid, int slot, Dictionary <string, int> usedItems, Network.ResponseCallback response)
        {
            this.name = "unit/job/equip/enforce";
            this.body = "\"iid\":" + (object)iid + ",";
            ReqEquipExpAdd reqEquipExpAdd = this;

            reqEquipExpAdd.body = reqEquipExpAdd.body + "\"id_equip\":" + (object)slot + ",";
            this.body          += "\"mats\":[";
            string str = string.Empty;

            using (Dictionary <string, int> .Enumerator enumerator = usedItems.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    KeyValuePair <string, int> current = enumerator.Current;
                    str += "{";
                    str  = str + "\"iname\":\"" + current.Key + "\",";
                    str  = str + "\"num\":" + (object)current.Value;
                    str += "},";
                }
            }
            if (str.Length > 0)
            {
                str = str.Substring(0, str.Length - 1);
            }
            this.body    += str;
            this.body    += "]";
            this.body     = WebAPI.GetRequestString(this.body);
            this.callback = response;
        }
 public ReqChatChannelAutoAssign(Network.ResponseCallback response)
 {
     this.name     = "chat/channel/auto";
     this.body     = WebAPI.GetRequestString((string)null);
     this.callback = response;
 }
예제 #20
0
 public ReqBtlColo(Network.ResponseCallback response)
 {
     this.name     = "btl/colo";
     this.body     = WebAPI.GetRequestString(WebAPI.GetStringBuilder().ToString());
     this.callback = response;
 }
예제 #21
0
        public ReqChatMessageRoom(long start_id, string room_token, int limit, long exclude_id, bool isMultiPush, Network.ResponseCallback response)
        {
            StringBuilder stringBuilder = WebAPI.GetStringBuilder();

            this.name = "chat/room/message";
            stringBuilder.Append("\"start_id\":" + start_id.ToString() + ",");
            if (!string.IsNullOrEmpty(room_token))
            {
                stringBuilder.Append("\"room_token\":\"" + room_token + "\",");
            }
            stringBuilder.Append("\"limit\":" + limit.ToString() + ",");
            stringBuilder.Append("\"exclude_id\":" + exclude_id.ToString());
            if (isMultiPush)
            {
                stringBuilder.Append(",\"is_multi_push\":1");
            }
            this.body     = WebAPI.GetRequestString(stringBuilder.ToString());
            this.callback = response;
        }
예제 #22
0
 public ReqFgGAuth(Network.ResponseCallback response)
 {
     this.name     = "achieve/auth";
     this.callback = response;
 }
예제 #23
0
 public ReqAwardList(Network.ResponseCallback response)
 {
     this.name     = "award";
     this.body     = WebAPI.GetRequestString((string)null);
     this.callback = response;
 }
예제 #24
0
 public ReqBuyGold(int coin, Network.ResponseCallback response)
 {
     this.name     = "shop/gold/buy";
     this.body     = WebAPI.GetRequestString("\"coin\":" + coin.ToString());
     this.callback = response;
 }
예제 #25
0
 public ReqHome(Network.ResponseCallback response)
 {
     this.name     = "home";
     this.body     = WebAPI.GetRequestString((string)null);
     this.callback = response;
 }
예제 #26
0
 public ReqBtlColoRanking(ReqBtlColoRanking.RankingTypes type, Network.ResponseCallback response)
 {
     this.name     = "btl/colo/ranking/" + type.ToString();
     this.body     = WebAPI.GetRequestString(WebAPI.GetStringBuilder().ToString());
     this.callback = response;
 }
예제 #27
0
 public ReqHikkoshiToken(Network.ResponseCallback response)
 {
     this.name     = "hikkoshi/token";
     this.body     = WebAPI.GetRequestString((string)null);
     this.callback = response;
 }
예제 #28
0
        public ReqBtlMultiTwReq(string iname, int partyIndex, int plid, int seat, string[] uid, Network.ResponseCallback response)
        {
            StringBuilder stringBuilder = WebAPI.GetStringBuilder();

            this.name = "btl/multi/tower/req";
            stringBuilder.Append("\"iname\":\"");
            stringBuilder.Append(iname);
            stringBuilder.Append("\",");
            if (partyIndex >= 0)
            {
                stringBuilder.Append("\"partyid\":");
                stringBuilder.Append(partyIndex);
                stringBuilder.Append(",");
            }
            stringBuilder.Append("\"token\":\"");
            stringBuilder.Append(JsonEscape.Escape(GlobalVars.SelectedMultiPlayRoomName));
            stringBuilder.Append("\",");
            stringBuilder.Append("\"plid\":\"");
            stringBuilder.Append(plid);
            stringBuilder.Append("\",");
            stringBuilder.Append("\"seat\":\"");
            stringBuilder.Append(seat);
            stringBuilder.Append("\",");
            stringBuilder.Append("\"uids\":[");
            for (int index = 0; index < uid.Length; ++index)
            {
                stringBuilder.Append("\"" + uid[index] + "\"");
                if (index != uid.Length - 1)
                {
                    stringBuilder.Append(",");
                }
            }
            stringBuilder.Append("]");
            this.body     = WebAPI.GetRequestString(stringBuilder.ToString());
            this.callback = response;
        }
예제 #29
0
 public ReqJobRankup(long iid_job, Network.ResponseCallback response)
 {
     this.name     = "unit/job/equip/lvup/";
     this.body     = WebAPI.GetRequestString("\"iid\":" + (object)iid_job);
     this.callback = response;
 }
예제 #30
0
 public ReqHikkoshiExec(string token, Network.ResponseCallback response)
 {
     this.name     = "hikkoshi/exec";
     this.body     = WebAPI.GetRequestString("\"token\":\"" + token + "\"");
     this.callback = response;
 }