From c6355a680d3b61c45580c052b38bc6c1b726aa82 Mon Sep 17 00:00:00 2001
From: client_linchunjie <461730578@qq.com>
Date: 星期三, 29 八月 2018 17:56:46 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts

---
 Core/NetworkPackage/NetPkgCtl.cs                                                       |   33 ++++++
 Core/Editor/AssetBundleBrowser/AssetBundleBuildTab.cs                                  |   36 ++++++
 Core/NetworkPackage/DTCFile/ServerPack/HA4_Family/DTCA407_tagGCFamilyStoreItemClear.cs |    2 
 System/FairyAu/PlayerFairyAuTreasureData.cs                                            |   27 +++--
 System/Debug/DebugLogin.cs                                                             |  119 +++++++----------------
 System/FairyAu/WarehouseTipsWin.cs                                                     |   35 ++++++
 6 files changed, 154 insertions(+), 98 deletions(-)

diff --git a/Core/Editor/AssetBundleBrowser/AssetBundleBuildTab.cs b/Core/Editor/AssetBundleBrowser/AssetBundleBuildTab.cs
index b86cb35..55faed5 100644
--- a/Core/Editor/AssetBundleBrowser/AssetBundleBuildTab.cs
+++ b/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.
diff --git a/Core/NetworkPackage/DTCFile/ServerPack/HA4_Family/DTCA407_tagGCFamilyStoreItemClear.cs b/Core/NetworkPackage/DTCFile/ServerPack/HA4_Family/DTCA407_tagGCFamilyStoreItemClear.cs
index cedc90b..cdc7bdf 100644
--- a/Core/NetworkPackage/DTCFile/ServerPack/HA4_Family/DTCA407_tagGCFamilyStoreItemClear.cs
+++ b/Core/NetworkPackage/DTCFile/ServerPack/HA4_Family/DTCA407_tagGCFamilyStoreItemClear.cs
@@ -17,7 +17,7 @@
             {
                 playerFairyAuTreasureData.FamilyStoreDel(vNetData.IndexList[i], vNetData.ClearType);
             }
-            playerFairyAuTreasureData.WarehouseToRefresh();
+            playerFairyAuTreasureData.WarehouseToRefresh(vNetData.IndexList);
         }
     }

 }

diff --git a/Core/NetworkPackage/NetPkgCtl.cs b/Core/NetworkPackage/NetPkgCtl.cs
index 1aeeda8..bc893b2 100644
--- a/Core/NetworkPackage/NetPkgCtl.cs
+++ b/Core/NetworkPackage/NetPkgCtl.cs
@@ -3,6 +3,7 @@
 using UnityEngine;
 using System;
 using System.Text;
+using System.IO;
 
 public class NetPkgCtl
 {
@@ -79,6 +80,38 @@
     {
         return _tempNetPkgLst;
     }
+
+    public static void WriteAllNetLog()
+    {
+        if (_typeLst != null)
+        {
+            var count = 0;
+            var lines = new List<string>();
+            for (int i = _typeLst.Count - 1; i >= 0; i--)
+            {
+                if (count > 20000)
+                {
+                    break;
+                }
+
+                var package = _typeLst[i];
+                var line = string.Empty;
+                line = StringUtility.Contact(package.NetPkgTp == NetPkgType.Client ? "銆愬彂閫併��" : "銆愭帴鏀躲��", package.SendOrGetTime, ":", package.GameNetName, "\r\n");
+                if (package.fieldDetails != null)
+                {
+                    for (int j = 0; j < package.fieldDetails.Count; j++)
+                    {
+                        line = StringUtility.Contact(line, "\t\t\t", package.fieldDetails[j], "\r\n");
+                    }
+                }
+
+                lines.Add(line);
+                count++;
+            }
+
+            File.WriteAllLines(Application.dataPath + "/PackageLogs" + "_" + DateTime.Now.ToString("HH_mm_ss") + ".txt", lines.ToArray());
+        }
+    }
 }
 
 public class NetPkg
diff --git a/System/Debug/DebugLogin.cs b/System/Debug/DebugLogin.cs
index 65257ae..8fb0fda 100644
--- a/System/Debug/DebugLogin.cs
+++ b/System/Debug/DebugLogin.cs
@@ -1,100 +1,65 @@
-锘縰sing System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-using UnityEngine.UI;
-using Snxxz.UI;
-using LitJson;
-
+锘縰sing 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;
 
+        if (!string.IsNullOrEmpty(appid.text))
+        {
+            VersionConfig.Get().m_AppId = appid.text;
+        }
+
         if (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,
@@ -105,6 +70,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 +109,9 @@
                 };
 
                 SDKUtility.Instance.FreePlatformCheckIDAuthentication(result.account);
-
-                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,
-                };
-
+                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
@@ -175,5 +134,5 @@
         public string token_expire;
         public string phone;
         public string account_id;
-    }
-}
+    }
+}
diff --git a/System/FairyAu/PlayerFairyAuTreasureData.cs b/System/FairyAu/PlayerFairyAuTreasureData.cs
index 4b5060b..db52f3c 100644
--- a/System/FairyAu/PlayerFairyAuTreasureData.cs
+++ b/System/FairyAu/PlayerFairyAuTreasureData.cs
@@ -55,9 +55,10 @@
     public static event OnFamilyActionInfo Event_FamilyActionInfo;//瀹舵棌琛屼负淇℃伅鐨勫埛鏂�
     public delegate void OnFamilyStoreItemInfo();
     public static event OnFamilyStoreItemInfo Event_FamilyStoreItemInfo;//浠撳簱淇℃伅鐨勫埛鏂�
+    public static event Action<List<int>> Del_FamilyStoreItemInfo;//浠撳簱淇℃伅鐗╁搧鐨勫垹闄�
     public int _FairyAuIntegral = 0;//鑾峰彇浠欑洘绉垎
 
-    public int JumpItemID = 0;//璺宠浆鑾峰彇ID
+    public int JumpItemID = 0;//
     public override void Init()
     {
         
@@ -113,16 +114,22 @@
 
 
 
-    }
-
-    public void WarehouseToRefresh()//浠撳簱鍒锋柊
-    {
-        if (Event_FamilyStoreItemInfo != null)
-        {
-            Event_FamilyStoreItemInfo();
+    }
+    List<int> List = new List<int>();
+    public void WarehouseToRefresh(byte [] _list)//浠撳簱鍒锋柊
+    {
+        List.Clear();
+        for (int i = 0; i < _list.Length; i++)
+        {
+            List.Add(_list[i]+1);
         }
-           
-
+        if (Del_FamilyStoreItemInfo != null)
+        {
+            Del_FamilyStoreItemInfo(List);
+        }
+
+
+
     }
     public void FamilyStoreDel(int _index ,int ClearType)//瀹舵棌浠撳簱鐗╁搧鍒犻櫎(娓呴櫎鐨勬牸瀛愮储寮�, 浠呭崟鏍煎瓙娓呴櫎鏃舵湁鏁�,浠�0寮�濮嬩唬琛ㄧ涓�鏍�,0-鍗曟牸瀛愭竻闄�; 1-鎵�鏈夌墿鍝佹竻闄�)
     {
diff --git a/System/FairyAu/WarehouseTipsWin.cs b/System/FairyAu/WarehouseTipsWin.cs
index 6a256ef..f4e97d3 100644
--- a/System/FairyAu/WarehouseTipsWin.cs
+++ b/System/FairyAu/WarehouseTipsWin.cs
@@ -111,6 +111,7 @@
             _FamilyPosition = (int)PlayerDatas.Instance.fairyData.mine.FamilyLV;
             PlayerFairyAuTreasureData.Event_FairyAuIntegral += FairyAuIntegral;//浠欑洘绉垎鍒锋柊
             PlayerFairyAuTreasureData.Event_FamilyStoreItemInfo += FamilyStoreItemInfo;//浠撳簱淇℃伅鍒锋柊
+            PlayerFairyAuTreasureData.Del_FamilyStoreItemInfo += Del_FamilyStoreItemInfo;//浠撳簱鐗╁搧鍒犻櫎
             PlayerFairyAuTreasureData.Event_FamilyActionInfo += FamilyActionInfo;//瀹舵棌琛屼负淇℃伅鍒锋柊
             _GridlineCtrl.OnRefreshCell += OnRefreshGridCell;
             _bool = false;
@@ -149,6 +150,7 @@
             PlayerFairyAuTreasureData.Event_FairyAuIntegral -= FairyAuIntegral;//浠欑洘绉垎鍒锋柊
             PlayerFairyAuTreasureData.Event_FamilyStoreItemInfo -= FamilyStoreItemInfo;//浠撳簱淇℃伅鍒锋柊
             PlayerFairyAuTreasureData.Event_FamilyActionInfo -= FamilyActionInfo;//瀹舵棌琛屼负淇℃伅鍒锋柊
+            PlayerFairyAuTreasureData.Del_FamilyStoreItemInfo -= Del_FamilyStoreItemInfo;//浠撳簱鐗╁搧鍒犻櫎
             _GridlineCtrl.OnRefreshCell -= OnRefreshGridCell;
         }
 
@@ -265,6 +267,7 @@
                 _CA610.StoreItemIndex = (byte)(_indexList);
                 _CA610.ItemID = (uint)_WPID;
                 _CA610.ExcangeCount = 1;
+                ClearItemID(_indexList);
                 GameNetSystem.Instance.SendInfo(_CA610);
                 KnapSackEventMgr.Instance.HideItemPopWin();
             }
@@ -911,6 +914,20 @@
             SetItemID();//鑾峰彇楂樹寒鐗规晥鐗╁搧ID
             _GridlineCtrl.m_Scorller.RefreshActiveCellViews();//鍒锋柊褰撳墠鍙
         }
+
+        void Del_FamilyStoreItemInfo(List<int> List)//鐗╁搧鍒犻櫎
+        {
+            QueryFamilyAction();//瀹舵棌琛屼负淇℃伅鏌ヨ      
+            _listArray.Clear();
+            foreach (int key in playerFairyAuTreasureData._DicfamilyStoreItem.Keys)
+            {
+                _listArray.Add(key);
+            }
+            SetItemID();//鑾峰彇楂樹寒鐗规晥鐗╁搧ID
+            _GridlineCtrl.m_Scorller.RefreshActiveCellViews();//鍒锋柊褰撳墠鍙
+
+        }
+
         void FamilyActionInfo()
         {
             _listArray.Clear();
@@ -1003,6 +1020,7 @@
             int Order = 0;//闃舵暟
             int Color = 0;//棰滆壊
             int Star = 0;//棰滆壊
+            int EquipPlace = 0;//瑁呭浣嶇疆
             if (playerFairyAuTreasureData.JumpItemID == 0)
             {
                 return;
@@ -1016,21 +1034,32 @@
             Order = itemconfig.LV;
             Color = itemconfig.ItemColor;
             Star = itemconfig.StarLevel;
+            EquipPlace = itemconfig.EquipPlace;
             foreach (var key in playerFairyAuTreasureData._DicfamilyStoreItem.Keys)
             {
-                var item_config = Config.Instance.Get<ItemConfig>(key);
-                if (item_config.EquipPlace == 0 && item_config.EquipPlace > 10)
+                var Item_ID = playerFairyAuTreasureData._DicfamilyStoreItem[key].ItemID;
+                var item_config = Config.Instance.Get<ItemConfig>(Item_ID);
+                if (item_config==null && item_config.EquipPlace == 0 && item_config.EquipPlace > 10)
                 {
                     continue;
                 }
                 if (item_config.LV >= Order && item_config.ItemColor >= Color
-                    && item_config.StarLevel >= Star && PlayerDatas.Instance.baseData.Job == item_config.JobLimit / 100)
+                    && item_config.StarLevel >= Star && EquipPlace == item_config.EquipPlace
+                    && PlayerDatas.Instance.baseData.Job == item_config.JobLimit / 100)
                 {
                     DicHighlight.Add(key,1);
                 }
             }
 
         }
+
+        private void ClearItemID(int Index)
+        {
+            if (DicHighlight.ContainsKey(Index))
+            {
+                DicHighlight.Clear();
+            }
+        }
     }
 }
 

--
Gitblit v1.8.0