Exemple #1
0
        public static string Get(int _Type = 99, int _Arg1 = 0, int _Arg2  = 0, int _Arg3       = 0, int _Arg4 = 0, int _Arg5 = 0, int _Arg6 = 0, int _Arg7 = 0,
                                 int _Arg8 = 0, int _Arg9  = 0, int _Arg10 = 0, string _StrArg1 = "", string _StrArg2 = "", string _StrArg3 = "")
        {
            switch (_Type)
            {
            case 1:
                return("{\"Error\":\"Not supported\"}");

            //Response.Write(Tooltip.GetSpell(Convert.ToInt32(Request.QueryString.Get("id")), "vanilla"));
            //break;
            case 0:
                /*
                 * Arg1 = Id
                 * Arg2 = Charid
                 */
                return(Tooltip.GetItem(_Arg1,
                                       _Arg2 == 0 ? "vanilla" : "tbc",
                                       _Arg2));

            case 2:
                /*
                 * Arg1 = Id
                 * Arg2 = InstanceId
                 */
                return(Tooltip.GetGuildProgress(_Arg1,
                                                _Arg2));

            case 3:
                /*
                 * Arg1 = GuildId
                 */
                return(Tooltip.GetGuild(_Arg1));

            case 4:
                /*
                 * Arg1 = CharId
                 */
                return(Tooltip.GetCharacter(_Arg1));

            case 5:
                /*
                 * Arg1 = AbilityId
                 * Arg2 = Raid Instance Id
                 * Arg3 = Uploader Id
                 * Arg4 = SourceId
                 * Arg5 = TargetId
                 * Arg6 = Start
                 * Arg7 = End
                 * Arg8 = Category Id
                 * Arg9 = Attempt Id
                 * Arg10 = Expansion Id
                 * StrArg1 = Mode
                 */
                return(Tooltip.GetRvRowData(_Arg1,
                                            _Arg2,
                                            _Arg3,
                                            _Arg4,
                                            _Arg5,
                                            _Arg6,
                                            _Arg7,
                                            _Arg8,
                                            _Arg9,
                                            _StrArg1,
                                            _Arg10));

            case 6:
                /*
                 * Arg1 = CharId/NpcId
                 * Arg2 = Raid Instance Id
                 * Arg3 = Uploader Id
                 * Arg4 = SourceId
                 * Arg5 = TargetId
                 * Arg6 = Start
                 * Arg7 = End
                 * Arg8 = Category Id
                 * Arg9 = Attempt Id
                 * Arg10 = Expansion Id
                 * StrArg1 = Mode
                 */
                return(Tooltip.GetRvRowPreview(_Arg1,
                                               _Arg2,
                                               _Arg3,
                                               _Arg4,
                                               _Arg5,
                                               _Arg6,
                                               _Arg7,
                                               _Arg8,
                                               _Arg9,
                                               _StrArg1,
                                               _Arg10));

            case 7:
                return(GetCharacterData(_Arg1, _StrArg1));

            case 8:
                return(GetGuildData(_Arg1, _StrArg1));

            case 9:
                return(QueryDB(0, "db_shortlink", new [] { "id", "data" }, "id", _Arg1));

            case 10:
                /*
                 * Arg1 = Expansion
                 * Arg2 = UploaderId
                 */
                return(QueryDB(_Arg1 == 0 ? 1 : 2, "rs_loot", new[] { "targetid", "itemid", "attemptid" },
                               "uploaderid", _Arg2));

            case 11:
                /*
                 * Arg1 = GuildId
                 */
                return(JsonConvert.SerializeObject(App.m_Chars.Values.Where(x => x.RefGuild.GuildID == _Arg1).Select(x => x.CharId)));

            case 12:     // Raid composition
                         /*
                          * Arg1 = Expansion
                          * Arg2 = Uploaderid
                          */
                return(QueryDB(_Arg1 + 1, "rs_participants", new[] { "charid" }, "uploaderid", _Arg2));

            case 1337:
                return(QueryDB(0, "db_servernames", new [] { "id", "expansion", "name", "logon" }));

            case 1338:
                int Launcher = 4;
                int Vanilla  = 24;
                int TBC      = 125;
                int WOTLK    = 200;
                int CATA     = 300;
                int MOP      = 400;
                int WOD      = 500;
                return("{\"Launcher\":" + Launcher + ",\"Vanilla\":" + Vanilla + ",\"TBC\":" + TBC + ",\"WOTLK\":" +
                       WOTLK + ",\"CATA\":" + CATA + ",\"MOP\":" + MOP + ",\"WOD\":" + WOD + "}");
            }

            return("{\"Error\":\"Retrieving information\"}");
        }
Exemple #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var queryString = Utility.GetQueryString(Request, "data", "null");

            if (queryString == "talents")
            {
                Response.Clear();
                Response.ContentType = "application/x-javascript";
                if (Request.QueryString.Get("class") == "1")
                {
                    Response.Write(TalentCalculator.TalentInfo_Warrior);
                }
                else if (Request.QueryString.Get("class") == "2")
                {
                    Response.Write(TalentCalculator.TalentInfo_Paladin);
                }
                else if (Request.QueryString.Get("class") == "3")
                {
                    Response.Write(TalentCalculator.TalentInfo_Hunter);
                }
                else if (Request.QueryString.Get("class") == "4")
                {
                    Response.Write(TalentCalculator.TalentInfo_Rogue);
                }
                else if (Request.QueryString.Get("class") == "5")
                {
                    Response.Write(TalentCalculator.TalentInfo_Priest);
                }
                else if (Request.QueryString.Get("class") == "6")
                {
                    Response.Write("");
                }
                else if (Request.QueryString.Get("class") == "7")
                {
                    Response.Write(TalentCalculator.TalentInfo_Shaman);
                }
                else if (Request.QueryString.Get("class") == "8")
                {
                    Response.Write(TalentCalculator.TalentInfo_Mage);
                }
                else if (Request.QueryString.Get("class") == "9")
                {
                    Response.Write(TalentCalculator.TalentInfo_Warlock);
                }
                else if (Request.QueryString.Get("class") == "10")
                {
                    Response.Write("");
                }
                else if (Request.QueryString.Get("class") == "11")
                {
                    Response.Write(TalentCalculator.TalentInfo_Druid);
                }
                else if (Request.QueryString.Get("class") == "21")
                {
                    Response.Write(TalentCalculator.TalentInfoTBC_Warrior);
                }
                else if (Request.QueryString.Get("class") == "22")
                {
                    Response.Write(TalentCalculator.TalentInfoTBC_Paladin);
                }
                else if (Request.QueryString.Get("class") == "23")
                {
                    Response.Write(TalentCalculator.TalentInfoTBC_Hunter);
                }
                else if (Request.QueryString.Get("class") == "24")
                {
                    Response.Write(TalentCalculator.TalentInfoTBC_Rogue);
                }
                else if (Request.QueryString.Get("class") == "25")
                {
                    Response.Write(TalentCalculator.TalentInfoTBC_Priest);
                }
                else if (Request.QueryString.Get("class") == "26")
                {
                    Response.Write("");
                }
                else if (Request.QueryString.Get("class") == "27")
                {
                    Response.Write(TalentCalculator.TalentInfoTBC_Shaman);
                }
                else if (Request.QueryString.Get("class") == "28")
                {
                    Response.Write(TalentCalculator.TalentInfoTBC_Mage);
                }
                else if (Request.QueryString.Get("class") == "29")
                {
                    Response.Write(TalentCalculator.TalentInfoTBC_Warlock);
                }
                else if (Request.QueryString.Get("class") == "30")
                {
                    Response.Write("");
                }
                else if (Request.QueryString.Get("class") == "31")
                {
                    Response.Write(TalentCalculator.TalentInfoTBC_Druid);
                }
                Response.End();
                return;
            }
            else if (queryString == "tooltip")
            {
                Response.Clear();
                Response.ContentType = "application/json; charset=utf-8";

                string flags = Request.QueryString.Get("flags");
                bool   flg1  = false;
                bool   flg2  = false;
                bool   flg3  = false;
                bool   flg4  = false;
                bool   flg5  = false;
                bool   flg6  = false;
                bool   flg7  = false;
                if (flags != null && flags.Length > 2)
                {
                    flg1 = flags[0] == '1';
                    flg2 = flags[1] == '1';
                    flg3 = flags[2] == '1';
                    flg4 = flags[3] == '1';
                    flg5 = flags[4] == '1';
                    flg6 = flags[5] == '1';
                    flg7 = flags[6] == '1';
                }

                switch (Request.QueryString.Get("type"))
                {
                case "0":
                    Response.Write(Tooltip.GetSpell(Convert.ToInt32(Request.QueryString.Get("id")), "vanilla"));
                    break;

                case "1":
                    Response.Write(Tooltip.GetItem(Convert.ToInt32(Request.QueryString.Get("id")), Request.QueryString.Get("charid") == "0" ? "vanilla" : "tbc", Convert.ToInt32(Request.QueryString.Get("charid"))));
                    break;

                case "2":
                    Response.Write(Tooltip.GetGuildProgress(Convert.ToInt32(Request.QueryString.Get("id")), Convert.ToInt32(Request.QueryString.Get("charid"))));     // charid => Instanceid
                    break;

                case "4":
                    Response.Write(Tooltip.GetGuild(Convert.ToInt32(Request.QueryString.Get("id"))));
                    break;

                case "5":
                    Response.Write(Tooltip.GetCharacter(Convert.ToInt32(Request.QueryString.Get("id"))));
                    break;

                case "6":
                    Response.Write(Tooltip.GetRvRowData(Convert.ToInt32(Request.QueryString.Get("id")),
                                                        Convert.ToInt32(Request.QueryString.Get("instanceid")),
                                                        Convert.ToInt32(Request.QueryString.Get("upl")),
                                                        Convert.ToInt32(Request.QueryString.Get("charid")),
                                                        Convert.ToInt32(Request.QueryString.Get("tarid")),
                                                        Convert.ToInt32(Request.QueryString.Get("start")),
                                                        Convert.ToInt32(Request.QueryString.Get("end")),
                                                        Convert.ToInt32(Request.QueryString.Get("cat")),
                                                        Convert.ToInt32(Request.QueryString.Get("atmt")),
                                                        Request.QueryString.Get("mode"),
                                                        Convert.ToInt32(Request.QueryString.Get("exp")), flg1, flg2, flg3, flg4, flg5, flg6, flg7));
                    break;

                case "7":
                    Response.Write(Tooltip.GetRvRowPreview(Convert.ToInt32(Request.QueryString.Get("id")),
                                                           Convert.ToInt32(Request.QueryString.Get("instanceid")),
                                                           Convert.ToInt32(Request.QueryString.Get("upl")),
                                                           Convert.ToInt32(Request.QueryString.Get("charid")),
                                                           Convert.ToInt32(Request.QueryString.Get("tarid")),
                                                           Convert.ToInt32(Request.QueryString.Get("start")),
                                                           Convert.ToInt32(Request.QueryString.Get("end")),
                                                           Convert.ToInt32(Request.QueryString.Get("cat")),
                                                           Convert.ToInt32(Request.QueryString.Get("atmt")),
                                                           Request.QueryString.Get("mode"),
                                                           Convert.ToInt32(Request.QueryString.Get("exp")), flg1, flg2, flg3, flg4, flg5, flg6, flg7));
                    break;

                case "8":
                    Response.Write(Tooltip.GetItemDesigner(Request.QueryString.Get("id")));
                    break;

                default:
                    Response.Write("{\"Error\":\"Error retrieving information\"}");
                    break;
                }
                Response.End();
            }
            return;
        }