少年修仙传客户端代码仓库
client_linchunjie
2018-09-25 9868740853473eaafdf117df9d5856c9253e53f0
Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
10个文件已修改
287 ■■■■ 已修改文件
System/ClientVersion/VersionUpdateWin.cs 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/ClientVersion/VersionUtility.cs 146 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Compose/New/ComposeWin.cs 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/FairyAu/FairyAuTaskWin.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/KnapSack/Logic/BoxGetItemWin.cs 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Login/LoginModel.cs 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Login/LoginWin.cs 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/MainInterfacePanel/TaskBoxBGMWin.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/MainInterfacePanel/TaskListTip.cs 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/WindowJump/WindowJumpMgr.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/ClientVersion/VersionUpdateWin.cs
@@ -16,7 +16,9 @@
    public class VersionUpdateWin : Window
    {
        [SerializeField] RectTransform m_ContainerHint;
        [SerializeField] RichText m_Content;
        [SerializeField] RichText m_HintDescription;
        [SerializeField] RectTransform m_UpdateContentContainer;
        [SerializeField] RichText m_UpdateCotent;
        [SerializeField] Button m_Confirm;
        [SerializeField] Transform m_ContainerProgress;
@@ -108,14 +110,13 @@
        private void DisplayHintContent()
        {
            var step = VersionUtility.Instance.step;
            switch (step)
            {
                case VersionUtility.Step.None:
                    m_Content.text = Language.GetFromLocal(4);
                    m_HintDescription.text = Language.GetFromLocal(4);
                    break;
                case VersionUtility.Step.ApkExist:
                    m_Content.text = Language.GetFromLocal(5);
                    m_HintDescription.text = Language.GetFromLocal(5);
                    break;
                case VersionUtility.Step.DownLoadPrepared:
                    if (Application.platform == RuntimePlatform.Android)
@@ -125,28 +126,49 @@
                        switch (Application.internetReachability)
                        {
                            case NetworkReachability.NotReachable:
                                m_Content.text = Language.GetFromLocal(6, sizeDescription);
                                m_HintDescription.text = Language.GetFromLocal(6, sizeDescription);
                                break;
                            case NetworkReachability.ReachableViaCarrierDataNetwork:
                                m_Content.text = Language.GetFromLocal(7, sizeDescription);
                                m_HintDescription.text = Language.GetFromLocal(7, sizeDescription);
                                break;
                            case NetworkReachability.ReachableViaLocalAreaNetwork:
                                m_Content.text = Language.GetFromLocal(8, sizeDescription);
                                m_HintDescription.text = Language.GetFromLocal(8, sizeDescription);
                                break;
                        }
                    }
                    else if (Application.platform == RuntimePlatform.IPhonePlayer)
                    {
                        m_Content.text = Language.GetFromLocal(9);
                        m_HintDescription.text = Language.GetFromLocal(9);
                    }
                    break;
                case VersionUtility.Step.DownLoad:
                    m_Content.text = Language.GetFromLocal(3);
                    m_HintDescription.text = Language.GetFromLocal(3);
                    break;
                case VersionUtility.Step.DownLoadFailed:
                    m_Content.text = Language.GetFromLocal(10);
                    m_HintDescription.text = Language.GetFromLocal(10);
                    break;
            }
            switch (step)
            {
                case VersionUtility.Step.ApkExist:
                case VersionUtility.Step.DownLoadPrepared:
                    var updateContent = VersionUtility.Instance.GetUpdateContent();
                    if (string.IsNullOrEmpty(updateContent))
                    {
                        m_UpdateContentContainer.gameObject.SetActive(false);
                    }
                    else
                    {
                        m_UpdateContentContainer.gameObject.SetActive(true);
                        m_UpdateCotent.text = updateContent;
                    }
                    break;
                default:
                    m_UpdateContentContainer.gameObject.SetActive(false);
                    break;
            }
        }
        private void Confirm()
@@ -160,11 +182,7 @@
                    VersionUtility.Instance.RequestVersionCheck();
                    break;
                case VersionUtility.Step.ApkExist:
                    var version = VersionUtility.Instance.versionInfo.GetLatestVersion();
                    var remoteURL = version.download_url;
                    var fileName = Path.GetFileName(remoteURL);
                    var apkLocalURL = StringUtility.Contact(VersionUtility.Instance.androidRoot, "/", fileName);
                    SDKUtility.Instance.InstallAPK(apkLocalURL);
                    SDKUtility.Instance.InstallAPK(VersionUtility.Instance.GetApkLocalUrl());
                    break;
                case VersionUtility.Step.DownLoadPrepared:
                    if (Application.platform == RuntimePlatform.Android)
@@ -173,7 +191,7 @@
                    }
                    else if (Application.platform == RuntimePlatform.IPhonePlayer)
                    {
                        Application.OpenURL(VersionUtility.Instance.versionInfo.GetLatestVersion().download_url);
                        Application.OpenURL(VersionUtility.Instance.GetApkRemoteUrl());
                        //打开应用商店链接
                    }
                    break;
System/ClientVersion/VersionUtility.cs
@@ -20,21 +20,18 @@
    public string androidRoot { get { return StringUtility.Contact(SDKUtility.Instance.DeviceRootPath, "/", VersionConfig.Get().bundleIdentifier); } }
    public float progress
    {
    public float progress {
        get { return RemoteFile.TotalDownloadedSize / ((float)versionInfo.GetLatestVersion().file_size * 1024); }
    }
    public string apkLocalURL = string.Empty;
    public VersionInfo versionInfo { get; private set; }
    public MaoErVersion maoerVersion;
    public bool completed { get { return step == Step.Completed; } }
    Step m_Step = Step.None;
    public Step step
    {
    public Step step {
        get { return m_Step; }
        private set
        {
        private set {
            if (m_Step != value)
            {
                m_Step = value;
@@ -70,17 +67,12 @@
        if (_ok)
        {
            versionInfo = JsonMapper.ToObject<VersionInfo>(_result);
            if (versionInfo.VersionCount > 0)
            if (NeedUpdate())
            {
                var version = versionInfo.GetLatestVersion();
                var remoteURL = version.download_url;
                switch (Application.platform)
                {
                    case RuntimePlatform.Android:
                        var fileName = Path.GetFileName(remoteURL);
                        apkLocalURL = StringUtility.Contact(androidRoot, "/", fileName);
                        if (File.Exists(apkLocalURL))
                        if (File.Exists(GetApkLocalUrl()))
                        {
                            step = Step.ApkExist;
                            WindowCenter.Instance.OpenFromLocal<VersionUpdateWin>();
@@ -118,18 +110,74 @@
        }
    }
    public bool NeedUpdate()
    {
        if (IsMaoErGame())
        {
            return versionInfo.downAsset == 0 && versionInfo.VersionCount > 0;
        }
        else
        {
            return versionInfo.downAsset == 1 && versionInfo.VersionCount > 0;
        }
    }
    public string GetApkLocalUrl()
    {
        if (IsMaoErGame())
        {
            return StringUtility.Contact(androidRoot, "/", "maoErGame.apk");
        }
        else
        {
            var remoteURL = GetApkRemoteUrl();
            var fileName = Path.GetFileName(remoteURL);
            return StringUtility.Contact(androidRoot, "/", fileName);
        }
    }
    public string GetApkRemoteUrl()
    {
        if (IsMaoErGame())
        {
            return maoerVersion.url;
        }
        else
        {
            var version = versionInfo.GetLatestVersion();
            return version.download_url;
        }
    }
    public string GetUpdateContent()
    {
        if (IsMaoErGame())
        {
            if (string.IsNullOrEmpty(maoerVersion.content))
            {
                return string.Empty;
            }
            else
            {
                return StringUtility.Contact(Language.GetFromLocal(30), "\r\n", maoerVersion.content);
            }
        }
        else
        {
            return string.Empty;
        }
    }
    public void StartDownLoad()
    {
        step = Step.DownLoad;
        var version = versionInfo.GetLatestVersion();
        var remoteURL = version.download_url;
        var fileName = Path.GetFileName(remoteURL);
        apkLocalURL = StringUtility.Contact(androidRoot, "/", fileName);
        var remoteURL = GetApkRemoteUrl();
        var apkLocalUrl = GetApkLocalUrl();
        RemoteFile.Prepare();
        var remoteFile = new RemoteFile();
        remoteFile.Init(remoteURL, apkLocalURL, null);
        remoteFile.Init(remoteURL, apkLocalUrl, null);
        remoteFile.Begin(OnDownLoadApkCompleted);
    }
@@ -155,7 +203,7 @@
                }
            }
            SDKUtility.Instance.InstallAPK(apkLocalURL);
            SDKUtility.Instance.InstallAPK(GetApkLocalUrl());
        }
        else
        {
@@ -168,10 +216,54 @@
        step = Step.Completed;
    }
    const string maoerGameAppId = "mrgame";
    static List<string> maoerGameAppId = new List<string> { "mrgame", "mrgameios" };
    public bool IsMaoErGame()
    {
        return VersionConfig.Get().appId == maoerGameAppId;
        return maoerGameAppId.Contains(VersionConfig.Get().appId);
    }
    public void RequestMaoErVersionCheck()
    {
        if (IsMaoErGame() && versionInfo.VersionCount > 0)
        {
            step = Step.None;
            var tables = new Dictionary<string, string>();
            tables["uid"] = ModelCenter.Instance.GetModel<LoginModel>().sdkLoginResult.account;
            var url = "https://api.maoergame.com/update/download/url";
            HttpRequest.Instance.RequestHttpPost(url, tables, HttpRequest.defaultHttpContentType, 1, OnMaoErVersionCheckResult);
        }
    }
    private void OnMaoErVersionCheckResult(bool ok, string result)
    {
        if (ok)
        {
            try
            {
                maoerVersion = JsonMapper.ToObject<MaoErVersion>(result);
                if (maoerVersion.code == 0)
                {
                    step = Step.DownLoadPrepared;
                    WindowCenter.Instance.OpenFromLocal<VersionUpdateWin>();
                }
                else
                {
                    step = Step.None;
                    Clock.Create(DateTime.Now + new TimeSpan(TimeSpan.TicksPerSecond), RequestMaoErVersionCheck);
                }
            }
            catch (System.Exception ex)
            {
                step = Step.None;
                Clock.Create(DateTime.Now + new TimeSpan(TimeSpan.TicksPerSecond), RequestMaoErVersionCheck);
            }
        }
        else
        {
            step = Step.None;
            Clock.Create(DateTime.Now + new TimeSpan(TimeSpan.TicksPerSecond), RequestMaoErVersionCheck);
        }
    }
    public class VersionInfo
@@ -181,7 +273,7 @@
        public JsonData resource_url;
        public JsonData notice_flag;
        public Version[] versions;
        public int downAsset =1;
        public int downAsset = 1;
        public Version GetLatestVersion()
        {
@@ -240,6 +332,14 @@
        public string version_name;
    }
    public struct MaoErVersion
    {
        public string msg;
        public int code;
        public string content;
        public string url;
    }
    public enum Step
    {
        None,
System/Compose/New/ComposeWin.cs
@@ -48,7 +48,7 @@
        #region Built-in
        protected override void BindController()
        {
            WindowCenter.Instance.jumpWindowCloseEvent += CloseJumpWindow;
        }
        protected override void AddListeners()
@@ -67,7 +67,7 @@
        protected override void OnPreOpen()
        {
            ComposeModel.ResetModel();
            if(WindowJumpMgr.Instance.IsJumpState && WindowJumpMgr.Instance.jumpType == 1)
            if(WindowJumpMgr.Instance.IsJumpState)
            {
                if(ComposeModel.CurComposeModel != null)
                {
@@ -164,11 +164,19 @@
                WindowCenter.Instance.Open<MainInterfaceWin>();
               
            }
            if(WindowJumpMgr.Instance.jumpType != 1)
        }
        private void CloseJumpWindow(Window win)
        {
            if(win as ComposeWin)
            {
                ComposeModel.SetCurComposeModel(null);
                if (WindowJumpMgr.Instance.jumpPhase <= 1)
                {
                    ComposeModel.SetCurComposeModel(null);
                }
            }
        }
        #endregion
        private void OnClickRightBtn()
System/FairyAu/FairyAuTaskWin.cs
@@ -82,7 +82,7 @@
            RewardsToOpen();
            ContentAssignment();
            int GetCylinderNumber = TaskAllocation.Instance.FairyAuNumber();//获取仙盟总环数
            if (coinTaskTip.IsFairy && GetCylinderNumber == 10)
            if (coinTaskTip.IsFairy && GetCylinderNumber == 10 && vipmodel.GetVipPrivilegeCnt(VipPrivilegeType.AutoFairyMisstion) >= 1)
            {
                _ReceiveImageText.text = string.Format(Language.Get("TaskContinueCount_1"), Second);
            }
System/KnapSack/Logic/BoxGetItemWin.cs
@@ -193,15 +193,24 @@
                item.name = StringUtility.Contact("CommonItemCell", index);
                item.gameObject.SetActive(true);
                BoxGetItemInfo itemInfo = BoxModel.getItems[index];
                PackType type = PackType.rptDeleted;
                ItemConfig itemConfig = Config.Instance.Get<ItemConfig>(itemInfo.ItemID);
                if(itemConfig != null)
                {
                    if(itemConfig.Type == 70 || (itemConfig.EquipPlace >= 101 && itemConfig.EquipPlace <= 105))
                    {
                        type = PackType.rptDogzItem;
                    }
                }
                CommonItemBaisc itemBasic = item.transform.Find("CommonItemCell").GetComponent<CommonItemBaisc>();
                ItemCellModel cellModel = new ItemCellModel(itemInfo.ItemID, false, (ulong)itemInfo.Count, itemInfo.IsBind,
                    "", PackType.rptDeleted, false, ConfigParse.Analysis(itemInfo.UserData));
                    "", type, false, ConfigParse.Analysis(itemInfo.UserData));
                itemBasic.Init(cellModel);
                itemBasic.cellBtn.RemoveAllListeners();
                itemBasic.cellBtn.AddListener(()=>
                {
                    ItemAttrData attrData = new ItemAttrData(itemInfo.ItemID,false, (ulong)itemInfo.Count,-1, itemInfo.IsBind,
                        false, PackType.rptDeleted,"", ConfigParse.Analysis(itemInfo.UserData));
                        false,type,"", ConfigParse.Analysis(itemInfo.UserData));
                    itemTipsModel.SetItemTipsModel(attrData);
                    
                });
System/Login/LoginModel.cs
@@ -15,8 +15,7 @@
        public SDKUtility.FP_LoginOk sdkLoginResult;
        public SDKUtility.FP_CheckIDAuthentication sdkIDCheckIDAuthentication;
        public string localSaveAccountName
        {
        public string localSaveAccountName {
            get { return LocalSave.GetString(USER_ACCOUNT); }
            set { LocalSave.SetString(USER_ACCOUNT, value); }
        }
@@ -25,22 +24,19 @@
        public event Action accountBindOkEvent;
        bool m_ReconnecBackGround = false;
        public bool reconnectBackGround
        {
        public bool reconnectBackGround {
            get { return m_ReconnecBackGround; }
            set { m_ReconnecBackGround = value; }
        }
        bool m_OnCreateRole = false;
        public bool onCreateRole
        {
        public bool onCreateRole {
            get { return m_OnCreateRole; }
            set { m_OnCreateRole = value; }
        }
        bool m_Busy = false;
        public bool busy
        {
        public bool busy {
            get { return m_Busy; }
            set { m_Busy = value; }
        }
@@ -90,11 +86,18 @@
            }
            SDKUtility.Instance.FreePlatformCheckIDAuthentication(sdkLoginResult.account);
            ServerListCenter.Instance.RequestServerListPlayer(sdkLoginResult.account);
            GameNotice.OpenGameNotice();
            SDKUtility.Instance.MakeKeyAndVisible();
            OperationLogCollect.Instance.RecordLauchEvent(5);
            if (VersionUtility.Instance.IsMaoErGame() && VersionUtility.Instance.NeedUpdate())
            {
                VersionUtility.Instance.RequestMaoErVersionCheck();
            }
            else
            {
                GameNotice.OpenGameNotice();
            }
        }
        private void OnSDKAccountLoginOutOk()
System/Login/LoginWin.cs
@@ -169,6 +169,14 @@
                return;
            }
            if (VersionUtility.Instance.IsMaoErGame())
            {
                if (VersionUtility.Instance.step != VersionUtility.Step.Completed)
                {
                    return;
                }
            }
            Login();
        }
System/MainInterfacePanel/TaskBoxBGMWin.cs
@@ -143,7 +143,7 @@
            if (_AllMissionDict.ContainsKey(_TaskId))
            {
                if (_AllMissionDict[_TaskId].Type == 7 || (_AllMissionDict[_TaskId].Type == 12 && vipmodel.GetVipPrivilegeCnt(VipPrivilegeType.AutoFairyMisstion) >= 1))
                if (_AllMissionDict[_TaskId].Type == 7 || (_AllMissionDict[_TaskId].Type == 12 /*&& vipmodel.GetVipPrivilegeCnt(VipPrivilegeType.AutoFairyMisstion) >= 1*/))
                {
                    taskmodel.RequestGetTaskAward("OK");
                    WindowCenter.Instance.CloseImmediately<TaskBoxBGMWin>();
System/MainInterfacePanel/TaskListTip.cs
@@ -390,6 +390,19 @@
        {
            MissionDetailDates xPack = taskmodel.allMissionDict[x];
            MissionDetailDates yPack = taskmodel.allMissionDict[y];
            bool IsMainTaskx = xPack.Type == 0;
            bool IsMainTasky = yPack.Type == 0;
            if (IsMainTaskx.CompareTo(IsMainTasky) != 0)//优先主线
            {
                return -IsMainTaskx.CompareTo(IsMainTasky);
            }
            bool IsStateTaskx = xPack.MissionState == 2;
            bool IsStateTasky = yPack.MissionState == 2;
            if (IsStateTaskx.CompareTo(IsStateTasky) != 0)//优先可领取
            {
                return -IsStateTaskx.CompareTo(IsStateTasky);
            }
            var _index0 = ListSort.IndexOf(xPack.Type);
            var _index1 = ListSort.IndexOf(yPack.Type);
            if (_index0.CompareTo(_index1) != 0)
@@ -407,6 +420,18 @@
        {
            MissionDetailDates xPack = taskmodel.allMissionDict[x];
            MissionDetailDates yPack = taskmodel.allMissionDict[y];
            bool IsMainTaskx = xPack.Type == 0;
            bool IsMainTasky = yPack.Type == 0;
            if (IsMainTaskx.CompareTo(IsMainTasky) != 0)//优先主线
            {
                return -IsMainTaskx.CompareTo(IsMainTasky);
            }
            bool IsStateTaskx = xPack.MissionState == 2;
            bool IsStateTasky = yPack.MissionState == 2;
            if (IsStateTaskx.CompareTo(IsStateTasky) != 0)//优先可领取
            {
                return -IsStateTaskx.CompareTo(IsStateTasky);
            }
            var _index0 = ListSort1.IndexOf(xPack.Type);
            var _index1 = ListSort1.IndexOf(yPack.Type);
            if (_index0.CompareTo(_index1) != 0)
System/WindowJump/WindowJumpMgr.cs
@@ -48,7 +48,7 @@
    ComposeWinModel composeModel { get { return ModelCenter.Instance.GetModel<ComposeWinModel>(); } }
    public bool IsJumpState { get; private set; }
    private int jumpPhase = 0;
    public int jumpPhase { get; private set;}
    public int jumpType { get; private set; }
    public void GetPreAllOpenWin()
    {