本文整理汇总了C#中Bussiness.PlayerBussiness.GetUserQuest方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerBussiness.GetUserQuest方法的具体用法?C# PlayerBussiness.GetUserQuest怎么用?C# PlayerBussiness.GetUserQuest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bussiness.PlayerBussiness
的用法示例。
在下文中一共展示了PlayerBussiness.GetUserQuest方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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)));
}
示例2: 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(); /*清除非结婚任务*/
}
示例3: LoadFromDatabase
/// <summary>
/// 初始化用户任务记录 [操作:加载有效用户任务列表;加载监听事件]
/// </summary>
/// <param name="playerId"></param>
public void LoadFromDatabase(int playerId)
{
lock (m_lock)
{
m_states = m_player.PlayerCharacter.QuestSite.Count() ==0 ? InitQuest() : m_player.PlayerCharacter.QuestSite;
using (PlayerBussiness db = new PlayerBussiness())
{
QuestDataInfo[] datas = db.GetUserQuest(playerId);
BeginChanges();
foreach (QuestDataInfo dt in datas)
{
QuestInfo info = QuestMgr.GetSingleQuest(dt.QuestID);
if (info != null)
{
AddQuest(new BaseQuest(info, dt));
}
}
CommitChanges();
}
if (m_list != null)
{
}
}
}