123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
-
- using CommonAI.Zone.Helper;
- using CommonAI.Zone.Instance;
- using CommonLang;
- using System.Collections.Generic;
- using XmdsCommon.Plugin;
- using XmdsCommonServer.Plugin.Scene;
- namespace XmdsCommonServer.Plugin
- {
- public partial class XmdsVirtual_Player
- {
- #region 任务相关.
- private void InitQuestData()
- {
- if (mProp.ServerData.Tasks == null) { return; }
- List<QuestData> tasks = new List<QuestData>();
- foreach (XmdsQuestData var in mProp.ServerData.Tasks)
- {
- QuestData qData = new QuestData(var.TaskID);
- if (var.TaskState == "1")
- {
- //已接受
- qData.State = QuestState.Accepted;
- }
- foreach (QuestAttribute attr in var.Attributes)
- {
- qData.Attributes.Add(attr.Key, attr.Value);
- }
- tasks.Add(qData);
- }
- if (mUnit is InstancePlayer)
- {
- (mUnit as InstancePlayer).InitQuestData(tasks);
- }
- }
- #endregion
- /*
- private HashMap<string, string> mQuestFlags = new HashMap<string, string>();
- private void InitQuestFlags()
- {
- mQuestFlags.Clear();
- if (mUnit is InstancePlayer)
- {
- foreach (XmdsQuestFlag e in mProp.ServerData.QuestFlags)
- {
- if (!string.IsNullOrEmpty(e.FlagName) && !string.IsNullOrEmpty(e.FlagValue))
- {
- mQuestFlags.Add(e.FlagName, e.FlagValue);
- if (!mProp.ServerData.PlayerEntered)
- {
- mUnit.Parent.queueTask((z) =>
- {
- (mUnit.Parent as XmdsServerScene).GS_OnInitZonePlayerQuestFlagR2B(mUnit as InstancePlayer, e.FlagName, e.FlagValue);
- });
- }
- }
- }
- }
- }
- internal void SetQuestFlag(string key, string value)
- {
- if (key != null)
- {
- if (value == null)
- {
- mQuestFlags.Remove(key);
- }
- else
- {
- mQuestFlags.Put(key, value);
- }
- }
- }
- internal string GetQuestFlag(string key)
- {
- return mQuestFlags.Get(key);
- }
- */
- }
- }
|