コード例 #1
0
        private static DataSet GetData(MySqlCommand cmd, int state)
        {
            using (var conn = new MySqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["COUNCILDB"].ConnectionString)) {
                conn.Open();

                using (MySqlDataAdapter msda = new MySqlDataAdapter()) {
                    cmd.Connection     = conn;
                    msda.SelectCommand = cmd;

                    using (DataSet ds = new DataSet()) {
                        msda.Fill(ds, "Petition");

                        DataTable dt = new DataTable("PageCount");
                        dt.Columns.Add("PageCount");
                        dt.Rows.Add();
                        int petitionsCount = PetitionManager.GetPetitionsCount(state);
                        dt.Rows[0][0] = petitionsCount % 5 == 0 ? petitionsCount / elementCount : petitionsCount / elementCount + 1;
                        ds.Tables.Add(dt);

                        conn.Close();
                        return(ds);
                    }
                }
            }
        }
コード例 #2
0
        protected void AllowButton_Click(object sender, EventArgs e)
        {
            AllowButton.Enabled = false;
            PetitionManager.PetitionCheck(int.Parse(Request.QueryString["id"]), 1);
            AllowButton.Enabled = true;

            Response.Redirect("/admin/PetitionManagement.aspx");
        }
コード例 #3
0
        protected void AgreeButton_Click(object sender, EventArgs e)
        {
            AgreeButton.Enabled = false;

            if (Session["UserID"] != null)
            {
                PetitionManager.AgreePetition(int.Parse(Request.QueryString["id"]), (string)Session["UserID"]);
                Response.Redirect(Request.RawUrl);
            }
            else
            {
                Response.Redirect("/Login.aspx?classification=1&id=" + Request.QueryString["id"]);
            }
        }
コード例 #4
0
        protected void AnswerButton_Click(object sender, EventArgs e)
        {
            AnswerButton.Enabled = false;

            if (string.IsNullOrEmpty(AnswerContent.Text.Trim()))
            {
                Response.Write("<script>alert('답변 내용을 입력해주세요.')</script>");
            }
            else
            {
                PetitionManager.AddAnswer(int.Parse(Request.QueryString["id"]), AnswerContent.Text);

                Response.Redirect("/admin/PetitionManagement.aspx?state=awaitingAnswer");
            }

            AnswerButton.Enabled = true;
        }
コード例 #5
0
        public override void RunImpl()
        {
            L2Player player = _client.CurrentPlayer;

            if (player.PBlockAct == 1)
            {
                player.SendActionFailed();
                return;
            }

            L2Npc       npc;
            L2Warehouse warehouseNPC;

            if (_alias.EqualsIgnoreCase("teleport_request"))
            {
                npc = GetNpc();

                if (npc == null)
                {
                    player.SendActionFailed();
                    return;
                }

                npc.OnTeleportRequest(player);
            }
            else
            {
                if (_alias.StartsWithIgnoreCase("menu_select?"))
                {
                    npc = GetNpc();

                    _alias = _alias.Replace(" ", string.Empty);
                    string   x1  = _alias.Split('?')[1];
                    string[] x2  = x1.Split('&');
                    int      ask = int.Parse(x2[0].Substring(4));
                    int      reply;

                    try
                    {
                        reply = int.Parse(x2[1].Substring(6));
                    }
                    catch
                    {
                        reply = 0;
                    }

                    npc.OnDialog(player, ask, reply);
                }
                else
                {
                    if (_alias.EqualsIgnoreCase("talk_select"))
                    {
                        npc = GetNpc();
                        //QuestManager.Instance.TalkSelection(player, npc);
                    }
                    else
                    {
                        if (_alias.StartsWithIgnoreCase("quest_accept?"))
                        {
                            npc    = GetNpc();
                            _alias = _alias.Replace(" ", string.Empty);
                            string x1  = _alias.Split('?')[1];
                            int    qid = int.Parse(x1.Split('=')[1]);

                            //QuestManager.Instance.QuestAccept(player, npc, qid);
                        }
                        else
                        {
                            if (_alias.StartsWithIgnoreCase("quest_continue?"))
                            {
                                npc    = GetNpc();
                                _alias = _alias.Replace(" ", string.Empty);
                                string x1  = _alias.Split('?')[1];
                                int    qid = int.Parse(x1.Split('=')[1]);

                                //QuestManager.Instance.Quest_continue(player, npc, qid);
                            }
                            else
                            {
                                if (_alias.StartsWithIgnoreCase("quest_tryaccept?"))
                                {
                                    npc    = GetNpc();
                                    _alias = _alias.Replace(" ", string.Empty);
                                    string x1  = _alias.Split('?')[1];
                                    int    qid = int.Parse(x1.Split('=')[1]);

                                    // QuestManager.Instance.Quest_tryaccept(player, npc, qid);
                                }
                                else
                                {
                                    if (_alias.Contains("DepositP"))
                                    {
                                        warehouseNPC = GetWarehouseNPC();
                                        warehouseNPC.ShowPrivateWarehouse(player);
                                        return;
                                    }
                                    else
                                    {
                                        if (_alias.Contains("WithdrawP"))
                                        {
                                            warehouseNPC = GetWarehouseNPC();
                                            warehouseNPC.ShowPrivateWarehouseBack(player);
                                            return;
                                        }
                                        else
                                        {
                                            if (_alias.Contains("DepositC"))
                                            {
                                                warehouseNPC = GetWarehouseNPC();
                                                warehouseNPC.ShowClanWarehouse(player);
                                                return;
                                            }
                                            else
                                            {
                                                if (_alias.Contains("WithdrawC"))
                                                {
                                                    warehouseNPC = GetWarehouseNPC();
                                                    warehouseNPC.ShowClanWarehouseBack(player);
                                                    return;
                                                }
                                                else
                                                {
                                                    if (_alias.EqualsIgnoreCase("learn_skill"))
                                                    {
                                                        npc = GetNpc();
                                                        npc.ShowSkillLearn(player, false);
                                                    }
                                                    else
                                                    {
                                                        if (_alias.StartsWithIgnoreCase("create_pledge?"))
                                                        {
                                                            npc = GetNpc();
                                                            //bypass -h create_pledge?pledge_name= $pledge_name
                                                            string x1   = _alias.Split('?')[1];
                                                            string name = x1.Split('=')[1];
                                                            name = name.Substring(1);

                                                            // GrandmasterTotal.CreateClan(player, name, npc);
                                                        }
                                                        else
                                                        {
                                                            if (_alias.StartsWithIgnoreCase("teleport_next?"))
                                                            {
                                                                npc = GetNpc();
                                                                string   x1    = _alias.Split('?')[1];
                                                                string[] x2    = x1.Split('&');
                                                                int      ask   = int.Parse(x2[0].Substring(4));
                                                                int      reply = int.Parse(x2[1].Substring(6));

                                                                npc.UseTeleporter(player, ask, reply);
                                                            }
                                                            else
                                                            {
                                                                if (_alias.StartsWithIgnoreCase("npc"))
                                                                {
                                                                    npc = GetNpc();
                                                                    Log.Warn($"Bypass Accepted '{_alias}'");
                                                                }
                                                                else
                                                                {
                                                                    if (_alias.StartsWithIgnoreCase("petitionlink?"))
                                                                    {
                                                                        PetitionManager.GetInstance().Petitionlink(player, _alias.Split('?')[1]);
                                                                    }
                                                                    else
                                                                    {
                                                                        Log.Warn($"Unknown bypass '{_alias}'");
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
コード例 #6
0
        public override void run()
        {
            L2Player player = getClient().CurrentPlayer;

            if (player._p_block_act == 1)
            {
                player.sendActionFailed();
                return;
            }

            L2Citizen npc;

            if (_alias.Equals("teleport_request"))
            {
                npc = getNpc();

                if (npc == null)
                {
                    player.sendActionFailed();
                    return;
                }

                npc.onTeleportRequest(player);
            }
            else if (_alias.StartsWith("menu_select?"))
            {
                npc = getNpc();

                _alias = _alias.Replace(" ", "");
                string   x1  = _alias.Split('?')[1];
                string[] x2  = x1.Split('&');
                int      ask = int.Parse(x2[0].Substring(4));
                int      reply;

                try
                {
                    reply = int.Parse(x2[1].Substring(6));
                }
                catch
                {
                    reply = 0;
                }

                npc.onDialog(player, ask, reply);
            }
            else if (_alias.Equals("talk_select"))
            {
                npc = getNpc();
                QuestManager.getInstance().talkSelection(player, npc);
            }
            else if (_alias.StartsWith("quest_accept?"))
            {
                npc    = getNpc();
                _alias = _alias.Replace(" ", "");
                string x1  = _alias.Split('?')[1];
                int    qid = int.Parse(x1.Split('=')[1]);

                QuestManager.getInstance().questAccept(player, npc, qid);
            }
            else if (_alias.StartsWith("quest_continue?"))
            {
                npc    = getNpc();
                _alias = _alias.Replace(" ", "");
                string x1  = _alias.Split('?')[1];
                int    qid = int.Parse(x1.Split('=')[1]);

                QuestManager.getInstance().quest_continue(player, npc, qid);
            }
            else if (_alias.StartsWith("quest_tryaccept?"))
            {
                npc    = getNpc();
                _alias = _alias.Replace(" ", "");
                string x1  = _alias.Split('?')[1];
                int    qid = int.Parse(x1.Split('=')[1]);

                QuestManager.getInstance().quest_tryaccept(player, npc, qid);
            }
            else if (_alias.Equals("deposit"))
            {
                npc = getNpc();
                npc.showPrivateWarehouse(player);
            }
            else if (_alias.Equals("withdraw"))
            {
                npc = getNpc();
                npc.showPrivateWarehouseBack(player);
            }
            else if (_alias.Equals("deposit_pledge"))
            {
                npc = getNpc();
                npc.showClanWarehouse(player);
            }
            else if (_alias.Equals("withdraw_pledge"))
            {
                npc = getNpc();
                npc.showClanWarehouseBack(player);
            }
            else if (_alias.Equals("learn_skill"))
            {
                npc = getNpc();
                npc.showSkillLearn(player, false);
            }
            else if (_alias.StartsWith("create_pledge?"))
            {
                npc = getNpc();
                //bypass -h create_pledge?pledge_name= $pledge_name
                string x1   = _alias.Split('?')[1];
                string name = x1.Split('=')[1];
                name = name.Substring(1);

                grandmaster_total.createClan(player, name, npc);
            }
            else if (_alias.StartsWith("teleport_next?"))
            {
                npc = getNpc();
                string   x1    = _alias.Split('?')[1];
                string[] x2    = x1.Split('&');
                int      ask   = int.Parse(x2[0].Substring(4));
                int      reply = int.Parse(x2[1].Substring(6));

                npc.UseTeleporter(player, ask, reply);
            }
            else if (_alias.StartsWith("petitionlink?"))
            {
                PetitionManager.getInstance().petitionlink(player, _alias.Split('?')[1]);
            }
            else if (_alias.StartsWith("_mr"))
            {
                npc = getNpc();
                MonsterRace.Instance.OnBypass(player, npc, _alias);
            }
            else
            {
                CLogger.warning("Unknown bypass '" + _alias + "'");
            }
        }