Example #1
0
    /// <summary>
    /// 点击按钮
    /// </summary>
    void OnClick(GameObject go)
    {
        if (GameInput.Instance.GetEnableInput() == false || mHoleOpen == false)
        {
            return;
        }

        // 玩家在安全区域内不响应
        Actor localPlayer = Game.GetInstance().GetLocalPlayer();

        if (localPlayer != null && localPlayer.IsInSafeArea)
        {
            UINotice.GetInstance().ShowMessage(xc.DBConstText.GetText("SKILL_CANNOT_SAFEAREA")); //在安全区无法使用技能
            return;
        }

        if (mFitPos == 1)                 // 第一装配位置的技能按键需要特殊处理
        {
            if (localPlayer.IsShapeShift) // 角色进行了变身,只能触发普通技能
            {
                if (mSkillIdx != 0)
                {
                    ClientEventMgr.GetInstance().FireEvent((int)ClientEvent.CE_TRIGGER_SKILL_CLICK_BUTTON, new CEventBaseArgs(mSkillIdx));
                }
            }
            else
            {
                ClientEventMgr.GetInstance().FireEvent((int)ClientEvent.CE_TRIGGER_SKILL_CLICK_BUTTON, new CEventBaseArgs(0xF0000000));
            }
        }
        else
        {
            ClientEventMgr.GetInstance().FireEvent((int)ClientEvent.CE_TRIGGER_SKILL_CLICK_BUTTON, new CEventBaseArgs(mSkillIdx));
        }
    }
Example #2
0
            /// <summary>
            /// 根据获取的服务器信息来进行登陆
            /// </summary>
            public void LoginServer(ServerInfo serverInfo)
            {
                if (serverInfo == null)
                {
                    GameDebug.LogError("Error, server info is null!!!");
                    UINotice.GetInstance().ShowMessage(DBConstText.GetText("PLEASE_SELECT_ONE_SERVER"));
                    return;
                }

                if (m_LoadingIcon != null)
                {
                    m_LoadingIcon.SetActive(true);
                }

                ServerListHelper.GetInstance().CheckServerStateAndEnter(serverInfo, (ServerInfo retServerInfo, bool canEnter) =>
                {
                    if (canEnter == false)
                    {
                        UIManager.Instance.ShowWaitScreen(false);
                        if (m_LoadingIcon != null)
                        {
                            m_LoadingIcon.SetActive(false);
                        }
                    }
                });

                // 点击登录按钮
                ControlServerLogHelper.Instance.PostPlayerFollowRecord(PlayerFollowRecordSceneId.ClickLoginButton);
            }
Example #3
0
    /// <summary>
    /// 点击按钮
    /// </summary>
    public void OnClick(GameObject go)
    {
        if (GameInput.Instance.GetEnableInput() == false || mHoleOpen == false)
        {
            return;
        }

        // 玩家在安全区域内不响应
        Actor localPlayer = Game.GetInstance().GetLocalPlayer();

        if (localPlayer != null && localPlayer.IsInSafeArea)
        {
            UINotice.GetInstance().ShowMessage(xc.DBConstText.GetText("SKILL_CANNOT_SAFEAREA")); //在安全区无法使用技能
            return;
        }


        //if (xc.SceneHelp.Instance.IsInNormalWild == false)
        //{
        //    //先提示
        //    ClientEventMgr.GetInstance().FireEvent(xc.EnumUtil.EnumToInt(xc.ClientEvent.CE_CLICK_MATE_SKILL), new CEventBaseArgs(mSkillIdx));
        //}
        //else
        //{
        //    RealClick();
        //}

        ClientEventMgr.GetInstance().FireEvent(xc.EnumUtil.EnumToInt(xc.ClientEvent.CE_CLICK_MATE_SKILL), new CEventBaseArgs(mSkillIdx));
    }
Example #4
0
    /// <summary>
    /// 点击按钮
    /// </summary>
    void OnClick(GameObject target)
    {
        if (GameInput.Instance.GetEnableInput() == false || mHoleOpen == false)
        {
            return;
        }

        // 玩家在安全区域内不响应
        Actor local_player = Game.Instance.GetLocalPlayer();

        if (local_player == null)
        {
            return;
        }

        if (local_player.IsInSafeArea)
        {
            UINotice.GetInstance().ShowMessage(xc.DBConstText.GetText("SKILL_CANNOT_SAFEAREA")); //在安全区无法使用技能
            return;
        }

        if (mSkillInfo == null)
        {
            return;
        }

        if (LocalPlayerManager.Instance.Fury < mSkillInfo.CostFury)
        {
            UINotice.Instance.ShowMessage(xc.DBConstText.GetText("FURY_CANNOT_USE")); // 怒气不足时候的提示
            return;
        }

        if (!local_player.CDCtrl.IsInCD(mSkillIdx))// 技能不在cd中
        {
            ClientEventMgr.GetInstance().FireEvent((int)ClientEvent.CE_TRIGGER_SKILL_CLICK_BUTTON, new CEventBaseArgs(mSkillIdx));
        }
    }
            /// <summary>
            /// 响应注册的网络消息
            /// </summary>
            /// <param name="protocol"></param>
            /// <param name="data"></param>
            void HandleCreateRole(ushort protocol, byte[] data)
            {
                if (protocol != NetMsg.MSG_CREATE_ROLE)
                {
                    return;
                }

                var create_role = S2CPackBase.DeserializePack <S2CCreateRole>(data);

                if (create_role.result != 1) // 创建不成功
                {
                    string content = "";

                    DBErrorCode           db_error_code = (DBErrorCode)DBManager.GetInstance().GetDB(typeof(DBErrorCode).Name);
                    DBErrorCode.ErrorInfo errorInfo     = db_error_code.GetErrorInfo(create_role.result);
                    if (errorInfo == null)
                    {
                        content = xc.TextHelper.GetConstText("CODE_TEXT_LOCALIZATION_35");
                    }
                    else
                    {
                        content = errorInfo.mDesc;
                    }

                    GameDebug.LogError(string.Format("服务端报错: {0}", content));
                    UINotice.GetInstance().ShowMessage(content);

                    UIManager.Instance.ShowWaitScreen(false);
                    return;
                }

                // 保存本地玩家ID
                UnitID uid = new UnitID();

                uid.type    = (byte)EUnitType.UNITTYPE_PLAYER;
                uid.obj_idx = (uint)create_role.uuid;
                Game.GetInstance().LocalPlayerID     = uid;
                Game.GetInstance().LocalPlayerTypeID = ActorHelper.RoleIdToTypeId(mVocationId);
                Game.GetInstance().LocalPlayerName   = mNameInputField.text;

                // 保存角色职业信息
                GlobalConfig.GetInstance().LoginInfo.RId = create_role.uuid.ToString();
                GlobalConfig.GetInstance().LoginInfo.Job = mVocationId.ToString();
                GlobalConfig.GetInstance().LoginInfo.Level = "0";
                GlobalConfig.GetInstance().LoginInfo.CreateRoleTime = create_role.now.ToString();

                // 通知服务端
                var enter_game = new C2SEnterGame();

                enter_game.uuid = create_role.uuid;
                NetClient.GetBaseClient().SendData <C2SEnterGame>(NetMsg.MSG_ENTER_GAME, enter_game);

                // 通知控制服
                ControlServerLogHelper.GetInstance().PostRoleInfo();

                // 通知sdk,sendRoleInfo2SDK要求等级最小为1,需要特殊处理
                GlobalConfig.GetInstance().LoginInfo.Level = "1";
                SDKControler.getSDKControler().sendRoleInfo2SDK((int)SDKControler.RoleEvent.CREATE_ROLE);

                // 创角埋点数据上报
                if (xc.Const.Region == xc.RegionType.KOREA)
                {
                    xc.BuriedPointHelper.ReportTapjoyEvnet("account generate");
                }

                // 注册FCM
                DBOSManager.getOSBridge().registerFCM();

                // 注册推送服务
                DBOSManager.getOSBridge().registerPush();
            }