用户信息注册页面 提交按钮
来源:互联网 发布:不用充值约爱软件 编辑:程序博客网 时间:2024/05/17 16:11
服务器向客户端连续推送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
阅读全文