Example #1
0
 public ReqMultiRank(string iname, Network.ResponseCallback response)
 {
     this.name     = "btl/usedunit";
     this.body     = "\"iname\":\"" + JsonEscape.Escape(iname) + "\"";
     this.body     = WebAPI.GetRequestString(this.body);
     this.callback = response;
 }
Example #2
0
 public ReqMultiTwRoom(string fuid, string iname, int floor, Network.ResponseCallback response)
 {
     this.name = "btl/multi/tower/room";
     this.body = string.Empty;
     if (!string.IsNullOrEmpty(fuid))
     {
         ReqMultiTwRoom reqMultiTwRoom = this;
         reqMultiTwRoom.body = reqMultiTwRoom.body + "\"fuid\":\"" + JsonEscape.Escape(fuid) + "\"";
     }
     if (!string.IsNullOrEmpty(iname))
     {
         if (!string.IsNullOrEmpty(this.body))
         {
             this.body += ",";
         }
         ReqMultiTwRoom reqMultiTwRoom = this;
         reqMultiTwRoom.body = reqMultiTwRoom.body + "\"iname\":\"" + JsonEscape.Escape(iname) + "\"";
     }
     if (!string.IsNullOrEmpty(iname))
     {
         if (!string.IsNullOrEmpty(this.body))
         {
             this.body += ",";
         }
         ReqMultiTwRoom reqMultiTwRoom = this;
         reqMultiTwRoom.body = reqMultiTwRoom.body + "\"floor\":" + (object)floor;
     }
     this.body     = WebAPI.GetRequestString(this.body);
     this.callback = response;
 }
Example #3
0
 public ReqVersusLine(string roomname)
 {
     this.name = "vs/friendmatch/line/recruitment";
     this.body = string.Empty;
     this.body = this.body + "\"token\":\"" + JsonEscape.Escape(roomname) + "\"";
     this.body = WebAPI.GetRequestString(this.body);
 }
        public ReqBtlComReq(string iname, string fuid, bool multi, int partyIndex, bool isHost = false, int plid = 0, int seat = 0)
        {
            StringBuilder stringBuilder = WebAPI.GetStringBuilder();

            this.name = ((!multi) ? "btl/com/req" : "btl/multi/req");
            stringBuilder.Append("\"iname\":\"");
            stringBuilder.Append(iname);
            stringBuilder.Append("\",");
            if (partyIndex >= 0)
            {
                stringBuilder.Append("\"partyid\":");
                stringBuilder.Append(partyIndex);
                stringBuilder.Append(",");
            }
            if (multi)
            {
                stringBuilder.Append("\"token\":\"");
                stringBuilder.Append(JsonEscape.Escape(GlobalVars.SelectedMultiPlayRoomName));
                stringBuilder.Append("\",");
                stringBuilder.Append("\"host\":\"");
                stringBuilder.Append((!isHost) ? "0" : "1");
                stringBuilder.Append("\",");
                stringBuilder.Append("\"plid\":\"");
                stringBuilder.Append(plid);
                stringBuilder.Append("\",");
                stringBuilder.Append("\"seat\":\"");
                stringBuilder.Append(seat);
                stringBuilder.Append("\",");
            }
            stringBuilder.Append("\"btlparam\":{\"help\":{\"fuid\":\"");
            stringBuilder.Append(fuid);
            stringBuilder.Append("\"}}");
            this.body = WebAPI.GetRequestString(stringBuilder.ToString());
        }
Example #5
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;
        }
Example #6
0
 public ReqVersusMake(VERSUS_TYPE type, string comment, string iname, bool isLine = false)
 {
     this.name = "vs/" + type.ToString().ToLower() + "match/make";
     this.body = string.Empty;
     this.body = this.body + "\"comment\":\"" + JsonEscape.Escape(comment) + "\",";
     this.body = this.body + "\"iname\":\"" + JsonEscape.Escape(iname) + "\",";
     this.body = this.body + "\"Line\":" + ((!isLine) ? 0 : 1);
     this.body = WebAPI.GetRequestString(this.body);
 }
Example #7
0
 public ReqVersusRoomUpdate(int roomID, string comment, string iname)
 {
     this.name = "vs/friendmatch/update";
     this.body = string.Empty;
     this.body = this.body + "\"roomid\":" + roomID;
     this.body = this.body + ",\"comment\":\"" + JsonEscape.Escape(comment) + "\"";
     this.body = this.body + ",\"quest\":\"" + iname + "\"";
     this.body = WebAPI.GetRequestString(this.body);
 }
Example #8
0
 public ReqMPRoomUpdate(int roomID, string comment, string passCode)
 {
     this.name = "btl/room/update";
     this.body = string.Empty;
     this.body = this.body + "\"roomid\":" + roomID;
     this.body = this.body + ",\"comment\":\"" + JsonEscape.Escape(comment) + "\"";
     this.body = this.body + ",\"pwd\":\"" + JsonEscape.Escape(passCode) + "\"";
     this.body = WebAPI.GetRequestString(this.body);
 }
Example #9
0
 public ReqMPRoom(string fuid)
 {
     this.name = "btl/room";
     this.body = string.Empty;
     if (!string.IsNullOrEmpty(fuid))
     {
         this.body = this.body + "\"fuid\":\"" + JsonEscape.Escape(fuid) + "\"";
     }
     this.body = WebAPI.GetRequestString(this.body);
 }
Example #10
0
        public ReqMultiTwRoom(string fuid, string iname, int floor, Network.ResponseCallback response)
        {
            this.name = "btl/multi/tower/room";
            this.body = string.Empty;
            ReqMultiTwRoom reqMultiTwRoom = this;

            reqMultiTwRoom.body = reqMultiTwRoom.body + "\"iname\":\"" + JsonEscape.Escape(iname) + "\"";
            this.body           = WebAPI.GetRequestString(this.body);
            this.callback       = response;
        }
Example #11
0
        public ReqVersusLine(string roomname, Network.ResponseCallback response)
        {
            this.name = "vs/friendmatch/line/recruitment";
            this.body = string.Empty;
            ReqVersusLine reqVersusLine = this;

            reqVersusLine.body = reqVersusLine.body + "\"token\":\"" + JsonEscape.Escape(roomname) + "\"";
            this.body          = WebAPI.GetRequestString(this.body);
            this.callback      = response;
        }
Example #12
0
 public ReqMPRoomMake(string iname, string comment, string passCode, bool isPrivate)
 {
     this.name = "btl/room/make";
     this.body = string.Empty;
     this.body = this.body + "\"iname\":\"" + JsonEscape.Escape(iname) + "\"";
     this.body = this.body + ",\"comment\":\"" + JsonEscape.Escape(comment) + "\"";
     this.body = this.body + ",\"pwd\":\"" + JsonEscape.Escape(passCode) + "\"";
     this.body = this.body + ",\"private\":" + ((!isPrivate) ? 0 : 1);
     this.body = WebAPI.GetRequestString(this.body);
 }
Example #13
0
 public ReqMPRoom(string fuid, Network.ResponseCallback response)
 {
     this.name = "btl/room";
     this.body = string.Empty;
     if (!string.IsNullOrEmpty(fuid))
     {
         ReqMPRoom reqMpRoom = this;
         reqMpRoom.body = reqMpRoom.body + "\"fuid\":\"" + JsonEscape.Escape(fuid) + "\"";
     }
     this.body     = WebAPI.GetRequestString(this.body);
     this.callback = response;
 }
Example #14
0
        public ReqMultiCheat(int type, string val, Network.ResponseCallback response)
        {
            this.name = "btl/multi/cheat";
            this.body = string.Empty;
            ReqMultiCheat reqMultiCheat1 = this;

            reqMultiCheat1.body = reqMultiCheat1.body + "\"type\":" + (object)type + ",";
            ReqMultiCheat reqMultiCheat2 = this;

            reqMultiCheat2.body = reqMultiCheat2.body + "\"val\":\"" + JsonEscape.Escape(val) + "\"";
            this.body           = WebAPI.GetRequestString(this.body);
            this.callback       = response;
        }
Example #15
0
        public ReqMPRoomUpdate(int roomID, string comment, string passCode, Network.ResponseCallback response)
        {
            this.name = "btl/room/update";
            this.body = string.Empty;
            ReqMPRoomUpdate reqMpRoomUpdate1 = this;

            reqMpRoomUpdate1.body = reqMpRoomUpdate1.body + "\"roomid\":" + (object)roomID;
            ReqMPRoomUpdate reqMpRoomUpdate2 = this;

            reqMpRoomUpdate2.body = reqMpRoomUpdate2.body + ",\"comment\":\"" + JsonEscape.Escape(comment) + "\"";
            ReqMPRoomUpdate reqMpRoomUpdate3 = this;

            reqMpRoomUpdate3.body = reqMpRoomUpdate3.body + ",\"pwd\":\"" + JsonEscape.Escape(passCode) + "\"";
            this.body             = WebAPI.GetRequestString(this.body);
            this.callback         = response;
        }
        public ReqVersusRoomUpdate(int roomID, string comment, string iname, Network.ResponseCallback response)
        {
            this.name = "vs/friendmatch/update";
            this.body = string.Empty;
            ReqVersusRoomUpdate versusRoomUpdate1 = this;

            versusRoomUpdate1.body = versusRoomUpdate1.body + "\"roomid\":" + (object)roomID;
            ReqVersusRoomUpdate versusRoomUpdate2 = this;

            versusRoomUpdate2.body = versusRoomUpdate2.body + ",\"comment\":\"" + JsonEscape.Escape(comment) + "\"";
            ReqVersusRoomUpdate versusRoomUpdate3 = this;

            versusRoomUpdate3.body = versusRoomUpdate3.body + ",\"quest\":\"" + iname + "\"";
            this.body     = WebAPI.GetRequestString(this.body);
            this.callback = response;
        }
Example #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;
        }
Example #18
0
        public ReqMultiCheat(int type, string val)
        {
            this.name = "btl/multi/cheat";
            this.body = string.Empty;
            string body = this.body;

            this.body = string.Concat(new object[]
            {
                body,
                "\"type\":",
                type,
                ","
            });
            this.body = this.body + "\"val\":\"" + JsonEscape.Escape(val) + "\"";
            this.body = WebAPI.GetRequestString(this.body);
        }
Example #19
0
        public ReqMultiTwRoomUpdate(int roomID, string comment, string passCode, string iname, int floor, Network.ResponseCallback response)
        {
            this.name = "btl/multi/tower/update";
            this.body = string.Empty;
            ReqMultiTwRoomUpdate multiTwRoomUpdate1 = this;

            multiTwRoomUpdate1.body = multiTwRoomUpdate1.body + "\"roomid\":" + (object)roomID;
            ReqMultiTwRoomUpdate multiTwRoomUpdate2 = this;

            multiTwRoomUpdate2.body = multiTwRoomUpdate2.body + ",\"iname\":\"" + JsonEscape.Escape(iname) + "\"";
            ReqMultiTwRoomUpdate multiTwRoomUpdate3 = this;

            multiTwRoomUpdate3.body = multiTwRoomUpdate3.body + ",\"floor\":" + (object)floor;
            ReqMultiTwRoomUpdate multiTwRoomUpdate4 = this;

            multiTwRoomUpdate4.body = multiTwRoomUpdate4.body + ",\"pwd\":\"" + JsonEscape.Escape(passCode) + "\"";
            this.body     = WebAPI.GetRequestString(this.body);
            this.callback = response;
        }
Example #20
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;
        }
Example #21
0
        public ReqMultiTwRoomMake(string iname, string comment, string passCode, int floor, Network.ResponseCallback response)
        {
            this.name = "btl/multi/tower/make";
            this.body = string.Empty;
            ReqMultiTwRoomMake reqMultiTwRoomMake1 = this;

            reqMultiTwRoomMake1.body = reqMultiTwRoomMake1.body + "\"iname\":\"" + JsonEscape.Escape(iname) + "\"";
            ReqMultiTwRoomMake reqMultiTwRoomMake2 = this;

            reqMultiTwRoomMake2.body = reqMultiTwRoomMake2.body + ",\"pwd\":\"" + JsonEscape.Escape(passCode) + "\"";
            ReqMultiTwRoomMake reqMultiTwRoomMake3 = this;

            reqMultiTwRoomMake3.body = reqMultiTwRoomMake3.body + ",\"req_at\":" + (object)Network.GetServerTime();
            ReqMultiTwRoomMake reqMultiTwRoomMake4 = this;

            reqMultiTwRoomMake4.body = reqMultiTwRoomMake4.body + ",\"floor\":" + (object)floor;
            this.body     = WebAPI.GetRequestString(this.body);
            this.callback = response;
        }
Example #22
0
        public ReqVersus(string iname, int plid, int seat, string uid, VERSUS_TYPE type)
        {
            StringBuilder stringBuilder = WebAPI.GetStringBuilder();

            this.name = "vs/" + type.ToString().ToLower() + "match/req";
            stringBuilder.Append("\"iname\":\"");
            stringBuilder.Append("QE_VS_TEST_00");
            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("\"uid\":\"");
            stringBuilder.Append(uid);
            stringBuilder.Append("\"");
            this.body = WebAPI.GetRequestString(stringBuilder.ToString());
        }
        public ReqBtlComEnd(long btlid, int time, BtlResultTypes result, int[] beats, int[] itemSteals, int[] goldSteals, int[] missions, string[] fuid, Dictionary <OString, OInt> usedItems, BtlEndTypes apiType, string trophyprog = null, string bingoprog = null, string maxdata = null)
        {
            StringBuilder stringBuilder = WebAPI.GetStringBuilder();

            stringBuilder.Append("btl/");
            stringBuilder.Append(apiType.ToString());
            stringBuilder.Append("/end");
            this.name            = stringBuilder.ToString();
            stringBuilder.Length = 0;
            stringBuilder.Append("\"btlid\":");
            stringBuilder.Append(btlid);
            stringBuilder.Append(',');
            stringBuilder.Append("\"btlendparam\":{");
            stringBuilder.Append("\"time\":");
            stringBuilder.Append(time);
            stringBuilder.Append(',');
            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;
            }
            if (result == BtlResultTypes.Win)
            {
                if (beats == null)
                {
                    beats = new int[0];
                }
                if (itemSteals == null)
                {
                    itemSteals = new int[0];
                }
                if (goldSteals == null)
                {
                    goldSteals = new int[0];
                }
                if (missions == null)
                {
                    missions = new int[3];
                }
            }
            if (result != BtlResultTypes.Cancel && usedItems == null)
            {
                usedItems = new Dictionary <OString, OInt>();
            }
            stringBuilder.Append("\",");
            if (beats != null)
            {
                stringBuilder.Append("\"beats\":[");
                for (int i = 0; i < beats.Length; i++)
                {
                    if (i > 0)
                    {
                        stringBuilder.Append(',');
                    }
                    stringBuilder.Append(beats[i].ToString());
                }
                stringBuilder.Append("],");
            }
            if (itemSteals != null || goldSteals != null)
            {
                stringBuilder.Append("\"steals\":{");
                if (itemSteals != null)
                {
                    stringBuilder.Append("\"items\":[");
                    for (int j = 0; j < itemSteals.Length; j++)
                    {
                        stringBuilder.Append(itemSteals[j].ToString());
                        if (j != beats.Length - 1)
                        {
                            stringBuilder.Append(',');
                        }
                    }
                    stringBuilder.Append("]");
                }
                if (goldSteals != null)
                {
                    if (itemSteals != null)
                    {
                        stringBuilder.Append(',');
                    }
                    stringBuilder.Append("\"golds\":[");
                    for (int k = 0; k < goldSteals.Length; k++)
                    {
                        stringBuilder.Append(goldSteals[k].ToString());
                        if (k != beats.Length - 1)
                        {
                            stringBuilder.Append(",");
                        }
                    }
                    stringBuilder.Append("]");
                }
                stringBuilder.Append("},");
            }
            if (missions != null)
            {
                stringBuilder.Append("\"missions\":[");
                for (int l = 0; l < missions.Length; l++)
                {
                    if (l > 0)
                    {
                        stringBuilder.Append(',');
                    }
                    stringBuilder.Append(missions[l].ToString());
                }
                stringBuilder.Append("],");
            }
            if (usedItems != null)
            {
                stringBuilder.Append("\"inputs\":[");
                int num = 0;
                foreach (KeyValuePair <OString, OInt> current in usedItems)
                {
                    if (num > 0)
                    {
                        stringBuilder.Append(',');
                    }
                    stringBuilder.Append("{");
                    stringBuilder.Append("\"use\":\"");
                    stringBuilder.Append(current.Key);
                    stringBuilder.Append("\",");
                    stringBuilder.Append("\"n\":");
                    stringBuilder.Append(current.Value);
                    stringBuilder.Append("}");
                    num++;
                }
                stringBuilder.Append("],");
            }
            if (apiType == BtlEndTypes.multi)
            {
                stringBuilder.Append("\"token\":\"");
                stringBuilder.Append(JsonEscape.Escape(GlobalVars.SelectedMultiPlayRoomName));
                stringBuilder.Append("\",");
            }
            if (stringBuilder[stringBuilder.Length - 1] == ',')
            {
                stringBuilder.Length--;
            }
            stringBuilder.Append('}');
            if (apiType == BtlEndTypes.multi && fuid != null)
            {
                stringBuilder.Append(",\"fuids\":[");
                for (int m = 0; m < fuid.Length; m++)
                {
                    if (fuid[m] != null)
                    {
                        if (m != 0)
                        {
                            stringBuilder.Append(", ");
                        }
                        stringBuilder.Append("\"");
                        stringBuilder.Append(fuid[m]);
                        stringBuilder.Append("\"");
                    }
                }
                stringBuilder.Append("]");
            }
            if (!string.IsNullOrEmpty(trophyprog))
            {
                stringBuilder.Append(",");
                stringBuilder.Append(trophyprog);
            }
            if (!string.IsNullOrEmpty(bingoprog))
            {
                stringBuilder.Append(",");
                stringBuilder.Append(bingoprog);
            }
            if (!string.IsNullOrEmpty(maxdata))
            {
                stringBuilder.Append(",");
                stringBuilder.Append(maxdata);
            }
            this.body = WebAPI.GetRequestString(stringBuilder.ToString());
        }
        public ReqVersusEnd(long btlid, int time, BtlResultTypes result, int[] beats, string uid, string fuid, VERSUS_TYPE type, string trophyprog = null, string bingoprog = null, string maxdata = 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("\"time\":");
            stringBuilder.Append(time);
            stringBuilder.Append(',');
            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;
            }
            if (result == BtlResultTypes.Win && beats == null)
            {
                beats = new int[0];
            }
            stringBuilder.Append("\",");
            if (beats != null)
            {
                stringBuilder.Append("\"beats\":[");
                for (int i = 0; i < beats.Length; i++)
                {
                    if (i > 0)
                    {
                        stringBuilder.Append(',');
                    }
                    stringBuilder.Append(beats[i].ToString());
                }
                stringBuilder.Append("],");
            }
            stringBuilder.Append("\"steals\":[");
            stringBuilder.Append("],");
            stringBuilder.Append("\"missions\":[");
            stringBuilder.Append("],");
            stringBuilder.Append("\"token\":\"");
            stringBuilder.Append(JsonEscape.Escape(GlobalVars.SelectedMultiPlayRoomName));
            stringBuilder.Append("\",");
            if (stringBuilder[stringBuilder.Length - 1] == ',')
            {
                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);
            }
            if (!string.IsNullOrEmpty(maxdata))
            {
                stringBuilder.Append(",");
                stringBuilder.Append(maxdata);
            }
            this.body = WebAPI.GetRequestString(stringBuilder.ToString());
        }
 public ReqMultiRank(string iname)
 {
     this.name = "btl/usedunit";
     this.body = "\"iname\":\"" + JsonEscape.Escape(iname) + "\"";
     this.body = WebAPI.GetRequestString(this.body);
 }
Example #26
0
        protected static string GetBtlEndParamString(BattleCore.Record record, bool multi = false)
        {
            string text = null;

            if (record != null)
            {
                int    num   = 0;
                string text2 = "win";
                if (multi && record.result == BattleCore.QuestResult.Pending)
                {
                    text2 = "retire";
                }
                else if (record.result != BattleCore.QuestResult.Win)
                {
                    text2 = "lose";
                }
                int[] array = new int[record.drops.Length];
                for (int i = 0; i < record.drops.Length; i++)
                {
                    array[i] = record.drops[i];
                }
                int[] array2 = new int[record.item_steals.Length];
                for (int j = 0; j < record.item_steals.Length; j++)
                {
                    array2[j] = record.item_steals[j];
                }
                int[] array3 = new int[record.gold_steals.Length];
                for (int k = 0; k < record.gold_steals.Length; k++)
                {
                    array3[k] = record.gold_steals[k];
                }
                int[] array4 = new int[3];
                for (int l = 0; l < array4.Length; l++)
                {
                    array4[l] = (((record.bonusFlags & 1 << l) == 0) ? 0 : 1);
                }
                text += "\"btlendparam\":{";
                string text3 = text;
                text = string.Concat(new object[]
                {
                    text3,
                    "\"time\":",
                    num,
                    ","
                });
                text  = text + "\"result\":\"" + text2 + "\",";
                text += "\"beats\":[";
                for (int m = 0; m < array.Length; m++)
                {
                    text += array[m].ToString();
                    if (m != array.Length - 1)
                    {
                        text += ",";
                    }
                }
                text += "],";
                text += "\"steals\":{";
                text += "\"items\":[";
                for (int n = 0; n < array2.Length; n++)
                {
                    text += array2[n].ToString();
                    if (n != array.Length - 1)
                    {
                        text += ",";
                    }
                }
                text += "],";
                text += "\"golds\":[";
                for (int num2 = 0; num2 < array3.Length; num2++)
                {
                    text += array3[num2].ToString();
                    if (num2 != array.Length - 1)
                    {
                        text += ",";
                    }
                }
                text += "]";
                text += "},";
                text += "\"missions\":[";
                for (int num3 = 0; num3 < array4.Length; num3++)
                {
                    text += array4[num3].ToString();
                    if (num3 != array4.Length - 1)
                    {
                        text += ",";
                    }
                }
                text += "]";
                if (multi)
                {
                    text = text + ",\"token\":\"" + JsonEscape.Escape(GlobalVars.SelectedMultiPlayRoomName) + "\"";
                }
                text += "}";
            }
            return(text);
        }