用户信息注册页面 提交按钮

服务器向客户端连续推送3条信息:

 Int32 OnNetMsg_NotifyUserBaseInfo(System.IO.Stream stream)
    {
        print ("OnNetMsg_NotifyUserBaseInfo");
        GSToGC.UserBaseInfo pMsg;
        if (!ProtoDes(out pMsg, stream))
        {
            return PROTO_DESERIALIZE_ERROR;
        }

        UInt64 sGUID = pMsg.guid;
        print ("sGUID  "+sGUID);
        print (pMsg.nickname);
        print (pMsg.nickname.Count());
        if (pMsg.nickname.Count() > 1)
        {
            GameUserModel.Instance.SetGameBaseInfo(pMsg);
            EventCenter.SendEvent(new CEvent(EGameEvent.eGameEvent_IntoLobby));
        }
        else if (sGUID > 0)
        {
            //没有昵称,进入补充玩家信息界面
            EventCenter.SendEvent(new CEvent(EGameEvent.eGameEvent_InputUserData));
        }

        return (Int32)EErrorCode.eNormal;
    }


    Int32 OnNetMsg_NotifyNotice(Stream stream)
    {
        GSToGC.GameNotice pMsg;
        if (!ProtoDes(out pMsg, stream))
        {
            return PROTO_DESERIALIZE_ERROR;
        }
        if (pMsg.notice.Count == 0)
            return (Int32)EErrorCode.eNormal;
        SystemNoticeData.Instance.Clear();
        foreach (var item in pMsg.notice)
        {
            if (string.IsNullOrEmpty(item.notice))
            return (Int32)EErrorCode.eNormal;
            SystemNoticeData.Instance.SetSystemNotList(item.title, (NoticeIdentify)item.flag, (NoticeState)item.status, (int)item.priority, item.notice);
        }
        if (UIGuideModel.Instance.mIsGuideComp)
        {
            SystemNoticeCtrl.Instance.Enter();
        }
        return (Int32)EErrorCode.eNormal;
    }


  Int32 OnNetMsg_NotifyReturn(Stream stream)
    {
        print ("OnNetMsg_NotifyReturn");
        GSToGC.AskRet pMsg;
        if (!ProtoDes(out pMsg, stream))
        {
            return PROTO_DESERIALIZE_ERROR;
        }
        var askID = pMsg.askid;
        switch (askID)
        {
            case (int)GCToCS.MsgNum.eMsgToGSToCSFromGC_AskBuyGoods:
                Debug.LogError("购买失败!");
                break;
            case (int)GCToCS.MsgNum.eMsgToGSToCSFromGC_EuipRunes:
                Debug.LogError("装备符文失败!");
                break;
            case (int)GCToCS.MsgNum.eMsgToGSToCSFromGC_UnloadRunes:
                Debug.LogError("卸载符文失败!");
                break;
            case (int)GCToCS.MsgNum.eMsgToGSToCSFromGC_ComposeRunes:
                Debug.LogError("合成符文失败!");
                break;
            case (int)GCToCS.MsgNum.eMsgToGSToCSFromGC_AskRecoinRune:
                Debug.LogError("洗练符文失败!");
                break;
        }

        Int32 m_n32ErrorId = pMsg.errorcode;

        switch ((EErrorCode)m_n32ErrorId)
        {
            //case EErrorCode.eEC_NickNameCollision:
            //case EErrorCode.eEc_NickNameContainInvalideChar:
            //    EventCenter.Broadcast(EGameEvent.eGameEvent_AskComplementedRegisterInfo, (EErrorCode)m_n32ErrorId);
            //    break;
            case EErrorCode.eEC_TheBattleUserFull:

            case EErrorCode.eEC_BattlePDWNotMatch:
            case EErrorCode.eEC_InvalidMapID:
            case EErrorCode.eEC_JustInBattle:
            case EErrorCode.eEC_AddBattleFailForLackOfGold:
            case EErrorCode.eEC_BattleIsPlaying:
            case EErrorCode.eEC_UserInBlackList:
            case EErrorCode.eEC_AddBattleFailForUserFull:
            case EErrorCode.eEC_AddBattleFailForAllFull:
            case EErrorCode.eEC_CounterpartFriendListFull:
            case EErrorCode.eEC_BlackListFull:
                EventCenter.Broadcast<EErrorCode>(EGameEvent.eGameEvent_AskFriendEorr, (EErrorCode)m_n32ErrorId);
                break;
            case EErrorCode.eEC_JustNotInBattle:
            case EErrorCode.eEC_YouAreNotBattleManager:
            case EErrorCode.eEC_NotAllUserReady:
            case EErrorCode.eEC_CampNotBalance:
            case EErrorCode.eEC_InvalidBattlePos:
                EventCenter.Broadcast(EGameEvent.eGameEvent_AskBeginBattleError, (EErrorCode)m_n32ErrorId);
                break;
            case EErrorCode.eEC_NullGateServer:
            case EErrorCode.eEC_InvalidUserName:
            case EErrorCode.eEC_InvalidUserPwd:
            case EErrorCode.eEC_UserInfoUnComplete:
                LoginCtrl.Instance.LoginError(m_n32ErrorId);
                break;
            case EErrorCode.eEC_NullUser:
                LoginCtrl.Instance.LoginError(m_n32ErrorId);
                EventCenter.Broadcast(EGameEvent.eGameEvent_AskAddInBattle, (EErrorCode)m_n32ErrorId);
                EventCenter.Broadcast(EGameEvent.eGameEvent_NotEnoughGold, (EErrorCode)m_n32ErrorId);
                break;

            case EErrorCode.eEC_HeroNotDead:
            case EErrorCode.eEC_NoRebornTimes:
            case EErrorCode.eEC_NotEnoughGold:
                EventCenter.Broadcast(EGameEvent.eGameEvent_NotEnoughGold, (EErrorCode)m_n32ErrorId);
                break;
            case EErrorCode.eEC_NullBattle:
                EventCenter.Broadcast(EGameEvent.eGameEvent_AskAddInBattle, (EErrorCode)m_n32ErrorId);
                EventCenter.Broadcast(EGameEvent.eGameEvent_NotEnoughGold, (EErrorCode)m_n32ErrorId);
                EventCenter.Broadcast(EGameEvent.eGameEvent_BattleUpdateRoomList);
                break;
            case EErrorCode.eNormal:
                break;
            case EErrorCode.eEC_BattleClosing:
                EventCenter.Broadcast(EGameEvent.eGameEvent_ReConnectFail);
                EventCenter.Broadcast(EGameEvent.eGameEvent_BeginWaiting);
                MsgInfoManager.Instance.ShowMsg(m_n32ErrorId);
                break;
            case EErrorCode.eEC_InvalidBattleID:
                PlayerManager.Instance.CleanAccount();

                CEvent evt = new CEvent(EGameEvent.eGameEvent_Loading);
                evt.AddParam("NextState", BlGame.GameState.GameStateType.GS_Lobby);
                EventCenter.SendEvent(evt);
                break;
            case EErrorCode.eEC_ReEnterRoomFail:
                EventCenter.SendEvent(new CEvent(EGameEvent.eGameEvent_IntoLobby));
                break;
            case EErrorCode.eEC_AccountTheGame:
                LoginCtrl.Instance.SdkLogOff();
                break;

            default:
                MsgInfoManager.Instance.ShowMsg(m_n32ErrorId);
                break;
        }

        return (Int32)EErrorCode.eNormal;
    }


FR:海涛高软(hunk Xu)
QQ技术交流群:386476712

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值