本文整理汇总了C#中Bussiness.PlayerBussiness.GetUserEuqip方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerBussiness.GetUserEuqip方法的具体用法?C# PlayerBussiness.GetUserEuqip怎么用?C# PlayerBussiness.GetUserEuqip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bussiness.PlayerBussiness
的用法示例。
在下文中一共展示了PlayerBussiness.GetUserEuqip方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandlePacket
//修改: Xiaov
//时间: 2009-11-7
//描述: 获取用户装备<已测试>
public int HandlePacket(GameClient client, GSPacketIn packet)
{
bool type = packet.ReadBoolean();//_loc_3.writeBoolean(true);
int id = packet.ReadInt();
string nickname;
if (!type)
nickname = packet.ReadString();
GamePlayer player = Managers.WorldMgr.GetPlayerById(id);
PlayerInfo info;
List<ItemInfo> items;
if (player != null)
{
info = player.PlayerCharacter;
items = player.MainBag.GetItems(0, 31);
}
else
{
using (PlayerBussiness pb = new PlayerBussiness())
{
info = pb.GetUserSingleByUserID(id);
items = pb.GetUserEuqip(id);
}
}
if (info != null && items != null)
client.Out.SendUserEquip(info, items);
return 0;
}
示例2: ProcessRequest
public void ProcessRequest(HttpContext context)
{
bool value = false;
string message = "Fail!";
XElement result = new XElement("Result");
try
{
// int userid = int.Parse(context.Request.Params["ID"]);
int userid = int.Parse(context.Request["ID"]);
using (PlayerBussiness pb = new PlayerBussiness())
{
PlayerInfo info = pb.GetUserSingleByUserID(userid);
result.Add(new XAttribute("Agility", info.Agility),
new XAttribute("Attack", info.Attack),
new XAttribute("Colors", info.Colors),
new XAttribute("Skin", info.Skin),
new XAttribute("Defence", info.Defence),
new XAttribute("GP", info.GP),
new XAttribute("Grade", info.Grade),
new XAttribute("Luck", info.Luck),
new XAttribute("Hide", info.Hide),
new XAttribute("Repute", info.Repute),
new XAttribute("Offer", info.Offer),
new XAttribute("NickName", info.NickName),
new XAttribute("ConsortiaName", info.ConsortiaName),
new XAttribute("ConsortiaID", info.ConsortiaID),
new XAttribute("ReputeOffer", info.ReputeOffer),
new XAttribute("ConsortiaHonor", info.ConsortiaHonor),
new XAttribute("ConsortiaLevel", info.ConsortiaLevel),
new XAttribute("ConsortiaRepute", info.ConsortiaRepute),
new XAttribute("WinCount", info.Win),
new XAttribute("TotalCount", info.Total),
new XAttribute("EscapeCount", info.Escape),
new XAttribute("Sex", info.Sex),
new XAttribute("Style", info.Style),
new XAttribute("FightPower",info.FightPower));
ItemInfo[] items = pb.GetUserEuqip(userid).ToArray();
foreach (ItemInfo g in items)
{
result.Add(Road.Flash.FlashUtils.CreateGoodsInfo(g));
}
//XElement item = new XElement("Item");
//ItemInfo[] items = pb.GetUserEuqip(userid);
//foreach (ItemInfo g in items)
//{
// item.Add(Road.Flash.FlashUtils.CreateGoodsInfo(g));
//}
//XElement buff = new XElement("Buff");
//BuffInfo[] buffs = pb.GetUserBuff(userid);
//foreach (BuffInfo b in buffs)
//{
// if (!b.IsValid())
// continue;
// buff.Add(Road.Flash.FlashUtils.CreateBuffInfo(b));
//}
// result.Add(item);
//result.Add(buff);
}
value = true;
message = "Success!";
}
catch(Exception ex)
{
log.Error("LoadUserEquip", ex);
}
result.Add(new XAttribute("value", value));
result.Add(new XAttribute("message", message));
context.Response.ContentType = "text/plain";
context.Response.Write(result.ToString(false));
}