| | |
| | | public class DebugLogin : MonoBehaviour
|
| | | { |
| | | public InputField appid; |
| | | public InputField serverId; |
| | | public InputField ipInputField; |
| | | public InputField portInputField;
|
| | | public InputField gateInputField; |
| | | public InputField account; |
| | | public InputField password; |
| | | |
| | | public Toggle isToken; |
| | | |
| | | string appidRecorder {
|
| | | string appidRecorder
|
| | | {
|
| | | get { return LocalSave.GetString("DebugLogin_AppId"); }
|
| | | set { LocalSave.SetString("DebugLogin_AppId", value); }
|
| | | }
|
| | |
|
| | | string serverIdRecorder {
|
| | | get { return LocalSave.GetString("DebugLogin_ServerId"); }
|
| | | set { LocalSave.SetString("DebugLogin_ServerId", value); }
|
| | | }
|
| | |
|
| | | string ipRecorder {
|
| | | get { return LocalSave.GetString("DebugLogin_Ip"); }
|
| | | set { LocalSave.SetString("DebugLogin_Ip", value); }
|
| | | }
|
| | |
|
| | | string portRecorder {
|
| | | get { return LocalSave.GetString("DebugLogin_Port"); }
|
| | | set { LocalSave.SetString("DebugLogin_Port", value); }
|
| | | }
|
| | |
|
| | | string gateRecorder {
|
| | | get { return LocalSave.GetString("DebugLogin_Gate"); }
|
| | | set { LocalSave.SetString("DebugLogin_Gate", value); }
|
| | | }
|
| | |
|
| | | string accountRecorder {
|
| | | string accountRecorder
|
| | | {
|
| | | get { return LocalSave.GetString("DebugLogin_Account"); }
|
| | | set { LocalSave.SetString("DebugLogin_Account", value); }
|
| | | }
|
| | |
|
| | | string passwordRecorder {
|
| | | string passwordRecorder
|
| | | {
|
| | | get { return LocalSave.GetString("DebugLogin_Password"); }
|
| | | set { LocalSave.SetString("DebugLogin_Password", value); }
|
| | | }
|
| | |
|
| | | bool istokenRecorder {
|
| | | bool istokenRecorder
|
| | | {
|
| | | get { return LocalSave.GetBool("DebugLogin_IsToken", false); }
|
| | | set { LocalSave.SetBool("DebugLogin_IsToken", value); }
|
| | | } |
| | |
| | | private void OnEnable()
|
| | | {
|
| | | appid.text = appidRecorder;
|
| | | serverId.text = serverIdRecorder;
|
| | | ipInputField.text = ipRecorder;
|
| | | portInputField.text = portRecorder;
|
| | | gateInputField.text = gateRecorder;
|
| | | account.text = accountRecorder;
|
| | | password.text = passwordRecorder;
|
| | | isToken.isOn = istokenRecorder;
|
| | |
| | | public void Login()
|
| | | {
|
| | | appidRecorder = appid.text;
|
| | | serverIdRecorder = serverId.text;
|
| | | ipRecorder = ipInputField.text;
|
| | | portRecorder = portInputField.text;
|
| | | gateRecorder = gateInputField.text;
|
| | | accountRecorder = account.text;
|
| | | passwordRecorder = password.text;
|
| | | istokenRecorder = isToken.isOn;
|
| | |
| | | {
|
| | | var loginModel = ModelCenter.Instance.GetModel<LoginModel>();
|
| | |
|
| | | var ip = ipInputField.text;
|
| | | var port = int.Parse(portInputField.text);
|
| | | var gamePort = int.Parse(gateInputField.text);
|
| | | VersionConfig.Get().m_AppId = appid.text;
|
| | | ServerListCenter.Instance.currentServer = new ServerData()
|
| | | {
|
| | | region_flag = int.Parse(serverId.text),
|
| | | login_port = port,
|
| | | game_port = gamePort,
|
| | | };
|
| | |
|
| | | loginModel.sdkLoginResult = new SDKUtility.FP_LoginOk()
|
| | | {
|
| | | account = account.text,
|
| | |
| | | };
|
| | |
|
| | | loginModel.sdkLogined = true;
|
| | | var ip = ServerListCenter.Instance.currentServer.region_domain;
|
| | | var port = ServerListCenter.Instance.currentServer.login_port;
|
| | | var gamePort = ServerListCenter.Instance.currentServer.game_port;
|
| | | loginModel.AccountLogin(ip, port, gamePort);
|
| | | }
|
| | | else
|
| | |
| | | };
|
| | |
|
| | | SDKUtility.Instance.FreePlatformCheckIDAuthentication(result.account);
|
| | |
|
| | | var ip = ipInputField.text;
|
| | | var port = int.Parse(portInputField.text);
|
| | | var gamePort = int.Parse(gateInputField.text);
|
| | | var ip = ServerListCenter.Instance.currentServer.region_domain;
|
| | | var port = ServerListCenter.Instance.currentServer.login_port;
|
| | | var gamePort = ServerListCenter.Instance.currentServer.game_port;
|
| | | VersionConfig.Get().m_AppId = appid.text;
|
| | | ServerListCenter.Instance.currentServer = new ServerData()
|
| | | {
|
| | | region_flag = int.Parse(serverId.text),
|
| | | login_port = port,
|
| | | game_port = gamePort,
|
| | | };
|
| | |
|
| | | loginModel.AccountLogin(ip, port, gamePort);
|
| | | }
|
| | | else
|