void StateEnter_LoginPlatform(xc.Machine.State s) { ControlServerLogHelper.GetInstance().PostStartClientLog(); GlobalConfig globalConfig = GlobalConfig.GetInstance(); if (globalConfig.IsEnterSDK) { login_wnd = "UIQuickLoginWindow"; UIManager.Instance.ShowWindow(login_wnd); } else { if (Game.Instance.IsSkillEditorScene == false) { if (string.IsNullOrEmpty(globalConfig.LoginInfo.AccName) == true) { login_wnd = "UIAccountWindow"; UIManager.Instance.ShowWindow(login_wnd); } else { login_wnd = "UILoginWindow"; UIManager.Instance.ShowWindow(login_wnd); } } } }
public void OnGetServerStateFinished(string url, string error, string reply, System.Object userData) { #if UNITY_IPHONE reply = Utils.AES.Decode(reply, Const.CS_URL_KEY, Const.CS_URL_IV); #endif System.Object replyObject = MiniJSON.JsonDecode(reply); if (CheckReply(url, error, replyObject) == false) { if (mGetServerStateFinishedCallback != null) { mGetServerStateFinishedCallback(null, false); } return; } ServerInfo serverInfo = userData as ServerInfo; if (serverInfo == null) { GameDebug.LogError("Error in OnGetServerStateFinished, serverInfo is null!!!"); return; } Hashtable hashtable = (replyObject as Hashtable)["args"] as Hashtable; if (hashtable != null) { serverInfo.State = (EServerState)DBTextResource.ParseI(hashtable["status"].ToString()); } bool canEnter = CheckServerState(serverInfo); // 如果是不推荐进入的服务器,则读取recomm属性选中推荐的服务器 if (serverInfo.State == EServerState.NotRecomm) { if (hashtable != null) { Hashtable recommHashtable = hashtable["recomm"] as Hashtable; if (recommHashtable != null) { ServerInfo recommServerInfo = ParseServerInfo(recommHashtable); if (recommServerInfo != null) { xc.ui.UIWidgetHelp.GetInstance().ShowNoticeDlg(DBConstText.GetText("SERVER_NOT_RECOMM_TIPS"), (x) => { ClientEventMgr.Instance.FireEvent((int)ClientEvent.CE_SELECT_SERVER, new CEventBaseArgs(recommServerInfo)); }); canEnter = false; } } } } if (mGetServerStateFinishedCallback != null) { mGetServerStateFinishedCallback(serverInfo, canEnter); } if (canEnter == false || mEnterWhenGetServerStateFinished == false) { return; } GlobalConfig.GetInstance().LoginInfo.ServerInfo = serverInfo; string[] ips = serverInfo.Url.Split(':'); Game game = Game.GetInstance(); game.ServerIP = ips[0]; game.ServerPort = DBTextResource.ParseI(ips[1]); game.ServerID = (uint)serverInfo.SId; ControlServerLogHelper.GetInstance().PostAccountLoginLogS(serverInfo.ServerId, serverInfo.State); game.GameMode = (Game.EGameMode)((int)game.GameMode | (int)xc.Game.EGameMode.GM_Net); game.Login(); }
private void OnEnterGame() { RequestAppendInfo(); // 请求所有本地角色相关系统的信息 ControlServerLogHelper.SendMobileInfo(); // 发送客户端的数据 }