コード例 #1
0
    private void ProcessUserlist()
    {
        string           search     = Request.Form["Tb_SearchKeys"].ToSafeString();
        int              num        = StringHelper.ConvertToInt(Request.QueryString["pages"], 1);
        INVelocityEngine arg_13D_0  = NVelocityEngineFactory.CreateNVelocityFileEngine(AppConfig.AppSettings["Path"], false);
        IDictionary      dictionary = new Hashtable();

        using (var x = new WebHelperClient())
        {
            List <UserInfo> list        = x.GetAllUserInfo().ToList();
            var             onlinecount = list.Where((a) => (a.State != 0)).Count();
            list.Sort(new Comparison <UserInfo>(CompareByID));
            if (search != "")
            {
                list = list.FindAll((UserInfo a) => a.UserName.IndexOf(search, 0) != -1 || a.NickName.IndexOf(search, 0) != -1);
            }
            int count = list.Count;
            int num2  = 1;
            if (search == "")
            {
                num2 = Convert.ToInt32(Math.Ceiling(count / 20m));
                list = list.Skip((num - 1) * 20).Take(20).ToList <UserInfo>();
            }
            dictionary.Add("Result", list);
            dictionary.Add("OnlineCount", onlinecount);
            dictionary.Add("Search", search);
            dictionary.Add("Count", count);
            dictionary.Add("Page", num);
            dictionary.Add("TocalPage", num2);
            string text = arg_13D_0.Process(dictionary, "UserList.vm");
            Response.Write(text);
        }
    }
コード例 #2
0
 private void ProcessXml()
 {
     using (var a = new WebHelperClient())
     {
         var dic = new SafeStringToStringDirectionary();
         Response.Write(a.GMAction("xml", dic.ToDictionary()));
     }
 }
コード例 #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        this.username = Request.Cookies["username"].GetSafeValue();
        this.password = Request.Cookies["password"].GetSafeValue();
        int inviteid = Request.Cookies["inviteid"].GetSafeValue().ConvertToInt(0);

        using (var a = new WebHelperClient())
        {
            if (a.CheckUser(username, password, inviteid))
            {
                this.usertype = a.GetUserType(username);
            }
        }

        if (this.usertype > 1)
        {
            var page = this.Request.QueryString["page"].ToSafeString();
            switch (page)
            {
            case "left":
                ProcessLeft();
                break;

            case "userlist":
                ProcessUserlist();
                break;

            case "version":
                ProcessVersion();
                break;

            case "top":
                ProcessTop();
                break;

            case "mail":
                ProcessMail();
                break;

            case "notice":
                ProcessNotice();
                break;

            case "status":
                ProcessStatus();
                break;

            default:
                ProcessIndex();
                break;
            }
        }
        else
        {
            Response.ReturnAndRedirect("你无权访问GM管理平台!", "../login");
        }
    }
コード例 #4
0
 private void ProcessKitoff()
 {
     using (var a = new WebHelperClient())
     {
         var dic = new SafeStringToStringDirectionary();
         dic.Add("UserID", Request.QueryString["UserID"].ToSafeString());
         Response.Write(a.GMAction("kitoff", dic.ToDictionary()));
     }
 }
コード例 #5
0
 private void ProcessNotice()
 {
     using (var a = new WebHelperClient())
     {
         var dic = new SafeStringToStringDirectionary();
         dic.Add("str", Request.Form["Tx_url"].ToSafeString());
         Response.Write(a.GMAction("notice", dic.ToDictionary()));
     }
 }
コード例 #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        using (var a = new WebHelperClient())
        {
            if (!a.IsOpen())
            {
                Response.Write("服务器尚未开放!");
            }
            else
            {
                string name     = Request.Cookies["username"].GetSafeValue();
                string pass     = Request.Cookies["password"].GetSafeValue();
                int    inviteid = Request.Cookies["inviteid"].GetSafeValue().ConvertToInt(0);
                int    b        = 0;
                if (a.CheckUser(name, pass, inviteid))
                {
                    b = a.GetUserType(name);
                    if (b >= 2)
                    {
                        var x = Request.QueryString["ForceLoginUsername"].ToSafeString();
                        if (x != "" && a.ExistsUsername(x))
                        {
                            name = x;
                        }
                        var type = a.GetUserType(x);
                        if (b <= type)
                        {
                            Response.Write("对不起,你的权限不足");
                            return;
                        }
                    }
                    pass = Guid.NewGuid().ToString();
                    a.AddPlayer(name, pass);


                    string content = "user="******"&key=" + pass;

                    INVelocityEngine FileEngine = NVelocityEngineFactory.CreateNVelocityFileEngine(AppConfig.AppSettings["Path"], false);

                    IDictionary context = new Hashtable();
                    context.Add("Username", name);
                    context.Add("Content", content);
                    context.Add("Edition", "0");
                    context.Add("Rand", DateTime.Now.Ticks.ToString());
                    context.Add("UserType", b.ToString());
                    Response.Write(FileEngine.Process(context, "Game.vm"));
                }
                else
                {
                    Response.Cookies.Add(WebHelper.CreateCookie("username", "", DateTime.Now.AddYears(-1), "hqgddt.com"));
                    Response.Cookies.Add(WebHelper.CreateCookie("password", "", DateTime.Now.AddYears(-1), "hqgddt.com"));
                    Response.ReturnAndRedirect("用户名或密码错误!", "login");
                }
            }
        }
    }
コード例 #7
0
 private void ProcessStatus()
 {
     using (var a = new WebHelperClient())
     {
         INVelocityEngine iNVelocityEngine = NVelocityEngineFactory.CreateNVelocityFileEngine(AppConfig.AppSettings["Path"], false);
         IDictionary      dictionary       = new Hashtable();
         dictionary.Add("Runmgr", a.GetRunMgr());
         dictionary.Add("IsConnected", a.IsOpen());
         Response.Write(iNVelocityEngine.Process(dictionary, "Status.vm"));
     }
 }
コード例 #8
0
 private void ProcessForbid()
 {
     using (var a = new WebHelperClient())
     {
         var dic = new SafeStringToStringDirectionary();
         dic.Add("UserID", Request.QueryString["UserID"].ToSafeString());
         dic.Add("reason", Request.QueryString["reason"].ToSafeString());
         dic.Add("day", Request.QueryString["day"].ToSafeString());
         Response.Write(a.GMAction("forbid", dic.ToDictionary()));
     }
 }
コード例 #9
0
 private void ProcessStart()
 {
     if (this.usertype <= 2)
     {
         Response.Write("对不起,你的权限不足");
         return;
     }
     using (var a = new WebHelperClient())
     {
         var dic = new SafeStringToStringDirectionary();
         dic.Add("type", Request.QueryString["type"].ToSafeString());
         Response.Write(a.GMAction("start", dic.ToDictionary()));
     }
 }
コード例 #10
0
 private void ProcessReconnect()
 {
     if (this.usertype <= 2)
     {
         Response.Write("对不起,你的权限不足");
         return;
     }
     using (var a = new WebHelperClient())
     {
         if (a.Reconnect())
         {
             Response.Write("成功");
         }
         Response.Write("错误");
     }
 }
コード例 #11
0
    private bool SendMail()
    {
        if (!(this.usertype > 2))
        {
            return(false);
        }
        DataTable tabGoods  = Context.Session["goodsTable"] as DataTable;
        bool      result    = false;
        var       Title     = System.Web.HttpUtility.UrlDecode(Request.Form["txt_Title"].ToSafeString());
        var       Gold      = Request.Form["txt_gold"].ConvertToInt();
        var       Money     = Request.Form["txt_money"].ConvertToInt();
        var       GiftToken = Request.Form["txt_liJuan"].ConvertToInt();
        var       Content   = System.Web.HttpUtility.UrlDecode(Request.Form["txt_Content"].ToSafeString());
        var       str       = "";

        if (tabGoods != null)
        {
            foreach (DataRow x in tabGoods.Rows)
            {
                str += string.Format("{0},{1},{2},{3},{4},{5},{6},{7},{8}|", new object[]
                {
                    x["TemplateId"],
                    x["GoodNumber"],
                    x["ValidDate"],
                    x["StrengthenLevel"],
                    x["AttackCompose"],
                    x["DefendCompose"],
                    x["AgilityCompose"],
                    x["LuckCompose"],
                    (x["IsBind"].ToString() == "True") ? 1 : 0
                });
            }
            str.RemoveLastOne();
        }
        int[] IDs = Request.Form["txt_userID"].Split(',').ConvertToIntArray();
        using (var a = new WebHelperClient())
        {
            foreach (var b in IDs)
            {
                a.SendMailAndItem(Title, Content, b, Gold, Money, GiftToken, str);
            }
        }
        result = true;
        Context.Session["goodsTable"] = null;
        return(result);
    }
コード例 #12
0
ファイル: Login.aspx.cs プロジェクト: SkelletonX/DDTServer
    private void ProcessPay()
    {
        string username = Request.QueryString["username"].ToSafeString();
        int    c        = 0;

        using (var a = new WebHelperClient())
        {
            c = a.GetIDByUserName(username).FirstOrDefault();
        }

        if (c == 0)
        {
            Response.ReturnAndRedirect("用户不存在,请确保已经注册角色!", "login");
        }
        else
        {
            Response.Redirect("charge?userid=" + c.ToString() + "&step=1");
        }
    }
コード例 #13
0
ファイル: Charge.aspx.cs プロジェクト: SkelletonX/DDTServer
    private void ProcessStep2()
    {
        string userid  = Request.QueryString["userid"];
        string paytype = Request.QueryString["paytype"];

        if (paytype.ConvertToInt(0) == 0 || userid.ConvertToInt(0) == 0)
        {
            Write404();
        }

        if (paytype.ConvertToInt(0) >= 1 && paytype.ConvertToInt(0) <= 24)
        {
            string username = "";
            using (var a = new WebHelperClient())
            {
                var x = a.GetUserNameByID(userid.ConvertToInt(0));
                if (x != "")
                {
                    username = x;
                }
                else
                {
                    Write404();
                }
            }


            INVelocityEngine FileEngine = NVelocityEngineFactory.CreateNVelocityFileEngine(AppConfig.AppSettings["Path"], false);
            IDictionary      context    = new Hashtable();

            context.Add("userid", userid);
            context.Add("username", username);
            Response.Write(FileEngine.Process(context, "charge/Pay" + paytype + ".vm"));
        }
        else
        {
            Write404();
        }
    }
コード例 #14
0
    private void ProcessInvite()
    {
        string username = Request.QueryString["user"].ToSafeString();
        int    c        = 0;

        using (var a = new WebHelperClient())
        {
            c = a.GetIDByUserName(username);
        }

        if (c == 0)
        {
            Response.ReturnAndRedirect("用户不存在,请确保已经注册角色!", "Default.aspx");
        }
        else
        {
            INVelocityEngine FileEngine = NVelocityEngineFactory.CreateNVelocityFileEngine(AppConfig.AppSettings["VMPath"], false);

            IDictionary context = new Hashtable();
            context.Add("content", $"{AppConfig.AppSettings["IndexPage"]}?i=" + c);
            Response.Write(FileEngine.Process(context, "invite.vm"));
        }
    }
コード例 #15
0
 private void ProcessKey()
 {
     using (var a = new WebHelperClient())
     {
         var name = Request.QueryString["UserName"].ToSafeString();
         if (name != "" && a.ExistsUsername(name))
         {
             var type = a.GetUserType(name);
             if (this.usertype <= type)
             {
                 Response.Write("对不起,你的权限不足");
                 return;
             }
             var pass = Guid.NewGuid().ToString();
             a.AddPlayer(name, pass);
             string content = "user="******"&key=" + pass;
             Response.Write(content);
         }
         else
         {
             Response.Write("错误");
         }
     }
 }
コード例 #16
0
    protected void Page_Load(object sender, EventArgs e)
    {
        this.username = Request.Cookies["username"].GetSafeValue();
        this.password = Request.Cookies["password"].GetSafeValue();
        int inviteid = Request.Cookies["inviteid"].GetSafeValue().ConvertToInt(0);

        using (var a = new WebHelperClient())
        {
            if (a.CheckUser(username, password, inviteid))
            {
                this.usertype = a.GetUserType(username);
            }
        }

        if (this.usertype > 1)
        {
            var page = this.Request.QueryString["method"].ToSafeString();
            switch (page)
            {
            case "charge":
                ProcessCharge();
                break;

            case "forbid":
                ProcessForbid();
                break;

            case "kitoff":
                ProcessKitoff();
                break;

            case "xml":
                ProcessXml();
                break;

            case "celeb":
                ProcessCeleb();
                break;

            case "notice":
                ProcessNotice();
                break;

            case "start":
                ProcessStart();
                break;

            case "stop":
                ProcessStop();
                break;

            case "reconnect":
                ProcessReconnect();
                break;

            case "loginkey":
                ProcessKey();
                break;

            default:
                break;
            }
        }
        else
        {
            Response.ReturnAndRedirect("你无权访问GM管理平台!", "../login");
        }
    }
コード例 #17
0
    private void ProcessMail()
    {
        if (!(this.usertype > 2))
        {
            Response.Write("对不起,你的权限不足");
            return;
        }
        using (var xx = new WebHelperClient())
        {
            if (Request["sub_searchUserId"].ToSafeString() != "")
            {
                string userMsg      = Request["userMsg"].ToSafeString();
                string getAllUserId = "";
                if (userMsg != "")
                {
                    string[] strUsersg = userMsg.Split(new char[]
                    {
                        ','
                    });
                    List <UserInfo> result = xx.GetAllUserInfo().ToList();
                    for (int i = 0; i < strUsersg.Count <string>(); i++)
                    {
                        foreach (var a in result.FindAll((t) =>
                        {
                            if (t.UserName.IndexOf(strUsersg[i]) != -1 || t.NickName.IndexOf(strUsersg[i]) != -1)
                            {
                                return(true);
                            }

                            else
                            {
                                return(false);
                            }
                        }))
                        {
                            getAllUserId += string.Concat(new string[]
                            {
                                "ID:[",
                                a.UserID.ToString(),
                                "],用户名:[",
                                a.UserName.ToString(),
                                "],昵称:[",
                                a.NickName.ToString(),
                                "]\n"
                            });
                        }
                    }
                    Response.Write(getAllUserId);
                    return;
                }
            }
            else if (Request.Form["txt_userID"].ToSafeString() != "" && Request.Form["txt_Title"].ToSafeString() != "" && Request.Form["txt_Content"].ToSafeString() != "")
            {
                if (SendMail())
                {
                    Response.Write("成功");
                }
                else
                {
                    Response.Write("失败");
                }
            }
            else
            {
                INVelocityEngine FileEngine = NVelocityEngineFactory.CreateNVelocityFileEngine(AppConfig.AppSettings["Path"], false);
                IDictionary      context    = new Hashtable();
                if (Request["btn_wq"].ToSafeString() != "")
                {
                    List <ItemTemplateInfo> GoodsWeapons = xx.GetSingleCategoryItemTemplates(7).ToList();
                    context.Add("GoodsWeapons", GoodsWeapons);
                }
                if (Request["btn_zb"].ToSafeString() != "")
                {
                    List <ItemTemplateInfo> GoodsEquipment = xx.GetSingleCategoryItemTemplates(1).ToList();
                    GoodsEquipment.AddRange(xx.GetSingleCategoryItemTemplates(2).ToList());
                    GoodsEquipment.AddRange(xx.GetSingleCategoryItemTemplates(3).ToList());
                    GoodsEquipment.AddRange(xx.GetSingleCategoryItemTemplates(4).ToList());
                    GoodsEquipment.AddRange(xx.GetSingleCategoryItemTemplates(5).ToList());
                    GoodsEquipment.AddRange(xx.GetSingleCategoryItemTemplates(6).ToList());
                    GoodsEquipment.AddRange(xx.GetSingleCategoryItemTemplates(8).ToList());
                    GoodsEquipment.AddRange(xx.GetSingleCategoryItemTemplates(9).ToList());
                    GoodsEquipment.AddRange(xx.GetSingleCategoryItemTemplates(13).ToList());
                    GoodsEquipment.AddRange(xx.GetSingleCategoryItemTemplates(14).ToList());
                    GoodsEquipment.AddRange(xx.GetSingleCategoryItemTemplates(15).ToList());
                    GoodsEquipment.AddRange(xx.GetSingleCategoryItemTemplates(16).ToList());
                    GoodsEquipment.AddRange(xx.GetSingleCategoryItemTemplates(17).ToList());
                    GoodsEquipment.AddRange(xx.GetSingleCategoryItemTemplates(18).ToList());
                    GoodsEquipment.AddRange(xx.GetSingleCategoryItemTemplates(19).ToList());
                    GoodsEquipment.AddRange(xx.GetSingleCategoryItemTemplates(20).ToList());
                    context.Add("GoodsEquipment", GoodsEquipment);
                }

                if (Request["btn_dj"].ToSafeString() != "")
                {
                    List <ItemTemplateInfo> GoodsProps = xx.GetSingleCategoryItemTemplates(11).ToList();
                    context.Add("GoodsProps", GoodsProps);
                }

                string hindGoodId = Request["hindGoodId"].ToSafeString();
                if (Request["getGoodId"].ToSafeString() != "")
                {
                    hindGoodId = Request["getGoodId"].ToSafeString();
                    ;
                }
                string changParames = Request["changParames"].ToSafeString();
                if (Request["params"].ToSafeString() != "")
                {
                    changParames = Request["params"].ToSafeString();
                }

                if (hindGoodId != "" && changParames != "")
                {
                    string[] paraStr = changParames.Split(new char[]
                    {
                        ','
                    });
                    DataTable tabGoods = Context.Session["goodsTable"] as DataTable ?? InitNewGoodTable();
                    int       rowNum   = Convert.ToInt32(hindGoodId);
                    DataRow[] rowArray = tabGoods.Select("id=" + hindGoodId);


                    DataRow[] array = rowArray;
                    for (int j = 0; j < array.Length; j++)
                    {
                        DataRow rows = array[j];
                        rows.BeginEdit();
                        rows["GoodId"]          = hindGoodId.ToString();
                        rows["GoodNumber"]      = paraStr[0].ToString();
                        rows["GoodName"]        = paraStr[16].ToString();
                        rows["TemplateID"]      = paraStr[12].ToString();
                        rows["ValidDate"]       = paraStr[1].ToString();
                        rows["Gold"]            = paraStr[10].ToString();
                        rows["Money"]           = paraStr[9].ToString();
                        rows["LiJuan"]          = paraStr[11].ToString();
                        rows["StrengthenLevel"] = paraStr[4].ToString();
                        rows["AttackCompose"]   = paraStr[5].ToString();
                        rows["DefendCompose"]   = paraStr[6].ToString();
                        rows["AgilityCompose"]  = paraStr[7].ToString();
                        rows["LuckCompose"]     = paraStr[8].ToString();
                        rows["IsBind"]          = paraStr[2].ToString();
                        rows["Sex"]             = paraStr[3].ToString();
                        rows["CategoryID"]      = paraStr[13].ToString();
                        rows["CanStrengthen"]   = paraStr[14].ToString();
                        rows["CanCompose"]      = paraStr[15].ToString();
                        rows.EndEdit();
                    }
                    Context.Session["goodsTable"] = tabGoods;
                }
                string delete = Request["deletegoodid"].ToSafeString();
                if (delete != "")
                {
                    DataTable dt = Context.Session["goodsTable"] as DataTable ?? InitNewGoodTable();
                    dt.Rows.Remove(dt.Select("id=" + delete)[0]);
                }



                string idArray = Request["ids"].ToSafeString();

                if (idArray != "")
                {
                    var   a = idArray.Substring(0, idArray.Length - 1);
                    int[] b = a.Split(',').ConvertToIntArray();
                    List <ItemTemplateInfo> selectGoods = new List <ItemTemplateInfo>();
                    foreach (var c in b)
                    {
                        selectGoods.Add(xx.GetSingleItemTemplate(c));
                    }

                    if (Context.Session["goodsTable"] == null)
                    {
                        goodsTable = InitNewGoodTable();
                    }
                    else
                    {
                        goodsTable = Context.Session["goodsTable"] as DataTable;
                    }
                    foreach (var item in selectGoods)
                    {
                        DataRow newRow = goodsTable.NewRow();
                        newRow["GoodId"]          = item.TemplateID;
                        newRow["GoodNumber"]      = 1;
                        newRow["GoodName"]        = item.Name;
                        newRow["TemplateID"]      = item.TemplateID;
                        newRow["ValidDate"]       = 1;
                        newRow["StrengthenLevel"] = 0;
                        newRow["AttackCompose"]   = 0;
                        newRow["DefendCompose"]   = 0;
                        newRow["AgilityCompose"]  = 0;
                        newRow["LuckCompose"]     = 0;
                        newRow["IsBind"]          = "True";
                        newRow["Sex"]             = 0;
                        newRow["CategoryID"]      = item.CategoryID;
                        newRow["CanStrengthen"]   = item.CanStrengthen;
                        newRow["CanCompose"]      = item.CanCompose;
                        goodsTable.Rows.Add(newRow);
                    }
                    Context.Session["goodsTable"] = goodsTable;
                }
                if (Context.Session["goodsTable"] != null)
                {
                    context.Add("ResultGoods", Context.Session["goodsTable"] as DataTable);
                    if (!string.IsNullOrEmpty(idArray))
                    {
                        context.Add("isSelect", idArray.Substring(0, idArray.Length - 1));
                    }
                    else
                    {
                        context.Add("isSelect", "false");
                    }
                    idArray = "";
                }

                context.Add("this", this);
                Response.Write(FileEngine.Process(context, "Mail.vm"));
            }
        }
    }