Ejemplo n.º 1
0
    public void exitSDK()
    {
        // 玩家发起退出游戏,通知sdk
        SDKControler.getSDKControler().sendRoleInfo2SDK((int)SDKControler.RoleEvent.EXIT_GAME);

        _exitSDK();
    }
Ejemplo n.º 2
0
 private void OnClickUserButton()
 {
     if (SDKControler.getSDKControler().IsLoginSuccess)
     {
         DBOSManager.getDBOSManager().getBridge().userCenter();
     }
 }
Ejemplo n.º 3
0
            /// <summary>
            /// 点击开始游戏按钮
            /// </summary>
            public void OnClickLoginButton()
            {
                if (mInDelayTime)
                {
                    return;
                }

                GlobalConfig globalConfig = GlobalConfig.GetInstance();

                if (!IsSDKWorking())
                {
                    if (string.IsNullOrEmpty(globalConfig.LoginInfo.AccName) == true)
                    {
                        if (globalConfig.IsEnterSDK)
                        {
                            SDKControler.getSDKControler().loginSDK(OnLoginCallback);
                        }
                        else
                        {
                            GameDebug.LogError("UIQucikWindow must be in sdk");
                        }
                    }
                    else
                    {
                        LoginServer(m_SelectedServerInfo);
                    }
                }
            }
Ejemplo n.º 4
0
            //--------------------------------------------------------
            //  外部调用
            //--------------------------------------------------------


            //--------------------------------------------------------
            //  控件消息
            //--------------------------------------------------------
            /// <summary>
            /// 点击登录/切换账号按钮
            /// </summary>
            public void OnClickSDKAccountButton()
            {
                if (mInDelayTime)
                {
                    return;
                }

                SetSDKButtonText(xc.TextHelper.GetConstText("CODE_TEXT_LOCALIZATION_100"));

                GlobalConfig globalConfig = GlobalConfig.GetInstance();

                if (globalConfig.IsEnterSDK)
                {
                    // sdk不在初始化、登陆状态下
                    if (!IsSDKWorking())
                    {
                        if (string.IsNullOrEmpty(globalConfig.LoginInfo.AccName) == true)
                        {
                            SDKControler.getSDKControler().loginSDK(OnLoginCallback);
                        }
                        else
                        {
                            IBridge bridge = DBOSManager.getDBOSManager().getBridge();
                            bridge.setLoginMsg("");
                            bridge.logout();
                            SetSelectedServerInfo(null);
                            SDKControler.getSDKControler().loginSDK(OnLoginCallback);
                        }
                    }
                }
                else
                {
                    GameDebug.LogError("UIQucikWindow must be in sdk");
                }
            }
Ejemplo n.º 5
0
 public void OnDelayInitSDK(float remainTime)
 {
     if (remainTime <= 0)
     {
         mInDelayTime = false;
         SDKControler.getSDKControler().InitSDK();
     }
 }
Ejemplo n.º 6
0
            /// <summary>
            /// 初始化sdk成功后的回调函数
            /// </summary>
            public void OnInitCallback(CEventBaseArgs data)
            {
                GameDebug.LogError("OnInitCallback");

                SDKControler.getSDKControler().loginSDK(OnLoginCallback);

                // 暂时屏蔽服务器更新信息的功能
                //ServerListHelper.GetInstance().RequestServerUpdateNotice(GetServerUpdateNoticeFinished);
            }
Ejemplo n.º 7
0
        /// <summary>
        /// 登录SDK并进行重新登录流程(不重启APP)
        /// </summary>
        public void Rebot()
        {
#if UNITY_ANDROID
            // 退出游戏的时候通知sdk
            SDKControler.getSDKControler().sendRoleInfo2SDK((int)SDKControler.RoleEvent.EXIT_GAME);
#endif

            GlobalConfig.Instance.ResetLoginInfo();

            IsRebooting = true;
            Relogin();
        }
Ejemplo n.º 8
0
            /// <summary>
            /// sdk是否正在初始化和登陆过程中
            /// </summary>
            public bool IsSDKWorking()
            {
                if (SDKControler.getSDKControler().IsIniting())
                {
                    //显示正在初始化
                    UINotice.Instance.ShowMessage(xc.TextHelper.GetConstText("CODE_TEXT_LOCALIZATION_101"));
                    GameDebug.LogError("sdk is initing .................");
                    return(true);
                }

                if (SDKControler.getSDKControler().IsLogining())
                {
                    //显示正在登陆
                    UINotice.Instance.ShowMessage(xc.TextHelper.GetConstText("CODE_TEXT_LOCALIZATION_102"));
                    GameDebug.LogError("sdk is logining .................");
                    return(true);
                }

                return(false);
            }
Ejemplo n.º 9
0
            /// <summary>
            /// 登陆sdk成功后的回调
            /// </summary>
            public void OnLoginCallback(int code, string msg)
            {
                if (mIsDestroy == true)
                {
                    return;
                }

                Debug.Log("onLoginCallback code = " + code + " msg = " + msg);
                switch (code)
                {
                case (int)SDKControler.SDK_STATU_CODE.LOGIN_SUCCESS:
                    InitLoginCache();
                    break;

                case  (int)SDKControler.SDK_STATU_CODE.LOGIN_FAIL:
                    //确定按钮的提示框
                    string errorMsg = xc.TextHelper.GetConstText("CODE_TEXT_LOCALIZATION_104") + msg + xc.TextHelper.GetConstText("CODE_TEXT_LOCALIZATION_105");
                    xc.ui.UIWidgetHelp.GetInstance().ShowNoticeDlg(errorMsg);
                    break;

                case  (int)SDKControler.SDK_STATU_CODE.LOGIN_CANCEL:
                    UINotice.Instance.ShowMessage(xc.TextHelper.GetConstText("CODE_TEXT_LOCALIZATION_106"));
                    break;

                case  (int)SDKControler.SDK_STATU_CODE.LOGIN_QQ:
                    break;

                case  (int)SDKControler.SDK_STATU_CODE.LOGIN_QQ_MORE_TIME:
                    SDKControler.getSDKControler().loginSDK(OnLoginCallback);
                    break;

                default:
                    UINotice.Instance.ShowMessage(xc.TextHelper.GetConstText("CODE_TEXT_LOCALIZATION_107"));
                    break;
                }
            }
Ejemplo n.º 10
0
            /// <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();
            }
Ejemplo n.º 11
0
        public void Update()
        {
            if (!mIsInited)
            {
                return;
            }

            if (Input.GetKeyUp(KeyCode.Escape))
            {
                Debug.Log("KeyCode.Escape pressed");
#if UNITY_IPHONE
                IBridge bridge = DBOSManager.getDBOSManager().getBridge();
                if (bridge != null && bridge.isBridgeEnable())
                {
                    // 退出游戏的时候通知sdk
                    SDKControler.getSDKControler().sendRoleInfo2SDK((int)SDKControler.RoleEvent.EXIT_GAME);
                    bridge.checkBackBtnAction();
                }
#else
                var exit_game = true;
                if (xc.Const.Region == RegionType.KOREA)
                {
                    if (UIManager.Instance.TryCloseAllWindow())
                    {
                        exit_game = false;
                    }
                }
                if (exit_game)
                {
                    Debug.Log("KeyCode.Escape pressed exit_game = true");
                    IBridge bridge = DBOSManager.getDBOSManager().getBridge();
                    if (bridge != null && bridge.isBridgeEnable())
                    {
                        // 退出游戏的时候通知sdk
                        SDKControler.getSDKControler().sendRoleInfo2SDK((int)SDKControler.RoleEvent.EXIT_GAME);
                        bridge.checkBackBtnAction();
                    }
                }
#endif
            }

            m_GameMachine.Update();
            UIManager.Instance.Update();

            // 场景加载完成的检查
            SceneLoadingUpdate();

            TimerManager.GetInstance().Update();
            DecimalTimerManager.GetInstance().Update();
            EffectManager.GetInstance().Update();
            TargetPathManager.Instance.Update();
            TaskManager.Instance.Update();
            InstanceManager.Instance.Update();
            UINotice.Instance.Update();
            TeamManager.Instance.Update();
            MainmapManager.Instance.Update();
            TimelineManager.Instance.Update();
            ShadowManager.Instance.Update();
            GuideManager.Instance.Update();

    #if !UNITY_MOBILE_LOCAL
            VoiceManager.Instance.Update();
    #endif

            NetReconnect.Instance.Update();
            if (ChangeRoleManager.Instance.IsChangeRole)
            {
                ChangeRoleManager.Instance.Update();
            }

#if UNITY_EDITOR
            TestUnit.Instance.Update();
#endif
            Uranus.Runtime.UranusManager.Instance.Update();
            MarryFireworkManager.Instance.Update();

            NetworkManager.Instance.Update();
            if (((int)GameMode & (int)EGameMode.GM_Net) == (int)EGameMode.GM_Net)
            {
                NetClient.GetBaseClient().Update();
                if (NetClient.CrossToggle)
                {
                    NetClient.GetCrossClient().Update();
                }
            }

            // 协程更新
            // 最好在其他模块都更新好,再更新协程
            SafeCoroutine.CoroutineManager.Update(Time.deltaTime);
        }
Ejemplo n.º 12
0
        public void HandleServerData(ushort protocol, byte[] data)
        {
            switch (protocol)
            {
            case NetMsg.MSG_EASY_LOGIN:
            {
                GameDebug.Log(">>>MSG_EASY_LOGIN");

                ChangeRoleManager.Instance.IsChangeRole = false;
                IsRebooting = false;

                S2CEasyLogin eazyLogin = S2CPackBase.DeserializePack <S2CEasyLogin>(data);
                mCharactorMaxCount = (int)eazyLogin.role_limit;
                mAccountIdx        = (int)eazyLogin.uid;
                for (int index = 0; index < eazyLogin.role_brief.Count; ++index)
                {
                    Equip.EquipHelper.DelEquipPart(eazyLogin.role_brief[index].shows, DBAvatarPart.BODY_PART.ELFIN);
                    Equip.EquipHelper.DelEquipPart(eazyLogin.role_brief[index].shows, DBAvatarPart.BODY_PART.MAGICAL_PET);
                }
                mRepCharacterList = eazyLogin.role_brief;

                if (Const.Region == RegionType.KOREA)
                {
                    ClientEventMgr.GetInstance().FireEvent((int)ClientEvent.CE_SERVERLIST_TO_CREATEACTOR_BEGIN, new CEventBaseArgs());
                }

                if (mRepCharacterList.Count != 0)
                {
                    SceneHelp.Instance.SwitchPreposeScene(GlobalConst.SelectActorScene, false);    // 选角场景
                }
                else
                {
#if UNITY_ANDROID || UNITY_IPHONE
                    //Handheld.PlayFullScreenMovie("Movie/YuanGu2CG.mp4", Color.black, FullScreenMovieControlMode.CancelOnInput, FullScreenMovieScalingMode.AspectFit);
#endif
                    SceneHelp.Instance.SwitchPreposeScene(GlobalConst.CreateActorScene, false);    // 创角场景
                }
                GameDebug.Log("AccountIdx: " + mAccountIdx);

                // 登录服务器成功
                ControlServerLogHelper.Instance.PostPlayerFollowRecord(PlayerFollowRecordSceneId.LoginServerSuccess);
                ControlServerLogHelper.Instance.PostCloudLadderEventAction(CloudLadderMarkEnum.login_gs);

                if (xc.Const.Region == xc.RegionType.KOREA)
                {
                    xc.BuriedPointHelper.ReportTapjoyEvnet("server");
                }

                //UIManager.Instance.UIMain.StartCoroutine(ShowCreateActorWnd());
                ShowCreateActorWnd();
            }
            break;

            case NetMsg.MSG_ACC_QUEUE:     // 登录排队信息
            {
                GameDebug.Log(">>>MSG_ACC_QUEUE");

                S2CAccQueue rep = S2CPackBase.DeserializePack <S2CAccQueue>(data);

                GameDebug.Log("Queue Num: " + rep.total);

                xc.ui.ugui.UIManager.Instance.ShowWaitScreen(false);
                //UIManager.GetInstance().UIMain.ShowQueueNotice(true, string.Format("前方还有: {0}人", rep.total));
                if (mCheckQueueTime == null)
                {
                    mCheckQueueTime = new Utils.Timer(15000, true, 15000, OnQueueChecking);
                }
            }
            break;

            case NetMsg.MSG_ACC_QUEUE_OK:    // 排队成功
            {
                GameDebug.Log(">>>MSG_ACC_QUEUE_OK");

                //UIManager.GetInstance().UIMain.ShowQueueNotice(false, "");
                CancelQueueTime();
            }
            break;

            case NetMsg.MSG_ENTER_GAME:
            {
                GameDebug.Log(">>>MSG_ENTER_GAME");

                ClientEventMgr.GetInstance().FireEvent((int)ClientEvent.CE_ENTER_GAME, null);

                S2CEnterGame enter_game = S2CPackBase.DeserializePack <S2CEnterGame>(data);
                mServerTime          = enter_game.ts;
                mServerLastUpdteTime = mServerTime;
                GlobalConfig.GetInstance().LoginInfo.CreateRoleTime = enter_game.birth.ToString();

                // 开启定时器
                if (mUpdateServerTimeStopwatch == null)
                {
                    mUpdateServerTimeStopwatch = new System.Diagnostics.Stopwatch();
                }
                else
                {
                    mUpdateServerTimeStopwatch.Reset();
                }
                mUpdateServerTimeStopwatch.Start();

                if (mServerTimeTimer != null)
                {
                    mServerTimeTimer.Destroy();
                }
                mServerTimeTimer = new Utils.Timer(1000, true, Mathf.Infinity, UpdateServerTime);

                // 设置角色属性
                LocalPlayerManager.Instance.InitAttribute(Game.GetInstance().LocalPlayerTypeID, Game.Instance.LocalPlayerName);
                OnEnterGame();

                // 进入游戏的时候通知sdk
                SDKControler.getSDKControler().sendRoleInfo2SDK((int)SDKControler.RoleEvent.ENTER_GAME);
                // 设置bugly的userid
                if (Game.GetInstance().LocalPlayerID != null)
                {
                    DBOSManager.getDBOSManager().SetUserId(Game.GetInstance().LocalPlayerID.obj_idx.ToString());
                }

                IsEnterGame = true;
            }
            break;

            case NetMsg.MSG_ACC_PING:
            {
                S2CAccPing s2c_acc_ping = S2CPackBase.DeserializePack <S2CAccPing>(data);
                mServerTime          = s2c_acc_ping.time;
                mServerLastUpdteTime = mServerTime;

                // 重置定时器
                if (mUpdateServerTimeStopwatch == null)
                {
                    mUpdateServerTimeStopwatch = new System.Diagnostics.Stopwatch();
                }
                else
                {
                    mUpdateServerTimeStopwatch.Reset();
                }
                mUpdateServerTimeStopwatch.Start();

                // 发送ping消息给服务器
                C2SAccPing c2s_ping = new C2SAccPing();
                c2s_ping.time = mServerTime;
                NetClient.GetBaseClient().SendData <C2SAccPing>(NetMsg.MSG_ACC_PING, c2s_ping);
            }
            break;

            case NetMsg.MSG_ACC_HOTUP:     // 数据有更新,需要在游戏内提示玩家
            {
                Debug.Log(">>>MSG_ACC_HOTUP");
            }
            break;

            case NetMsg.MSG_ACC_SYS_SETTING:
            {
                /*var pack = S2CPackBase.DeserializePack<S2CAccSysSetting>(data);
                 * foreach (var set in pack.sets)
                 * {
                 *  QualitySetting.SetPlayerCount(set.key, set.val);
                 * }*/
            }
            break;

            case NetMsg.MSG_PLAYER_REQUEST_ALL_INFO_END:
            {
                mAllSystemInited = true;
                NetReconnect.Instance.ReconnectSucc();
                ClientEventMgr.Instance.FireEvent((int)ClientEvent.CE_ALL_SYSTEM_INITED, null);
            }
            break;

            case NetMsg.MSG_ACC_ROLE_CHANGE_FAIL:
            {
                ChangeRoleManager.Instance.IsChangeRole = false;
                m_GameMachine.React((uint)GameEvent.GE_CHANGE_ROLE_FINISH);

                IBridge bridge = DBOSManager.getDBOSManager().getBridge();
                bridge.logout();
            }
            break;

            case NetMsg.MSG_PLAYER_OPEN_TIME:
            {
                var pack = S2CPackBase.DeserializePack <S2CPlayerOpenTime>(data);

                mServerOpenTime  = pack.time;
                mMergeServerTime = pack.merge_time;
                mTimeZone        = pack.time_zone;
                var timeZoneHour = TimeZoneHour();
                var timeZoneMin  = TimeZoneMin();
                converted = new System.DateTime(1970, 1, 1, timeZoneHour, timeZoneMin, 0, 0);
            }
            break;

            case NetMsg.MSG_PLAYER_DAILY_RESET:
            {
                ClientEventMgr.Instance.FireEvent((int)ClientEvent.CE_PLAYER_DAILY_RESET, null);
            }
            break;

            default:
                break;
            }
        }
Ejemplo n.º 13
0
        public void OnNetConnect(NetType netType)
        {
            Debug.Log("Connect server successed!");

            // 设置连接状态
            mConnected = true;
            ClientEventMgr.Instance.FireEvent((int)ClientEvent.CE_NET_MAIN_CONNECTED, null);

            if (ChangeRoleManager.Instance.IsChangeRole)// 更换角色发送C2SAccRoleChangeLogin协议
            {
                var acc_role_change_login = new C2SAccRoleChangeLogin();
                acc_role_change_login.token = GlobalConfig.Instance.Token;
                acc_role_change_login.uuid  = ChangeRoleManager.Instance.PreUuid;
                NetClient.GetBaseClient().SendData <C2SAccRoleChangeLogin>(NetMsg.MSG_ACC_ROLE_CHANGE_LOGIN, acc_role_change_login);
                return;
            }

            if (NetReconnect.Instance.IsReconnect)// 在断线重连状态下,不需要发送C2SEasyLogin协议
            {
                var session_login = new C2SAccSessionLogin();
                session_login.token = GlobalConfig.Instance.Token;
                session_login.uuid  = Game.Instance.LocalPlayerID.obj_idx;
                NetClient.GetBaseClient().SendData <C2SAccSessionLogin>(NetMsg.MSG_ACC_SESSION_LOGIN, session_login);
                return;
            }

            // 游戏帐号为空则直接返回
            if (string.IsNullOrEmpty(Game.GetInstance().Account))
            {
                GameDebug.LogError("Game account is null");
                return;
            }

            IBridge bridge = DBOSManager.getDBOSManager().getBridge();

            // 发送C2SEasyLogin协议
            C2SEasyLogin easy_login = new C2SEasyLogin();

            easy_login.username = System.Text.Encoding.UTF8.GetBytes(Game.GetInstance().Account);
            if (string.IsNullOrEmpty(GlobalConfig.GetInstance().LoginInfo.Ticket))
            {
                easy_login.password = System.Text.Encoding.UTF8.GetBytes("ticket");
            }
            else
            {
                easy_login.password = System.Text.Encoding.UTF8.GetBytes(GlobalConfig.GetInstance().LoginInfo.Ticket);
            }
            easy_login.channel      = System.Text.Encoding.UTF8.GetBytes(GlobalConfig.GetInstance().SDKName);
            easy_login.server_id    = (uint)GlobalConfig.GetInstance().LoginInfo.ServerInfo.SId;
            easy_login.sub_channel  = System.Text.Encoding.UTF8.GetBytes(GlobalConfig.GetInstance().SubChannel);
            easy_login.sdk_user_id  = System.Text.Encoding.UTF8.GetBytes(DBOSManager.getOSBridge().getSdkUserID());
            easy_login.roll_sever   = GlobalConfig.GetInstance().LoginInfo.RollServer;
            easy_login.ext_channel  = System.Text.Encoding.UTF8.GetBytes(bridge.getExtChannel());
            easy_login.main_channel = System.Text.Encoding.UTF8.GetBytes(bridge.getCurrChannel());
            NetClient.GetBaseClient().SendData <C2SEasyLogin>(NetMsg.MSG_EASY_LOGIN, easy_login);

#if !UNITY_IPHONE
            // 选择服务器的时候通知sdk
            SDKControler.getSDKControler().sendRoleInfo2SDK((int)SDKControler.RoleEvent.SELECT_SERVER);
#endif
        }
Ejemplo n.º 14
0
        public void ProcessCharacterInfo(S2CPlayerLvExp lv_exp)
        {
            bool isInitInfo = IsFirstCallBackExp;

            if (IsFirstCallBackExp == true)
            {
                IsFirstCallBackExp = false;
                GetExpMax();
            }

            bool is_level_change = false;

            ulong add_exp = GetAddExp(Level, Exp, lv_exp.level, lv_exp.exp);

            // 检测角色等级是否变化
            if (LocalActorAttribute != null && LocalActorAttribute.Level != lv_exp.level)
            {
                LocalActorAttribute.Level = lv_exp.level;
                GlobalConfig.GetInstance().LoginInfo.Level = lv_exp.level.ToString();
                GetExpMax();
                is_level_change = true;

                if (isInitInfo == false)
                {
                    ControlServerLogHelper.Instance.PostRoleInfo();
                }
                HookSettingManager.Instance.UpdateAutoBuyDrugGoodsId();
            }

            // 收到角色信息时都要检查是否弹出小包的更新界面
            ClientEventMgr.Instance.FireEvent((int)ClientEvent.CE_CHECK_MINIPACK, null);
            if (add_exp > 0)
            {
                //                UINotice.GetInstance().ShowMessage("[efdb7c]获得经验:[e3e3e3]" + (s2cLvExp.exp - Exp));
                var localplayer = Game.Instance.GetLocalPlayer();
                if (localplayer != null)
                {
                    string push_str = "";
                    if (lv_exp.extra_rate > 0)
                    {
                        push_str = (lv_exp.extra_rate / 100.0f).ToString("0");
                        //push_str = ActorUtils.Instance.TrimFloatStr(push_str);
                        push_str = string.Format("(+{0}%)", push_str);
                    }
                    localplayer.ShowDamageEffect(FightEffectHelp.FightEffectType.AddExp, 0, (long)add_exp, false, push_str);
                }


                ClientEventMgr.GetInstance().FireEvent((int)ClientEvent.CE_LOCALPLAYER_EXP_ADDED, new CEventObjectArgs(add_exp, lv_exp.reason));
            }

            Exp = lv_exp.exp;

            Actor localActor = Game.GetInstance().GetLocalPlayer();

            if (null != localActor)
            {
                localActor.SetActorAttribute(LocalActorAttribute);

                ClientEventMgr.GetInstance().FireEvent((int)ClientEvent.CE_ACTOR_BASEINFO_UPDATE, new CEventActorArgs(localActor));
            }

            if (is_level_change && !isInitInfo)
            {
                ItemManager.Instance.CheckBagCanQuickUse();
                ClientEventMgr.GetInstance().FireEvent((int)ClientEvent.CE_ACTOR_LEVEL_UPDATE, new CEventBaseArgs());

                // 等级升级的时候通知sdk
                SDKControler.getSDKControler().sendRoleInfo2SDK((int)SDKControler.RoleEvent.LEVEL_UP);
            }
        }