Ejemplo n.º 1
0
    private bool AcceptQuest(ObjectBase obj, respond_msg_gm respond)
    {
        QuestEvent evt = new QuestEvent(QuestEvent.QUEST_ACCEPT);

        evt.mQuestId = Convert.ToInt32(respond.param1);
        PlayerDataModule pdm = ModuleManager.Instance.FindModule <PlayerDataModule>();

        pdm.AcceptQuest(evt.mQuestId);

        if (QuestHelper.IsInFightScene() || QuestHelper.IsLoading())
        {
            GameDebug.Log("gm接取任务缓存" + evt.mQuestId);
            QuestModule qm = ModuleManager.Instance.FindModule <QuestModule>();
            qm.mEventCache.Enqueue(evt);
        }
        else
        {
            GameDebug.Log("gm接取任务" + evt.mQuestId);
            EventSystem.Instance.PushEvent(evt);
        }
        return(true);
    }
Ejemplo n.º 2
0
    protected override void OnRespond(respond_accept_quest respond, object userdata)
    {
        if (respond.result == (int)ERROR_CODE.ERR_QUEST_ACCEPT_OK)
        {
            QuestEvent evt = new QuestEvent(QuestEvent.QUEST_ACCEPT);
            evt.mQuestId = Convert.ToInt32(userdata);
            PlayerDataModule pdm = ModuleManager.Instance.FindModule <PlayerDataModule>();
            pdm.AcceptQuest(evt.mQuestId);

            if (QuestHelper.IsInFightScene() || QuestHelper.IsLoading())
            {
                GameDebug.Log("接取任务缓存" + evt.mQuestId);
                QuestModule qm = ModuleManager.Instance.FindModule <QuestModule>();
                qm.mEventCache.Enqueue(evt);
            }
            else
            {
                EventSystem.Instance.PushEvent(evt);
            }

            //GameDebug.Log("回复接受任务:" + Convert.ToInt32(userdata));
        }
    }