Exemplo n.º 1
0
    protected override void OnRequest(request_msg_relive request, object userdata)
    {
        ReliveActionParam param = userdata as ReliveActionParam;

        if (param == null)
        {
            return;
        }

        request.scene_type  = (uint)param.scenetype;
        request.scene_id    = (uint)param.sceneid;
        request.relive_type = (uint)param.relivetype;
    }
Exemplo n.º 2
0
    // 请求复活
    private void onReliveRequest(EventBase evt)
    {
        StageReliveEvent e = evt as StageReliveEvent;

        if (e == null)
        {
            return;
        }

        if (e.mReliveType == ReliveType.ReliveType_Normal)
        {
            if (!ConditionManager.Instance.CheckCondition(mRes.mReliveCostId0))
            {
                PopTipManager.Instance.AddNewTip(StringHelper.GetErrorString(ERROR_CODE.ERR_SCENE_RELIVE_FAILED_NOCOST, FontColor.Red));
                return;
            }
        }
        else if (e.mReliveType == ReliveType.ReliveType_Extra)
        {
            if (!ConditionManager.Instance.CheckCondition(mRes.mReliveCostId1))
            {
                PopTipManager.Instance.AddNewTip(StringHelper.GetErrorString(ERROR_CODE.ERR_SCENE_RELIVE_FAILED_NOCOST, FontColor.Red));
                return;
            }
        }

        mModule.WaitRelive = true;

        WindowManager.Instance.CloseUI("stagerelive");

        ReliveActionParam param = new ReliveActionParam();

        param.scenetype  = SceneType.SceneType_Stage;
        param.sceneid    = mRes.resID;
        param.relivetype = (int)e.mReliveType;
        Net.Instance.DoAction((int)Message.MESSAGE_ID.ID_MSG_SCENE_RELIVE, param);
    }