|
@@ -1,17 +1,18 @@
|
|
using System.Collections.Generic;
|
|
using System.Collections.Generic;
|
|
using System.Collections;
|
|
using System.Collections;
|
|
|
|
+using ET;
|
|
|
|
+
|
|
namespace GFGGame
|
|
namespace GFGGame
|
|
{
|
|
{
|
|
public class CustomSuitDataManager
|
|
public class CustomSuitDataManager
|
|
{
|
|
{
|
|
- private static int _currentIndex = 0;
|
|
|
|
public static int currentIndex
|
|
public static int currentIndex
|
|
{
|
|
{
|
|
- get {return _currentIndex;}
|
|
|
|
|
|
+ get { return StorageDataManager.Instance.GetStorageValue(ConstStorageId.STORAGE_CUSTOME_SUIT_INDEX); }
|
|
}
|
|
}
|
|
|
|
|
|
private static Dictionary<int, CustomSuitData> _dataDic = new Dictionary<int, CustomSuitData>();
|
|
private static Dictionary<int, CustomSuitData> _dataDic = new Dictionary<int, CustomSuitData>();
|
|
- private static void SaveSuit(int index, int[] arrayList, int bgID = 0, int suitId = 0, int pic = 0)
|
|
|
|
|
|
+ public static void SaveSuit(int index, List<int> arrayList, int bgID = 0, int suitId = 0, bool pic = false)
|
|
{
|
|
{
|
|
CustomSuitData suitSavedData = null;
|
|
CustomSuitData suitSavedData = null;
|
|
if(_dataDic.ContainsKey(index))
|
|
if(_dataDic.ContainsKey(index))
|
|
@@ -27,7 +28,6 @@ namespace GFGGame
|
|
suitSavedData.bg = bgID;
|
|
suitSavedData.bg = bgID;
|
|
suitSavedData.pic = pic;
|
|
suitSavedData.pic = pic;
|
|
suitSavedData.suitId = suitId;
|
|
suitSavedData.suitId = suitId;
|
|
- GameProxy.ReqUpdateRoleSuit(suitSavedData);
|
|
|
|
}
|
|
}
|
|
|
|
|
|
public static CustomSuitData GetSuitList(int index)
|
|
public static CustomSuitData GetSuitList(int index)
|
|
@@ -48,10 +48,10 @@ namespace GFGGame
|
|
public static CustomSuitData CreateDefaultSuitData(int index)
|
|
public static CustomSuitData CreateDefaultSuitData(int index)
|
|
{
|
|
{
|
|
CustomSuitData suitSavedData = new CustomSuitData(index);
|
|
CustomSuitData suitSavedData = new CustomSuitData(index);
|
|
- suitSavedData.equipDatas = new int[3]{10000, 30000, 50000};
|
|
|
|
|
|
+ suitSavedData.equipDatas = new List<int>{10000, 30000, 50000};
|
|
suitSavedData.bg = 180001;
|
|
suitSavedData.bg = 180001;
|
|
- suitSavedData.pic = 0;
|
|
|
|
suitSavedData.suitId = 0;
|
|
suitSavedData.suitId = 0;
|
|
|
|
+ suitSavedData.pic = false;
|
|
return suitSavedData;
|
|
return suitSavedData;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -64,39 +64,27 @@ namespace GFGGame
|
|
{
|
|
{
|
|
if(currentIndex != index)
|
|
if(currentIndex != index)
|
|
{
|
|
{
|
|
- _currentIndex = index;
|
|
|
|
- GameProxy.ReqUpdateRoleSuitIndex(index);
|
|
|
|
|
|
+ StorageSProxy.ReqSetClientValue(ConstStorageId.STORAGE_CUSTOME_SUIT_INDEX ,index).Coroutine();
|
|
}
|
|
}
|
|
- SaveSuit(currentIndex, EquipDataCache.cacher.equipDatas, EquipDataCache.cacher.bgId, EquipDataCache.cacher.suitId, EquipDataCache.cacher.picStatus);
|
|
|
|
|
|
+ CustomSuitSProxy.UpdateCustomSuit(index, EquipDataCache.cacher.equipDatas, EquipDataCache.cacher.bgId, EquipDataCache.cacher.suitId, EquipDataCache.cacher.picStatus).Coroutine();
|
|
}
|
|
}
|
|
|
|
|
|
- public static void InitServerData(int suitIndex, List<RoleSuit> list)
|
|
|
|
|
|
+ public static void InitServerData(List<CustomSuitProto> list)
|
|
{
|
|
{
|
|
- _currentIndex = 0;
|
|
|
|
_dataDic.Clear();
|
|
_dataDic.Clear();
|
|
if(list != null)
|
|
if(list != null)
|
|
{
|
|
{
|
|
- _currentIndex = suitIndex;
|
|
|
|
- foreach(RoleSuit roleSuit in list)
|
|
|
|
|
|
+ foreach(var roleSuit in list)
|
|
{
|
|
{
|
|
- CustomSuitData suitSavedData = new CustomSuitData(roleSuit.pos);
|
|
|
|
- _dataDic[roleSuit.pos] = suitSavedData;
|
|
|
|
- if(roleSuit.equipIds.Length > 0)
|
|
|
|
- {
|
|
|
|
- string[] ids = roleSuit.equipIds.Split(',');
|
|
|
|
- suitSavedData.equipDatas = new int[ids.Length];
|
|
|
|
- for(int i = 0; i < ids.Length; i++)
|
|
|
|
- {
|
|
|
|
- suitSavedData.equipDatas[i] = int.Parse(ids[i]);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
|
|
+ CustomSuitData suitSavedData = new CustomSuitData(roleSuit.Pos);
|
|
|
|
+ _dataDic[roleSuit.Pos] = suitSavedData;
|
|
|
|
+ suitSavedData.bg = roleSuit.BgId;
|
|
|
|
+ suitSavedData.suitId = roleSuit.SuitId;
|
|
|
|
+ suitSavedData.pic = roleSuit.Pic;
|
|
|
|
+ foreach (var equipId in roleSuit.EquipIds)
|
|
{
|
|
{
|
|
- suitSavedData.equipDatas = new int[]{};
|
|
|
|
|
|
+ suitSavedData.equipDatas.Add(equipId);
|
|
}
|
|
}
|
|
- suitSavedData.bg = roleSuit.bg;
|
|
|
|
- suitSavedData.pic = roleSuit.pic;
|
|
|
|
- suitSavedData.suitId = roleSuit.suitId;
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|