From 67c4ca84c9f1517ecc603f4cf9f7859f1802e8fb Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期一, 26 五月 2025 15:55:18 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts
---
Main/NetworkPackage/ServerPack/HA2_Package/HA204_tagMCVPackRefresh.cs.meta | 12
Main/System/Equip/EquipSuitEffect.cs.meta | 12
Main/Message.meta | 8
Main/NetworkPackage/ClientPack/ClientToGameServer/CA9_Function.meta | 8
Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0706_tagUseItemSuccess.cs.meta | 12
Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0725_tagRolePackRefreshEx.cs | 42
Main/NetworkPackage/ClientPack/ClientToMapServer/C03_MainCharacter/C030A_tagCChangeAttackMode.cs.meta | 12
Main/NetworkPackage/DTCFile/ServerPack/HA8_Item.meta | 8
Main/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA362_tagMCMailList.cs.meta | 11
Main/NetworkPackage/ServerPack/H02_PlayerTalk/H0212_tagNotifyCode.cs.meta | 8
Main/NetworkPackage/ServerPack/HA3_Function/HA363_tagMCMailStateChange.cs | 29
Main/NetworkPackage/DTCFile/ServerPack/H01_System/DTC0102_tagCDBPlayer.cs.meta | 12
Main/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA363_tagMCMailStateChange.cs.meta | 11
Main/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA537_tagCMRequestMail.cs | 20
Main/System/Equip.meta | 8
Main/System/KnapSack/Logic/CommonGetItem.cs.meta | 11
Main/System/KnapSack/Logic/CommonGetItemWin.cs | 126
Main/NetworkPackage/ServerPack/H07_PlayerItem/H0724_tagRolePackCanUseCount.cs | 35
Main/System/GMCommand/GMInputWin.cs | 191
Main/System/GMCommand/MoveObj.cs.meta | 12
Main/System/KnapSack/Logic.meta | 8
Main/NetworkPackage/ServerPack/H07_PlayerItem.meta | 8
Main/NetworkPackage/ServerPack/H07_PlayerItem/H0707_tagItemCountRefresh.cs | 21
Main/System/GMCommand/GMCmdModel.cs | 100
Main/System/KnapSack/New/CommonItemBaisc.cs | 375 +
Main/NetworkPackage/DTCFile/ServerPack/H03_MainCharacter/DTC0316_tagPackResetOK.cs.meta | 8
Main/System/KnapSack/New/ItemCell.cs | 76
Main/NetworkPackage/ServerPack/H04_Scene/H0403_tagPlayerLoginLoadOK.cs.meta | 8
Main/System/KnapSack/Logic/ItemModel.cs | 189
Main/Message/SysNotifyMgr.cs.meta | 12
Main/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA363_tagMCMailStateChange.cs | 10
Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0724_tagRolePackCanUseCount.cs.meta | 12
Main/NetworkPackage/ServerPack/H07_PlayerItem/H0704_tagRolePackRefresh.cs.meta | 12
Main/System/GatheringSoul.meta | 8
Main/NetworkPackage/DTCFile/ServerPack/H01_System/DTC0102_tagCDBPlayer.cs | 259 +
Main/NetworkPackage/DTCFile/ServerPack/H02_PlayerTalk/DTC0212_tagNotifyCode.cs.meta | 12
Main/NetworkPackage/ServerPack.meta | 8
Main/NetworkPackage/ServerPack/H07_PlayerItem/H0711_tagClearItemPack.cs.meta | 8
Main/Core/GameEngine/Common.meta | 8
Main/NetworkPackage/ClientPack/ClientToMapServer/C03_MainCharacter/C030A_tagCChangeAttackMode.cs | 20
Main/NetworkPackage/DTCFile/ServerPack/H03_MainCharacter/DTC0316_tagPackResetOK.cs | 19
Main/NetworkPackage/ServerPack/HA2_Package/HA205_tagMCVPackClear.cs | 21
Main/NetworkPackage/ServerPack/H04_Scene.meta | 8
Main/System/GMCommand.meta | 8
Main/System/KnapSack.meta | 8
Main/NetworkPackage/DTCFile/ServerPack/HA2_Package/DTCA205_tagMCVPackClear.cs.meta | 12
Main/NetworkPackage/ServerPack/H07_PlayerItem/H0707_tagItemCountRefresh.cs.meta | 8
Main/NetworkPackage/ServerPack/H07_PlayerItem/H0724_tagRolePackCanUseCount.cs.meta | 12
Main/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA537_tagCMRequestMail.cs.meta | 11
Main/NetworkPackage/ClientPack/ClientToGameServer/CA9_Function/CA9A1_tagCGQueryCompensation.cs.meta | 11
Main/NetworkPackage/DTCFile/ServerPack/HA8_Item/DTCA809_tagMCItemDayUseCntInfo.cs.meta | 11
Main/NetworkPackage/DTCFile/ServerPack/HA2_Package.meta | 8
Main/NetworkPackage/ServerPack/H02_PlayerTalk.meta | 8
Main/System/Backpack.meta | 8
Main/System/KnapSack/Logic/CommonGetItemWin.cs.meta | 11
Main/NetworkPackage/ServerPack/H07_PlayerItem/H0725_tagRolePackRefreshEx.cs.meta | 12
Main/NetworkPackage/DTCFile/ServerPack/H02_PlayerTalk.meta | 8
Main/System/GatheringSoul/VirtualPackModel.cs.meta | 12
Main/NetworkPackage/DTCFile.meta | 8
Main/NetworkPackage/ServerPack/H07_PlayerItem/H0709_tagClearItem.cs | 39
Main/Utility/UIUtility.cs | 2
Main/Component/UI/Common/ItemBaseEffect.cs | 276
Main/Mail.meta | 8
Main/NetworkPackage/ServerPack/H07_PlayerItem/H0711_tagClearItemPack.cs | 21
Main/System/GMCommand/MoveObj.cs | 54
Main/NetworkPackage/ServerPack/HA3_Function/HA362_tagMCMailList.cs.meta | 11
Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0704_tagRolePackRefresh.cs | 40
Main/NetworkPackage/ServerPack/H03_MainCharacter/H0316_tagPackResetOK.cs | 17
Main/Utility/GMCommand.cs.meta | 12
Main/Message/MessageWin.cs.meta | 12
Main/System/KnapSack/Logic/CommonGetItemCell.cs.meta | 11
Main/Mail/MailModel.cs | 258 +
Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0725_tagRolePackRefreshEx.cs.meta | 12
Main/System/KnapSack/KnapsackTimeCDMgr.cs | 282 +
Main/NetworkPackage/ClientPack/ClientToMapServer/CA3_Item/CA32D_tagCMDecomposeSeting.cs.meta | 11
Main/NetworkPackage/ServerPack/H03_MainCharacter.meta | 8
Main/System/ItemTip/ItemTipUtility.cs | 2035 +++++++++
Main/NetworkPackage/ServerPack/H07_PlayerItem/H0706_tagUseItemSuccess.cs | 39
Main/NetworkPackage/ServerPack/H01_System.meta | 8
Main/System/GMCommand/GMCmdPanel.cs | 96
Main/Utility/StageLoadTimeOutCatcher.cs.meta | 12
Main/NetworkPackage/ClientPack/ClientToMapServer/C03_MainCharacter.meta | 8
Main/System/KnapSack/KnapsackTimeCDMgr.cs.meta | 12
Main/System/KnapSack/New/CommonItemBaisc.cs.meta | 12
Main/NetworkPackage/ClientPack/ClientToGameServer.meta | 8
Main/NetworkPackage/DTCFile/ServerPack.meta | 8
Main/System/KnapSack/Logic/ItemModel.cs.meta | 12
Main/NetworkPackage/ServerPack/HA3_Function.meta | 8
Main/NetworkPackage/DTCFile/ServerPack/HA2_Package/DTCA205_tagMCVPackClear.cs | 19
Main/NetworkPackage/DTCFile/ServerPack/HA8_Item/DTCA809_tagMCItemDayUseCntInfo.cs | 13
Main/System/KnapSack/New/ItemCell.cs.meta | 12
Main/NetworkPackage/DTCFile/ServerPack/HA2_Package/DTCA204_tagMCVPackRefresh.cs.meta | 12
Main/System/Message/TextUnline.cs | 87
Main/NetworkPackage/ServerPack/HA2_Package/HA204_tagMCVPackRefresh.cs | 59
Main/System/ItemTip.meta | 8
Main/System/GMCommand/GMCmdPanel.cs.meta | 12
Main/System/KnapSack/Logic/SinglePack.cs.meta | 11
Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem.meta | 8
Main/NetworkPackage/DTCFile/ServerPack/H01_System.meta | 8
Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0709_tagClearItem.cs.meta | 12
Main/NetworkPackage/ServerPack/HA8_Item/HA801_tagMCGiveAwardInfo.cs.meta | 11
Main/NetworkPackage/ServerPack/H07_PlayerItem/H0725_tagRolePackRefreshEx.cs | 49
Main/System/GMCommand/GMInputWin.cs.meta | 12
Main/System/Backpack/BackpackData.cs.meta | 12
Main/NetworkPackage/ServerPack/HA2_Package/HA205_tagMCVPackClear.cs.meta | 12
Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0704_tagRolePackRefresh.cs.meta | 12
Main/NetworkPackage/ServerPack/H07_PlayerItem/H0704_tagRolePackRefresh.cs | 39
Main/NetworkPackage/ServerPack/HA3_Function/HA362_tagMCMailList.cs | 65
Main/NetworkPackage/DTCFile/ServerPack/HA2_Package/DTCA206_tagMCAutoItemCountRefresh.cs.meta | 11
Main/NetworkPackage/ClientPack/ClientToMapServer/C32_GM/C320C_tagCGMCMD.cs.meta | 12
Main/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA362_tagMCMailList.cs | 10
Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0709_tagClearItem.cs | 33
Main/System/ItemTip/ItemTipUtility.cs.meta | 12
Main/System/Equip/EquipSuitEffect.cs | 108
Main/Mail/MailModel.cs.meta | 11
Main/Message/SysNotifyMgr.cs | 297 +
Main/NetworkPackage/ServerPack/HA2_Package.meta | 8
Main/System/Message/TextUnline.cs.meta | 12
Main/NetworkPackage/ClientPack/ClientToMapServer/CA3_Item.meta | 8
Main/NetworkPackage/DTCFile/ServerPack/HA8_Item/DTCA801_tagMCGiveAwardInfo.cs.meta | 11
Main/NetworkPackage/ServerPack/HA3_Function/HA363_tagMCMailStateChange.cs.meta | 11
Main/NetworkPackage/ClientPack/ClientToMapServer/C32_GM/C320C_tagCGMCMD.cs | 35
Main/System/MainInterfacePanel/MainRedDot.cs | 1
Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0706_tagUseItemSuccess.cs | 15
Main/NetworkPackage/DTCFile/ServerPack/HA2_Package/DTCA202_tagMCAttackMode.cs.meta | 12
Main/NetworkPackage/DTCFile/ServerPack/H02_PlayerTalk/DTC0212_tagNotifyCode.cs | 29
Main/System/KnapSack/Logic/CommonGetItemCell.cs | 35
Main/NetworkPackage/ClientPack.meta | 8
Main/NetworkPackage/DTCFile/ServerPack/H03_MainCharacter.meta | 8
Main/NetworkPackage/DTCFile/ServerPack/HA2_Package/DTCA206_tagMCAutoItemCountRefresh.cs | 13
Main/NetworkPackage/DTCFile/ServerPack/H04_Scene/DTC0403_tagPlayerLoginLoadOK.cs | 123
Main/System/KnapSack/New.meta | 8
Main/NetworkPackage/ServerPack/H04_Scene/H0403_tagPlayerLoginLoadOK.cs | 31
Main/NetworkPackage/DTCFile/ServerPack/H04_Scene.meta | 8
Main/System/KnapSack/Logic/ItemLogicUtility.cs | 1828 ++++++++
Main/NetworkPackage/ServerPack/H02_PlayerTalk/H0212_tagNotifyCode.cs | 66
Main/NetworkPackage/ServerPack/HA8_Item/HA809_tagMCItemDayUseCntInfo.cs.meta | 11
Main/Core/GameEngine/Common/Equation.cs.meta | 12
Main/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function.meta | 8
Main/NetworkPackage/ServerPack/H07_PlayerItem/H0709_tagClearItem.cs.meta | 8
Main/NetworkPackage/ClientPack/ClientToMapServer.meta | 8
Main/NetworkPackage/DTCFile/ServerPack/H04_Scene/DTC0403_tagPlayerLoginLoadOK.cs.meta | 12
Main/NetworkPackage/ServerPack/HA2_Package/HA202_tagMCAttackMode.cs | 17
Main/NetworkPackage/ServerPack/HA8_Item.meta | 8
Main/System/KnapSack/Logic/SinglePack.cs | 388 +
Main/NetworkPackage/ServerPack/HA2_Package/HA202_tagMCAttackMode.cs.meta | 11
Main/Message/MessageWin.cs | 288 +
Main/NetworkPackage/ServerPack/HA2_Package/HA206_tagMCAutoItemCountRefresh.cs | 29
Main/NetworkPackage/ClientPack/ClientToMapServer/C32_GM.meta | 8
Main/NetworkPackage/ServerPack/H03_MainCharacter/H0316_tagPackResetOK.cs.meta | 8
Main/NetworkPackage/ServerPack/HA8_Item/HA809_tagMCItemDayUseCntInfo.cs | 29
Main/System/Backpack/BackpackData.cs | 80
Main/System/GatheringSoul/VirtualPackModel.cs | 363 +
Main/System/KnapSack/Logic/PackModel.cs | 1899 ++++++++
Main/Utility/GMCommand.cs | 35
Main/NetworkPackage/DTCFile/ServerPack/HA2_Package/DTCA204_tagMCVPackRefresh.cs | 17
Main/NetworkPackage/ServerPack/HA8_Item/HA801_tagMCGiveAwardInfo.cs | 57
Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0711_tagClearItemPack.cs.meta | 12
Main/NetworkPackage/ServerPack/H07_PlayerItem/H0706_tagUseItemSuccess.cs.meta | 8
Main/Core/GameEngine/Common/Equation.cs | 458 ++
Main/NetworkPackage/DTCFile/ServerPack/HA3_Function.meta | 8
Main/System/KnapSack/Logic/PackModel.cs.meta | 12
Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0707_tagItemCountRefresh.cs | 19
Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0711_tagClearItemPack.cs | 17
Main/System/KnapSack/Logic/ItemLogicUtility.cs.meta | 12
Main/NetworkPackage/ClientPack/ClientToMapServer/CA3_Item/CA32D_tagCMDecomposeSeting.cs | 18
Main/System/KnapSack/Logic/CommonGetItem.cs | 27
Main/Utility/StageLoadTimeOutCatcher.cs | 105
Main/NetworkPackage/ClientPack/ClientToGameServer/CA9_Function/CA9A1_tagCGQueryCompensation.cs | 15
Main/NetworkPackage/ServerPack/HA2_Package/HA206_tagMCAutoItemCountRefresh.cs.meta | 11
Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0707_tagItemCountRefresh.cs.meta | 12
Main/NetworkPackage/DTCFile/ServerPack/HA8_Item/DTCA801_tagMCGiveAwardInfo.cs | 13
Main/System/GMCommand/GMCmdModel.cs.meta | 12
Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0724_tagRolePackCanUseCount.cs | 17
Main/NetworkPackage/DTCFile/ServerPack/HA2_Package/DTCA202_tagMCAttackMode.cs | 40
Main/NetworkPackage/ServerPack/H01_System/H0102_tagCDBPlayer.cs | 215 +
Main/NetworkPackage/ServerPack/H01_System/H0102_tagCDBPlayer.cs.meta | 8
177 files changed, 12,719 insertions(+), 139 deletions(-)
diff --git a/Main/Component/UI/Common/ItemBaseEffect.cs b/Main/Component/UI/Common/ItemBaseEffect.cs
index 6e642cf..82aee4f 100644
--- a/Main/Component/UI/Common/ItemBaseEffect.cs
+++ b/Main/Component/UI/Common/ItemBaseEffect.cs
@@ -1,157 +1,157 @@
-锘�// using System.Collections;
-// using System.Collections.Generic;
-// using UnityEngine;
-// namespace vnxbqy.UI
-// {
-// public class ItemBaseEffect : MonoBehaviour
-// {
-// [SerializeField] UIEffect m_SuitEffect;
+锘縰sing System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+namespace vnxbqy.UI
+{
+ public class ItemBaseEffect : MonoBehaviour
+ {
+ [SerializeField] UIEffect m_SuitEffect;
-// int itemId = 0;
+ int itemId = 0;
-// private void OnEnable()
-// {
-// Display(itemId);
-// }
+ private void OnEnable()
+ {
+ Display(itemId);
+ }
-// public void Display(int itemId, bool dirty = false)
-// {
-// this.itemId = itemId;
-// var curItem = ItemConfig.Get(this.itemId);
-// bool isPlay = true;
-// if (curItem == null)
-// {
-// isPlay = false;
-// return;
-// }
+ public void Display(int itemId, bool dirty = false)
+ {
+ this.itemId = itemId;
+ var curItem = ItemConfig.Get(this.itemId);
+ bool isPlay = true;
+ if (curItem == null)
+ {
+ isPlay = false;
+ return;
+ }
-// int effectId = 0;
-// switch (curItem.ItemColor)
-// {
-// case 4:
-// effectId = 7119;
-// break;
-// case 5:
-// effectId = 7120;
-// break;
-// case 6:
-// case 7:
-// case 8:
-// effectId = 7121;
-// break;
-// }
+ int effectId = 0;
+ switch (curItem.ItemColor)
+ {
+ case 4:
+ effectId = 7119;
+ break;
+ case 5:
+ effectId = 7120;
+ break;
+ case 6:
+ case 7:
+ case 8:
+ effectId = 7121;
+ break;
+ }
-// if (curItem.BaseEffectID != 0)
-// {
-// effectId = curItem.BaseEffectID;
-// }
+ if (curItem.BaseEffectID != 0)
+ {
+ effectId = curItem.BaseEffectID;
+ }
-// if (m_SuitEffect.effect != effectId)
-// {
-// //鍚屼竴涓綅缃浛鎹㈢壒鏁堥渶瑕佸厛閲婃斁
-// m_SuitEffect.StopImediatly();
-// }
-// m_SuitEffect.effect = effectId;
+ if (m_SuitEffect.effect != effectId)
+ {
+ //鍚屼竴涓綅缃浛鎹㈢壒鏁堥渶瑕佸厛閲婃斁
+ m_SuitEffect.StopImediatly();
+ }
+ m_SuitEffect.effect = effectId;
-// if (m_SuitEffect.effect == 0)
-// {
-// isPlay = false;
-// }
-// if (isPlay)
-// {
-// m_SuitEffect.Play();
-// }
-// else
-// {
-// m_SuitEffect.StopImediatly();
-// }
+ if (m_SuitEffect.effect == 0)
+ {
+ isPlay = false;
+ }
+ if (isPlay)
+ {
+ m_SuitEffect.Play();
+ }
+ else
+ {
+ m_SuitEffect.StopImediatly();
+ }
-// if (dirty)
-// {
-// SnxxzGame.Instance.StartCoroutine(Co_SetOrder(this, transform as RectTransform));
-// }
-// }
+ // if (dirty)
+ // {
+ // SnxxzGame.Instance.StartCoroutine(Co_SetOrder(this, transform as RectTransform));
+ // }
+ }
-// public static ItemBaseEffect Create(RectTransform transform)
-// {
-// var go = UIUtility.CreateWidget("ItemBaseEffect", "ItemBaseEffect");
-// var behaviour = go.GetComponent<ItemBaseEffect>();
+ public static ItemBaseEffect Create(RectTransform transform)
+ {
+ var go = UIUtility.CreateWidget("ItemBaseEffect", "ItemBaseEffect");
+ var behaviour = go.GetComponent<ItemBaseEffect>();
-// SnxxzGame.Instance.StartCoroutine(Co_SetOrder(behaviour, transform));
+ // SnxxzGame.Instance.StartCoroutine(Co_SetOrder(behaviour, transform));
-// var scale = 1f;
-// var itemBasic = transform.GetComponentInParent<CommonItemBaisc>();
-// if (itemBasic == null)
-// itemBasic = transform.GetComponentInParent<ItemCell>();
-// if (itemBasic != null)
-// {
-// scale = GetEffectScale(itemBasic.format);
-// }
-// else
-// {
-// var itemBehaviour = transform.GetComponentInParent<ItemBehaviour>();
-// if (itemBehaviour != null)
-// {
-// if (itemBehaviour.backGround != null)
-// {
-// var size = itemBehaviour.backGround.rectTransform.rect.width;
-// scale = size / 84;
-// }
-// }
-// else
-// {
-// var findPreciousItemBehaviour = transform.GetComponentInParent<FindPreciousItemBehaviour>();
-// if (findPreciousItemBehaviour != null)
-// {
-// scale = 0.86f; //鏆備笖鍐欐
-// }
-// }
-// }
+ var scale = 1f;
+ var itemBasic = transform.GetComponentInParent<CommonItemBaisc>();
+ if (itemBasic == null)
+ itemBasic = transform.GetComponentInParent<ItemCell>();
+ if (itemBasic != null)
+ {
+ scale = GetEffectScale(itemBasic.format);
+ }
+ // else
+ // {
+ // var itemBehaviour = transform.GetComponentInParent<ItemBehaviour>();
+ // if (itemBehaviour != null)
+ // {
+ // if (itemBehaviour.backGround != null)
+ // {
+ // var size = itemBehaviour.backGround.rectTransform.rect.width;
+ // scale = size / 84;
+ // }
+ // }
+ // else
+ // {
+ // var findPreciousItemBehaviour = transform.GetComponentInParent<FindPreciousItemBehaviour>();
+ // if (findPreciousItemBehaviour != null)
+ // {
+ // scale = 0.86f; //鏆備笖鍐欐
+ // }
+ // }
+ // }
-// var rect = go.transform as RectTransform;
-// go.transform.SetParentEx(transform, Vector3.zero, Quaternion.identity, Vector3.one);
-// rect.MatchWhith(transform);
-// go.transform.localScale = Vector3.one * scale;
-// go.transform.SetAsLastSibling();
+ var rect = go.transform as RectTransform;
+ go.transform.SetParentEx(transform, Vector3.zero, Quaternion.identity, Vector3.one);
+ rect.MatchWhith(transform);
+ go.transform.localScale = Vector3.one * scale;
+ go.transform.SetAsLastSibling();
-// return behaviour;
-// }
+ return behaviour;
+ }
-// static IEnumerator Co_SetOrder(ItemBaseEffect behaviour, RectTransform transform)
-// {
-// yield return null;
+ static IEnumerator Co_SetOrder(ItemBaseEffect behaviour, RectTransform transform)
+ {
+ yield return null;
-// if (transform == null || behaviour == null)
-// {
-// yield break;
-// }
+ if (transform == null || behaviour == null)
+ {
+ yield break;
+ }
-// Canvas canva = transform.GetComponentInParent<Canvas>();
-// if (canva != null)
-// {
-// behaviour.m_SuitEffect.ResetOrder(canva.sortingOrder + 1);
-// }
+ Canvas canva = transform.GetComponentInParent<Canvas>();
+ if (canva != null)
+ {
+ behaviour.m_SuitEffect.ResetOrder(canva.sortingOrder + 1);
+ }
-// if (behaviour.m_SuitEffect.maskArea == null)
-// {
-// behaviour.m_SuitEffect.SetMask();
-// }
-// }
+ if (behaviour.m_SuitEffect.maskArea == null)
+ {
+ behaviour.m_SuitEffect.SetMask();
+ }
+ }
-// static float GetEffectScale(ItemCellformat format)
-// {
-// switch (format)
-// {
-// case ItemCellformat.Format_80x80:
-// return 0.95f;
-// case ItemCellformat.Format_70x70:
-// return 0.83f;
-// case ItemCellformat.Format_64x64:
-// return 0.76f;
-// default:
-// return 1f;
-// }
-// }
-// }
-// }
+ static float GetEffectScale(ItemCellformat format)
+ {
+ switch (format)
+ {
+ case ItemCellformat.Format_80x80:
+ return 0.95f;
+ case ItemCellformat.Format_70x70:
+ return 0.83f;
+ case ItemCellformat.Format_64x64:
+ return 0.76f;
+ default:
+ return 1f;
+ }
+ }
+ }
+}
diff --git a/Main/Core/GameEngine/Common.meta b/Main/Core/GameEngine/Common.meta
new file mode 100644
index 0000000..29b34bc
--- /dev/null
+++ b/Main/Core/GameEngine/Common.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 6b68b2e87cfa2fc48aff8e7f40a5c555
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Core/GameEngine/Common/Equation.cs b/Main/Core/GameEngine/Common/Equation.cs
new file mode 100644
index 0000000..31445db
--- /dev/null
+++ b/Main/Core/GameEngine/Common/Equation.cs
@@ -0,0 +1,458 @@
+锘縰sing System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Text;
+using System.Text.RegularExpressions;
+using UnityEngine;
+
+
+public class Equation : Singleton<Equation>
+{
+ public static readonly List<char> operatorList = new List<char>() { '*', '-', '+', '/', '^', '!', '@', '%', ';', '#', '$', '~', '&' };
+
+ public static StringBuilder textBuilder = new StringBuilder();
+
+ private List<KeyValuePair<string, string>> keyValueDic = new List<KeyValuePair<string, string>>();
+
+ public readonly Regex replaecRegex = new Regex(@"[a-zA-Z]{2,50}");
+
+ public T Eval<T>(string equation) where T : struct
+ {
+ keyValueDic.Sort(Compare);
+ equation = GetEquation(equation);
+ T val = default(T);
+ try
+ {
+ EquationParse equationParse = new EquationParse(equation);
+ val = (T)Convert.ChangeType(equationParse.result, typeof(T));
+ equationParse = null;
+ }
+ catch (Exception e)
+ {
+ Debug.LogError(e.Message);
+ }
+ return val;
+ }
+
+ private string GetEquation(string equation)
+ {
+ try
+ {
+ MatchCollection matchArray = replaecRegex.Matches(equation);
+ textBuilder.Length = 0;
+ int length = 0;
+ if (matchArray != null)
+ {
+ for (int i = 0; i < matchArray.Count; i++)
+ {
+ Match match = matchArray[i];
+ textBuilder.Append(equation.Substring(length, match.Index - length));
+ length = match.Index + match.Length;
+ bool _replace = false;
+ for (int j = 0; j < keyValueDic.Count; j++)
+ {
+ if (match.Value.Equals(keyValueDic[j].Key))
+ {
+ textBuilder.Append(keyValueDic[j].Value);
+ _replace = true;
+ break;
+ }
+ }
+ if (!_replace)
+ {
+ textBuilder.Append(0);
+ }
+ }
+ }
+ textBuilder.Append(equation.Substring(length, equation.Length - length));
+ }
+ catch (Exception e)
+ {
+ Debug.Log(e.Message);
+ }
+ return textBuilder.ToString();
+ }
+
+ public void AddKeyValue(string key, object val)
+ {
+ int index = keyValueDic.FindIndex((x) => {
+ return x.Key == key;
+ });
+ if (index == -1)
+ {
+ KeyValuePair<string, string> keyValuePair = new KeyValuePair<string, string>(key, val.ToString());
+ keyValueDic.Add(keyValuePair);
+ }
+ }
+
+ public void Clear()
+ {
+ keyValueDic.Clear();
+ }
+
+ int Compare(KeyValuePair<string, string> x, KeyValuePair<string, string> y)
+ {
+ return -x.Key.Length.CompareTo(y.Key.Length);
+ }
+
+ public class EquationParse
+ {
+ public string equation { get; private set; }
+ public string result { get; private set; }
+ private StringBuilder equationBuilder = new StringBuilder();
+ private List<EquationParse> subEquations = new List<EquationParse>();
+ private List<OperatorType> operatorTypeList = new List<OperatorType>();
+ private List<string> values = new List<string>();
+ public EquationParse(string _equation)
+ {
+ this.equation = _equation;
+ this.result = string.Empty;
+ equationBuilder.Length = 0;
+ if (CheckSplit())
+ {
+ return;
+ }
+ Subsection();
+ GetResult();
+ }
+ private bool CheckSplit()
+ {
+ var _left = string.Empty;
+ var _right = string.Empty;
+ OperatorType _operatorType;
+ if (Split(equation, out _left, out _right, out _operatorType))
+ {
+ var _leftResult = new EquationParse(_left);
+ var _rightResult = new EquationParse(_right);
+ result = GetResult(_leftResult.result, _rightResult.result, _operatorType).ToString();
+ return true;
+ }
+ return false;
+ }
+ private void Subsection()
+ {
+ try
+ {
+ int bracketCnt = 0;
+ int startIndex = 0;
+ int length = 0;
+ int index = 0;
+ for (int i = 0; i < equation.Length; i++)
+ {
+ if (equation[i] == '(')
+ {
+ i = i + 1;
+ startIndex = i;
+ while (i < equation.Length && (equation[i] != ')' || bracketCnt > 0))
+ {
+ if (equation[i] == '(')
+ {
+ bracketCnt++;
+ }
+ else if (equation[i] == ')')
+ {
+ bracketCnt--;
+ }
+ length++;
+ i = i + 1;
+ }
+ subEquations.Add(new EquationParse(equation.Substring(startIndex, length)));
+ length = 0;
+ equationBuilder.Append('=');
+ equationBuilder.Append(index);
+ equationBuilder.Append('=');
+ index++;
+ continue;
+ }
+ equationBuilder.Append(equation[i]);
+ }
+ }
+ catch (Exception e)
+ {
+ Debug.Log(e.Message);
+ }
+ }
+
+ private void AnalysisEquation()
+ {
+ try
+ {
+ textBuilder.Length = 0;
+ for (int i = 0; i < subEquations.Count; i++)
+ {
+ equationBuilder.Replace(string.Format("={0}=", i), subEquations[i].result);
+ subEquations[i] = null;
+ }
+ subEquations.Clear();
+ var _result = equationBuilder.ToString();
+ char _lastChar = default(char);
+ for (int i = 0; i < _result.Length; i++)
+ {
+ if (i - 1 > 0 && _result[i - 1] == 'E')
+ {//杩囨护瓒呭ぇ鏁板�煎悗鐨勭鍙�
+ textBuilder.Append(_result[i]);
+ continue;
+ }
+ int index = operatorList.IndexOf(_result[i]);
+ if (index != -1 && _lastChar >= '0' && _lastChar <= '9')
+ {
+ values.Add(textBuilder.ToString());
+ textBuilder.Length = 0;
+ operatorTypeList.Add(GetOperatorType(_result[i]));
+ }
+ else
+ {
+ textBuilder.Append(_result[i]);
+ }
+ _lastChar = _result[i];
+ }
+ values.Add(textBuilder.ToString());
+ }
+ catch (Exception e)
+ {
+ Debug.Log(e.Message);
+ }
+ }
+
+ public void GetResult()
+ {
+ AnalysisEquation();
+ try
+ {
+ for (int i = 0; i < operatorTypeList.Count; i++)
+ {
+ if (IsPriorityOperator(operatorTypeList[i]))
+ {
+ double _result = 0;
+ if (IsUnaryOperator(operatorTypeList[i]))
+ {
+ _result = GetResult(values[i], string.Empty, operatorTypeList[i]);
+ }
+ else
+ {
+ _result = GetResult(values[i], values[i + 1], operatorTypeList[i]);
+ values.RemoveAt(i);
+ }
+ values.RemoveAt(i);
+ values.Insert(i, _result.ToString());
+ operatorTypeList.RemoveAt(i);
+ i--;
+ }
+ }
+ while (values.Count > 1 && operatorTypeList.Count > 0)
+ {
+ double _result = 0;
+ if (IsUnaryOperator(operatorTypeList[0]))
+ {
+ _result = GetResult(values[0], string.Empty, operatorTypeList[0]);
+ }
+ else
+ {
+ _result = GetResult(values[0], values[1], operatorTypeList[0]);
+ values.RemoveAt(0);
+ }
+ values.RemoveAt(0);
+ values.Insert(0, _result.ToString());
+ operatorTypeList.RemoveAt(0);
+ }
+ if (operatorTypeList.Count == 1 && IsUnaryOperator(operatorTypeList[0]))
+ {
+ result = GetResult(values[0], string.Empty, operatorTypeList[0]).ToString();
+ }
+ else
+ {
+ result = values[0];
+ }
+ }
+ catch (Exception e)
+ {
+ Debug.Log(e.Message);
+ }
+ }
+
+ public static double GetResult(string leftValue, string rightValue, OperatorType operatorType)
+ {
+ double _leftValue = 0, _rightValue = 0;
+ try
+ {
+ double.TryParse(leftValue, out _leftValue);
+ double.TryParse(rightValue, out _rightValue);
+ }
+ catch (Exception)
+ {
+ Debug.LogErrorFormat("瀛楃涓蹭笉鑳借浆涓烘暟鍊納0} {1}", leftValue, rightValue);
+ }
+ switch (operatorType)
+ {
+ case OperatorType.Plus:
+ return _leftValue + _rightValue;
+ case OperatorType.Subtract:
+ return _leftValue - _rightValue;
+ case OperatorType.Ride:
+ return _leftValue * _rightValue;
+ case OperatorType.Divide:
+ if (_rightValue == 0)
+ {
+ _rightValue = 1;
+ }
+ return _leftValue / _rightValue;
+ case OperatorType.Pow:
+ return Math.Pow(_leftValue, _rightValue);
+ case OperatorType.Min:
+ return Math.Min(_leftValue, _rightValue);
+ case OperatorType.Max:
+ return Math.Max(_leftValue, _rightValue);
+ case OperatorType.Remain:
+ return _leftValue % _rightValue;
+ case OperatorType.Random:
+ {
+ return UnityEngine.Random.Range((float)_leftValue, (float)_rightValue);
+ }
+ case OperatorType.Floor:
+ return Math.Floor(_leftValue);
+ case OperatorType.Ceil:
+ return Math.Ceiling((float)_leftValue);
+ case OperatorType.RandomInt:
+ {
+ return UnityEngine.Random.Range((int)_leftValue, (int)_rightValue);
+ }
+ case OperatorType.Sqrt:
+ return Math.Sqrt(_leftValue);
+
+ }
+ return 0;
+ }
+ public static OperatorType GetOperatorType(char _operator)
+ {
+ switch (_operator)
+ {
+ case '+':
+ return OperatorType.Plus;
+ case '-':
+ return OperatorType.Subtract;
+ case '*':
+ return OperatorType.Ride;
+ case '/':
+ return OperatorType.Divide;
+ case '^':
+ return OperatorType.Pow;
+ case '!':
+ return OperatorType.Min;
+ case '@':
+ return OperatorType.Max;
+ case '%':
+ return OperatorType.Remain;
+ case ';':
+ return OperatorType.Random;
+ case '#':
+ return OperatorType.Floor;
+ case '$':
+ return OperatorType.Ceil;
+ case '~':
+ return OperatorType.RandomInt;
+ case '&':
+ return OperatorType.Sqrt;
+ }
+ return OperatorType.Plus;
+ }
+ public static bool IsPriorityOperator(OperatorType operatorType)
+ {
+ if (operatorType == OperatorType.Plus || operatorType == OperatorType.Subtract)
+ {
+ return false;
+ }
+ return true;
+ }
+ public static bool IsUnaryOperator(OperatorType operatorType)
+ {
+ if (operatorType == OperatorType.Floor || operatorType == OperatorType.Ceil
+ || operatorType == OperatorType.Sqrt)
+ {
+ return true;
+ }
+ return false;
+ }
+
+ private static bool Split(string _source, out string _left, out string _right, out OperatorType _type)
+ {
+ _left = _right = string.Empty;
+ _type = OperatorType.Plus;
+ try
+ {
+ var _index = 0;
+ for (int i = _source.Length - 1; i >= 0; i--)
+ {
+ if (_source[i] == ')')
+ {
+ _index++;
+ continue;
+ }
+ else if (_source[i] == '(')
+ {
+ _index--;
+ continue;
+ }
+ if (IsSplitOperator(_source[i], out _type) && _index == 0)
+ {
+ _left = _source.Substring(0, i);
+ if (i + 1 < _source.Length)
+ {
+ _right = _source.Substring(i + 1);
+ }
+ return true;
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ Debug.Log(e.Message);
+ }
+ return false;
+ }
+
+ public static bool IsSplitOperator(char _char, out OperatorType _type)
+ {
+ var _index = operatorList.FindIndex((x) =>
+ {
+ return x == _char;
+ });
+ _type = OperatorType.Plus;
+ if (_index == -1)
+ {
+ return false;
+ }
+ _type = GetOperatorType(_char);
+ switch (_type)
+ {
+ case OperatorType.Floor:
+ case OperatorType.Ceil:
+ case OperatorType.Min:
+ case OperatorType.Max:
+ case OperatorType.Remain:
+ case OperatorType.Pow:
+ case OperatorType.Random:
+ case OperatorType.RandomInt:
+ case OperatorType.Sqrt:
+ return true;
+ }
+ return false;
+ }
+ }
+
+ public enum OperatorType
+ {
+ Plus,//+
+ Subtract,//-
+ Ride,//*
+ Divide,// /
+ Pow,// ^
+ Min,// !
+ Max,// @
+ Remain,// %
+ Random,
+ Floor,
+ Ceil,
+ RandomInt,
+ Sqrt
+ }
+}
diff --git a/Main/Core/GameEngine/Common/Equation.cs.meta b/Main/Core/GameEngine/Common/Equation.cs.meta
new file mode 100644
index 0000000..662170c
--- /dev/null
+++ b/Main/Core/GameEngine/Common/Equation.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 87f34f1073caa794c85c409b99178842
+timeCreated: 1513492313
+licenseType: Free
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Mail.meta b/Main/Mail.meta
new file mode 100644
index 0000000..a293ad6
--- /dev/null
+++ b/Main/Mail.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 41d19f3a7c060704d9f6f673a80c91d4
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Mail/MailModel.cs b/Main/Mail/MailModel.cs
new file mode 100644
index 0000000..9138ec5
--- /dev/null
+++ b/Main/Mail/MailModel.cs
@@ -0,0 +1,258 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using UnityEngine;
+using vnxbqy.UI;
+
+public class MailModel : ManagerBase<MailModel>
+{
+ /// <summary>
+ /// 閭欢鏁版嵁瀛楀吀锛屽瓨鍌ㄦ墍鏈夐偖浠惰鎯�
+ /// Key: 閭欢GUID(鍞竴鏍囪瘑)
+ /// Value: 閭欢璇︾粏鏁版嵁(MailData缁撴瀯浣�)
+ /// </summary>
+ Dictionary<string, MailData> mailDataDict = new Dictionary<string, MailData>();
+ public MailCategory nowMailCategory = MailCategory.Personal;
+ public Redpoint parentRedpoint = new Redpoint(MainRedDot.MailRepoint);
+ public Redpoint tabRedpoint0;
+ public Redpoint tabRedpoint1;
+ public event Action OnUpdateMailListEvent;// 鏇存柊閭欢鍒楄〃鏁版嵁
+ public event Action OnUpdateMailStateChangeEvent;// 鏇存柊閭欢鐘舵�佸彉鏇�
+
+ public readonly string dateFormat = "yyyy-MM-dd";
+ public override void Init()
+ {
+ tabRedpoint0 = new Redpoint(MainRedDot.MailRepoint, GetTabRedpointId(MailCategory.Personal));
+ tabRedpoint1 = new Redpoint(MainRedDot.MailRepoint, GetTabRedpointId(MailCategory.Global));
+ DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += OnBeforePlayerDataInitializeEvent;
+ }
+
+ public override void Release()
+ {
+ DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= OnBeforePlayerDataInitializeEvent;
+ }
+
+ public void OnBeforePlayerDataInitializeEvent()
+ {
+ mailDataDict.Clear();
+ }
+
+ public bool HasNoReadMail(MailCategory category)
+ {
+ var list = GetMailList(category);
+ if (list.IsNullOrEmpty())
+ return false;
+
+ foreach (var guid in list)
+ {
+ if (mailDataDict.TryGetValue(guid, out var mailData) && mailData.MailState == 1)
+ return true;
+ }
+ return false;
+ }
+
+ public int GetTabRedpointId(MailCategory type)
+ {
+ return MainRedDot.MailRepoint * 10 + (int)type;
+ }
+
+ public void UpdatePersonalRedPoint()
+ {
+ if (tabRedpoint0 == null)
+ return;
+ tabRedpoint0.state = RedPointState.None;
+ if (HasNoReadMail(MailCategory.Personal))
+ {
+ tabRedpoint0.state = RedPointState.Simple;
+ }
+ }
+
+ public void UpdateGlobalRedPoint()
+ {
+ if (tabRedpoint1 == null) return;
+ tabRedpoint1.state = RedPointState.None;
+ if (HasNoReadMail(MailCategory.Global))
+ {
+ tabRedpoint1.state = RedPointState.Simple;
+ }
+ }
+
+ /// <summary>
+ /// 鏇存柊閭欢绾㈢偣鎻愮ず鐘舵��
+ /// </summary>
+ public void UpdateRedPoint()
+ {
+ UpdatePersonalRedPoint();
+ UpdateGlobalRedPoint();
+ }
+
+ public bool TryGetMailData(string uuid, out MailData mailData)
+ {
+ return mailDataDict.TryGetValue(uuid, out mailData);
+ }
+
+ // // 閭欢鏄惁鏈夋晥
+ // public bool IsMailLimit(DateTime CreateDateTime, int limitDays)
+ // {
+ // TimeSpan timeSpan = TimeUtility.ServerNow - CreateDateTime;
+ // double totalDays = timeSpan.TotalDays;
+ // return totalDays > limitDays;
+ // }
+
+ public List<string> GetMailList(MailCategory mailCategory)
+ {
+ var result = new List<string>();
+ foreach (var kvp in mailDataDict)
+ {
+ if (kvp.Value.Category == mailCategory)
+ {
+ result.Add(kvp.Key);
+ }
+ }
+ return result;
+ }
+
+ public List<string> GetSortMailScrList(MailCategory mailCategory)
+ {
+ List<string> resList = GetMailList(mailCategory);
+ return resList.OrderByDescending(guid => mailDataDict[guid].CreateDateTime).ToList();
+ }
+
+ /// <summary>
+ /// 鏇存柊閭欢鍒楄〃鏁版嵁
+ /// </summary>
+ /// <param name="vNetData">浠庢湇鍔″櫒鎺ユ敹鐨勯偖浠跺垪琛ㄦ暟鎹寘</param>
+ public void UpdateMailList(HA362_tagMCMailList vNetData)
+ {
+ if (vNetData == null) return;
+
+ // 鏇存柊閭欢鏁版嵁瀛楀吀
+ foreach (var mail in vNetData.MailList)
+ {
+ var category = vNetData.IsServerMail == 1 ? MailCategory.Global : MailCategory.Personal;
+ var mailData = new MailData();
+
+ mailData.Category = category;
+ mailData.GUID = mail.GUID;
+ mailData.Type = mail.Type;
+ mailData.CreateTime = mail.CreateTime;
+ mailData.CreateDateTime = Convert.ToDateTime(UIHelper.GetTime(mail.CreateTime));
+ mailData.LimitDays = mail.LimitDays;
+ mailData.Title = mail.Title;
+ mailData.Text = mail.Text;
+ mailData.MailState = mail.MailState;
+
+ mailData.Items = mail.Items?.Select(i => new MailItemData
+ {
+ ItemID = i.ItemID,
+ Count = i.Count,
+ IsBind = i.IsBind,
+ UserData = i.UserData
+ }).ToList();
+ mailDataDict[mail.GUID] = mailData;
+ }
+
+ UpdateRedPoint();
+ OnUpdateMailListEvent?.Invoke();
+ }
+
+ /// <summary>
+ /// 鏇存柊閭欢鐘舵�佸彉鏇�
+ /// </summary>
+ /// <param name="vNetData">浠庢湇鍔″櫒鎺ユ敹鐨勯偖浠剁姸鎬佸彉鏇存暟鎹寘</param>
+ public void UpdateMailStateChange(HA363_tagMCMailStateChange vNetData)
+ {
+ if (vNetData == null || vNetData.MailList == null) return;
+
+ foreach (var stateChange in vNetData.MailList)
+ {
+ if (mailDataDict.TryGetValue(stateChange.GUID, out var mailData))
+ {
+ if (stateChange.MailState == 4)
+ {
+ mailDataDict.Remove(stateChange.GUID);
+ continue;
+ }
+ mailData.MailState = stateChange.MailState;
+ mailDataDict[stateChange.GUID] = mailData;
+ }
+ }
+
+ UpdateRedPoint();
+ OnUpdateMailStateChangeEvent?.Invoke();
+ }
+
+
+ /// <summary>
+ /// 闃呰閭欢
+ /// </summary>
+ /// <param name="GUID">閭欢GUID</param>
+ public void ReadMail(string GUID)
+ {
+ if (string.IsNullOrEmpty(GUID))
+ {
+ Debug.LogError("闃呰閭欢GUID涓嶈兘涓虹┖");
+ return;
+ }
+ SendRequestMail(GUID, 0);
+ }
+
+ /// <summary>
+ /// 棰嗗彇閭欢
+ /// </summary>
+ /// <param name="GUID">閭欢GUID锛屼负绌烘椂鎵归噺棰嗗彇鎵�鏈夐偖浠�</param>
+ public void ClaimMail(string GUID = null)
+ {
+ SendRequestMail(GUID, 1);
+ }
+
+ /// <summary>
+ /// 鍒犻櫎閭欢
+ /// </summary>
+ /// <param name="GUID">閭欢GUID锛屼负绌烘椂鎵归噺鍒犻櫎宸查鍙栨垨鏃犵墿鍝佺殑宸茶閭欢</param>
+ public void DeleteMail(string GUID = null)
+ {
+ SendRequestMail(GUID, 2);
+ }
+
+ /// <summary>
+ /// 鍙戦�侀偖浠惰姹傚埌鏈嶅姟鍣�
+ /// </summary>
+ /// <param name="GUID">閭欢GUID</param>
+ /// <param name="ReqType">璇锋眰绫诲瀷 0-璁剧疆宸茶锛�1-棰嗗彇閭欢锛�2-鍒犻櫎閭欢</param>
+ public void SendRequestMail(string GUID, byte ReqType)
+ {
+ CA537_tagCMRequestMail pack = new CA537_tagCMRequestMail();
+ pack.GUID = GUID;
+ pack.ReqType = ReqType;
+ GameNetSystem.Instance.SendInfo(pack);
+ }
+}
+
+public enum MailCategory
+{
+ Personal = 0, // 涓汉閭欢
+ Global = 1 // 鍏ㄦ湇閭欢
+}
+
+public class MailItemData
+{
+ public uint ItemID; //鐗╁搧ID
+ public uint Count; //鏁伴噺
+ public byte IsBind; //鏄惁缁戝畾
+ public string UserData; //鑷畾涔夋暟鎹�
+}
+
+public class MailData
+{
+ public MailCategory Category;
+ public string GUID; //閭欢GUID
+ public byte Type; //閭欢绫诲瀷锛屾殏鏃堕粯璁�0
+ public string CreateTime; //鍒涘缓鏃堕棿
+ public DateTime CreateDateTime;
+ public byte LimitDays; //鏈夋晥澶╂暟
+ public string Title; //鏍囬
+ public string Text; //鍐呭
+ public byte MailState; //閭欢鐘舵�侊細 0-鏈煡锛�1-鏈锛�2-宸茶锛�3-宸查锛�
+ public List<MailItemData> Items; //鐗╁搧淇℃伅
+}
\ No newline at end of file
diff --git a/Main/Mail/MailModel.cs.meta b/Main/Mail/MailModel.cs.meta
new file mode 100644
index 0000000..ba445cb
--- /dev/null
+++ b/Main/Mail/MailModel.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 5891ab4254cba5c4fa49e6bbb28b94d3
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Message.meta b/Main/Message.meta
new file mode 100644
index 0000000..0aaf106
--- /dev/null
+++ b/Main/Message.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 23097aa976ae3cf448f09b0f632e5316
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Message/MessageWin.cs b/Main/Message/MessageWin.cs
new file mode 100644
index 0000000..a5e7f3d
--- /dev/null
+++ b/Main/Message/MessageWin.cs
@@ -0,0 +1,288 @@
+锘縰sing System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+using CJ.Wait;
+using System;
+
+using System.Text.RegularExpressions;
+using DG.Tweening;
+namespace vnxbqy.UI
+{
+
+ public class MessageWin : UIBase
+ {
+ [SerializeField] RectTransform m_ContainerNormalHint;
+ [SerializeField] RichText m_NormalHint;
+ [SerializeField] RectTransform m_ContainerChatHint;
+ [SerializeField] RichText m_NormalChatHint; //鏄剧ず鍦ㄨ亰澶╃晫闈㈢殑浣嶇疆
+
+ [SerializeField] RectTransform m_ContainerServerTip;
+ [SerializeField] ScaleTween m_ServerTipScaleTween;
+ [SerializeField] PositionTween m_ServerTipPositionTween;
+ [SerializeField] RichText m_ServerTip;
+ [SerializeField, Header("鍏ㄦ湇骞挎挱鍋滅暀鏃堕棿")] float m_ServerTipKeepTime = 1.5f;
+
+ [SerializeField] RectTransform m_ContainerGM;
+ [SerializeField] Text m_GmRichText;
+ [SerializeField] ScrollerController m_ScrollControl;
+ [SerializeField] Toggle m_AutoPopToggle;
+ [SerializeField] Toggle m_AutoRefreshToggle;
+ [SerializeField] Button m_GMClose;
+
+ bool m_ServerTipPrepared = true;
+
+ protected override void OnPreOpen()
+ {
+ m_ServerTipPrepared = true;
+
+#if UNITY_EDITOR
+ m_ContainerGM.SetActive(VersionConfig.Get().debugVersion);
+#else
+ m_ContainerGM.SetActive(false);
+#endif
+ ServerTipDetails.normalHintRefresh += CheckNormalHint;
+ ServerTipDetails.serverHintRefresh += CheckServerHint;
+ ServerTipDetails.gmMessageRefresh += DisplayGM;
+ ServerTipDetails.gmOpenEvent += GmOpenEvent;
+ ServerTipDetails.chatHintRefresh += CheckChatHint;
+ CheckNormalHint();
+ CheckChatHint();
+ CheckServerHint();
+ DisplayGM(string.Empty);
+
+ if (ServerTipDetails.requireOpenGM)
+ {
+ if (hasOnFrom)
+ {
+ OnGMOpen();
+ }
+ ServerTipDetails.requireOpenGM = false;
+ }
+
+ m_ContainerNormalHint.OnWaitCompelete(OnHintDisplayComplete);
+ m_ContainerChatHint.OnWaitCompelete(OnHintDisplayComplete);
+ m_ScrollControl.OnRefreshCell += OnRefreshGmCell;
+ m_ScrollControl.OnGetDynamicSize += OnGetDynamicSize;
+ m_ScrollControl.lockType = EnhanceLockType.LockVerticalBottom;
+ m_GMClose.onClick.AddListener(OnGMClose);
+ }
+
+ protected override void OnPreClose()
+ {
+ ServerTipDetails.normalHintRefresh -= CheckNormalHint;
+ ServerTipDetails.serverHintRefresh -= CheckServerHint;
+ ServerTipDetails.gmMessageRefresh -= DisplayGM;
+ ServerTipDetails.gmOpenEvent -= GmOpenEvent;
+ ServerTipDetails.chatHintRefresh -= CheckChatHint;
+ }
+
+
+ private void GmOpenEvent()
+ {
+ if (ServerTipDetails.requireOpenGM)
+ {
+ OnGMOpen();
+ ServerTipDetails.requireOpenGM = false;
+ }
+ }
+
+ void CheckNormalHint()
+ {
+ var hint = ServerTipDetails.RequireNormalHint();
+ if (hint != null)
+ {
+ DisplayNormalHint(hint);
+ }
+ }
+
+ void DisplayNormalHint(SystemHintData hint)
+ {
+ transform.SetAsLastSibling();
+ m_NormalHint.SetExtenalData(hint.extentionData);
+ m_NormalHint.text = hint.message;
+ if (!m_ContainerNormalHint.gameObject.activeInHierarchy)
+ {
+ m_ContainerNormalHint.SetActive(true);
+ }
+ m_ContainerNormalHint.DoWaitRestart();
+ }
+
+ private void OnHintDisplayComplete(Component com)
+ {
+ com.DoWaitStop();
+ com.SetActive(false);
+ }
+
+ void CheckServerHint()
+ {
+ if (!m_ServerTipPrepared)
+ {
+ return;
+ }
+ var hint = ServerTipDetails.RequireServerTip();
+ if (hint != null && gameObject.activeInHierarchy)
+ {
+ DisplayServerHint(hint);
+ }
+ else
+ {
+ DisableServerTip();
+ }
+ }
+
+ public void DisplayServerHint(SystemHintData hint)
+ {
+ transform.SetAsLastSibling();
+ m_ServerTipPrepared = false;
+ if (!m_ServerTipScaleTween.gameObject.activeSelf)
+ {
+ m_ServerTipScaleTween.SetActive(true);
+ }
+ m_ServerTipScaleTween.SetStartState();
+ m_ServerTipPositionTween.SetStartState();
+ m_ContainerServerTip.SetActive(true);
+ m_ServerTip.SetExtenalData(hint.extentionData);
+ m_ServerTip.text = hint.message;
+ m_ServerTipScaleTween.Play();
+ TimeMgr.Instance.Register(m_ServerTip, ServerTipStartHide, m_ServerTipKeepTime + m_ServerTipScaleTween.duration);
+ }
+
+ private void ServerTipStartHide(Component comp)
+ {
+ m_ServerTipPositionTween.Play();
+ TimeMgr.Instance.Register(m_ServerTipPositionTween, ServerTipTweenComplete, m_ServerTipPositionTween.duration);
+ }
+
+ private void ServerTipTweenComplete(Component comp)
+ {
+ m_ServerTipPrepared = true;
+ DisableServerTip();
+ CheckServerHint();
+ }
+
+ private void DisableServerTip()
+ {
+ TimeMgr.Instance.UnRegister(m_ServerTip);
+ TimeMgr.Instance.UnRegister(m_ServerTipPositionTween);
+ m_ContainerServerTip.SetActive(false);
+ m_ServerTipScaleTween.Stop();
+ m_ServerTipPositionTween.Stop();
+ m_ServerTipScaleTween.SetStartState();
+ m_ServerTipPositionTween.SetStartState();
+ }
+
+
+ #region GM
+ readonly Regex autoPopRegex = new Regex("鍙傛暟閿欒|鎵цGM鍛戒护閿欒|^###");
+ void DisplayGM(string latest)
+ {
+ if (!string.IsNullOrEmpty(latest))
+ {
+ if (m_AutoPopToggle.isOn && hasOnFrom)
+ {
+ RectTransform rt = m_ContainerGM;
+ Vector3 pos = new Vector3(hasOnFrom ? -rt.sizeDelta.x / 2 : rt.sizeDelta.x / 2, 0, 0);
+ rt.DOLocalMove(pos, 1.0f);
+ hasOnFrom = !hasOnFrom;
+ m_GMClose.SetActive(!hasOnFrom);
+ }
+ }
+ if (m_ScrollControl.GetNumberOfCells(m_ScrollControl.m_Scorller) >= 300)
+ {
+ m_ScrollControl.m_Scorller.RefreshActiveCellViews();
+ return;
+ }
+ m_ScrollControl.Refresh();
+ for (int i = 0; i < ServerTipDetails.gmMessages.Count; i++)
+ {
+ m_ScrollControl.AddCell(ScrollerDataType.Normal, i);
+ }
+ m_ScrollControl.Restart();
+ if (autoPopRegex.IsMatch(latest))
+ {
+ if (hasOnFrom)
+ {
+ OnGMOpen();
+ }
+ }
+ }
+
+ private void OnRefreshGmCell(ScrollerDataType type, CellView cell)
+ {
+ if (cell.index < ServerTipDetails.gmMessages.Count)
+ {
+ Text text = cell.transform.Find("Text").GetComponent<Text>();
+ text.text = ServerTipDetails.gmMessages[cell.index];
+ }
+ }
+
+ private bool OnGetDynamicSize(ScrollerDataType type, int index, out float height)
+ {
+ var msg = index < ServerTipDetails.gmMessages.Count ? ServerTipDetails.gmMessages[index] : string.Empty;
+ height = m_GmRichText.cachedTextGeneratorForLayout.GetPreferredHeight(msg,
+ m_GmRichText.GetGenerationSettings(new Vector2(m_GmRichText.rectTransform.rect.size.x, 0.0f)))
+ / m_GmRichText.pixelsPerUnit;
+ height += 5;
+ return true;
+ }
+
+ private void OnGMClose()
+ {
+ if (!hasOnFrom)
+ {
+ RectTransform rt = m_ContainerGM;
+ Vector3 pos = new Vector3(hasOnFrom ? -rt.sizeDelta.x / 2 : rt.sizeDelta.x / 2, 0, 0);
+ rt.DOLocalMove(pos, 1.0f);
+ hasOnFrom = !hasOnFrom;
+ m_GMClose.SetActive(!hasOnFrom);
+ }
+ }
+ #endregion
+
+ private void OnDisable()
+ {
+ m_ContainerNormalHint.SetActive(false);
+ m_ContainerChatHint.SetActive(false);
+ DisableServerTip();
+ StopAllCoroutines();
+ }
+
+ private Vector3 gmTo = new Vector3(442, 0, 0);
+ private Vector3 gmFrom = new Vector3(892, 0, 0);
+ private bool hasOnFrom = true;
+ public void OnGMOpen()
+ {
+ RectTransform rt = m_ContainerGM;
+ Vector3 pos = new Vector3(hasOnFrom ? -rt.sizeDelta.x / 2 : rt.sizeDelta.x / 2, 0, 0);
+ rt.DOLocalMove(pos, 1.0f);
+ hasOnFrom = !hasOnFrom;
+ m_GMClose.SetActive(!hasOnFrom);
+ }
+
+ void CheckChatHint()
+ {
+ var hint = ServerTipDetails.RequireChatHint();
+ if (hint != null)
+ {
+ DisplayChatHint(hint);
+ }
+ }
+
+ void DisplayChatHint(SystemHintData hint)
+ {
+ // if (!WindowCenter.Instance.IsOpen<ChatWin>())
+ // {
+ // return;
+ // }
+ // if (!m_ContainerChatHint.gameObject.activeInHierarchy)
+ // {
+ // m_ContainerChatHint.gameObject.SetActive(true);
+ // }
+ // m_NormalChatHint.SetExtenalData(hint.extentionData);
+ // m_NormalChatHint.text = hint.message;
+ // m_ContainerChatHint.DoWaitRestart();
+ }
+ }
+}
+
diff --git a/Main/Message/MessageWin.cs.meta b/Main/Message/MessageWin.cs.meta
new file mode 100644
index 0000000..db5da62
--- /dev/null
+++ b/Main/Message/MessageWin.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 5b46b0146160b5f47a20899a65da3af8
+timeCreated: 1499772891
+licenseType: Free
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Message/SysNotifyMgr.cs b/Main/Message/SysNotifyMgr.cs
new file mode 100644
index 0000000..249e0a7
--- /dev/null
+++ b/Main/Message/SysNotifyMgr.cs
@@ -0,0 +1,297 @@
+锘縰sing vnxbqy.UI;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Text.RegularExpressions;
+
+using UnityEngine;
+using UnityEngine.UI;
+
+
+public class SysNotifyMgr : SingletonMonobehaviour<SysNotifyMgr>
+
+{
+ /// <summary>
+ /// 鏈嶅姟绔笅鍙戠殑鏁版嵁
+ /// </summary>
+ private H0212_tagNotifyCode.tagNotifyStr[] sysNotifyMsg;
+
+ private ArrayList tipInfoList = new ArrayList();
+
+ private Dictionary<string, Func<string, ArrayList, bool>> notifyConditionDict = new Dictionary<string, Func<string, ArrayList, bool>>();
+
+ public event Action<string, ArrayList> sysNotifyEvent;
+
+ public event Action<string> OnSystemNotifyEvent;
+ /// <summary>
+ /// UserData鍘荤┖鏍煎鐞�
+ /// </summary>
+ public static Regex s_UserDataSpaceRegex = new Regex(@"'([0-9]+)':[ ]+\[(.*?)\]", RegexOptions.Singleline);
+
+ private void Awake()
+ {
+ DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += BeforePlayerDataInitializeEvent;
+ //StageLoad.Instance.onStageLoadFinish += OnStageLoadFinish;
+ //StartCoroutine(Co_Instance());
+ }
+
+ IEnumerator Co_Instance()
+ {
+ yield return null;
+ // var instance = BattleHint.Instance;
+ }
+
+ private void LateUpdate()
+ {
+#if UNITY_EDITOR
+ if (Input.GetKeyDown(KeyCode.F3))
+ {
+ ServerTipDetails.OpenGMPanel();
+ }
+#endif
+ }
+
+ protected override void OnDestroy()
+ {
+ base.OnDestroy();
+ DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= BeforePlayerDataInitializeEvent;
+ //StageLoad.Instance.onStageLoadFinish -= OnStageLoadFinish;
+ }
+
+ private void OnStageLoadFinish()
+ {
+ //ServerTipDetails.OnStageLoadFinish();
+ //BattleHint.Instance.OnStageLoadFinish();
+ }
+
+ private void BeforePlayerDataInitializeEvent()
+ {
+ // ScrollTip.m_Hints.Clear();
+ ServerTipDetails.ClearHint();
+ }
+
+ public void ReceiveNotifyCode(H0212_tagNotifyCode vNetData)
+ {
+ if (vNetData != null)
+ {
+ sysNotifyMsg = vNetData.Pars;
+
+ tipInfoList.Clear();
+ for (int i = 0; i < sysNotifyMsg.Length; i++)
+ {
+ if (sysNotifyMsg[i].Len != 0)
+ {
+ var _msg = sysNotifyMsg[i].Msg;
+ _msg = _msg.Replace(" ", string.Empty);
+ tipInfoList.Add(_msg);
+ }
+ else
+ {
+ tipInfoList.Add(sysNotifyMsg[i].MsgInt);
+ }
+ }
+
+ if (sysNotifyEvent != null)
+ {
+ sysNotifyEvent(vNetData.Msg, tipInfoList);
+ }
+
+ GetSysMsg(vNetData.Msg);
+ }
+ }
+
+ void GetSysMsg(string key)
+ {
+ ///鏍规嵁key浠庣郴缁熶俊鎭〃鍙栧埌娑堟伅绫诲瀷
+ SysInfoConfig cfg = SysInfoConfig.Get(key);
+ if (cfg == null)
+ {
+#if UNITY_EDITOR
+ string hint = Language.Get("L1093", key);
+ //ScrollTip.ShowTip(hint);
+ //ChatCtrl.Inst.RevChatInfo(hint);
+#endif
+ }
+ else
+ {
+ if (!string.IsNullOrEmpty(cfg.richText))
+ {
+ if (notifyConditionDict.ContainsKey(cfg.key))
+ {
+ try
+ {
+ if (!notifyConditionDict[cfg.key](cfg.key, tipInfoList))
+ {
+ return;
+ }
+ }
+ catch (Exception e)
+ {
+ Debug.Log(e.StackTrace);
+ }
+ }
+ AnalysisSysmsg(cfg);
+ }
+ if (OnSystemNotifyEvent != null)
+ {
+ OnSystemNotifyEvent(cfg.key);
+ }
+ }
+ }
+
+ public void RegisterCondition(string key, Func<string, ArrayList, bool> condition)
+ {
+ if (!notifyConditionDict.ContainsKey(key))
+ {
+ notifyConditionDict.Add(key, condition);
+ }
+ }
+
+ public void ShowTip(string key, params object[] msg)
+ {
+ SysInfoConfig cfg = SysInfoConfig.Get(key);
+ if (cfg != null)
+ {
+ tipInfoList.Clear();
+ tipInfoList.AddRange(msg);
+ AnalysisSysmsg(cfg);
+ }
+ }
+
+ void AnalysisSysmsg(SysInfoConfig cfg)
+ {
+ SysNotifySound(cfg.sound);
+ SysNotifyFx(cfg.effect);
+ SysNotifyRichText(cfg.type, cfg.richText, cfg.order);
+ }
+
+ void SysNotifySound(string msg)
+ {
+ //DesignDebug.Log("闊虫晥淇℃伅" + msg);
+ }
+
+ void SysNotifyFx(string msg)
+ {
+ //DesignDebug.Log("鐗规晥淇℃伅" + msg);
+ }
+
+ void SysNotifyRichText(int[] type, string msg, int order = 0)
+ {
+ if (type == null || type.Length == 0)
+ {
+ return;
+ }
+ for (int i = 0; i < type.Length; i++)
+ {
+ // switch ((SysNotifyType)type[i])
+ // {
+ // case SysNotifyType.SysFixedTip:
+ // case SysNotifyType.SysFixedTip1:
+ // case SysNotifyType.SysScrollTip:
+ // case SysNotifyType.SysIntervalFixedTip:
+ // case SysNotifyType.SysMarqueeTip:
+ // case SysNotifyType.SysRealmTip:
+ // if (!PreFightMission.Instance.IsFinished())
+ // {
+ // continue;
+ // }
+ // break;
+ // }
+ switch ((SysNotifyType)type[i])
+ {
+ case SysNotifyType.SysFixedTip:
+ ServerTipDetails.DisplayNormalTip(msg, tipInfoList);
+ break;
+ case SysNotifyType.SysChatWin:
+ ServerTipDetails.DisplayChatTip(msg, tipInfoList);
+ break;
+ // case SysNotifyType.SysFixedTip1:
+ // case SysNotifyType.SysScrollTip:
+ // ScrollTip.ShowTip(msg, tipInfoList, order);
+ // break;
+ case SysNotifyType.SysIntervalFixedTip:
+ ServerTipDetails.ShowServerTip(msg, tipInfoList, order);
+ break;
+ // case SysNotifyType.SysMarqueeTip:
+ // ServerTipDetails.ShowMarquee(msg, tipInfoList,order);
+ // break;
+ // case SysNotifyType.SysChanelTip:
+ // ChatCtrl.Inst.RevChatInfo(msg, tipInfoList);
+ // break;
+ // case SysNotifyType.SysFairyQuestionTip:
+ // ChatCtrl.Inst.RevChatInfo(msg, tipInfoList, ChatInfoType.FairyQuestion);
+ // break;
+ // case SysNotifyType.SysFairyTip:
+ // ChatCtrl.Inst.RevChatInfo(msg, tipInfoList, ChatInfoType.FairyTip);
+ // break;
+ // case SysNotifyType.SysTeamTip:
+ // ChatCtrl.Inst.RevChatInfo(msg, tipInfoList, ChatInfoType.TeamTip);
+ // break;
+ // case SysNotifyType.SysRealmTip:
+ // if (OnSysTipEvent != null)
+ // {
+ // OnSysTipEvent(type[i], msg, tipInfoList);
+ // }
+ // break;
+ // case SysNotifyType.SysEvenKill:
+ // BattleHint.Instance.ReceiveEvenKill(msg, tipInfoList);
+ // break;
+ // case SysNotifyType.SysFactionTip:
+ // ChatCtrl.Inst.RevChatInfo(msg, tipInfoList, ChatInfoType.default2);
+ // break;
+
+ }
+ }
+
+ }
+
+ #region 浜嬩欢
+ public static event Action<int, string, ArrayList> OnSysTipEvent;
+ #endregion
+
+ public enum SysNotifyType
+ {
+ SysFixedTip = 1,//鍥哄畾鎻愮ず
+ SysScrollTip = 2,//婊氬姩鎻愮ず
+ SysIntervalFixedTip = 4,//鍏ㄦ湇鍥哄畾娑堟伅鎻愮ず
+ SysMarqueeTip = 5,//璺戦┈鐏�
+ SysChatWin = 6, //鑱婂ぉ浣嶇疆鐨勬彁绀�
+ SysEvenKill = 7,//涓婂彜鎴樺満杩炴潃鎻愮ず
+ SysFixedTip1 = 11,//鍥哄畾鎻愮ず2
+ SysChanelTip = 20,//绯荤粺棰戦亾鏄剧ず
+ SysFairyQuestionTip = 31,//浠欑洘棰戦亾闂瓟鎻愮ず
+ SysFairyTip = 32,//浠欑洘棰戦亾淇℃伅鎻愮ず
+ SysTeamTip = 41,//闃熶紞棰戦亾鎻愮ず
+ SysFactionTip = 51, //闃佃惀棰戦亾鎻愮ず
+ SysRealmTip = 100,//澧冪晫鎻愮ず
+
+ //鍚庣画IL寮�鍙戞坊鍔犻璁�
+ default1 = 200,
+ default2,
+ default3,
+ default4,
+ default5,
+ default6,
+ default7,
+ default8,
+ default9,
+ default10,
+ }
+
+ public int Compare(SystemHintData x, SystemHintData y)
+ {
+ if (x.order.CompareTo(y.order) != 0)
+ {
+ return -x.order.CompareTo(y.order);
+ }
+ return x.appendTime.CompareTo(y.appendTime);
+ }
+}
+
+public class SystemHintData
+{
+ public DateTime appendTime;
+ public string message;
+ public ArrayList extentionData;
+ public int order;
+}
diff --git a/Main/Message/SysNotifyMgr.cs.meta b/Main/Message/SysNotifyMgr.cs.meta
new file mode 100644
index 0000000..4af8b6b
--- /dev/null
+++ b/Main/Message/SysNotifyMgr.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 8db32490b6c76984da5e96b4639531fc
+timeCreated: 1505706548
+licenseType: Free
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/ClientPack.meta b/Main/NetworkPackage/ClientPack.meta
new file mode 100644
index 0000000..9e21ddc
--- /dev/null
+++ b/Main/NetworkPackage/ClientPack.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 87bbd3a58a75a594db01a4ecb46e826a
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/ClientPack/ClientToGameServer.meta b/Main/NetworkPackage/ClientPack/ClientToGameServer.meta
new file mode 100644
index 0000000..162f13c
--- /dev/null
+++ b/Main/NetworkPackage/ClientPack/ClientToGameServer.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: e929ce1c208223b48bb495610e82ee08
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/ClientPack/ClientToGameServer/CA9_Function.meta b/Main/NetworkPackage/ClientPack/ClientToGameServer/CA9_Function.meta
new file mode 100644
index 0000000..35a1e45
--- /dev/null
+++ b/Main/NetworkPackage/ClientPack/ClientToGameServer/CA9_Function.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: e5caa0e836ee017408ecf167352727e0
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/ClientPack/ClientToGameServer/CA9_Function/CA9A1_tagCGQueryCompensation.cs b/Main/NetworkPackage/ClientPack/ClientToGameServer/CA9_Function/CA9A1_tagCGQueryCompensation.cs
new file mode 100644
index 0000000..e0ae2e8
--- /dev/null
+++ b/Main/NetworkPackage/ClientPack/ClientToGameServer/CA9_Function/CA9A1_tagCGQueryCompensation.cs
@@ -0,0 +1,15 @@
+using UnityEngine;
+using System.Collections;
+
+//A9 A1 鏌ヨ鐜╁琛ュ伩#tagCGQueryCompensation
+
+public class CA9A1_tagCGQueryCompensation : GameNetPackBasic {
+
+ public CA9A1_tagCGQueryCompensation () {
+ _cmd = (ushort)0xA9A1;
+ }
+
+ public override void WriteToBytes () {
+ }
+
+}
diff --git a/Main/NetworkPackage/ClientPack/ClientToGameServer/CA9_Function/CA9A1_tagCGQueryCompensation.cs.meta b/Main/NetworkPackage/ClientPack/ClientToGameServer/CA9_Function/CA9A1_tagCGQueryCompensation.cs.meta
new file mode 100644
index 0000000..7e543c8
--- /dev/null
+++ b/Main/NetworkPackage/ClientPack/ClientToGameServer/CA9_Function/CA9A1_tagCGQueryCompensation.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 5ca70122a0a71f1448b089fcf7986149
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/ClientPack/ClientToMapServer.meta b/Main/NetworkPackage/ClientPack/ClientToMapServer.meta
new file mode 100644
index 0000000..bfcd9fb
--- /dev/null
+++ b/Main/NetworkPackage/ClientPack/ClientToMapServer.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: a792f8ad9038d4140b80b5c299786e11
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/ClientPack/ClientToMapServer/C03_MainCharacter.meta b/Main/NetworkPackage/ClientPack/ClientToMapServer/C03_MainCharacter.meta
new file mode 100644
index 0000000..35b0f67
--- /dev/null
+++ b/Main/NetworkPackage/ClientPack/ClientToMapServer/C03_MainCharacter.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 469410eba7e70e941b0d9b85b3b3e4f4
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/ClientPack/ClientToMapServer/C03_MainCharacter/C030A_tagCChangeAttackMode.cs b/Main/NetworkPackage/ClientPack/ClientToMapServer/C03_MainCharacter/C030A_tagCChangeAttackMode.cs
new file mode 100644
index 0000000..69fe327
--- /dev/null
+++ b/Main/NetworkPackage/ClientPack/ClientToMapServer/C03_MainCharacter/C030A_tagCChangeAttackMode.cs
@@ -0,0 +1,20 @@
+using UnityEngine;
+using System.Collections;
+
+//03 0A 更改攻击模式#tagCChangeAttackMode
+
+public class C030A_tagCChangeAttackMode : GameNetPackBasic
+{
+ public byte Mode; //TAttackMode
+
+ public C030A_tagCChangeAttackMode()
+ {
+ _cmd = (ushort)0x030A;
+ }
+
+ public override void WriteToBytes()
+ {
+ WriteBytes(Mode, NetDataType.BYTE);
+ }
+
+}
\ No newline at end of file
diff --git a/Main/NetworkPackage/ClientPack/ClientToMapServer/C03_MainCharacter/C030A_tagCChangeAttackMode.cs.meta b/Main/NetworkPackage/ClientPack/ClientToMapServer/C03_MainCharacter/C030A_tagCChangeAttackMode.cs.meta
new file mode 100644
index 0000000..a625ac3
--- /dev/null
+++ b/Main/NetworkPackage/ClientPack/ClientToMapServer/C03_MainCharacter/C030A_tagCChangeAttackMode.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: d2182c67a5023ca4385be825e74c24b4
+timeCreated: 1499086628
+licenseType: Free
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/ClientPack/ClientToMapServer/C32_GM.meta b/Main/NetworkPackage/ClientPack/ClientToMapServer/C32_GM.meta
new file mode 100644
index 0000000..f55bec9
--- /dev/null
+++ b/Main/NetworkPackage/ClientPack/ClientToMapServer/C32_GM.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 066a8a7a9a4a0624580eb3a83bef0f7f
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/ClientPack/ClientToMapServer/C32_GM/C320C_tagCGMCMD.cs b/Main/NetworkPackage/ClientPack/ClientToMapServer/C32_GM/C320C_tagCGMCMD.cs
new file mode 100644
index 0000000..14c2412
--- /dev/null
+++ b/Main/NetworkPackage/ClientPack/ClientToMapServer/C32_GM/C320C_tagCGMCMD.cs
@@ -0,0 +1,35 @@
+using UnityEngine;
+using System.Collections;
+
+//32 0C GM命令#tagCGMCMD
+
+
+
+public class C320C_tagCGMCMD : GameNetPackBasic {
+
+ public byte CmdLen;
+
+ public string Cmd; //size = CmdLen
+
+
+
+ public C320C_tagCGMCMD () {
+
+ _cmd = (ushort)0x320C;
+
+ }
+
+
+
+ public override void WriteToBytes () {
+
+ WriteBytes (CmdLen, NetDataType.BYTE);
+
+ WriteBytes (Cmd, NetDataType.Chars, CmdLen);
+
+ }
+
+
+
+}
+
diff --git a/Main/NetworkPackage/ClientPack/ClientToMapServer/C32_GM/C320C_tagCGMCMD.cs.meta b/Main/NetworkPackage/ClientPack/ClientToMapServer/C32_GM/C320C_tagCGMCMD.cs.meta
new file mode 100644
index 0000000..3a6427f
--- /dev/null
+++ b/Main/NetworkPackage/ClientPack/ClientToMapServer/C32_GM/C320C_tagCGMCMD.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: a79ea7dee3d89124da2dde961123234e
+timeCreated: 1500277239
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/ClientPack/ClientToMapServer/CA3_Item.meta b/Main/NetworkPackage/ClientPack/ClientToMapServer/CA3_Item.meta
new file mode 100644
index 0000000..80b1715
--- /dev/null
+++ b/Main/NetworkPackage/ClientPack/ClientToMapServer/CA3_Item.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 76a18e2b46000a94184e10521319d66a
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/ClientPack/ClientToMapServer/CA3_Item/CA32D_tagCMDecomposeSeting.cs b/Main/NetworkPackage/ClientPack/ClientToMapServer/CA3_Item/CA32D_tagCMDecomposeSeting.cs
new file mode 100644
index 0000000..5106dee
--- /dev/null
+++ b/Main/NetworkPackage/ClientPack/ClientToMapServer/CA3_Item/CA32D_tagCMDecomposeSeting.cs
@@ -0,0 +1,18 @@
+using UnityEngine;
+using System.Collections;
+
+// A3 2D 瑁呭鍒嗚В璁剧疆 #tagCMDecomposeSeting
+
+public class CA32D_tagCMDecomposeSeting : GameNetPackBasic {
+ public uint Seting;
+
+ public CA32D_tagCMDecomposeSeting () {
+ combineCmd = (ushort)0x03FE;
+ _cmd = (ushort)0xA32D;
+ }
+
+ public override void WriteToBytes () {
+ WriteBytes (Seting, NetDataType.DWORD);
+ }
+
+}
diff --git a/Main/NetworkPackage/ClientPack/ClientToMapServer/CA3_Item/CA32D_tagCMDecomposeSeting.cs.meta b/Main/NetworkPackage/ClientPack/ClientToMapServer/CA3_Item/CA32D_tagCMDecomposeSeting.cs.meta
new file mode 100644
index 0000000..df96e22
--- /dev/null
+++ b/Main/NetworkPackage/ClientPack/ClientToMapServer/CA3_Item/CA32D_tagCMDecomposeSeting.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: a177596988acf134d8a9c2a0a3fe9b51
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function.meta b/Main/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function.meta
new file mode 100644
index 0000000..5b9d5db
--- /dev/null
+++ b/Main/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 069cb09ad112a6b48b1ff813e63b44de
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA537_tagCMRequestMail.cs b/Main/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA537_tagCMRequestMail.cs
new file mode 100644
index 0000000..4f02720
--- /dev/null
+++ b/Main/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA537_tagCMRequestMail.cs
@@ -0,0 +1,20 @@
+using UnityEngine;
+using System.Collections;
+
+// A5 37 璇锋眰閭欢鎿嶄綔 #tagCMRequestMail
+
+public class CA537_tagCMRequestMail : GameNetPackBasic {
+ public string GUID; //閭欢GUID锛屽彲浼犵┖锛岄粯璁ら拡瀵逛釜浜洪偖浠剁殑鎵归噺澶勭悊锛屽鎵归噺棰嗗彇銆佹壒閲忓垹闄ゅ凡棰嗛偖浠剁瓑锛涘叏鏈嶉偖浠舵殏鏃堕檺鍒跺彧鑳藉崟灏侀偖浠跺鐞�
+ public byte ReqType; //0-璁剧疆宸茶锛�1-棰嗗彇閭欢锛�2-鍒犻櫎閭欢
+
+ public CA537_tagCMRequestMail () {
+ combineCmd = (ushort)0x03FE;
+ _cmd = (ushort)0xA537;
+ }
+
+ public override void WriteToBytes () {
+ WriteBytes (GUID, NetDataType.Chars, 36);
+ WriteBytes (ReqType, NetDataType.BYTE);
+ }
+
+}
diff --git a/Main/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA537_tagCMRequestMail.cs.meta b/Main/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA537_tagCMRequestMail.cs.meta
new file mode 100644
index 0000000..2a951d5
--- /dev/null
+++ b/Main/NetworkPackage/ClientPack/ClientToMapServer/CA5_Function/CA537_tagCMRequestMail.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 67c76623325f2c04b9e009f49ea00860
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/DTCFile.meta b/Main/NetworkPackage/DTCFile.meta
new file mode 100644
index 0000000..0f637ac
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 5579aa925db093148be8599c2aaa70ee
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/DTCFile/ServerPack.meta b/Main/NetworkPackage/DTCFile/ServerPack.meta
new file mode 100644
index 0000000..790d487
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile/ServerPack.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 8ed069a34040fbd4aa25e00f3b32f525
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/DTCFile/ServerPack/H01_System.meta b/Main/NetworkPackage/DTCFile/ServerPack/H01_System.meta
new file mode 100644
index 0000000..e61ca0b
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile/ServerPack/H01_System.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 18bfcf7440a4d5e48b15ac74d5dfc80a
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/DTCFile/ServerPack/H01_System/DTC0102_tagCDBPlayer.cs b/Main/NetworkPackage/DTCFile/ServerPack/H01_System/DTC0102_tagCDBPlayer.cs
new file mode 100644
index 0000000..6f17582
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile/ServerPack/H01_System/DTC0102_tagCDBPlayer.cs
@@ -0,0 +1,259 @@
+锘縰sing UnityEngine;
+using vnxbqy.UI;
+using System;
+//01 02 鐜╁鍒濆鍖�#tagCDBPlayer
+
+public class DTC0102_tagCDBPlayer : DtcBasic
+{
+
+ public static event Action beforePlayerDataInitializeEvent;
+ public static event Action afterPlayerDataInitializeEvent;
+ public static event Action switchAccountEvent;
+ public static bool isAfterPlayerDataInitialize = false;
+ public static uint playerIdBuf = 0;
+
+ public override void Done(GameNetPackBasic vNetPack)
+ {
+ base.Done(vNetPack);
+ Debug.LogFormat("0102 涓诲伐绋� DTCDone锛歿0}", vNetPack.ToString());
+ var package = vNetPack as H0102_tagCDBPlayer;
+ // StageLoadTimeOutCatcher.RecordProtocol(vNetPack.socketType, "0102", DateTime.Now);
+ DTC0403_tagPlayerLoginLoadOK.finishedLogin = false;
+ // MapTransferUtility.Instance.lastMoveToWorldBossTime = float.MinValue;
+ // MapTransferUtility.Instance.lastMoveToWorldBossNpcID = 0;
+
+ if (package.socketType == ServerType.Main)
+ {
+ DTC0403_tagPlayerLoginLoadOK.neverLoginOk = true;
+ }
+
+ if (package.socketType == ServerType.Main)
+ {
+ if (beforePlayerDataInitializeEvent != null)
+ {
+ beforePlayerDataInitializeEvent();
+ }
+
+ try
+ {
+ RedpointCenter.Instance.ResetAllRedpointState();
+ PlayerDatas.Instance.ClearPlayerData();
+ }
+ catch (Exception ex)
+ {
+ Debug.LogError(ex);
+ }
+ }
+
+ // GA_Hero.recordServerPos = new Vector3(package.PosX, 0, package.PosY);
+
+ // PlayerDatas.Instance.InitPlayerData(package);
+ // PlayerDatas.Instance.RequestWorldTick();
+
+ if (package.socketType == ServerType.Main)
+ {
+ if (playerIdBuf != 0 && playerIdBuf != PlayerDatas.Instance.baseData.PlayerID)
+ {
+ if (switchAccountEvent != null)
+ {
+ switchAccountEvent();
+ }
+
+ }
+
+ playerIdBuf = PlayerDatas.Instance.baseData.PlayerID;
+ if (afterPlayerDataInitializeEvent != null)
+ {
+ afterPlayerDataInitializeEvent();
+ isAfterPlayerDataInitialize = true;
+ }
+
+ }
+
+ // int fakeMapID = (int)package.ExAttr14 / 1000;
+ // int fakeLineID = (int)package.ExAttr14 % 1000;
+ // var clientDungeonInfo = new Dungeon()
+ // {
+ // mapId = fakeMapID,
+ // lineId = fakeLineID,
+ // };
+
+ //鍚屾鍋囧壇鏈� 鍗曚汉鍓湰瀛樺湪鍋囧壇鏈紝鍜屾湇鍔$1瀵瑰鎴风澶氬湴鍥惧悓鍒嗙嚎鎯呭喌
+ // if (fakeLineID != 0)
+ // PlayerDatas.Instance.baseData.dungeonLineId = fakeLineID;
+ // if (fakeMapID != 0)
+ // PlayerDatas.Instance.baseData.dungeonMapId = fakeMapID;
+
+ // if (ArenaModel.Instance.CheckArenaComplete(clientDungeonInfo.mapId))
+ // {
+ // clientDungeonInfo.mapId = 0;
+ // }
+
+ // if (ClientDungeonStageUtility.isClientDungeon)
+ // {
+ // PlayerDatas.Instance.baseData.MapID = ClientDungeonStageUtility.clientMapId;
+ // }
+ // else
+ // {
+ // if (clientDungeonInfo.mapId != 0 )
+ // {
+ // var clientMapId = ClientDungeonStageUtility.GetClientMapId(clientDungeonInfo.mapId);
+ // if (clientMapId != 0)
+ // {
+ // ClientDungeonStageUtility.SetClientDungeon(true, (ushort)clientMapId);
+ // ClientDungeonStageUtility.dungeonInfo = clientDungeonInfo;
+ // PlayerDatas.Instance.baseData.MapID = (ushort)clientMapId;
+ // }
+ // }
+ // }
+ // 杞Щ鍒扮櫥闄嗘椂閫氱煡鐨勫垱瑙掓椂闂村寘
+ // if (package.socketType == ServerType.Main)
+ // {
+ // ynmbxxjUtil.Instance.RoleLogin(package.PlayerID.ToString(),
+ // package.PlayerName.Trim().Replace("\0", ""),
+ // package.LV.ToString(),
+ // package.VIPLv.ToString());
+ // }
+
+ // var mapId = PlayerDatas.Instance.baseData.MapID;
+ // var dataMapId = MapUtility.GetDataMapId(mapId);
+ // var lineId = MapUtility.GetLineId(mapId, (int)package.ExAttr3%1000);
+ // var mapResourceConfig = MapResourcesConfig.GetConfig(dataMapId, lineId);
+ // if (mapResourceConfig != null)
+ // {
+ // GA_Hero.MapOffset.x = mapResourceConfig.MapOffset.x;
+ // GA_Hero.MapOffset.z = mapResourceConfig.MapOffset.y;
+ // }
+ // else
+ // {
+ // GA_Hero.MapOffset.x = 0;
+ // GA_Hero.MapOffset.z = 0;
+ // }
+
+ // var mapConfig = MapConfig.Get(mapId);
+ // DungeonStage.CurrentMapType = (MapType)mapConfig.MapFBType;
+ // if (DungeonStage.CurrentMapType != MapType.OpenCountry)
+ // {
+ // var dungeonOpen = DungeonOpenTimeConfig.Get(dataMapId);
+ // if (dungeonOpen != null)
+ // {
+ // if (dungeonOpen.DoFight == 1)
+ // {
+ // GA_Hero.forceAutoFight = true;
+ // }
+ // }
+ // }
+
+ // if (package.socketType == ServerType.CrossSever)
+ // {
+ // if (PlayerDatas.Instance.hero != null)
+ // {
+ // PlayerDatas.Instance.hero.ActorInfo.recordServerDie = PlayerDatas.Instance.hero.ActorInfo.serverDie;
+ // }
+ // }
+
+ // DTCA713_tagMCDynamicBarrierState.Clear();
+ // MainRedDot.Instance.Register();
+ // SettingEffectMgr.Instance.Begin();
+ // if (vNetPack.socketType == ServerType.Main)
+ // {
+ // QuickSetting.Instance.SetQuickSetting(package.Setting);
+ // SettingMgr.Instance.SetIsRecordData(PlayerDatas.Instance.baseData.PlayerID.ToString());
+ // }
+ // ClientSceneManager.Instance.ReConnectClear();
+
+ // // 鍒濆鍖栨憚鍍忔満
+ // if (!CameraController.Instance)
+ // {
+ // var prefab = UnityEngine.Object.Instantiate(BuiltInLoader.LoadPrefab("GameCamera"));
+ // CameraController.Instance.SetcamerePrefab(prefab);
+ // CameraController.Instance.AcceptInput = false;
+ // CameraController.Instance.CameraObject.enabled = false;
+ // CameraController.Instance.QualityLevelChanged();
+ // }
+
+ // var hudRoot = HUDCenter.hudRoot;
+ // if (!hudRoot)
+ // {
+ // hudRoot = HUDCenter.CreateHUDRoot();
+ // hudRoot.SetCamera(CameraController.Instance.CameraObject);
+ // }
+
+ // DropItemManager.ReleaseAll();
+ // ClientDropItemUtility.Instance.ReleaseAll();
+ // StatusMgr.Instance.ReleaseActor(PlayerDatas.Instance.PlayerId);
+
+ // var hero = PlayerDatas.Instance.hero;
+ // if (hero == null)
+ // {
+ // hero = GAMgr.Instance.RequestPlayer<GA_Hero>(PlayerDatas.Instance.PlayerId, E_ActorGroup.User, null);
+ // PlayerDatas.Instance.hero = hero;
+ // }
+ // else // 閲嶈繛
+ // {
+ // if (PreFightMission.Instance.IsFinished())
+ // {
+ // hero.StopAll();
+ // if (!AdventureStage.Instance.IsInAdventureStage)
+ // {
+ // hero.InitBornPos(package.PosX, package.PosY);
+ // }
+ // hero.RequestName();
+ // hero.ActorInfo.serverDie = false;
+ // hero.IdleImmediate();
+ // }
+ // }
+
+ // if (!ClientDungeonStageUtility.isClientDungeon
+ // && !ArenaManager.IsArenaClientNotMirrorFight)
+ // {
+ // GAMgr.Instance.UnInit();
+ // }
+
+ // hero.OnPathFindStop -= MapTransferUtility.Instance.OnHeroStopPathFind;
+ // hero.OnPathFindStop += MapTransferUtility.Instance.OnHeroStopPathFind;
+ // GA_Hero.s_MapSwitching = true;
+
+ // if (DebugUtility.Instance.debugAccount)
+ // {
+ // GMCommand.Instance.Begin();
+ // }
+
+ // if (package.socketType == ServerType.Main
+ // && GameNetSystem.Instance.crossServerData.crossState == GameNetSystem.CrossServerState.Yes)
+ // {
+ // StageLoad.Instance.UpdateServerFlag(package.socketType, false);
+ // StageLoad.Instance.PushSceneLoadCommand(new StageLoad.StageLoadCommand()
+ // {
+ // toMapId = mapId,
+ // toLineId = MapUtility.GetLineId(mapId, PlayerDatas.Instance.baseData.dungeonLineId),
+ // needEmpty = true,
+ // needLoadResource = false,
+ // serverType = package.socketType,
+ // isClientLoadMap = false
+ // });
+
+ // var loginModel = ModelCenter.Instance.GetModel<LoginModel>();
+ // var account = loginModel.accountBuf;
+ // var ip = GameNetSystem.Instance.crossServerData.ip;
+ // var port = GameNetSystem.Instance.crossServerData.port;
+ // CrossServerLogin.Instance.AccountLogin(account, ip, port, loginModel.reconnectBackGround);
+ // }
+ // else
+ // {
+ // StageLoad.Instance.UpdateServerFlag(package.socketType, false);
+ // StageLoad.Instance.PushSceneLoadCommand(new StageLoad.StageLoadCommand()
+ // {
+ // toMapId = mapId,
+ // toLineId = MapUtility.GetLineId(mapId, PlayerDatas.Instance.baseData.dungeonLineId),
+ // needEmpty = true,
+ // needLoadResource = true,
+ // serverType = package.socketType,
+ // isClientLoadMap = false
+ // });
+ // }
+
+
+ }
+}
+
diff --git a/Main/NetworkPackage/DTCFile/ServerPack/H01_System/DTC0102_tagCDBPlayer.cs.meta b/Main/NetworkPackage/DTCFile/ServerPack/H01_System/DTC0102_tagCDBPlayer.cs.meta
new file mode 100644
index 0000000..a1ac991
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile/ServerPack/H01_System/DTC0102_tagCDBPlayer.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 294dd0db79287344b98ad716d34dce76
+timeCreated: 1494494511
+licenseType: Free
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/DTCFile/ServerPack/H02_PlayerTalk.meta b/Main/NetworkPackage/DTCFile/ServerPack/H02_PlayerTalk.meta
new file mode 100644
index 0000000..e875ed5
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile/ServerPack/H02_PlayerTalk.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: d5f06e920fb85c74d9b2aea7730b1089
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/DTCFile/ServerPack/H02_PlayerTalk/DTC0212_tagNotifyCode.cs b/Main/NetworkPackage/DTCFile/ServerPack/H02_PlayerTalk/DTC0212_tagNotifyCode.cs
new file mode 100644
index 0000000..e700d22
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile/ServerPack/H02_PlayerTalk/DTC0212_tagNotifyCode.cs
@@ -0,0 +1,29 @@
+using UnityEngine;
+using System.Collections;
+using vnxbqy.UI;
+
+//02 12 锟斤拷锟斤拷锟斤拷示#tagNotifyCode
+
+
+
+public class DTC0212_tagNotifyCode : DtcBasic
+{
+
+ public override void Done(GameNetPackBasic vNetPack)
+ {
+
+ base.Done(vNetPack);
+
+ H0212_tagNotifyCode vNetData = vNetPack as H0212_tagNotifyCode;
+
+ //锟介奖时锟斤拷锟斤拷 锟斤拷没锟斤拷锟斤拷锟较�
+ if (vNetData.Msg == "GetMoney" && ItemLogicUtility.Instance.hidePickItem)
+ return;
+
+ //SysNotifyMgr.Instance.ReceiveNotifyCode(vNetData);
+ Debug.Log(vNetData.Msg);
+
+ }
+
+}
+
diff --git a/Main/NetworkPackage/DTCFile/ServerPack/H02_PlayerTalk/DTC0212_tagNotifyCode.cs.meta b/Main/NetworkPackage/DTCFile/ServerPack/H02_PlayerTalk/DTC0212_tagNotifyCode.cs.meta
new file mode 100644
index 0000000..fc5b7b9
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile/ServerPack/H02_PlayerTalk/DTC0212_tagNotifyCode.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: bb38d1763c9f5754fa381682fc49d223
+timeCreated: 1499240441
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/DTCFile/ServerPack/H03_MainCharacter.meta b/Main/NetworkPackage/DTCFile/ServerPack/H03_MainCharacter.meta
new file mode 100644
index 0000000..bbf3b7d
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile/ServerPack/H03_MainCharacter.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 19a67769fa5e74943be2e1ef64791ac1
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/DTCFile/ServerPack/H03_MainCharacter/DTC0316_tagPackResetOK.cs b/Main/NetworkPackage/DTCFile/ServerPack/H03_MainCharacter/DTC0316_tagPackResetOK.cs
new file mode 100644
index 0000000..c2f633b
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile/ServerPack/H03_MainCharacter/DTC0316_tagPackResetOK.cs
@@ -0,0 +1,19 @@
+using UnityEngine;
+using System.Collections;
+using vnxbqy.UI;
+//03 16 锟斤拷锟斤拷锟斤拷锟斤拷锟缴癸拷#tagPackResetOK
+
+
+
+public class DTC0316_tagPackResetOK : DtcBasic {
+
+ public override void Done(GameNetPackBasic vNetPack) {
+
+ base.Done(vNetPack);
+
+ H0316_tagPackResetOK vNetData = vNetPack as H0316_tagPackResetOK;
+ PackModel.Instance.PackResetOk(vNetData);
+ }
+
+}
+
diff --git a/Main/NetworkPackage/DTCFile/ServerPack/H03_MainCharacter/DTC0316_tagPackResetOK.cs.meta b/Main/NetworkPackage/DTCFile/ServerPack/H03_MainCharacter/DTC0316_tagPackResetOK.cs.meta
new file mode 100644
index 0000000..6bf5bba
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile/ServerPack/H03_MainCharacter/DTC0316_tagPackResetOK.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 7d757cfd20bf2ba48883d1053fe8d02c
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Main/NetworkPackage/DTCFile/ServerPack/H04_Scene.meta b/Main/NetworkPackage/DTCFile/ServerPack/H04_Scene.meta
new file mode 100644
index 0000000..0c72d1d
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile/ServerPack/H04_Scene.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 151028c5dded1b54f9139b01b1fe4aef
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/DTCFile/ServerPack/H04_Scene/DTC0403_tagPlayerLoginLoadOK.cs b/Main/NetworkPackage/DTCFile/ServerPack/H04_Scene/DTC0403_tagPlayerLoginLoadOK.cs
new file mode 100644
index 0000000..ec1da99
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile/ServerPack/H04_Scene/DTC0403_tagPlayerLoginLoadOK.cs
@@ -0,0 +1,123 @@
+using UnityEngine;
+using System.Collections;
+using System;
+using vnxbqy.UI;
+
+public class DTC0403_tagPlayerLoginLoadOK : DtcBasic
+{
+ public static bool neverLoginOk = true;
+ public static bool finishedLogin = false;
+ public static event Action playerLoginOkEvent;
+ public static event Action mapInitOkEvent;
+ // LoginModel loginModel { get { return ModelCenter.Instance.GetModel<LoginModel>(); } }
+
+ public override void Done(GameNetPackBasic vNetPack)
+ {
+ base.Done(vNetPack);
+ var vNetData = vNetPack as H0403_tagPlayerLoginLoadOK;
+ // StageLoadTimeOutCatcher.RecordProtocol(vNetPack.socketType, "0403", DateTime.Now);
+
+ GameNetSystem.Instance.netState = GameNetSystem.NetState.Connected;
+
+ finishedLogin = true;
+ // GA_Hero.s_MapSwitching = false;
+
+ // NetLinkWin.Hide();
+
+ // if (loginModel.reconnectBackGround)
+ // {
+ // WindowCenter.Instance.Close<LoadingWin>();
+ // }
+
+ switch (vNetData.socketType)
+ {
+ // case ServerType.Main:
+ // loginModel.reconnectBackGround = false;
+ // break;
+ // case ServerType.CrossSever:
+ // GameNetSystem.Instance.crossServerConnected_Loigc = true;
+ // CrossServerLogin.Instance.reconnectBackGround = false;
+ // CrossServerLogin.Instance.StopLoginOverTimeProcess();
+ // break;
+ default:
+ break;
+ }
+
+ if (neverLoginOk)
+ {
+ try
+ {
+ if (vNetData.socketType == ServerType.Main)
+ {
+ if (playerLoginOkEvent != null)
+ {
+ playerLoginOkEvent();
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ Debug.Log(ex);
+ }
+ finally
+ {
+ neverLoginOk = false;
+ }
+ }
+
+ if (mapInitOkEvent != null)
+ {
+ mapInitOkEvent();
+ }
+
+
+ //锟叫碉拷图锟斤拷锟斤拷pk boss状态
+ PlayerDatas.Instance.extersion.bossState = 2;
+ PlayerDatas.Instance.extersion.pkState = 2;
+
+ // if (PlayerDatas.Instance.hero != null)
+ // {
+ // if (CameraController.Instance)
+ // {
+ // CameraController.Instance.SetLookTarget(PlayerDatas.Instance.hero.Root);
+ // }
+ // }
+
+ // MapTransferUtility.Instance.CheckMap(PlayerDatas.Instance.baseData.MapID);
+
+ // if (MapTransferUtility.Instance.MapTransferDoType == MapTransferUtility.E_MapTransferDoType.Npc)
+ // {
+ // MapTransferUtility.Instance.MoveToNPC(MapTransferUtility.Instance.NpcID);
+ // }
+
+ //SettingMgr.Instance.SetIsRecordData(PlayerDatas.Instance.baseData.PlayerID.ToString());
+
+ // SnxxzGame.Instance.StartCoroutine(DelayHandleMapArea());
+ }
+
+ // IEnumerator DelayHandleMapArea()
+ // {
+ // yield return WaitingForSecondConst.WaitMS500;
+
+ // if (PlayerDatas.Instance.hero == null)
+ // {
+ // yield break;
+ // }
+
+ // var pack = ModelCenter.Instance.GetModel<PackModel>();
+ // var equipIndex = EquipSet.ClientPlaceToServerPlace(new Int2(0, (int)RoleEquipType.Guard));
+ // var _itemModel = pack.GetItemByIndex(PackType.Equip, equipIndex);
+ // if (_itemModel != null && _itemModel.itemInfo != null)
+ // {
+ // PlayerDatas.Instance.hero.SwitchGuard((uint)_itemModel.itemId);
+ // }
+
+ // bool _result = MapArea.IsInMapArea(PlayerDatas.Instance.hero.CurMapArea, MapArea.E_Type.Boss);
+
+ // if (MapArea.IsInMapArea(PlayerDatas.Instance.hero.CurMapArea, MapArea.E_Type.Boss))
+ // {
+ // PlayerDatas.Instance.hero.EnterArea((int)MapArea.E_Type.Boss);
+ // }
+ // }
+}
+
diff --git a/Main/NetworkPackage/DTCFile/ServerPack/H04_Scene/DTC0403_tagPlayerLoginLoadOK.cs.meta b/Main/NetworkPackage/DTCFile/ServerPack/H04_Scene/DTC0403_tagPlayerLoginLoadOK.cs.meta
new file mode 100644
index 0000000..c162f62
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile/ServerPack/H04_Scene/DTC0403_tagPlayerLoginLoadOK.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: d14cd171a6fcdfe4fb04e38aa5c76f8e
+timeCreated: 1502519191
+licenseType: Free
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem.meta b/Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem.meta
new file mode 100644
index 0000000..7992d61
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: dea76c2b985db4841b470faffdbc70be
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0704_tagRolePackRefresh.cs b/Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0704_tagRolePackRefresh.cs
new file mode 100644
index 0000000..350e914
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0704_tagRolePackRefresh.cs
@@ -0,0 +1,40 @@
+using UnityEngine;
+using System.Collections;
+using vnxbqy.UI;
+
+//07 04 锟斤拷锟角憋拷锟斤拷刷锟斤拷#tagRolePackRefresh
+
+
+
+public class DTC0704_tagRolePackRefresh : DtcBasic
+{
+ public override void Done(GameNetPackBasic vNetPack)
+ {
+ base.Done(vNetPack);
+ H0704_tagRolePackRefresh vNetData = vNetPack as H0704_tagRolePackRefresh;
+ PackModel.Instance.UpdateItem(vNetData);
+
+ // if (vNetData.PackType == 1)
+ // {
+ // var _hero = PlayerDatas.Instance.hero;
+ // if (_hero != null)
+ // {
+ // _hero.PutonEquip(vNetData.ItemID);
+
+ // if (vNetData.ItemPlace == 5)
+ // {
+ // if (vNetData.UserDataLen > 0)
+ // {
+ // var _jsonData = LitJson.JsonMapper.ToObject(vNetData.UserData);
+ // if ((_jsonData as IDictionary).Contains("210"))
+ // {
+ // _hero.horseAwakeId = int.Parse(_jsonData["210"][0].ToString());
+ // }
+ // }
+ // }
+ // }
+ // }
+ }
+
+}
+
diff --git a/Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0704_tagRolePackRefresh.cs.meta b/Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0704_tagRolePackRefresh.cs.meta
new file mode 100644
index 0000000..8a2dd55
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0704_tagRolePackRefresh.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: f399fea9e7fd81643b6121d0bd66b2a0
+timeCreated: 1498810221
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0706_tagUseItemSuccess.cs b/Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0706_tagUseItemSuccess.cs
new file mode 100644
index 0000000..d42ab01
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0706_tagUseItemSuccess.cs
@@ -0,0 +1,15 @@
+using UnityEngine;
+using System.Collections;
+using vnxbqy.UI;
+
+//07 06 锟斤拷锟绞癸拷锟斤拷锟狡凤拷晒锟�#tagUseItemSuccess
+public class DTC0706_tagUseItemSuccess : DtcBasic
+{
+ public override void Done(GameNetPackBasic vNetPack)
+ {
+ base.Done(vNetPack);
+ H0706_tagUseItemSuccess vNetData = vNetPack as H0706_tagUseItemSuccess;
+ PackModel.Instance.UseItemSuccess(vNetData);
+ }
+}
+
diff --git a/Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0706_tagUseItemSuccess.cs.meta b/Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0706_tagUseItemSuccess.cs.meta
new file mode 100644
index 0000000..56b7472
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0706_tagUseItemSuccess.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 90f05649170f40141849f4dd053a736f
+timeCreated: 1498812650
+licenseType: Free
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0707_tagItemCountRefresh.cs b/Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0707_tagItemCountRefresh.cs
new file mode 100644
index 0000000..62b9b1e
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0707_tagItemCountRefresh.cs
@@ -0,0 +1,19 @@
+using UnityEngine;
+using System.Collections;
+using vnxbqy.UI;
+
+//07 07 锟斤拷品锟斤拷锟斤拷刷锟斤拷#tagItemCountRefresh
+
+
+public class DTC0707_tagItemCountRefresh : DtcBasic
+{
+ public override void Done(GameNetPackBasic vNetPack)
+ {
+ base.Done(vNetPack);
+ H0707_tagItemCountRefresh vNetData = vNetPack as H0707_tagItemCountRefresh;
+ Debug.Log(707 + "刷锟斤拷锟斤拷锟斤拷");
+ PackModel.Instance.RefreshItemCount(vNetData);
+ }
+
+}
+
diff --git a/Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0707_tagItemCountRefresh.cs.meta b/Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0707_tagItemCountRefresh.cs.meta
new file mode 100644
index 0000000..ab43d62
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0707_tagItemCountRefresh.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 09f138407066f5845a1073fadea5aef4
+timeCreated: 1498812649
+licenseType: Free
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0709_tagClearItem.cs b/Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0709_tagClearItem.cs
new file mode 100644
index 0000000..d9f7669
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0709_tagClearItem.cs
@@ -0,0 +1,33 @@
+using UnityEngine;
+using System.Collections;
+using vnxbqy.UI;
+
+//07 09 锟斤拷锟斤拷锟狡�#tagClearItem
+
+
+
+public class DTC0709_tagClearItem : DtcBasic
+{
+ /** 删锟斤拷锟斤拷品锟铰硷拷锟斤拷锟斤拷 */
+ public delegate void ItemChangeHandler(int type, int index);
+ public static event ItemChangeHandler ItemChangeEvent;
+ public override void Done(GameNetPackBasic vNetPack)
+ {
+ base.Done(vNetPack);
+
+ H0709_tagClearItem vNetData = vNetPack as H0709_tagClearItem;
+ PackModel.Instance.RemoveItem(vNetData);
+
+ // if (vNetData.PackType == 1)
+ // {
+ // var _hero = PlayerDatas.Instance.hero;
+ // if (_hero != null)
+ // {
+ // _hero.TakeoffEquip(vNetData.ItemIndex);
+ // }
+ // }
+
+ }
+
+}
+
diff --git a/Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0709_tagClearItem.cs.meta b/Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0709_tagClearItem.cs.meta
new file mode 100644
index 0000000..9ad103a
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0709_tagClearItem.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 0a7bfb9b8c9825d4581968fd689f68bf
+timeCreated: 1498812649
+licenseType: Free
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0711_tagClearItemPack.cs b/Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0711_tagClearItemPack.cs
new file mode 100644
index 0000000..40d5dfc
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0711_tagClearItemPack.cs
@@ -0,0 +1,17 @@
+using UnityEngine;
+using System.Collections;
+using vnxbqy.UI;
+//07 11 锟斤拷毡锟斤拷锟�#tagClearItemPack
+
+
+public class DTC0711_tagClearItemPack : DtcBasic
+{
+ public override void Done(GameNetPackBasic vNetPack)
+ {
+ base.Done(vNetPack);
+ H0711_tagClearItemPack vNetData = vNetPack as H0711_tagClearItemPack;
+ PackModel.Instance.ClearPack(vNetData);
+ }
+
+}
+
diff --git a/Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0711_tagClearItemPack.cs.meta b/Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0711_tagClearItemPack.cs.meta
new file mode 100644
index 0000000..9effd9e
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0711_tagClearItemPack.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 1222fcb935c6f7f41a5bb3472070f471
+timeCreated: 1498812649
+licenseType: Free
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0724_tagRolePackCanUseCount.cs b/Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0724_tagRolePackCanUseCount.cs
new file mode 100644
index 0000000..59633cf
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0724_tagRolePackCanUseCount.cs
@@ -0,0 +1,17 @@
+using UnityEngine;
+using System.Collections;
+using vnxbqy.UI;
+
+//07 24 锟斤拷锟角憋拷锟斤拷锟窖匡拷锟斤拷锟斤拷锟斤拷#tagRolePackCanUseCount
+
+public class DTC0724_tagRolePackCanUseCount : DtcBasic
+{
+ public override void Done(GameNetPackBasic vNetPack)
+ {
+ base.Done(vNetPack);
+ H0724_tagRolePackCanUseCount vNetData = vNetPack as H0724_tagRolePackCanUseCount;
+ PackModel.Instance.UpdateUnlockedGridCount(vNetData);
+ }
+
+}
+
diff --git a/Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0724_tagRolePackCanUseCount.cs.meta b/Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0724_tagRolePackCanUseCount.cs.meta
new file mode 100644
index 0000000..baa55eb
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0724_tagRolePackCanUseCount.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: d597f8060bbc1544cb43384ee50c5e2c
+timeCreated: 1498807363
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0725_tagRolePackRefreshEx.cs b/Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0725_tagRolePackRefreshEx.cs
new file mode 100644
index 0000000..b63fc10
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0725_tagRolePackRefreshEx.cs
@@ -0,0 +1,42 @@
+using UnityEngine;
+using System.Collections;
+using vnxbqy.UI;
+
+//07 25 锟斤拷锟角憋拷锟斤拷刷锟铰o拷通知锟斤拷锟斤拷锟斤拷品锟斤拷 #tagRolePackRefreshEx
+
+
+
+public class DTC0725_tagRolePackRefreshEx : DtcBasic
+{
+ public override void Done(GameNetPackBasic vNetPack)
+ {
+ base.Done(vNetPack);
+ H0725_tagRolePackRefreshEx vNetData = vNetPack as H0725_tagRolePackRefreshEx;
+ PackModel.Instance.UpdatePack(vNetData);
+
+ // if (vNetData.PackType == 1)
+ // {
+ // if (vNetData.ItemCount > 0)
+ // {
+ // foreach (var _item in vNetData.ItemInfo)
+ // {
+ // var _hero = PlayerDatas.Instance.hero;
+ // if (_hero != null)
+ // {
+ // _hero.PutonEquip(_item.ItemID);
+
+ // if (_item.UserDataLen > 0)
+ // {
+ // var _jsonData = LitJson.JsonMapper.ToObject(_item.UserData);
+ // if ((_jsonData as IDictionary).Contains("210"))
+ // {
+ // _hero.horseAwakeId = int.Parse(_jsonData["210"][0].ToString());
+ // }
+ // }
+ // }
+ // }
+ // }
+ // }
+ }
+}
+
diff --git a/Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0725_tagRolePackRefreshEx.cs.meta b/Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0725_tagRolePackRefreshEx.cs.meta
new file mode 100644
index 0000000..b14d324
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile/ServerPack/H07_PlayerItem/DTC0725_tagRolePackRefreshEx.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 1e7997509c7d1e541bafb76d6a70f4c5
+timeCreated: 1511947216
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/DTCFile/ServerPack/HA2_Package.meta b/Main/NetworkPackage/DTCFile/ServerPack/HA2_Package.meta
new file mode 100644
index 0000000..d27579b
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile/ServerPack/HA2_Package.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 5f7a41c173ee5c64f8784065d403d859
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/DTCFile/ServerPack/HA2_Package/DTCA202_tagMCAttackMode.cs b/Main/NetworkPackage/DTCFile/ServerPack/HA2_Package/DTCA202_tagMCAttackMode.cs
new file mode 100644
index 0000000..e7b88dc
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile/ServerPack/HA2_Package/DTCA202_tagMCAttackMode.cs
@@ -0,0 +1,40 @@
+锘縰sing UnityEngine;
+
+public class DTCA202_tagMCAttackMode : DtcBasic
+{
+ public static void Send_SwitchAttackMode(E_AttackMode attackMode)
+ {
+ var _proto = new C030A_tagCChangeAttackMode();
+ _proto.Mode = (byte)attackMode;
+ if (CrossServerUtility.IsCrossServer())
+ {
+ GameNetSystem.Instance.SendToCrossServer(_proto);
+ }
+ else
+ {
+ GameNetSystem.Instance.SendInfo(_proto);
+ }
+ }
+
+ public override void Done(GameNetPackBasic vNetPack)
+ {
+ base.Done(vNetPack);
+
+ HA202_tagMCAttackMode vNetData = vNetPack as HA202_tagMCAttackMode;
+
+ if (vNetData == null)
+ {
+ return;
+ }
+
+ if (CrossServerUtility.IsCrossServer())
+ {
+ if (vNetData.socketType == ServerType.Main)
+ {
+ return;
+ }
+ }
+
+ PlayerDatas.Instance.OnRecv_SwitchAttackMode(vNetData.Mode);
+ }
+}
\ No newline at end of file
diff --git a/Main/NetworkPackage/DTCFile/ServerPack/HA2_Package/DTCA202_tagMCAttackMode.cs.meta b/Main/NetworkPackage/DTCFile/ServerPack/HA2_Package/DTCA202_tagMCAttackMode.cs.meta
new file mode 100644
index 0000000..32f2016
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile/ServerPack/HA2_Package/DTCA202_tagMCAttackMode.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 77bfc043a579afa478ba6d587e809dc9
+timeCreated: 1508313923
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/DTCFile/ServerPack/HA2_Package/DTCA204_tagMCVPackRefresh.cs b/Main/NetworkPackage/DTCFile/ServerPack/HA2_Package/DTCA204_tagMCVPackRefresh.cs
new file mode 100644
index 0000000..0a32e98
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile/ServerPack/HA2_Package/DTCA204_tagMCVPackRefresh.cs
@@ -0,0 +1,17 @@
+using UnityEngine;
+using System.Collections;
+using vnxbqy.UI;
+
+// A2 04 锟斤拷锟解背锟斤拷锟斤拷品刷锟斤拷 #tagMCVPackRefresh
+
+public class DTCA204_tagMCVPackRefresh : DtcBasic
+{
+ public override void Done(GameNetPackBasic vNetPack)
+ {
+ base.Done(vNetPack);
+ HA204_tagMCVPackRefresh vNetData = vNetPack as HA204_tagMCVPackRefresh;
+ VirtualPackModel.Instance.OnReceiveServerPack(vNetData);
+ }
+
+}
+
diff --git a/Main/NetworkPackage/DTCFile/ServerPack/HA2_Package/DTCA204_tagMCVPackRefresh.cs.meta b/Main/NetworkPackage/DTCFile/ServerPack/HA2_Package/DTCA204_tagMCVPackRefresh.cs.meta
new file mode 100644
index 0000000..17b9d9b
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile/ServerPack/HA2_Package/DTCA204_tagMCVPackRefresh.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: bcb9f5315bd53bf498dbd7a12164aa2b
+timeCreated: 1501835018
+licenseType: Free
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/DTCFile/ServerPack/HA2_Package/DTCA205_tagMCVPackClear.cs b/Main/NetworkPackage/DTCFile/ServerPack/HA2_Package/DTCA205_tagMCVPackClear.cs
new file mode 100644
index 0000000..166b99f
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile/ServerPack/HA2_Package/DTCA205_tagMCVPackClear.cs
@@ -0,0 +1,19 @@
+using UnityEngine;
+using System.Collections;
+using vnxbqy.UI;
+
+// A2 05 锟斤拷锟解背锟斤拷锟斤拷品锟斤拷锟� #tagMCVPackClear
+
+
+
+public class DTCA205_tagMCVPackClear : DtcBasic
+{
+ public override void Done(GameNetPackBasic vNetPack)
+ {
+ base.Done(vNetPack);
+ HA205_tagMCVPackClear vNetData = vNetPack as HA205_tagMCVPackClear;
+ VirtualPackModel.Instance.OnReceiveServerPack(vNetData);
+ }
+
+}
+
diff --git a/Main/NetworkPackage/DTCFile/ServerPack/HA2_Package/DTCA205_tagMCVPackClear.cs.meta b/Main/NetworkPackage/DTCFile/ServerPack/HA2_Package/DTCA205_tagMCVPackClear.cs.meta
new file mode 100644
index 0000000..2668787
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile/ServerPack/HA2_Package/DTCA205_tagMCVPackClear.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 19aaacc5877b03c419bce5e3a1c59559
+timeCreated: 1502090684
+licenseType: Free
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/DTCFile/ServerPack/HA2_Package/DTCA206_tagMCAutoItemCountRefresh.cs b/Main/NetworkPackage/DTCFile/ServerPack/HA2_Package/DTCA206_tagMCAutoItemCountRefresh.cs
new file mode 100644
index 0000000..94094bb
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile/ServerPack/HA2_Package/DTCA206_tagMCAutoItemCountRefresh.cs
@@ -0,0 +1,13 @@
+using UnityEngine;
+using System.Collections;
+using vnxbqy.UI;
+
+// A2 06 鑷姩杞寲涓哄搴旂墿鍝両D涓暟鍒锋柊 #tagMCAutoItemCountRefresh
+
+public class DTCA206_tagMCAutoItemCountRefresh : DtcBasic {
+ public override void Done(GameNetPackBasic vNetPack) {
+ base.Done(vNetPack);
+ HA206_tagMCAutoItemCountRefresh vNetData = vNetPack as HA206_tagMCAutoItemCountRefresh;
+ VirtualPackModel.Instance.UpdateAutoItemCountRefresh(vNetData);
+ }
+}
diff --git a/Main/NetworkPackage/DTCFile/ServerPack/HA2_Package/DTCA206_tagMCAutoItemCountRefresh.cs.meta b/Main/NetworkPackage/DTCFile/ServerPack/HA2_Package/DTCA206_tagMCAutoItemCountRefresh.cs.meta
new file mode 100644
index 0000000..090ac8a
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile/ServerPack/HA2_Package/DTCA206_tagMCAutoItemCountRefresh.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: afad8a5bbbcca1e428b45fbc4f431320
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/DTCFile/ServerPack/HA3_Function.meta b/Main/NetworkPackage/DTCFile/ServerPack/HA3_Function.meta
new file mode 100644
index 0000000..f757333
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile/ServerPack/HA3_Function.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: e910e27bfb211ad438940b36e9680e66
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA362_tagMCMailList.cs b/Main/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA362_tagMCMailList.cs
new file mode 100644
index 0000000..ffee400
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA362_tagMCMailList.cs
@@ -0,0 +1,10 @@
+// A3 62 閭欢鍒楄〃 #tagMCMailList
+public class DTCA362_tagMCMailList : DtcBasic
+{
+ public override void Done(GameNetPackBasic vNetPack)
+ {
+ base.Done(vNetPack);
+ HA362_tagMCMailList vNetData = vNetPack as HA362_tagMCMailList;
+ MailModel.Instance.UpdateMailList(vNetData);
+ }
+}
diff --git a/Main/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA362_tagMCMailList.cs.meta b/Main/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA362_tagMCMailList.cs.meta
new file mode 100644
index 0000000..5e715ab
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA362_tagMCMailList.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: eeac130543accfc4286a62a43fd536dd
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA363_tagMCMailStateChange.cs b/Main/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA363_tagMCMailStateChange.cs
new file mode 100644
index 0000000..09b624e
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA363_tagMCMailStateChange.cs
@@ -0,0 +1,10 @@
+// A3 63 閭欢鐘舵�佸彉鏇� #tagMCMailStateChange
+public class DTCA363_tagMCMailStateChange : DtcBasic
+{
+ public override void Done(GameNetPackBasic vNetPack)
+ {
+ base.Done(vNetPack);
+ HA363_tagMCMailStateChange vNetData = vNetPack as HA363_tagMCMailStateChange;
+ MailModel.Instance.UpdateMailStateChange(vNetData);
+ }
+}
diff --git a/Main/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA363_tagMCMailStateChange.cs.meta b/Main/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA363_tagMCMailStateChange.cs.meta
new file mode 100644
index 0000000..b0b6131
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile/ServerPack/HA3_Function/DTCA363_tagMCMailStateChange.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: fffd7f8a755a9e545b8df4bb0375de89
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/DTCFile/ServerPack/HA8_Item.meta b/Main/NetworkPackage/DTCFile/ServerPack/HA8_Item.meta
new file mode 100644
index 0000000..1270e33
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile/ServerPack/HA8_Item.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: b23a6a4659cb7dd4fa73342d42c9ed47
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/DTCFile/ServerPack/HA8_Item/DTCA801_tagMCGiveAwardInfo.cs b/Main/NetworkPackage/DTCFile/ServerPack/HA8_Item/DTCA801_tagMCGiveAwardInfo.cs
new file mode 100644
index 0000000..e1fc30e
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile/ServerPack/HA8_Item/DTCA801_tagMCGiveAwardInfo.cs
@@ -0,0 +1,13 @@
+using UnityEngine;
+using System.Collections;
+using vnxbqy.UI;
+// A8 01 鑾峰緱濂栧姳淇℃伅 #tagMCGiveAwardInfo
+
+public class DTCA801_tagMCGiveAwardInfo : DtcBasic {
+ public override void Done(GameNetPackBasic vNetPack)
+ {
+ base.Done(vNetPack);
+ HA801_tagMCGiveAwardInfo vNetData = vNetPack as HA801_tagMCGiveAwardInfo;
+ PackModel.Instance.ReceiveAwardNotify(vNetData);
+ }
+}
diff --git a/Main/NetworkPackage/DTCFile/ServerPack/HA8_Item/DTCA801_tagMCGiveAwardInfo.cs.meta b/Main/NetworkPackage/DTCFile/ServerPack/HA8_Item/DTCA801_tagMCGiveAwardInfo.cs.meta
new file mode 100644
index 0000000..7abc0fc
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile/ServerPack/HA8_Item/DTCA801_tagMCGiveAwardInfo.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 634e0ffbc9e9eb44992d2a3378bfa0e8
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/DTCFile/ServerPack/HA8_Item/DTCA809_tagMCItemDayUseCntInfo.cs b/Main/NetworkPackage/DTCFile/ServerPack/HA8_Item/DTCA809_tagMCItemDayUseCntInfo.cs
new file mode 100644
index 0000000..9b464ea
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile/ServerPack/HA8_Item/DTCA809_tagMCItemDayUseCntInfo.cs
@@ -0,0 +1,13 @@
+using UnityEngine;
+using System.Collections;
+using vnxbqy.UI;
+// A8 09 閫氱煡鐗╁搧褰撴棩宸蹭娇鐢ㄦ鏁� #tagMCItemDayUseCntInfo
+
+public class DTCA809_tagMCItemDayUseCntInfo : DtcBasic {
+ public override void Done(GameNetPackBasic vNetPack)
+ {
+ base.Done(vNetPack);
+ HA809_tagMCItemDayUseCntInfo vNetData = vNetPack as HA809_tagMCItemDayUseCntInfo;
+ PackModel.Instance.UpdateItemUseCnt(vNetData);
+ }
+}
diff --git a/Main/NetworkPackage/DTCFile/ServerPack/HA8_Item/DTCA809_tagMCItemDayUseCntInfo.cs.meta b/Main/NetworkPackage/DTCFile/ServerPack/HA8_Item/DTCA809_tagMCItemDayUseCntInfo.cs.meta
new file mode 100644
index 0000000..42fc162
--- /dev/null
+++ b/Main/NetworkPackage/DTCFile/ServerPack/HA8_Item/DTCA809_tagMCItemDayUseCntInfo.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 475510ddb345dad4eb69ec6c5c621d17
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/ServerPack.meta b/Main/NetworkPackage/ServerPack.meta
new file mode 100644
index 0000000..31258f5
--- /dev/null
+++ b/Main/NetworkPackage/ServerPack.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: e5cfd1e8add258a47a1a83db5fb4e888
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/ServerPack/H01_System.meta b/Main/NetworkPackage/ServerPack/H01_System.meta
new file mode 100644
index 0000000..1b35163
--- /dev/null
+++ b/Main/NetworkPackage/ServerPack/H01_System.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 93f9f3ef663ca5840ac149a8c2cf8740
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/ServerPack/H01_System/H0102_tagCDBPlayer.cs b/Main/NetworkPackage/ServerPack/H01_System/H0102_tagCDBPlayer.cs
new file mode 100644
index 0000000..50bbf52
--- /dev/null
+++ b/Main/NetworkPackage/ServerPack/H01_System/H0102_tagCDBPlayer.cs
@@ -0,0 +1,215 @@
+using UnityEngine;
+using System.Collections;
+
+//01 02 鐜╁鍒濆鍖�#tagCDBPlayer
+
+public class H0102_tagCDBPlayer : GameNetPackBasic {
+ public string AccID; //_KEY_i_甯愬彿鍚�, 璇ヨ鑹叉墍鍦ㄧ殑甯愬彿鐨勭敤鎴峰悕
+ public uint PlayerID; //_IDT_
+ public string PlayerName; //size = 14
+ public byte AccState; //0: 鏈垱寤�, 1: 鍒涘缓OK,姝e父鐧诲綍 2:灏佸彿 3:宸插垹闄�
+ public byte GMLevel; //GM绛夌骇, 0:涓嶆槸GM >=1 : GM鐨勭瓑绾�
+ public byte Sex; //鎬у埆
+ public byte Job; //鑱屼笟, 0.鏂版墜 1.娓镐緺 2.鎴樺+ 3.寮撶鎵� 4.鏈+ 5.閬撳+
+ public ushort ReincarnationLv; // 杞敓绛夌骇
+ public ushort LV; //绛夌骇
+ public ushort LVEx; //鐜╁绛夌骇鍓湰锛岀敤浜庤浆鐢�
+ public ushort LV2; //澶у笀绛夌骇
+ public uint ExpPoint; //鎵╁厖缁忛獙鐐规暟
+ public uint TotalExp; //鎬荤粡楠�
+ public uint Family; //瀹舵棌
+ public string FamilyName; //瀹舵棌鍚嶇О
+ public int TeamHornor; //缁勯槦鑽h獕
+ public int FamilyHornor; //瀹舵棌鑽h��
+ public int FamilyActiveValue; //瀹舵棌娲昏穬搴�
+ public int LastWeekFamilyActiveValue; //涓婂懆瀹舵棌娲昏穬搴�
+ public int CountryHornor; //鏈懆鍥藉鍔熷媼鍊�
+ public int CountryLastWeekHornor; //涓婂懆鍥藉鍔熷媼鍊�
+ public uint Mate;
+ public uint Gold; //閲戝瓙
+ public uint GoldPaper; //閲戠エ
+ public uint Silver; //閾跺瓙
+ public uint SilverPaper; //閾剁エ
+ public uint FightPoint; //鎴樻枟鍊�
+ public uint HappyPoint; //
+ public byte LineID; //瑙掕壊鎵�鍦ㄧ嚎璺�
+ public ushort MapID; //瑙掕壊鎵�鍦ㄥ湴鍥�
+ public ushort PosX; //瑙掕壊鍧愭爣
+ public ushort PosY;
+ public ushort RebornMapID; //閲嶇敓鐐瑰湴鍥綢D
+ public ushort RebornPosX;
+ public ushort RebornPosY;
+ public byte State; //瑙掕壊鐘舵�� 0.姝e父鍦ㄧ嚎1.鑴辨満鎸傚湪绾� 2鑴辨満鎸傛浜�
+ public uint HP; //褰撳墠HP
+ public uint XP; //褰撳墠XP
+ public ushort HPRestoreSetting; //灏戜簬杩欎釜鍊�%鑷姩鍠濊
+ public ushort MPRestoreSetting; //灏戜簬杩欎釜鍊�%鑷姩鍠濋瓟
+ public uint FreePoint; //鏈垎閰嶇偣鏁�
+ public uint FreeSkillPoint; //鏈垎閰嶇殑鎶�鑳界偣
+ public int BaseSTR; //瑁镐綋鍔涢噺
+ public int BasePNE; //瑁镐綋鐪熷厓
+ public int BasePHY; //瑁镐綋绛嬮
+ public int BaseCON; //瑁镐綋浣撻瓌
+ public int STR; //鍔涢噺
+ public int PNE; //鐪熷厓
+ public int PHY; //绛嬮
+ public int CON; //浣撻瓌
+ public string Setting; //璁惧畾
+ public ushort PKValue; //琛¢噺PK鑳藉姏鐨勪竴椤瑰睘鎬э紝鐢辨敾闃茶绠楄�屽緱
+ public ushort ActiveValue; //鍑绘潃鏁屽浗闃佃惀鐜╁鍜孨PC鐨勭粺璁″��
+ public byte BackpackLV; //鑳屽寘绛夌骇
+ public byte WarehouseLV; //浠撳簱绛夌骇
+ public uint TeamID; //闃熶紞ID
+ public byte UseGoldType; //榛樿鐢ㄩ噾瀛�/閲戠エ 绫诲瀷涓篗oneyType
+ public byte UseSilverType; //榛樿鐢ㄧ殑閾跺瓙/閾剁エ
+ public byte AttackMode; //鏀诲嚮妯″紡
+ public uint LastWeekOnlineTime; //涓婂懆鍦ㄧ嚎鏃堕棿
+ public byte FBID; //fb id
+ public byte FamilyLV; //瀹舵棌绛夌骇
+ public uint FriendFavor; //濂藉弸浜烘皵鍊�
+ public uint Energy; //绮惧姏鍊�
+ public uint EquipShowSwitch; //瑁呭鏄剧ず寮�鍏�
+ public uint LuckValue; //骞歌繍鍊�
+ public uint ExAttr1; //鎵╁睍灞炴��1锛屽悇椤圭洰涓撶敤
+ public uint ExAttr2; //鎵╁睍灞炴��2锛屽悇椤圭洰涓撶敤
+ public uint ExAttr3; //鎵╁睍灞炴��3锛屽悇椤圭洰涓撶敤
+ public uint ExAttr4; //鎵╁睍灞炴��4锛屽悇椤圭洰涓撶敤
+ public uint ExAttr5; //鎵╁睍灞炴��5锛屽悇椤圭洰涓撶敤
+ public byte Faction; //闃佃惀
+ public uint InfamyValue; //鎭跺悕鍊�
+ public byte OfficialRank; //瀹橀樁锛屽畼鑱岀瓑绾�
+ public uint ChangeCoinPointTotal; //鍏戞崲鐨勭偣鏁版�昏
+ public byte VIPLv; //VIP绛夌骇
+ public byte VIPLvForPhone; //绉诲姩VIP绛夌骇
+ public uint ExAttr6; //鎵╁睍灞炴��6锛屽悇椤圭洰涓撶敤
+ public uint ExAttr7; //鎵╁睍灞炴��7锛屽悇椤圭洰涓撶敤
+ public uint ExAttr8; //鎵╁睍灞炴��8锛屽悇椤圭洰涓撶敤
+ public uint ExAttr9; //鎵╁睍灞炴��9锛屽悇椤圭洰涓撶敤
+ public uint ExAttr10; //鎵╁睍灞炴��10锛屽悇椤圭洰涓撶敤
+ public uint ModelMark; // 鍙樺舰妯″瀷mark
+ public uint ExAttr11; //棰勭暀鐨勬墿灞曞睘鎬у瓧娈碉紝鐢ㄦ潵瀛樻斁椤圭洰鐗瑰畾鐨勫睘鎬�
+ public uint ExAttr12; //棰勭暀鐨勬墿灞曞睘鎬у瓧娈碉紝鐢ㄦ潵瀛樻斁椤圭洰鐗瑰畾鐨勫睘鎬�
+ public uint ExAttr13; //棰勭暀鐨勬墿灞曞睘鎬у瓧娈碉紝鐢ㄦ潵瀛樻斁椤圭洰鐗瑰畾鐨勫睘鎬�
+ public uint ExAttr14; //棰勭暀鐨勬墿灞曞睘鎬у瓧娈碉紝鐢ㄦ潵瀛樻斁椤圭洰鐗瑰畾鐨勫睘鎬�
+ public uint OperateInfo; //鐜╁闄勫姞杩愯惀鍟嗕俊鎭�
+ public string Operate; //鎵�灞炶繍钀ュ晢骞冲彴鍚�
+ public uint ServerID; //鎵�灞炲尯鏈岻D
+ public uint ExAttr15; //棰勭暀鐨勬墿灞曞睘鎬у瓧娈碉紝鐢ㄦ潵瀛樻斁椤圭洰鐗瑰畾鐨勫睘鎬�
+ public uint ExAttr16; //棰勭暀鐨勬墿灞曞睘鎬у瓧娈碉紝鐢ㄦ潵瀛樻斁椤圭洰鐗瑰畾鐨勫睘鎬�
+ public uint ExAttr17; //棰勭暀鐨勬墿灞曞睘鎬у瓧娈碉紝鐢ㄦ潵瀛樻斁椤圭洰鐗瑰畾鐨勫睘鎬�
+ public uint ExAttr18; //棰勭暀鐨勬墿灞曞睘鎬у瓧娈碉紝鐢ㄦ潵瀛樻斁椤圭洰鐗瑰畾鐨勫睘鎬�
+ public uint ExAttr19; //棰勭暀鐨勬墿灞曞睘鎬у瓧娈碉紝鐢ㄦ潵瀛樻斁椤圭洰鐗瑰畾鐨勫睘鎬�
+ public uint ExAttr20; //棰勭暀鐨勬墿灞曞睘鎬у瓧娈碉紝鐢ㄦ潵瀛樻斁椤圭洰鐗瑰畾鐨勫睘鎬�
+ public uint HPEx; //褰撳墠琛�閲� 瓒呰繃E鐨勮褰�
+ public uint Face; //澶村儚
+ public uint FacePic; //澶村儚澶栨
+ public uint RoleType; //瑙掕壊绫诲瀷锛堝悇椤圭洰鍙嚜瀹氫箟鍚箟锛屽绉嶆棌锛屼笌鑱屼笟鍖哄垎锛�
+
+ public H0102_tagCDBPlayer () {
+ _cmd = (ushort)0x0102;
+ }
+
+ public override void ReadFromBytes (byte[] vBytes) {
+ TransBytes (out AccID, vBytes, NetDataType.Chars, 65);
+ TransBytes (out PlayerID, vBytes, NetDataType.DWORD);
+ TransBytes (out PlayerName, vBytes, NetDataType.Chars, 33);
+ TransBytes (out AccState, vBytes, NetDataType.BYTE);
+ TransBytes (out GMLevel, vBytes, NetDataType.BYTE);
+ TransBytes (out Sex, vBytes, NetDataType.BYTE);
+ TransBytes (out Job, vBytes, NetDataType.BYTE);
+ TransBytes (out ReincarnationLv, vBytes, NetDataType.WORD);
+ TransBytes (out LV, vBytes, NetDataType.WORD);
+ TransBytes (out LVEx, vBytes, NetDataType.WORD);
+ TransBytes (out LV2, vBytes, NetDataType.WORD);
+ TransBytes (out ExpPoint, vBytes, NetDataType.DWORD);
+ TransBytes (out TotalExp, vBytes, NetDataType.DWORD);
+ TransBytes (out Family, vBytes, NetDataType.DWORD);
+ TransBytes (out FamilyName, vBytes, NetDataType.Chars, 33);
+ TransBytes (out TeamHornor, vBytes, NetDataType.Int);
+ TransBytes (out FamilyHornor, vBytes, NetDataType.Int);
+ TransBytes (out FamilyActiveValue, vBytes, NetDataType.Int);
+ TransBytes (out LastWeekFamilyActiveValue, vBytes, NetDataType.Int);
+ TransBytes (out CountryHornor, vBytes, NetDataType.Int);
+ TransBytes (out CountryLastWeekHornor, vBytes, NetDataType.Int);
+ TransBytes (out Mate, vBytes, NetDataType.DWORD);
+ TransBytes (out Gold, vBytes, NetDataType.DWORD);
+ TransBytes (out GoldPaper, vBytes, NetDataType.DWORD);
+ TransBytes (out Silver, vBytes, NetDataType.DWORD);
+ TransBytes (out SilverPaper, vBytes, NetDataType.DWORD);
+ TransBytes (out FightPoint, vBytes, NetDataType.DWORD);
+ TransBytes (out HappyPoint, vBytes, NetDataType.DWORD);
+ TransBytes (out LineID, vBytes, NetDataType.BYTE);
+ TransBytes (out MapID, vBytes, NetDataType.WORD);
+ TransBytes (out PosX, vBytes, NetDataType.WORD);
+ TransBytes (out PosY, vBytes, NetDataType.WORD);
+ TransBytes (out RebornMapID, vBytes, NetDataType.WORD);
+ TransBytes (out RebornPosX, vBytes, NetDataType.WORD);
+ TransBytes (out RebornPosY, vBytes, NetDataType.WORD);
+ TransBytes (out State, vBytes, NetDataType.BYTE);
+ TransBytes (out HP, vBytes, NetDataType.DWORD);
+ TransBytes (out XP, vBytes, NetDataType.DWORD);
+ TransBytes (out HPRestoreSetting, vBytes, NetDataType.WORD);
+ TransBytes (out MPRestoreSetting, vBytes, NetDataType.WORD);
+ TransBytes (out FreePoint, vBytes, NetDataType.DWORD);
+ TransBytes (out FreeSkillPoint, vBytes, NetDataType.DWORD);
+ TransBytes (out BaseSTR, vBytes, NetDataType.Int);
+ TransBytes (out BasePNE, vBytes, NetDataType.Int);
+ TransBytes (out BasePHY, vBytes, NetDataType.Int);
+ TransBytes (out BaseCON, vBytes, NetDataType.Int);
+ TransBytes (out STR, vBytes, NetDataType.Int);
+ TransBytes (out PNE, vBytes, NetDataType.Int);
+ TransBytes (out PHY, vBytes, NetDataType.Int);
+ TransBytes (out CON, vBytes, NetDataType.Int);
+ TransBytes (out Setting, vBytes, NetDataType.Chars, 100);
+ TransBytes (out PKValue, vBytes, NetDataType.WORD);
+ TransBytes (out ActiveValue, vBytes, NetDataType.WORD);
+ TransBytes (out BackpackLV, vBytes, NetDataType.BYTE);
+ TransBytes (out WarehouseLV, vBytes, NetDataType.BYTE);
+ TransBytes (out TeamID, vBytes, NetDataType.DWORD);
+ TransBytes (out UseGoldType, vBytes, NetDataType.BYTE);
+ TransBytes (out UseSilverType, vBytes, NetDataType.BYTE);
+ TransBytes (out AttackMode, vBytes, NetDataType.BYTE);
+ TransBytes (out LastWeekOnlineTime, vBytes, NetDataType.DWORD);
+ TransBytes (out FBID, vBytes, NetDataType.BYTE);
+ TransBytes (out FamilyLV, vBytes, NetDataType.BYTE);
+ TransBytes (out FriendFavor, vBytes, NetDataType.DWORD);
+ TransBytes (out Energy, vBytes, NetDataType.DWORD);
+ TransBytes (out EquipShowSwitch, vBytes, NetDataType.DWORD);
+ TransBytes (out LuckValue, vBytes, NetDataType.DWORD);
+ TransBytes (out ExAttr1, vBytes, NetDataType.DWORD);
+ TransBytes (out ExAttr2, vBytes, NetDataType.DWORD);
+ TransBytes (out ExAttr3, vBytes, NetDataType.DWORD);
+ TransBytes (out ExAttr4, vBytes, NetDataType.DWORD);
+ TransBytes (out ExAttr5, vBytes, NetDataType.DWORD);
+ TransBytes (out Faction, vBytes, NetDataType.BYTE);
+ TransBytes (out InfamyValue, vBytes, NetDataType.DWORD);
+ TransBytes (out OfficialRank, vBytes, NetDataType.BYTE);
+ TransBytes (out ChangeCoinPointTotal, vBytes, NetDataType.DWORD);
+ TransBytes (out VIPLv, vBytes, NetDataType.BYTE);
+ TransBytes (out VIPLvForPhone, vBytes, NetDataType.BYTE);
+ TransBytes (out ExAttr6, vBytes, NetDataType.DWORD);
+ TransBytes (out ExAttr7, vBytes, NetDataType.DWORD);
+ TransBytes (out ExAttr8, vBytes, NetDataType.DWORD);
+ TransBytes (out ExAttr9, vBytes, NetDataType.DWORD);
+ TransBytes (out ExAttr10, vBytes, NetDataType.DWORD);
+ TransBytes (out ModelMark, vBytes, NetDataType.DWORD);
+ TransBytes (out ExAttr11, vBytes, NetDataType.DWORD);
+ TransBytes (out ExAttr12, vBytes, NetDataType.DWORD);
+ TransBytes (out ExAttr13, vBytes, NetDataType.DWORD);
+ TransBytes (out ExAttr14, vBytes, NetDataType.DWORD);
+ TransBytes (out OperateInfo, vBytes, NetDataType.DWORD);
+ TransBytes (out Operate, vBytes, NetDataType.Chars, 15);
+ TransBytes (out ServerID, vBytes, NetDataType.DWORD);
+ TransBytes (out ExAttr15, vBytes, NetDataType.DWORD);
+ TransBytes (out ExAttr16, vBytes, NetDataType.DWORD);
+ TransBytes (out ExAttr17, vBytes, NetDataType.DWORD);
+ TransBytes (out ExAttr18, vBytes, NetDataType.DWORD);
+ TransBytes (out ExAttr19, vBytes, NetDataType.DWORD);
+ TransBytes (out ExAttr20, vBytes, NetDataType.DWORD);
+ TransBytes (out HPEx, vBytes, NetDataType.DWORD);
+ TransBytes (out Face, vBytes, NetDataType.DWORD);
+ TransBytes (out FacePic, vBytes, NetDataType.DWORD);
+ TransBytes (out RoleType, vBytes, NetDataType.DWORD);
+ }
+
+}
diff --git a/Main/NetworkPackage/ServerPack/H01_System/H0102_tagCDBPlayer.cs.meta b/Main/NetworkPackage/ServerPack/H01_System/H0102_tagCDBPlayer.cs.meta
new file mode 100644
index 0000000..aca8560
--- /dev/null
+++ b/Main/NetworkPackage/ServerPack/H01_System/H0102_tagCDBPlayer.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: ca0859fed1012bd4c9d6b4ab3515ade7
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Main/NetworkPackage/ServerPack/H02_PlayerTalk.meta b/Main/NetworkPackage/ServerPack/H02_PlayerTalk.meta
new file mode 100644
index 0000000..9a8196b
--- /dev/null
+++ b/Main/NetworkPackage/ServerPack/H02_PlayerTalk.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 7bb8fa49867ae70418e84daa705d2760
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/ServerPack/H02_PlayerTalk/H0212_tagNotifyCode.cs b/Main/NetworkPackage/ServerPack/H02_PlayerTalk/H0212_tagNotifyCode.cs
new file mode 100644
index 0000000..4886721
--- /dev/null
+++ b/Main/NetworkPackage/ServerPack/H02_PlayerTalk/H0212_tagNotifyCode.cs
@@ -0,0 +1,66 @@
+using UnityEngine;
+using System.Collections;
+
+//02 12 代码提示#tagNotifyCode
+
+
+
+public class H0212_tagNotifyCode : GameNetPackBasic {
+
+ public byte MsgLen; //表中的msg信息
+
+ public string Msg; //size = MsgLen
+
+ public byte ParCount;
+
+ public tagNotifyStr[] Pars = null; //size = ParCount
+
+
+
+ public H0212_tagNotifyCode () {
+
+ _cmd = (ushort)0x0212;
+
+ }
+
+
+
+ public override void ReadFromBytes (byte[] vBytes) {
+
+ TransBytes (out MsgLen, vBytes, NetDataType.BYTE);
+
+ TransBytes (out Msg, vBytes, NetDataType.Chars, MsgLen);
+
+ TransBytes (out ParCount, vBytes, NetDataType.BYTE);
+
+ Pars = new tagNotifyStr[ParCount];
+
+ for (int i = 0; i < ParCount; i++) {
+
+ Pars[i] = new tagNotifyStr();
+
+ TransBytes (out Pars[i].MsgInt, vBytes, NetDataType.DWORD);
+
+ TransBytes (out Pars[i].Len, vBytes, NetDataType.BYTE);
+
+ TransBytes (out Pars[i].Msg, vBytes, NetDataType.Chars, Pars[i].Len);
+ }
+
+ }
+
+
+
+ public class tagNotifyStr {
+
+ public uint MsgInt; //int类型
+
+ public byte Len;
+
+ public string Msg; //size = Len
+
+ }
+
+
+
+}
+
diff --git a/Main/NetworkPackage/ServerPack/H02_PlayerTalk/H0212_tagNotifyCode.cs.meta b/Main/NetworkPackage/ServerPack/H02_PlayerTalk/H0212_tagNotifyCode.cs.meta
new file mode 100644
index 0000000..eccbf42
--- /dev/null
+++ b/Main/NetworkPackage/ServerPack/H02_PlayerTalk/H0212_tagNotifyCode.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 02d32e48a8ed71241809bb3942d656ae
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Main/NetworkPackage/ServerPack/H03_MainCharacter.meta b/Main/NetworkPackage/ServerPack/H03_MainCharacter.meta
new file mode 100644
index 0000000..92eaab5
--- /dev/null
+++ b/Main/NetworkPackage/ServerPack/H03_MainCharacter.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: b2f05491d58dbcc4a9a195374301d061
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/ServerPack/H03_MainCharacter/H0316_tagPackResetOK.cs b/Main/NetworkPackage/ServerPack/H03_MainCharacter/H0316_tagPackResetOK.cs
new file mode 100644
index 0000000..e49cf73
--- /dev/null
+++ b/Main/NetworkPackage/ServerPack/H03_MainCharacter/H0316_tagPackResetOK.cs
@@ -0,0 +1,17 @@
+using UnityEngine;
+using System.Collections;
+
+//03 16 背包重整成功#tagPackResetOK
+
+public class H0316_tagPackResetOK : GameNetPackBasic {
+ public byte Type;
+
+ public H0316_tagPackResetOK () {
+ _cmd = (ushort)0x0316;
+ }
+
+ public override void ReadFromBytes (byte[] vBytes) {
+ TransBytes (out Type, vBytes, NetDataType.BYTE);
+ }
+
+}
diff --git a/Main/NetworkPackage/ServerPack/H03_MainCharacter/H0316_tagPackResetOK.cs.meta b/Main/NetworkPackage/ServerPack/H03_MainCharacter/H0316_tagPackResetOK.cs.meta
new file mode 100644
index 0000000..4e537a3
--- /dev/null
+++ b/Main/NetworkPackage/ServerPack/H03_MainCharacter/H0316_tagPackResetOK.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 2c992724047e11440811b19889580bde
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Main/NetworkPackage/ServerPack/H04_Scene.meta b/Main/NetworkPackage/ServerPack/H04_Scene.meta
new file mode 100644
index 0000000..2b3a2ee
--- /dev/null
+++ b/Main/NetworkPackage/ServerPack/H04_Scene.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 47756718182ffe44bbe1637aa91e1bae
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/ServerPack/H04_Scene/H0403_tagPlayerLoginLoadOK.cs b/Main/NetworkPackage/ServerPack/H04_Scene/H0403_tagPlayerLoginLoadOK.cs
new file mode 100644
index 0000000..7bef49a
--- /dev/null
+++ b/Main/NetworkPackage/ServerPack/H04_Scene/H0403_tagPlayerLoginLoadOK.cs
@@ -0,0 +1,31 @@
+锘縰sing UnityEngine;
+using System.Collections;
+
+//04 03 锟斤拷业锟铰硷拷锟斤拷莘锟斤拷锟斤拷锟斤拷OK#tagPlayerLoginLoadOK
+
+
+
+public class H0403_tagPlayerLoginLoadOK : GameNetPackBasic {
+
+ public byte Type;
+
+
+
+ public H0403_tagPlayerLoginLoadOK () {
+
+ _cmd = (ushort)0x0403;
+
+ }
+
+
+
+ public override void ReadFromBytes (byte[] vBytes) {
+
+ TransBytes (out Type, vBytes, NetDataType.BYTE);
+
+ }
+
+
+
+}
+
diff --git a/Main/NetworkPackage/ServerPack/H04_Scene/H0403_tagPlayerLoginLoadOK.cs.meta b/Main/NetworkPackage/ServerPack/H04_Scene/H0403_tagPlayerLoginLoadOK.cs.meta
new file mode 100644
index 0000000..9666b4c
--- /dev/null
+++ b/Main/NetworkPackage/ServerPack/H04_Scene/H0403_tagPlayerLoginLoadOK.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 2901f184189811d478272b9f0c4f0189
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Main/NetworkPackage/ServerPack/H07_PlayerItem.meta b/Main/NetworkPackage/ServerPack/H07_PlayerItem.meta
new file mode 100644
index 0000000..c280027
--- /dev/null
+++ b/Main/NetworkPackage/ServerPack/H07_PlayerItem.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: af56399ef71538447966414a09d5e18c
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/ServerPack/H07_PlayerItem/H0704_tagRolePackRefresh.cs b/Main/NetworkPackage/ServerPack/H07_PlayerItem/H0704_tagRolePackRefresh.cs
new file mode 100644
index 0000000..ef2e04d
--- /dev/null
+++ b/Main/NetworkPackage/ServerPack/H07_PlayerItem/H0704_tagRolePackRefresh.cs
@@ -0,0 +1,39 @@
+using UnityEngine;
+using System.Collections;
+
+//07 04 主角背包刷新#tagRolePackRefresh
+
+public class H0704_tagRolePackRefresh : GameNetPackBasic {
+ public byte PackType; //背包类型:rptItem, rptEquip, rptWarehouse
+ public byte ItemPlace;
+ public uint ItemID;
+ public byte IsLocked; //是否锁定
+ public ushort ItemCount; //物品数量
+ public byte IsBind; //是否绑定
+ public uint GearScore; //评分
+ public uint RemainHour; //剩余时间(小时)
+ public byte IsSuite; //是否已经套装化
+ public uint UserDataLen;
+ public string UserData; //size = UserDataLen
+ public string ItemGUID;
+
+ public H0704_tagRolePackRefresh () {
+ _cmd = (ushort)0x0704;
+ }
+
+ public override void ReadFromBytes (byte[] vBytes) {
+ TransBytes (out PackType, vBytes, NetDataType.BYTE);
+ TransBytes (out ItemPlace, vBytes, NetDataType.BYTE);
+ TransBytes (out ItemID, vBytes, NetDataType.DWORD);
+ TransBytes (out IsLocked, vBytes, NetDataType.BYTE);
+ TransBytes (out ItemCount, vBytes, NetDataType.WORD);
+ TransBytes (out IsBind, vBytes, NetDataType.BYTE);
+ TransBytes (out GearScore, vBytes, NetDataType.DWORD);
+ TransBytes (out RemainHour, vBytes, NetDataType.DWORD);
+ TransBytes (out IsSuite, vBytes, NetDataType.BYTE);
+ TransBytes (out UserDataLen, vBytes, NetDataType.DWORD);
+ TransBytes (out UserData, vBytes, NetDataType.Chars, UserDataLen);
+ TransBytes (out ItemGUID, vBytes, NetDataType.Chars, 40);
+ }
+
+}
diff --git a/Main/NetworkPackage/ServerPack/H07_PlayerItem/H0704_tagRolePackRefresh.cs.meta b/Main/NetworkPackage/ServerPack/H07_PlayerItem/H0704_tagRolePackRefresh.cs.meta
new file mode 100644
index 0000000..acf8183
--- /dev/null
+++ b/Main/NetworkPackage/ServerPack/H07_PlayerItem/H0704_tagRolePackRefresh.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: df9b1fda01a0f4f4dbc7d3ef150e1621
+timeCreated: 1498810221
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/ServerPack/H07_PlayerItem/H0706_tagUseItemSuccess.cs b/Main/NetworkPackage/ServerPack/H07_PlayerItem/H0706_tagUseItemSuccess.cs
new file mode 100644
index 0000000..ca693a9
--- /dev/null
+++ b/Main/NetworkPackage/ServerPack/H07_PlayerItem/H0706_tagUseItemSuccess.cs
@@ -0,0 +1,39 @@
+using UnityEngine;
+using System.Collections;
+
+//07 06 玩家使用物品成功#tagUseItemSuccess
+
+
+
+public class H0706_tagUseItemSuccess : GameNetPackBasic {
+
+ public uint PlayerID;
+
+ public uint ItemID;
+
+ public byte ItemIndex;
+
+
+
+ public H0706_tagUseItemSuccess () {
+
+ _cmd = (ushort)0x0706;
+
+ }
+
+
+
+ public override void ReadFromBytes (byte[] vBytes) {
+
+ TransBytes (out PlayerID, vBytes, NetDataType.DWORD);
+
+ TransBytes (out ItemID, vBytes, NetDataType.DWORD);
+
+ TransBytes (out ItemIndex, vBytes, NetDataType.BYTE);
+
+ }
+
+
+
+}
+
diff --git a/Main/NetworkPackage/ServerPack/H07_PlayerItem/H0706_tagUseItemSuccess.cs.meta b/Main/NetworkPackage/ServerPack/H07_PlayerItem/H0706_tagUseItemSuccess.cs.meta
new file mode 100644
index 0000000..0dda8e3
--- /dev/null
+++ b/Main/NetworkPackage/ServerPack/H07_PlayerItem/H0706_tagUseItemSuccess.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: ca83bd12264a76e4d91d36d58a19ec6c
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Main/NetworkPackage/ServerPack/H07_PlayerItem/H0707_tagItemCountRefresh.cs b/Main/NetworkPackage/ServerPack/H07_PlayerItem/H0707_tagItemCountRefresh.cs
new file mode 100644
index 0000000..a93367c
--- /dev/null
+++ b/Main/NetworkPackage/ServerPack/H07_PlayerItem/H0707_tagItemCountRefresh.cs
@@ -0,0 +1,21 @@
+using UnityEngine;
+using System.Collections;
+
+//07 07 物品数量刷新#tagItemCountRefresh
+
+public class H0707_tagItemCountRefresh : GameNetPackBasic {
+ public byte PackType;
+ public byte ItemIndex;
+ public ushort ItemCount;
+
+ public H0707_tagItemCountRefresh () {
+ _cmd = (ushort)0x0707;
+ }
+
+ public override void ReadFromBytes (byte[] vBytes) {
+ TransBytes (out PackType, vBytes, NetDataType.BYTE);
+ TransBytes (out ItemIndex, vBytes, NetDataType.BYTE);
+ TransBytes (out ItemCount, vBytes, NetDataType.WORD);
+ }
+
+}
diff --git a/Main/NetworkPackage/ServerPack/H07_PlayerItem/H0707_tagItemCountRefresh.cs.meta b/Main/NetworkPackage/ServerPack/H07_PlayerItem/H0707_tagItemCountRefresh.cs.meta
new file mode 100644
index 0000000..66fd010
--- /dev/null
+++ b/Main/NetworkPackage/ServerPack/H07_PlayerItem/H0707_tagItemCountRefresh.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 57543717e2d8e9343b48d992f5164c3b
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Main/NetworkPackage/ServerPack/H07_PlayerItem/H0709_tagClearItem.cs b/Main/NetworkPackage/ServerPack/H07_PlayerItem/H0709_tagClearItem.cs
new file mode 100644
index 0000000..0714894
--- /dev/null
+++ b/Main/NetworkPackage/ServerPack/H07_PlayerItem/H0709_tagClearItem.cs
@@ -0,0 +1,39 @@
+using UnityEngine;
+using System.Collections;
+
+//07 09 清空物品#tagClearItem
+
+
+
+public class H0709_tagClearItem : GameNetPackBasic {
+
+ public byte PackType;
+
+ public byte ItemIndex;
+
+ public byte ClearType; //Type = TItemNotifyType
+
+
+
+ public H0709_tagClearItem () {
+
+ _cmd = (ushort)0x0709;
+
+ }
+
+
+
+ public override void ReadFromBytes (byte[] vBytes) {
+
+ TransBytes (out PackType, vBytes, NetDataType.BYTE);
+
+ TransBytes (out ItemIndex, vBytes, NetDataType.BYTE);
+
+ TransBytes (out ClearType, vBytes, NetDataType.BYTE);
+
+ }
+
+
+
+}
+
diff --git a/Main/NetworkPackage/ServerPack/H07_PlayerItem/H0709_tagClearItem.cs.meta b/Main/NetworkPackage/ServerPack/H07_PlayerItem/H0709_tagClearItem.cs.meta
new file mode 100644
index 0000000..e507f45
--- /dev/null
+++ b/Main/NetworkPackage/ServerPack/H07_PlayerItem/H0709_tagClearItem.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 40d00658e0a7da94a85382281221cb77
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Main/NetworkPackage/ServerPack/H07_PlayerItem/H0711_tagClearItemPack.cs b/Main/NetworkPackage/ServerPack/H07_PlayerItem/H0711_tagClearItemPack.cs
new file mode 100644
index 0000000..e398f8a
--- /dev/null
+++ b/Main/NetworkPackage/ServerPack/H07_PlayerItem/H0711_tagClearItemPack.cs
@@ -0,0 +1,21 @@
+using UnityEngine;
+using System.Collections;
+
+//07 11 清空背包#tagClearItemPack
+
+public class H0711_tagClearItemPack : GameNetPackBasic {
+ public byte PackIndex; //背包索引
+ public ushort ItemBeginIndex; //背包格子起始索引,从0开始
+ public ushort ItemEndIndex; //背包格子结索引,从0开始
+
+ public H0711_tagClearItemPack () {
+ _cmd = (ushort)0x0711;
+ }
+
+ public override void ReadFromBytes (byte[] vBytes) {
+ TransBytes (out PackIndex, vBytes, NetDataType.BYTE);
+ TransBytes (out ItemBeginIndex, vBytes, NetDataType.WORD);
+ TransBytes (out ItemEndIndex, vBytes, NetDataType.WORD);
+ }
+
+}
diff --git a/Main/NetworkPackage/ServerPack/H07_PlayerItem/H0711_tagClearItemPack.cs.meta b/Main/NetworkPackage/ServerPack/H07_PlayerItem/H0711_tagClearItemPack.cs.meta
new file mode 100644
index 0000000..5f6ff0e
--- /dev/null
+++ b/Main/NetworkPackage/ServerPack/H07_PlayerItem/H0711_tagClearItemPack.cs.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 0ba98be50406b91469ffa5674f8fe550
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
diff --git a/Main/NetworkPackage/ServerPack/H07_PlayerItem/H0724_tagRolePackCanUseCount.cs b/Main/NetworkPackage/ServerPack/H07_PlayerItem/H0724_tagRolePackCanUseCount.cs
new file mode 100644
index 0000000..5776f1c
--- /dev/null
+++ b/Main/NetworkPackage/ServerPack/H07_PlayerItem/H0724_tagRolePackCanUseCount.cs
@@ -0,0 +1,35 @@
+using UnityEngine;
+using System.Collections;
+
+//07 24 主角背包已开启格数#tagRolePackCanUseCount
+
+
+
+public class H0724_tagRolePackCanUseCount : GameNetPackBasic {
+
+ public byte PackType; //背包类型:rptItem, rptEquip, rptWarehouse
+
+ public ushort CanUseCount; //背包已开启格数
+
+
+
+ public H0724_tagRolePackCanUseCount () {
+
+ _cmd = (ushort)0x0724;
+
+ }
+
+
+
+ public override void ReadFromBytes (byte[] vBytes) {
+
+ TransBytes (out PackType, vBytes, NetDataType.BYTE);
+
+ TransBytes (out CanUseCount, vBytes, NetDataType.WORD);
+
+ }
+
+
+
+}
+
diff --git a/Main/NetworkPackage/ServerPack/H07_PlayerItem/H0724_tagRolePackCanUseCount.cs.meta b/Main/NetworkPackage/ServerPack/H07_PlayerItem/H0724_tagRolePackCanUseCount.cs.meta
new file mode 100644
index 0000000..ba51a7f
--- /dev/null
+++ b/Main/NetworkPackage/ServerPack/H07_PlayerItem/H0724_tagRolePackCanUseCount.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: feb79b060e1645c41a5c90bedeb6516c
+timeCreated: 1498807363
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/ServerPack/H07_PlayerItem/H0725_tagRolePackRefreshEx.cs b/Main/NetworkPackage/ServerPack/H07_PlayerItem/H0725_tagRolePackRefreshEx.cs
new file mode 100644
index 0000000..f3d689a
--- /dev/null
+++ b/Main/NetworkPackage/ServerPack/H07_PlayerItem/H0725_tagRolePackRefreshEx.cs
@@ -0,0 +1,49 @@
+using UnityEngine;
+using System.Collections;
+
+//07 25 主角背包刷新(通知所有物品) #tagRolePackRefreshEx
+
+public class H0725_tagRolePackRefreshEx : GameNetPackBasic {
+ public byte PackType; //背包类型:rptItem, rptEquip, rptWarehouse
+ public ushort ItemCount;
+ public tagRoleItemRefresh[] ItemInfo = null; //size = ItemCount
+
+ public H0725_tagRolePackRefreshEx () {
+ _cmd = (ushort)0x0725;
+ }
+
+ public override void ReadFromBytes (byte[] vBytes) {
+ TransBytes (out PackType, vBytes, NetDataType.BYTE);
+ TransBytes (out ItemCount, vBytes, NetDataType.WORD);
+ ItemInfo = new tagRoleItemRefresh[ItemCount];
+ for (int i = 0; i < ItemCount; i ++) {
+ ItemInfo[i] = new tagRoleItemRefresh();
+ TransBytes (out ItemInfo[i].ItemPlace, vBytes, NetDataType.BYTE);
+ TransBytes (out ItemInfo[i].ItemID, vBytes, NetDataType.DWORD);
+ TransBytes (out ItemInfo[i].IsLocked, vBytes, NetDataType.BYTE);
+ TransBytes (out ItemInfo[i].ItemCount, vBytes, NetDataType.WORD);
+ TransBytes (out ItemInfo[i].IsBind, vBytes, NetDataType.BYTE);
+ TransBytes (out ItemInfo[i].GearScore, vBytes, NetDataType.DWORD);
+ TransBytes (out ItemInfo[i].RemainHour, vBytes, NetDataType.DWORD);
+ TransBytes (out ItemInfo[i].IsSuite, vBytes, NetDataType.BYTE);
+ TransBytes (out ItemInfo[i].UserDataLen, vBytes, NetDataType.DWORD);
+ TransBytes (out ItemInfo[i].UserData, vBytes, NetDataType.Chars, ItemInfo[i].UserDataLen);
+ TransBytes (out ItemInfo[i].ItemGUID, vBytes, NetDataType.Chars, 40);
+ }
+ }
+
+ public struct tagRoleItemRefresh {
+ public byte ItemPlace;
+ public uint ItemID;
+ public byte IsLocked; //是否锁定
+ public ushort ItemCount; //物品数量
+ public byte IsBind; //是否绑定
+ public uint GearScore; //评分
+ public uint RemainHour; //剩余时间(小时)
+ public byte IsSuite; //是否已经套装化
+ public uint UserDataLen;
+ public string UserData; //size = UserDataLen
+ public string ItemGUID;
+ }
+
+}
diff --git a/Main/NetworkPackage/ServerPack/H07_PlayerItem/H0725_tagRolePackRefreshEx.cs.meta b/Main/NetworkPackage/ServerPack/H07_PlayerItem/H0725_tagRolePackRefreshEx.cs.meta
new file mode 100644
index 0000000..ad11cf6
--- /dev/null
+++ b/Main/NetworkPackage/ServerPack/H07_PlayerItem/H0725_tagRolePackRefreshEx.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 98f9794fbec696c4db2433d9db9364ca
+timeCreated: 1511947216
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/ServerPack/HA2_Package.meta b/Main/NetworkPackage/ServerPack/HA2_Package.meta
new file mode 100644
index 0000000..6604a91
--- /dev/null
+++ b/Main/NetworkPackage/ServerPack/HA2_Package.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: bc5194d52d90cf5439d1adb4865380aa
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/ServerPack/HA2_Package/HA202_tagMCAttackMode.cs b/Main/NetworkPackage/ServerPack/HA2_Package/HA202_tagMCAttackMode.cs
new file mode 100644
index 0000000..d854845
--- /dev/null
+++ b/Main/NetworkPackage/ServerPack/HA2_Package/HA202_tagMCAttackMode.cs
@@ -0,0 +1,17 @@
+using UnityEngine;
+using System.Collections;
+
+// A2 02 鐜╁鏀诲嚮妯″紡閫氱煡 #tagMCAttackMode
+
+public class HA202_tagMCAttackMode : GameNetPackBasic {
+ public byte Mode;
+
+ public HA202_tagMCAttackMode () {
+ _cmd = (ushort)0xA202;
+ }
+
+ public override void ReadFromBytes (byte[] vBytes) {
+ TransBytes (out Mode, vBytes, NetDataType.BYTE);
+ }
+
+}
diff --git a/Main/NetworkPackage/ServerPack/HA2_Package/HA202_tagMCAttackMode.cs.meta b/Main/NetworkPackage/ServerPack/HA2_Package/HA202_tagMCAttackMode.cs.meta
new file mode 100644
index 0000000..c25ecc3
--- /dev/null
+++ b/Main/NetworkPackage/ServerPack/HA2_Package/HA202_tagMCAttackMode.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 1b563b4d32b55f343a54a3a82a948885
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/ServerPack/HA2_Package/HA204_tagMCVPackRefresh.cs b/Main/NetworkPackage/ServerPack/HA2_Package/HA204_tagMCVPackRefresh.cs
new file mode 100644
index 0000000..4f4583e
--- /dev/null
+++ b/Main/NetworkPackage/ServerPack/HA2_Package/HA204_tagMCVPackRefresh.cs
@@ -0,0 +1,59 @@
+using UnityEngine;
+using System.Collections;
+
+// A2 04 虚拟背包物品刷新 #tagMCVPackRefresh
+
+
+
+public class HA204_tagMCVPackRefresh : GameNetPackBasic {
+
+ public byte PackType; //背包类型
+
+ public ushort Count; // 刷新个数
+
+ public tagMCVPackItem[] VPacklItemList = null; // 物品信息列表
+
+
+
+ public HA204_tagMCVPackRefresh () {
+
+ _cmd = (ushort)0xA204;
+
+ }
+
+
+
+ public override void ReadFromBytes (byte[] vBytes) {
+
+ TransBytes (out PackType, vBytes, NetDataType.BYTE);
+
+ TransBytes (out Count, vBytes, NetDataType.WORD);
+
+ VPacklItemList = new tagMCVPackItem[Count];
+
+ for (int i = 0; i < Count; i ++) {
+
+ VPacklItemList[i] = new tagMCVPackItem();
+
+ TransBytes (out VPacklItemList[i].ItemPlace, vBytes, NetDataType.WORD);
+
+ TransBytes (out VPacklItemList[i].ItemData, vBytes, NetDataType.DWORD);
+
+ }
+
+ }
+
+
+
+ public class tagMCVPackItem {
+
+ public ushort ItemPlace; // 背包物品位置索引
+
+ public uint ItemData; // 物品数据,根据不同背包类型自定义
+
+ }
+
+
+
+}
+
diff --git a/Main/NetworkPackage/ServerPack/HA2_Package/HA204_tagMCVPackRefresh.cs.meta b/Main/NetworkPackage/ServerPack/HA2_Package/HA204_tagMCVPackRefresh.cs.meta
new file mode 100644
index 0000000..cc06673
--- /dev/null
+++ b/Main/NetworkPackage/ServerPack/HA2_Package/HA204_tagMCVPackRefresh.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: a81e6ef5b6dae2148bfa6219cd13f028
+timeCreated: 1501834992
+licenseType: Free
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/ServerPack/HA2_Package/HA205_tagMCVPackClear.cs b/Main/NetworkPackage/ServerPack/HA2_Package/HA205_tagMCVPackClear.cs
new file mode 100644
index 0000000..0cb719a
--- /dev/null
+++ b/Main/NetworkPackage/ServerPack/HA2_Package/HA205_tagMCVPackClear.cs
@@ -0,0 +1,21 @@
+using UnityEngine;
+using System.Collections;
+
+// A2 05 虚拟背包物品清空 #tagMCVPackClear
+
+public class HA205_tagMCVPackClear : GameNetPackBasic {
+ public byte PackType; //背包类型
+ public ushort Count;
+ public ushort[] ItemPlaceList = null; //清空格子索引列表, size = Count
+
+ public HA205_tagMCVPackClear () {
+ _cmd = (ushort)0xA205;
+ }
+
+ public override void ReadFromBytes (byte[] vBytes) {
+ TransBytes (out PackType, vBytes, NetDataType.BYTE);
+ TransBytes (out Count, vBytes, NetDataType.WORD);
+ TransBytes (out ItemPlaceList, vBytes, NetDataType.WORD, Count);
+ }
+
+}
diff --git a/Main/NetworkPackage/ServerPack/HA2_Package/HA205_tagMCVPackClear.cs.meta b/Main/NetworkPackage/ServerPack/HA2_Package/HA205_tagMCVPackClear.cs.meta
new file mode 100644
index 0000000..d65ee5f
--- /dev/null
+++ b/Main/NetworkPackage/ServerPack/HA2_Package/HA205_tagMCVPackClear.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: ecda4d6788589d6468b91359edb7907c
+timeCreated: 1502090708
+licenseType: Free
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/ServerPack/HA2_Package/HA206_tagMCAutoItemCountRefresh.cs b/Main/NetworkPackage/ServerPack/HA2_Package/HA206_tagMCAutoItemCountRefresh.cs
new file mode 100644
index 0000000..2947cfc
--- /dev/null
+++ b/Main/NetworkPackage/ServerPack/HA2_Package/HA206_tagMCAutoItemCountRefresh.cs
@@ -0,0 +1,29 @@
+using UnityEngine;
+using System.Collections;
+
+// A2 06 鑷姩杞寲涓哄搴旂墿鍝両D涓暟鍒锋柊 #tagMCAutoItemCountRefresh
+
+public class HA206_tagMCAutoItemCountRefresh : GameNetPackBasic {
+ public ushort Count; // 鍒锋柊涓暟
+ public tagMCAutoItemCount[] ItemCountList; // 鐗╁搧淇℃伅鍒楄〃
+
+ public HA206_tagMCAutoItemCountRefresh () {
+ _cmd = (ushort)0xA206;
+ }
+
+ public override void ReadFromBytes (byte[] vBytes) {
+ TransBytes (out Count, vBytes, NetDataType.WORD);
+ ItemCountList = new tagMCAutoItemCount[Count];
+ for (int i = 0; i < Count; i ++) {
+ ItemCountList[i] = new tagMCAutoItemCount();
+ TransBytes (out ItemCountList[i].ItemID, vBytes, NetDataType.DWORD);
+ TransBytes (out ItemCountList[i].ItemCount, vBytes, NetDataType.DWORD);
+ }
+ }
+
+ public struct tagMCAutoItemCount {
+ public uint ItemID;
+ public uint ItemCount;
+ }
+
+}
diff --git a/Main/NetworkPackage/ServerPack/HA2_Package/HA206_tagMCAutoItemCountRefresh.cs.meta b/Main/NetworkPackage/ServerPack/HA2_Package/HA206_tagMCAutoItemCountRefresh.cs.meta
new file mode 100644
index 0000000..d6f4874
--- /dev/null
+++ b/Main/NetworkPackage/ServerPack/HA2_Package/HA206_tagMCAutoItemCountRefresh.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: ce4c3547897d0e448b0061c458b14a38
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/ServerPack/HA3_Function.meta b/Main/NetworkPackage/ServerPack/HA3_Function.meta
new file mode 100644
index 0000000..95af3b5
--- /dev/null
+++ b/Main/NetworkPackage/ServerPack/HA3_Function.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: c2802af55d798c347a4a292a3bc3ce37
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/ServerPack/HA3_Function/HA362_tagMCMailList.cs b/Main/NetworkPackage/ServerPack/HA3_Function/HA362_tagMCMailList.cs
new file mode 100644
index 0000000..1dcf026
--- /dev/null
+++ b/Main/NetworkPackage/ServerPack/HA3_Function/HA362_tagMCMailList.cs
@@ -0,0 +1,65 @@
+using UnityEngine;
+using System.Collections;
+
+// A3 62 閭欢鍒楄〃 #tagMCMailList
+
+public class HA362_tagMCMailList : GameNetPackBasic {
+ public byte IsServerMail; //鏄惁鍏ㄦ湇閭欢锛屽鍏憡銆佺淮鎶ゃ�佹洿鏂般�佽ˉ鍋跨瓑閲嶈閭欢
+ public ushort Count;
+ public tagMCMail[] MailList; //閭欢鍒楄〃
+
+ public HA362_tagMCMailList () {
+ _cmd = (ushort)0xA362;
+ }
+
+ public override void ReadFromBytes (byte[] vBytes) {
+ TransBytes (out IsServerMail, vBytes, NetDataType.BYTE);
+ TransBytes (out Count, vBytes, NetDataType.WORD);
+ MailList = new tagMCMail[Count];
+ for (int i = 0; i < Count; i ++) {
+ MailList[i] = new tagMCMail();
+ TransBytes (out MailList[i].GUID, vBytes, NetDataType.Chars, 36);
+ TransBytes (out MailList[i].Type, vBytes, NetDataType.BYTE);
+ TransBytes (out MailList[i].CreateTime, vBytes, NetDataType.Chars, 30);
+ TransBytes (out MailList[i].LimitDays, vBytes, NetDataType.BYTE);
+ TransBytes (out MailList[i].TitleLen, vBytes, NetDataType.BYTE);
+ TransBytes (out MailList[i].Title, vBytes, NetDataType.Chars, MailList[i].TitleLen);
+ TransBytes (out MailList[i].TextLen, vBytes, NetDataType.WORD);
+ TransBytes (out MailList[i].Text, vBytes, NetDataType.Chars, MailList[i].TextLen);
+ TransBytes (out MailList[i].MailState, vBytes, NetDataType.BYTE);
+ TransBytes (out MailList[i].Count, vBytes, NetDataType.BYTE);
+ MailList[i].Items = new tagMCMailItem[MailList[i].Count];
+ for (int j = 0; j < MailList[i].Count; j ++) {
+ MailList[i].Items[j] = new tagMCMailItem();
+ TransBytes (out MailList[i].Items[j].ItemID, vBytes, NetDataType.DWORD);
+ TransBytes (out MailList[i].Items[j].Count, vBytes, NetDataType.DWORD);
+ TransBytes (out MailList[i].Items[j].IsBind, vBytes, NetDataType.BYTE);
+ TransBytes (out MailList[i].Items[j].UserDataLen, vBytes, NetDataType.WORD);
+ TransBytes (out MailList[i].Items[j].UserData, vBytes, NetDataType.Chars, MailList[i].Items[j].UserDataLen);
+ }
+ }
+ }
+
+ public struct tagMCMail {
+ public string GUID; //閭欢GUID
+ public byte Type; //閭欢绫诲瀷锛屾殏鏃堕粯璁�0
+ public string CreateTime; //鍒涘缓鏃堕棿
+ public byte LimitDays; //鏈夋晥澶╂暟
+ public byte TitleLen;
+ public string Title; //鏍囬
+ public ushort TextLen;
+ public string Text; //鍐呭
+ public byte MailState; //閭欢鐘舵�侊細 0-鏈煡锛�1-鏈锛�2-宸茶锛�3-宸查锛�
+ public byte Count; //鐗╁搧鏁�
+ public tagMCMailItem[] Items; //鐗╁搧淇℃伅
+ }
+
+ public struct tagMCMailItem {
+ public uint ItemID; //鐗╁搧ID
+ public uint Count; //鏁伴噺
+ public byte IsBind; //鏄惁缁戝畾
+ public ushort UserDataLen;
+ public string UserData; //鑷畾涔夋暟鎹�
+ }
+
+}
diff --git a/Main/NetworkPackage/ServerPack/HA3_Function/HA362_tagMCMailList.cs.meta b/Main/NetworkPackage/ServerPack/HA3_Function/HA362_tagMCMailList.cs.meta
new file mode 100644
index 0000000..3ff1056
--- /dev/null
+++ b/Main/NetworkPackage/ServerPack/HA3_Function/HA362_tagMCMailList.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: f38336f65bd59224d9d47288a14b88a4
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/ServerPack/HA3_Function/HA363_tagMCMailStateChange.cs b/Main/NetworkPackage/ServerPack/HA3_Function/HA363_tagMCMailStateChange.cs
new file mode 100644
index 0000000..9a5e001
--- /dev/null
+++ b/Main/NetworkPackage/ServerPack/HA3_Function/HA363_tagMCMailStateChange.cs
@@ -0,0 +1,29 @@
+using UnityEngine;
+using System.Collections;
+
+// A3 63 閭欢鐘舵�佸彉鏇� #tagMCMailStateChange
+
+public class HA363_tagMCMailStateChange : GameNetPackBasic {
+ public ushort Count;
+ public tagMCMailState[] MailList; //閭欢鍒楄〃
+
+ public HA363_tagMCMailStateChange () {
+ _cmd = (ushort)0xA363;
+ }
+
+ public override void ReadFromBytes (byte[] vBytes) {
+ TransBytes (out Count, vBytes, NetDataType.WORD);
+ MailList = new tagMCMailState[Count];
+ for (int i = 0; i < Count; i ++) {
+ MailList[i] = new tagMCMailState();
+ TransBytes (out MailList[i].GUID, vBytes, NetDataType.Chars, 36);
+ TransBytes (out MailList[i].MailState, vBytes, NetDataType.BYTE);
+ }
+ }
+
+ public struct tagMCMailState {
+ public string GUID; //閭欢GUID
+ public byte MailState; //閭欢鐘舵�侊細 0-鏈煡锛�1-鏈锛�2-宸茶锛�3-宸查锛�4-宸插垹
+ }
+
+}
diff --git a/Main/NetworkPackage/ServerPack/HA3_Function/HA363_tagMCMailStateChange.cs.meta b/Main/NetworkPackage/ServerPack/HA3_Function/HA363_tagMCMailStateChange.cs.meta
new file mode 100644
index 0000000..2c4e615
--- /dev/null
+++ b/Main/NetworkPackage/ServerPack/HA3_Function/HA363_tagMCMailStateChange.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 61d2635b9ecae54408561ec9c3aaacc7
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/ServerPack/HA8_Item.meta b/Main/NetworkPackage/ServerPack/HA8_Item.meta
new file mode 100644
index 0000000..c265cff
--- /dev/null
+++ b/Main/NetworkPackage/ServerPack/HA8_Item.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 31cf1556ce646c74abde6be1091a568d
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/ServerPack/HA8_Item/HA801_tagMCGiveAwardInfo.cs b/Main/NetworkPackage/ServerPack/HA8_Item/HA801_tagMCGiveAwardInfo.cs
new file mode 100644
index 0000000..ba2aea9
--- /dev/null
+++ b/Main/NetworkPackage/ServerPack/HA8_Item/HA801_tagMCGiveAwardInfo.cs
@@ -0,0 +1,57 @@
+using UnityEngine;
+using System.Collections;
+
+// A8 01 鑾峰緱濂栧姳淇℃伅 #tagMCGiveAwardInfo
+
+public class HA801_tagMCGiveAwardInfo : GameNetPackBasic {
+ public byte EventLen;
+ public string EventName;
+ public uint Exp; // 濂栧姳缁忛獙锛屾眰浣欎嚎閮ㄥ垎
+ public uint ExpPoint; // 濂栧姳缁忛獙锛屾暣闄や嚎閮ㄥ垎
+ public byte MoneyLen;
+ public tagMCGiveAwardMoney[] MoneyList; // 濂栧姳璐у竵
+ public byte ItemLen;
+ public tagMCGiveAwardItem[] ItemList; // 濂栧姳鐗╁搧
+ public ushort DataLen;
+ public string DataEx; // 鎵╁睍淇℃伅锛屽彲鐢变笉鍚岀殑Event鑷畾涔変俊鎭唴瀹�
+
+ public HA801_tagMCGiveAwardInfo () {
+ _cmd = (ushort)0xA801;
+ }
+
+ public override void ReadFromBytes (byte[] vBytes) {
+ TransBytes (out EventLen, vBytes, NetDataType.BYTE);
+ TransBytes (out EventName, vBytes, NetDataType.Chars, EventLen);
+ TransBytes (out Exp, vBytes, NetDataType.DWORD);
+ TransBytes (out ExpPoint, vBytes, NetDataType.DWORD);
+ TransBytes (out MoneyLen, vBytes, NetDataType.BYTE);
+ MoneyList = new tagMCGiveAwardMoney[MoneyLen];
+ for (int i = 0; i < MoneyLen; i ++) {
+ MoneyList[i] = new tagMCGiveAwardMoney();
+ TransBytes (out MoneyList[i].MoneyType, vBytes, NetDataType.BYTE);
+ TransBytes (out MoneyList[i].MoneyValue, vBytes, NetDataType.DWORD);
+ }
+ TransBytes (out ItemLen, vBytes, NetDataType.BYTE);
+ ItemList = new tagMCGiveAwardItem[ItemLen];
+ for (int i = 0; i < ItemLen; i ++) {
+ ItemList[i] = new tagMCGiveAwardItem();
+ TransBytes (out ItemList[i].ItemID, vBytes, NetDataType.DWORD);
+ TransBytes (out ItemList[i].Count, vBytes, NetDataType.DWORD);
+ TransBytes (out ItemList[i].IsBind, vBytes, NetDataType.BYTE);
+ }
+ TransBytes (out DataLen, vBytes, NetDataType.WORD);
+ TransBytes (out DataEx, vBytes, NetDataType.Chars, DataLen);
+ }
+
+ public struct tagMCGiveAwardMoney {
+ public byte MoneyType;
+ public uint MoneyValue;
+ }
+
+ public struct tagMCGiveAwardItem {
+ public uint ItemID;
+ public uint Count;
+ public byte IsBind;
+ }
+
+}
diff --git a/Main/NetworkPackage/ServerPack/HA8_Item/HA801_tagMCGiveAwardInfo.cs.meta b/Main/NetworkPackage/ServerPack/HA8_Item/HA801_tagMCGiveAwardInfo.cs.meta
new file mode 100644
index 0000000..820f7f7
--- /dev/null
+++ b/Main/NetworkPackage/ServerPack/HA8_Item/HA801_tagMCGiveAwardInfo.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: c94124bac8e9b5942ae3db3907e0c4aa
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/NetworkPackage/ServerPack/HA8_Item/HA809_tagMCItemDayUseCntInfo.cs b/Main/NetworkPackage/ServerPack/HA8_Item/HA809_tagMCItemDayUseCntInfo.cs
new file mode 100644
index 0000000..58d8863
--- /dev/null
+++ b/Main/NetworkPackage/ServerPack/HA8_Item/HA809_tagMCItemDayUseCntInfo.cs
@@ -0,0 +1,29 @@
+using UnityEngine;
+using System.Collections;
+
+// A8 09 閫氱煡鐗╁搧褰撴棩宸蹭娇鐢ㄦ鏁� #tagMCItemDayUseCntInfo
+
+public class HA809_tagMCItemDayUseCntInfo : GameNetPackBasic {
+ public ushort Count; //淇℃伅鏁�
+ public tagMCItemDayUseCnt[] ItemUseCntList;
+
+ public HA809_tagMCItemDayUseCntInfo () {
+ _cmd = (ushort)0xA809;
+ }
+
+ public override void ReadFromBytes (byte[] vBytes) {
+ TransBytes (out Count, vBytes, NetDataType.WORD);
+ ItemUseCntList = new tagMCItemDayUseCnt[Count];
+ for (int i = 0; i < Count; i ++) {
+ ItemUseCntList[i] = new tagMCItemDayUseCnt();
+ TransBytes (out ItemUseCntList[i].ItemID, vBytes, NetDataType.DWORD);
+ TransBytes (out ItemUseCntList[i].UseCnt, vBytes, NetDataType.WORD);
+ }
+ }
+
+ public struct tagMCItemDayUseCnt {
+ public uint ItemID;
+ public ushort UseCnt; // 浠婃棩宸蹭娇鐢ㄦ鏁�
+ }
+
+}
diff --git a/Main/NetworkPackage/ServerPack/HA8_Item/HA809_tagMCItemDayUseCntInfo.cs.meta b/Main/NetworkPackage/ServerPack/HA8_Item/HA809_tagMCItemDayUseCntInfo.cs.meta
new file mode 100644
index 0000000..d0e046a
--- /dev/null
+++ b/Main/NetworkPackage/ServerPack/HA8_Item/HA809_tagMCItemDayUseCntInfo.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 04651ffa78ca8b146a2151b47bd1d759
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/Backpack.meta b/Main/System/Backpack.meta
new file mode 100644
index 0000000..7cc09d3
--- /dev/null
+++ b/Main/System/Backpack.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: f8bf87d87292319479b6bf9694235710
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/Backpack/BackpackData.cs b/Main/System/Backpack/BackpackData.cs
new file mode 100644
index 0000000..3b3853e
--- /dev/null
+++ b/Main/System/Backpack/BackpackData.cs
@@ -0,0 +1,80 @@
+锘�//--------------------------------------------------------
+// [Author]: 绗簩涓栫晫
+// [ Date ]: Monday, July 31, 2017
+//--------------------------------------------------------
+using UnityEngine;
+using System.Collections;
+
+namespace vnxbqy.UI
+{
+
+ public struct Item
+ {
+ public int id;
+ public int count; //鍏煎鏃т唬鐮佷繚鐣�
+ public ulong countEx; //鍏煎鏃т唬鐮乧ount锛屽綋鏁伴噺瓒呰繃浜�32浣嶆棤娉曡〃绀烘椂浣跨敤
+ public int quality;
+ public int bind;
+
+ public Item(int _id, ulong _count)
+ {
+ this.id = _id;
+ this.count = (int)_count;
+ this.quality = 0;
+ this.bind = 0;
+ this.countEx = _count;
+ }
+
+ public Item(int _id, ulong _count, int _quality)
+ {
+ this.id = _id;
+ this.count = (int)_count;
+ this.quality = _quality;
+ this.bind = 0;
+ this.countEx = _count;
+ }
+
+ public Item(int _id, ulong _count, int _bind = 0, int _quality = 0)
+ {
+ this.id = _id;
+ this.count = (int)_count;
+ this.quality = _quality;
+ this.bind = _bind;
+ this.countEx = _count;
+ }
+
+ #region 鏃т唬鐮佸吋瀹� 鏄剧ず鏃犳硶瓒呰繃32浣�
+
+ public Item(int _id, int _count)
+ {
+ this.id = _id;
+ this.count = _count;
+ this.quality = 0;
+ this.bind = 0;
+ this.countEx = (ulong)_count;
+ }
+
+ public Item(int _id, int _count, int _quality)
+ {
+ this.id = _id;
+ this.count = _count;
+ this.quality = _quality;
+ this.bind = 0;
+ this.countEx = (ulong)_count;
+ }
+
+
+ public Item(int _id, int _count, int _bind = 0, int _quality = 0)
+ {
+ this.id = _id;
+ this.count = _count;
+ this.quality = _quality;
+ this.bind = _bind;
+ this.countEx = (ulong)_count;
+ }
+ #endregion
+ }
+}
+
+
+
diff --git a/Main/System/Backpack/BackpackData.cs.meta b/Main/System/Backpack/BackpackData.cs.meta
new file mode 100644
index 0000000..1ab5762
--- /dev/null
+++ b/Main/System/Backpack/BackpackData.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 72bacd308d67d86449df692b5d03d306
+timeCreated: 1501482606
+licenseType: Free
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/Equip.meta b/Main/System/Equip.meta
new file mode 100644
index 0000000..6e21001
--- /dev/null
+++ b/Main/System/Equip.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: ea46dc704fa70ad4ebb65e608526deea
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/Equip/EquipSuitEffect.cs b/Main/System/Equip/EquipSuitEffect.cs
new file mode 100644
index 0000000..1e26069
--- /dev/null
+++ b/Main/System/Equip/EquipSuitEffect.cs
@@ -0,0 +1,108 @@
+锘縰sing System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+namespace vnxbqy.UI
+{
+ public class EquipSuitEffect : MonoBehaviour
+ {
+ [SerializeField] UIEffect m_SuitEffect;
+
+ int itemId = 0;
+
+ private void OnEnable()
+ {
+ Display(itemId);
+ }
+
+ public void Display(int itemId, bool dirty = false)
+ {
+ this.itemId = itemId;
+ // var isSuitEquip = ItemLogicUtility.Instance.IsSuitEquip(itemId);
+ // if (isSuitEquip)
+ // {
+ // m_SuitEffect.Play();
+ // }
+ // else
+ // {
+ // m_SuitEffect.StopImediatly();
+ // }
+
+ // if (dirty)
+ // {
+ // SnxxzGame.Instance.StartCoroutine(Co_SetOrder(this, transform as RectTransform));
+ // }
+ }
+
+ public static EquipSuitEffect Create(RectTransform transform)
+ {
+ var go = UIUtility.CreateWidget("EquipSuitEffect", "EquipSuitEffect");
+ var behaviour = go.GetComponent<EquipSuitEffect>();
+
+ // SnxxzGame.Instance.StartCoroutine(Co_SetOrder(behaviour, transform));
+
+ var scale = 1f;
+ var itemBasic = transform.GetComponentInParent<CommonItemBaisc>();
+ if (itemBasic != null)
+ {
+ scale = GetEffectScale(itemBasic.format);
+ }
+ // else
+ // {
+ // var itemBehaviour = transform.GetComponentInParent<ItemBehaviour>();
+ // if (itemBehaviour != null)
+ // {
+ // if (itemBehaviour.backGround != null)
+ // {
+ // var size = itemBehaviour.backGround.rectTransform.rect.width;
+ // scale = size / 84;
+ // }
+ // }
+ // }
+
+ var rect = go.transform as RectTransform;
+ go.transform.SetParentEx(transform, Vector3.zero, Quaternion.identity, Vector3.one);
+ rect.MatchWhith(transform);
+ go.transform.localScale = Vector3.one * scale;
+ go.transform.SetAsLastSibling();
+
+ return behaviour;
+ }
+
+ static IEnumerator Co_SetOrder(EquipSuitEffect behaviour, RectTransform transform)
+ {
+ yield return null;
+
+ if (transform == null || behaviour == null)
+ {
+ yield break;
+ }
+
+ Canvas canva = transform.GetComponentInParent<Canvas>();
+ if (canva != null)
+ {
+ behaviour.m_SuitEffect.ResetOrder(canva.sortingOrder + 1);
+ }
+
+ if (behaviour.m_SuitEffect.maskArea == null)
+ {
+ behaviour.m_SuitEffect.SetMask();
+ }
+ }
+
+ static float GetEffectScale(ItemCellformat format)
+ {
+ switch (format)
+ {
+ case ItemCellformat.Format_80x80:
+ return 0.95f;
+ case ItemCellformat.Format_70x70:
+ return 0.8f;
+ case ItemCellformat.Format_64x64:
+ return 0.75f;
+ default:
+ return 1f;
+ }
+ }
+ }
+}
+
diff --git a/Main/System/Equip/EquipSuitEffect.cs.meta b/Main/System/Equip/EquipSuitEffect.cs.meta
new file mode 100644
index 0000000..2e7f060
--- /dev/null
+++ b/Main/System/Equip/EquipSuitEffect.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 08b930c33878e864a9f8479b5359c96f
+timeCreated: 1557466872
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/GMCommand.meta b/Main/System/GMCommand.meta
new file mode 100644
index 0000000..4db3ef8
--- /dev/null
+++ b/Main/System/GMCommand.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: b2f88359c2972304d927e02b231f666d
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/GMCommand/GMCmdModel.cs b/Main/System/GMCommand/GMCmdModel.cs
new file mode 100644
index 0000000..58152de
--- /dev/null
+++ b/Main/System/GMCommand/GMCmdModel.cs
@@ -0,0 +1,100 @@
+锘縰sing vnxbqy.UI;
+using System.Collections.Generic;
+
+using System.Text;
+using System;
+using UnityEngine;
+
+
+public class GMCmdModel : ManagerBase<GMCmdModel>
+{
+ public const string Record_CmdKey = "Record_CmdKey";
+ private List<string> recordCmdlist = new List<string>();
+ private string[] recordCmdArray;
+
+ public override void Init()
+ {
+ base.Init();
+ GetCmdArray();
+ //SnxxzGame.Instance.AddApplicationOutAction(SetCmdArray);
+ }
+
+
+ /// <summary>
+ /// 鍙戦�佽姹�
+ /// </summary>
+ /// <param name="sendQuest"></param>
+ public void OnSendGMQuest(string sendQuest)
+ {
+ Debug.Log("sendQuest: " + sendQuest);
+ C320C_tagCGMCMD gmCmd = new C320C_tagCGMCMD();
+ gmCmd.Cmd = sendQuest;
+ gmCmd.CmdLen = (byte)(sendQuest.Length);
+ GameNetSystem.Instance.SendInfo(gmCmd);
+ }
+
+ /// <summary>
+ /// 鍙戦�丆rossServer GM
+ /// </summary>
+ /// <param name="sendQuest"></param>
+ public void SendCrossServerGMQuest(string sendQuest)
+ {
+ Debug.Log("sendQuest: " + sendQuest);
+ C320C_tagCGMCMD gmCmd = new C320C_tagCGMCMD();
+ gmCmd.Cmd = sendQuest;
+ gmCmd.CmdLen = (byte)(sendQuest.Length);
+ GameNetSystem.Instance.SendToCrossServer(gmCmd);
+ }
+
+
+ public void GetCmdArray()
+ {
+ recordCmdArray = LocalSave.GeStringArray(Record_CmdKey);
+ recordCmdlist.Clear();
+ if (recordCmdArray == null)
+ return;
+
+ int i = 0;
+ for (i = 0; i < recordCmdArray.Length; i++)
+ {
+ if (recordCmdArray[i] != "" && recordCmdArray[i] != string.Empty)
+ recordCmdlist.Add(recordCmdArray[i]);
+
+ }
+ }
+
+ public void SetRecordCmdlist(string cmdStr)
+ {
+ if (!recordCmdlist.Contains(cmdStr))
+ {
+ recordCmdlist.Add(cmdStr);
+ }
+ else
+ {
+ recordCmdlist.Remove(cmdStr);
+ recordCmdlist.Insert(recordCmdlist.Count, cmdStr);
+ }
+ }
+
+ public void SetCmdArray()
+ {
+ recordCmdArray = new string[recordCmdlist.Count];
+ int i = 0;
+ for (i = 0; i < recordCmdlist.Count; i++)
+ {
+ recordCmdArray[i] = recordCmdlist[i];
+ }
+ LocalSave.SetStringArray(Record_CmdKey, recordCmdArray);
+ }
+
+ public List<string> GetRecordCmdlist()
+ {
+ return recordCmdlist;
+ }
+
+ public void ClearRecordCmdlist()
+ {
+ recordCmdlist.Clear();
+ LocalSave.DeleteKey(Record_CmdKey);
+ }
+}
diff --git a/Main/System/GMCommand/GMCmdModel.cs.meta b/Main/System/GMCommand/GMCmdModel.cs.meta
new file mode 100644
index 0000000..d6c8264
--- /dev/null
+++ b/Main/System/GMCommand/GMCmdModel.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: b230629a2182f3f4b80319cf8bfc0dcc
+timeCreated: 1511418437
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/GMCommand/GMCmdPanel.cs b/Main/System/GMCommand/GMCmdPanel.cs
new file mode 100644
index 0000000..c51d371
--- /dev/null
+++ b/Main/System/GMCommand/GMCmdPanel.cs
@@ -0,0 +1,96 @@
+锘縰sing System;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+using UnityEngine.Events;
+
+namespace vnxbqy.UI
+{
+ public class GMCmdPanel : UIBase
+ {
+
+ [SerializeField]
+ private ScrollerController _cmdCtrl;
+
+ [SerializeField]
+ private Button _closeBtn;
+
+ GMCmdModel _cmdModel;
+ GMCmdModel cmdModel{ get { return GMCmdModel.Instance; } }
+
+ protected override void OnPreOpen()
+ {
+ base.OnPreOpen();
+ _cmdCtrl.OnRefreshCell += RefreshCmdCell;
+
+ _closeBtn.onClick.AddListener(OnClickCloseBtn);
+
+ CreateCmdCell();
+ }
+
+ protected override void OnOpen()
+ {
+ base.OnOpen();
+ this.transform.SetAsLastSibling();
+ }
+
+
+ private void CreateCmdCell()
+ {
+ _cmdCtrl.Refresh();
+ var allKeys = GmCmdConfig.dic.Keys;
+ foreach (var key in allKeys)
+ {
+ _cmdCtrl.AddCell(ScrollerDataType.Header, key);
+ }
+ _cmdCtrl.Restart();
+ }
+
+ private void RefreshCmdCell(ScrollerDataType type, CellView cell)
+ {
+ Button cellBtn = cell.GetComponent<Button>();
+ Text cmdText = cell.transform.Find("Text").GetComponent<Text>();
+ GmCmdConfig gmCmdModel = GmCmdConfig.Get(cell.index);
+ if (gmCmdModel == null)
+ return;
+
+ cmdText.text = gmCmdModel.Cmd + "=" + gmCmdModel.ParamSet;
+ cellBtn.onClick.RemoveAllListeners();
+ cellBtn.onClick.AddListener(() => { OnClickCmdCell(gmCmdModel.ParamSet); });
+ }
+
+ private void OnClickCmdCell(string paramSet)
+ {
+ SplitLongGMCmd(paramSet);
+ }
+
+ public void SplitLongGMCmd(string value)
+ {
+ if (value == "RoleDead" && CrossServerUtility.IsCrossServer())
+ {
+ string[] longCmdArray = value.Split('|');
+ for (int i = 0; i < longCmdArray.Length; i++)
+ {
+ cmdModel.SendCrossServerGMQuest(longCmdArray[i].Trim());
+ }
+ }
+ else
+ {
+ string[] longCmdArray = value.Split('|');
+ for (int i = 0; i < longCmdArray.Length; i++)
+ {
+ cmdModel.OnSendGMQuest(longCmdArray[i].Trim());
+ }
+ }
+
+ }
+
+ public void OnClickCloseBtn()
+ {
+ CloseWindow();
+ }
+
+ }
+}
+
diff --git a/Main/System/GMCommand/GMCmdPanel.cs.meta b/Main/System/GMCommand/GMCmdPanel.cs.meta
new file mode 100644
index 0000000..92e1807
--- /dev/null
+++ b/Main/System/GMCommand/GMCmdPanel.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: ff929f87c6e78854abe33d4a8466e7f1
+timeCreated: 1500290216
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/GMCommand/GMInputWin.cs b/Main/System/GMCommand/GMInputWin.cs
new file mode 100644
index 0000000..ce2499f
--- /dev/null
+++ b/Main/System/GMCommand/GMInputWin.cs
@@ -0,0 +1,191 @@
+锘縰sing System;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace vnxbqy.UI
+{
+ public class GMInputWin : UIBase
+ {
+ [SerializeField]
+ private ScrollerController _cmdCtrl;
+
+ [SerializeField]
+ private InputField _inputCmd;
+
+ [SerializeField]
+ private Button _closeBtn;
+
+ [SerializeField]
+ private Button _lookBtn;
+
+ [SerializeField]
+ private Button _sendBtn;
+
+ [SerializeField]
+ private Button m_CrossServerSend;
+
+ [SerializeField]
+ private Button _gmInfoBtn;
+
+ [SerializeField]
+ private Button _clearBtn;
+
+ [SerializeField]
+ private Button achieveJumpTestBtn;
+
+ [SerializeField]
+ private GameObject _cmdContent;
+
+ private List<string> recordCmdlist;
+
+ GMCmdModel cmdModel { get { return GMCmdModel.Instance; } }
+
+
+ protected override void OnPreOpen()
+ {
+ base.OnPreOpen();
+ _cmdCtrl.OnRefreshCell += RefreshCmdCell;
+ _closeBtn.onClick.AddListener(OnClickCloseBtn);
+ _lookBtn.onClick.AddListener(OnClickLookBtn);
+ _sendBtn.onClick.AddListener(() => { OnClickSendBtn(); });
+ _gmInfoBtn.onClick.AddListener(OnClickGMInfoBtn);
+ _clearBtn.onClick.AddListener(OnClickClearBtn);
+ achieveJumpTestBtn.AddListener(ClickAchieveJumpBtn);
+ m_CrossServerSend.SetListener(SendCrossServerGM);
+ _cmdContent.SetActive(false);
+ }
+
+ protected override void OnOpen()
+ {
+ base.HandleOpen();
+ this.transform.SetAsLastSibling();
+ }
+ protected void LateUpdate()
+ {
+ if (Input.GetKeyDown(KeyCode.Return) || Input.GetKeyDown(KeyCode.KeypadEnter))
+ {
+ OnClickSendBtn();
+ }
+ }
+
+ private void CreateCmdCell()
+ {
+ _cmdCtrl.Refresh();
+ int i = 0;
+ for (i = recordCmdlist.Count - 1; i > -1; i--)
+ {
+ _cmdCtrl.AddCell(ScrollerDataType.Header, i);
+ }
+ _cmdCtrl.Restart();
+ }
+
+ private void RefreshCmdCell(ScrollerDataType type, CellView cell)
+ {
+ Button cellBtn = cell.GetComponent<Button>();
+ Text cmdText = cell.transform.Find("Text").GetComponent<Text>();
+ string cmdStr = recordCmdlist[cell.index];
+ cmdText.text = cmdStr;
+ cellBtn.onClick.RemoveAllListeners();
+ cellBtn.onClick.AddListener(() =>
+ {
+ OnClickCmdCell(cmdStr);
+ });
+ }
+
+ private void OnClickCmdCell(string paramSet)
+ {
+ _inputCmd.text = paramSet;
+ }
+
+ private void OnClickGMInfoBtn()
+ {
+ ServerTipDetails.OpenGMPanel();
+ }
+
+ private void OnClickLookBtn()
+ {
+ if (_cmdContent.gameObject.activeInHierarchy)
+ {
+ _cmdContent.SetActive(false);
+ }
+ else
+ {
+ _cmdContent.SetActive(true);
+ recordCmdlist = cmdModel.GetRecordCmdlist();
+ CreateCmdCell();
+ }
+ }
+
+ private void OnClickSendBtn()
+ {
+ if (_inputCmd.text == null || _inputCmd.text == "" || _inputCmd.text == string.Empty)
+ return;
+
+ // if (_inputCmd.text == "HappyXB")
+ // {
+ // WindowCenter.Instance.Open<HappyXBWin>();
+ // return;
+ // }
+ // else if (_inputCmd.text == "TreasureFindHost")
+ // {
+ // WindowCenter.Instance.Open<TreasureFindHostWin>();
+ // return;
+ // }
+ // if (_inputCmd.text.Equals("EnterFB 31250"))
+ // {
+ // cmdModel.OnSendGMQuest("SetFBStar 31250");
+ // ClientGuardDungeon.RequestEnter();
+ // return;
+ // }
+
+ cmdModel.OnSendGMQuest(_inputCmd.text.Trim());
+ cmdModel.SetRecordCmdlist(_inputCmd.text);
+ }
+
+ private void SendCrossServerGM()
+ {
+ if (_inputCmd.text == null || _inputCmd.text == "" || _inputCmd.text == string.Empty)
+ return;
+
+ // if (_inputCmd.text == "HappyXB")
+ // {
+ // WindowCenter.Instance.Open<HappyXBWin>();
+ // return;
+ // }
+ // else if (_inputCmd.text == "TreasureFindHost")
+ // {
+ // WindowCenter.Instance.Open<TreasureFindHostWin>();
+ // return;
+ // }
+
+ cmdModel.SendCrossServerGMQuest(_inputCmd.text.Trim());
+ cmdModel.SetRecordCmdlist(_inputCmd.text);
+ }
+
+
+ private void OnClickClearBtn()
+ {
+ cmdModel.ClearRecordCmdlist();
+ OnClickLookBtn();
+ }
+
+ private void OnClickCloseBtn()
+ {
+ CloseWindow();
+ }
+
+ private void ClickAchieveJumpBtn()
+ {
+ // try
+ // {
+ // int achieveId = int.Parse(_inputCmd.text);
+ // ModelCenter.Instance.GetModel<AchievementModel>().GotoCompleteAchievement(achieveId);
+ // }
+ // catch (Exception ex)
+ // {
+ // }
+ }
+
+ }
+}
diff --git a/Main/System/GMCommand/GMInputWin.cs.meta b/Main/System/GMCommand/GMInputWin.cs.meta
new file mode 100644
index 0000000..5f4c492
--- /dev/null
+++ b/Main/System/GMCommand/GMInputWin.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 208776f2449bacf42b46433d1afd852e
+timeCreated: 1511425001
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/GMCommand/MoveObj.cs b/Main/System/GMCommand/MoveObj.cs
new file mode 100644
index 0000000..4255a23
--- /dev/null
+++ b/Main/System/GMCommand/MoveObj.cs
@@ -0,0 +1,54 @@
+锘縰sing UnityEngine.EventSystems;
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace vnxbqy.UI
+{
+ public class MoveObj : MonoBehaviour,IDragHandler,IBeginDragHandler,IEndDragHandler
+ {
+ private Vector3 vec3;
+ private Vector3 pos;
+ public const string GMInputPos_Key = "GMInputPos";
+ private float[] gmInputPos = new float[3];
+
+
+ private void OnEnable()
+ {
+ if (LocalSave.GetFloatArray(GMInputPos_Key) != null)
+ {
+ gmInputPos = LocalSave.GetFloatArray(GMInputPos_Key);
+ transform.GetComponent<RectTransform>().anchoredPosition3D = new Vector3(gmInputPos[0], gmInputPos[1], gmInputPos[2]);
+ }
+ }
+
+
+ public void OnBeginDrag(PointerEventData eventData)
+ {
+ GameObject _moveObj = eventData.pointerDrag;
+ vec3 = Input.mousePosition;
+ pos = transform.GetComponent<RectTransform>().anchoredPosition3D;
+ }
+
+ public void OnDrag(PointerEventData eventData)
+ {
+ Vector3 off = Input.mousePosition - vec3;
+ vec3 = Input.mousePosition;
+ pos = pos + off;
+
+ if (pos.x > -506 && pos.y > -318 && pos.x < 515 && pos.y < 336)
+ {
+ transform.GetComponent<RectTransform>().anchoredPosition3D = pos;
+ gmInputPos[0] = pos.x;
+ gmInputPos[1] = pos.y;
+ gmInputPos[2] = pos.z;
+ LocalSave.SetFloatArray(GMInputPos_Key, gmInputPos);
+ }
+ }
+
+ public void OnEndDrag(PointerEventData eventData)
+ {
+ Debug.Log(pos.x + "鍜�" + pos.y);
+ }
+
+ }
+}
diff --git a/Main/System/GMCommand/MoveObj.cs.meta b/Main/System/GMCommand/MoveObj.cs.meta
new file mode 100644
index 0000000..aeaeb35
--- /dev/null
+++ b/Main/System/GMCommand/MoveObj.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 044e125d00bc6ad499d965f894feefcd
+timeCreated: 1511435569
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/GatheringSoul.meta b/Main/System/GatheringSoul.meta
new file mode 100644
index 0000000..b6009f9
--- /dev/null
+++ b/Main/System/GatheringSoul.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: e738788740f4f644e9d10089a38d623d
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/GatheringSoul/VirtualPackModel.cs b/Main/System/GatheringSoul/VirtualPackModel.cs
new file mode 100644
index 0000000..4e35c58
--- /dev/null
+++ b/Main/System/GatheringSoul/VirtualPackModel.cs
@@ -0,0 +1,363 @@
+锘縰sing System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Text;
+
+using UnityEngine;
+namespace vnxbqy.UI
+{
+
+ public class VirtualPackModel : ManagerBase<VirtualPackModel>
+ {
+ Dictionary<PackType, List<VirtualPackItem>> virtualPackItems
+ = new Dictionary<PackType, List<VirtualPackItem>>();
+ Dictionary<PackType, ObjectPool<VirtualPackItem>> m_VirtualItemPool
+ = new Dictionary<PackType, ObjectPool<VirtualPackItem>>();
+ Dictionary<PackType, int> virtualPackCapacityDict = new Dictionary<PackType, int>();
+
+ public event Action<PackType> virtualPackRefresh;
+ int getA206Count = 0; //鏀跺埌浜嗗嚑娆206鍖�
+ bool isFrist = false; //鏄笉鏄涓�娆¤幏寰楄仛榄傜鐗�
+ Dictionary<int, int> noPackItemCountDict = new Dictionary<int, int>(); //鏃犻渶鑳屽寘鐨勭墿鍝佹暟閲忓埛鏂帮紝鑷姩杞寲涓烘暟鍊�
+ public event Action OnNoPackItemCountRefresh;
+
+ public void OnBeforePlayerDataInitialize()
+ {
+ foreach (var packType in virtualPackItems.Keys)
+ {
+ var pool = m_VirtualItemPool[packType];
+ var items = virtualPackItems[packType];
+ foreach (var item in items)
+ {
+ pool.Release(item);
+ }
+ }
+ virtualPackItems.Clear();
+ noPackItemCountDict.Clear();
+ getA206Count = 0;
+ isFrist = false;
+ }
+
+ public void OnPlayerLoginOk()
+ {
+ isFrist = noPackItemCountDict.Count == 0;
+ }
+
+ public override void Init()
+ {
+ base.Init();
+ ParseConfig();
+ m_VirtualItemPool.Add(PackType.GatherSoul, new ObjectPool<VirtualPackItem>(OnGetItem, OnReleaseItem));
+ m_VirtualItemPool.Add(PackType.RunePack, new ObjectPool<VirtualPackItem>(OnGetItem, OnReleaseItem));
+ DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += OnBeforePlayerDataInitialize;
+ DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += OnPlayerLoginOk;
+ }
+
+ public virtual void Release()
+ {
+ base.Release();
+ DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= OnBeforePlayerDataInitialize;
+ DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent -= OnPlayerLoginOk;
+ }
+
+ void ParseConfig()
+ {
+ var funcConfig = FuncConfigConfig.Get("RunePackageNum");
+ virtualPackCapacityDict.Add(PackType.RunePack, int.Parse(funcConfig.Numerical1));
+ }
+
+ public bool IsVirtualPack(PackType packType)
+ {
+ switch (packType)
+ {
+ case PackType.GatherSoul:
+ case PackType.RunePack:
+ return true;
+ }
+ return false;
+ }
+
+ public int GetPackCapacity(PackType packType)
+ {
+ if (virtualPackCapacityDict.ContainsKey(packType))
+ {
+ return virtualPackCapacityDict[packType];
+ }
+ return 0;
+ }
+
+ public int GetPackRemainCount(PackType packType)
+ {
+ var capacity = GetPackCapacity(packType);
+ return capacity - GetPackItemCount(packType);
+ }
+
+ public int GetPackItemCount(PackType packType)
+ {
+ if (virtualPackItems.ContainsKey(packType))
+ {
+ return virtualPackItems[packType].Count;
+ }
+ return 0;
+ }
+
+ public int GetItemCountById(PackType packType, int id)
+ {
+ var count = 0;
+ List<int> list;
+ if (TryGetItems(packType, out list))
+ {
+ for (int i = 0; i < list.Count; i++)
+ {
+ VirtualPackItem item;
+ if (TryGetItem(packType, list[i], out item)
+ && item.id == id)
+ {
+ count++;
+ }
+ }
+ }
+ return count;
+ }
+
+ public void GetItemIndexs(PackType packType, ref List<int> list)
+ {
+ list.Clear();
+ List<VirtualPackItem> _list;
+ if (virtualPackItems.TryGetValue(packType, out _list))
+ {
+ for (int i = 0; i < _list.Count; i++)
+ {
+ list.Add(_list[i].index);
+ }
+ }
+ }
+
+ public bool TryGetItems(PackType packType, out List<int> list)
+ {
+ list = new List<int>();
+ List<VirtualPackItem> _list;
+ if (virtualPackItems.TryGetValue(packType, out _list))
+ {
+ for (int i = 0; i < _list.Count; i++)
+ {
+ list.Add(_list[i].index);
+ }
+ return true;
+ }
+ return false;
+ }
+
+ public bool TryGetItem<T>(PackType packType, int packIndex, out T item) where T : VirtualPackItem
+ {
+ item = default(T);
+ if (virtualPackItems.ContainsKey(packType))
+ {
+ var _index = virtualPackItems[packType].FindIndex((x) =>
+ {
+ return x.index == packIndex;
+ });
+ if (_index != -1)
+ {
+ item = virtualPackItems[packType][_index] as T;
+ }
+ return _index != -1;
+ }
+ return false;
+ }
+
+ public void OnReceiveServerPack(HA204_tagMCVPackRefresh package)
+ {
+ var packType = (PackType)package.PackType;
+ if (!IsVirtualPack(packType))
+ {
+ return;
+ }
+ List<VirtualPackItem> list;
+ if (!virtualPackItems.TryGetValue(packType, out list))
+ {
+ list = new List<VirtualPackItem>();
+ virtualPackItems.Add(packType, list);
+ }
+ SetVirtualItem(packType, ref list, package.VPacklItemList);
+ if (virtualPackRefresh != null)
+ {
+ virtualPackRefresh((PackType)package.PackType);
+ }
+
+ }
+
+ public void OnReceiveServerPack(HA205_tagMCVPackClear package)
+ {
+ var packType = (PackType)package.PackType;
+ if (!IsVirtualPack(packType))
+ {
+ return;
+ }
+ List<VirtualPackItem> list;
+ if (virtualPackItems.TryGetValue(packType, out list))
+ {
+ var pool = m_VirtualItemPool[packType];
+ for (int i = 0; i < package.Count; i++)
+ {
+ var index = package.ItemPlaceList[i];
+ var items = list.FindAll((x) =>
+ {
+ return x.index == index;
+ });
+ foreach (var item in items)
+ {
+ list.Remove(item);
+ pool.Release(item);
+ }
+ }
+ if (virtualPackRefresh != null)
+ {
+ virtualPackRefresh(packType);
+ }
+ }
+ }
+
+
+ public void UpdateAutoItemCountRefresh(HA206_tagMCAutoItemCountRefresh netPack)
+ {
+
+ ShowRewardWin(netPack);//vNetData涓璉temCount浼犵殑鏄鐗囨�绘暟锛岄渶瑕佸湪noPackItemCountDict鍐欏叆鏁版嵁涔嬪墠璁$畻宸��
+ for (int i = 0; i < netPack.Count; i++)
+ {
+ noPackItemCountDict[(int)netPack.ItemCountList[i].ItemID] = (int)netPack.ItemCountList[i].ItemCount;
+ }
+ OnNoPackItemCountRefresh?.Invoke();
+ }
+
+ void ShowRewardWin(HA206_tagMCAutoItemCountRefresh vNetData)
+ {
+ getA206Count += 1;
+ if (ItemLogicUtility.Instance.hidePickItem)
+ return;
+ // if (ModelCenter.Instance.GetModel<GatheringSoulModel>().isOpenXBWin)
+ // return;
+ if (getA206Count <= 1 && !isFrist)
+ return;
+
+ for (int i = 0; i < vNetData.ItemCountList.Length; i++)
+ {
+ int itemID = (int)vNetData.ItemCountList[i].ItemID;
+ int itemCount = (int)vNetData.ItemCountList[i].ItemCount;
+ if (noPackItemCountDict.ContainsKey(itemID) && noPackItemCountDict[itemID] > itemCount)
+ return;
+ ItemLogicUtility.Instance.RefreshPickItem(PackType.Item, itemID.ToString());
+ }
+ }
+
+
+ public int GetNoPackItemCount(int id)
+ {
+ if (noPackItemCountDict.ContainsKey(id))
+ {
+ return noPackItemCountDict[id];
+ }
+ return 0;
+ }
+
+ public Dictionary<int, int> GetAllNoPackItem()
+ {
+ return noPackItemCountDict;
+ }
+
+
+
+ void SetVirtualItem(PackType packType, ref List<VirtualPackItem> list, HA204_tagMCVPackRefresh.tagMCVPackItem[] items)
+ {
+ var pool = m_VirtualItemPool[packType];
+ for (int i = 0; i < items.Length; i++)
+ {
+ var item = list.Find((x) =>
+ {
+ return x.index == items[i].ItemPlace;
+ });
+ if (item != null)
+ {
+ item.Release();
+ }
+ else
+ {
+ if (pool.inactivedCount > 0)
+ {
+ item = pool.Get();
+ list.Add(item);
+ }
+ }
+ if (item == null)
+ {
+ item = VirtualPackItem.Get(packType);
+ list.Add(item);
+ }
+ item.ParsePackItem(items[i].ItemPlace, items[i].ItemData);
+
+ ItemLogicUtility.Instance.RefreshPickItem(packType, item.id.ToString());
+ }
+ }
+
+ static void OnGetItem(VirtualPackItem item)
+ {
+
+ }
+
+ static void OnReleaseItem(VirtualPackItem item)
+ {
+ item.Release();
+ }
+ }
+
+ public abstract class VirtualPackItem
+ {
+ public int index { get; private set; }
+
+ public int id { get; private set; }
+
+ public int level { get; private set; }
+
+ protected string dataString { get; set; }
+
+ protected static StringBuilder sb = new StringBuilder();
+
+ public virtual void ParsePackItem(int index, uint data)
+ {
+ this.index = index;
+
+ dataString = data.ToString();
+ int delta = 10 - dataString.Length;
+ sb.Length = 0;
+ sb.Append('0', delta);
+ dataString = dataString.Insert(0, sb.ToString());
+
+ id = int.Parse(dataString.Substring(5, 5));
+ level = int.Parse(dataString.Substring(2, 3)) + 1;
+ }
+
+ public virtual void Release()
+ {
+ dataString = null;
+ }
+
+ public static VirtualPackItem Get(PackType packType)
+ {
+ // switch (packType)
+ // {
+ // case PackType.RunePack:
+ // return new RuneItem();
+ // }
+ return null;
+ }
+ }
+
+ public struct VirtualItem
+ {
+ public PackType packType;
+ public int itemId;
+ public int index;
+ public int level;
+ }
+}
+
diff --git a/Main/System/GatheringSoul/VirtualPackModel.cs.meta b/Main/System/GatheringSoul/VirtualPackModel.cs.meta
new file mode 100644
index 0000000..c50fc76
--- /dev/null
+++ b/Main/System/GatheringSoul/VirtualPackModel.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 31921259156650748816297a77bb44a0
+timeCreated: 1544421387
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/ItemTip.meta b/Main/System/ItemTip.meta
new file mode 100644
index 0000000..a8ee3dd
--- /dev/null
+++ b/Main/System/ItemTip.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 52f8b7daf3bbb514baec6f43206b3dbf
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/ItemTip/ItemTipUtility.cs b/Main/System/ItemTip/ItemTipUtility.cs
new file mode 100644
index 0000000..1e299f9
--- /dev/null
+++ b/Main/System/ItemTip/ItemTipUtility.cs
@@ -0,0 +1,2035 @@
+锘�//--------------------------------------------------------
+// [Author]: 绗簩涓栫晫
+// [ Date ]: Tuesday, March 12, 2019
+//--------------------------------------------------------
+using UnityEngine;
+using System.Collections;
+using UnityEngine.UI;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace vnxbqy.UI
+{
+
+ public class ItemTipUtility
+ {
+ public enum TipType
+ {
+ Item,
+ Equip,
+ Dogz,
+ GatherSoul, //搴熷純
+ KingTreasure, //鐜嬭�呮硶瀹漷ip
+ PetMount,
+ SpiritWeapon,
+ PeerlessChest,
+ TreasureShow, //鍏朵粬娉曞疂tip
+ BoxItem, //瀹濈鐗╁搧
+ TreasurePavilion, //鍙ゅ疂鐗╁搧锛堢鐗囷級
+ }
+
+ public class TipData
+ {
+ public string guid;
+ public int itemId;
+ public int goodId;
+ public int exchangeItemId;
+
+ public BaseInfo baseInfo;
+ public BaseProperty baseProperty;
+ public BaseProperty petMountBaseProperty;
+ public SpiritWeaponProperty spiritWeaponProperty;
+ public ShenProperty shenProperty;
+ public LegendProperty legendProperty;
+ public SkillInfo skillInfo;
+ public SuitInfo suitInfo;
+ public StarInfo starInfo;
+ public StrengthenProperty strengthenProperty;
+ public GemInfo gemInfo;
+ public TrainProperty trainProperty;
+ public List<ItemOperateType> operates;
+ public WingRefineMaterials refineMaterials;
+ public GetWay getWay;
+ }
+
+ public struct BaseInfo
+ {
+ public int itemId;
+ public int count;
+ public bool isAuction;
+ public bool isEquiped;
+ public bool isPreview;
+
+ public int star;
+ public int strengthenLevel;
+ public int score;
+ public bool isOverdue;
+ public int auctionSurplusTime;
+ public int overdueSurplusTime;
+ public int levelLimit;
+ public int realmLimit;
+ public int moneyLimit;
+ public int evolveLevel;
+ }
+
+ public struct BaseProperty
+ {
+ public List<Int2> baseProperties;
+ public int star;
+ public List<Int2> starProperties;
+ }
+
+ public struct SpiritWeaponProperty
+ {
+ public int itemId;
+ public List<Int3> properties;
+ }
+
+ public struct LegendProperty
+ {
+ public bool isPreview;
+ public int itemId;
+ public int trueCount;
+ public List<Int2> properties;
+ public int score;
+ }
+
+ //绁炶灞炴��
+ public struct ShenProperty
+ {
+ public bool isPreview;
+ public int itemId;
+ public List<Int3> properties;
+ }
+
+ public struct SuitInfo
+ {
+ public int job;
+ public string name;
+ public int level;
+ public int maxSuitLevel;
+ public List<int> places;
+ public Dictionary<int, int> placeStars;
+ // public Dictionary<int, EquipSuitPropertyEntry> twoSuitProperties;
+ // public Dictionary<int, EquipSuitPropertyEntry> fiveSuitProperties;
+ public Dictionary<int, bool> eightSuits;
+ }
+
+ public struct StarInfo
+ {
+ public Int2 equipPosition;
+ public int starLevel;
+ public int maxLevel;
+ }
+
+ public struct StrengthenProperty
+ {
+ public int strengthenLevel;
+ public List<Int2> properties;
+ public int evolveLevel;
+ public int equipPlace;
+ }
+
+ public struct GemInfo
+ {
+ public Dictionary<int, bool> activeStates;
+ public Dictionary<int, int> gems;
+ }
+
+ public struct TrainProperty
+ {
+ public int level;
+ public List<Int2> properties;
+ }
+
+ public struct SkillInfo
+ {
+ public List<int> skills;
+ }
+
+ public struct WingRefineMaterials
+ {
+ public List<Int2> materials;
+ }
+
+ public struct GetWay
+ {
+ public bool defaultUnfold;
+ public int itemId;
+ public List<int> ways;
+ }
+
+
+
+ public struct CustomEquipInfo
+ {
+ public int job;
+ public int itemId;
+ public int score;
+ public bool isEquiped;
+ public List<Int2> legendProperties;
+ public List<int> suitPlaces;
+ public Dictionary<int, int> placeStars;
+ // public Dictionary<EquipSuitType, int> suitLevels;
+ public int strengthenLevel;
+ public int starLevel;
+ public List<Int2> trainProperties;
+ public Dictionary<int, bool> gemHoleActiveStates;
+ public Dictionary<int, int> gems;
+ public List<int> equipSkillList;
+ public int evolveLevel;
+ }
+
+ public struct CustomItemPlus
+ {
+ public int ItemID;
+ public int count;
+ public int Equipped;
+ public int Preview;
+ public int Star;
+ public int PlusLV;
+ public int EvolveLV;
+ public string UserData;
+ public int[] Stone;
+ public CustomEquipWash Wash;
+ public int[][] Equips;
+ public int[] suitPlaces;
+ public int[] suitLevels;
+ public int[] placeStars;
+ }
+
+ public struct CustomEquipWash
+ {
+ public int LV;
+ public int[] Value;
+ }
+
+ public struct ItemViewInfo
+ {
+ public int itemId;
+ public bool compare;
+ public bool unfoldGetWay;
+ public bool isAuctionEquip;
+ public LegendProperty legendProperty;
+ public int score;
+ }
+
+ // static PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
+ // static EquipModel equipModel { get { return ModelCenter.Instance.GetModel<EquipModel>(); } }
+ // static EquipStarModel starModel { get { return ModelCenter.Instance.GetModel<EquipStarModel>(); } }
+ // static EquipGemModel gemModel { get { return ModelCenter.Instance.GetModel<EquipGemModel>(); } }
+ // static EquipTrainModel trainModel { get { return ModelCenter.Instance.GetModel<EquipTrainModel>(); } }
+ // static EquipStrengthModel strengthenModel { get { return ModelCenter.Instance.GetModel<EquipStrengthModel>(); } }
+ // static MountModel mountModel { get { return ModelCenter.Instance.GetModel<MountModel>(); } }
+ // static PetModel petModel { get { return ModelCenter.Instance.GetModel<PetModel>(); } }
+ // static ComposeWinModel composeModel { get { return ModelCenter.Instance.GetModel<ComposeWinModel>(); } }
+ // static StoreModel storeModel { get { return ModelCenter.Instance.GetModel<StoreModel>(); } }
+ // static VirtualPackModel virtualPackModel { get { return ModelCenter.Instance.GetModel<VirtualPackModel>(); } }
+ // static ItemOverdueModel itemOverdueModel { get { return ModelCenter.Instance.GetModel<ItemOverdueModel>(); } }
+ // static BoxGetItemModel boxGetItemModel { get { return ModelCenter.Instance.GetModel<BoxGetItemModel>(); } }
+
+ public static TipData mainTipData { get; private set; }
+ public static TipData secondaryData { get; private set; }
+
+ public static void Show(int itemId)
+ {
+ if (!ItemConfig.HasKey(itemId))
+ {
+ Debug.LogErrorFormat("鏌ユ棤姝ょ墿鍝侊細{0}", itemId);
+ return;
+ }
+
+ Show(new ItemViewInfo()
+ {
+ itemId = itemId,
+ });
+ }
+
+ public static void Show(ItemViewInfo item)
+ {
+ var itemId = item.itemId;
+ if (!ItemConfig.HasKey(itemId))
+ {
+ Debug.LogErrorFormat("鏌ユ棤姝ょ墿鍝侊細{0}", itemId);
+ return;
+ }
+
+ // secondaryData = null;
+
+ // var config = ItemConfig.Get(itemId);
+ // PrintItemBrief(itemId);
+
+ // var tipType = GetTipType(itemId);
+ // switch (tipType)
+ // {
+ // case TipType.Equip:
+ // mainTipData = CreateNormalEquipData(itemId);
+ // if (item.isAuctionEquip && !item.legendProperty.Equals(default(LegendProperty)))
+ // {
+ // mainTipData.legendProperty = item.legendProperty;
+ // mainTipData.baseInfo.score = item.score;
+ // mainTipData.baseInfo.isPreview = false;
+ // }
+
+ // if (item.compare)
+ // {
+ // if (ItemLogicUtility.Instance.IsJobCompatibleItem(itemId))
+ // {
+ // var equipedGuid = equipModel.GetEquip(new Int2(config.LV, config.EquipPlace));
+ // if (equipedGuid != string.Empty)
+ // {
+ // secondaryData = CreateNormalEquipData(equipedGuid, false);
+ // }
+ // }
+ // }
+ // break;
+ // case TipType.Dogz:
+ // mainTipData = CreateDogzEquipData(itemId);
+ // break;
+ // case TipType.PeerlessChest:
+ // mainTipData = CreateItemData(itemId);
+ // mainTipData.getWay = default(GetWay);
+ // Dictionary<int, int> selectItems;
+ // if (boxGetItemModel.IsSelectItemByID(itemId, out selectItems))
+ // {
+ // secondaryData = CreateNormalEquipData(selectItems.Keys.First());
+ // secondaryData.getWay = default(GetWay);
+ // }
+ // break;
+ // default:
+ // mainTipData = CreateItemData(itemId);
+ // break;
+ // }
+
+ // mainTipData.getWay.defaultUnfold = item.unfoldGetWay;
+ // switch (tipType)
+ // {
+ // case TipType.Equip:
+ // WindowCenter.Instance.Open<EquipTipWin>();
+ // break;
+ // case TipType.Dogz:
+ // WindowCenter.Instance.Open<EquipTipWin>();
+ // break;
+ // case TipType.KingTreasure:
+ // var kingTreasureShow = ModelCenter.Instance.GetModel<KingTreasureShowModel>();
+ // kingTreasureShow.SetInitData(itemId);
+ // break;
+ // case TipType.PetMount:
+ // WindowCenter.Instance.Open<PetMountTipWin>();
+ // break;
+ // case TipType.SpiritWeapon:
+ // WindowCenter.Instance.Open<SpiritWeaponTipWin>();
+ // break;
+ // case TipType.PeerlessChest:
+ // WindowCenter.Instance.Open<PeerlessChestTipWin>();
+ // break;
+ // case TipType.TreasureShow:
+ // TreasureEffectModel effectModel = ModelCenter.Instance.GetModel<TreasureEffectModel>();
+ // if (config.Effect1 == 232)
+ // {
+ // effectModel.SetTreasureID(config.EffectValueA1, 0);
+ // }
+ // break;
+ // case TipType.BoxItem:
+ // if (WindowCenter.Instance.IsOpen<ItemBoxTipWin>())
+ // {
+ // WindowCenter.Instance.Open<ItemTipWin>();
+ // }
+ // else
+ // {
+ // WindowCenter.Instance.Open<ItemBoxTipWin>();
+ // }
+ // break;
+ // case TipType.TreasurePavilion:
+ // TreasurePavilionModel.Instance.selectGubao = config.EffectValueA1;
+ // TreasurePavilionModel.Instance.showTipFromPiece = config.ID;
+ // WindowCenter.Instance.OpenIL<TreasurePavilionTipWin>();
+ // break;
+ // default:
+ // WindowCenter.Instance.Open<ItemTipWin>();
+ // break;
+ // }
+ }
+
+ // public static void Show(string guid, bool operatable = true)
+ // {
+ // var item = packModel.GetItemByGuid(guid);
+ // if (item == null)
+ // {
+ // return;
+ // }
+ // PrintItemBrief(item.itemId, guid);
+
+ // secondaryData = null;
+ // var tipType = GetTipType(item.itemId);
+ // switch (tipType)
+ // {
+ // case TipType.Equip:
+ // var packType = item.packType;
+ // switch (packType)
+ // {
+ // case PackType.Equip:
+ // mainTipData = CreateNormalEquipData(guid, operatable);
+ // break;
+ // default:
+ // if (item.isAuction)
+ // {
+ // mainTipData = CreateEquipAuctionData(guid, operatable);
+
+ // if (ItemLogicUtility.Instance.IsJobCompatibleItem(item.itemId))
+ // {
+ // var equipedGuid = equipModel.GetEquip(new Int2(item.config.LV, item.config.EquipPlace));
+ // if (equipedGuid != string.Empty)
+ // {
+ // secondaryData = CreateNormalEquipData(equipedGuid, false);
+ // }
+ // }
+ // }
+ // else
+ // {
+ // mainTipData = CreateNormalEquipData(guid, operatable);
+ // var equipedGuid = equipModel.GetEquip(new Int2(item.config.LV, item.config.EquipPlace));
+ // if (equipedGuid != guid)
+ // {
+ // secondaryData = CreateNormalEquipData(equipedGuid, false);
+ // }
+ // }
+ // break;
+ // }
+ // break;
+ // case TipType.Dogz:
+ // mainTipData = CreateDogzEquipData(guid);
+ // break;
+ // default:
+ // mainTipData = CreateItemData(guid, operatable);
+ // break;
+ // }
+
+ // switch (tipType)
+ // {
+ // case TipType.Equip:
+ // WindowCenter.Instance.Open<EquipTipWin>();
+ // break;
+ // case TipType.Dogz:
+ // WindowCenter.Instance.Open<EquipTipWin>();
+ // break;
+ // case TipType.KingTreasure:
+ // var kingTreasureShow = ModelCenter.Instance.GetModel<KingTreasureShowModel>();
+ // kingTreasureShow.SetInitData(item.itemId);
+ // break;
+ // case TipType.PetMount:
+ // WindowCenter.Instance.Open<PetMountTipWin>();
+ // break;
+ // case TipType.SpiritWeapon:
+ // WindowCenter.Instance.Open<SpiritWeaponTipWin>();
+ // break;
+ // case TipType.BoxItem:
+ // if (WindowCenter.Instance.IsOpen<ItemBoxTipWin>())
+ // {
+ // WindowCenter.Instance.Open<ItemTipWin>();
+ // }
+ // else
+ // {
+ // WindowCenter.Instance.Open<ItemBoxTipWin>();
+ // }
+ // break;
+ // case TipType.TreasurePavilion:
+ // TreasurePavilionModel.Instance.selectGubao = item.config.EffectValueA1;
+ // TreasurePavilionModel.Instance.showTipFromPiece = item.itemId;
+ // WindowCenter.Instance.OpenIL<TreasurePavilionTipWin>();
+ // break;
+ // default:
+ // WindowCenter.Instance.Open<ItemTipWin>();
+ // break;
+ // }
+
+ // }
+
+ // public static void ShowGood(int goodId, int itemId)
+ // {
+ // secondaryData = null;
+
+ // var isEquip = ItemLogicUtility.Instance.IsRealmEquip(itemId);
+ // if (isEquip)
+ // {
+ // mainTipData = CreateGoodEquipData(itemId, goodId);
+ // }
+ // else
+ // {
+ // mainTipData = CreateGoodItemData(itemId, goodId);
+ // }
+
+ // BuyItemController.Instance.SetGood(goodId);
+ // var itemConfig = ItemConfig.Get(itemId);
+ // if (isEquip)
+ // {
+ // WindowCenter.Instance.Open<EquipTipWin>();
+ // }
+ // else
+ // {
+ // var tipType = GetTipType(itemId);
+
+ // switch (tipType)
+ // {
+ // case TipType.PetMount:
+ // WindowCenter.Instance.Open<PetMountTipWin>();
+ // break;
+ // case TipType.SpiritWeapon:
+ // WindowCenter.Instance.Open<SpiritWeaponTipWin>();
+ // break;
+ // case TipType.BoxItem:
+ // if (WindowCenter.Instance.IsOpen<ItemBoxTipWin>())
+ // {
+ // WindowCenter.Instance.Open<ItemTipWin>();
+ // }
+ // else
+ // {
+ // WindowCenter.Instance.Open<ItemBoxTipWin>();
+ // }
+ // break;
+ // default:
+ // WindowCenter.Instance.Open<ItemTipWin>();
+ // break;
+ // }
+ // }
+ // }
+
+ // public static void ShowCustomEquip(CustomEquipInfo info)
+ // {
+ // secondaryData = null;
+ // mainTipData = CreateCustomEquipData(info);
+ // WindowCenter.Instance.Open<EquipTipWin>();
+ // }
+
+
+
+ // static TipData CreateNormalEquipData(string guid, bool operatable)
+ // {
+ // var item = packModel.GetItemByGuid(guid);
+ // if (item == null)
+ // {
+ // return default(TipData);
+ // }
+
+ // return new TipData()
+ // {
+ // itemId = item.itemId,
+ // guid = guid,
+
+ // baseInfo = GetBaseInfo(guid),
+ // baseProperty = GetBaseProperty(guid),
+ // spiritWeaponProperty = GetSpiritWeaponProperty(item.itemId),
+ // legendProperty = GetLegendProperty(guid),
+ // skillInfo = GetSkillInfo(item.itemId, guid),
+ // suitInfo = GetSuitInfo(guid),
+ // starInfo = GetStarInfo(guid),
+ // strengthenProperty = GetStrengthenProperty(guid),
+ // gemInfo = GetGemInfo(guid),
+ // trainProperty = GetTrainProperty(guid),
+ // operates = operatable ? GetOperates(guid) : null,
+ // shenProperty = GetShenProperty(item.itemId)
+ // };
+ // }
+
+ // static TipData CreateNormalEquipData(int itemId)
+ // {
+ // return new TipData()
+ // {
+ // itemId = itemId,
+ // guid = string.Empty,
+
+ // baseInfo = GetBaseInfo(itemId),
+ // baseProperty = GetBaseProperty(itemId),
+ // legendProperty = GetLegendProperty(itemId),
+ // spiritWeaponProperty = GetSpiritWeaponProperty(itemId),
+ // skillInfo = GetSkillInfo(itemId),
+ // suitInfo = GetSuitInfo(itemId),
+ // gemInfo = GetGemInfo(itemId),
+ // starInfo = GetStarInfo(itemId),
+ // getWay = GetGetWay(itemId),
+ // shenProperty = GetShenProperty(itemId)
+ // };
+ // }
+
+ // static TipData CreateDogzEquipData(string guid)
+ // {
+ // var item = packModel.GetItemByGuid(guid);
+ // if (item == null)
+ // {
+ // return default(TipData);
+ // }
+
+ // return new TipData()
+ // {
+ // itemId = item.itemId,
+ // guid = guid,
+
+ // baseInfo = GetBaseInfo(guid),
+ // baseProperty = GetBaseProperty(guid),
+ // legendProperty = GetLegendProperty(guid),
+ // operates = GetOperates(guid),
+ // };
+ // }
+
+ // static TipData CreateDogzEquipData(int itemId)
+ // {
+ // return new TipData()
+ // {
+ // itemId = itemId,
+ // guid = string.Empty,
+
+ // baseInfo = GetBaseInfo(itemId),
+ // baseProperty = GetBaseProperty(itemId),
+ // legendProperty = GetLegendProperty(itemId),
+ // getWay = GetGetWay(itemId)
+ // };
+ // }
+
+ // static TipData CreateCustomEquipData(CustomEquipInfo info)
+ // {
+ // var config = ItemConfig.Get(info.itemId);
+ // if (config == null)
+ // {
+ // return default(TipData);
+ // }
+
+ // var baseInfo = new BaseInfo()
+ // {
+ // itemId = info.itemId,
+ // star = info.starLevel,
+ // strengthenLevel = info.strengthenLevel,
+ // score = info.score,
+ // isEquiped = info.isEquiped,
+ // evolveLevel = info.evolveLevel,
+ // };
+
+ // var baseProperty = GetBaseProperty(info.itemId);
+ // if (info.starLevel > 0)
+ // {
+ // var starProperties = new List<Int2>();
+ // baseProperty.star = info.starLevel;
+ // var starConfig = EquipStarConfig.Get(config.LV, config.EquipPlace, info.starLevel);
+ // starProperties.AddRange(starConfig.BaseAttrInfo);
+ // baseProperty.starProperties = starProperties;
+ // }
+
+ // var legendProperty = new LegendProperty()
+ // {
+ // properties = info.legendProperties,
+ // };
+
+ // var skillInfo = GetSkillInfo(info.itemId, info);
+ // var suitInfo = default(SuitInfo);
+ // if (ItemLogicUtility.Instance.IsSuitEquip(info.itemId))
+ // {
+ // var job = config.JobLimit;
+ // var twoConfigs = EquipSuitConfig.GetConfigs(job, config.LV, EquipSuitType.TwoSuit);
+ // var name = twoConfigs[0].name;
+ // var level = config.LV;
+ // var maxSuitLevel = EquipStarModel.GetMaxStarLevel(level);
+
+ // var twoSuitProperties = new Dictionary<int, EquipSuitPropertyEntry>();
+ // var fiveSuitProperties = new Dictionary<int, EquipSuitPropertyEntry>();
+ // var eightSuits = new Dictionary<int, bool>();
+ // var eightSuitLevel = info.suitLevels[EquipSuitType.EightSuit];
+
+ // for (var i = 0; i <= 9; i++, i++, i++)
+ // {
+ // var configs = EquipSuitConfig.GetConfigs(job, level, EquipSuitType.TwoSuit);
+ // var actived = info.suitLevels[EquipSuitType.TwoSuit] >= i;
+ // var properties = new List<Int2>();
+ // foreach (var item in configs)
+ // {
+ // if (item.star == i)
+ // {
+ // properties.AddRange(item.attr);
+ // break;
+ // }
+ // }
+
+ // twoSuitProperties[i] = new EquipSuitPropertyEntry()
+ // {
+ // type = EquipSuitType.TwoSuit,
+ // actived = actived,
+ // properties = properties,
+ // };
+
+ // configs = EquipSuitConfig.GetConfigs(job, level, EquipSuitType.FiveSuit);
+ // actived = info.suitLevels[EquipSuitType.FiveSuit] >= i;
+ // properties = new List<Int2>();
+ // foreach (var item in configs)
+ // {
+ // if (item.star == i)
+ // {
+ // properties.AddRange(item.attr);
+ // break;
+ // }
+ // }
+
+ // fiveSuitProperties[i] = new EquipSuitPropertyEntry()
+ // {
+ // type = EquipSuitType.TwoSuit,
+ // actived = actived,
+ // properties = properties,
+ // };
+
+ // eightSuits[i] = eightSuitLevel >= i;
+ // }
+
+ // suitInfo = new SuitInfo()
+ // {
+ // name = name,
+ // level = level,
+ // job = job,
+ // maxSuitLevel = maxSuitLevel,
+ // places = info.suitPlaces,
+ // placeStars = info.placeStars,
+ // twoSuitProperties = twoSuitProperties,
+ // fiveSuitProperties = fiveSuitProperties,
+ // eightSuits = eightSuits
+ // };
+ // }
+
+ // var starInfo = new StarInfo()
+ // {
+ // equipPosition = new Int2(config.LV, config.EquipPlace),
+ // starLevel = info.starLevel,
+ // maxLevel = config.LV == 0 ? 0 : EquipStarModel.GetMaxStarLevel(config.ItemColor, config.LV),
+ // };
+
+ // var type = EquipStrengthModel.GetEquipStrengthType(config.EquipPlace);
+ // var strengthenConfig = ItemPlusConfig.GetTypeAndLevel(type, info.strengthenLevel);
+ // var strengthenProperties = new List<Int2>();
+ // for (int i = 0; i < strengthenConfig.attType.Length; i++)
+ // {
+ // strengthenProperties.Add(new Int2(strengthenConfig.attType[i], strengthenConfig.attValue[i]));
+ // }
+ // var strengthenProperty = new StrengthenProperty()
+ // {
+ // strengthenLevel = info.strengthenLevel,
+ // properties = strengthenProperties,
+ // equipPlace = config.EquipPlace,
+ // evolveLevel = info.evolveLevel,
+ // };
+
+ // var gemInfo = new GemInfo()
+ // {
+ // activeStates = info.gemHoleActiveStates,
+ // gems = info.gems,
+ // };
+
+ // var trainProperty = new TrainProperty()
+ // {
+ // properties = info.trainProperties,
+ // };
+
+ // return new TipData()
+ // {
+ // itemId = info.itemId,
+ // baseInfo = baseInfo,
+ // baseProperty = baseProperty,
+ // legendProperty = legendProperty,
+ // skillInfo = skillInfo,
+ // suitInfo = suitInfo,
+ // starInfo = starInfo,
+ // strengthenProperty = strengthenProperty,
+ // gemInfo = gemInfo,
+ // trainProperty = trainProperty,
+ // shenProperty = GetShenProperty(info.itemId)
+ // };
+ // }
+
+ // static TipData CreateGoodEquipData(int itemId, int goodId)
+ // {
+ // return new TipData()
+ // {
+ // itemId = itemId,
+ // guid = string.Empty,
+ // goodId = goodId,
+
+ // baseInfo = GetBaseInfo(itemId),
+ // baseProperty = GetBaseProperty(itemId),
+ // spiritWeaponProperty = GetSpiritWeaponProperty(itemId),
+ // legendProperty = GetLegendProperty(itemId),
+ // skillInfo = GetSkillInfo(itemId),
+ // suitInfo = GetSuitInfo(itemId),
+ // gemInfo = GetGemInfo(itemId),
+ // starInfo = GetStarInfo(itemId),
+ // operates = GetGoodOperates(goodId),
+ // shenProperty = GetShenProperty(itemId)
+ // };
+ // }
+
+ // static TipData CreateEquipAuctionData(string guid, bool operatable)
+ // {
+ // var item = packModel.GetItemByGuid(guid);
+ // if (item == null)
+ // {
+ // return default(TipData);
+ // }
+
+ // var legendProperty = GetLegendProperty(guid);
+ // if (legendProperty.properties.IsNullOrEmpty())
+ // {
+ // legendProperty = GetLegendProperty(item.itemId);
+ // }
+
+ // return new TipData()
+ // {
+ // itemId = item.itemId,
+ // guid = guid,
+
+ // baseInfo = GetBaseInfo(guid),
+ // baseProperty = GetBaseProperty(item.itemId),
+ // spiritWeaponProperty = GetSpiritWeaponProperty(item.itemId),
+ // legendProperty = legendProperty,
+ // skillInfo = GetSkillInfo(item.itemId, guid),
+ // suitInfo = GetSuitInfo(item.itemId),
+ // operates = operatable ? GetOperates(guid) : null,
+
+ // starInfo = GetStarInfo(guid),
+ // gemInfo = GetGemInfo(guid),
+ // shenProperty = GetShenProperty(item.itemId)
+ // };
+ // }
+
+ // static TipData CreateItemData(string guid, bool operatable)
+ // {
+ // var item = packModel.GetItemByGuid(guid);
+ // if (item == null)
+ // {
+ // return default(TipData);
+ // }
+
+ // return new TipData()
+ // {
+ // itemId = item.itemId,
+ // guid = guid,
+
+ // baseInfo = GetBaseInfo(guid),
+ // baseProperty = GetBaseProperty(item.itemId),
+ // spiritWeaponProperty = GetSpiritWeaponProperty(item.itemId),
+ // legendProperty = GetLegendProperty(guid),
+ // petMountBaseProperty = GetPetMountBaseProperty(item.itemId),
+ // operates = operatable ? GetOperates(guid) : null,
+ // refineMaterials = GetWingRefineMaterials(guid),
+ // shenProperty = GetShenProperty(item.itemId)
+ // };
+ // }
+
+ // static TipData CreateItemData(int itemId)
+ // {
+ // return new TipData()
+ // {
+ // itemId = itemId,
+ // baseInfo = GetBaseInfo(itemId),
+ // baseProperty = GetBaseProperty(itemId),
+ // exchangeItemId = itemId,
+ // spiritWeaponProperty = GetSpiritWeaponProperty(itemId),
+ // legendProperty = GetLegendProperty(itemId),
+ // petMountBaseProperty = GetPetMountBaseProperty(itemId),
+ // getWay = GetGetWay(itemId),
+ // shenProperty = GetShenProperty(itemId)
+ // };
+ // }
+
+ // static TipData CreateGoodItemData(int itemId, int goodId)
+ // {
+ // return new TipData()
+ // {
+ // itemId = itemId,
+ // goodId = goodId,
+ // baseInfo = GetBaseInfo(itemId),
+ // baseProperty = GetBaseProperty(itemId),
+ // legendProperty = GetLegendProperty(itemId),
+ // spiritWeaponProperty = GetSpiritWeaponProperty(itemId),
+ // petMountBaseProperty = GetPetMountBaseProperty(itemId),
+ // operates = GetGoodOperates(goodId),
+ // shenProperty = GetShenProperty(itemId)
+ // };
+ // }
+
+
+
+ // public static void Operate(ItemOperateType type, string guid)
+ // {
+ // switch (type)
+ // {
+ // case ItemOperateType.putOn:
+ // ItemOperateUtility.Instance.PutOnItem(guid);
+ // break;
+ // case ItemOperateType.gotoPuton:
+ // ItemOperateUtility.Instance.PutOnItem(guid);
+ // break;
+ // case ItemOperateType.putOff:
+ // ItemOperateUtility.Instance.PutOffEquip(guid);
+ // break;
+ // case ItemOperateType.putAway:
+ // ItemOperateUtility.Instance.PutAway(guid);
+ // break;
+ // case ItemOperateType.putIn:
+ // ItemOperateUtility.Instance.PutInWareHouse(guid);
+ // break;
+ // case ItemOperateType.putOut:
+ // ItemOperateUtility.Instance.TakeOutFromWarehouse(guid);
+ // break;
+ // case ItemOperateType.sell:
+ // ItemOperateUtility.Instance.SellItem(guid);
+ // break;
+ // case ItemOperateType.strength:
+ // ItemOperateUtility.Instance.GotoStrengthen(guid);
+ // break;
+ // case ItemOperateType.star:
+ // ItemOperateUtility.Instance.GotoStarUpgrade(guid);
+ // break;
+ // case ItemOperateType.inlay:
+ // ItemOperateUtility.Instance.GotoInlayItem(guid);
+ // break;
+ // case ItemOperateType.train:
+ // ItemOperateUtility.Instance.GotoTrain(guid);
+ // break;
+ // case ItemOperateType.makeUse:
+ // ItemOperateUtility.Instance.GotoUseItem(guid);
+ // break;
+ // case ItemOperateType.split:
+ // ItemOperateUtility.Instance.OnClickSplitBtn(guid);
+ // break;
+ // case ItemOperateType.compose:
+ // var wannaComposeItem = packModel.GetItemByGuid(guid);
+ // var jumpId = 0;
+ // var isUnlock = composeModel.CheckComposeItemById(wannaComposeItem.itemId, out jumpId);
+ // if (isUnlock)
+ // {
+ // ItemOperateUtility.Instance.GotoComposeItem(jumpId);
+ // }
+ // break;
+ // case ItemOperateType.renewal:
+ // ItemOperateUtility.Instance.RenewalItem(guid);
+ // break;
+ // case ItemOperateType.exchange:
+ // WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.ExchangeActiveToken);
+ // break;
+ // case ItemOperateType.lsExchange:
+ // WindowCenter.Instance.Open<LingShiChange>();
+ // break;
+ // case ItemOperateType.default1:
+ // var item = packModel.GetItemByGuid(guid);
+ // if (item == null)
+ // {
+ // break;
+ // }
+
+ // EquipEvolveModel.Instance.EquipJump(item.config.LV, item.config.EquipPlace);
+ // WindowJumpMgr.Instance.WindowJumpTo((JumpUIType)2013);
+ // break;
+ // }
+ // }
+
+ // public static void GoodOperate(ItemOperateType type, int goodId, int count)
+ // {
+ // var config = StoreConfig.Get(goodId);
+ // storeModel.SendBuyShopItem(config, count);
+ // }
+
+
+ // private static BaseInfo GetBaseInfo(int itemId)
+ // {
+ // var config = ItemConfig.Get(itemId);
+ // var money = 0;
+ // if (config.Type == 81)
+ // {
+ // var chestConfig = ChestsConfig.Get(itemId);
+ // money = chestConfig.OpenMoney;
+ // }
+
+ // var baseInfo = new BaseInfo()
+ // {
+ // itemId = itemId,
+ // isAuction = false,
+ // isEquiped = false,
+ // isPreview = true,
+ // score = ItemLogicUtility.Instance.GetEquipScore(itemId, null, true),
+ // auctionSurplusTime = 0,
+ // levelLimit = config.UseLV,
+ // realmLimit = config.RealmLimit,
+ // moneyLimit = money,
+ // };
+
+ // return baseInfo;
+ // }
+
+ // private static BaseInfo GetBaseInfo(string guid)
+ // {
+ // var item = packModel.GetItemByGuid(guid);
+
+ // var level = item.config.LV;
+ // var place = item.config.EquipPlace;
+
+ // var isEquiped = equipModel.GetEquip(new Int2(level, place)) == guid;
+
+ // var type = EquipStrengthModel.GetEquipStrengthType(place);
+ // var star = starModel.GetEquipStarLevel(new Int2(level, place));
+ // var maxStrengthenLevel = strengthenModel.GetEquipLevelMax(type, level);
+ // var placeStrengthenLevel = strengthenModel.GetStrengthLevel(level, place);
+
+ // var money = 0;
+ // if (item.config.Type == 81)
+ // {
+ // var chestConfig = ChestsConfig.Get(item.itemId);
+ // money = chestConfig.OpenMoney;
+ // }
+
+ // var baseInfo = new BaseInfo()
+ // {
+ // itemId = item.itemId,
+ // count = item.count,
+ // isAuction = item.isAuction,
+ // isEquiped = isEquiped,
+ // isPreview = false,
+ // score = item.score,
+ // isOverdue = ItemLogicUtility.Instance.IsOverdue(guid),
+ // auctionSurplusTime = item.isAuction ? item.auctionSurplusTime : 0,
+ // overdueSurplusTime = item.overdueSurplusTime,
+ // levelLimit = item.isAuction ? 0 : item.config.UseLV,
+ // realmLimit = item.isAuction ? 0 : item.config.RealmLimit,
+ // star = isEquiped ? star : -1,
+ // strengthenLevel = isEquiped ? Mathf.Min(placeStrengthenLevel, maxStrengthenLevel) : 0,
+ // moneyLimit = money,
+ // };
+
+ // return baseInfo;
+ // }
+
+ // private static BaseProperty GetBaseProperty(int itemId)
+ // {
+ // var baseProperties = new List<Int2>();
+ // var config = ItemConfig.Get(itemId);
+
+ // if (config.Effect1 == 220)
+ // {
+ // return GetBaseProperty(config.EffectValueA1);
+ // }
+
+ // if (!ItemLogicUtility.Instance.IsDogzEquip(itemId))
+ // {
+ // if (config.Effect1 != 0)
+ // {
+ // baseProperties.Add(new Int2(config.Effect1, config.EffectValueA1));
+ // }
+ // }
+
+ // if (config.Effect2 != 0)
+ // {
+ // baseProperties.Add(new Int2(config.Effect2, config.EffectValueA2));
+ // }
+
+ // if (config.Effect3 != 0)
+ // {
+ // baseProperties.Add(new Int2(config.Effect3, config.EffectValueA3));
+ // }
+
+ // if (config.Effect4 != 0)
+ // {
+ // baseProperties.Add(new Int2(config.Effect4, config.EffectValueA4));
+ // }
+
+ // if (config.Effect5 != 0)
+ // {
+ // baseProperties.Add(new Int2(config.Effect5, config.EffectValueA5));
+ // }
+
+ // var baseProperty = new BaseProperty()
+ // {
+ // baseProperties = baseProperties,
+ // };
+
+ // return baseProperty;
+ // }
+
+ // private static BaseProperty GetBaseProperty(string guid)
+ // {
+ // var item = packModel.GetItemByGuid(guid);
+ // var equipPosition = new Int2(item.config.LV, item.config.EquipPlace);
+ // var equiped = equipModel.GetEquip(equipPosition) == guid;
+
+ // var baseProperty = GetBaseProperty(item.itemId);
+
+ // if (equiped)
+ // {
+ // var starProperties = new List<Int2>();
+ // var currentStar = starModel.GetEquipStarLevel(equipPosition);
+ // var maxStar = EquipStarModel.GetMaxStarLevel(item.config.ItemColor, item.config.LV);
+ // var star = Mathf.Min(currentStar, maxStar);
+ // if (star > 0)
+ // {
+ // baseProperty.star = star;
+ // var starConfig = EquipStarConfig.Get(item.config.LV, item.config.EquipPlace, star);
+ // starProperties.AddRange(starConfig.BaseAttrInfo);
+ // }
+
+ // baseProperty.starProperties = starProperties;
+ // }
+
+ // return baseProperty;
+ // }
+
+ // private static BaseProperty GetPetMountBaseProperty(int itemId)
+ // {
+ // var config = ItemConfig.Get(itemId);
+ // var baseProperty = new BaseProperty();
+ // Dictionary<int, int> properties = null;
+ // switch (config.Type)
+ // {
+ // case 26:
+ // var petId = PetInfoConfig.GetItemUnLockPet(itemId);
+ // properties = petModel.GetPetAttrAddDict(petId);
+ // break;
+ // case 41:
+ // case 42:
+ // var horseId = HorseConfig.GetItemUnLockHorse(itemId);
+ // properties = mountModel.GetMountAttrAddDict(horseId);
+ // break;
+ // default:
+ // break;
+ // }
+
+ // if (properties != null)
+ // {
+ // baseProperty.baseProperties = new List<Int2>();
+ // foreach (var property in properties)
+ // {
+ // baseProperty.baseProperties.Add(new Int2(property.Key, property.Value));
+ // }
+ // }
+
+ // return baseProperty;
+ // }
+
+ // //绁炶灞炴��
+ // private static ShenProperty GetShenProperty(int itemId)
+ // {
+ // var data = new ShenProperty();
+ // data.isPreview = true;
+ // data.itemId = itemId;
+
+ // var config = ItemConfig.Get(itemId);
+
+ // data.properties = ShenPropertyUtility.GetEquipShenProperties(itemId);
+
+
+ // return data;
+ // }
+
+
+ // private static LegendProperty GetLegendProperty(int itemId)
+ // {
+ // var data = new LegendProperty();
+ // data.isPreview = true;
+ // data.itemId = itemId;
+
+ // var config = ItemConfig.Get(itemId);
+ // if (config.Effect1 == 220)
+ // {
+ // data.isPreview = false;
+ // var appConfig = AppointItemConfig.Get(itemId);
+ // data.trueCount = 0;
+
+ // data.properties = new List<Int2>();
+ // for (var i = 0; i < appConfig.LegendAttrID.Length; i++)
+ // {
+ // data.properties.Add(new Int2(appConfig.LegendAttrID[i], appConfig.LegendAttrValue[i]));
+ // }
+ // }
+ // else
+ // {
+ // data.properties = LegendPropertyUtility.GetLegendProFromEquipShen(itemId);
+ // if (data.properties != null)
+ // {
+ // data.trueCount = 0;
+ // data.isPreview = false;
+ // }
+ // else
+ // {
+ // data.trueCount = LegendPropertyUtility.GetEquipPropertyCount(itemId);
+ // data.properties = LegendPropertyUtility.GetEquipProperties(itemId);
+ // }
+ // }
+
+ // return data;
+ // }
+
+ // private static SpiritWeaponProperty GetSpiritWeaponProperty(int itemId)
+ // {
+ // var config = SpiritWeaponConfig.Get(itemId);
+ // if (config == null)
+ // {
+ // return default(SpiritWeaponProperty);
+ // }
+
+ // var properties = new List<Int3>();
+ // for (var i = 0; i < config.AttrIDList.Length; i++)
+ // {
+ // properties.Add(new Int3(config.AttrIDList[i], config.AttrValueList[i], config.AttrColorList[i]));
+ // }
+
+ // var spiritWeaponProperty = new SpiritWeaponProperty();
+ // spiritWeaponProperty.itemId = itemId;
+ // spiritWeaponProperty.properties = properties;
+ // return spiritWeaponProperty;
+ // }
+
+ // private static LegendProperty GetLegendProperty(string guid)
+ // {
+ // var item = packModel.GetItemByGuid(guid);
+ // if (item == null)
+ // {
+ // return default(LegendProperty);
+ // }
+
+ // var data = new LegendProperty();
+ // data.isPreview = false;
+ // data.itemId = item.itemId;
+
+ // var ids = item.GetUseData((int)ItemUseDataKey.legendAttrID);
+ // var values = item.GetUseData((int)ItemUseDataKey.legendAttrValue);
+ // if (!ids.IsNullOrEmpty() && !values.IsNullOrEmpty())
+ // {
+ // var properties = new List<Int2>();
+ // var count = Mathf.Min(ids.Count, values.Count);
+ // for (int i = 0; i < count; i++)
+ // {
+ // properties.Add(new Int2(ids[i], values[i]));
+ // }
+
+ // data.properties = properties;
+ // }
+
+ // return data;
+ // }
+
+ public static LegendProperty GetLegendProperty(int itemId, Dictionary<int, List<int>> userData)
+ {
+ var data = new LegendProperty();
+ data.isPreview = false;
+ data.itemId = itemId;
+
+ List<int> ids = null;
+ List<int> values = null;
+ if (userData != null)
+ {
+ userData.TryGetValue((int)ItemUseDataKey.legendAttrID, out ids);
+ userData.TryGetValue((int)ItemUseDataKey.legendAttrValue, out values);
+ }
+ if (!ids.IsNullOrEmpty() && !values.IsNullOrEmpty())
+ {
+ var properties = new List<Int2>();
+ var count = Mathf.Min(ids.Count, values.Count);
+ for (int i = 0; i < count; i++)
+ {
+ properties.Add(new Int2(ids[i], values[i]));
+ }
+
+ data.properties = properties;
+ }
+
+ return data;
+ }
+
+ // public static SuitInfo GetSuitInfo(int itemId)
+ // {
+ // var config = ItemConfig.Get(itemId);
+ // if (config == null || config.SuiteiD <= 0)
+ // {
+ // return default(SuitInfo);
+ // }
+
+ // var job = config.JobLimit;
+ // var twoConfigs = EquipSuitConfig.GetConfigs(job, config.LV, EquipSuitType.TwoSuit);
+
+ // var name = twoConfigs[0].name;
+ // var level = config.LV;
+ // var places = new List<int>();
+ // places.Add(config.EquipPlace);
+ // //var suitInfo = new SuitInfo()
+ // //{
+ // // name = name,
+ // // level = level,
+ // // job = job,
+ // // places = places,
+ // //};
+ // var maxSuitLevel = EquipStarModel.GetMaxStarLevel(level);
+
+ // var placeStars = new Dictionary<int, int>();
+ // for (int i = 1; i <= 8; i++)
+ // {
+ // var equip = packModel.GetItemByGuid(equipModel.GetEquip(new Int2(level, i)));
+ // var hasSuit = equip != null && equip.config.SuiteiD > 0;
+ // if (hasSuit)
+ // {
+ // placeStars[i] = starModel.GetEquipStarLevel(new Int2(level, i));
+ // }
+ // }
+
+ // var twoSuitProperties = new Dictionary<int, EquipSuitPropertyEntry>();
+ // var fiveSuitProperties = new Dictionary<int, EquipSuitPropertyEntry>();
+ // var eightSuits = new Dictionary<int, bool>();
+ // var eightSuitLevel = equipModel.GetSuitLevel(config.LV, EquipSuitType.EightSuit);
+
+ // var twoSuitProperties0 = equipModel.GetEquipSuitEntry(config.LV, 0, EquipSuitType.TwoSuit);
+ // var fiveSuitProperties0 = equipModel.GetEquipSuitEntry(config.LV, 0, EquipSuitType.FiveSuit);
+
+
+ // twoSuitProperties[0] = twoSuitProperties0;
+ // fiveSuitProperties[0] = fiveSuitProperties0;
+ // eightSuits[0] = eightSuitLevel >= 0;
+
+ // if (maxSuitLevel >= 3)
+ // {
+ // twoSuitProperties[3] = equipModel.GetEquipSuitEntry(config.LV, 3, EquipSuitType.TwoSuit);
+ // fiveSuitProperties[3] = equipModel.GetEquipSuitEntry(config.LV, 3, EquipSuitType.FiveSuit);
+ // eightSuits[3] = eightSuitLevel >= 3;
+ // }
+
+ // if (maxSuitLevel >= 6)
+ // {
+ // twoSuitProperties[6] = equipModel.GetEquipSuitEntry(config.LV, 6, EquipSuitType.TwoSuit);
+ // fiveSuitProperties[6] = equipModel.GetEquipSuitEntry(config.LV, 6, EquipSuitType.FiveSuit);
+ // eightSuits[6] = eightSuitLevel >= 3;
+ // }
+
+ // if (maxSuitLevel >= 9)
+ // {
+ // twoSuitProperties[9] = equipModel.GetEquipSuitEntry(config.LV, 9, EquipSuitType.TwoSuit);
+ // fiveSuitProperties[9] = equipModel.GetEquipSuitEntry(config.LV, 9, EquipSuitType.FiveSuit);
+ // eightSuits[9] = eightSuitLevel >= 9;
+ // }
+
+ // var suitInfo = new SuitInfo()
+ // {
+ // name = name,
+ // level = level,
+ // job = job,
+ // maxSuitLevel = maxSuitLevel,
+ // places = places,
+ // placeStars = placeStars,
+ // twoSuitProperties = twoSuitProperties,
+ // fiveSuitProperties = fiveSuitProperties,
+ // eightSuits = eightSuits
+ // };
+ // return suitInfo;
+ // }
+
+ // private static SuitInfo GetSuitInfo(string guid)
+ // {
+ // var item = packModel.GetItemByGuid(guid);
+ // if (item == null)
+ // {
+ // return default(SuitInfo);
+ // }
+
+ // var config = ItemConfig.Get(item.itemId);
+ // if (config == null || config.SuiteiD <= 0)
+ // {
+ // return default(SuitInfo);
+ // }
+
+ // var equipPosition = new Int2(item.config.LV, item.config.EquipPlace);
+ // var equiped = equipModel.GetEquip(equipPosition) == guid;
+
+ // var job = config.JobLimit;
+ // var twoConfigs = EquipSuitConfig.GetConfigs(job, config.LV, EquipSuitType.TwoSuit);
+ // var name = twoConfigs[0].name;
+
+ // var level = config.LV;
+ // var maxSuitLevel = equiped ? EquipStarModel.GetMaxStarLevel(level) : -1;
+
+ // var places = new List<int>();
+ // var placeStars = new Dictionary<int, int>();
+ // if (equiped)
+ // {
+ // for (int i = 1; i <= 8; i++)
+ // {
+ // var equip = packModel.GetItemByGuid(equipModel.GetEquip(new Int2(level, i)));
+ // var hasSuit = equip != null && equip.config.SuiteiD > 0;
+ // if (hasSuit)
+ // {
+ // places.Add(i);
+ // placeStars[i] = starModel.GetEquipStarLevel(new Int2(level, i));
+ // }
+ // }
+ // }
+
+ // var twoSuitProperties = new Dictionary<int, EquipSuitPropertyEntry>();
+ // var fiveSuitProperties = new Dictionary<int, EquipSuitPropertyEntry>();
+ // var eightSuits = new Dictionary<int, bool>();
+ // var eightSuitLevel = equiped ? equipModel.GetSuitLevel(config.LV, EquipSuitType.EightSuit) : -1;
+
+ // if (!equiped)
+ // {
+ // var suit2 = equipModel.GetEquipSuitEntry(config.LV, 0, EquipSuitType.TwoSuit);
+ // suit2.actived = false;
+ // var suit5 = equipModel.GetEquipSuitEntry(config.LV, 0, EquipSuitType.FiveSuit);
+ // suit5.actived = false;
+ // twoSuitProperties[0] = suit2;
+ // fiveSuitProperties[0] = suit5;
+ // eightSuits[0] = eightSuitLevel >= 0;
+ // }
+ // else
+ // {
+ // foreach (var star in EquipStarModel.StarList)
+ // {
+ // if (maxSuitLevel >= star)
+ // {
+ // twoSuitProperties[star] = equipModel.GetEquipSuitEntry(config.LV, star, EquipSuitType.TwoSuit);
+ // fiveSuitProperties[star] = equipModel.GetEquipSuitEntry(config.LV, star, EquipSuitType.FiveSuit);
+ // eightSuits[star] = eightSuitLevel >= star;
+ // }
+ // }
+ // }
+
+
+
+
+ // var suitInfo = new SuitInfo()
+ // {
+ // name = name,
+ // level = level,
+ // job = job,
+ // maxSuitLevel = maxSuitLevel,
+ // places = places,
+ // placeStars = placeStars,
+ // twoSuitProperties = twoSuitProperties,
+ // fiveSuitProperties = fiveSuitProperties,
+ // eightSuits = eightSuits
+ // };
+
+ // return suitInfo;
+ // }
+
+ // private static StarInfo GetStarInfo(int itemId)
+ // {
+ // var config = ItemConfig.Get(itemId);
+ // if (!EquipModel.IsRealmEquip(config.EquipPlace))
+ // {
+ // return default(StarInfo);
+ // }
+
+ // var starInfo = new StarInfo();
+ // starInfo.equipPosition = new Int2(config.LV, config.EquipPlace);
+ // starInfo.maxLevel = EquipStarModel.GetMaxStarLevel(config.ItemColor, config.LV);
+ // starInfo.starLevel = 0;
+
+ // return starInfo;
+ // }
+
+ // private static StarInfo GetStarInfo(string guid)
+ // {
+ // var item = packModel.GetItemByGuid(guid);
+ // if (item == null)
+ // {
+ // return default(StarInfo);
+ // }
+
+ // if (!EquipModel.IsRealmEquip(item.config.EquipPlace))
+ // {
+ // return default(StarInfo);
+ // }
+
+ // var starInfo = new StarInfo();
+ // var equipPosition = new Int2(item.config.LV, item.config.EquipPlace);
+ // var equiped = equipModel.GetEquip(equipPosition) == guid;
+ // starInfo.equipPosition = equipPosition;
+ // starInfo.maxLevel = EquipStarModel.GetMaxStarLevel(item.config.ItemColor, item.config.LV);
+ // starInfo.starLevel = equiped ? starModel.GetStarLevel(equipPosition) : 0;
+
+ // return starInfo;
+ // }
+
+ // private static StrengthenProperty GetStrengthenProperty(string guid)
+ // {
+ // var item = packModel.GetItemByGuid(guid);
+ // if (item == null)
+ // {
+ // return default(StrengthenProperty);
+ // }
+
+ // var level = item.config.LV;
+ // var place = item.config.EquipPlace;
+ // var equiped = equipModel.GetEquip(new Int2(level, place)) == guid;
+ // if (!equiped)
+ // {
+ // return default(StrengthenProperty);
+ // }
+
+ // var data = new StrengthenProperty();
+
+ // var strengthenLevel = strengthenModel.GetStrengthLevel(level, place);
+
+ // var type = EquipStrengthModel.GetEquipStrengthType(place);
+ // var maxStrengthenLevel = strengthenModel.GetEquipLevelMax(type, level);
+
+ // data.strengthenLevel = Mathf.Min(strengthenLevel, maxStrengthenLevel);
+ // data.evolveLevel = strengthenModel.GetStrengthEvolveLevel(level, place);
+ // data.equipPlace = place;
+
+ // data.properties = new List<Int2>();
+ // var config = ItemPlusConfig.GetTypeAndLevel(type, data.strengthenLevel);
+ // for (int i = 0; i < config.attType.Length; i++)
+ // {
+ // data.properties.Add(new Int2(config.attType[i], config.attValue[i]));
+ // }
+
+ // return data;
+ // }
+
+ // private static GemInfo GetGemInfo(int itemId)
+ // {
+ // var config = ItemConfig.Get(itemId);
+ // var level = config.LV;
+ // var place = config.EquipPlace;
+
+ // var gemInfo = new GemInfo();
+ // var maxStar = EquipStarModel.GetMaxStarLevel(config.ItemColor, config.LV);
+ // gemInfo.activeStates = new Dictionary<int, bool>();
+ // for (int i = 0; i < 4; i++)
+ // {
+ // gemInfo.activeStates[i] = IsEquipGemHoleOpen(new Int2(level, place), maxStar, i);
+ // }
+
+ // return gemInfo;
+ // }
+
+ // private static GemInfo GetGemInfo(string guid)
+ // {
+ // var item = packModel.GetItemByGuid(guid);
+ // if (item == null)
+ // {
+ // return default(GemInfo);
+ // }
+
+ // var level = item.config.LV;
+ // var place = item.config.EquipPlace;
+
+ // var gemInfo = new GemInfo();
+ // var maxStar = EquipStarModel.GetMaxStarLevel(item.config.ItemColor, item.config.LV);
+ // gemInfo.activeStates = new Dictionary<int, bool>();
+ // for (int i = 0; i < 4; i++)
+ // {
+ // gemInfo.activeStates[i] = IsEquipGemHoleOpen(new Int2(level, place), maxStar, i);
+ // }
+
+ // gemInfo.gems = new Dictionary<int, int>();
+ // if (item.packType == PackType.Equip)
+ // {
+ // int[] gems;
+ // if (gemModel.TryGetEquipGems(item.config.LV, item.config.EquipPlace, out gems))
+ // {
+ // for (int i = 0; i < gems.Length; i++)
+ // {
+ // gemInfo.gems[i] = gems[i];
+ // }
+ // }
+ // }
+
+ // return gemInfo;
+ // }
+
+ // private static TrainProperty GetTrainProperty(string guid)
+ // {
+ // var item = packModel.GetItemByGuid(guid);
+ // if (item == null)
+ // {
+ // return default(TrainProperty);
+ // }
+
+ // var equipPosition = new Int2(item.config.LV, item.config.EquipPlace);
+ // var equiped = equipModel.GetEquip(equipPosition) == guid;
+ // if (!equiped)
+ // {
+ // return default(TrainProperty);
+ // }
+
+ // var trainProperty = new TrainProperty();
+ // var star = Mathf.Min(EquipStarModel.GetMaxStarLevel(item.config.ItemColor, item.config.LV), starModel.GetEquipStarLevel(equipPosition));
+ // var type = EquipTrainModel.GetTrainType(equipPosition.y);
+ // var maxConfig = WashLevelMaxConfig.Get(type, star);
+ // var maxLevel = maxConfig == null ? 1 : maxConfig.levelMax;
+ // var trainLevel = Mathf.Min(maxLevel, trainModel.GetTrainLevel(equipPosition));
+ // trainProperty.level = trainLevel;
+
+ // var trainConfig = EquipWashConfig.Get(type, trainLevel);
+ // trainProperty.properties = new List<Int2>();
+
+ // if (trainConfig == null)
+ // {
+ // var trainConfigLevel1 = EquipWashConfig.Get(type, 1);
+ // trainProperty.properties.Add(new Int2(trainConfigLevel1.config.attType1, 0));
+ // trainProperty.properties.Add(new Int2(trainConfigLevel1.config.attType2, 0));
+ // //trainProperty.properties.Add(new Int2(trainConfigLevel1.config.attType3, 0));
+ // }
+ // else
+ // {
+ // var trainedProperties = trainModel.GetTrainedProperties(equipPosition);
+ // trainProperty.properties.Add(new Int2(trainConfig.config.attType1, Mathf.Min(trainedProperties.x, trainConfig.config.attMax1)));
+ // trainProperty.properties.Add(new Int2(trainConfig.config.attType2, Mathf.Min(trainedProperties.y, trainConfig.config.attMax2)));
+ // //trainProperty.properties.Add(new Int2(trainConfig.config.attType3, Mathf.Min(trainedProperties.z, trainConfig.config.attMax3)));
+ // }
+
+ // return trainProperty;
+ // }
+
+ private static SkillInfo GetSkillInfo(int itemId)
+ {
+ var config = ItemConfig.Get(itemId);
+ if (config == null)
+ {
+ return default(SkillInfo);
+ }
+
+ var skillInfo = new SkillInfo();
+ skillInfo.skills = new List<int>();
+
+ if (config.AddSkill1 != 0)
+ {
+ skillInfo.skills.Add(config.AddSkill1);
+ }
+
+ if (config.AddSkill2 != 0)
+ {
+ skillInfo.skills.Add(config.AddSkill2);
+ }
+
+ return skillInfo;
+ }
+
+
+ private static SkillInfo GetSkillInfo(int itemId, CustomEquipInfo info)
+ {
+ var skillInfo = new SkillInfo();
+ skillInfo.skills = new List<int>();
+ if (!info.equipSkillList.IsNullOrEmpty())
+ {
+ skillInfo.skills = info.equipSkillList;
+ }
+ else
+ {
+ return GetSkillInfo(itemId);
+ }
+ return skillInfo;
+ }
+
+ // private static SkillInfo GetSkillInfo(int itemId, string guid)
+ // {
+
+ // var skillInfo = new SkillInfo();
+ // skillInfo.skills = new List<int>();
+
+ // var item = packModel.GetItemByGuid(guid);
+ // if (item == null)
+ // {
+ // return GetSkillInfo(itemId);
+ // }
+
+ // var values = item.GetUseData((int)ItemUseDataKey.equipSkills);
+ // if (!values.IsNullOrEmpty())
+ // {
+ // skillInfo.skills = values;
+ // }
+ // else
+ // {
+ // return GetSkillInfo(itemId);
+ // }
+
+ // return skillInfo;
+ // }
+
+ // private static WingRefineMaterials GetWingRefineMaterials(string guid)
+ // {
+ // var item = packModel.GetItemByGuid(guid);
+ // if (item == null)
+ // {
+ // return default(WingRefineMaterials);
+ // }
+
+ // if (item.config.Type != 113)
+ // {
+ // return default(WingRefineMaterials);
+ // }
+
+ // var refineMaterials = new WingRefineMaterials();
+ // refineMaterials.materials = new List<Int2>();
+
+ // var ids = item.GetUseData((int)ItemUseDataKey.wingMaterialItemID);
+ // var values = item.GetUseData((int)ItemUseDataKey.wingMaterialItemCount);
+ // if (!ids.IsNullOrEmpty() && !values.IsNullOrEmpty())
+ // {
+ // var min = Mathf.Min(ids.Count, values.Count);
+ // for (int i = 0; i < min; i++)
+ // {
+ // refineMaterials.materials.Add(new Int2(ids[i], values[i]));
+ // }
+ // }
+
+ // return refineMaterials;
+ // }
+
+ // private static GetWay GetGetWay(int itemId)
+ // {
+ // var config = ItemConfig.Get(itemId);
+ // if (config == null)
+ // {
+ // return default(GetWay);
+ // }
+
+ // var getWay = new GetWay();
+ // getWay.itemId = itemId;
+ // getWay.ways = new List<int>();
+ // foreach (var way in config.GetWay)
+ // {
+ // var wayConfig = GetItemWaysConfig.Get(way);
+ // if (wayConfig.FuncOpenId == 0 || FuncOpen.Instance.IsFuncOpen(wayConfig.FuncOpenId))
+ // {
+ // int activityType = 0; // 娲诲姩妯℃澘 鍙傝�僌penServerActivityCenter.ActivityType
+ // if (wayConfig.customize == 2)
+ // {
+ // activityType = (int)OpenServerActivityCenter.ActivityType.AT_JRZF;
+ // }
+ // else if (wayConfig.customize == 3)
+ // {
+ // activityType = (int)OpenServerActivityCenter.ActivityType.AT_HFHD;
+ // }
+ // if (wayConfig.ActiveType == -1 || OpenServerActivityCenter.Instance.IsActivityOpen(wayConfig.ActiveType, activityType))
+ // {
+ // getWay.ways.Add(way);
+ // }
+ // }
+ // }
+
+ // return getWay;
+ // }
+
+ // private static List<ItemOperateType> GetOperates(int itemId, int itemCount = 0)
+ // {
+ // var config = ItemConfig.Get(itemId);
+ // var operates = new List<ItemOperateType>();
+ // var lsItemID = 150;
+ // if (config.CanSell == 1 && itemId != lsItemID)
+ // {
+ // operates.Add(ItemOperateType.sell);
+ // }
+
+ // // if (itemCount > 1 && itemId != lsItemID)
+ // // {
+ // // operates.Add(ItemOperateType.split);
+ // // }
+
+ // if (config.UseTag == 1)
+ // {
+ // if (itemId != lsItemID)
+ // operates.Add(ItemOperateType.makeUse);
+ // else
+ // operates.Add(ItemOperateType.lsExchange);
+ // }
+
+ // if (config.Type == 25 || config.Effect1 == 225)
+ // {
+ // operates.Add(ItemOperateType.inlay);
+ // }
+
+ // if (!config.JumpComposeCondi.IsNullOrEmpty())
+ // {
+ // var jumpId = 0;
+ // if (composeModel.CheckComposeItemById(itemId, out jumpId))
+ // {
+ // operates.Add(ItemOperateType.compose);
+ // }
+ // }
+
+ // return operates;
+ // }
+
+
+ // private static List<ItemOperateType> GetOperates(string guid)
+ // {
+ // var item = packModel.GetItemByGuid(guid);
+ // if (item == null)
+ // {
+ // return null;
+ // }
+
+ // var operates = new List<ItemOperateType>();
+
+ // var packType = item.packType;
+ // if (WindowCenter.Instance.IsOpen("DepotWin"))
+ // {
+ // switch (packType)
+ // {
+ // case PackType.Warehouse:
+ // operates.Add(ItemOperateType.putOut);
+ // break;
+ // default:
+ // operates.Add(ItemOperateType.putIn);
+ // break;
+ // }
+
+ // return operates;
+ // }
+
+ // if (packType == PackType.Equip)
+ // {
+ // if (WindowCenter.Instance.IsOpen("RealmEquipWin"))
+ // {
+ // operates.Add(ItemOperateType.putOff);
+
+ // if (FuncOpen.Instance.IsFuncOpen(1))
+ // {
+ // operates.Add(ItemOperateType.strength);
+ // }
+
+ // if (FuncOpen.Instance.IsFuncOpen(172))
+ // {
+ // operates.Add(ItemOperateType.star);
+ // }
+
+ // if (FuncOpen.Instance.IsFuncOpen(2))
+ // {
+ // operates.Add(ItemOperateType.inlay);
+ // }
+
+ // if (FuncOpen.Instance.IsFuncOpen(91))
+ // {
+ // int limitLevel = 0;
+ // if (equipModel.EquipLevelFuncID != null)
+ // limitLevel = equipModel.EquipLevelFuncID[91];
+ // if (item.config.LV >= limitLevel)
+ // operates.Add(ItemOperateType.train);
+ // }
+
+ // if (EquipEvolveModel.Instance.IsShowEvolveBtn(item.itemId))
+ // {
+ // operates.Add(ItemOperateType.default1);
+ // }
+ // return operates;
+ // }
+
+ // if (ItemLogicUtility.Instance.IsRealmEquip(item.itemId) && WindowCenter.Instance.IsOpen("RoleEquipWin"))
+ // {
+ // operates.Add(ItemOperateType.putOff);
+ // return operates;
+ // }
+
+ // if (ItemLogicUtility.Instance.IsSpiritWeapon(item.itemId) && WindowCenter.Instance.IsOpen("SpiritEquipBagWin"))
+ // {
+ // operates.Add(ItemOperateType.putOff);
+ // return operates;
+ // }
+ // }
+
+ // if (packType == PackType.Warehouse)
+ // {
+ // operates.Add(ItemOperateType.putOut);
+ // return operates;
+ // }
+
+ // if (item.isAuction)
+ // {
+ // operates.Add(ItemOperateType.putAway);
+ // }
+
+ // var isEquip = ItemLogicUtility.Instance.IsRealmEquip(item.itemId);
+ // var isSpiritWeapon = ItemLogicUtility.Instance.IsSpiritWeapon(item.itemId);
+ // if (isEquip || isSpiritWeapon)
+ // {
+ // var isOverdue = ItemLogicUtility.Instance.IsOverdue(guid);
+ // if (item.config.CanSell == 1)
+ // {
+ // operates.Add(ItemOperateType.sell);
+ // }
+
+ // if (item.config.ExpireTime > 0 && isOverdue && itemOverdueModel.CanRenewal(item.itemId))
+ // {
+ // operates.Add(ItemOperateType.renewal);
+ // }
+
+ // if (!isOverdue)
+ // {
+ // if (ItemLogicUtility.Instance.IsJobCompatibleItem(item.itemId))
+ // {
+ // if (isEquip)
+ // {
+ // operates.Add(ItemOperateType.putOn);
+
+ // if (!item.config.JumpComposeCondi.IsNullOrEmpty())
+ // {
+ // var jumpId = 0;
+ // if (composeModel.CheckComposeItemById(item.itemId, out jumpId))
+ // {
+ // operates.Add(ItemOperateType.compose);
+ // }
+ // }
+ // }
+
+ // if (isSpiritWeapon)
+ // {
+ // if (WindowCenter.Instance.IsOpen<RoleEquipWin>())
+ // {
+ // operates.Add(ItemOperateType.putOn);
+ // }
+ // else if (WindowCenter.Instance.IsOpen<MainInterfaceWin>() || WindowCenter.Instance.IsOpen("SpiritEquipBagWin"))
+ // {
+ // operates.Add(ItemOperateType.putOn);
+ // }
+ // }
+ // }
+ // //else
+ // //{
+ // // if (item.config.ItemColor > 3)
+ // // {
+ // // operates.Add(ItemOperateType.exchange);
+ // // }
+ // //}
+ // }
+
+ // return operates;
+ // }
+ // if (ItemLogicUtility.Instance.IsDogzEquip(item.itemId))
+ // {
+ // if (packType == PackType.DogzItem)
+ // {
+ // if (item.config.ItemColor > 2 && item.config.ItemColor < 6)
+ // {
+ // operates.Add(ItemOperateType.compose);
+ // }
+ // operates.Add(ItemOperateType.putOn);
+ // }
+ // else if (packType == PackType.DogzEquip)
+ // {
+ // operates.Add(ItemOperateType.putOff);
+ // }
+ // return operates;
+ // }
+
+ // operates.AddRange(GetOperates(item.itemId, item.count));
+
+ // return operates;
+ // }
+
+
+
+ // private static List<ItemOperateType> GetGoodOperates(int goodId)
+ // {
+ // var operates = new List<ItemOperateType>();
+ // var countLimit = BuyItemController.Instance.GetBuyCountLimit(goodId, PlayerDatas.Instance.baseData.VIPLv);
+ // if (countLimit == -1 || countLimit > 0)
+ // {
+ // var config = StoreConfig.Get(goodId);
+ // int curVipIndex = -1;
+ // int nextVipIndex = -1;
+ // bool isVipBuy = BuyItemController.Instance.CheckIsVipBuy(config, out curVipIndex, out nextVipIndex);
+
+ // if ((isVipBuy && curVipIndex == -1) || PlayerDatas.Instance.baseData.LV < config.LV)
+ // {
+ // return operates;
+ // }
+ // operates.Add(ItemOperateType.buy);
+ // }
+
+ // return operates;
+ // }
+
+ // private static bool IsEquipGemHoleOpen(Int2 equipPosition, int maxStar, int hole)
+ // {
+ // GemHoleCondition condition;
+ // if (gemModel.TryGetGemHoleCondition(hole, out condition))
+ // {
+ // var star = starModel.GetStarLevel(equipPosition);
+ // if (Mathf.Min(star, maxStar) < condition.equipStar)
+ // {
+ // return false;
+ // }
+
+ // var vipLevel = PlayerDatas.Instance.baseData.VIPLv;
+ // if (vipLevel < condition.vipLevel)
+ // {
+ // return false;
+ // }
+ // }
+
+ // return true;
+ // }
+
+ // private static TipType GetTipType(int itemId)
+ // {
+ // if (GeneralDefine.chestDisplayItems.Contains(itemId))
+ // {
+ // return TipType.PeerlessChest;
+ // }
+
+ // if (ChestsAwardConfig.IsBox(itemId))
+ // {
+ // return TipType.BoxItem;
+ // }
+
+ // var config = ItemConfig.Get(itemId);
+ // switch (config.Type)
+ // {
+ // case 101:
+ // case 102:
+ // case 103:
+ // case 104:
+ // case 105:
+ // case 106:
+ // case 107:
+ // case 108:
+ // case 109:
+ // case 110:
+ // case 111:
+ // case 112:
+ // return TipType.Equip;
+ // case 119:
+ // case 120:
+ // case 121:
+ // case 122:
+ // case 123:
+ // return TipType.Dogz;
+ // case 53:
+ // return TipType.KingTreasure;
+ // case 56:
+ // return TipType.TreasureShow;
+ // case 26:
+ // case 41:
+ // case 42:
+ // return TipType.PetMount;
+ // case 113:
+ // case 114:
+ // case 116:
+ // case 117:
+ // return TipType.SpiritWeapon;
+ // case 147:
+ // return TipType.TreasurePavilion;
+ // default:
+ // return TipType.Item;
+ // }
+
+ // }
+
+ [System.Diagnostics.Conditional("UNITY_EDITOR")]
+ private static void PrintItemBrief(int itemId)
+ {
+ var config = ItemConfig.Get(itemId);
+ Debug.LogFormat("浣犳煡鐪嬬殑鐗╁搧鏄細itemId->{0} ;name->{1}", itemId, config.ItemName);
+ }
+
+ [System.Diagnostics.Conditional("UNITY_EDITOR")]
+ private static void PrintItemBrief(int itemId, string guid)
+ {
+ var config = ItemConfig.Get(itemId);
+ Debug.LogFormat("浣犳煡鐪嬬殑鐗╁搧鏄細itemId->{0};name->{1};guid->{2};", itemId, config.ItemName, string.IsNullOrEmpty(guid) ? "" : guid);
+ }
+
+ }
+
+}
+
+
+
diff --git a/Main/System/ItemTip/ItemTipUtility.cs.meta b/Main/System/ItemTip/ItemTipUtility.cs.meta
new file mode 100644
index 0000000..27eb967
--- /dev/null
+++ b/Main/System/ItemTip/ItemTipUtility.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: cf7cae7c5308be24380d2ca3154bd8db
+timeCreated: 1552532488
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/KnapSack.meta b/Main/System/KnapSack.meta
new file mode 100644
index 0000000..a157617
--- /dev/null
+++ b/Main/System/KnapSack.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 7eb6e020290299143972038511c77ce1
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/KnapSack/KnapsackTimeCDMgr.cs b/Main/System/KnapSack/KnapsackTimeCDMgr.cs
new file mode 100644
index 0000000..8431054
--- /dev/null
+++ b/Main/System/KnapSack/KnapsackTimeCDMgr.cs
@@ -0,0 +1,282 @@
+锘縰sing System;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+
+namespace vnxbqy.UI
+{
+
+ public class KnapsackTimeCDMgr : SingletonMonobehaviour<KnapsackTimeCDMgr>
+
+ {
+ private List<ItemCDCool> itemCDList = new List<ItemCDCool>();
+ private List<NormalCDCool> normalCDList = new List<NormalCDCool>();
+ public event Action<string> RefresCoolTimeAct;
+ public event Action<string> RefreshItemOverdueTimeAct;
+ public event Action<string> RefreshItemOverdueAct;
+ public event Action<int, int> RefreshNormalCDAct;
+ int secondBuf = -1;
+ int minuteBuf = -1;
+ private void LateUpdate()
+ {
+ CheckItemCoolTime(TimeRefreshType.Frame);
+ var minute = DateTime.Now.Minute;
+ var second = DateTime.Now.Second;
+ if (second != secondBuf)
+ {
+ CheckNormalCoolTime(TimeRefreshType.Second);
+ secondBuf = second;
+ }
+ if (minute != minuteBuf)
+ {
+ CheckItemCoolTime(TimeRefreshType.Minute);
+ minuteBuf = minute;
+ }
+
+ }
+
+ private void CheckItemCoolTime(TimeRefreshType type)
+ {
+ for (int i = itemCDList.Count - 1; i > -1; i--)
+ {
+ double remianCD = itemCDList[i].GetRemainTime();
+ switch (type)
+ {
+ case TimeRefreshType.Frame:
+ if (RefresCoolTimeAct != null)
+ {
+ RefresCoolTimeAct(itemCDList[i].guid);
+ }
+ break;
+ case TimeRefreshType.Minute:
+ if (RefreshItemOverdueTimeAct != null)
+ {
+ RefreshItemOverdueTimeAct(itemCDList[i].guid);
+ }
+ break;
+ }
+
+ if (remianCD <= 0)
+ {
+ string guid = itemCDList[i].guid;
+ itemCDList.RemoveAt(i);
+ if (RefreshItemOverdueAct != null)
+ {
+ RefreshItemOverdueAct(guid);
+ }
+ }
+ }
+
+ }
+
+ private void CheckNormalCoolTime(TimeRefreshType type)
+ {
+ for (int i = 0; i < normalCDList.Count; i++)
+ {
+ double remianCD = normalCDList[i].GetRemainTime();
+ switch (type)
+ {
+ case TimeRefreshType.Frame:
+ break;
+ case TimeRefreshType.Second:
+ if (RefreshNormalCDAct != null)
+ {
+ RefreshNormalCDAct(normalCDList[i].code, (int)remianCD);
+ }
+ break;
+ case TimeRefreshType.Minute:
+ break;
+ }
+
+ if (remianCD <= 0)
+ {
+ UnRegister(normalCDList[i].code);
+ }
+ }
+
+ }
+
+ public void Register(string guid, int itemId, double cdTime)
+ {
+ int index;
+ if (ContainsItemCD(guid, out index))
+ {
+ itemCDList[index].SetTime(cdTime);
+ }
+ else
+ {
+ ItemCDCool cool = new ItemCDCool(guid, itemId, cdTime);
+ itemCDList.Add(cool);
+ }
+ }
+
+ public void Register(int code, double cdTime)
+ {
+ int index;
+ if (ContainsNormalCD(code, out index))
+ {
+ normalCDList[index].SetTime(cdTime);
+ }
+ else
+ {
+ NormalCDCool cool = new NormalCDCool(code, cdTime);
+ normalCDList.Add(cool);
+ }
+ }
+
+ public void UnRegister(string guid)
+ {
+ int index;
+ if (ContainsItemCD(guid, out index))
+ {
+ itemCDList.RemoveAt(index);
+ }
+ }
+
+ public void UnRegister(int code)
+ {
+ int index;
+ if (ContainsNormalCD(code, out index))
+ {
+ normalCDList.RemoveAt(index);
+ }
+ }
+
+ public ItemCDCool GetItemCoolById(string guid)
+ {
+ int index;
+ if (ContainsItemCD(guid, out index))
+ {
+ return itemCDList[index];
+ }
+ return null;
+ }
+
+ public int GetNormalCDTime(int code)
+ {
+ int index;
+ if (ContainsNormalCD(code, out index))
+ {
+ return (int)normalCDList[index].GetRemainTime();
+ }
+ return 0;
+ }
+
+ List<ItemCDCool> typeCoollist = new List<ItemCDCool>();
+ public List<ItemCDCool> GetItemCoolByCDType(int type, out bool isCool)
+ {
+ typeCoollist.Clear();
+ isCool = false;
+ for (int i = 0; i < itemCDList.Count; i++)
+ {
+ ItemConfig itemConfig = ItemConfig.Get(itemCDList[i].itemId);
+ if (itemConfig != null
+ && itemConfig.CDType == type
+ && itemCDList[i].GetRemainTime() > 0)
+ {
+ typeCoollist.Add(itemCDList[i]);
+ isCool = true;
+ }
+ }
+ return typeCoollist;
+ }
+
+ private bool ContainsItemCD(string guid, out int index)
+ {
+ index = 0;
+ for (int i = 0; i < itemCDList.Count; i++)
+ {
+ if (itemCDList[i].guid == guid)
+ {
+ index = i;
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private bool ContainsNormalCD(int code, out int index)
+ {
+ index = 0;
+ for (int i = 0; i < normalCDList.Count; i++)
+ {
+ if (normalCDList[i].code == code)
+ {
+ index = i;
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public enum TimeRefreshType
+ {
+ Frame, //姣忓抚
+ Second, //姣忕
+ Minute //姣忓垎
+ }
+ }
+
+ public class ItemCDCool
+ {
+ public string guid;
+ public int itemId;
+ public double totalTime;
+ public DateTime startTime { get; private set; }
+
+ public ItemCDCool(string guid, int itemId, double totalTime)
+ {
+ this.guid = guid;
+ this.itemId = itemId;
+ this.totalTime = totalTime;
+ this.startTime = DateTime.Now;
+ }
+
+ public void SetTime(double totalTime)
+ {
+ this.totalTime = totalTime;
+ this.startTime = DateTime.Now;
+ }
+
+ public double GetRemainTime()
+ {
+ double remainTime = totalTime - (DateTime.Now - startTime).TotalSeconds;
+ if (remainTime <= 0)
+ {
+ remainTime = 0;
+ }
+ return remainTime;
+ }
+ }
+
+ public class NormalCDCool
+ {
+ public int code;
+ public double totalTime;
+ public DateTime startTime { get; private set; }
+ public NormalCDCool(int code, double totalTime)
+ {
+ this.code = code;
+ this.totalTime = totalTime;
+ this.startTime = DateTime.Now;
+ }
+
+ public void SetTime(double totalTime)
+ {
+ this.totalTime = totalTime;
+ this.startTime = DateTime.Now;
+ }
+
+ public double GetRemainTime()
+ {
+ double remainTime = totalTime - (DateTime.Now - startTime).TotalSeconds;
+ if (remainTime <= 0)
+ {
+ remainTime = 0;
+ }
+ return remainTime;
+ }
+ }
+
+}
diff --git a/Main/System/KnapSack/KnapsackTimeCDMgr.cs.meta b/Main/System/KnapSack/KnapsackTimeCDMgr.cs.meta
new file mode 100644
index 0000000..accae13
--- /dev/null
+++ b/Main/System/KnapSack/KnapsackTimeCDMgr.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: dea25939bd75de84494444a029cbd918
+timeCreated: 1530350297
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/KnapSack/Logic.meta b/Main/System/KnapSack/Logic.meta
new file mode 100644
index 0000000..6b05bc7
--- /dev/null
+++ b/Main/System/KnapSack/Logic.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 8b6355b3c6fc5394c9fdd0150217d66b
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/KnapSack/Logic/CommonGetItem.cs b/Main/System/KnapSack/Logic/CommonGetItem.cs
new file mode 100644
index 0000000..b234168
--- /dev/null
+++ b/Main/System/KnapSack/Logic/CommonGetItem.cs
@@ -0,0 +1,27 @@
+锘縰sing UnityEngine;
+
+namespace vnxbqy.UI
+{
+ public class CommonGetItem : MonoBehaviour
+ {
+ [SerializeField] ItemCell itemCell;
+ [SerializeField] TextEx txtItemName;
+
+ public void Display(int itemID)
+ {
+ txtItemName.SetActive(ItemLogicUtility.Instance.isNameShow);
+ if (!ItemLogicUtility.Instance.totalShowItems.ContainsKey(itemID))
+ {
+ return;
+ }
+
+ var item = ItemLogicUtility.Instance.totalShowItems[itemID];
+ itemCell.Init(new ItemCellModel(itemID, false, item.countEx));
+ txtItemName.text = ItemConfig.Get(itemID).ItemName;
+ itemCell.button.SetListener(() =>
+ {
+ ItemTipUtility.Show(itemID);
+ });
+ }
+ }
+}
\ No newline at end of file
diff --git a/Main/System/KnapSack/Logic/CommonGetItem.cs.meta b/Main/System/KnapSack/Logic/CommonGetItem.cs.meta
new file mode 100644
index 0000000..b8408c4
--- /dev/null
+++ b/Main/System/KnapSack/Logic/CommonGetItem.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: a3ae06d9569376243ac7d6912a2bf715
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/KnapSack/Logic/CommonGetItemCell.cs b/Main/System/KnapSack/Logic/CommonGetItemCell.cs
new file mode 100644
index 0000000..5241df2
--- /dev/null
+++ b/Main/System/KnapSack/Logic/CommonGetItemCell.cs
@@ -0,0 +1,35 @@
+锘縰sing System.Collections.Generic;
+using System.Linq;
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace vnxbqy.UI
+{
+ public class CommonGetItemCell : CellView
+ {
+ [SerializeField] List<CommonGetItem> commonGetItems = new List<CommonGetItem>();
+ [SerializeField] HorizontalLayoutGroup horizontalLayout;
+ public void Display(int rowIndex)
+ {
+ var dict = ItemLogicUtility.Instance.totalShowItems;
+ var list = dict.Keys.ToList();
+ int rowCount = (int)Mathf.Ceil((float)list.Count / 5);
+ horizontalLayout.childAlignment= rowCount > 1?TextAnchor.MiddleLeft: TextAnchor.MiddleCenter;
+
+ for (int i = 0; i < commonGetItems.Count; i++)
+ {
+ int index = rowIndex * 5 + i;
+ if (index < list.Count)
+ {
+ int itemId = list[index];
+ commonGetItems[i].Display(itemId);
+ commonGetItems[i].SetActive(true);
+ }
+ else
+ {
+ commonGetItems[i].SetActive(false);
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Main/System/KnapSack/Logic/CommonGetItemCell.cs.meta b/Main/System/KnapSack/Logic/CommonGetItemCell.cs.meta
new file mode 100644
index 0000000..77f015e
--- /dev/null
+++ b/Main/System/KnapSack/Logic/CommonGetItemCell.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: af6591c3f4d4fd9499f086bd21c5e42f
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/KnapSack/Logic/CommonGetItemWin.cs b/Main/System/KnapSack/Logic/CommonGetItemWin.cs
new file mode 100644
index 0000000..fc589da
--- /dev/null
+++ b/Main/System/KnapSack/Logic/CommonGetItemWin.cs
@@ -0,0 +1,126 @@
+锘縰sing System.Linq;
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace vnxbqy.UI
+{
+ //鐢ㄤ簬鏄剧ず鑾峰緱鐗╁搧鐨勭獥鍙�
+ public class CommonGetItemWin : UIBase
+ {
+ [SerializeField] ScrollerController scroller;
+ [SerializeField] RichText desc;
+ [SerializeField] Button sureBtn;
+ [SerializeField] Text sureText;
+ [SerializeField] TextEx closeText;
+
+
+ float openTime;
+
+ protected override void InitComponent()
+ {
+ base.InitComponent();
+ Debug.Log("鍒濆鍖栭�氱敤鑾峰緱鐗╁搧绐楀彛");
+ sureBtn.SetListener(() => UIManager.Instance.CloseWindow<CommonGetItemWin>());
+ }
+
+ public override void HandleOpen()
+ {
+ base.HandleOpen();
+ Debug.Log("鎵撳紑閫氱敤鑾峰緱鐗╁搧绐楀彛");
+ Refresh();
+ }
+
+ public override void HandleClose()
+ {
+ base.HandleClose();
+ Debug.Log("鍏抽棴閫氱敤鑾峰緱鐗╁搧绐楀彛");
+ }
+
+ public override void Refresh()
+ {
+ base.Refresh();
+ Debug.Log("鍒锋柊閫氱敤鑾峰緱鐗╁搧绐楀彛");
+ }
+
+ protected override void OnPreOpen()
+ {
+ ItemLogicUtility.Instance.OnGetItemShowEvent += OnGetItemShowEvent;
+ scroller.OnRefreshCell += OnRefreshCell;
+ desc.SetActive(!string.IsNullOrEmpty(ItemLogicUtility.Instance.getItemInfo));
+ desc.text = ItemLogicUtility.Instance.getItemInfo;
+ sureText.text = ItemLogicUtility.Instance.getItemBtnText;
+ CreateScroller();
+ closeText.text = Language.Get("L2004");
+ openTime = Time.time;
+ }
+
+
+ protected override void OnPreClose()
+ {
+ ItemLogicUtility.Instance.OnGetItemShowEvent -= OnGetItemShowEvent;
+ scroller.OnRefreshCell -= OnRefreshCell;
+ ItemLogicUtility.Instance.OnGetItem?.Invoke();
+ ItemLogicUtility.Instance.ClearGetItem();
+
+ }
+
+ void CreateScroller()
+ {
+ scroller.Refresh();
+ var keys = ItemLogicUtility.Instance.totalShowItems.Keys.ToList();
+ int rowCount = (int)Mathf.Ceil((float)keys.Count / 5);
+ for (int i = 0; i < rowCount; i++)
+ {
+ scroller.AddCell(ScrollerDataType.Header, i);
+ }
+ scroller.Restart();
+ }
+
+ float needRefreshTime; //閬垮厤灏佸寘杩囧鍗¢】
+ void OnGetItemShowEvent()
+ {
+ needRefreshTime = Time.time + 0.3f;
+
+ }
+
+ void RefreshScroller()
+ {
+ if (needRefreshTime <= 0)
+ return;
+
+ if (Time.time < needRefreshTime)
+ return;
+
+ if (scroller.GetNumberOfCells(scroller.m_Scorller) != ItemLogicUtility.Instance.totalShowItems.Count)
+ {
+ CreateScroller();
+ }
+ else
+ {
+ scroller.m_Scorller.RefreshActiveCellViews();
+ }
+ needRefreshTime = 0;
+ }
+
+ protected void LateUpdate()
+ {
+ RefreshScroller();
+ if (ItemLogicUtility.Instance.closeSeconds == 0)
+ return;
+
+ float closeTime = ItemLogicUtility.Instance.closeSeconds - (Time.time - openTime);
+ if (closeTime <= 0)
+ {
+ UIManager.Instance.CloseWindow<CommonGetItemWin>();
+ return;
+ }
+ closeText.text = Language.Get("AutoCloseAfterSeconds", (int)closeTime);
+ }
+
+ void OnRefreshCell(ScrollerDataType type, CellView cell)
+ {
+ var _cell = cell as CommonGetItemCell;
+ _cell?.Display(cell.index);
+ }
+ }
+}
diff --git a/Main/System/KnapSack/Logic/CommonGetItemWin.cs.meta b/Main/System/KnapSack/Logic/CommonGetItemWin.cs.meta
new file mode 100644
index 0000000..4c06ade
--- /dev/null
+++ b/Main/System/KnapSack/Logic/CommonGetItemWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: cf9db318692f57f469aa8e1f9999cf72
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/KnapSack/Logic/ItemLogicUtility.cs b/Main/System/KnapSack/Logic/ItemLogicUtility.cs
new file mode 100644
index 0000000..60ef7df
--- /dev/null
+++ b/Main/System/KnapSack/Logic/ItemLogicUtility.cs
@@ -0,0 +1,1828 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using LitJson;
+using UnityEngine;
+
+namespace vnxbqy.UI
+{
+
+ public class ItemLogicUtility : Singleton<ItemLogicUtility>
+ {
+ private string dogzGSFormula;
+ private string normalGSFormula;
+ private Dictionary<int, string> specialSpiritPropertyFormula = new Dictionary<int, string>();
+ Dictionary<int, int> specialSpiritPropertyMaxLevels;
+
+ private int[] preciousItemTypes;
+ private int[] preciousItemIDs; // 涓嶅睍绀虹殑鐗╁搧ID
+ public int[] drugIDs;
+ private int[] onekeySellTypes;
+ private int[] pushItemIds;
+
+ private int lsItemCnt; // 鑳屽寘涓殑鐏电煶鏁伴噺
+
+ private List<int> equipBaseProperties = new List<int>();
+ private Dictionary<int, int> promptUseLimitDict;
+ private Dictionary<int, List<int>> betterEquipExceptDungeonDict;
+ Dictionary<int, int> equipSkillScores = new Dictionary<int, int>();
+
+ PackModel packModel { get { return PackModel.Instance; } }
+ // BuffModel buffDatas { get { return ModelCenter.Instance.GetModel<BuffModel>(); } }
+ // MountModel mountDatas { get { return ModelCenter.Instance.GetModel<MountModel>(); } }
+ // PetModel petDatas { get { return ModelCenter.Instance.GetModel<PetModel>(); } }
+ // StrengthenModel strengthDatas { get { return ModelCenter.Instance.GetModel<StrengthenModel>(); } }
+ // MagicianModel magicianModel { get { return ModelCenter.Instance.GetModel<MagicianModel>(); } }
+ // ComposeWinModel composeModel { get { return ModelCenter.Instance.GetModel<ComposeWinModel>(); } }
+ // EquipModel equipModel { get { return ModelCenter.Instance.GetModel<EquipModel>(); } }
+ // AlchemyModel alchemyModel { get { return ModelCenter.Instance.GetModel<AlchemyModel>(); } }
+
+ public void Init()
+ {
+ var GSFormulaConfig = FuncConfigConfig.Get("EquipGSFormula");
+ dogzGSFormula = GSFormulaConfig.Numerical3;
+ normalGSFormula = GSFormulaConfig.Numerical1;
+
+ var json = JsonMapper.ToObject(FuncConfigConfig.Get("OutOfPrintValue").Numerical2);
+ foreach (var key in json.Keys)
+ {
+ specialSpiritPropertyFormula[int.Parse(key)] = json[key].ToString();
+ }
+ specialSpiritPropertyMaxLevels = ConfigParse.GetDic<int, int>(FuncConfigConfig.Get("OutOfPrintValueDes").Numerical1);
+ var equipSkillScoreJson = JsonMapper.ToObject(GSFormulaConfig.Numerical4);
+ foreach (var key in equipSkillScoreJson.Keys)
+ {
+ var skillId = 0;
+ int.TryParse(key, out skillId);
+ if (skillId != 0)
+ {
+ equipSkillScores[skillId] = (int)equipSkillScoreJson[key];
+ }
+ }
+
+ var baseAttr = JsonMapper.ToObject(GSFormulaConfig.Numerical2);
+ if (baseAttr.IsArray)
+ {
+ for (int i = 0; i < baseAttr.Count; i++)
+ {
+ equipBaseProperties.Add(int.Parse(baseAttr[i].ToString()));
+ }
+ }
+ lsItemCnt = int.Parse(FuncConfigConfig.Get("LingshiShowCount").Numerical1);
+
+ preciousItemTypes = ConfigParse.GetMultipleStr<int>(FuncConfigConfig.Get("ItemPush").Numerical1);
+ promptUseLimitDict = ConfigParse.GetDic<int, int>(FuncConfigConfig.Get("NoPromptUsetItem").Numerical1);
+ preciousItemIDs = ConfigParse.GetMultipleStr<int>(FuncConfigConfig.Get("ItemPush").Numerical3);
+ drugIDs = ConfigParse.GetMultipleStr<int>(FuncConfigConfig.Get("LifePotionlist").Numerical1);
+
+ onekeySellTypes = ConfigParse.GetMultipleStr<int>(FuncConfigConfig.Get("OneKeySellItemType").Numerical1);
+
+ pushItemIds = ConfigParse.GetMultipleStr<int>(FuncConfigConfig.Get("IntroductionItem").Numerical1);
+
+ betterEquipExceptDungeonDict = new Dictionary<int, List<int>>();
+ var excEquipData = JsonMapper.ToObject(FuncConfigConfig.Get("GoodItemDungeon").Numerical1);
+ foreach (var dungeonId in excEquipData.Keys)
+ {
+ var itemIds = new List<int>();
+ betterEquipExceptDungeonDict.Add(int.Parse(dungeonId), itemIds);
+ for (var i = 0; i < excEquipData[dungeonId].Count; i++)
+ {
+ var itemId = int.Parse(excEquipData[dungeonId][i].ToString());
+ itemIds.Add(itemId);
+ }
+ }
+
+ DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += OnBeforePlayerDataInitialize;
+ }
+
+ void OnBeforePlayerDataInitialize()
+ {
+ isPackResetOk = true;
+ ClearSortedBetterEquip();
+ }
+
+ #region 璁$畻瑁呭璇勫垎
+
+ class EquipSorceProperties
+ {
+ Dictionary<int, int> properties = new Dictionary<int, int>();
+
+ public int this[int id] { get { return properties[id]; } set { properties[id] = value; } }
+
+ public List<int> Keys { get { return new List<int>(properties.Keys); } }
+
+ void Add(int id, int value)
+ {
+ if (properties.ContainsKey(id))
+ {
+ properties[id] += value;
+ }
+ else
+ {
+ properties[id] = value;
+ }
+ }
+
+ public void AddRange(List<int> ids, List<int> values)
+ {
+ if (ids == null || values == null)
+ {
+ return;
+ }
+
+ var count = Mathf.Min(ids.Count, values.Count);
+ for (int i = 0; i < count; i++)
+ {
+ Add(ids[i], values[i]);
+ }
+ }
+
+ public void AddRange(int[] ids, int[] values)
+ {
+ if (ids == null || values == null)
+ {
+ return;
+ }
+
+ var length = Mathf.Min(ids.Length, values.Length);
+ for (int i = 0; i < length; i++)
+ {
+ Add(ids[i], values[i]);
+ }
+ }
+
+ public void AddRange(Dictionary<int, int> keyValues)
+ {
+ if (keyValues == null)
+ {
+ return;
+ }
+
+ foreach (var item in keyValues)
+ {
+ Add(item.Key, item.Value);
+ }
+ }
+
+ public void AddBaseProperties(int itemId, List<int> reference)
+ {
+ var config = ItemConfig.Get(itemId);
+ if (config == null)
+ {
+ return;
+ }
+ if (config.Effect1 != 0 && reference.Contains(config.Effect1))
+ {
+ properties.Add(config.Effect1, config.EffectValueA1);
+ }
+
+ if (config.Effect2 != 0 && reference.Contains(config.Effect2))
+ {
+ properties.Add(config.Effect2, config.EffectValueA2);
+ }
+
+ if (config.Effect3 != 0 && reference.Contains(config.Effect3))
+ {
+ properties.Add(config.Effect3, config.EffectValueA3);
+ }
+
+ if (config.Effect4 != 0 && reference.Contains(config.Effect4))
+ {
+ properties.Add(config.Effect4, config.EffectValueA4);
+ }
+
+ if (config.Effect5 != 0 && reference.Contains(config.Effect5))
+ {
+ properties.Add(config.Effect5, config.EffectValueA5);
+ }
+ }
+
+ public void AddCustomProperties(int itemId)
+ {
+ if (!AppointItemConfig.HasKey(itemId))
+ {
+ return;
+ }
+
+ var config = AppointItemConfig.Get(itemId);
+ AddRange(config.LegendAttrID, config.LegendAttrValue);
+ }
+
+ public bool ContainsKey(int id)
+ {
+ return properties.ContainsKey(id);
+ }
+
+ }
+
+ // public int GetEquipScore(int itemId, Dictionary<int, List<int>> useDataDic = null, bool isPreview = false)
+ // {
+ // var config = ItemConfig.Get(itemId);
+ // if (config == null) return 0;
+ // if (config.EquipPlace == 0)
+ // {
+ // return 0;
+ // }
+
+ // var properties = new EquipSorceProperties();
+
+ // if (IsCustomItem(itemId))
+ // {
+ // properties.AddBaseProperties(config.EffectValueA1, equipBaseProperties);
+ // properties.AddCustomProperties(itemId);
+ // return CalculateEquipScore(config.EffectValueA1, properties);
+ // }
+
+ // properties.AddBaseProperties(itemId, equipBaseProperties);
+ // if (isPreview)
+ // {
+ // switch ((RoleEquipType)config.EquipPlace)
+ // {
+ // case RoleEquipType.Weapon:
+ // case RoleEquipType.Weapon2:
+ // case RoleEquipType.Hat:
+ // case RoleEquipType.Clothes:
+ // case RoleEquipType.Belt:
+ // case RoleEquipType.Trousers:
+ // case RoleEquipType.Shoes:
+ // case RoleEquipType.Glove:
+ // case RoleEquipType.Neck:
+ // case RoleEquipType.FairyCan1:
+ // case RoleEquipType.FairyCan2:
+ // case RoleEquipType.Jade:
+ // properties.AddRange(GetEquipLegendProperties(itemId));
+ // break;
+ // }
+
+ // return CalculateEquipScore(itemId, properties);
+ // }
+
+ // if (useDataDic != null)
+ // {
+ // if (useDataDic.ContainsKey((int)ItemUseDataKey.legendAttrID))
+ // {
+ // properties.AddRange(useDataDic[(int)ItemUseDataKey.legendAttrID], useDataDic[(int)ItemUseDataKey.legendAttrValue]);
+ // }
+
+ // if (useDataDic.ContainsKey((int)ItemUseDataKey.outOfPrintAttrID))
+ // {
+ // properties.AddRange(useDataDic[(int)ItemUseDataKey.outOfPrintAttrID], useDataDic[(int)ItemUseDataKey.outOfPrintAttrValue]);
+ // }
+ // }
+
+ // return CalculateEquipScore(itemId, properties, useDataDic);
+ // }
+
+ // private Dictionary<int, int> GetEquipLegendProperties(int itemId)
+ // {
+ // var legendProperties = LegendPropertyUtility.GetLegendProFromEquipShen(itemId);
+ // if (legendProperties == null)
+ // legendProperties = LegendPropertyUtility.GetEquipProperties(itemId);
+ // var properties = new Dictionary<int, int>();
+ // if (legendProperties != null)
+ // {
+ // foreach (var item in legendProperties)
+ // {
+ // properties[item.x] = item.y;
+ // }
+ // }
+
+ // return properties;
+ // }
+
+ // private Dictionary<int, int> GetEquipShenProperties(int itemId)
+ // {
+ // var shenProperties = ShenPropertyUtility.GetEquipShenProperties(itemId);
+ // var properties = new Dictionary<int, int>();
+ // if (shenProperties != null)
+ // {
+ // foreach (var item in shenProperties)
+ // {
+ // properties[item.x] = item.y;
+ // }
+ // }
+
+ // return properties;
+ // }
+
+ public bool IsCustomItem(int itemId)
+ {
+ if (!ItemConfig.HasKey(itemId))
+ {
+ return false;
+ }
+
+ return ItemConfig.Get(itemId).Effect1 == 220;
+ }
+
+ /// <summary>
+ /// 寰楀埌瑁呭鐨勮瘎鍒�
+ /// </summary>
+ /// <param name="itemId"></param>
+ /// <returns></returns>
+ private Dictionary<PropertyType, float> curEquipAttrDict = new Dictionary<PropertyType, float>(); //瀛樺偍褰撳墠瑁呭灞炴�у搴旂殑鏁板�� key 灞炴�� value 灞炴�у��
+ // private int CalculateEquipScore(int itemId, EquipSorceProperties properties, Dictionary<int, List<int>> useDataDic = null)
+ // {
+ // var config = ItemConfig.Get(itemId);
+ // if (config == null || !GeneralDefine.CompareEquipPlaces.Contains(config.EquipPlace))
+ // {
+ // return 0;
+ // }
+
+ // properties.AddRange(GetEquipShenProperties(itemId));
+
+ // var minAttack = properties.ContainsKey((int)PropertyType.MinAtk) ? properties[(int)PropertyType.MinAtk] : 0;
+ // var maxAttack = properties.ContainsKey((int)PropertyType.MaxAtk) ? properties[(int)PropertyType.MaxAtk] : 0;
+ // var attack = properties.ContainsKey((int)PropertyType.ATK) ? properties[(int)PropertyType.ATK] : 0;
+
+ // properties[(int)PropertyType.MinAtk] = minAttack + attack;
+ // properties[(int)PropertyType.MaxAtk] = maxAttack + attack;
+
+ // Equation.Instance.Clear();
+ // curEquipAttrDict.Clear();
+
+ // var GSProValueDict = EquipGSParamConfig.GetTagGsProValueDict(config.LV, config.ItemColor, config.SuiteiD > 0 ? 1 : 0, config.StarLevel);
+ // foreach (var key in properties.Keys)
+ // {
+ // var attrType = (PropertyType)key;
+ // switch (attrType)
+ // {
+ // case PropertyType.ATKSPEED:
+ // case PropertyType.OnlyFinalHurt:
+ // case PropertyType.PVPAtkBackHP:
+ // case PropertyType.MinAtk:
+ // case PropertyType.MaxAtk:
+ // case PropertyType.AddFinalHurt:
+ // case PropertyType.ReduceFinalHurt:
+ // curEquipAttrDict.Add(attrType, properties[key]);
+ // break;
+ // default:
+ // if (GSProValueDict != null && GSProValueDict.ContainsKey(attrType))
+ // {
+ // var curProValue = properties[key] * GSProValueDict[attrType];
+ // curEquipAttrDict.Add(attrType, curProValue);
+ // }
+ // else
+ // {
+ // curEquipAttrDict.Add(attrType, properties[key]);
+ // }
+ // break;
+ // }
+ // }
+
+ // foreach (var key in curEquipAttrDict.Keys)
+ // {
+ // var propertyConfig = PlayerPropertyConfig.Get((int)key);
+ // if (propertyConfig != null)
+ // {
+ // Equation.Instance.AddKeyValue(propertyConfig.Parameter, curEquipAttrDict[key]);
+ // }
+ // }
+
+ // var skillScore = 0;
+ // if (useDataDic != null && useDataDic.ContainsKey((int)ItemUseDataKey.equipSkills))
+ // {
+ // for (int i = 0; i < useDataDic[(int)ItemUseDataKey.equipSkills].Count; i++)
+ // {
+ // skillScore += equipSkillScores[useDataDic[(int)ItemUseDataKey.equipSkills][i]];
+ // }
+ // }
+ // else
+ // {
+
+ // if (config.AddSkill1 != 0 && equipSkillScores.ContainsKey(config.AddSkill1))
+ // {
+ // skillScore += equipSkillScores[config.AddSkill1];
+ // }
+
+ // if (config.AddSkill2 != 0 && equipSkillScores.ContainsKey(config.AddSkill2))
+ // {
+ // skillScore += equipSkillScores[config.AddSkill2];
+ // }
+
+ // }
+
+
+ // var spiritWeaponScore = 0;
+ // if (SpiritWeaponConfig.Has(itemId))
+ // {
+ // spiritWeaponScore = SpiritWeaponConfig.Get(itemId).AttrScore;
+ // }
+
+ // if (IsDogzEquip(itemId))
+ // {
+ // return Equation.Instance.Eval<int>(dogzGSFormula);
+ // }
+ // else
+ // {
+ // return spiritWeaponScore + skillScore + Equation.Instance.Eval<int>(normalGSFormula);
+ // }
+ // }
+
+ #endregion
+
+ #region 涓荤晫闈㈢墿鍝佸脊妗嗗睍绀�
+ public event Action<PackType, string> GetPreciousItemEvent; //寰楀埌鐝嶅搧 value 鐗╁搧鐨勫疄渚婭D
+ public event Action<PackType, string> GetExpItemEvent; //寰楀埌缁忛獙鐗╁搧 value 鐗╁搧鐨勫疄渚婭D
+ public void RecommendItem(ItemModel item)
+ {
+ if (item.packType != PackType.Item)
+ {
+ return;
+ }
+ if (!preciousItemTypes.Contains(item.config.Type))
+ {
+ int mapId = PlayerDatas.Instance.baseData.MapID;
+ var drugList = packModel.GetDrugIDListByDungeonID(mapId);
+ if (drugList == null)
+ return;
+ if (!drugList.Contains(item.config.ID))
+ return;
+ }
+
+ if (item.config.Type == 145 && item.config.CDTime > 0)
+ {
+ var createTime = item.GetUseDataFirstValue((int)ItemUseDataKey.createTime);
+ if (createTime > 0)
+ {
+ DateTime useTime;
+ if (item.config.CDTypeEx == 1)
+ {
+ //itemConfig.CDTime 涓哄ぉ锛岃繃0鐐瑰彲鐢�
+ useTime = TimeUtility.GetTime((uint)createTime).AddDays(item.config.CDTime);
+ useTime = TimeUtility.GetDayStartTime(useTime.Year, useTime.Month, useTime.Day);
+ }
+ else
+ {
+ useTime = TimeUtility.GetTime((uint)createTime).AddSeconds(item.config.CDTime);
+ }
+ if (TimeUtility.ServerNow < useTime)
+ {
+ return;
+ }
+ }
+ }
+
+ if (preciousItemIDs != null && preciousItemIDs.Contains(item.config.ID))
+ {
+ return;
+ }
+ if (item.config.ID == packModel.lsItemID)
+ {
+ int tmpCnt = PlayerDatas.Instance.baseData.LV < 50 ? 5 : lsItemCnt;
+ if (packModel.GetItemCountByID(PackType.Item, packModel.lsItemID) < tmpCnt)
+ return;
+ }
+ //if (item.isAuction)
+ //{
+ // return;
+ //}
+
+ if (item.config.UseLV > PlayerDatas.Instance.baseData.LV)
+ {
+ return;
+ }
+
+ if (IsOverdue(item.guid))
+ {
+ return;
+ }
+
+ // if (!IsAbleToUse(item))
+ // {
+ // return;
+ // }
+
+ if (IsSpiritWeapon(item.itemId))
+ {
+ if (IsFightUp(item.itemId, item.score) != 1)
+ {
+ return;
+ }
+ }
+ if (item.config.Type == 13)
+ {
+ // 缁忛獙涓圭壒娈婂鐞嗭紝浼樺厛鏄剧ず
+ if (GetExpItemEvent != null)
+ {
+ GetExpItemEvent(item.packType, item.guid);
+ }
+ }
+ else
+ {
+ if (GetPreciousItemEvent != null)
+ {
+ GetPreciousItemEvent(item.packType, item.guid);
+ }
+
+ }
+ }
+
+ // bool IsAbleToUse(ItemModel item)
+ // {
+ // var windowSearch = WindowSearchConfig.Get(item.config.Jump);
+ // if (windowSearch != null)
+ // {
+ // if (!FuncOpen.Instance.IsFuncOpen(windowSearch.Lv) && windowSearch.Lv != 0)
+ // {
+ // return false;
+ // }
+ // }
+
+ // if (pushItemIds.Contains(item.itemId))
+ // {
+ // var itemCnt = packModel.GetItemCountByID(PackType.Item, item.itemId) - item.count;
+ // if (itemCnt > 0)
+ // {
+ // return false;
+ // }
+ // else
+ // {
+ // if (item.preItemCount > 0)
+ // {
+ // return false;
+ // }
+ // }
+ // }
+
+ // if (promptUseLimitDict.ContainsKey(item.itemId))
+ // {
+ // var playerLv = PlayerDatas.Instance.baseData.LV;
+ // if (playerLv < promptUseLimitDict[item.itemId])
+ // {
+ // return false;
+ // }
+ // }
+
+ // ulong canUseCnt = 0;
+ // if (packModel.IsReachUseLimit(item.guid, out canUseCnt))
+ // {
+ // return false;
+ // }
+
+ // bool isBox = false;
+ // bool isCanOpen = ModelCenter.Instance.GetModel<BoxGetItemModel>().CheckOpenBoxCondition(item.itemId, out isBox);
+ // if (isBox)
+ // {
+ // if (!isCanOpen)
+ // {
+ // return false;
+ // }
+ // }
+
+ // //if (trialModel.trialTokens.Contains(item.itemId))
+ // //{
+ // // if (!trialModel.IsAnySatisfyExchangeBetter(item.itemId))
+ // // {
+ // // return false;
+ // // }
+ // //}
+
+ // if (packModel.CheckIsDrugById(item.itemId))
+ // {
+ // if (item.config.RealmLimit > PlayerDatas.Instance.baseData.realmLevel)
+ // {
+ // return false;
+ // }
+ // }
+
+ // var fruitConfig = AttrFruitConfig.Get(item.itemId);
+ // if (fruitConfig != null && fruitConfig.FuncID == 2)
+ // {
+ // if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.BlastFurnace))
+ // {
+ // return false;
+ // }
+ // }
+
+ // switch (item.config.Type)
+ // {
+ // case 8:
+ // if (buffDatas.BastBuff(item.itemId))
+ // {
+ // return false;
+ // }
+ // break;
+ // case 20:
+ // if (magicianModel.IsGodWeaponMaxLevelByItem(item.itemId))
+ // {
+ // return false;
+ // }
+ // break;
+ // case 21:
+ // if (!mountDatas.IsHint(HorseEnum.HorseDan, item.itemId))
+ // {
+ // return false;
+ // }
+ // break;
+ // case 22:
+ // if (!mountDatas.IsHint(HorseEnum.HorseStone, item.itemId))
+ // {
+ // return false;
+ // }
+ // break;
+ // case 41:
+ // if (!mountDatas.IsHint(HorseEnum.HorseDebris, item.itemId))
+ // {
+ // return false;
+ // }
+ // break;
+ // case 26:
+ // if (!petDatas.IsHint(PetEnum.PetDebris, item.itemId))
+ // {
+ // return false;
+ // }
+ // break;
+ // case 27:
+ // if (!petDatas.IsHint(PetEnum.PetDan, item.itemId))
+ // {
+ // return false;
+ // }
+ // break;
+ // case 28:
+ // if (!petDatas.IsHint(PetEnum.PetStone, item.itemId))
+ // {
+ // return false;
+ // }
+ // break;
+ // case 25:
+ // if (!ModelCenter.Instance.GetModel<EquipGemModel>().IsBetterGem(item.itemId))
+ // {
+ // return false;
+ // }
+ // break;
+ // case 39:
+ // if (!IsBetterWings(item))
+ // {
+ // return false;
+ // }
+ // break;
+ // case 52:
+ // if (!strengthDatas.IsHint(item.itemId))
+ // {
+ // return false;
+ // }
+ // break;
+ // case 55:
+ // if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.BlastFurnace))
+ // {
+ // return false;
+ // }
+ // var alchemyId = 0;
+ // if (alchemyModel.TryGetAlchemyByStudyMaterial(item.itemId, out alchemyId))
+ // {
+ // var alchemyConfig = AlchemyConfig.Get(alchemyId);
+ // int alchemingId;
+ // if (alchemyModel.IsStoveAlcheming((AlchemyType)alchemyConfig.AlchemType, out alchemingId))
+ // {
+ // return false;
+ // }
+ // if (alchemyModel.IsGraspRecipe(alchemyId))
+ // {
+ // return false;
+ // }
+ // var studyError = 0;
+ // if (!alchemyModel.TryLearn(alchemyId, out studyError))
+ // {
+ // return false;
+ // }
+ // }
+ // break;
+ // case 127:
+ // var error = 0;
+ // bool isHaveMakeNum = ItemOperateUtility.Instance.CanUseItem(item.guid, 1, out error);
+ // int remainNum = CrossServerOneVsOnePlayerInfo.Instance.GetDayRemainNum();
+ // if (!CrossServerOneVsOnePKSeason.Instance.isSatisfyMatch
+ // || remainNum > 0
+ // || !isHaveMakeNum)
+ // {
+ // return false;
+ // }
+ // break;
+ // default:
+ // break;
+ // }
+
+ // switch (item.itemId)
+ // {
+ // case 951:
+ // if (!CheckIsExtendGrid(item.itemId))
+ // {
+ // return false;
+ // }
+ // break;
+ // case 952:
+ // return false;
+ // break;
+
+ // }
+
+ // return true;
+ // }
+
+ // private bool IsBetterWings(ItemModel item)
+ // {
+ // if (item == null)
+ // {
+ // return false;
+ // }
+
+ // var putModel = packModel.GetItemByIndex(PackType.Equip, SpiritWeaponModel.WING_EQUIPINDEX);
+ // var singlePack = packModel.GetSinglePack(PackType.Item);
+ // if (singlePack == null)
+ // {
+ // return false;
+ // }
+
+ // int[] composeTypes = item.config.JumpComposeCondi;
+ // bool isOpenCompose = false;
+ // if (composeTypes != null && composeTypes.Length >= 3)
+ // {
+ // int first = composeTypes[0];
+ // int second = composeTypes[1];
+ // int third = composeTypes[2];
+ // ComposeWinModel.ComposeThirdTypeData thirdTypeData = null;
+ // composeModel.TryGetThirdTypeData(first, second, third, out thirdTypeData);
+ // if (thirdTypeData != null)
+ // {
+ // var itemCompound = thirdTypeData.itemCompound;
+ // if (itemCompound.levelNeed <= PlayerDatas.Instance.baseData.LV)
+ // {
+ // isOpenCompose = true;
+ // }
+ // }
+ // }
+
+ // if (!isOpenCompose)
+ // {
+ // return false;
+ // }
+
+ // if (putModel != null && putModel.config.LV >= item.config.LV)
+ // {
+ // return false;
+ // }
+
+ // var itemModels = packModel.GetItems(PackType.Item, new SinglePack.FilterParams()
+ // {
+ // itemTypes = new List<int>() { (int)ItemType.Equip_Wing }
+ // });
+
+ // if (itemModels != null)
+ // {
+ // for (int i = 0; i < itemModels.Count; i++)
+ // {
+ // if (IsJobCompatibleItem(itemModels[i].itemId))
+ // {
+ // if (itemModels[i].config.LV >= item.config.LV)
+ // {
+ // return false;
+ // }
+ // }
+ // }
+ // }
+
+ // return true;
+ // }
+
+ private bool CheckIsExtendGrid(int itemId)
+ {
+ SinglePack singlePack = packModel.GetSinglePack(PackType.Item);
+ if (singlePack == null) return false;
+
+ int startLockIndex = singlePack.unlockedGridCount - GeneralDefine.initBagGridCount;
+ FuncConfigConfig _tagFuncModel = FuncConfigConfig.Get("OpenBagItem");
+ int haveCount = packModel.GetItemCountByID(PackType.Item, itemId);
+ Equation.Instance.Clear();
+ Equation.Instance.AddKeyValue("index", startLockIndex + 1);
+ int needTool = Equation.Instance.Eval<int>(_tagFuncModel.Numerical2);
+ if (haveCount >= needTool)
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ public event Action<string> GetBetterEquipEvent; //寰楀埌鏇村ソ鐨勮澶� value 鐗╁搧鐨勫疄渚婭D
+
+ // public void OnGetEquip(ItemModel item)
+ // {
+ // if (item == null)
+ // {
+ // return;
+ // }
+
+ // if (item.packType != PackType.Item)
+ // {
+ // return;
+ // }
+
+ // if (!IsJobCompatibleItem(item.itemId))
+ // {
+ // return;
+ // }
+
+ // int equipPlace = item.config.EquipPlace;
+ // if ((RoleEquipType)equipPlace == RoleEquipType.Wing)
+ // {
+ // var wing = packModel.GetItemByIndex(PackType.Equip, SpiritWeaponModel.WING_EQUIPINDEX);
+ // if (wing == null)
+ // {
+ // if (!SpiritWeaponModel.hasAutoEquipWing)
+ // {
+ // SpiritWeaponModel.hasAutoEquipWing = true;
+ // ItemOperateUtility.Instance.PutOnItem(item.guid);
+ // return;
+ // }
+ // }
+ // }
+
+ // switch ((RoleEquipType)equipPlace)
+ // {
+ // case RoleEquipType.Weapon:
+ // case RoleEquipType.Weapon2:
+ // case RoleEquipType.Hat:
+ // case RoleEquipType.Clothes:
+ // case RoleEquipType.Belt:
+ // case RoleEquipType.Trousers:
+ // case RoleEquipType.Shoes:
+ // case RoleEquipType.Neck:
+ // case RoleEquipType.FairyCan1:
+ // case RoleEquipType.FairyCan2:
+ // case RoleEquipType.Glove:
+ // case RoleEquipType.Jade:
+ // case RoleEquipType.Wing:
+ // case RoleEquipType.Guard:
+ // case RoleEquipType.PeerlessWeapon1:
+ // case RoleEquipType.PeerlessWeapon2:
+ // if (betterEquipExceptDungeonDict.ContainsKey(PlayerDatas.Instance.baseData.MapID))
+ // {
+ // if (betterEquipExceptDungeonDict[PlayerDatas.Instance.baseData.MapID].Contains(item.itemId))
+ // {
+ // return;
+ // }
+ // }
+ // SetGetBetterEquipEvent(item);
+ // break;
+ // }
+ // }
+
+ private void SetGetBetterEquipEvent(ItemModel model)
+ {
+ // // if (model.isAuction)
+ // // {
+ // // return;
+ // // }
+
+ // var itemEffectTime = model.GetUseData((int)ItemUseDataKey.createTime);
+ // if (!itemEffectTime.IsNullOrEmpty() && itemEffectTime.Count > 0)
+ // {
+ // if (itemEffectTime[0] != 0)
+ // {
+ // var cool = KnapsackTimeCDMgr.Instance.GetItemCoolById(model.guid);
+ // double remainTime = 0;
+ // if (cool != null)
+ // {
+ // remainTime = cool.GetRemainTime();
+ // }
+
+ // if (remainTime >= 0 && remainTime < 120 && model.config.ExpireTime > 0)
+ // {
+ // return;
+ // }
+ // }
+ // }
+
+ // if (!equipModel.IsLevelUnLocked(model.config.LV))
+ // {
+ // return;
+ // }
+
+ // int isFightUp = IsFightUp(model.itemId, model.score);
+ // if (isFightUp != 1)
+ // {
+ // return;
+ // }
+
+ // if (GetBetterEquipEvent != null)
+ // {
+ // GetBetterEquipEvent(model.guid);
+ // }
+ }
+
+ public event Action<PackType, string> PickItemEvent; //鎹¤捣鐨勭墿鍝�
+
+ //鐢ㄤ簬杩囨护閬撳叿椋樺叆琛ㄧ幇 鍦ㄤ笉鎯冲嚭鐜扮墿鍝侀鍔ㄧ殑鐣岄潰 寮�鍚晫闈㈢殑鏃跺�欒缃畉rue 锛屽叧闂晫闈㈣缃甪alse
+ public bool hidePickItem = false;
+ public void RefreshPickItem(PackType type, string itemIDStr)
+ {
+ if (hidePickItem)
+ return;
+
+ if (!DTC0403_tagPlayerLoginLoadOK.finishedLogin) return;
+
+ //淇敼鍚庝紶鐨勬槸鐗╁搧id瀛楃涓�
+ if (type != PackType.Item && type != PackType.DogzItem && type != PackType.GatherSoul && type != PackType.RunePack && type != PackType.default1) return;
+
+ if (PickItemEvent != null)
+ {
+ PickItemEvent(type, itemIDStr);
+ }
+ }
+
+ Dictionary<int, ItemModel> RealmBetterDict = new Dictionary<int, ItemModel>();
+ // public Dictionary<int, ItemModel> CheckBetterEquipByRealm()
+ // {
+ // RealmBetterDict.Clear();
+ // SinglePack singlePack = packModel.GetSinglePack(PackType.Item);
+ // if (singlePack == null) return RealmBetterDict;
+
+ // int realmLv = PlayerDatas.Instance.baseData.realmLevel;
+ // Dictionary<int, ItemModel> pairs = singlePack.GetAllItems();
+ // foreach (var model in pairs.Values)
+ // {
+ // var equipServerIndex = EquipSet.ClientPlaceToServerPlace(new Int2(model.config.LV, model.config.EquipPlace));
+ // if (model.config.EquipPlace > 0
+ // && model.config.EquipPlace != (int)RoleEquipType.Guard
+ // && model.config.RealmLimit <= realmLv
+ // && !IsOverdue(model.guid)
+ // && IsFightUp(model.itemId, model.score) == 1)
+ // {
+ // if (!RealmBetterDict.ContainsKey(equipServerIndex))
+ // {
+ // RealmBetterDict.Add(equipServerIndex, model);
+ // }
+ // else
+ // {
+ // if (model.score > RealmBetterDict[equipServerIndex].score)
+ // {
+ // RealmBetterDict[equipServerIndex] = model;
+ // }
+ // }
+ // }
+ // }
+ // return RealmBetterDict;
+ // }
+
+ // List<ItemModel> RealmDruglist = new List<ItemModel>();
+ // public List<ItemModel> GetDruglistByRealm()
+ // {
+ // RealmDruglist.Clear();
+ // SinglePack singlePack = packModel.GetSinglePack(PackType.Item);
+ // if (singlePack == null) return RealmDruglist;
+
+ // int realmLv = PlayerDatas.Instance.baseData.realmLevel;
+ // Dictionary<int, ItemModel> pairs = singlePack.GetAllItems();
+ // foreach (var model in pairs.Values)
+ // {
+ // if (packModel.CheckIsDrugById(model.itemId))
+ // {
+ // AttrFruitConfig fruitConfig = AttrFruitConfig.Get(model.itemId);
+ // if (!packModel.IsReachMaxUseDrug(fruitConfig)
+ // && model.config.RealmLimit <= realmLv)
+ // {
+ // RealmDruglist.Add(model);
+ // }
+ // }
+ // }
+ // return RealmDruglist;
+ // }
+ #endregion
+
+ #region 鐗╁搧澶勪簬CD涓殑閫昏緫澶勭悊
+
+ private List<string> itemEffectTimelist = new List<string>(); //key 鐗╁搧瀹炰緥ID
+ /// <summary>
+ /// 鐗╁搧浣跨敤鏃堕棿闄愬埗
+ /// </summary>
+ public void SetItemEffectCDTime(string guid, int itemID, int getTime, int serverSurplusTime)
+ {
+ double time = GetTimeOffest(TimeUtility.GetTime((uint)getTime));
+ if (time < 0)
+ {
+ time = 0;
+ }
+
+ ItemConfig itemConfig = ItemConfig.Get(itemID);
+ if (time >= itemConfig.ExpireTime)
+ {
+ KnapsackTimeCDMgr.Instance.UnRegister(guid);
+ return;
+ }
+ double remainTime = (serverSurplusTime > 0 ? serverSurplusTime : itemConfig.ExpireTime) - time;
+ KnapsackTimeCDMgr.Instance.Register(guid, itemID, remainTime);
+ }
+
+ public double GetTimeOffest(DateTime getTime)
+ {
+ Debug.Log("鐜板湪鏃堕棿锛�" + TimeUtility.ServerNow + "鑾峰緱鏃堕棿:" + getTime);
+ //TimeUtility.SyncServerTime();
+ TimeSpan t = TimeUtility.ServerNow - getTime;
+ Debug.Log("鏃堕棿宸細" + t.TotalSeconds);
+ return t.TotalSeconds;
+ }
+
+ #endregion
+
+ #region 璁剧疆鍙互涓�閿嚭鍞殑鐗╁搧鏁版嵁
+
+ private int playerLv;
+ private Dictionary<int, List<ItemModel>> _lifePotionDict = new Dictionary<int, List<ItemModel>>(); //key 鑽按绛夌骇
+ private List<int> _sellItemScorelist = new List<int>();
+ private Dictionary<int, Dictionary<int, List<ItemModel>>> _sameIndexEquipDict = new Dictionary<int, Dictionary<int, List<ItemModel>>>(); //瀛樺偍鐩稿悓瑁呭浣嶇殑瑁呭
+ // private _sameEquipScoreDict = new Dictionary<int, List<ItemModel>>(); //瀛樺偍鐩稿悓ID涓浉鍚岃澶囪瘎鍒嗙殑瑁呭
+ private Dictionary<int, ItemModel> _packModelDict;
+ private List<ItemModel> _sellItemlist = new List<ItemModel>();
+
+ // public List<ItemModel> GetSellItemList()
+ // {
+ // GetOneKeySellModel();
+ // _sellItemlist.Sort(SetSellItemOrder);
+ // return _sellItemlist;
+ // }
+
+ // public int SetSellItemOrder(ItemModel startModel, ItemModel endModel)
+ // {
+ // bool startIsEquip = IsRealmEquip(startModel.itemId);
+ // bool endIsEquip = IsRealmEquip(endModel.itemId);
+ // if (startIsEquip.CompareTo(endIsEquip) != 0) return -startIsEquip.CompareTo(endIsEquip);
+ // int order1 = startModel.config.Type;
+ // int order2 = endModel.config.Type;
+ // if (order1.CompareTo(order2) != 0) return order1.CompareTo(order2);
+ // int color1 = startModel.config.ItemColor;
+ // int color2 = endModel.config.ItemColor;
+ // if (color1.CompareTo(color2) != 0) return -color1.CompareTo(color2);
+ // int code1 = startModel.itemId;
+ // int code2 = endModel.itemId;
+ // if (code1.CompareTo(code2) != 0) return -code1.CompareTo(code2);
+ // return 0;
+ // }
+
+ // public void GetOneKeySellModel()
+ // {
+ // SinglePack singlePack = packModel.GetSinglePack(PackType.Item);
+ // if (singlePack == null)
+ // return;
+
+ // _sellItemlist.Clear();
+ // _lifePotionDict.Clear();
+ // _sameIndexEquipDict.Clear();
+ // _sellItemScorelist.Clear();
+ // playerLv = PlayerDatas.Instance.baseData.LV;
+ // _packModelDict = singlePack.GetAllItems();
+ // foreach (var key in _packModelDict.Keys)
+ // {
+ // GetCanSellEquipList(_packModelDict[key]);
+ // ItemModel itemModel = _packModelDict[key];
+ // if (drugIDs.Contains(itemModel.itemId))
+ // {
+ // if (!_lifePotionDict.ContainsKey(itemModel.config.LV))
+ // {
+ // List<ItemModel> modellist = new List<ItemModel>();
+ // modellist.Add(itemModel);
+ // _lifePotionDict.Add(itemModel.config.LV, modellist);
+ // }
+ // else
+ // {
+ // _lifePotionDict[itemModel.config.LV].Add(itemModel);
+ // }
+ // }
+ // }
+
+ // #region 寰楀埌鍙互鍑哄敭鐨勮澶�
+ // foreach (var key in _sameIndexEquipDict.Keys)
+ // {
+ // _sellItemScorelist = _sameIndexEquipDict[key].Keys.ToList();
+ // _sellItemScorelist.Sort();
+ // if (_sellItemScorelist.Count > 0)
+ // {
+ // int score = 0;
+ // for (score = _sellItemScorelist.Count - 1; score > -1; score--)
+ // {
+ // SinglePack equipPack = packModel.GetSinglePack(PackType.Equip);
+ // ItemModel model = null;
+ // if (equipPack != null)
+ // {
+ // model = equipPack.GetItemByIndex(key);
+ // }
+
+ // var modellist = _sameIndexEquipDict[key][_sellItemScorelist[score]];
+ // bool remainBetter = true;
+ // for (var i = 0; i < modellist.Count; i++)
+ // {
+ // if (model != null)
+ // {
+ // if (remainBetter)
+ // {
+ // if (model.score < _sellItemScorelist[score] && IsJobCompatibleItem(model.itemId))
+ // {
+ // _sameIndexEquipDict[key].Remove(_sellItemScorelist[score]);
+ // remainBetter = false;
+ // break;
+ // }
+ // }
+
+ // }
+ // else
+ // {
+ // if (IsJobCompatibleItem(model.itemId))
+ // {
+ // if (remainBetter)
+ // {
+ // _sameIndexEquipDict[key].Remove(_sellItemScorelist[score]);
+ // remainBetter = false;
+ // break;
+ // }
+ // }
+ // }
+ // }
+
+ // if (!remainBetter)
+ // {
+ // break;
+ // }
+
+ // }
+
+ // for (var j = 0; j < _sellItemScorelist.Count; j++)
+ // {
+
+ // if (_sameIndexEquipDict[key].ContainsKey(_sellItemScorelist[j]))
+ // {
+ // var sellModlelist = _sameIndexEquipDict[key][_sellItemScorelist[j]];
+ // for (var k = 0; k < sellModlelist.Count; k++)
+ // {
+ // _sellItemlist.Add(sellModlelist[k]);
+ // }
+ // }
+ // }
+
+ // }
+
+ // }
+ // #endregion
+
+ // List<int> drugLvlist = new List<int>();
+ // drugLvlist.AddRange(_lifePotionDict.Keys.ToList());
+ // drugLvlist.Sort();
+ // for (int i = drugLvlist.Count - 1; i > -1; i--)
+ // {
+ // if (drugLvlist[i] > playerLv)
+ // {
+ // _lifePotionDict.Remove(drugLvlist[i]);
+ // }
+ // else
+ // {
+ // _lifePotionDict.Remove(drugLvlist[i]);
+ // break;
+ // }
+ // }
+
+ // foreach (var list in _lifePotionDict.Values)
+ // {
+ // for (int i = 0; i < list.Count; i++)
+ // {
+ // _sellItemlist.Add(list[i]);
+ // }
+
+ // }
+ // }
+
+
+ //寰楀埌婊¤冻鍑哄敭鏉′欢鐨勮澶囧垪琛�
+ // public void GetCanSellEquipList(ItemModel model)
+ // {
+
+ // if (model.config.EquipPlace == 0 || !onekeySellTypes.Contains(model.config.Type))
+ // return;
+
+ // Dictionary<int, List<ItemModel>> sameScoreDict;
+ // List<ItemModel> sameScorelist;
+
+ // if (model.config.ItemColor < 3)
+ // {
+ // if (!_sameIndexEquipDict.ContainsKey(model.config.EquipPlace))
+ // {
+ // sameScoreDict = new Dictionary<int, List<ItemModel>>();
+ // sameScorelist = new List<ItemModel>();
+ // sameScorelist.Add(model);
+ // sameScoreDict.Add(model.score, sameScorelist);
+ // _sameIndexEquipDict.Add(model.config.EquipPlace, sameScoreDict);
+
+ // }
+ // else
+ // {
+ // if (_sameIndexEquipDict[model.config.EquipPlace].ContainsKey(model.score))
+ // {
+ // _sameIndexEquipDict[model.config.EquipPlace][model.score].Add(model);
+ // }
+ // else
+ // {
+ // sameScorelist = new List<ItemModel>();
+ // sameScorelist.Add(model);
+ // _sameIndexEquipDict[model.config.EquipPlace].Add(model.score, sameScorelist);
+ // }
+
+ // }
+ // }
+
+
+ // }
+
+ #endregion
+
+ #region 鍙戦�佽姹�
+ /// <summary>
+ /// 涓�閿嚭鍞墿鍝佺殑璇锋眰
+ /// </summary>
+ /// <param name="_oneKeySelllist"></param>
+ // public void OneKeySell(List<ItemModel> _oneKeySelllist)
+ // {
+ // if (!isPackResetOk || SettingEffectMgr.Instance.isStartOneKeySell) return;
+
+ // SettingEffectMgr.Instance.isStartOneKeySell = true;
+ // byte[] itemIndexs = new byte[_oneKeySelllist.Count];
+ // int i = 0;
+ // for (i = 0; i < _oneKeySelllist.Count; i++)
+ // {
+ // itemIndexs[i] = (byte)_oneKeySelllist[i].gridIndex;
+ // }
+ // CA311_tagCMSellItem sellItem = new CA311_tagCMSellItem();
+ // sellItem.PackType = (int)PackType.Item;
+ // sellItem.Count = (byte)_oneKeySelllist.Count;
+ // sellItem.ItemIndex = itemIndexs;
+ // GameNetSystem.Instance.SendInfo(sellItem);
+ // }
+
+ /// <summary>
+ /// 鏁寸悊鍖呰9鐗╁搧
+ /// </summary>
+ /// <param name="type"></param>
+ public bool isPackResetOk { get; set; }
+ public void ResetPack(PackType type)
+ {
+ // if (lookLineIndex > -1)
+ // {
+ // SetLookIndex(null);
+ // }
+
+ // if (KnapSackWin.titleType == KnapsackFuncTitle.bag)
+ // {
+ // packModel.isPlayBetterEquipEffect = true;
+ // }
+
+ // SinglePack singlePack = packModel.GetSinglePack(type);
+ // if (singlePack != null)
+ // {
+ // var packReset = new C070F_tagCItemPackReset();
+ // packReset.Type = (byte)type;
+ // packReset.ItemBeginIndex = 0;
+ // packReset.ItemEndIndex = (ushort)(singlePack.unlockedGridCount - 1);
+ // GameNetSystem.Instance.SendInfo(packReset); //鏁寸悊鐗╁搧
+ // if (type == PackType.Item)
+ // {
+ // isPackResetOk = false;
+ // }
+ // }
+ }
+ #endregion
+
+ #region 鏌ョ湅鏌愪釜浣嶇疆鐨勭墿鍝�
+ public event Action lookEquipEvent;
+ private int _lookLineIndex = -1;
+ public int lookLineIndex { get { return _lookLineIndex; } private set { _lookLineIndex = value; } }
+
+ public string lookItemGUID { get; private set; }
+
+ public void SetLookIndex(string guid, int singleRowCount = 5)
+ {
+
+ if (string.IsNullOrEmpty(guid) || guid == "")
+ {
+ lookLineIndex = -1;
+ }
+ else
+ {
+ int index = packModel.GetItemByGuid(guid).gridIndex;
+ lookLineIndex = index / singleRowCount;
+ lookItemGUID = guid;
+ }
+
+ if (lookEquipEvent != null)
+ {
+ lookEquipEvent();
+ }
+
+ }
+ #endregion
+
+ #region 鍒ゆ柇鏄惁鏈夋洿濂界殑瑁呭鏇挎崲
+
+ /// <summary>
+ /// 鑾峰彇瑁呭璇勫垎鏈�楂樺彲鎻愬崌鎴樺姏鐨勮澶�
+ /// </summary>
+ /// <param name="_places"></param>
+ /// <returns></returns>
+ // public string GetHighestScoreEquipByPlace(int equipPlace)
+ // {
+ // var itemPackage = packModel.GetSinglePack(PackType.Item);
+ // var allItems = itemPackage.GetAllItems();
+ // var putModel = packModel.GetItemByIndex(PackType.Equip, equipPlace);
+ // var guid = string.Empty;
+ // var score = putModel == null ? 0 : putModel.score;
+ // foreach (var item in allItems.Values)
+ // {
+ // if (item.config.EquipPlace == equipPlace)
+ // {
+ // if (!IsOverdue(item.guid)
+ // && (IsJobCompatibleItem(item.itemId)) && item.score > score)
+ // {
+ // guid = item.guid;
+ // score = item.score;
+ // }
+ // }
+ // }
+
+ // return guid;
+ // }
+ #endregion
+
+ #region 鑳屽寘鏁寸悊鍚庡ソ鐨勫悓绫诲瀷鏈�濂界殑瑁呭
+ Dictionary<int, Dictionary<int, ItemModel>> itemModelDict = new Dictionary<int, Dictionary<int, ItemModel>>(); // key1 瑁呭浣嶇疆绱㈠紩 key2 鑳屽寘浣嶇疆绱㈠紩
+
+ public void ClearSortedBetterEquip()
+ {
+ itemModelDict.Clear();
+ }
+
+ public void SetBagSortBetterEquipList(ItemModel itemModel)
+ {
+ if (itemModel == null || itemModel.packType != PackType.Item) return;
+
+ if (!IsCanPutOn(itemModel)) return;
+
+ int equipPlace = itemModel.config.EquipPlace;
+ if (!itemModelDict.ContainsKey(equipPlace))
+ {
+ var dict = new Dictionary<int, ItemModel>();
+ if (IsFightUp(itemModel.itemId, itemModel.score) == 1)
+ {
+ dict.Add(itemModel.gridIndex, itemModel);
+ itemModelDict.Add(equipPlace, dict);
+ }
+ }
+ else
+ {
+ if (IsFightUp(itemModel.itemId, itemModel.score) == 1)
+ {
+ itemModelDict[equipPlace].Add(itemModel.gridIndex, itemModel);
+ }
+ }
+
+ }
+
+ public ItemModel GetBagSortBetterEquip(int equipPlace, int index)
+ {
+ ItemModel itemModel = null;
+ if (itemModelDict.ContainsKey(equipPlace))
+ {
+ itemModelDict[equipPlace].TryGetValue(index, out itemModel);
+ }
+ return itemModel;
+ }
+
+ bool IsCanPutOn(ItemModel item)
+ {
+ if (IsJobCompatibleItem(item.itemId))
+ {
+ return false;
+ }
+
+ int equipPlace = item.config.EquipPlace;
+ if (equipPlace == 0 || equipPlace > 17)
+ {
+ return false;
+ }
+
+ var putOnlimitList = item.GetUseData((int)ItemUseDataKey.cancelUseLimit);
+ if (!putOnlimitList.IsNullOrEmpty())
+ {
+ if (putOnlimitList[0] == 1)
+ {
+ return true;
+ }
+ }
+
+ return PlayerDatas.Instance.baseData.realmLevel >= item.config.RealmLimit;
+ }
+
+ #endregion
+
+ #region 寰楀埌鐗╁搧鐨勫搧璐ㄩ鑹�
+ private Dictionary<int, int> wingRefineQualityDict;
+ private int[] wingsQualitys;
+ private int[] wingsRefineExps;
+ public int GetItemQuality(int itemId, Dictionary<int, List<int>> useDataDic = null)
+ {
+ wingsQualitys = null;
+ wingsRefineExps = null;
+ ItemConfig itemConfig = ItemConfig.Get(itemId);
+ // wingRefineQualityDict = WingRefineAttrConfig.GetWingsQualityModel(itemConfig.LV);
+ // if (useDataDic != null)
+ // {
+ // if (useDataDic.ContainsKey(42) && wingRefineQualityDict != null)
+ // {
+ // wingsQualitys = wingRefineQualityDict.Keys.ToArray();
+ // wingsRefineExps = wingRefineQualityDict.Values.ToArray();
+ // int i = 0;
+ // for (i = wingsRefineExps.Length - 1; i > -1; i--)
+ // {
+ // if (useDataDic[42][0] >= wingsRefineExps[i])
+ // {
+ // return wingsQualitys[i];
+ // }
+ // }
+ // }
+ // }
+ return itemConfig.ItemColor;
+ }
+ #endregion
+
+ //璁剧疆鐜╁璐у竵鏄剧ず
+ public string OnChangeCoinsUnit(ulong value)
+ {
+ return UIHelper.ReplaceLargeNum(value);
+ }
+
+ /// <summary>
+ /// 瑁呭鏄惁鍙互鎻愬崌鎴樺姏
+ /// </summary>
+ /// <param name="_itemID"></param>
+ /// <param name="_score"></param>
+ /// <returns></returns>
+ public int IsFightUp(int _itemID, int _score)//-1浣庣骇锛�0涓嶆槸鏈亴涓氾紝1鏇村ソ
+ {
+ var config = ItemConfig.Get(_itemID);
+ if (config != null)
+ {
+ // var index = EquipModel.GetItemServerEquipPlace(_itemID);
+ // if (index == -1)
+ // {
+ // return 0;
+ // }
+
+ // var item = packModel.GetItemByIndex(PackType.Equip, index);
+ // var equipScore = item != null ? item.score : 0;
+ // if (IsJobCompatibleItem(_itemID))
+ // {
+ // return _score.CompareTo(equipScore);
+ // }
+ // else
+ // {
+ // return 0;
+ // }
+ }
+
+ return 0;
+ }
+
+ // 涓嶅寘鍚湭寮�鏀捐澶囩殑姣旇緝 灞炰簬-1
+ public int IsFightUpEx(int _itemID, int _score, int _realm)//-1浣庣骇锛�0涓嶆槸鏈亴涓氾紝1鏇村ソ
+ {
+ var config = ItemConfig.Get(_itemID);
+ if (config != null)
+ {
+ // var index = EquipModel.GetItemServerEquipPlace(_itemID);
+ // if (index == -1)
+ // {
+ // return 0;
+ // }
+
+ // var item = packModel.GetItemByIndex(PackType.Equip, index);
+
+ // var equipScore = item != null ? item.score : 0;
+ // if (IsJobCompatibleItem(_itemID))
+ // {
+ // if (_realm > PlayerDatas.Instance.baseData.realmLevel)
+ // return -1;
+ // return _score.CompareTo(equipScore);
+ // }
+ // else
+ // {
+ // return 0;
+ // }
+ }
+
+ return 0;
+ }
+
+
+ #region 鐗╁搧鏄惁杩囨湡
+
+ public bool IsOverdue(string guid)
+ {
+ var item = packModel.GetItemByGuid(guid);
+ if (item == null)
+ {
+ return false;
+ }
+
+ if (item.isAuction)
+ {
+ return false;//item.auctionSurplusTime < 0;
+ }
+ else
+ {
+ var isoverdue = false;
+ switch ((ItemTimeType)item.config.EndureReduceType)
+ {
+ case ItemTimeType.EquipedTime:
+ isoverdue = item.GetUseDataFirstValue(44) > 0 && item.overdueSurplusTime < 0;
+ break;
+ case ItemTimeType.RealityTime:
+ isoverdue = item.overdueSurplusTime < 0;
+ break;
+ }
+
+ return isoverdue;
+ }
+ }
+
+ #endregion
+
+ public bool IsJobCompatibleItem(int itemId)
+ {
+ var config = ItemConfig.Get(itemId);
+ return config != null && (config.JobLimit == 0 || config.JobLimit == PlayerDatas.Instance.baseData.Job);
+ }
+
+ public bool IsRealmEquip(int itemId)
+ {
+ if (!ItemConfig.HasKey(itemId))
+ {
+ return false;
+ }
+
+ var config = ItemConfig.Get(itemId);
+ return config.Type >= 101 && config.Type <= 112;
+ }
+
+ public bool IsWing(int itemId)
+ {
+ if (!ItemConfig.HasKey(itemId))
+ {
+ return false;
+ }
+ var config = ItemConfig.Get(itemId);
+ return config.Type == 113 || config.Type == 39 || config.Type == 52;
+ }
+
+ public bool IsDogzEquip(int itemId)
+ {
+ if (!ItemConfig.HasKey(itemId))
+ {
+ return false;
+ }
+
+ var config = ItemConfig.Get(itemId);
+ return config.Type >= 119 && config.Type <= 123;
+ }
+
+ public bool IsSpiritWeapon(int itemId)
+ {
+ if (!ItemConfig.HasKey(itemId))
+ {
+ return false;
+ }
+
+ var config = ItemConfig.Get(itemId);
+ return config.Type >= 113 && config.Type <= 117;
+ }
+
+ public bool IsSuitEquip(int itemId)
+ {
+ if (!ItemConfig.HasKey(itemId))
+ {
+ return false;
+ }
+
+ var config = ItemConfig.Get(itemId);
+ return config.SuiteiD > 0 && config.Type >= 101 && config.Type <= 112;
+ }
+
+ // public bool IsThanksItem(int itemID)
+ // {
+ // if (AssistThanksGiftConfig.Get(itemID) == null)
+ // {
+ // return false;
+ // }
+ // return true;
+ // }
+
+ // public int GetSpecialSpiritPropertyValue(int itemId)
+ // {
+ // var config = SpiritWeaponConfig.Get(itemId);
+ // if (config == null)
+ // {
+ // return 0;
+ // }
+
+ // var propertyId = 0;
+ // var propertyValue = 0;
+ // for (var i = 0; i < config.AttrIDList.Length; i++)
+ // {
+ // var id = config.AttrIDList[i];
+ // if (id == 79 || id == 80)
+ // {
+ // propertyId = id;
+ // propertyValue = config.AttrValueList[i];
+ // break;
+ // }
+ // }
+
+ // if (propertyId == 0)
+ // {
+ // return 0;
+ // }
+
+ // Equation.Instance.Clear();
+ // Equation.Instance.AddKeyValue("maxOOPValue", propertyValue);
+
+ // var maxLevel = 100;
+ // if (specialSpiritPropertyMaxLevels.ContainsKey(config.Level))
+ // {
+ // maxLevel = specialSpiritPropertyMaxLevels[config.Level];
+ // }
+
+ // Equation.Instance.AddKeyValue("lv", Mathf.Min(maxLevel, PlayerDatas.Instance.baseData.LV));
+ // return Equation.Instance.Eval<int>(specialSpiritPropertyFormula[propertyId]);
+ // }
+
+ // public int GetSpecialSpiritPropertyMaxLevel(int itemId)
+ // {
+ // var config = SpiritWeaponConfig.Get(itemId);
+ // if (config == null)
+ // {
+ // return 0;
+ // }
+
+ // var maxLevel = 0;
+ // if (specialSpiritPropertyMaxLevels.ContainsKey(config.Level))
+ // {
+ // maxLevel = specialSpiritPropertyMaxLevels[config.Level];
+ // }
+
+ // return maxLevel;
+ // }
+
+ //瑁呭瀵规瘮锛岀敤浜庨潪瀹為檯瑁呭绠�鍗曟瘮杈� 鏄惁闇�瑕佹瑁呭
+ // public bool IsSatisfyEquipBetterEquip(int itemID)
+ // {
+ // if (!IsRealmEquip(itemID))
+ // {
+ // return false;
+ // }
+
+ // var itemConfig = ItemConfig.Get(itemID);
+ // if (itemConfig.JobLimit != 0 && itemConfig.JobLimit != PlayerDatas.Instance.baseData.Job)
+ // {
+ // return false;
+ // }
+
+ // var equipSet = equipModel.GetEquipSet(itemConfig.LV);
+ // if (!equipSet.IsSlotUnLocked(itemConfig.EquipPlace))
+ // {
+ // return false;
+ // }
+
+ // var equipGuid = equipModel.GetEquip(new Int2(itemConfig.LV, itemConfig.EquipPlace));
+ // if (string.IsNullOrEmpty(equipGuid))
+ // {
+ // return true;
+ // }
+
+ // var itemModel = packModel.GetItemByGuid(equipGuid);
+ // if (itemModel == null)
+ // {
+ // return true;
+ // }
+
+ // if (itemConfig.ItemColor > itemModel.config.ItemColor)
+ // {
+ // return true;
+ // }
+
+ // return itemModel.config.SuiteiD == 0 && itemConfig.SuiteiD != 0;
+ // }
+
+
+
+ public Action OnGetItem; //CommonGetItemWin鐣岄潰鍏抽棴鏃惰Е鍙�
+ public string getItemInfo { get; private set; } //閫氱敤鏄剧ず鑾峰緱鐨勭晫闈俊鎭�
+ public string getItemBtnText { get; private set; } //閫氱敤鏄剧ず鑾峰緱鐨勭晫闈㈡寜閽枃瀛� 榛樿纭畾
+ public int closeSeconds { get; private set; } // 鍏抽棴鍊掕鏃舵椂闂� 濡傛灉浼�0浠h〃鎵嬪姩鍏抽棴
+ public bool isNameShow { get; private set; } // 鏄惁灞曠ず鐗╁搧鍚嶅瓧
+
+ // 濡傛灉鍚屾椂鏈夊绉嶅鍔卞皝鍖咃紝鍚屼竴涓簨浠跺綊闆嗭紝涓嶅悓浜嬩欢鐩存帴椤舵帀鏄剧ず鏈�鏂�
+ public Dictionary<int, Item> totalShowItems = new Dictionary<int, Item>();
+ public event Action OnGetItemShowEvent;
+ private string getItemEventName;
+
+
+ // 閫氱敤鏄剧ず鑾峰緱鐨勭墿鍝�
+ public void ShowGetItem(List<Item> items, string info = "", int seconds = 3, string btnName = "", Action func = null, bool isNameShow = true, string eventName = "default")
+ {
+ if (getItemEventName != eventName)
+ {
+ if (UIManager.Instance.IsOpenedInList<CommonGetItemWin>())
+ {
+ //----------------------璁板緱鏀圭珛鍗冲叧闂�
+ UIManager.Instance.CloseWindow<CommonGetItemWin>();
+ }
+ totalShowItems.Clear();
+ getItemEventName = eventName;
+ }
+
+ //鐩稿悓ID 鍚堝苟鏁伴噺鏄剧ず
+ for (int i = 0; i < items.Count; i++)
+ {
+ var id = items[i].id;
+ if (totalShowItems.ContainsKey(id))
+ {
+ totalShowItems[id] = new Item(id, items[i].countEx + totalShowItems[id].countEx, items[i].bind, items[i].quality);
+ }
+ else
+ {
+ totalShowItems.Add(id, items[i]);
+ }
+ }
+
+
+ getItemInfo = info;
+ OnGetItem = func;
+ if (btnName == "")
+ btnName = Language.Get("PopConfirmWin_OK");
+ getItemBtnText = btnName;
+ closeSeconds = seconds;
+ this.isNameShow = isNameShow;
+ OnGetItemShowEvent?.Invoke();
+ if (!UIManager.Instance.IsOpenedInList<CommonGetItemWin>())
+ {
+ UIManager.Instance.OpenWindow<CommonGetItemWin>();
+ }
+ }
+
+ //鍙互鎸囧畾鎵撳紑鐨勭獥鍙�
+ public void ShowGetItemEx<T>(List<Item> items, string info = "", int seconds = 3, string btnName = "", Action func = null, bool isNameShow = true, string eventName = "default") where T : UIBase
+ {
+ if (getItemEventName != eventName)
+ {
+ if (UIManager.Instance.IsOpenedInList<T>())
+ {
+ //----------------------璁板緱鏀圭珛鍗冲叧闂�
+ UIManager.Instance.CloseWindow<T>();
+ }
+
+ totalShowItems.Clear();
+ getItemEventName = eventName;
+ }
+
+ //鐩稿悓ID 鍚堝苟鏁伴噺鏄剧ず
+ for (int i = 0; i < items.Count; i++)
+ {
+ var id = items[i].id;
+ if (totalShowItems.ContainsKey(id))
+ {
+ totalShowItems[id] = new Item(id, items[i].countEx + totalShowItems[id].countEx, items[i].bind, items[i].quality);
+ }
+ else
+ {
+ totalShowItems.Add(id, items[i]);
+ }
+ }
+
+
+ getItemInfo = info;
+ OnGetItem = func;
+ if (btnName == "")
+ btnName = Language.Get("PopConfirmWin_OK");
+ getItemBtnText = btnName;
+ closeSeconds = seconds;
+ this.isNameShow = isNameShow;
+ OnGetItemShowEvent?.Invoke();
+ if (!UIManager.Instance.IsOpenedInList<T>())
+ {
+ UIManager.Instance.OpenWindow<T>();
+ }
+ }
+ public void ClearGetItem()
+ {
+ //涓嶆竻鐞嗙墿鍝侊紝涓嬫鏀跺埌鏁版嵁浼氳嚜鍔ㄦ竻鐞嗭紝鍙敼浜嬩欢鏂逛究鎵撳紑鐣岄潰娴嬭瘯
+ getItemEventName = "";
+ }
+ }
+}
+
diff --git a/Main/System/KnapSack/Logic/ItemLogicUtility.cs.meta b/Main/System/KnapSack/Logic/ItemLogicUtility.cs.meta
new file mode 100644
index 0000000..9b7cfa3
--- /dev/null
+++ b/Main/System/KnapSack/Logic/ItemLogicUtility.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: ca708e003b212e14995ca16b2a0798b2
+timeCreated: 1513505543
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/KnapSack/Logic/ItemModel.cs b/Main/System/KnapSack/Logic/ItemModel.cs
new file mode 100644
index 0000000..0a3c50d
--- /dev/null
+++ b/Main/System/KnapSack/Logic/ItemModel.cs
@@ -0,0 +1,189 @@
+锘縰sing vnxbqy.UI;
+using System;
+using System.Collections.Generic;
+
+
+namespace vnxbqy.UI
+{
+ public class ItemModel
+ {
+ public readonly PackType packType;
+
+ public ItemConfig config { get; private set; }
+ public ItemInfo itemInfo { get; private set; }
+ public int score { get; private set; }
+ public Dictionary<int, List<int>> useDataDict { get; private set; }
+
+ public string guid { get { return itemInfo == null ? string.Empty : itemInfo.guid; } }
+ public int itemId { get { return itemInfo == null ? 0 : itemInfo.itemId; } }
+ public int count { get { return itemInfo == null ? 0 : itemInfo.count; } }
+ public int gridIndex { get { return itemInfo == null ? 0 : itemInfo.index; } }
+ public bool isAuction { get { return itemInfo == null ? false : itemInfo.isAuction == 1; } }
+ public int preItemCount { get; private set; }
+
+ public int auctionSurplusTime {
+
+ get {
+ return 0;
+ /*
+ var createTime = GetUseDataFirstValue(50);
+ if (createTime > 0)
+ {
+ var overdueTime = TimeUtility.GetTime((uint)createTime) + new TimeSpan(GeneralDefine.acutionItemHour * TimeSpan.TicksPerHour);
+ return (int)(overdueTime).Subtract(TimeUtility.ServerNow).TotalSeconds;
+ }
+ else
+ {
+ return 0;
+ }
+ */
+ }
+ }
+
+ public int overdueSurplusTime {
+ get {
+ var surplusTime = 0;
+ if (config.ExpireTime > 0)
+ {
+ var createTime = GetUseDataFirstValue((int)ItemUseDataKey.createTime);
+ if (createTime > 0)
+ {
+ var seconds = GetUseDataFirstValue(48);
+ var overdueTime = DateTime.Now;
+ if (seconds != 0)
+ {
+ overdueTime = TimeUtility.GetTime((uint)createTime).AddSeconds(seconds);
+ }
+ else
+ {
+ overdueTime = TimeUtility.GetTime((uint)createTime).AddSeconds(config.ExpireTime);
+ }
+
+ surplusTime = (int)(overdueTime).Subtract(TimeUtility.ServerNow).TotalSeconds;
+ }
+ }
+
+ return surplusTime;
+ }
+ }
+
+ public ItemModel(PackType type, ItemInfo info)
+ {
+ packType = type;
+ SetItemInfo(info);
+ }
+
+ public void SetItemInfo(ItemInfo info)
+ {
+ if (itemInfo != null)
+ {
+ preItemCount = itemInfo.count;
+ }
+
+ itemInfo = info;
+ config = ItemConfig.Get(info.itemId);
+ useDataDict = ConfigParse.Analysis(info.userData);
+
+ var customCount = GetUseDataFirstValue((int)ItemUseDataKey.itemCount);
+ if (customCount > 0)
+ {
+ itemInfo.count = customCount;
+ }
+
+ if (config.ExpireTime > 0)
+ {
+ var createTime = GetUseDataFirstValue((int)ItemUseDataKey.createTime);
+ if (createTime > 0)
+ {
+ var serverSurplusTime = GetUseDataFirstValue(48);
+ //ItemLogicUtility.Instance.SetItemEffectCDTime(info.guid, info.itemId, createTime, serverSurplusTime);
+ }
+ }
+
+ this.score = info.gearScore;//ItemLogicUtility.Instance.GetEquipScore(itemId, useDataDict);
+ }
+
+ public void RefreshCount(int count)
+ {
+ if (itemInfo != null)
+ {
+ preItemCount = itemInfo.count;
+ }
+
+ itemInfo.count = count;
+ }
+
+ public List<int> GetUseData(int key)
+ {
+ List<int> list = null;
+ if (useDataDict != null)
+ {
+ useDataDict.TryGetValue(key, out list);
+ }
+
+ return list;
+ }
+
+ public int GetUseDataFirstValue(int key)
+ {
+ if (useDataDict != null && useDataDict.ContainsKey(key) && useDataDict[key].Count > 0)
+ {
+ return useDataDict[key][0];
+ }
+
+ return 0;
+ }
+
+ }
+
+ public class ItemInfo
+ {
+ public int index; //浣嶇疆绱㈠紩
+
+ public int itemId;
+
+ public int count; //鐗╁搧鏁伴噺
+
+ public int isAuction;//鏄惁鎷嶅搧
+
+ public int remainHour; //鍓╀綑鏃堕棿(灏忔椂)
+
+ public string userData;//size = UserDataLen
+
+ public string guid; //鐗╁搧鐨勫疄渚婭D
+ public int gearScore; //璇勫垎
+
+ public ItemInfo()
+ {
+
+ }
+
+ public ItemInfo(H0725_tagRolePackRefreshEx.tagRoleItemRefresh serverItem)
+ {
+ itemId = (int)serverItem.ItemID;
+ index = serverItem.ItemPlace;
+ count = serverItem.ItemCount;
+ remainHour = (int)serverItem.RemainHour;
+ userData = serverItem.UserData;
+ guid = serverItem.ItemGUID;
+ isAuction = serverItem.IsBind;
+ gearScore = (int)serverItem.GearScore;
+ }
+
+ public ItemInfo(H0704_tagRolePackRefresh serverItem)
+ {
+ itemId = (int)serverItem.ItemID;
+ index = serverItem.ItemPlace;
+ count = serverItem.ItemCount;
+ remainHour = (int)serverItem.RemainHour;
+ userData = serverItem.UserData;
+ guid = serverItem.ItemGUID;
+ isAuction = serverItem.IsBind;
+ gearScore = (int)serverItem.GearScore;
+ }
+
+ }
+}
+
+
+
diff --git a/Main/System/KnapSack/Logic/ItemModel.cs.meta b/Main/System/KnapSack/Logic/ItemModel.cs.meta
new file mode 100644
index 0000000..61300d5
--- /dev/null
+++ b/Main/System/KnapSack/Logic/ItemModel.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: b9fb4d25c6b9272468dd81a88c29c251
+timeCreated: 1513489118
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/KnapSack/Logic/PackModel.cs b/Main/System/KnapSack/Logic/PackModel.cs
new file mode 100644
index 0000000..5b6763c
--- /dev/null
+++ b/Main/System/KnapSack/Logic/PackModel.cs
@@ -0,0 +1,1899 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using UnityEngine;
+using LitJson;
+using System.Text.RegularExpressions;
+using System.Collections;
+
+namespace vnxbqy.UI
+{
+ public class PackModel : ManagerBase<PackModel>
+ //public class PackModel : Model, IBeforePlayerDataInitialize, IAfterPlayerDataInitialize, IPlayerLoginOk
+ {
+ public static string StrengthAttrShift_RecordKey = "";
+ public const string RecordKnapsackTitle = "RecordKnapsackTitle";
+
+ Dictionary<int, int> DrugToDungeonDict { get; set; } //key 涓硅嵂ID,value鍓湰ID
+ Dictionary<int, int[]> DungeonToDrugDict { get; set; } //key 鍓湰ID,value涓硅嵂ID鍒楄〃
+ //public List<AttrFruitConfig> makeDruglist { get; private set; }
+ Dictionary<int, Dictionary<int, int>> decomposeAttrDict = new Dictionary<int, Dictionary<int, int>>();
+ string RoleEquipLocalSave = "";
+ List<int> LocalSavePlaceArray { get; set; }
+ Dictionary<int, List<int>> sharedUseCountItemDict { get; set; }
+ bool isUpdatePlayerLv = false;
+
+ //AlchemyModel alchemyModel { get { return ModelCenter.Instance.GetModel<AlchemyModel>(); } }
+ //ItemTipsModel itemTipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
+
+ public int lsItemID = 150; //鍙厬鎹㈢殑鐏电煶鐗╁搧ID
+ int lsItemCnt = 0;
+ List<string> commonShowAwardEvents = new List<string>();
+
+ public int[] autoUseItemIDs;
+ UIEffect lingshiEffect; //鐏电煶鐗规晥
+ public override void Init()
+ {
+ ParseConfig();
+ //SysNotifyMgr.Instance.sysNotifyEvent += RefreshSysInfo;
+ // List<DungeonOpenTimeConfig> dungeonlist = DungeonOpenTimeConfig.GetValues();
+ // if (dungeonlist != null)
+ // {
+ // //DrugToDungeonDict = new Dictionary<int, int>();
+ // DungeonToDrugDict = new Dictionary<int, int[]>();
+
+ // for (int i = 0; i < dungeonlist.Count; i++)
+ // {
+ // int[] drugIdlist = dungeonlist[i].ElixirHint;
+ // if (drugIdlist != null && drugIdlist.Length > 0)
+ // {
+ // DungeonToDrugDict.Add(dungeonlist[i].DataMapID, drugIdlist);
+ // //for (int j = 0; j < drugIdlist.Length; j++)
+ // //{
+ // // DrugToDungeonDict.Add(drugIdlist[j], dungeonlist[i].DataMapID);
+ // //}
+ // }
+ // }
+ // }
+
+ // makeDruglist = new List<AttrFruitConfig>();
+ // List<AttrFruitConfig> fruitlist = AttrFruitConfig.GetValues();
+ // for (int i = 0; i < fruitlist.Count; i++)
+ // {
+ // if (fruitlist[i].FuncID == 2)
+ // {
+ // makeDruglist.Add(fruitlist[i]);
+ // }
+ // }
+ // StageLoad.Instance.onStageLoadFinish += OnStageLoadFinish;
+
+ SetDevourEquipPlace();
+
+ // decomposeAttrDict.Clear();
+ // List<EquipDeComposeConfig> decomlist = EquipDeComposeConfig.GetValues();
+ // for (int i = 0; i < decomlist.Count; i++)
+ // {
+ // JsonData attrData = JsonMapper.ToObject(decomlist[i].Attr);
+ // Dictionary<int, int> attrDict = new Dictionary<int, int>();
+ // decomposeAttrDict.Add(decomlist[i].LV, attrDict);
+ // foreach (var id in attrData.Keys)
+ // {
+ // attrDict.Add(int.Parse(id), int.Parse(attrData[id].ToString()));
+ // }
+ // }
+
+ FuncConfigConfig equipDecompose = FuncConfigConfig.Get("EquipDevourCount");
+ minDecomposeNum = int.Parse(equipDecompose.Numerical1);
+ defaultUnSelectlist = ConfigParse.GetMultipleStr<int>(equipDecompose.Numerical2);
+
+ FuncConfigConfig ShareUseCntItem = FuncConfigConfig.Get("ShareUseCntItem");
+ sharedUseCountItemDict = new Dictionary<int, List<int>>();
+ JsonData shareUseJson = JsonMapper.ToObject(ShareUseCntItem.Numerical1);
+ if (shareUseJson.IsArray)
+ {
+ for (int i = 0; i < shareUseJson.Count; i++)
+ {
+ var idListJson = shareUseJson[i];
+ var idlist = new List<int>();
+ sharedUseCountItemDict.Add(i, idlist);
+ foreach (var id in idListJson)
+ {
+ idlist.Add(int.Parse(id.ToString()));
+ }
+ }
+ }
+
+ ParseItemCount();
+
+ autoUseItemIDs = JsonMapper.ToObject<int[]>(FuncConfigConfig.Get("ItemTipsNum").Numerical2);
+ }
+
+
+ public override void Release()
+ {
+FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChangeEvent;
+ // SysNotifyMgr.Instance.sysNotifyEvent -= RefreshSysInfo;
+ }
+
+ public Dictionary<int, string> textCountShow = new Dictionary<int, string>();
+ public int[] textCountShow2;
+ public List<int> gameCashShow = new List<int>();
+
+ public void ParseItemCount()
+ {
+ var textConfig = FuncConfigConfig.Get("ItemCountShow");
+ var json = JsonMapper.ToObject(textConfig.Numerical1);
+ foreach (var key in json.Keys)
+ {
+ var itemID = int.Parse(key);
+ textCountShow[itemID] = json[key].ToString();
+ }
+
+ textCountShow2 = JsonMapper.ToObject<int[]>(textConfig.Numerical2);
+ gameCashShow = JsonMapper.ToObject<List<int>>(textConfig.Numerical3);
+ }
+
+
+ private void OnFuncStateChangeEvent(int id)
+ {
+ if (id == (int)FuncOpenEnum.EquipDecompose)
+ {
+ EquipDecomRedCtrl();
+ }
+ }
+ public void OnBeforePlayerDataInitialize()
+ {
+ GlobalTimeEvent.Instance.secondEvent -= UpdateSecond;
+ PlayerDatas.Instance.playerDataRefreshEvent -= UpdatePlayerLv;
+ LocalSave.DeleteKey(RecordKnapsackTitle);
+ cacheMapId = 0;
+ playerPackDict.Clear();
+ itemDayUseCntDict.Clear();
+ itemSumUseCntDict.Clear();
+ itemGUIDDict.Clear();
+ isPlayBetterEquipEffect = false;
+ colorType = EquipColorType.Orange;
+ decomposeLv = 1;
+ decomposeExp = 0;
+ decomposeProgress = 0;
+ isAutoDecompose = false;
+ }
+
+ public void OnAfterPlayerDataInitialize()
+ {
+
+ }
+
+ public void OnPlayerLoginOk()
+ {
+ //ItemOperateUtility.Instance.RequestWarehouseData();
+ EquipDecomRedCtrl();
+ RoleEquipLocalSave = StringUtility.Contact("RoleEquipLocalSave", PlayerDatas.Instance.baseData.PlayerID);
+ StrengthAttrShift_RecordKey = StringUtility.Contact(PlayerDatas.Instance.baseData.PlayerID, "StrengthAttrShift");
+ if (LocalSave.GetIntArray(RoleEquipLocalSave) != null)
+ {
+ LocalSavePlaceArray = LocalSave.GetIntArray(RoleEquipLocalSave).ToList();
+ }
+ else
+ {
+ LocalSavePlaceArray = null;
+ }
+ GlobalTimeEvent.Instance.secondEvent += UpdateSecond;
+ PlayerDatas.Instance.playerDataRefreshEvent += UpdatePlayerLv;
+ isUpdatePlayerLv = true;
+ FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent;
+ }
+
+ private void RefreshSysInfo(string key, ArrayList infolist)
+ {
+ // if (key != "GetMoney") return;
+ // if (ItemLogicUtility.Instance.hidePickItem)
+ // return;
+
+ // if (PlayerDatas.Instance.baseData.LV < 3)
+ // return;
+
+ // var type = 0;
+ // int.TryParse(infolist[0].ToString(), out type);
+ // if (type == 1)
+ // {
+ // Vector3 pos = new Vector3(-100, 0, 0);
+ // Vector3 rot = new Vector3(0, 0, 0);
+ // if (!WindowCenter.Instance.IsOpen<MainInterfaceWin>())
+ // {
+ // pos = new Vector3(0, 50, 0);
+ // rot = new Vector3(180, 180, 0);
+ // }
+ // EffectMgr.Instance.PlayUIEffect(1204, 3000, WindowCenter.Instance.uiRoot.tipsCanvas, pos, rot, false);
+ // }
+ // else if (type == 2)
+ // {
+ // Vector3 pos = new Vector3(-100, 0, 0);
+ // Vector3 rot = new Vector3(0, 0, 0);
+ // if (!WindowCenter.Instance.IsOpen<MainInterfaceWin>())
+ // {
+ // pos = new Vector3(150, 50, 0);
+ // rot = new Vector3(180, 180, 0);
+ // }
+ // lingshiEffect = EffectMgr.Instance.PlayUIEffect(1158, 3000, WindowCenter.Instance.uiRoot.tipsCanvas, pos, rot, false);
+ // }
+ }
+
+ public event Action<PackType> refrechPackEvent; //鍒锋柊鏁翠釜鑳屽寘鏁版嵁
+ public event Action<PackType, int, int> refreshItemCountEvent; // 鎱庣敤浼氬崱锛堝崟涓級鏈�鏂扮墿鍝佹暟閲忓埛鏂�(鏃х殑寮冪敤)鍦ㄥ緱鍒版柊鐗╁搧銆佺墿鍝佹暟閲忕殑鏀瑰彉锛屾竻鐞嗚鐗╁搧鏃跺潎浼氳Е鍙� int 浣嶇疆绱㈠紩 int鐗╁搧id
+ public event Action<PackType> gridRefreshEvent; //鑳屽寘绌烘牸鍒锋柊
+ public event Action<PackType, int, int> itemCntAddEvent; //鐗╁搧鏁伴噺澧炲姞 int 浣嶇疆绱㈠紩 int鐗╁搧id
+ public event Action<PackType, int, int> itemCntReduceEvent; //鐗╁搧鏁伴噺鍑忓皯鐨勬敼鍙� int 浣嶇疆绱㈠紩 int鐗╁搧id
+ public event Action<int, int> useItemSuccessEvent; //鐗╁搧浣跨敤鎴愬姛 int 浣嶇疆绱㈠紩 int鐗╁搧id
+
+ public event Action<int> refreshItemDayUseCountEvent; //鍒锋柊鐗╁搧姣忔棩浣跨敤鏁伴噺
+ public event Action<int> refreshItemSumUseCountEvent; //鍒锋柊鐗╁搧鎬讳娇鐢ㄦ暟閲�
+
+ public bool isPlayBetterEquipEffect { get; set; } //鏁寸悊鑳屽寘鏃舵槸鍚︽挱鏀剧壒鏁�
+
+ #region 鎺ユ敹鏈嶅姟绔暟鎹�
+ private Dictionary<PackType, SinglePack> playerPackDict = new Dictionary<PackType, SinglePack>();
+ private Dictionary<string, ItemModel> itemGUIDDict = new Dictionary<string, ItemModel>();
+
+ public void UpdatePack(H0725_tagRolePackRefreshEx packInfo)
+ {
+ SetLookIndex(null);
+ var packType = (PackType)packInfo.PackType;
+ if (!playerPackDict.ContainsKey(packType))
+ {
+ playerPackDict.Add(packType, new SinglePack(packType));
+ }
+
+ if (isPlayBetterEquipEffect)
+ {
+ ItemLogicUtility.Instance.ClearSortedBetterEquip();
+ }
+
+ for (int i = 0; i < packInfo.ItemCount; i++)
+ {
+ var itemInfo = new ItemInfo(packInfo.ItemInfo[i]);
+ var item = playerPackDict[packType].UpdateItem(itemInfo);
+ AddItemGUIDDict(item, false);
+
+ if (isPlayBetterEquipEffect)
+ {
+ ItemLogicUtility.Instance.SetBagSortBetterEquipList(GetItemByGuid(itemInfo.guid));
+ }
+ }
+
+ if (refrechPackEvent != null)
+ {
+ refrechPackEvent(packType);
+ }
+
+ UpdatePackRedpoint(packType);
+ }
+
+ public void UpdateItem(H0704_tagRolePackRefresh serverItem)
+ {
+ isPlayBetterEquipEffect = false;
+ SetLookIndex(null);
+ PackType type = (PackType)serverItem.PackType;
+ if (!playerPackDict.ContainsKey(type))
+ {
+ playerPackDict.Add(type, new SinglePack(type));
+ }
+
+ var showNewItem = false;
+ if (itemGUIDDict.ContainsKey(serverItem.ItemGUID))
+ {
+ var prePack = itemGUIDDict[serverItem.ItemGUID].packType;
+ var preAuction = itemGUIDDict[serverItem.ItemGUID].isAuction;
+ var nowPackType = type;
+ var nowAcution = serverItem.IsBind == 1;
+ showNewItem = preAuction != nowAcution || prePack != nowPackType;
+ }
+ else
+ {
+ showNewItem = true;
+ }
+
+ var itemInfo = new ItemInfo(serverItem);
+ var item = playerPackDict[type].UpdateItem(itemInfo);
+ AddItemGUIDDict(item, showNewItem);
+
+ if (refreshItemCountEvent != null)
+ {
+ refreshItemCountEvent(type, itemInfo.index, itemInfo.itemId);
+ }
+
+ if (itemCntAddEvent != null)
+ {
+ itemCntAddEvent(type, itemInfo.index, itemInfo.itemId);
+ }
+
+ // if (type == PackType.Equip)
+ // {
+ // if (ItemLogicUtility.Instance.IsRealmEquip(itemInfo.itemId))
+ // {
+ // ItemOperateUtility.Instance.ShowPutOnNewEquipRemind(itemInfo.itemId);
+ // }
+ // }
+
+ UpdatePackRedpoint(type);
+ //EquipDecomRedCtrl();
+ m_CheckEquipDecomRedCtrl = true;
+ AutoUseItem(itemInfo.itemId, serverItem.ItemGUID);
+ }
+
+
+ bool m_CheckEquipDecomRedCtrl = false;
+ void CheckEquipDecomRedCtrl()
+ {
+ if (m_CheckEquipDecomRedCtrl)
+ {
+ EquipDecomRedCtrl();
+ m_CheckEquipDecomRedCtrl = false;
+ }
+ }
+
+
+ public void UpdateUnlockedGridCount(H0724_tagRolePackCanUseCount useCount)
+ {
+ PackType type = (PackType)useCount.PackType;
+ if (!playerPackDict.ContainsKey(type))
+ {
+ playerPackDict.Add(type, new SinglePack(type));
+ }
+
+ playerPackDict[type].SetOpenGridCount(useCount.CanUseCount);
+
+ if (gridRefreshEvent != null)
+ {
+ gridRefreshEvent(type);
+ }
+
+ UpdatePackRedpoint(type);
+ }
+
+ public void RefreshItemCount(H0707_tagItemCountRefresh refresh)
+ {
+ SetLookIndex(null);
+ isPlayBetterEquipEffect = false;
+ PackType type = (PackType)refresh.PackType;
+ SinglePack singlePack = null;
+ playerPackDict.TryGetValue(type, out singlePack);
+
+ if (singlePack != null)
+ {
+ ItemModel itemModel = singlePack.GetItemByIndex(refresh.ItemIndex);
+ if (itemModel != null)
+ {
+ bool isAddItemCount = false;
+ if (refresh.ItemCount > itemModel.count)
+ {
+ isAddItemCount = true;
+ }
+ itemModel.RefreshCount(refresh.ItemCount);
+
+ if (isAddItemCount)
+ {
+ if (itemCntAddEvent != null)
+ {
+ itemCntAddEvent(type, itemModel.gridIndex, itemModel.itemId);
+ }
+ ItemLogicUtility.Instance.RecommendItem(itemModel);
+ ItemLogicUtility.Instance.RefreshPickItem(type, itemModel.itemId.ToString());
+ }
+ else
+ {
+ if (itemCntReduceEvent != null)
+ {
+ itemCntReduceEvent(type, itemModel.gridIndex, itemModel.itemId);
+ }
+ }
+
+ if (refreshItemCountEvent != null)
+ {
+ refreshItemCountEvent(type, itemModel.gridIndex, itemModel.itemId);
+ }
+
+ UpdateLSRedpoint(type, itemModel.itemId);
+ }
+ }
+
+ }
+
+ public void ClearPack(H0711_tagClearItemPack clearPack)
+ {
+ PackType type = (PackType)clearPack.PackIndex;
+ SinglePack singlePack = null;
+ playerPackDict.TryGetValue(type, out singlePack);
+ if (singlePack != null)
+ {
+ singlePack.Clear();
+ }
+ }
+
+ public void RemoveItem(H0709_tagClearItem clearItem)
+ {
+ isPlayBetterEquipEffect = false;
+ SetLookIndex(null);
+ PackType type = (PackType)clearItem.PackType;
+
+ SinglePack singlePack = null;
+ playerPackDict.TryGetValue(type, out singlePack);
+ string guid = "";
+ if (singlePack != null)
+ {
+ ItemModel itemModel = singlePack.GetItemByIndex(clearItem.ItemIndex);
+ guid = itemModel.guid;
+ int itemId = itemModel.itemId;
+
+ DeleteItemDictByGUID(type, itemModel.guid);
+
+ singlePack.RemoveItem(clearItem.ItemIndex);
+ if (refreshItemCountEvent != null)
+ {
+ refreshItemCountEvent(type, clearItem.ItemIndex, itemId);
+ }
+
+ if (itemCntReduceEvent != null)
+ {
+ itemCntReduceEvent(type, clearItem.ItemIndex, itemId);
+ }
+ }
+
+ UpdatePackRedpoint(type);
+ m_CheckEquipDecomRedCtrl = true;
+ //EquipDecomRedCtrl();
+
+ if (GetItemByGuid(guid) == null)
+ {
+ KnapsackTimeCDMgr.Instance.UnRegister(guid);
+ }
+
+ }
+
+ public void PackResetOk(H0316_tagPackResetOK packreset)
+ {
+ ItemLogicUtility.Instance.isPackResetOk = true;
+ }
+
+ public void UseItemSuccess(H0706_tagUseItemSuccess success)
+ {
+ isPlayBetterEquipEffect = false;
+ SetLookIndex(null);
+ if (success.PlayerID != PlayerDatas.Instance.baseData.PlayerID)
+ {
+ return;
+ }
+
+ MakeUseItemSuccess(success.ItemIndex, (int)success.ItemID);
+ switch (success.ItemID)
+ {
+ // case 221:
+ // if (WindowCenter.Instance.IsOpen<KnapSackWin>())
+ // {
+ // WindowCenter.Instance.Close<KnapSackWin>();
+ // }
+ // break;
+ }
+
+ if (useItemSuccessEvent != null)
+ {
+ useItemSuccessEvent(success.ItemIndex, (int)success.ItemID);
+ }
+ }
+
+ void AutoUseItem(int itemID, string guid)
+ {
+ // if (autoUseItemIDs.Contains(itemID))
+ // {
+ // ItemOperateUtility.Instance.GotoUseItem(guid);
+ // }
+ }
+
+ private void MakeUseItemSuccess(int index, int id)
+ {
+ ItemConfig itemConfig = ItemConfig.Get(id);
+ if (itemConfig.CDType != 0)
+ {
+ var items = GetItems(PackType.Item, new SinglePack.FilterParams()
+ {
+ itemTypes = new List<int>() { (int)ItemType.Buff }
+ });
+
+ for (int i = 0; i < items.Count; i++)
+ {
+ if (ItemLogicUtility.Instance.drugIDs.Contains(items[i].itemId))
+ {
+ itemConfig = ItemConfig.Get(items[i].itemId);
+ float configCdTime = (float)Math.Round((double)itemConfig.CDTime / 1000, 1);
+ KnapsackTimeCDMgr.Instance.Register(items[i].guid, items[i].itemId, configCdTime);
+ }
+ }
+
+ }
+ }
+
+ void AddItemGUIDDict(ItemModel itemModel, bool showNewItem)
+ {
+ itemGUIDDict[itemModel.guid] = itemModel;
+ GetItemEventCtrl(itemModel, showNewItem);
+ }
+
+ void DeleteItemDictByGUID(PackType type, string guid)
+ {
+ if (itemGUIDDict.ContainsKey(guid))
+ {
+ if (itemGUIDDict[guid].packType == type)
+ {
+ itemGUIDDict.Remove(guid);
+ }
+ }
+ }
+
+ /// <summary>
+ /// 鐗╁搧姣忔棩浣跨敤鐨勬鏁�
+ /// </summary>
+ private Dictionary<int, int> itemDayUseCntDict = new Dictionary<int, int>();
+ public void UpdateItemUseCnt(HA809_tagMCItemDayUseCntInfo useCntInfo)
+ {
+ for (int i = 0; i < useCntInfo.Count; i++)
+ {
+ int itemId = (int)useCntInfo.ItemUseCntList[i].ItemID;
+ int cnt = useCntInfo.ItemUseCntList[i].UseCnt;
+ if (!itemDayUseCntDict.ContainsKey(itemId))
+ {
+ itemDayUseCntDict.Add(itemId, cnt);
+ }
+ else
+ {
+ itemDayUseCntDict[itemId] = cnt;
+ }
+
+ if (refreshItemDayUseCountEvent != null)
+ {
+ refreshItemDayUseCountEvent(itemId);
+ }
+
+ }
+ }
+
+ private Dictionary<int, int> itemSumUseCntDict = new Dictionary<int, int>();
+ // public void UpdateItemSumUseCnt(HA339_tagMCAttrFruitEatCntList useCntInfo)
+ // {
+ // for (int i = 0; i < useCntInfo.count; i++)
+ // {
+ // int itemId = (int)useCntInfo.EatCntList[i].ItemID;
+ // int cnt = (int)useCntInfo.EatCntList[i].EatCnt;
+ // if (!itemSumUseCntDict.ContainsKey(itemId))
+ // {
+ // itemSumUseCntDict.Add(itemId, cnt);
+ // }
+ // else
+ // {
+ // itemSumUseCntDict[itemId] = cnt;
+ // }
+
+ // if (refreshItemSumUseCountEvent != null)
+ // {
+ // refreshItemSumUseCountEvent(itemId);
+ // }
+ // }
+ // }
+
+ #endregion
+
+ #region 鐜╁瑁呭鐗规畩閫昏緫
+ public Dictionary<int, Dictionary<int, int>> spiritWeaponPathIds { get; private set; }
+ public Dictionary<int, int> wingsGetPathIdDict { get; private set; }
+ public Dictionary<int, List<int>> dungeonUseDict { get; private set; }
+ void ParseConfig()
+ {
+ FuncConfigConfig funcConfig = FuncConfigConfig.Get("WingYuPeiHQTJ");
+ spiritWeaponPathIds = new Dictionary<int, Dictionary<int, int>>();
+ var splits = funcConfig.Numerical3.Split('|');
+ for (int i = 0; i < splits.Length; i++)
+ {
+ var tempString = splits[i];
+ var matches = Regex.Matches(tempString.Trim(), "\\d+");
+ var equipPlace = int.Parse(matches[0].Value);
+ var job = int.Parse(matches[1].Value);
+ var itemId = int.Parse(matches[2].Value);
+
+ if (!spiritWeaponPathIds.ContainsKey(equipPlace))
+ {
+ spiritWeaponPathIds[equipPlace] = new Dictionary<int, int>();
+ }
+
+ spiritWeaponPathIds[equipPlace][job] = itemId;
+ }
+
+ FuncConfigConfig copyItemBulletWindow = FuncConfigConfig.Get("CopyItemBulletWindow");
+ JsonData copyWinData = JsonMapper.ToObject(copyItemBulletWindow.Numerical1);
+ dungeonUseDict = new Dictionary<int, List<int>>();
+ foreach (var dungeonId in copyWinData.Keys)
+ {
+ List<int> idlist = new List<int>();
+ dungeonUseDict.Add(int.Parse(dungeonId), idlist);
+ if (copyWinData[dungeonId].IsArray)
+ {
+ JsonData useData = copyWinData[dungeonId];
+ for (int i = 0; i < useData.Count; i++)
+ {
+ idlist.Add(int.Parse(useData[i].ToString()));
+ }
+ }
+ }
+
+ lsItemCnt = int.Parse(FuncConfigConfig.Get("LingshiShowCount").Numerical1);
+ var config = FuncConfigConfig.Get("CommonShowAwards");
+ commonShowAwardEvents = JsonMapper.ToObject<List<string>>(config.Numerical1);
+
+ }
+
+ public int GetRoleEquipPathId(int equipPlace)
+ {
+ int playerJob = PlayerDatas.Instance.baseData.Job;
+ switch ((RoleEquipType)equipPlace)
+ {
+ case RoleEquipType.Guard:
+ case RoleEquipType.PeerlessWeapon1:
+ case RoleEquipType.PeerlessWeapon2:
+ case RoleEquipType.Wing:
+ return spiritWeaponPathIds[equipPlace][playerJob];
+ default:
+ return 0;
+ }
+ }
+
+ private void UpdateSecond()
+ {
+ if (isUpdatePlayerLv)
+ {
+ isUpdatePlayerLv = false;
+ }
+ CheckEquipDecomRedCtrl();
+ }
+
+ private void UpdatePlayerLv(PlayerDataType type)
+ {
+ if (type != PlayerDataType.LV) return;
+
+ isUpdatePlayerLv = true;
+ }
+
+ #endregion
+
+
+ private void GetItemEventCtrl(ItemModel itemModel, bool showNewItem)
+ {
+ // if (showNewItem)
+ // {
+ // bool isOverdue = false;
+ // if (itemModel.config.ExpireTime > 0)
+ // {
+ // ItemCDCool cool = KnapsackTimeCDMgr.Instance.GetItemCoolById(itemModel.guid);
+ // switch ((ItemTimeType)itemModel.config.EndureReduceType)
+ // {
+ // case ItemTimeType.EquipedTime:
+ // List<int> itemEffectTime = itemModel.GetUseData((int)ItemUseDataKey.createTime);
+ // if (itemEffectTime != null && itemEffectTime[0] != 0)
+ // {
+ // if (cool == null || cool.GetRemainTime() <= 0)
+ // {
+ // isOverdue = true;
+ // }
+ // }
+ // break;
+
+ // case ItemTimeType.RealityTime:
+ // if (cool == null || cool.GetRemainTime() <= 0)
+ // {
+ // isOverdue = true;
+ // }
+ // break;
+
+ // }
+ // }
+
+ // if (!isOverdue)
+ // {
+ // ItemLogicUtility.Instance.RecommendItem(itemModel);
+ // ItemLogicUtility.Instance.OnGetEquip(itemModel);
+ // ItemLogicUtility.Instance.RefreshPickItem(itemModel.packType, itemModel.itemId.ToString());
+ // }
+ // }
+
+ }
+
+ /// <summary>
+ /// 寰楀埌鏌愪釜鍖呰9鐨勬墍鏈夋暟鎹�
+ /// </summary>
+ /// <param name="type"></param>
+ /// <returns></returns>
+ public SinglePack GetSinglePack(PackType type)
+ {
+ SinglePack singlePack = null;
+ playerPackDict.TryGetValue(type, out singlePack);
+ return singlePack;
+ }
+
+ public void UnLockPackGrid(int chooseGridCount, PackType type)
+ {
+ // var singlePack = GetSinglePack(type);
+ // int openCount = chooseGridCount - singlePack.unlockedGridCount;
+ // int index = 0;
+ // switch (type)
+ // {
+ // case PackType.Item:
+ // index = chooseGridCount - GeneralDefine.initBagGridCount;
+ // break;
+ // case PackType.Warehouse:
+ // index = chooseGridCount - GeneralDefine.initDepotGridCount;
+ // break;
+ // }
+
+ // itemTipsModel.SetExtendGirdModel(openCount, index, type);
+ // WindowCenter.Instance.Open<ExtendWin>();
+ }
+
+ public ItemModel GetItemByGuid(string guid)
+ {
+ if (string.IsNullOrEmpty(guid))
+ {
+ return null;
+ }
+
+ ItemModel itemModel = null;
+ itemGUIDDict.TryGetValue(guid, out itemModel);
+ return itemModel;
+ }
+
+ public ItemModel GetItemByIndex(PackType type, int index)
+ {
+ ItemModel itemModel = null;
+ if (playerPackDict.ContainsKey(type))
+ {
+ itemModel = playerPackDict[type].GetItemByIndex(index);
+ }
+ return itemModel;
+ }
+
+ /// <summary>
+ /// 鑾峰彇鎸囧畾鑳屽寘鍐� 鎸囧畾ID鐨勬墍鏈夌墿鍝�
+ /// </summary>
+ /// <param name="type"></param>
+ /// <param name="id"></param>
+ /// <param name="includeAuction"></param>
+ /// <returns></returns>
+ public List<ItemModel> GetItemsById(PackType type, int id, bool includeAuction = true)
+ {
+ if (playerPackDict.ContainsKey(type))
+ {
+ var singlePack = playerPackDict[type];
+ return singlePack.GetItemsById(id, includeAuction);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ /// <summary>
+ /// 鑾峰彇鎸囧畾鑳屽寘鍐呮寚瀹欼D鐨勪竴涓墿鍝�
+ /// </summary>
+ /// <param name="type"></param>
+ /// <param name="id"></param>
+ /// <param name="includeAuction"></param>
+ /// <returns></returns>
+ public ItemModel GetItemByID(PackType type, int id, bool includeAuction = true)
+ {
+ if (playerPackDict.ContainsKey(type))
+ {
+ var singlePack = playerPackDict[type];
+ return singlePack.GetItemByID(id, includeAuction);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public List<ItemModel> GetItems(PackType packType, SinglePack.FilterParams param)
+ {
+ if (playerPackDict.ContainsKey(packType))
+ {
+ return playerPackDict[packType].GetItems(param);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ //閫氳繃id鎵剧墿鍝侊紝娉ㄦ剰妫�鏌ユ槸鍚︽寚瀹氳儗鍖�
+ public string GetItemGUIDByID(int itemId, bool includeAuction = true, PackType packType = PackType.Item)
+ {
+ string guid = string.Empty;
+ foreach (var key in itemGUIDDict.Keys)
+ {
+ if (!includeAuction && itemGUIDDict[key].isAuction)
+ {
+ continue;
+ }
+
+ if (itemGUIDDict[key].itemId == itemId && packType == itemGUIDDict[key].packType)
+ {
+ guid = key;
+ return guid;
+ }
+ }
+
+ return guid;
+ }
+
+ /// <summary>
+ /// 寰楀埌ID鐩稿悓鐨勭墿鍝佹暟閲�
+ /// </summary>
+ /// <param name="type"></param>
+ /// <param name="id"></param>
+ /// <returns></returns>
+ public int GetItemCountByID(PackType type, int id, bool includeAuction = true)
+ {
+ int count = 0;
+ var singlePack = GetSinglePack(type);
+ if (singlePack != null)
+ {
+ count = singlePack.GetCountById(id, includeAuction);
+ }
+
+ return count;
+ }
+
+ public int GetEmptyGridCount(PackType type)
+ {
+ int count = 0;
+ SinglePack singlePack = GetSinglePack(type);
+ if (singlePack != null)
+ {
+ count = singlePack.GetEmptyGridCount();
+ }
+
+ return count;
+ }
+
+ public bool TryGetShareNumItem(int itemId, out List<int> idlist)
+ {
+ idlist = new List<int>();
+ foreach (var list in sharedUseCountItemDict.Values)
+ {
+ if (list.Contains(itemId))
+ {
+ idlist = list;
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /// <summary>
+ /// 寰楀埌鐗╁搧浠婃棩浣跨敤娆℃暟
+ /// </summary>
+ /// <param name="itemId"></param>
+ /// <returns></returns>
+ public int GetItemUsedTimesToday(int itemId)
+ {
+ int useCnt = 0;
+ List<int> shareIdlist = null;
+ bool isShare = TryGetShareNumItem(itemId, out shareIdlist);
+ if (isShare)
+ {
+ foreach (var id in shareIdlist)
+ {
+ int singleUseCnt = 0;
+ itemDayUseCntDict.TryGetValue(id, out singleUseCnt);
+ useCnt += singleUseCnt;
+ }
+ }
+ else
+ {
+ itemDayUseCntDict.TryGetValue(itemId, out useCnt);
+ }
+ return useCnt;
+ }
+
+ /// <summary>
+ /// 寰楀埌鐗╁搧鎬讳娇鐢ㄦ鏁�
+ /// </summary>
+ /// <param name="itemId"></param>
+ /// <returns></returns>
+ public int GetItemTotalUsedTimes(int itemId)
+ {
+ int useCnt = 0;
+ List<int> shareIdlist = null;
+ bool isShare = TryGetShareNumItem(itemId, out shareIdlist);
+ if (isShare)
+ {
+ foreach (var id in shareIdlist)
+ {
+ int singleUseCnt = 0;
+ itemDayUseCntDict.TryGetValue(id, out singleUseCnt);
+ useCnt += singleUseCnt;
+ }
+ }
+ else
+ {
+ itemSumUseCntDict.TryGetValue(itemId, out useCnt);
+ }
+ return useCnt;
+ }
+
+ public void GotoWashAttributePoint(string guid)
+ {
+ // ItemModel itemModel = GetItemByGuid(guid);
+ // if (itemModel == null) return;
+
+ // WashAttrPointWin.itemModel = itemModel;
+ // WindowCenter.Instance.Open<WashAttrPointWin>();
+ }
+
+ #region 绾㈢偣閫昏緫鍒ゆ柇
+
+ const int ITEMPACK_REDKEY = 102011003;
+ Redpoint redpointItemPack = new Redpoint(MainRedDot.RedPoint_BagFuncKey, ITEMPACK_REDKEY);
+
+ const int LS_REDKEY = 102011015;
+ Redpoint redpointLS = new Redpoint(MainRedDot.RedPoint_BagFuncKey, LS_REDKEY);
+
+ private void UpdateLSRedpoint(PackType type, int itemID)
+ {
+ var singlePack = GetSinglePack(type);
+ if (singlePack == null)
+ {
+ return;
+ }
+ if (type != PackType.Item) return;
+ if (itemID != lsItemID) return;
+
+
+ if (GetItemCountByID(PackType.Item, lsItemID) < lsItemCnt)
+ {
+ redpointLS.state = RedPointState.None;
+ }
+ else
+ {
+ redpointLS.state = RedPointState.Simple;
+ }
+
+ }
+
+ private void UpdatePackRedpoint(PackType type)
+ {
+ var singlePack = GetSinglePack(type);
+ if (singlePack == null)
+ {
+ return;
+ }
+
+ switch (type)
+ {
+ case PackType.Item:
+ if (singlePack.GetEmptyGridCount() <= 0)
+ {
+ redpointItemPack.state = RedPointState.Full;
+ //SysNotifyMgr.Instance.ShowTip("BagFull");
+ }
+ else
+ {
+ redpointItemPack.state = RedPointState.None;
+ }
+ if (GetItemCountByID(PackType.Item, lsItemID) < lsItemCnt)
+ {
+ redpointLS.state = RedPointState.None;
+ }
+ else
+ {
+ redpointLS.state = RedPointState.Simple;
+ }
+ break;
+ case PackType.Warehouse:
+ if (singlePack.GetEmptyGridCount() <= 0)
+ {
+ MainRedDot.Instance.redPointDepotFunc.state = RedPointState.Full;
+ }
+ else
+ {
+ MainRedDot.Instance.redPointDepotFunc.state = RedPointState.None;
+ }
+ break;
+ }
+ }
+
+ const int PLAYERSUMSTAR_REDKEY = 102011002;
+ Redpoint redpointSTAR = new Redpoint(MainRedDot.RedPoint_BagFuncKey, PLAYERSUMSTAR_REDKEY);
+
+ public const int EquipDecompose_RedKey = 10205;
+ public Redpoint redpointEquipDecom = new Redpoint(MainRedDot.RedPoint_MainPackKey, EquipDecompose_RedKey);
+ public void EquipDecomRedCtrl()
+ {
+ if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.EquipDecompose))
+ {
+ return;
+ }
+
+ if (PlayerDatas.Instance.baseData.LV < devourRedpointLevel)
+ {
+ redpointEquipDecom.state = RedPointState.None;
+ return;
+ }
+
+ var canDevourItems = GetCanDevourModellist();
+ if (canDevourItems != null && canDevourItems.Count >= minDevourEquipNum)
+ {
+ redpointEquipDecom.state = RedPointState.Simple;
+ }
+ else
+ {
+ redpointEquipDecom.state = RedPointState.None;
+ }
+ }
+ #endregion
+
+ #region 鏌ョ湅鏌愪釜浣嶇疆鐨勭墿鍝�
+ public event Action lookEquipEvent;
+ private int _lookLineIndex = -1;
+ public int lookLineIndex { get { return _lookLineIndex; } private set { _lookLineIndex = value; } }
+
+ public string lookItemGUID { get; private set; }
+
+ public void SetLookIndex(string guid, int singleRowCount = 5)
+ {
+ if (string.IsNullOrEmpty(guid) || guid == "")
+ {
+ lookLineIndex = -1;
+ lookItemGUID = "";
+ }
+ else
+ {
+ int index = GetItemByGuid(guid).gridIndex;
+ lookLineIndex = index / singleRowCount;
+ lookItemGUID = guid;
+ }
+
+ if (lookEquipEvent != null)
+ {
+ lookEquipEvent();
+ }
+ }
+
+ public event Action RefreshBagEvent;
+ public void RefreshBagInfo()
+ {
+ if (RefreshBagEvent != null)
+ {
+ RefreshBagEvent();
+ }
+ }
+ #endregion
+
+ public void SetJumpToOneKeySell(Transform parent)
+ {
+ // var goEffect = AchievementGuideEffectPool.Require(1);
+ // goEffect.transform.SetParentEx(parent, Vector3.zero, Quaternion.identity, Vector3.one);
+ // AchievementGoto.guideAchievementId = 0;
+ }
+
+ #region 鐗╁搧浣跨敤蹇嵎鎻愮ず
+
+ private int cacheMapId = 0;
+ public event Action<PackType, string> itemUseAct;
+ private Dictionary<int, int> itemUseTypeDict = new Dictionary<int, int>(); //key SkillTypeID,value 浣跨敤鐗╁搧鐨処D
+ private void OnStageLoadFinish()
+ {
+ // itemUseTypeDict.Clear();
+ // if (PlayerDatas.Instance.baseData.MapID == cacheMapId)
+ // {
+ // return;
+ // }
+
+ // cacheMapId = PlayerDatas.Instance.baseData.MapID;
+ // UpdateDungeonDanUse();
+ // UpdateDungeonUse();
+ // SinglePack singlePack = GetSinglePack(PackType.Item);
+ // foreach (int itemId in itemUseTypeDict.Values)
+ // {
+ // var modellist = singlePack.GetItemsById(itemId);
+ // if (modellist.Count > 0)
+ // {
+ // ItemModel itemModel = modellist[0];
+ // bool isExist = StatusMgr.Instance.IsExist(PlayerDatas.Instance.hero.ServerInstID, itemModel.config.AddSkill1);
+ // Debug.Log("Buff鏄惁瀛樺湪" + isExist);
+ // if (itemUseAct != null && !isExist)
+ // {
+ // itemUseAct(PackType.Item, itemModel.guid);
+ // }
+ // }
+ // }
+ }
+
+ private void AddItemUseTypeDict(int id)
+ {
+ SkillConfig skillConfig = GetSkillConfig(id);
+ int itemCount = GetItemCountByID(PackType.Item, id);
+ if (skillConfig != null && itemCount > 0)
+ {
+ if (!itemUseTypeDict.ContainsKey(skillConfig.SkillTypeID))
+ {
+ itemUseTypeDict.Add(skillConfig.SkillTypeID, id);
+ }
+ else
+ {
+ SkillConfig preSkillConfig = GetSkillConfig(itemUseTypeDict[skillConfig.SkillTypeID]);
+ if (skillConfig.SkillLV > preSkillConfig.SkillLV)
+ {
+ itemUseTypeDict[skillConfig.SkillTypeID] = id;
+ }
+ }
+ }
+ }
+
+ private void UpdateDungeonDanUse()
+ {
+ int mapId = PlayerDatas.Instance.baseData.MapID;
+ int[] useDrugs = GetDrugIDListByDungeonID(mapId);
+ if (useDrugs == null) return;
+
+ for (int i = 0; i < useDrugs.Length; i++)
+ {
+ int id = useDrugs[i];
+ AddItemUseTypeDict(id);
+ }
+ }
+
+ private void UpdateDungeonUse()
+ {
+ int mapId = PlayerDatas.Instance.baseData.MapID;
+ if (!dungeonUseDict.ContainsKey(mapId)) return;
+
+ List<int> useIdlist = dungeonUseDict[mapId];
+ for (int i = 0; i < useIdlist.Count; i++)
+ {
+ int id = useIdlist[i];
+ AddItemUseTypeDict(id);
+ }
+ }
+
+ public SkillConfig GetSkillConfig(int itemId)
+ {
+ ItemConfig itemConfig = ItemConfig.Get(itemId);
+ SkillConfig skillConfig = SkillConfig.Get(itemConfig.AddSkill1);
+ return skillConfig;
+ }
+
+ public int GetDungeonIDByDrugID(int drugID)
+ {
+ int dungeonID = 0;
+ //DrugToDungeonDict.TryGetValue(drugID, out dungeonID);
+ return dungeonID;
+ }
+
+ public int[] GetDrugIDListByDungeonID(int dungeonID)
+ {
+ int[] drugIDlist = null;
+ DungeonToDrugDict.TryGetValue(dungeonID, out drugIDlist);
+ return drugIDlist;
+ }
+ #endregion
+
+ #region 鍒ゆ柇鐗╁搧鏄惁杈惧埌浣跨敤涓婇檺
+ // public bool IsReachUseLimit(string guid, out ulong count)
+ // {
+ // count = 0;
+ // ItemModel itemModel = GetItemByGuid(guid);
+ // if (itemModel == null) return false;
+
+ // AttrFruitConfig fruitConfig = AttrFruitConfig.Get(itemModel.itemId);
+ // int haveUseCnt = GetItemUsedTimesToday(itemModel.itemId);
+ // int sumHaveUseCnt = GetItemTotalUsedTimes(itemModel.itemId);
+ // count = (ulong)itemModel.count;
+ // bool isReach = false;
+ // int remainDayCnt = 0;
+ // if (itemModel.config.MaxSkillCnt > 0)
+ // {
+ // remainDayCnt = itemModel.config.MaxSkillCnt - haveUseCnt;
+ // if (itemModel.count > remainDayCnt)
+ // {
+ // count = (ulong)remainDayCnt;
+ // }
+ // }
+
+ // int remainSumCnt = 0;
+ // if (fruitConfig != null)
+ // {
+ // remainSumCnt = fruitConfig.basicUseLimit - sumHaveUseCnt;
+ // if (remainSumCnt <= remainDayCnt && itemModel.count > remainSumCnt)
+ // {
+ // count = (ulong)remainSumCnt;
+ // }
+ // }
+
+ // if (count < (ulong)itemModel.count)
+ // {
+ // isReach = true;
+ // }
+
+ // return isReach;
+ // }
+ #endregion
+
+ #region 鐗╁搧鍚炲櫖閫昏緫澶勭悊
+ public EquipColorType colorType { get; private set; }
+ public event Action<EquipColorType> RefreshColorSelectAct;
+ public event Action RefreshEquipDecomNumAct;
+ public int[] defaultUnSelectlist { get; private set; }
+
+ public int GetBetterEquipCount(List<ItemModel> itemModels)
+ {
+ if (itemModels.IsNullOrEmpty())
+ {
+ return 0;
+ }
+
+ var count = 0;
+ foreach (var item in itemModels)
+ {
+ if (ItemLogicUtility.Instance.IsFightUp(item.itemId, item.score) == 1)
+ {
+ count += item.count;
+ }
+ }
+ return count;
+ }
+
+ public void SetColorSelect(EquipColorType type)
+ {
+ colorType = type;
+
+ if (RefreshColorSelectAct != null)
+ {
+ RefreshColorSelectAct(type);
+ }
+ SendEquipDevourRecordQuest();
+ EquipDecomRedCtrl();
+ }
+
+ public List<int> devourPlacelist { get; private set; }
+ public int devourRedpointLevel { get; private set; }
+ public int minDevourEquipNum { get; private set; }
+ public void SetDevourEquipPlace()
+ {
+ devourPlacelist = new List<int>();
+ FuncConfigConfig funcConfig = FuncConfigConfig.Get("PetAbsorbType");
+ int[] placeArray = ConfigParse.GetMultipleStr<int>(funcConfig.Numerical1);
+ for (int i = 0; i < placeArray.Length; i++)
+ {
+ devourPlacelist.Add(placeArray[i]);
+ }
+ devourRedpointLevel = int.Parse(funcConfig.Numerical2);
+ minDevourEquipNum = int.Parse(funcConfig.Numerical3);
+ }
+
+ List<ItemModel> devourModellist = new List<ItemModel>();
+ List<ItemModel> orderDevourModellist = new List<ItemModel>();
+ public List<ItemModel> GetDevourModellist()
+ {
+ SinglePack singlePack = GetSinglePack(PackType.Item);
+ if (singlePack == null) return null;
+
+ devourModellist.Clear();
+ orderDevourModellist.Clear();
+ foreach (var model in singlePack.GetAllItems().Values)
+ {
+ if (model.config.Type == 29)
+ {
+ devourModellist.Add(model);
+ }
+ else
+ {
+ if (devourPlacelist.Contains(model.config.EquipPlace))
+ {
+ if (GeneralDefine.equipDecomposeScreen.Contains(model.config.ItemColor))
+ {
+ devourModellist.Add(model);
+ }
+ }
+ }
+
+ }
+ orderDevourModellist.AddRange(devourModellist);
+ orderDevourModellist.Sort(CompareByColor);
+ return orderDevourModellist;
+ }
+
+ public int CompareByColor(ItemModel start, ItemModel next)
+ {
+ bool typeX = start.config.Type == 29 ? true : false;
+ bool typeY = next.config.Type == 29 ? true : false;
+
+ if (typeX.CompareTo(typeY) != 0) return -typeX.CompareTo(typeY);
+
+ int colorX = start.config.ItemColor;
+ int colorY = next.config.ItemColor;
+ if (colorX.CompareTo(colorY) != 0) return colorX.CompareTo(colorY);
+
+ int startIndex = devourModellist.IndexOf(start);
+ int nextIndex = devourModellist.IndexOf(next);
+ if (startIndex.CompareTo(nextIndex) != 0) return startIndex.CompareTo(nextIndex);
+
+ return 0;
+ }
+
+ public List<ItemModel> GetCanDevourModellist()
+ {
+ List<ItemModel> canDevourModellist = new List<ItemModel>();
+ SinglePack singlePack = GetSinglePack(PackType.Item);
+ if (singlePack == null || colorType == EquipColorType.None)
+ {
+ if (RefreshEquipDecomNumAct != null)
+ {
+ RefreshEquipDecomNumAct();
+ }
+ return null;
+ }
+
+ foreach (var model in singlePack.GetAllItems().Values)
+ {
+ if (model.config.Type == 29)
+ {
+ if (!defaultUnSelectlist.Contains(model.itemId))
+ {
+ canDevourModellist.Add(model);
+ }
+ }
+ else
+ {
+ if (IsCanDevour(model))
+ {
+ canDevourModellist.Add(model);
+ }
+ }
+ }
+
+ if (RefreshEquipDecomNumAct != null)
+ {
+ RefreshEquipDecomNumAct();
+ }
+
+ return canDevourModellist;
+ }
+
+ public bool IsCanDevour(ItemModel model)
+ {
+ // if (devourPlacelist.Contains(model.config.EquipPlace))
+ // {
+ // if (GeneralDefine.equipDecomposeScreen.Contains(model.config.ItemColor))
+ // {
+ // var eatEquipConfig = PetEatEquipConfig.GetEquipColorAndEquipClass(model.config.ItemColor, model.config.LV);
+ // if (eatEquipConfig == null) return false;
+
+ // if (EquipControlConfig.Get(model.config.LV, 1).realm > PlayerDatas.Instance.baseData.realmLevel)
+ // {
+ // //bug锛氱帺瀹舵寕鏈轰細鎵撻珮澧冪晫鎬紝瀵艰嚧瑁呭鏃犳硶鍒嗚В鑳屽寘澶弧鐨勬儏鍐�
+ // //澧冪晫澶т簬鐜╁澧冪晫锛屼笖鍦ㄦ寚瀹氶鑹插搧璐ㄤ笅鐨勭洿鎺ュ垎瑙g传鑹蹭互涓嬭澶�
+ // if (model.config.ItemColor <= (int)colorType && model.config.ItemColor <= 3)
+ // {
+ // return true;
+ // }
+ // }
+
+ // //1. 闈炴媿鍗栬澶�
+ // //2. 瑁呭鍝佽川灏忎簬绛変簬褰撳墠閫夋嫨鐨勫搧璐�
+ // //3. 闈炴湰鑱屼笟鐨勫瑁呰澶�
+ // //4. 闈炴垬鏂楀姏鎻愬崌鐨勮澶�
+ // if (!model.isAuction && model.config.ItemColor <= (int)colorType
+ // && !(ItemLogicUtility.Instance.IsJobCompatibleItem(model.itemId)
+ // && model.config.ItemColor == 4 && model.config.SuiteiD != 0)
+ // && ItemLogicUtility.Instance.IsFightUp(model.itemId, model.score) != 1)
+ // {
+ // return true;
+ // }
+ // }
+ // }
+
+ return false;
+ }
+
+ public bool IsMaxDecomLv(int decomLv, out int realLv)
+ {
+ realLv = decomLv;
+ // var decomlist = EquipDeComposeConfig.GetValues();
+ // if (decomLv > decomlist[decomlist.Count - 1].LV)
+ // {
+ // realLv = decomlist[decomlist.Count - 1].LV;
+ // return true;
+ // }
+
+ return false;
+ }
+
+ public List<ItemModel> selectDevourlist = new List<ItemModel>();
+ public void GetSelectDevourList()
+ {
+ selectDevourlist.Clear();
+ List<ItemModel> itemModels = GetCanDevourModellist();
+ if (itemModels != null)
+ {
+ selectDevourlist.AddRange(itemModels);
+ }
+ }
+
+ public void RefreshGetNewItem(ItemModel model)
+ {
+ if (model == null) return;
+
+ if (CheckIsReachDevourCondi(model))
+ {
+ selectDevourlist.Add(model);
+ if (RefreshEquipDecomNumAct != null)
+ {
+ RefreshEquipDecomNumAct();
+ }
+ }
+ }
+
+ public void AddSelectDevourModellist(ItemModel model)
+ {
+ selectDevourlist.Add(model);
+ if (RefreshEquipDecomNumAct != null)
+ {
+ RefreshEquipDecomNumAct();
+ }
+ }
+
+ public bool CheckIsReachDevourCondi(ItemModel model)
+ {
+ if (model.config.Type == 29)
+ {
+ if (!defaultUnSelectlist.Contains(model.itemId))
+ {
+ return true;
+ }
+ return false;
+ }
+ else
+ {
+ if (IsCanDevour(model))
+ {
+ return true;
+ }
+
+ }
+ return false;
+ }
+
+ public void RemoveSelectDevourModellist(ItemModel model)
+ {
+ if (selectDevourlist.Contains(model))
+ {
+ selectDevourlist.Remove(model);
+ }
+ if (RefreshEquipDecomNumAct != null)
+ {
+ RefreshEquipDecomNumAct();
+ }
+ }
+
+ public Dictionary<int, int> GetDecomAttrDictByLv(int decomLv)
+ {
+ if (decomposeAttrDict.ContainsKey(decomLv))
+ {
+ return decomposeAttrDict[decomLv];
+ }
+
+ return null;
+ }
+
+ public bool IsReachMinDecomposeNum()
+ {
+ List<ItemModel> itemModels = GetCanDevourModellist();
+ if (itemModels != null && itemModels.Count >= minDecomposeNum)
+ {
+ return true;
+ }
+ return false;
+ }
+
+ public void SendEquipdevourQuest(bool auto)
+ {
+ List<ItemModel> items = null;
+ if (auto)
+ {
+ items = GetCanDevourModellist();
+ }
+ else
+ {
+ items = selectDevourlist;
+ }
+
+ // if (items == null || items.Count < minDecomposeNum || !ItemLogicUtility.Instance.isPackResetOk || SettingEffectMgr.Instance.isStartDecompose) return;
+
+ // SettingEffectMgr.Instance.isStartDecompose = true;
+ // isAutoDecompose = auto;
+ // recordAutoDecomNum = Math.Min(items.Count, 100); //鍗曟鏈�澶�100浠跺垎瑙�
+ // var package = new CA32C_tagCMEquipDecompose();
+ // var indexLists = new ushort[recordAutoDecomNum];
+ // var idlist = new uint[recordAutoDecomNum];
+ // for (int i = 0; i < recordAutoDecomNum; i++)
+ // {
+ // indexLists[i] = (ushort)items[i].gridIndex;
+ // idlist[i] = (uint)items[i].itemId;
+ // if ((items[i].config.EquipPlace == 0 && items[i].config.Type != 29))
+ // {
+ // return;
+ // }
+ // }
+ // package.Count = (byte)indexLists.Length;
+ // package.IndexList = indexLists;
+ // package.ItemIDList = idlist;
+ // package.IsAuto = (byte)(auto ? 1 : 0);
+ // GameNetSystem.Instance.SendInfo(package);
+ }
+
+ public void SendEquipDevourRecordQuest()
+ {
+ var record = StringUtility.Contact((int)colorType + 1, 1, 1);
+ var decomSet = new CA32D_tagCMDecomposeSeting();
+ decomSet.Seting = uint.Parse(record);
+ GameNetSystem.Instance.SendInfo(decomSet);
+ }
+
+ public int decomposeLv { get; private set; }
+ public int decomposeExp { get; private set; }
+ public int decomposeProgress { get; private set; }
+ public int addDecomposeExp { get; private set; }
+ public int minDecomposeNum { get; private set; }
+ public bool isAutoDecompose { get; set; }
+ public int recordAutoDecomNum { get; private set; }
+ public DecomposeGetMatInfo[] getItems { get; private set; }
+
+ public event Action RefreshDecomAttrAct;
+ // public void GetServerDecomposeSet(HA31C_tagMCEquipDecomposeInfo info)
+ // {
+ // addDecomposeExp = 0;
+ // int realLv = info.LV + 1;
+ // bool isMax = IsMaxDecomLv(realLv, out realLv);
+ // if (realLv == decomposeLv)
+ // {
+ // addDecomposeExp = (int)info.Exp - decomposeExp;
+ // }
+ // else
+ // {
+ // for (int i = decomposeLv; i <= realLv; i++)
+ // {
+ // var deComposeConfig = EquipDeComposeConfig.Get(i);
+ // if (i == decomposeLv)
+ // {
+ // addDecomposeExp = deComposeConfig.UpNeedExp - decomposeExp;
+ // }
+ // else if (i == realLv)
+ // {
+ // addDecomposeExp += (int)info.Exp;
+ // }
+ // else
+ // {
+ // addDecomposeExp += deComposeConfig.UpNeedExp;
+ // }
+ // }
+ // }
+
+ // decomposeLv = realLv;
+ // decomposeExp = (int)info.Exp;
+ // decomposeProgress = info.DecomposeCnt;
+ // getItems = JsonMapper.ToObject<DecomposeGetMatInfo[]>(info.GetItemData);
+
+ // if (info.Seting != 0)
+ // {
+ // string decomSetStr = info.Seting.ToString();
+ // string colorStr = decomSetStr.Substring(0, 1);
+ // colorType = (EquipColorType)(int.Parse(colorStr) - 1);
+ // string lvStr = decomSetStr.Substring(1, decomSetStr.Length - 2);
+ // }
+ // if (RefreshDecomAttrAct != null)
+ // {
+ // RefreshDecomAttrAct();
+ // }
+ // }
+ /// <summary>
+ /// 璁剧疆鑾峰緱鐐间腹鏉愭枡鐨勫睍绀烘暟鎹�
+ /// </summary>
+ /// <param name="getMatInfos"></param>
+ /// <returns></returns>
+ private List<DecomposeGetMatInfo> getMatInfos = new List<DecomposeGetMatInfo>();
+ public List<DecomposeGetMatInfo> SetShowMatInfo()
+ {
+ getMatInfos.Clear();
+ int sumMatCnt = 0;
+ if (getItems != null)
+ {
+ for (int i = 0; i < getItems.Length; i++)
+ {
+ if (getItems[i].Count > 0)
+ {
+ sumMatCnt += getItems[i].Count;
+ }
+ else
+ {
+ sumMatCnt += 1;
+ }
+ }
+ }
+
+ if (sumMatCnt > 5)
+ {
+ for (int i = 0; i < getItems.Length; i++)
+ {
+ getMatInfos.Add(getItems[i]);
+ }
+ }
+ else
+ {
+ if (getItems != null)
+ {
+ for (int i = 0; i < getItems.Length; i++)
+ {
+ //if (getItems[i].Count > 0)
+ //{
+ // for (int j = 0; j < getItems[i].Count; j++)
+ // {
+ // DecomposeGetMatInfo matInfo = new DecomposeGetMatInfo();
+ // matInfo.ItemID = getItems[i].ItemID;
+ // matInfo.Count = 1;
+ // matInfo.IsSuite = getItems[i].IsSuite;
+ // matInfo.UserData = getItems[i].UserData;
+ // getMatInfos.Add(matInfo);
+ // }
+ //}
+ //else
+ {
+ getMatInfos.Add(getItems[i]);
+ }
+ }
+ }
+ }
+ return getMatInfos;
+ }
+
+ public enum EquipColorType
+ {
+ None = 0,
+ White = 1,
+ Blue = 2,
+ Purple = 3,
+ Orange = 4,
+ Red = 5,
+ //鍚庣画IL寮�鍙戞坊鍔犻璁�
+ default1,
+ default2,
+ default3,
+ default4,
+ All = 10,
+ }
+
+ public class DecomposeGetMatInfo
+ {
+ public int ItemID;
+ public int Count;
+ public int IsSuite;
+ public string UserData;
+ }
+ #endregion
+
+ #region 涓硅嵂閫昏緫澶勭悊
+
+ // private int CompareMakeDrug(AttrFruitConfig start, AttrFruitConfig end)
+ // {
+ // ItemConfig configS = ItemConfig.Get(start.ID);
+ // ItemConfig configE = ItemConfig.Get(end.ID);
+ // if (configS.RealmLimit.CompareTo(configE.RealmLimit) != 0)
+ // {
+ // return configS.RealmLimit.CompareTo(configE.RealmLimit);
+ // }
+ // if (configS.LV.CompareTo(configE.LV) != 0)
+ // {
+ // return configS.LV.CompareTo(configE.LV);
+ // }
+
+ // int x = makeDruglist.IndexOf(start);
+ // int y = makeDruglist.IndexOf(end);
+ // if (x.CompareTo(y) != 0) x.CompareTo(y);
+
+ // return 0;
+ // }
+
+ // List<AttrFruitConfig> drugOrderlist = new List<AttrFruitConfig>();
+ // List<AttrFruitConfig> haveDruglist = new List<AttrFruitConfig>();
+ // public List<AttrFruitConfig> GetDrugOrderByCnt()
+ // {
+ // drugOrderlist.Clear();
+ // haveDruglist.Clear();
+ // drugOrderlist.AddRange(makeDruglist);
+ // drugOrderlist.Sort(CompareByIsHave);
+ // for (int i = 0; i < drugOrderlist.Count; i++)
+ // {
+ // if (IsHaveDrugUse(drugOrderlist[i]))
+ // {
+ // haveDruglist.Add(drugOrderlist[i]);
+ // }
+ // }
+ // haveDruglist.Sort(CompareMakeDrug);
+ // for (int i = 0; i < haveDruglist.Count; i++)
+ // {
+ // drugOrderlist[i] = haveDruglist[i];
+ // }
+
+ // return drugOrderlist;
+ // }
+
+ public bool CheckIsDrugById(int itemId)
+ {
+ // for (int i = 0; i < makeDruglist.Count; i++)
+ // {
+ // if (makeDruglist[i].ID == itemId)
+ // {
+ // return true;
+ // }
+ // }
+ return false;
+ }
+
+ // public int CompareByIsHave(AttrFruitConfig start, AttrFruitConfig end)
+ // {
+ // bool isHaveStart = IsHaveDrugUse(start);
+ // bool isHaveEnd = IsHaveDrugUse(end);
+ // if (isHaveStart.CompareTo(isHaveEnd) != 0) return -isHaveStart.CompareTo(isHaveEnd);
+
+ // //isHaveStart = IsHaveDrugRecycle(start);
+ // //isHaveEnd = IsHaveDrugRecycle(end);
+ // //if (isHaveStart.CompareTo(isHaveEnd) != 0) return -isHaveStart.CompareTo(isHaveEnd);
+
+ // isHaveStart = GetItemCountByID(PackType.Item, start.ID) > 0 ? true : false;
+ // isHaveEnd = GetItemCountByID(PackType.Item, end.ID) > 0 ? true : false;
+ // if (isHaveStart.CompareTo(isHaveEnd) != 0) return isHaveStart.CompareTo(isHaveEnd);
+
+ // isHaveStart = IsReachMaxUseDrug(start);
+ // isHaveEnd = IsReachMaxUseDrug(end);
+ // if (isHaveStart.CompareTo(isHaveEnd) != 0) return isHaveStart.CompareTo(isHaveEnd);
+
+ // int x = makeDruglist.IndexOf(start);
+ // int y = makeDruglist.IndexOf(end);
+ // if (x.CompareTo(y) != 0) return x.CompareTo(y);
+ // return 0;
+ // }
+
+ // public bool IsHaveDrugUse(AttrFruitConfig fruitConfig)
+ // {
+ // if (!IsReachMaxUseDrug(fruitConfig))
+ // {
+ // return GetItemCountByID(PackType.Item, fruitConfig.ID) > 0 ? true : false;
+ // }
+
+ // return false;
+ // }
+
+ // public bool IsHaveDrugRecycle(AttrFruitConfig fruitConfig)
+ // {
+ // if (IsReachMaxUseDrug(fruitConfig))
+ // {
+ // return GetItemCountByID(PackType.Item, fruitConfig.ID) > 0 ? true : false;
+ // }
+ // return false;
+ // }
+
+ // public bool IsReachMaxUseDrug(AttrFruitConfig fruitConfig)
+ // {
+ // if (fruitConfig == null)
+ // {
+ // return false;
+ // }
+
+ // if (fruitConfig.FuncID == 2)
+ // {
+ // AlchemyDrugUseLimit drugUseLimit;
+ // if (alchemyModel.TryGetAlchemyUseLimit(fruitConfig.ID, out drugUseLimit))
+ // {
+ // return drugUseLimit.IsReachLimit();
+ // }
+ // }
+
+ // int useNum = GetItemTotalUsedTimes(fruitConfig.ID);
+ // if (useNum >= fruitConfig.basicUseLimit)
+ // {
+ // return true;
+ // }
+ // return false;
+ // }
+ #endregion
+
+ //鑾峰彇鑳屽寘涓殑涓�浠跺彲鎷嶅崠鐗╁搧 浼樺厛鍏朵粬鑱屼笟
+ public string GetAuctionEquip()
+ {
+ var itemPackage = GetSinglePack(PackType.Item);
+ var allItems = itemPackage.GetAllItems();
+
+ var guid = string.Empty;
+ List<string> guidList = new List<string>();
+ foreach (var item in allItems.Values)
+ {
+ var isAuction = item.isAuction;
+ if (isAuction && ItemLogicUtility.Instance.IsRealmEquip(item.itemId))
+ {
+ if (!ItemLogicUtility.Instance.IsJobCompatibleItem(item.itemId))
+ {
+ return item.guid;
+ }
+ else
+ {
+ if (guid != string.Empty)
+ continue;
+ guid = item.guid;
+ }
+ }
+ }
+ return guid;
+ }
+
+
+ public void ReceiveAwardNotify(HA801_tagMCGiveAwardInfo netPack)
+ {
+ var eventName = UIHelper.ServerStringTrim(netPack.EventName);
+ if (eventName == "BuyItem")
+ return;
+
+ // 浠欑洘鏀诲煄鎴�
+ // if (eventName == "FamilyGCZSQGrid" || eventName == "FamilyGCZSQPass" || eventName == "FamilyGCZSQPassAll" ||
+ // eventName == "FamilyGCZContiribution" || eventName == "FamilyGCZAtk")
+ // {
+ // ModelCenter.Instance.GetModel<FairySiegeActModel>()?.OnUpdateAwardInfoAction(netPack);
+ // return;
+ // }
+ if (!commonShowAwardEvents.Contains(eventName))
+ return;
+
+ List<Item> showItems = new List<Item>();
+
+ if (netPack.Exp != 0 || netPack.ExpPoint != 0)
+ {
+ ulong expValue = netPack.Exp + netPack.ExpPoint * (ulong)Constants.ExpPointValue;
+ showItems.Add(new Item(GeneralDefine.expDisplayId, expValue));
+ }
+ if (netPack.MoneyList.Length != 0)
+ {
+ for (int i = 0; i < netPack.MoneyLen; i++)
+ {
+ var moneyType = netPack.MoneyList[i].MoneyType;
+ if (GeneralDefine.moneyDisplayIds.ContainsKey(moneyType) && netPack.MoneyList[i].MoneyValue != 0)
+ {
+ showItems.Add(new Item(GeneralDefine.moneyDisplayIds[moneyType], netPack.MoneyList[i].MoneyValue));
+ }
+
+ }
+ }
+
+ if (netPack.ItemList.Length != 0)
+ {
+ for (int i = 0; i < netPack.ItemLen; i++)
+ {
+ showItems.Add(new Item((int)netPack.ItemList[i].ItemID, netPack.ItemList[i].Count, netPack.ItemList[i].IsBind));
+ }
+ }
+
+
+ string info = string.Empty;
+ if (LanguageConfig.HasKey("commonShowAwardEvents_" + eventName))
+ info = Language.Get("commonShowAwardEvents_" + eventName);
+
+ if (showItems.Count == 0)
+ return;
+
+ ItemLogicUtility.Instance.ShowGetItem(showItems, info, 0, eventName: eventName);
+ }
+ }
+}
diff --git a/Main/System/KnapSack/Logic/PackModel.cs.meta b/Main/System/KnapSack/Logic/PackModel.cs.meta
new file mode 100644
index 0000000..517839c
--- /dev/null
+++ b/Main/System/KnapSack/Logic/PackModel.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 25e261b589e477f4da58ce735ed326cc
+timeCreated: 1513774174
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/KnapSack/Logic/SinglePack.cs b/Main/System/KnapSack/Logic/SinglePack.cs
new file mode 100644
index 0000000..20ab7ae
--- /dev/null
+++ b/Main/System/KnapSack/Logic/SinglePack.cs
@@ -0,0 +1,388 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using vnxbqy.UI;
+
+namespace vnxbqy.UI
+{
+ public class SinglePack
+ {
+ public readonly PackType type;
+ public int unlockedGridCount { get; private set; }
+ private Dictionary<int, ItemModel> items = new Dictionary<int, ItemModel>(); //key 鐗╁搧浣嶇疆绱㈠紩
+ private Dictionary<int, List<int>> itemIDs = new Dictionary<int, List<int>>(); //key 鐗╁搧ID锛氱墿鍝佷綅缃储寮�
+ public SinglePack(PackType type)
+ {
+ this.type = type;
+ }
+
+ public bool HasItem(int itemID)
+ {
+ return itemIDs.ContainsKey(itemID);
+ }
+
+ public ItemModel UpdateItem(ItemInfo itemInfo)
+ {
+ //瀛楀吀绱㈠紩涓虹墿鍝佷綅缃储寮�
+ var index = itemInfo.index;
+ if (!items.ContainsKey(index))
+ {
+ items.Add(index, new ItemModel(type, itemInfo));
+ }
+ else
+ {
+ //浣嶇疆涓婄殑鐗╁搧鍙樺寲锛屽厛绉婚櫎鍘熸潵鐨�
+ var itemID = items[index].itemId;
+ if (itemIDs.ContainsKey(itemID))
+ {
+ if (itemIDs[itemID].Contains(index))
+ {
+ if (itemIDs[itemID].Count == 1)
+ {
+ itemIDs.Remove(itemID);
+ }
+ else
+ {
+ itemIDs[itemID].Remove(index);
+ }
+ }
+ }
+
+ items[index].SetItemInfo(itemInfo);
+ }
+
+ //瀛楀吀绱㈠紩涓虹墿鍝両D
+ if (!itemIDs.ContainsKey(itemInfo.itemId))
+ {
+ itemIDs.Add(itemInfo.itemId, new List<int>());
+ }
+
+ if (!itemIDs[itemInfo.itemId].Contains(itemInfo.index))
+ {
+ itemIDs[itemInfo.itemId].Add(itemInfo.index);
+ }
+
+ return items[index];
+ }
+
+ public void RemoveItem(int index)
+ {
+ if (items.ContainsKey(index))
+ {
+ //瀛楀吀绱㈠紩涓虹墿鍝両D
+ var itemID = items[index].itemId;
+ if (itemIDs.ContainsKey(itemID))
+ {
+ if (itemIDs[itemID].Contains(index))
+ {
+ if (itemIDs[itemID].Count == 1)
+ {
+ itemIDs.Remove(itemID);
+ }
+ else
+ {
+ itemIDs[itemID].Remove(index);
+ }
+ }
+ }
+
+ items.Remove(index);
+ }
+
+ }
+
+ public void SetOpenGridCount(int count)
+ {
+ unlockedGridCount = count;
+ }
+
+ public ItemModel GetItemByIndex(int index)
+ {
+ ItemModel item = null;
+ items.TryGetValue(index, out item);
+ return item;
+ }
+
+ public Dictionary<int, ItemModel> GetAllItems()
+ {
+ return items;
+ }
+
+ /// <summary>
+ /// 鑾峰彇鎸囧畾ID鐨勪竴涓墿鍝�
+ /// </summary>
+ /// <param name="itemId"></param>
+ /// <param name="includeAuction"></param>
+ /// <returns></returns>
+ public ItemModel GetItemByID(int itemId, bool includeAuction = true)
+ {
+ //foreach (var item in items.Values)
+ //{
+ // if (!includeAuction && item.isAuction)
+ // {
+ // continue;
+ // }
+
+ // if (item.itemId == itemId)
+ // {
+ // return item;
+ // }
+ //}
+
+ //return null;
+
+ if (itemIDs.ContainsKey(itemId))
+ {
+ foreach (var index in itemIDs[itemId])
+ {
+ var item = items[index];
+ if (!includeAuction && item.isAuction)
+ {
+ continue;
+ }
+ return item;
+ }
+ }
+ return null;
+ }
+
+ /// <summary>
+ /// 鑾峰彇鍖呭唴鐨勬寚瀹欼D鐨勬墍鏈夌墿鍝�
+ /// </summary>
+ /// <param name="itemId"></param>
+ /// <param name="includeAuction"></param>
+ /// <returns></returns>
+ public List<ItemModel> GetItemsById(int itemId, bool includeAuction = true)
+ {
+ var list = new List<ItemModel>();
+ //foreach (var item in items.Values)
+ //{
+ // if (!includeAuction && item.isAuction)
+ // {
+ // continue;
+ // }
+
+ // if (item.itemId == itemId)
+ // {
+ // list.Add(item);
+ // }
+ //}
+
+ if (itemIDs.ContainsKey(itemId))
+ {
+ foreach (var index in itemIDs[itemId])
+ {
+ var item = items[index];
+ if (!includeAuction && item.isAuction)
+ {
+ continue;
+ }
+ list.Add(item);
+ }
+ }
+ return list;
+ }
+
+ public int GetCountById(int itemId, bool includeAuction = true)
+ {
+ var count = 0;
+ //foreach (var item in items.Values)
+ //{
+ // if (!includeAuction && item.isAuction)
+ // {
+ // continue;
+ // }
+
+ // if (item.itemId == itemId)
+ // {
+ // count += item.count;
+ // }
+ //}
+
+ if (itemIDs.ContainsKey(itemId))
+ {
+ foreach (var index in itemIDs[itemId])
+ {
+ var item = items[index];
+ if (!includeAuction && item.isAuction)
+ {
+ continue;
+ }
+ count += item.count;
+ }
+ }
+ return count;
+ }
+
+ public List<ItemModel> GetItems(FilterParams filterParams)
+ {
+ var list = new List<ItemModel>();
+ foreach (var item in items.Values)
+ {
+ var levelValid = filterParams.levels == null || filterParams.levels.Contains(item.config.LV);
+ if (!levelValid)
+ {
+ continue;
+ }
+
+ var qualityValid = filterParams.qualitys == null || filterParams.qualitys.Contains(item.config.ItemColor);
+ if (!qualityValid)
+ {
+ continue;
+ }
+
+ var typeValid = filterParams.itemTypes == null || filterParams.itemTypes.Contains(item.config.Type);
+ if (!typeValid)
+ {
+ continue;
+ }
+
+ var equipTypeValid = filterParams.equipTypes == null || filterParams.equipTypes.Contains(item.config.EquipPlace);
+ if (!equipTypeValid)
+ {
+ continue;
+ }
+
+ var jobValid = filterParams.jobs == null || filterParams.jobs.Contains(item.config.JobLimit);
+ if (!jobValid)
+ {
+ continue;
+ }
+
+ //var auctionValid = filterParams.isAuction == item.isAuction;
+ //if (!auctionValid)
+ //{
+ // continue;
+ //}
+
+ var realmValid = filterParams.realmLimit == 0 || filterParams.realmLimit == item.config.RealmLimit;
+ if (!realmValid)
+ {
+ continue;
+ }
+
+ list.Add(item);
+ }
+
+ return list;
+ }
+
+ public int GetCountByType(int type)
+ {
+ var count = 0;
+ foreach (var item in items.Values)
+ {
+ if (item.config.Type == type)
+ {
+ count += item.count;
+ }
+ }
+
+ return count;
+ }
+
+ /// <summary>
+ /// 寰楀埌鍚屼竴涓猧d鎸囧畾鏁伴噺鐨勭墿鍝佹牸瀛愬簭鍙�
+ /// </summary>
+ /// <param name="itemId"></param>
+ /// <param name="needCount"></param>
+ /// <param name="type"></param>
+ /// <returns></returns>
+ public List<int> GetItemIndexsAppointedCount(int itemId, int needCount, bool includeAuction = true)
+ {
+ //var goalItems = new List<ItemModel>();
+ //foreach (var item in this.items.Values)
+ //{
+ // if (!includeAuction && item.isAuction)
+ // {
+ // continue;
+ // }
+
+ // if (item.itemId == itemId)
+ // {
+ // goalItems.Add(item);
+ // }
+ //}
+
+ var itemIndexs = new List<int>();
+ var count = 0;
+ //for (var i = 0; i < goalItems.Count; i++)
+ //{
+ // if (count < needCount)
+ // {
+ // itemIndexs.Add(goalItems[i].gridIndex);
+ // count += goalItems[i].count;
+ // }
+ // else
+ // {
+ // break;
+ // }
+
+ //}
+
+ if (itemIDs.ContainsKey(itemId))
+ {
+ foreach (var index in itemIDs[itemId])
+ {
+ var item = items[index];
+ if (!includeAuction && item.isAuction)
+ {
+ continue;
+ }
+ if (count < needCount)
+ {
+ itemIndexs.Add(index);
+ count += item.count;
+ }
+ else
+ {
+ break;
+ }
+ }
+ }
+ return itemIndexs;
+ }
+
+ /// <summary>
+ /// 寰楀埌绗竴涓┖鏍间綅缃储寮�
+ /// </summary>
+ /// <param name="type"></param>
+ /// <returns></returns>
+ public int GetFirstEmptyGridIndex()
+ {
+ for (var index = 0; index < unlockedGridCount; index++)
+ {
+ if (!items.ContainsKey(index))
+ {
+ return index;
+ }
+ }
+
+ return -1;
+ }
+
+ public int GetEmptyGridCount()
+ {
+ return unlockedGridCount - items.Count;
+ }
+
+ public void Clear()
+ {
+ items.Clear();
+ itemIDs.Clear();
+ }
+
+ public struct FilterParams
+ {
+ public List<int> levels;
+ public List<int> qualitys;
+ public List<int> itemTypes;
+ public List<int> equipTypes;
+ public int realmLimit;
+ public bool isAuction;
+ public List<int> jobs;
+ }
+
+ }
+}
diff --git a/Main/System/KnapSack/Logic/SinglePack.cs.meta b/Main/System/KnapSack/Logic/SinglePack.cs.meta
new file mode 100644
index 0000000..4083488
--- /dev/null
+++ b/Main/System/KnapSack/Logic/SinglePack.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 920d1fdfb7e0a3348bcf7ff921f6eea5
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/KnapSack/New.meta b/Main/System/KnapSack/New.meta
new file mode 100644
index 0000000..1d97b55
--- /dev/null
+++ b/Main/System/KnapSack/New.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: f274df2bf8ac5dc43999b27e6c8150dd
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/KnapSack/New/CommonItemBaisc.cs b/Main/System/KnapSack/New/CommonItemBaisc.cs
new file mode 100644
index 0000000..6b95fb6
--- /dev/null
+++ b/Main/System/KnapSack/New/CommonItemBaisc.cs
@@ -0,0 +1,375 @@
+锘縰sing System;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace vnxbqy.UI
+{
+ public enum ItemCellformat
+ {
+ Format_84x84,
+ Format_80x80,
+ Format_70x70,
+ Format_64x64,
+ None,
+ }
+
+ public class CommonItemBaisc : MonoBehaviour
+ {
+ [SerializeField] ItemCellformat m_Format;
+ public ItemCellformat format { get { return m_Format; } set { m_Format = value; } }
+
+ Image m_BgIcon;
+ public Image bgIcon {
+ get {
+ if (m_BgIcon == null)
+ {
+ LoadPrefab();
+ m_BgIcon = this.transform.GetComponent<Image>("Container_ItemCell/Img_BackGround");
+ }
+ return m_BgIcon;
+ }
+ }
+
+ Image m_ItemIcon;
+ public Image itemIcon {
+ get {
+ if (m_ItemIcon == null)
+ {
+ LoadPrefab();
+ m_ItemIcon = this.transform.GetComponent<Image>("Container_ItemCell/Img_Icon");
+ }
+ return m_ItemIcon;
+ }
+ }
+
+
+ Image m_StateIcon;
+ public Image stateIcon {
+ get {
+ if (m_StateIcon == null)
+ {
+ LoadPrefab();
+ m_StateIcon = this.transform.GetComponent<Image>("Container_ItemCell/Img_State");
+ }
+ return m_StateIcon;
+ }
+ }
+
+ Text m_CountText;
+ public Text countText {
+ get {
+ if (m_CountText == null)
+ {
+ LoadPrefab();
+ m_CountText = this.transform.GetComponent<Text>("Container_ItemCell/Txt_Count");
+ }
+ return m_CountText;
+ }
+ }
+
+ Button m_Button;
+ public Button button {
+ get {
+ if (m_Button == null)
+ {
+ LoadPrefab();
+ m_Button = this.GetComponent<Button>("Container_ItemCell");
+ }
+ return m_Button;
+ }
+ }
+
+ EquipSuitEffect m_SuitEffect;
+ EquipSuitEffect suitEffect {
+ get {
+ if (m_SuitEffect == null)
+ {
+ LoadPrefab();
+ //clone 浼氶�犳垚浜屾鍒涘缓
+ m_SuitEffect = transform.GetComponentInChildren<EquipSuitEffect>();
+ if (m_SuitEffect == null)
+ m_SuitEffect = EquipSuitEffect.Create(transform as RectTransform);
+ }
+ return m_SuitEffect;
+ }
+ }
+
+ //鐗╁搧鍩虹鐗规晥锛堢墿鍝佽〃锛�
+ ItemBaseEffect m_ItemBaseEffect;
+ ItemBaseEffect itemBaseEffect {
+ get {
+ if (m_ItemBaseEffect == null)
+ {
+ LoadPrefab();
+ //clone 浼氶�犳垚浜屾鍒涘缓
+ m_ItemBaseEffect = transform.GetComponentInChildren<ItemBaseEffect>();
+ if (m_ItemBaseEffect == null)
+ m_ItemBaseEffect = ItemBaseEffect.Create(transform as RectTransform);
+ }
+ return m_ItemBaseEffect;
+ }
+ }
+
+ public bool suitEffectDirty { get; set; }
+
+ GameObject cellContainer;
+ protected void LoadPrefab()
+ {
+ //clone 浼氶�犳垚浜屾鍒涘缓
+ var tmp = transform.Find("Container_ItemCell");
+ if (tmp != null)
+ {
+ cellContainer = tmp.gameObject;
+ return;
+ }
+ if (cellContainer == null)
+ {
+ switch (format)
+ {
+ case ItemCellformat.Format_64x64:
+ cellContainer = UIUtility.CreateWidget("ItemCell_64", "Container_ItemCell");
+ break;
+ case ItemCellformat.Format_70x70:
+ cellContainer = UIUtility.CreateWidget("ItemCell_70", "Container_ItemCell");
+ break;
+ case ItemCellformat.Format_80x80:
+ cellContainer = UIUtility.CreateWidget("ItemCell_80", "Container_ItemCell");
+ break;
+ case ItemCellformat.Format_84x84:
+ cellContainer = UIUtility.CreateWidget("ItemCell_84", "Container_ItemCell");
+ break;
+ }
+
+ if (cellContainer != null)
+ {
+ cellContainer.transform.SetParentEx(this.transform, Vector3.zero, Quaternion.identity, Vector3.one);
+ cellContainer.transform.SetAsFirstSibling();
+ }
+ }
+ }
+
+ public int itemId { get; private set; }
+ PackModel packModel { get { return PackModel.Instance; } }
+ // EquipModel equipModel { get { return ModelCenter.Instance.GetModel<EquipModel>(); } }
+
+ /// <summary>
+ /// 鍒濆鍖栨暟鎹� bool鍊肩敤鏉ュ垽鏂槸鍚﹂渶瑕佸睍绀鸿瘎鍒嗛珮浣庢垨鑰呰亴涓氶檺鍒�
+ /// </summary>
+ /// <param name="model"></param>
+ /// <param name="isCompare"></param>
+ public virtual void Init(ItemModel model, bool isCompare = false)
+ {
+ itemId = model.itemId;
+ InitUI(model.guid, model.itemId, (ulong)model.count, model.score, model.isAuction, model.packType, isCompare, model.useDataDict);
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栨暟鎹紙棰勮锛�
+ /// </summary>
+ /// <param name="model"></param>
+ public virtual void Init(ItemCellModel model)
+ {
+ itemId = model.itemId;
+ InitUI(model.guid, model.itemId, model.count, model.score, false, model.packType, model.isCompare, model.useDataDic);
+ }
+
+ private void InitUI(string guid, int itemId, ulong count, int score, bool isAuction, PackType type, bool isCompare, Dictionary<int, List<int>> useDataDic)
+ {
+ var config = ItemConfig.Get(itemId);
+ if (config == null) return;
+
+ itemIcon.SetActive(true);
+ bgIcon.SetActive(true);
+ itemIcon.SetSprite(config.IconKey);
+ ItemConfig itemConfig = ItemConfig.Get(itemId);
+ // bgIcon.SetItemBackGround(ItemLogicUtility.Instance.GetItemQuality(itemId, useDataDic), itemConfig.QualityEchoType);
+ // if (packModel.textCountShow.ContainsKey(itemId))
+ // {
+ // countText.SetActive(true);
+ // countText.text = count > 1 ? packModel.textCountShow[itemId] + "x" + count : packModel.textCountShow[itemId];
+ // }
+ // else if (packModel.gameCashShow.Contains(itemId))
+ // {
+ // //浠i噾鍒�
+ // countText.SetActive(true);
+ // countText.text = count > 1000000 ? UIHelper.ReplaceLargeNum(count / 100.0f) : (count / 100.0f).ToString("0.##");
+ // }
+ // else if (Array.IndexOf(packModel.textCountShow2, itemId) != -1)
+ // {
+ // countText.SetActive(true);
+ // countText.text = UIHelper.ReplaceLargeNum(count * (ulong)config.EffectValueA1);
+ // }
+ // else
+ // {
+ countText.SetActive(count > 1);
+ if (count > 1)
+ {
+ countText.text = UIHelper.ReplaceLargeNum((double)count);
+ }
+ // }
+
+ suitEffect.Display(itemId, suitEffectDirty);
+ suitEffectDirty = false;
+ itemBaseEffect.Display(itemId);
+
+ // var compareReslut = isCompare ? Compare(type, itemId, score, guid) : 0;
+ // switch (compareReslut)
+ // {
+ // case -1:
+ // stateIcon.SetActive(true);
+ // stateIcon.SetSprite("EquipDownIcon");
+ // break;
+ // case 0:
+ // stateIcon.SetActive(false);
+ // break;
+ // case 1:
+ // stateIcon.SetActive(true);
+ // stateIcon.SetSprite("EquipUpIcon");
+ // break;
+ // case 99:
+ // stateIcon.SetActive(true);
+ // stateIcon.SetSprite("EquipForbidIcon");
+ // break;
+ // }
+ }
+
+ /// <summary>
+ /// 0 鐩哥瓑 99 绂佹姣旇緝 1 楂樿瘎鍒� -1 浣庤瘎鍒�
+ /// </summary>
+ /// <param name="itemId"></param>
+ /// <param name="score"></param>
+ /// <param name="isCompare"></param>
+ /// <param name="compareSocre"></param>
+ /// <returns></returns>
+ // int Compare(PackType type, int itemId, int score, string guid)
+ // {
+ // if (type == PackType.Equip || type == PackType.DogzEquip)
+ // {
+ // return 0;
+ // }
+
+ // if (!ItemLogicUtility.Instance.IsJobCompatibleItem(itemId))
+ // {
+ // return 99;
+ // }
+
+ // var config = ItemConfig.Get(itemId);
+ // if (config == null || config.EquipPlace == 0)
+ // {
+ // return 0;
+ // }
+
+ // var item = packModel.GetItemByGuid(guid);
+ // //if (item != null && item.isAuction)
+ // //{
+ // // return 0;
+ // //}
+
+ // if (item != null && ItemLogicUtility.Instance.IsOverdue(guid))
+ // {
+ // return 99;
+ // }
+
+ // if (ItemLogicUtility.Instance.IsDogzEquip(itemId))
+ // {
+ // var compareSocre = GetDogzEquipScore(config.EquipPlace);
+ // return score.CompareTo(compareSocre);
+ // }
+ // else if (ItemLogicUtility.Instance.IsSpiritWeapon(itemId))
+ // {
+ // return score.CompareTo(GetSpiritWeaponScore(config.EquipPlace));
+ // }
+ // else if (ItemLogicUtility.Instance.IsRealmEquip(itemId))
+ // {
+ // return equipModel.CompareToCurrent(guid);
+ // }
+ // else
+ // {
+ // return 0;
+ // }
+ // }
+
+ // int GetDogzEquipScore(int equipPlace)
+ // {
+ // var dogzModel = ModelCenter.Instance.GetModel<DogzModel>();
+ // ItemModel putOnModel = null;
+ // dogzModel.TryGetDogzEquip(dogzModel.presentSelectDogz, equipPlace, out putOnModel);
+ // return putOnModel == null ? 0 : putOnModel.score;
+ // }
+
+ // int GetSpiritWeaponScore(int equipPlace)
+ // {
+ // var spiritWeaponModel = ModelCenter.Instance.GetModel<SpiritWeaponModel>();
+ // var guid = spiritWeaponModel.GetSpiritWeapon((RoleEquipType)equipPlace);
+ // var item = packModel.GetItemByGuid(guid);
+ // return item != null ? item.score : 0;
+ // }
+
+ }
+
+ public class ItemCellModel
+ {
+ public string guid { get; private set; }
+ public int itemId { get; private set; }
+ public ulong count { get; private set; }
+ public int score { get; private set; }
+ public bool isCompare { get; private set; }
+ public ItemConfig itemConfig { get { return ItemConfig.Get(itemId); } }
+ public PackType packType { get; private set; }
+ public Dictionary<int, List<int>> useDataDic { get; private set; }
+
+
+ public ItemCellModel(int itemId, bool isPreview = false, ulong count = 0, string guid = "", PackType type = PackType.Deleted, bool isCompare = false, Dictionary<int, List<int>> useDataDic = null)
+ {
+ this.itemId = AdjustItemId(itemId);
+ this.guid = guid;
+ this.count = count;
+ this.isCompare = isCompare;
+ this.useDataDic = useDataDic;
+ this.packType = type;
+
+ //this.score = ItemLogicUtility.Instance.GetEquipScore(itemId, useDataDic, isPreview);
+ }
+
+ public ItemCellModel(int itemId)
+ {
+ this.itemId = AdjustItemId(itemId);
+ this.guid = "";
+ this.count = 0;
+ this.isCompare = false;
+ this.useDataDic = null;
+ this.packType = PackType.Deleted;
+ this.score = 0;
+ }
+
+ public ItemCellModel(int itemId, bool isPreview, ulong count)
+ {
+ this.itemId = AdjustItemId(itemId);
+ this.guid = "";
+ this.count = count;
+ this.isCompare = false;
+ this.useDataDic = null;
+ this.packType = PackType.Deleted;
+
+ //this.score = ItemLogicUtility.Instance.GetEquipScore(itemId, null, isPreview);
+ }
+
+ int AdjustItemId(int itemId)
+ {
+ var config = ItemConfig.Get(itemId);
+ if (config != null && config.Effect1 == 220)
+ {
+ return config.EffectValueA1;
+ }
+ else
+ {
+ return itemId;
+ }
+ }
+
+ }
+
+
+}
+
diff --git a/Main/System/KnapSack/New/CommonItemBaisc.cs.meta b/Main/System/KnapSack/New/CommonItemBaisc.cs.meta
new file mode 100644
index 0000000..53d5597
--- /dev/null
+++ b/Main/System/KnapSack/New/CommonItemBaisc.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 35473b2a6cd5171499a434642f1712a8
+timeCreated: 1552035262
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/KnapSack/New/ItemCell.cs b/Main/System/KnapSack/New/ItemCell.cs
new file mode 100644
index 0000000..9212f30
--- /dev/null
+++ b/Main/System/KnapSack/New/ItemCell.cs
@@ -0,0 +1,76 @@
+锘縰sing UnityEngine;
+using UnityEngine.UI;
+using vnxbqy.UI;
+using System.Collections.Generic;
+using System;
+
+namespace vnxbqy.UI
+{
+
+ public class ItemCell : CommonItemBaisc
+ {
+ private Button m_Reducebtn;
+ public Button reducebtn {
+ get {
+ if (m_Reducebtn == null)
+ {
+ LoadPrefab();
+ m_Reducebtn = this.transform.GetComponent<Button>("Container_ItemCell/Btn_Reduce");
+ }
+ return m_Reducebtn;
+ }
+ }
+
+ Image m_AuctionIcon;
+ public Image auctionIcon
+ {
+ get
+ {
+ if (m_AuctionIcon == null)
+ {
+ LoadPrefab();
+ m_AuctionIcon = this.transform.GetComponent<Image>("Container_ItemCell/Img_Auction");
+ }
+ return m_AuctionIcon;
+ }
+ }
+
+ Image m_TimeMark;
+ public Image timeMark
+ {
+ get
+ {
+ if (m_TimeMark == null)
+ {
+ LoadPrefab();
+ m_TimeMark = this.transform.GetComponent<Image>("Container_ItemCell/Img_Time");
+ }
+ return m_TimeMark;
+ }
+ }
+
+ public override void Init(ItemModel model, bool isCompare = false)
+ {
+ base.Init(model, isCompare);
+ reducebtn.SetActive(false);
+ auctionIcon.SetActive(false);
+ // auctionIcon.SetActive(model.isAuction);
+ // if (model.isAuction)
+ // {
+ // auctionIcon.SetSprite(ItemLogicUtility.Instance.IsOverdue(model.guid) ? "Item_Auction_3" : "Item_Auction_1");
+ // }
+
+ timeMark?.SetActive(model.config.Type == 145 && model.config.CDTime > 0);
+ }
+
+ public override void Init(ItemCellModel model)
+ {
+ base.Init(model);
+ reducebtn.SetActive(false);
+ auctionIcon.SetActive(false);
+
+ timeMark?.SetActive(model.itemConfig.Type == 145 && model.itemConfig.CDTime > 0);
+ }
+ }
+}
+
diff --git a/Main/System/KnapSack/New/ItemCell.cs.meta b/Main/System/KnapSack/New/ItemCell.cs.meta
new file mode 100644
index 0000000..e94098e
--- /dev/null
+++ b/Main/System/KnapSack/New/ItemCell.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 1fe9f3a16bb6e9e4f8f48d1ea66deb00
+timeCreated: 1508742860
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/MainInterfacePanel/MainRedDot.cs b/Main/System/MainInterfacePanel/MainRedDot.cs
index 5afd195..5668cfa 100644
--- a/Main/System/MainInterfacePanel/MainRedDot.cs
+++ b/Main/System/MainInterfacePanel/MainRedDot.cs
@@ -168,6 +168,7 @@
public const int YunShiRepoint = 464; //杩愬娍
public const int LianQiRepoint = 465; //浠欏尃澶т細
public const int FairySiegeRepoint = 466; //浠欑洘鏀诲煄鎴�
+ public const int MailRepoint = 467; //閭
public const int RedPoint_MR648 = 900; // BT鍔熻兘绾㈢偣 - 姣忔棩648
diff --git a/Main/System/Message/TextUnline.cs b/Main/System/Message/TextUnline.cs
new file mode 100644
index 0000000..f1454e7
--- /dev/null
+++ b/Main/System/Message/TextUnline.cs
@@ -0,0 +1,87 @@
+锘縰sing System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+public class TextUnline : MaskableGraphic {
+
+ private RectTransform target;
+
+ private bool isChanged = false;
+
+ protected override void Awake()
+ {
+ if (transform.parent != null) {
+ target = transform.parent as RectTransform;
+ }
+ }
+
+ private List<UIVertex> vertlist = new List<UIVertex>();
+
+ protected override void OnPopulateMesh(VertexHelper vh)
+ {
+ vh.Clear();
+ DrawUnderline(vh);
+ }
+
+ private void DrawUnderline(VertexHelper vh)
+ {
+ if (vertlist.Count < 1) return;
+
+ for (int i = 0; i < vertlist.Count; i++)
+ {
+ vh.AddVert(vertlist[i]);
+ }
+
+ for (int i = 0; i < vertlist.Count; i+=4)
+ {
+ vh.AddTriangle(i, i + 1, i + 2);
+ vh.AddTriangle(i + 1, i + 3, i + 2);
+ }
+ }
+
+ public void SetUIVertex(Vector3 start,Vector3 end,float delta, float height,Color color)
+ {
+ UIVertex[] verts = new UIVertex[4];
+ Vector3 pos = Vector3.zero;
+ pos.x = start.x;pos.y = start.y + delta;
+ verts[0].position = pos;
+ pos.x = end.x;
+ verts[1].position = pos;
+ pos.x = start.x;pos.y = pos.y + height;
+ verts[2].position = pos;
+ pos.x = end.x;
+ verts[3].position = pos;
+
+ for (int i = 0; i < 4; i++) {
+ verts[i].color = color;
+ verts[i].uv0 = Vector2.zero;
+ vertlist.Add(verts[i]);
+ }
+ isChanged = true;
+ }
+
+ private void Update()
+ {
+ if (target != null) {
+ rectTransform.sizeDelta = target.sizeDelta;
+ rectTransform.localPosition = Vector3.zero;
+ rectTransform.pivot = target.pivot;
+ }
+ else {
+ if (transform.parent != null) {
+ target = transform.parent as RectTransform;
+ }
+ }
+
+ if (isChanged) {
+ SetAllDirty();
+ isChanged = false;
+ }
+ }
+
+ public void ClearVert()
+ {
+ vertlist.Clear();
+ isChanged = true;
+ }
+}
diff --git a/Main/System/Message/TextUnline.cs.meta b/Main/System/Message/TextUnline.cs.meta
new file mode 100644
index 0000000..245a752
--- /dev/null
+++ b/Main/System/Message/TextUnline.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 4f2256ca60f43dd46acb603765acad4d
+timeCreated: 1503129452
+licenseType: Free
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Utility/GMCommand.cs b/Main/Utility/GMCommand.cs
new file mode 100644
index 0000000..a510e91
--- /dev/null
+++ b/Main/Utility/GMCommand.cs
@@ -0,0 +1,35 @@
+锘縰sing UnityEngine;
+using vnxbqy.UI;
+
+public class GMCommand : SingletonMonobehaviour<GMCommand>
+{
+ private void Update()
+ {
+ if (Input.GetKeyDown(KeyCode.F1))
+ {
+ if (!UIManager.Instance.IsOpened<GMInputWin>())
+ {
+ UIManager.Instance.OpenWindow<GMInputWin>();
+ }
+ else
+ {
+ UIManager.Instance.CloseWindow<GMInputWin>();
+ }
+ }
+
+ if (Input.GetKeyDown(KeyCode.F2))
+ {
+ if (!UIManager.Instance.IsOpened<GMCmdPanel>())
+ {
+ UIManager.Instance.OpenWindow<GMCmdPanel>();
+ }
+ else
+ {
+ UIManager.Instance.CloseWindow<GMCmdPanel>();
+ }
+ }
+ }
+
+
+}
+
diff --git a/Main/Utility/GMCommand.cs.meta b/Main/Utility/GMCommand.cs.meta
new file mode 100644
index 0000000..715cc14
--- /dev/null
+++ b/Main/Utility/GMCommand.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: c54e0ed6dd028844686b339c2de07598
+timeCreated: 1504508766
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Utility/StageLoadTimeOutCatcher.cs b/Main/Utility/StageLoadTimeOutCatcher.cs
new file mode 100644
index 0000000..33ae30f
--- /dev/null
+++ b/Main/Utility/StageLoadTimeOutCatcher.cs
@@ -0,0 +1,105 @@
+锘縰sing System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using System;
+
+public class StageLoadTimeOutCatcher : MonoBehaviour
+{
+ public static ProtocolRecorder got0102Time;
+ public static ProtocolRecorder gotA126Time;
+ public static ProtocolRecorder gotA127Time;
+ public static ProtocolRecorder got0109Time;
+ public static ProtocolRecorder got0403Time;
+ public static ProtocolRecorder send0107Time;
+
+ static StageLoadTimeOutCatcher timeOutCatcher;
+
+ public int stageId = 0;
+ public DateTime startTime;
+
+ private void Awake()
+ {
+ startTime = DateTime.Now;
+ }
+
+ public static void Begin(int stageId)
+ {
+ if (timeOutCatcher != null)
+ {
+ DestroyImmediate(timeOutCatcher.gameObject);
+ timeOutCatcher = null;
+ }
+
+ var go = new GameObject("StageLoadTimeOutCatcher");
+ var catcher = go.AddMissingComponent<StageLoadTimeOutCatcher>();
+ catcher.stageId = stageId;
+ timeOutCatcher = catcher;
+ DontDestroyOnLoad(go);
+ }
+
+ public static void Stop()
+ {
+ if (timeOutCatcher != null)
+ {
+ DestroyImmediate(timeOutCatcher.gameObject);
+ timeOutCatcher = null;
+ }
+ }
+
+ public static void ReportLoadingOverTime()
+ {
+ if (timeOutCatcher != null)
+ {
+ DestroyImmediate(timeOutCatcher.gameObject);
+ timeOutCatcher = null;
+ }
+ }
+
+ public static void RecordProtocol(ServerType socketType, string number, DateTime time)
+ {
+ var recorder = new ProtocolRecorder(number, time, socketType);
+ switch (number)
+ {
+ case "0102":
+ got0102Time = recorder;
+ break;
+ case "A126":
+ gotA126Time = recorder;
+ break;
+ case "A127":
+ gotA127Time = recorder;
+ break;
+ case "0109":
+ got0109Time = recorder;
+ break;
+ case "0107":
+ send0107Time = recorder;
+ break;
+ case "0403":
+ got0403Time = recorder;
+ break;
+ default:
+ break;
+ }
+ }
+
+ public struct ProtocolRecorder
+ {
+ public string number;
+ public DateTime time;
+ public ServerType socketType;
+
+ public ProtocolRecorder(string number, DateTime time, ServerType socketType)
+ {
+ this.number = number;
+ this.time = time;
+ this.socketType = socketType;
+ }
+
+ public override string ToString()
+ {
+ return StringUtility.Contact("灏佸寘锛�", number, ";", "鏃堕棿锛�", time.ToString("HH:mm:ss"), ";", "鏈嶅姟鍣細", socketType);
+ }
+ }
+
+}
diff --git a/Main/Utility/StageLoadTimeOutCatcher.cs.meta b/Main/Utility/StageLoadTimeOutCatcher.cs.meta
new file mode 100644
index 0000000..3ca6706
--- /dev/null
+++ b/Main/Utility/StageLoadTimeOutCatcher.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: c94dd2ad545844d41ae32b38c84f5370
+timeCreated: 1535611323
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Utility/UIUtility.cs b/Main/Utility/UIUtility.cs
index 98468b2..0d9577c 100644
--- a/Main/Utility/UIUtility.cs
+++ b/Main/Utility/UIUtility.cs
@@ -11,7 +11,7 @@
public static GameObject CreateWidget(string _sourceName, string _name)
{
- var prefab = ResManager.Instance.LoadAsset<GameObject>("UI", _sourceName);
+ var prefab = ResManager.Instance.LoadAsset<GameObject>("UIComp", _sourceName);
if (prefab == null)
{
return null;
--
Gitblit v1.8.0