本文整理汇总了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;
}
示例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));
}
示例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()));
}
示例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;
}
示例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));
}
}
}
}