少年修仙传客户端代码仓库
client_Wu Xijin
2018-08-29 cd2a94a5168a81893f75ae4bc263198f4cca071f
3064  修改debug 登录工具
2个文件已修改
147 ■■■■■ 已修改文件
Core/Editor/AssetBundleBrowser/AssetBundleBuildTab.cs 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Debug/DebugLogin.cs 111 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/Editor/AssetBundleBrowser/AssetBundleBuildTab.cs
@@ -20,8 +20,10 @@
        //private string m_OutputPath = string.Empty;
        //[SerializeField]
        //private bool m_UseDefaultPath = true;
        private string m_streamingPath {
            get {
        private string m_streamingPath
        {
            get
            {
                switch (m_UserData.m_BuildTarget)
                {
                    case ValidBuildTarget.Android:
@@ -71,12 +73,14 @@
        [SerializeField] int m_Version;
        public string ApkOutputPath {
        public string ApkOutputPath
        {
            get { return LocalSave.GetString("APKOutPutPath"); }
            set { LocalSave.SetString("APKOutPutPath", value); }
        }
        public string publishers {
        public string publishers
        {
            get { return LocalSave.GetString("APKPublishers"); }
            set { LocalSave.SetString("APKPublishers", value); }
        }
@@ -429,6 +433,12 @@
            GUILayout.EndHorizontal();
            GUILayout.Space(20);
            if (GUILayout.Button("SwitchVersionConfig"))
            {
                EditorApplication.delayCall += ExecuteSwitchVersionConfig;
            }
            GUILayout.EndVertical();
            EditorGUILayout.EndScrollView();
        }
@@ -636,6 +646,24 @@
            ClientPackage.BuildPublishers(ClientPackage.SDK_PLUGIN_PROJECT, outputPath, ApkOutputPath, publishers, true, false);
        }
        private void ExecuteSwitchVersionConfig()
        {
            var newVersionConfigPath = StringUtility.Contact("Assets/Resources/ScriptableObject/Config/VersionConfig", ".asset");
            var versionsFilePath = Application.dataPath + Path.DirectorySeparatorChar + "Editor/VersionConfigs/Versions.txt";
            var lines = File.ReadAllLines(versionsFilePath);
            for (int i = 2; i < lines.Length; i++)
            {
                var line = lines[i];
                var lineStrings = line.Split('\t');
                if (lineStrings[0] == publishers)
                {
                    VersionConfig.Get().Read(line);
                    break;
                }
            }
        }
        private static void DirectoryCopy(string sourceDirName, string destDirName)
        {
            // Get the subdirectories for the specified directory.
System/Debug/DebugLogin.cs
@@ -1,81 +1,53 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using Snxxz.UI;
using LitJson;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using Snxxz.UI;
using LitJson;
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 {
{
    public InputField appid;
    public InputField account;
    public InputField password;
    public Toggle isToken;
    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;
@@ -84,17 +56,7 @@
        {
            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,
@@ -105,6 +67,9 @@
            };
            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
@@ -141,18 +106,10 @@
                };
                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
@@ -175,5 +132,5 @@
        public string token_expire;
        public string phone;
        public string account_id;
    }
}
    }
}