本文整理汇总了C#中Bussiness.PlayerBussiness类的典型用法代码示例。如果您正苦于以下问题:C# PlayerBussiness类的具体用法?C# PlayerBussiness怎么用?C# PlayerBussiness使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PlayerBussiness类属于Bussiness命名空间,在下文中一共展示了PlayerBussiness类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Build
public static string Build()
{
bool value = false;
string message = "Fail!";
XElement result = new XElement("Result");
try
{
using (PlayerBussiness db = new PlayerBussiness())
{
BestEquipInfo[] infos = db.GetCelebByDayBestEquip();
foreach (BestEquipInfo info in infos)
{
result.Add(FlashUtils.CreateBestEquipInfo(info));
}
value = true;
message = "Success!";
}
}
catch (Exception ex)
{
log.Error("Load CelebByDayBestEquip is fail!", ex);
}
result.Add(new XAttribute("value", value));
result.Add(new XAttribute("message", message));
return csFunction.CreateCompressXml(result, "CelebForBestEquip", false);
}
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:30,代码来源:CelebByDayBestEquip.ashx.cs
示例2: 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;
}
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:31,代码来源:UserEquipListHandler.cs
示例3: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
int result = 1;
try
{
string username = HttpUtility.UrlDecode(Request["username"]);
string site = Request["site"] == null ? "" : HttpUtility.UrlDecode(Request["site"]);
if (!string.IsNullOrEmpty(username))
{
username = BaseInterface.GetNameBySite(username, site);
using (PlayerBussiness db = new PlayerBussiness())
{
PlayerInfo info = db.GetUserSingleByUserName(username);
if (info != null)
{
result = 0;
}
else
{
result = 2;
}
}
}
}
catch (Exception ex)
{
log.Error("UserNameCheck:", ex);
}
Response.Write(result);
}
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:31,代码来源:UserNameCheck.aspx.cs
示例4: HandlePacket
public int HandlePacket(ClientBase client, GamePacket packet)
{
int clientID = packet.ReadInt();
string account = packet.ReadUTF();
string nickName = packet.ReadUTF();
int playerID = 0;
using (PlayerBussiness pb = new PlayerBussiness())
{
playerID = pb.Registe(account, nickName);
}
if (playerID != 0)
{
ValidateLoginHandler.SendLoginPacket(client, clientID, account, playerID);
}
else
{
//TODO: 发送创建角色失败给客户端
RegisteResultPacket pkg = new RegisteResultPacket();
pkg.ClientID = clientID;
client.SendTcp(pkg);
}
return 0;
}
开发者ID:W8023Y2014,项目名称:jsion,代码行数:30,代码来源:RegistePlayerHandler.cs
示例5: OnTick
public override void OnTick(MarryRoom room)
{
try
{
if(room != null)
{
room.KickAllPlayer();
using(PlayerBussiness db = new PlayerBussiness())
{
db.DisposeMarryRoomInfo(room.Info.ID);
}
GameServer.Instance.LoginServer.SendUpdatePlayerMarriedStates(room.Info.GroomID);
GameServer.Instance.LoginServer.SendUpdatePlayerMarriedStates(room.Info.BrideID);
GameServer.Instance.LoginServer.SendMarryRoomInfoToPlayer(room.Info.GroomID, false, room.Info);
GameServer.Instance.LoginServer.SendMarryRoomInfoToPlayer(room.Info.BrideID, false, room.Info);
MarryRoomMgr.RemoveMarryRoom(room);
GSPacketIn pkg = new GSPacketIn((short)ePackageType.MARRY_ROOM_DISPOSE);
pkg.WriteInt(room.Info.ID);
WorldMgr.MarryScene.SendToALL(pkg);
room.StopTimer();
}
}
catch(Exception ex)
{
if (log.IsErrorEnabled)
log.Error("OnTick",ex);
}
}
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:34,代码来源:TankMarryLogicProcessor.cs
示例6: ProcessRequest
public void ProcessRequest(HttpContext context)
{
XElement result = new XElement("Result");
bool registerResult=false;
try
{
string username = HttpUtility.UrlDecode(context.Request["username"]);
string password = HttpUtility.UrlDecode(context.Request["password"]);
string nickName = HttpUtility.UrlDecode(context.Request["password"]);
bool sex=false;
int money=100;
int giftoken=100;
int gold = 100;
using (PlayerBussiness db = new PlayerBussiness())
{
registerResult=db.RegisterUser(username,password,nickName,sex,money,giftoken,gold);;
}
}
catch (Exception ex)
{
log.Error("RegisterResult", ex);
}
finally
{
result.Add(new XAttribute("value", "vl"));
result.Add(new XAttribute("message", registerResult));
context.Response.ContentType = "text/plain";
context.Response.Write(result.ToString(false));
}
}
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:30,代码来源:AccountRegister.ashx.cs
示例7: LoadFromDatabase
/// <summary>
/// 从数据库中加载
/// </summary>
/// <param name="playerId"></param>
public void LoadFromDatabase(int playerId)
{
lock (m_lock)
{
using (PlayerBussiness db = new PlayerBussiness())
{
BufferInfo[] infos = db.GetUserBuffer(playerId);
BeginChanges();
foreach (BufferInfo info in infos)
{
AbstractBuffer buffer = CreateBuffer(info);
if (buffer != null)
{
buffer.Start(m_player);
}
}
CommitChanges();
}
//更新状态
Update();
}
}
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:29,代码来源:BufferList.cs
示例8: SaveToDatabase
/// <summary>
/// 保存到数据库中
/// </summary>
public void SaveToDatabase()
{
using (PlayerBussiness pb = new PlayerBussiness())
{
lock (_lock)
{
for (int i = 0; i < _items.Length; i++)
{
ItemInfo item = _items[i];
if (item != null)
{
if (item.IsDirty)
{
if (item.ItemID > 0)
{
pb.UpdateGoods(item);
}
else
{
pb.AddGoods(item);
}
}
}
}
foreach (ItemInfo item in _removedList)
{
pb.UpdateGoods(item);
}
_removedList.Clear();
}
}
}
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:36,代码来源:CommonPage.cs
示例9: HandlePacket
//修改: Xiaov
//时间: 2009-11-4
//描述: 修改邮件的已读未读标志<已测试>
public int HandlePacket(GameClient client, GSPacketIn packet)
{
GSPacketIn pkg = packet.Clone();
pkg.ClearContext();
int id = packet.ReadInt();
using (PlayerBussiness db = new PlayerBussiness())
{
MailInfo mes = db.GetMailSingle(client.Player.PlayerCharacter.ID, id);
if (mes != null && !mes.IsRead)
{
mes.IsRead = true;
if (mes.Type < 100)
{
mes.ValidDate = 3 * 24;
mes.SendTime = DateTime.Now;
}
db.UpdateMail(mes, mes.Money);
pkg.WriteBoolean(true);
}
else
{
pkg.WriteBoolean(false);
}
}
client.Out.SendTCP(pkg);
return 0;
}
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:33,代码来源:UserUpdateMailHandler.cs
示例10: HandlePacket
public int HandlePacket(GameClient client, GSPacketIn packet)
{
if (client.Player.CurrentMarryRoom != null && client.Player.PlayerCharacter.ID == client.Player.CurrentMarryRoom.Info.PlayerID)
{
string roomName = packet.ReadString();
bool isPwdChanged = packet.ReadBoolean();
string pwd = packet.ReadString();
string introduction = packet.ReadString();
MarryRoom room = client.Player.CurrentMarryRoom;
room.Info.RoomIntroduction = introduction;
room.Info.Name = roomName;
if (isPwdChanged)
{
room.Info.Pwd = pwd;
}
using (PlayerBussiness db = new PlayerBussiness())
{
db.UpdateMarryRoomInfo(room.Info);
}
room.SendMarryRoomInfoUpdateToScenePlayers(room);
client.Player.Out.SendMessage(eMessageType.Normal, LanguageMgr.GetTranslation("MarryRoomInfoUpdateHandler.Successed"));
return 0;
}
return 1;
}
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:35,代码来源:MarryRoomInfoUpdateHandler.cs
示例11: ProcessRequest
public void ProcessRequest(HttpContext context)
{
bool value = false;
string message = "Fail!";
XElement result = new XElement("Result");
try
{
int id = Convert.ToInt32(context.Request["userid"]);
int selfid = Convert.ToInt32(context.Request["selfid"]);
string key = context.Request["key"];
using (PlayerBussiness db = new PlayerBussiness())
{
}
value = true;
message = "Success!";
}
catch (Exception ex)
{
log.Error("IMListLoad", ex);
}
result.Add(new XAttribute("value", value));
result.Add(new XAttribute("message", message));
context.Response.ContentType = "text/plain";
context.Response.Write(string.Format("0,{0},0",DateTime.Now));
//context.Response.BinaryWrite(StaticFunction.Compress(result.ToString(false)));
}
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:31,代码来源:AdvanceQuestTime.ashx.cs
示例12: ProcessRequest
public void ProcessRequest(HttpContext context)
{
bool value = false;
string message = "Fail!";
XElement result = new XElement("Result");
try
{
int userID = int.Parse(context.Request["ID"]);
using (PlayerBussiness db = new PlayerBussiness())
{
QuestDataInfo[] quests = db.GetUserQuest(userID);
foreach (QuestDataInfo quest in quests)
{
result.Add(FlashUtils.CreateQuestDataInfo(quest));
}
value = true;
message = "Success!";
}
}
catch (Exception ex)
{
log.Error("UserQuestList", ex);
}
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(false)));
}
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:33,代码来源:UserQuestList.ashx.cs
示例13: 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"]);
using (PlayerBussiness db = new PlayerBussiness())
{
ItemInfo[] items = db.GetUserItem(userid);
foreach (ItemInfo item in items)
{
result.Add(Road.Flash.FlashUtils.CreateGoodsInfo(item));
}
}
value = true;
message = "Success!";
}
catch (Exception ex)
{
log.Error("LoadUserItems", 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,代码行数:34,代码来源:LoadUserItems.ashx.cs
示例14: ProcessRequest
public void ProcessRequest(HttpContext context)
{
bool value = false;
string message = "Fail!";
XElement result = new XElement("Result");
try
{
//int id = int.Parse(context.Request["id"]);
using (PlayerBussiness db = new PlayerBussiness())
{
}
value = true;
message = "Success!";
}
catch (Exception ex)
{
log.Error("ActivePullDown", 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:vancourt,项目名称:BaseGunnyII,代码行数:25,代码来源:ActivePullDown.ashx.cs
示例15: HandlePacket
public int HandlePacket(GameClient client, GSPacketIn packet)
{
GSPacketIn pkg = packet.Clone();
//pkg.ClearContext();
if (client.Player.PlayerCharacter.HasBagPassword && client.Player.PlayerCharacter.IsLocked)
{
client.Out.SendMessage(eMessageType.Normal, LanguageMgr.GetTranslation("Bag.Locked"));
return 0;
}
int id = packet.ReadInt();
int senderID;
using (PlayerBussiness db = new PlayerBussiness())
{
if (db.DeleteMail(client.Player.PlayerCharacter.ID, id, out senderID))
{
client.Out.SendMailResponse(senderID,eMailRespose.Receiver);
pkg.WriteBoolean(true);
}
else
{
pkg.WriteBoolean(false);
}
}
client.Out.SendTCP(pkg);
return 0;
}
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:30,代码来源:UserDeleteMailHandler.cs
示例16: LoadFromDatabase
/// <summary>
/// 从数据库中加载当前玩家的的任务列表
/// </summary>
/// <param name="playerId">传入玩家编号</param>
public void LoadFromDatabase(int playerId)
{
lock (_lock)
{
using (PlayerBussiness db = new PlayerBussiness())
{
QuestDataInfo[] infos = db.GetUserQuest(playerId);
foreach (QuestDataInfo info in infos)
{
if (!_currentQuest.ContainsKey(info.QuestID))
{
//未开始
//if (info.IsExist && info.QuestInfo.TimeLimit && DateTime.Now.CompareTo(info.QuestInfo.EndDate) > 0)
//{
// info.IsExist = false;
//}
_currentQuest.Add(info.QuestID, info);
}
}
}
}
ClearConsortiaQuest(); /*清除非工会任务*/
ClearMarryQuest(); /*清除非结婚任务*/
}
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:31,代码来源:QuestInventoryOld.cs
示例17: 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
示例18: ProcessRequest
public void ProcessRequest(HttpContext context)
{
bool value = false;
string message = "Fail!";
XElement result = new XElement("Result");
try
{
string UserName = context.Request["UserName"];
using (PlayerBussiness db = new PlayerBussiness())
{
ArrayList friends = db.GetFriendsGood(UserName);
for (int i = 0; i < friends.Count; i++)
{
XElement node = new XElement("Item",
new XAttribute("UserName", friends[i].ToString()));
result.Add(node);
}
}
value = true;
message = "Success!";
}
catch (Exception ex)
{
log.Error("IMFriendsGood", 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:vancourt,项目名称:BaseGunnyII,代码行数:34,代码来源:IMFriendsGood.ashx.cs
示例19: ProcessRequest
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
try
{
//param格式://int templateID, int count, int validDate, int StrengthenLevel, int AttackCompose, int DefendCompose, int AgilityCompose, int LuckCompose, bool isBinds
//result:0:成功 1:失败 2:没有该账号 3:ip无效 4:param不合法 5:key错误 6:content内参数列不正确 7:超时
int result=1;
//判断IP是否合法
if (ValidSentRewardIP(context.Request.UserHostAddress))
{
string content = HttpUtility.UrlDecode(context.Request["content"]);
string key = GetSentRewardKey;
BaseInterface inter = BaseInterface.CreateInterface();
string[] str_param = inter.UnEncryptSentReward(content, ref result, key);
if (str_param.Length == 8 && result != 5 && result != 6 && result != 7)
{
string mailTitle = str_param[0];
string mailContent = str_param[1];
string username = str_param[2];
int gold = Int32.Parse(str_param[3]);
int money = Int32.Parse(str_param[4]);
string param = str_param[5];
//判断para是否合法,并将不合法的数值设为默认合法值
if (checkParam(ref param))
{
PlayerBussiness pb = new PlayerBussiness();
result = pb.SendMailAndItemByUserName(mailTitle, mailContent, username, gold, money, param);
}
else
{
result = 4;
}
}
}
else
{
result = 3;
}
context.Response.Write(result);
}
catch(Exception ex)
{
log.Error("SentReward", ex);
}
}
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:59,代码来源:SentReward.ashx.cs
示例20: BuildCelebConsortia
public static string BuildCelebConsortia(string file, int order, string fileNotCompress)
{
bool value = false;
string message = "Fail!";
XElement result = new XElement("Result");
int total = 0;
try
{
int page = 1;
int size = 50;
//int order = 10;
int consortiaID = -1;
string name = "";
int level = -1;
using (ConsortiaBussiness db = new ConsortiaBussiness())
{
ConsortiaInfo[] infos = db.GetConsortiaPage(page, size, ref total, order, name, consortiaID, level,-1);
foreach (ConsortiaInfo info in infos)
{
XElement node = FlashUtils.CreateConsortiaInfo(info);
if (info.ChairmanID != 0)
{
using (PlayerBussiness pb = new PlayerBussiness())
{
PlayerInfo player = pb.GetUserSingleByUserID(info.ChairmanID);
if (player != null)
{
node.Add(FlashUtils.CreateCelebInfo(player));
}
}
}
result.Add(node);
}
value = true;
message = "Success!";
}
}
catch (Exception ex)
{
log.Error(file + " is fail!", ex);
}
result.Add(new XAttribute("total", total));
result.Add(new XAttribute("value", value));
result.Add(new XAttribute("message", message));
result.Add(new XAttribute("date", System.DateTime.Today.ToString("yyyy-MM-dd")));
if (!string.IsNullOrEmpty(fileNotCompress))
{
csFunction.CreateCompressXml(result, fileNotCompress, false);
}
return csFunction.CreateCompressXml(result, file, true);
}
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:58,代码来源:csFunction.cs
注:本文中的Bussiness.PlayerBussiness类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论