|
@@ -47,7 +47,6 @@ namespace GFGGame
|
|
|
|
|
|
_ui.m_imgLogo.visible = LauncherConfig.netType != LauncherConfig.EnumNetType.TEMP;
|
|
_ui.m_imgLogo.visible = LauncherConfig.netType != LauncherConfig.EnumNetType.TEMP;
|
|
|
|
|
|
- EventAgent.AddEventListener(ConstMessage.SERVER_CHANGE, OnSeverChangeListener);
|
|
|
|
|
|
|
|
_ui.m_btnChange.onClick.Add(OnBtnChangeClick);
|
|
_ui.m_btnChange.onClick.Add(OnBtnChangeClick);
|
|
|
|
|
|
@@ -67,11 +66,16 @@ namespace GFGGame
|
|
UpdateServer(recentlyServerInfo);
|
|
UpdateServer(recentlyServerInfo);
|
|
_ui.m_btnStart.visible = false;
|
|
_ui.m_btnStart.visible = false;
|
|
_ui.m_btnTapLogin.visible = false;
|
|
_ui.m_btnTapLogin.visible = false;
|
|
|
|
+ _ui.m_btnLogout.visible = false;
|
|
InitLoginStatus(serverInfosComponent).Coroutine();
|
|
InitLoginStatus(serverInfosComponent).Coroutine();
|
|
|
|
+ EventAgent.AddEventListener(ConstMessage.SERVER_CHANGE, OnSeverChangeListener);
|
|
|
|
+ EventAgent.AddEventListener(ConstMessage.LOGIN_SUCCESS, OnLoginSuccess);
|
|
}
|
|
}
|
|
|
|
|
|
protected override void OnHide()
|
|
protected override void OnHide()
|
|
{
|
|
{
|
|
|
|
+ EventAgent.RemoveEventListener(ConstMessage.SERVER_CHANGE, OnSeverChangeListener);
|
|
|
|
+ EventAgent.RemoveEventListener(ConstMessage.LOGIN_SUCCESS, OnLoginSuccess);
|
|
if (_sceneObject != null)
|
|
if (_sceneObject != null)
|
|
{
|
|
{
|
|
GameObject.Destroy(_sceneObject);
|
|
GameObject.Destroy(_sceneObject);
|
|
@@ -86,7 +90,6 @@ namespace GFGGame
|
|
{
|
|
{
|
|
var success = await PlatformTapManager.Instance.LoginCache();
|
|
var success = await PlatformTapManager.Instance.LoginCache();
|
|
_ui.m_btnTapLogin.visible = !success;
|
|
_ui.m_btnTapLogin.visible = !success;
|
|
- _ui.m_btnStart.visible = success;
|
|
|
|
}
|
|
}
|
|
else//自有登录
|
|
else//自有登录
|
|
{
|
|
{
|
|
@@ -108,13 +111,10 @@ namespace GFGGame
|
|
{
|
|
{
|
|
var success = await PlatformTapManager.Instance.Login();
|
|
var success = await PlatformTapManager.Instance.Login();
|
|
_ui.m_btnTapLogin.visible = !success;
|
|
_ui.m_btnTapLogin.visible = !success;
|
|
- _ui.m_btnStart.visible = success;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
private void UpdateServer(ServerInfo info)
|
|
private void UpdateServer(ServerInfo info)
|
|
{
|
|
{
|
|
- //登录成功后更新注销按钮显示
|
|
|
|
- _ui.m_btnLogout.visible = GameGlobal.zoneScene.GetComponent<AccountInfoComponent>().IsLogin();
|
|
|
|
ServerInfosComponent serverInfosComponent = GameGlobal.zoneScene.GetComponent<ServerInfosComponent>();
|
|
ServerInfosComponent serverInfosComponent = GameGlobal.zoneScene.GetComponent<ServerInfosComponent>();
|
|
if (serverInfosComponent.ServerInfoList.Count == 0)
|
|
if (serverInfosComponent.ServerInfoList.Count == 0)
|
|
{
|
|
{
|
|
@@ -126,6 +126,13 @@ namespace GFGGame
|
|
|
|
|
|
LogServerHelperHttp.SendNodeLog((int)LogNode.ShowSelectServer);
|
|
LogServerHelperHttp.SendNodeLog((int)LogNode.ShowSelectServer);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ private void OnLoginSuccess(EventContext context)
|
|
|
|
+ {
|
|
|
|
+ _ui.m_btnLogout.visible = true;
|
|
|
|
+ _ui.m_btnStart.visible = true;
|
|
|
|
+ }
|
|
|
|
+
|
|
private void OnSeverChangeListener(EventContext context)
|
|
private void OnSeverChangeListener(EventContext context)
|
|
{
|
|
{
|
|
ServerInfosComponent serverInfosComponent = GameGlobal.zoneScene.GetComponent<ServerInfosComponent>();
|
|
ServerInfosComponent serverInfosComponent = GameGlobal.zoneScene.GetComponent<ServerInfosComponent>();
|
|
@@ -138,7 +145,7 @@ namespace GFGGame
|
|
}
|
|
}
|
|
private void OnClickBtnNotice()
|
|
private void OnClickBtnNotice()
|
|
{
|
|
{
|
|
- if (NoticeDataManager.Instance.LastNoticeInfo.noticeId == 0)
|
|
|
|
|
|
+ if (NoticeDataManager.Instance.LastNoticeInfo == null || NoticeDataManager.Instance.LastNoticeInfo.noticeId == 0)
|
|
{
|
|
{
|
|
PromptController.Instance.ShowFloatTextPrompt("暂无公告发布");
|
|
PromptController.Instance.ShowFloatTextPrompt("暂无公告发布");
|
|
return;
|
|
return;
|
|
@@ -146,20 +153,27 @@ namespace GFGGame
|
|
ViewManager.Show<SystemNoticeView>(new object[] { NoticeDataManager.Instance.LastNoticeInfo.title, NoticeDataManager.Instance.LastNoticeInfo.content });
|
|
ViewManager.Show<SystemNoticeView>(new object[] { NoticeDataManager.Instance.LastNoticeInfo.title, NoticeDataManager.Instance.LastNoticeInfo.content });
|
|
}
|
|
}
|
|
|
|
|
|
- private async void OnClickBtnStart()
|
|
|
|
|
|
+ private void OnClickBtnStart()
|
|
{
|
|
{
|
|
- var serverInfosComponent = GameGlobal.zoneScene.GetComponent<ServerInfosComponent>();
|
|
|
|
- if (serverInfosComponent.ServerInfoList.Count <= 0)
|
|
|
|
|
|
+ if (PlatformManager.IsTaptap)//taptap平台
|
|
{
|
|
{
|
|
- bool login = GameController.CheckLoginCache(true);
|
|
|
|
- if (!login)
|
|
|
|
- {
|
|
|
|
- ViewManager.Show<LoginInputView>();
|
|
|
|
- }
|
|
|
|
|
|
+ LoginController.GetRoles().Coroutine();
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- await LoginController.GetRoles();
|
|
|
|
|
|
+ var serverInfosComponent = GameGlobal.zoneScene.GetComponent<ServerInfosComponent>();
|
|
|
|
+ if (serverInfosComponent.ServerInfoList.Count <= 0)
|
|
|
|
+ {
|
|
|
|
+ bool login = GameController.CheckLoginCache(true);
|
|
|
|
+ if (!login)
|
|
|
|
+ {
|
|
|
|
+ ViewManager.Show<LoginInputView>();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ LoginController.GetRoles().Coroutine();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|