当前位置: 首页>>代码示例>>C#>>正文


C# Client.GetParam方法代码示例

本文整理汇总了C#中Client.GetParam方法的典型用法代码示例。如果您正苦于以下问题:C# Client.GetParam方法的具体用法?C# Client.GetParam怎么用?C# Client.GetParam使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Client的用法示例。


在下文中一共展示了Client.GetParam方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Init

        public override bool Init(Client client)
        {
            string Action = BaseFuncs.GetAdditionalURLArray(client.URL, this.URL)[0];
            Logger.ConsoleLog("ROBO page; GET: " + client.Head.GetParams.Count + " POST: " + client.Head.PostParams.Count);

            uint OrderID;
            XOrder Order;

            if (Action == "success")
            {
                client.Redirect(Helper.GetReferer(client));
                return false;
            }
            if (Action == "result")
            {
                Logger.ConsoleLog("Result come!", ConsoleColor.Green);

                if (uint.TryParse(client.GetParam("InvId"), out OrderID) && Helper.OrderHelper.Table.SelectOne(data => data.ID == OrderID && data.Status == 0, out Order))
                {
                    if (this.ResultCRC(client).Equals(client.GetParam("SignatureValue")))
                    {
                        Order.Status = 1;
                        XUser user = Helper.UserHelper.Table.SelectByID(Order.UserID);
                        user.Wallet += Order.Price;

                        Helper.OrderHelper.Table.UpdateByID(Order, Order.ID);
                        Helper.UserHelper.Table.UpdateByID(user, user.ID);

                        client.HttpSend("OK" + Order.ID);
                        return false;
                    }
                }
            }

            client.HttpSend("");
            return false;
        }
开发者ID:GiByteNET,项目名称:GameSlot,代码行数:37,代码来源:Robokassa.cs

示例2: Init

        public override bool Init(Client client)
        {
            //Image ing = Image.FromStream(new MemoryStream());
            List<Chip> Chips = new List<Chip>();
            List<USteamItem> usi = new List<USteamItem>();
            /*
            Helper.ChipHelper.AddChipToUser(4, 1);

            Chip chip = new Chip();
            chip.AssertID = 909383131;
            Chips.Add(chip);
            */

            if(Helper.SteamBotHelper.Table.SelectAll().Count == 0)
            {
                XSteamBot bot = new XSteamBot();
                bot.Login = "gabechest02";
                bot.Password = "43uiy48cEKbchfcUICda";
                bot.Name = "Tatar";
                Helper.SteamBotHelper.Table.Insert(bot);

                bot = new XSteamBot();
                bot.Login = "gabechest03";
                bot.Password = "kejbcxk78487ckxbCEceebw";
                bot.Name = "Chertila";
                Helper.SteamBotHelper.Table.Insert(bot);

                bot = new XSteamBot();
                bot.Login = "gabechest04";
                bot.Password = "CJgebc873bKDH928ebndDa482";
                bot.Name = "BBWBot";
                Helper.SteamBotHelper.Table.Insert(bot);

                bot = new XSteamBot();
                bot.Login = "gabechest05";
                bot.Password = "Ckcbhejvc3278dbvCV2kjbJB4b4";
                bot.Name = "Kekins";
                Helper.SteamBotHelper.Table.Insert(bot);

                bot = new XSteamBot();
                bot.Login = "gabechest06";
                bot.Password = "ckebccKLbkabJK8477412bJDCFVBjv12";
                bot.Name = "Shushan";
                Helper.SteamBotHelper.Table.Insert(bot);

                bot = new XSteamBot();
                bot.Login = "gabechest07";
                bot.Password = "CKbghwuiyvgbc772qi3ebdcu3w22";
                bot.Name = "Bratan";
                Helper.SteamBotHelper.Table.Insert(bot);

                Logger.ConsoleLog("added bots!", ConsoleColor.Cyan, LogLevel.Warning);
            }

            XUser user;
            if (Helper.UserHelper.GetCurrentUser(client, out user) && (user.ID == Configs.ADMIN_ACCOUNT))
            {
                if (client.GetParam("all") != null)
                {
                    Logger.ConsoleLog("count::" + Helper.UserHelper.Table_SteamItemUsersInventory.SelectAll().Count, ConsoleColor.Red);
                    foreach(XSItemUsersInventory x in Helper.UserHelper.Table_SteamItemUsersInventory.SelectAll())
                    {
                        Logger.ConsoleLog(x.ID + ":UserID:" + x.UserID + ":AssertID:" + x.AssertID + ":SteamGameID:" + x.SteamGameID + ":Deleted:" + x.Deleted + ":SteamItemID:" + x.SteamItemID + ":SteamBotID:" + x.SteamBotID + "-------------", ConsoleColor.Cyan, LogLevel.Warning);
                    }
                }
                else if (client.GetParam("chipID") != null && client.GetParam("to") != null)
                {
                    Helper.ChipHelper.AddChipToUser(Convert.ToUInt32(client.GetParam("chipID")), Convert.ToUInt32(client.GetParam("to")));
                    Logger.ConsoleLog("Added chip!!!", ConsoleColor.Cyan, LogLevel.Warning);
                    //Thread.Sleep(10);
                }

                else if(client.GetParam("game_322") != null)
                {
                    Logger.ConsoleLog("\nDOTA: ", ConsoleColor.Cyan, LogLevel.Warning);
                    Lottery dota = Helper.LotteryHelper.GetCurrent(Configs.DOTA2_STEAM_GAME_ID, client);
                    Logger.ConsoleLog("RoundNumber: " + dota.RaundNumber.ToString(), ConsoleColor.Cyan, LogLevel.Warning);
                    Logger.ConsoleLog("WinnersToken: " + (int)(dota.JackpotPrice * 100 * dota.RaundNumber), ConsoleColor.Cyan, LogLevel.Warning);
                    Logger.ConsoleLog("Winner: " + Helper.LotteryHelper.GetUserByToken((int)(dota.JackpotPrice * 100 * dota.RaundNumber), dota.ID).Name, ConsoleColor.Cyan, LogLevel.Warning);
                    Logger.ConsoleLog("--------------------------------------------------------------------\n", ConsoleColor.Cyan, LogLevel.Warning);

                    Logger.ConsoleLog("\nCSGO: ", ConsoleColor.Cyan, LogLevel.Warning);
                    Lottery csgo = Helper.LotteryHelper.GetCurrent(Configs.CSGO_STEAM_GAME_ID, client);
                    Logger.ConsoleLog("RoundNumber: " + csgo.RaundNumber.ToString(), ConsoleColor.Cyan, LogLevel.Warning);
                    Logger.ConsoleLog("WinnersToken: " + (int)(csgo.JackpotPrice * 100 * csgo.RaundNumber), ConsoleColor.Cyan, LogLevel.Warning);
                    Logger.ConsoleLog("Winner: " + Helper.LotteryHelper.GetUserByToken((int)(csgo.JackpotPrice * 100 * csgo.RaundNumber), csgo.ID).Name, ConsoleColor.Cyan, LogLevel.Warning);
                    Logger.ConsoleLog("--------------------------------------------------------------------\n", ConsoleColor.Cyan, LogLevel.Warning);
                }

                else if (client.GetParam("add_money") != null && client.GetParam("to") != null)
                {
                    double money;
                    uint to;
                    XUser us;
                    if (double.TryParse(client.GetParam("add_money"), out money) && uint.TryParse(client.GetParam("to"), out to) && Helper.UserHelper.Table.SelectByID(to, out us))
                    {
                        us.Wallet += money;
                        Helper.UserHelper.Table.UpdateByID(us, us.ID);
                        Logger.ConsoleLog("Added money: " + money + " to user: " + us.Name, ConsoleColor.Cyan, LogLevel.Warning);
                    }
//.........这里部分代码省略.........
开发者ID:GiByteNET,项目名称:GameSlot,代码行数:101,代码来源:TestPage.cs

示例3: Init

        public override bool Init(Client client)
        {
            if(client.Closed)
            {
                return false;
            }

            if(Helper.UserHelper.Authorized(client))
            {
                client.Redirect("/");
                return false;
            }

            if (client.GetParam("openid.identity") == null)
            {
                client.Redirect("https://steamcommunity.com/openid/login/?openid.ns=http://specs.openid.net/auth/2.0&openid.mode=checkid_setup&openid.return_to=http://" + client.Host + "/login&openid.realm=http://" + client.Host + "&openid.ns.sreg=http://openid.net/extensions/sreg/1.1&openid.claimed_id=http://specs.openid.net/auth/2.0/identifier_select&openid.identity=http://specs.openid.net/auth/2.0/identifier_select");
                return false;
            }
            else
            {
                try
                {
                    using (WebClient WebClient = new WebClient())
                    {
                        string url = "https://steamcommunity.com/openid/login/?openid.sig=" + client.GetParam("openid.sig")
                            + "&openid.ns=" + client.GetParam("openid.ns")
                            + "&openid.mode=check_authentication";

                        foreach (string get in client.GetParam("openid.signed").Split(','))
                        {
                            url += "&openid." + get + "=" + client.GetParam("openid." + get);
                        }

                        if (!WebClient.DownloadString(url.Replace("+", "%2B")).Contains("true"))
                        {
                            client.Redirect(this.URL);
                            return false;
                        }
                        else
                        {
                            string[] pre = client.GetParam("openid.identity").Split('/');
                            if (pre.Length > 5)
                            {
                                ulong SteamID = ulong.Parse(pre[5]);
                                XUser user;
                                if (!Helper.UserHelper.Auth(SteamID, out user, client))
                                {
                                    client.Redirect(this.URL);
                                    return false;
                                }
                            }
                        }
                    }
                }
                catch(Exception ex)
                {
                    Logger.ConsoleLog("login: ex" + ex, ConsoleColor.Red);
                }
            }

            client.Redirect(Helper.GetReferer(client));
            return false;
        }
开发者ID:GiByteNET,项目名称:GameSlot,代码行数:63,代码来源:LoginPage.cs

示例4: Init

        public override bool Init(Client client)
        {
            Dictionary<uint, USteamItem> StoreItems = new Dictionary<uint,USteamItem>();
            int ElementsOnPage = 2;

            uint SteamGameID = Configs.DOTA2_STEAM_GAME_ID;
            if(client.GetParam("game") != null && client.GetParam("game").Equals(Configs.CSGO_STEAM_GAME_ID.ToString()))
            {
                SteamGameID = Configs.CSGO_STEAM_GAME_ID;
            }

            foreach (USteamItem SteamItem in Helper.UserHelper.GetSteamLocalInventory(Configs.ADMIN_ACCOUNT, SteamGameID, false, 1))
            {
                if(StoreItems.ContainsKey(SteamItem.ID))
                {
                    StoreItems[SteamItem.ID].Num++;
                }
                else
                {
                    SteamItem.Num++;
                    SteamItem.ShopPrice = SteamItem.Price - (SteamItem.Price / 100 * 40);
                    SteamItem.ShopPrice_Str = SteamItem.ShopPrice.ToString("###,###,##0");
                    StoreItems.Add(SteamItem.ID, SteamItem);
                }
            }

            Dictionary<uint, USteamItem> StoreItemsData = new Dictionary<uint, USteamItem>();
            int Page = 1;
            if (client.GetParam("page") != null)
            {
                if(int.TryParse(client.GetParam("page"), out Page))
                {
                    if (Page > StoreItems.Count / ElementsOnPage)
                    {
                        Page = StoreItems.Count / ElementsOnPage;
                    }
                }
            }

            if(Page <= 0)
            {
                Page = 1;
            }

            int count = 0;
            foreach(uint Key in StoreItems.Keys)
            {
                if(count < (Page -1) * ElementsOnPage)
                {
                    count++;
                    continue;
                }

                StoreItemsData.Add(Key, StoreItems[Key]);
                count++;

                if (count >= Page * ElementsOnPage)
                {
                    break;
                }
            }

            Hashtable data = new Hashtable();
            data.Add("Title", "Магазин GAMESLOT");
            data.Add("StoreItems", StoreItemsData);
            data.Add("Page", Page);
            data.Add("ItemsNum", StoreItems.Count);
            data.Add("ElementsOnPage", ElementsOnPage);
            data.Add("Game", SteamGameID);
            client.HttpSend(TemplateActivator.Activate(this, client, data));
            return true;
        }
开发者ID:GiByteNET,项目名称:GameSlot,代码行数:72,代码来源:StoreMainPage.cs

示例5: Init

        public override bool Init(Client client)
        {
            ushort currency = Helper.UserHelper.GetCurrency(client);

            uint SteamGameID = 0;
            string[] urls = BaseFuncs.GetAdditionalURLArray(client.URL, this.URL);
            string Game = urls[0];

            List<XUser> Users = new List<XUser>();
            string title = "";
            if (Game.Equals("dota2"))
            {
                Helper.UserHelper.Table.Select(data => data.DOTA_WonTotalPrice > 0, out Users);
                SteamGameID = Configs.DOTA2_STEAM_GAME_ID;
                Users = (from it in Users orderby it.DOTA_RUB_WonTotalPrice descending select it).ToList();
                title = "Топ победителей DOTA2";
            }
            else if (Game.Equals("csgo"))
            {
                Helper.UserHelper.Table.Select(data => data.CSGO_WonTotalPrice > 0, out Users);
                SteamGameID = Configs.CSGO_STEAM_GAME_ID;
                Users = (from it in Users orderby it.CSGO_RUB_WonTotalPrice descending select it).ToList();
                title = "Топ победителей CSGO";
            }
            else if (Game.Equals("current"))
            {
                Helper.UserHelper.Table.Select(data => (data.DOTA_WonTotalPrice + data.CSGO_WonTotalPrice) > 0, out Users);
                Users = (from it in Users orderby (it.CSGO_RUB_WonTotalPrice + it.DOTA_RUB_WonTotalPrice) descending select it).ToList();
                title = "Топ победителей";
            }
            else
            {
                BaseFuncs.Show404(client);
                return false;
            }

            int ShowNum = 10;
            int from = 0;

            if(client.GetParam("from") != null)
            {
                int.TryParse(client.GetParam("from"), out from);
            }

            if (from >= Users.Count)
            {
                from = (Users.Count / ShowNum) * ShowNum;
            }

            List<TopPlayer> TopPlayers = new List<TopPlayer>();
            for (int i = from; i < Math.Min(from + ShowNum, Users.Count); i++)
            {
                TopPlayer TopPlayer = new TopPlayer();
                TopPlayer.ID = Users[i].ID;
                TopPlayer.Position = i + 1;
                TopPlayer.Name = Users[i].Name;
                TopPlayer.Avatar = Users[i].Avatar;

                if (SteamGameID == Configs.DOTA2_STEAM_GAME_ID)
                {
                    TopPlayer.GamesCount = Users[i].DOTA_GamesCount;
                    TopPlayer.WonCount = Users[i].DOTA_WonCount;

                    TopPlayer.BetItemsCount = Users[i].DOTA_TotalBetItemsCount;
                    TopPlayer.WonItemsCount = Users[i].DOTA_WonItemsCount;

                    TopPlayer.BetPrice = Users[i].DOTA_RUB_TotalBetPrice;
                    TopPlayer.WonPrice = Users[i].DOTA_RUB_WonTotalPrice;
                }

                else if (SteamGameID == Configs.CSGO_STEAM_GAME_ID)
                {
                    TopPlayer.GamesCount = Users[i].CSGO_GamesCount;
                    TopPlayer.WonCount = Users[i].CSGO_WonCount;

                    TopPlayer.BetItemsCount = Users[i].CSGO_TotalBetItemsCount;
                    TopPlayer.WonItemsCount = Users[i].CSGO_WonItemsCount;

                    TopPlayer.BetPrice = Users[i].CSGO_RUB_TotalBetPrice;
                    TopPlayer.WonPrice = Users[i].CSGO_RUB_WonTotalPrice;
                }

                else if (SteamGameID == 0)
                {
                    TopPlayer.GamesCount = (Users[i].CSGO_GamesCount + Users[i].DOTA_GamesCount);
                    TopPlayer.WonCount = (Users[i].CSGO_WonCount + Users[i].DOTA_WonCount);

                    TopPlayer.BetItemsCount = (Users[i].CSGO_TotalBetItemsCount + Users[i].DOTA_TotalBetItemsCount);
                    TopPlayer.WonItemsCount = (Users[i].CSGO_WonItemsCount + Users[i].DOTA_WonItemsCount);

                    TopPlayer.BetPrice = (Users[i].CSGO_RUB_TotalBetPrice + Users[i].DOTA_RUB_TotalBetPrice);
                    TopPlayer.WonPrice = (Users[i].CSGO_RUB_WonTotalPrice + Users[i].DOTA_RUB_WonTotalPrice);
                }

                if (TopPlayer.WonCount > 0)
                {
                    TopPlayer.Winrate = (int)(TopPlayer.WonCount / ((double)TopPlayer.GamesCount / 100d));
                }
                else
                {
//.........这里部分代码省略.........
开发者ID:GiByteNET,项目名称:GameSlot,代码行数:101,代码来源:TopPlayersPage.cs

示例6: ResultCRC

 private string ResultCRC(Client client)
 {
     string crc = client.GetParam("OutSum") + ":" + client.GetParam("InvId") + ":" + "12311974b";
     Console.WriteLine(crc);
     return BaseFuncs.MD5(crc).ToUpper();
 }
开发者ID:GiByteNET,项目名称:GameSlot,代码行数:6,代码来源:Robokassa.cs


注:本文中的Client.GetParam方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。