本文整理汇总了C#中Bussiness.PlayerBussiness.UpdatePlayer方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerBussiness.UpdatePlayer方法的具体用法?C# PlayerBussiness.UpdatePlayer怎么用?C# PlayerBussiness.UpdatePlayer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bussiness.PlayerBussiness
的用法示例。
在下文中一共展示了PlayerBussiness.UpdatePlayer方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SaveIntoDatabase
/// <summary>
/// Save the player into the database
/// </summary>
public bool SaveIntoDatabase()
{
try
{
if (m_character.IsDirty)
{
using (PlayerBussiness db = new PlayerBussiness())
{
db.UpdatePlayer(m_character);
//db.UpdateVIPInfo(m_character);
}
}
MainBag.SaveToDatabase();
PropBag.SaveToDatabase();
StoreBag.SaveToDatabase();
//CardBag.SaveToDatabase();
QuestInventory.SaveToDatabase();
BufferList.SaveToDatabase();
return true;
}
catch (Exception e)
{
log.Error("Error saving player " + m_character.NickName + "!", e);
return false;
}
}
示例2: LoadFromDatabase
public bool LoadFromDatabase()
{
using (PlayerBussiness db = new PlayerBussiness())
{
PlayerInfo detail = db.GetUserSingleByUserID(m_character.ID);
if (detail == null)
{
Out.SendKitoff(LanguageMgr.GetTranslation("UserLoginHandler.Forbid"));
Client.Disconnect();
return false;
}
else
{
m_character = detail;
}
ChargeToUser();
int[] sole = new int[] { 0, 1, 2 };
Out.SendUpdateInventorySlot(FightBag, sole);
UpdateItemForUser(1);
UpdateVIPForUser();
//AddGP(0);
UpdateWeapon(m_mainBag.GetItemAt(6));
UpdateSecondWeapon(m_mainBag.GetItemAt(15));
m_pvepermissions = string.IsNullOrEmpty(detail.PvePermission) ? InitPvePermission() : m_converter.GetBytes(detail.PvePermission);
_friends = new Dictionary<int, int>();
_friends = db.GetFriendsIDAll(m_character.ID);
m_character.State = 1;
db.UpdatePlayer(m_character);
// db.UpdateVIPInfo(m_character);
return true;
}
}