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


C# PlayerBussiness.GetUserItemSingle方法代码示例

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


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

示例1: GetAnnex

 public bool GetAnnex(string value, GamePlayer player, ref string msg, ref bool result, ref eMessageType eMsg)
 {
     int gid = int.Parse(value);
     using (PlayerBussiness db = new PlayerBussiness())
     {
         ItemInfo goods = db.GetUserItemSingle(gid);
         if (goods != null)
         {
             if (goods.TemplateID == 11408)
             {
                 player.AddMedal(goods.Count);
                 return true;
             }
             else
             {
                 if (player.AddItem(goods))
                 {
                     eMsg = eMessageType.Normal;
                     return true;
                 }
                 else
                 {
                     eMsg = eMessageType.ERROR;
                     result = false;
                     msg = LanguageMgr.GetTranslation(goods.GetBagName()) + LanguageMgr.GetTranslation("MailGetAttachHandler.NoPlace");
                 }
             }
         }
     }
     return false;
 }
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:31,代码来源:MailGetAttachHandler.cs

示例2: ProcessRequest

        public void ProcessRequest(HttpContext context)
        {
            bool value = false;
            string message = "Fail!";

            XElement result = new XElement("Result");
            try
            {
                int goodsID = int.Parse(context.Request.Params["ID"]);
                using (PlayerBussiness db = new PlayerBussiness())
                {
                    ItemInfo item = db.GetUserItemSingle(goodsID);
                    result.Add(Road.Flash.FlashUtils.CreateGoodsInfo(item));
                }
                value = true;
                message = "Success!";

            }
            catch(Exception ex)
            {
                log.Error("UserGoodsInfo", ex);
            }

            result.Add(new XAttribute("value", value));
            result.Add(new XAttribute("message", message));

            context.Response.ContentType = "text/plain";
            context.Response.Write(result.ToString(false));
        }
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:29,代码来源:UserGoodsInfo.ashx.cs

示例3: ProcessRequest

        public void ProcessRequest(HttpContext context)
        {
            bool value = false;
            string message = "Fail!";
            int total = 0;
            XElement result = new XElement("Result");

            try
            {
                int page = int.Parse(context.Request["page"]);
                string name = csFunction.ConvertSql(HttpUtility.UrlDecode(context.Request["name"]));
                int type = int.Parse(context.Request["type"]);
                int pay = int.Parse(context.Request["pay"]);
                int userID = int.Parse(context.Request["userID"]);
                int buyID = int.Parse(context.Request["buyID"]);
                int order = int.Parse(context.Request["order"]);
                bool sort = bool.Parse(context.Request["sort"]);
                string AuctionIDs = csFunction.ConvertSql(HttpUtility.UrlDecode(context.Request["Auctions"]));
                AuctionIDs = string.IsNullOrEmpty(AuctionIDs) ? "0" : AuctionIDs;
                int size = 50;//int.Parse(context.Request["size"]);

                using (PlayerBussiness db = new PlayerBussiness())
                {

                    AuctionInfo[] infos = db.GetAuctionPage(page, name, type, pay, ref total, userID, buyID, order, sort, size, AuctionIDs);
                    foreach (AuctionInfo info in infos)
                    {
                        XElement temp = FlashUtils.CreateAuctionInfo(info);
                        using (PlayerBussiness pb = new PlayerBussiness())
                        {
                            ItemInfo item = pb.GetUserItemSingle(info.ItemID);
                            if (item != null)
                            {
                                temp.Add(Road.Flash.FlashUtils.CreateGoodsInfo(item));
                            }
                            result.Add(temp);
                        }
                    }

                    value = true;
                    message = "Success!";
                }
            }
            catch (Exception ex)
            {
                log.Error("AuctionPageList", ex);
            }

            result.Add(new XAttribute("total", total));
            result.Add(new XAttribute("vaule", value)); 
            result.Add(new XAttribute("message", message));

            context.Response.ContentType = "text/plain";
            context.Response.Write(result.ToString(false));
            //context.Response.BinaryWrite(StaticFunction.Compress(result.ToString()));
        }
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:56,代码来源:AuctionPageList.ashx.cs

示例4: HandlePacket

        public int HandlePacket(GameClient client, GSPacketIn packet)
        {

            int Type = packet.ReadInt();
            if (Type == 2)
            {
                int ItemID = packet.ReadInt();

                using (PlayerBussiness db = new PlayerBussiness())
                {
                    ItemInfo Item = db.GetUserItemSingle(ItemID);
                    if (Item != null)
                    {
                        GSPacketIn pkg = new GSPacketIn((byte)ePackageType.LINKREQUEST_GOODS, client.Player.PlayerCharacter.ID);
                        pkg.WriteInt(Item.TemplateID);
                        pkg.WriteInt(Item.ItemID);

                        pkg.WriteInt(Item.StrengthenLevel);

                        pkg.WriteInt(Item.AttackCompose);

                        pkg.WriteInt(Item.AgilityCompose);

                        pkg.WriteInt(Item.LuckCompose);

                        pkg.WriteInt(Item.DefendCompose);
                        pkg.WriteInt(Item.ValidDate);
                        pkg.WriteBoolean(Item.IsBinds);
                        pkg.WriteBoolean(Item.IsJudge);
                        pkg.WriteBoolean(Item.IsUsed);
                        if (Item.IsUsed)
                        {
                            pkg.WriteString(Item.BeginDate.ToString());
                        }
                        pkg.WriteInt(Item.Hole1);
                        pkg.WriteInt(Item.Hole2);
                        pkg.WriteInt(Item.Hole3);
                        pkg.WriteInt(Item.Hole4);
                        pkg.WriteInt(Item.Hole5);
                        pkg.WriteInt(Item.Hole6);

                        pkg.WriteString(Item.Template.Hole);

                        client.Out.SendTCP(pkg);
                    }
                    return 1;
                }

            }
            return 0;
        }
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:51,代码来源:ItemCompareHandler.cs

示例5: AddAnnex

 public static void AddAnnex(XElement node, string value)
 {
     using (PlayerBussiness pb = new PlayerBussiness())
     {
         if (!string.IsNullOrEmpty(value))
         {
             ItemInfo pr = pb.GetUserItemSingle(int.Parse(value));
             if (pr != null)
             {
                 node.Add(Road.Flash.FlashUtils.CreateGoodsInfo(pr));
             }
         }
     }
 }
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:14,代码来源:LoadUserMail.ashx.cs


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