|
@@ -15,26 +15,28 @@ namespace GFGEditor
|
|
|
public static void StartScan()
|
|
|
{
|
|
|
WriteClothingShop();
|
|
|
- WriteCJShop();
|
|
|
- WriteCJAShop();
|
|
|
+ // WriteCJShop();
|
|
|
+ // WriteCJAShop();
|
|
|
WriteGalleryShop();
|
|
|
}
|
|
|
|
|
|
public static void WriteClothingShop()
|
|
|
{
|
|
|
+
|
|
|
Dictionary<int, string> _typeIndexDic = new Dictionary<int, string>();
|
|
|
- SQLiteHelper.Instance.OpenConnection();
|
|
|
try
|
|
|
{
|
|
|
+ List<ShopCfg> clothingShopCfgs = ShopCfgArray.Instance.GetCfgsBymenu1Andmenu2(ConstStoreTabId.FU_ZHUANG_DIAN, ConstStoreSubId.FU_ZHUANG_DIAN);
|
|
|
string typeIndex = "";
|
|
|
int itemId;
|
|
|
int id;
|
|
|
- var reader = SQLiteHelper.Instance.ReadFullTable("ShopCfgClothingArray");
|
|
|
- while (reader.Read())
|
|
|
+
|
|
|
+ int index = 0;
|
|
|
+ while (index < clothingShopCfgs.Count)
|
|
|
{
|
|
|
- typeIndex = reader["_typeIndex"].ToString();
|
|
|
- itemId = int.Parse(reader["_itemId"].ToString());
|
|
|
- id = int.Parse(reader["_id"].ToString());
|
|
|
+ typeIndex = clothingShopCfgs[index].typeIndex.ToString();// reader["_typeIndex"].ToString();
|
|
|
+ itemId = clothingShopCfgs[index].itemId;// int.Parse(reader["_itemId"].ToString());
|
|
|
+ id = clothingShopCfgs[index].id;// int.Parse(reader["_id"].ToString());
|
|
|
|
|
|
int count;
|
|
|
if (Array.IndexOf(_shopItemType, typeIndex) >= 0)
|
|
@@ -56,18 +58,18 @@ namespace GFGEditor
|
|
|
}
|
|
|
}
|
|
|
_typeIndexDic.Add(id, count.ToString());
|
|
|
+ index++;
|
|
|
}
|
|
|
}
|
|
|
- catch (System.Exception e)
|
|
|
+ catch (Exception e)
|
|
|
{
|
|
|
- ET.Log.Error(e);
|
|
|
+ ET.Log.Error(e.ToString());
|
|
|
}
|
|
|
finally
|
|
|
{
|
|
|
SQLiteHelper.Instance.CloseConnection();
|
|
|
}
|
|
|
|
|
|
-
|
|
|
SQLiteHelper.Instance.OpenConnection();
|
|
|
try
|
|
|
{
|
|
@@ -76,7 +78,7 @@ namespace GFGEditor
|
|
|
{
|
|
|
var names = new string[] { "typeIndex" };
|
|
|
var values = new string[] { "" + _typeIndexDic[key] };
|
|
|
- SQLiteHelper.Instance.UpdateValues(nameof(ShopCfgClothingArray), names, values, "id", key.ToString());
|
|
|
+ SQLiteHelper.Instance.UpdateValues(nameof(ShopCfgArray), names, values, "id", key.ToString());
|
|
|
}
|
|
|
}
|
|
|
catch (Exception e)
|
|
@@ -92,228 +94,228 @@ namespace GFGEditor
|
|
|
|
|
|
public static void WriteCJShop()
|
|
|
{
|
|
|
- Dictionary<int, string> _typeIndexDic = new Dictionary<int, string>();
|
|
|
- SQLiteHelper.Instance.OpenConnection();
|
|
|
- try
|
|
|
- {
|
|
|
- string typeIndex = "";
|
|
|
- int itemId;
|
|
|
- int id;
|
|
|
- var reader = SQLiteHelper.Instance.ReadFullTable("ShopCfgCJArray");
|
|
|
- while (reader.Read())
|
|
|
- {
|
|
|
- typeIndex = reader["_typeIndex"].ToString();
|
|
|
- itemId = int.Parse(reader["_itemId"].ToString());
|
|
|
- id = int.Parse(reader["_id"].ToString());
|
|
|
-
|
|
|
- int count;
|
|
|
- if (Array.IndexOf(_shopItemType, typeIndex) >= 0)
|
|
|
- {
|
|
|
- count = Array.IndexOf(_shopItemType, typeIndex);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemId);
|
|
|
- string itemType = ItemTypeCfgArray.Instance.GetCfg(itemCfg.subType).type.ToString();
|
|
|
-
|
|
|
- if (Array.IndexOf(_shopItemType, itemType) >= 0)
|
|
|
- {
|
|
|
- count = Array.IndexOf(_shopItemType, itemType);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- count = _shopItemType.Length - 1;
|
|
|
- }
|
|
|
- }
|
|
|
- _typeIndexDic.Add(id, count.ToString());
|
|
|
- }
|
|
|
- }
|
|
|
- catch (System.Exception e)
|
|
|
- {
|
|
|
- ET.Log.Error(e);
|
|
|
- }
|
|
|
- finally
|
|
|
- {
|
|
|
- SQLiteHelper.Instance.CloseConnection();
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- SQLiteHelper.Instance.OpenConnection();
|
|
|
- try
|
|
|
- {
|
|
|
- ICollection keys = _typeIndexDic.Keys;
|
|
|
- foreach (int key in keys)
|
|
|
- {
|
|
|
-
|
|
|
- var names = new string[] { "typeIndex" };
|
|
|
- var values = new string[] { "" + _typeIndexDic[key] };
|
|
|
- SQLiteHelper.Instance.UpdateValues(nameof(ShopCfgCJArray), names, values, "id", key.ToString());
|
|
|
- }
|
|
|
- }
|
|
|
- catch (Exception e)
|
|
|
- {
|
|
|
- ET.Log.Error(e.ToString());
|
|
|
- }
|
|
|
- finally
|
|
|
- {
|
|
|
- SQLiteHelper.Instance.CloseConnection();
|
|
|
- }
|
|
|
+ // Dictionary<int, string> _typeIndexDic = new Dictionary<int, string>();
|
|
|
+ // SQLiteHelper.Instance.OpenConnection();
|
|
|
+ // try
|
|
|
+ // {
|
|
|
+ // string typeIndex = "";
|
|
|
+ // int itemId;
|
|
|
+ // int id;
|
|
|
+ // var reader = SQLiteHelper.Instance.ReadFullTable("ShopCfgCJArray");
|
|
|
+ // while (reader.Read())
|
|
|
+ // {
|
|
|
+ // typeIndex = reader["_typeIndex"].ToString();
|
|
|
+ // itemId = int.Parse(reader["_itemId"].ToString());
|
|
|
+ // id = int.Parse(reader["_id"].ToString());
|
|
|
+
|
|
|
+ // int count;
|
|
|
+ // if (Array.IndexOf(_shopItemType, typeIndex) >= 0)
|
|
|
+ // {
|
|
|
+ // count = Array.IndexOf(_shopItemType, typeIndex);
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemId);
|
|
|
+ // string itemType = ItemTypeCfgArray.Instance.GetCfg(itemCfg.subType).type.ToString();
|
|
|
+
|
|
|
+ // if (Array.IndexOf(_shopItemType, itemType) >= 0)
|
|
|
+ // {
|
|
|
+ // count = Array.IndexOf(_shopItemType, itemType);
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // count = _shopItemType.Length - 1;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // _typeIndexDic.Add(id, count.ToString());
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // catch (System.Exception e)
|
|
|
+ // {
|
|
|
+ // ET.Log.Error(e);
|
|
|
+ // }
|
|
|
+ // finally
|
|
|
+ // {
|
|
|
+ // SQLiteHelper.Instance.CloseConnection();
|
|
|
+ // }
|
|
|
+
|
|
|
+
|
|
|
+ // SQLiteHelper.Instance.OpenConnection();
|
|
|
+ // try
|
|
|
+ // {
|
|
|
+ // ICollection keys = _typeIndexDic.Keys;
|
|
|
+ // foreach (int key in keys)
|
|
|
+ // {
|
|
|
+
|
|
|
+ // var names = new string[] { "typeIndex" };
|
|
|
+ // var values = new string[] { "" + _typeIndexDic[key] };
|
|
|
+ // SQLiteHelper.Instance.UpdateValues(nameof(ShopCfgCJArray), names, values, "id", key.ToString());
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // catch (Exception e)
|
|
|
+ // {
|
|
|
+ // ET.Log.Error(e.ToString());
|
|
|
+ // }
|
|
|
+ // finally
|
|
|
+ // {
|
|
|
+ // SQLiteHelper.Instance.CloseConnection();
|
|
|
+ // }
|
|
|
|
|
|
}
|
|
|
|
|
|
public static void WriteCJAShop()
|
|
|
{
|
|
|
- Dictionary<int, string> _typeIndexDic = new Dictionary<int, string>();
|
|
|
-
|
|
|
- SQLiteHelper.Instance.OpenConnection();
|
|
|
- try
|
|
|
- {
|
|
|
- string typeIndex = "";
|
|
|
- int itemId;
|
|
|
- int id;
|
|
|
- var reader = SQLiteHelper.Instance.ReadFullTable("ShopCfgCJAArray");
|
|
|
- while (reader.Read())
|
|
|
- {
|
|
|
- typeIndex = reader["_typeIndex"].ToString();
|
|
|
- itemId = int.Parse(reader["_itemId"].ToString());
|
|
|
- id = int.Parse(reader["_id"].ToString());
|
|
|
-
|
|
|
- int count;
|
|
|
- if (Array.IndexOf(_shopItemType, typeIndex) >= 0)
|
|
|
- {
|
|
|
- count = Array.IndexOf(_shopItemType, typeIndex);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemId);
|
|
|
- string itemType = ItemTypeCfgArray.Instance.GetCfg(itemCfg.subType).type.ToString();
|
|
|
-
|
|
|
- if (Array.IndexOf(_shopItemType, itemType) >= 0)
|
|
|
- {
|
|
|
- count = Array.IndexOf(_shopItemType, itemType);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- count = _shopItemType.Length - 1;
|
|
|
- }
|
|
|
- }
|
|
|
- _typeIndexDic.Add(id, count.ToString());
|
|
|
- }
|
|
|
- }
|
|
|
- catch (System.Exception e)
|
|
|
- {
|
|
|
- ET.Log.Error(e);
|
|
|
- }
|
|
|
- finally
|
|
|
- {
|
|
|
- SQLiteHelper.Instance.CloseConnection();
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- SQLiteHelper.Instance.OpenConnection();
|
|
|
- try
|
|
|
- {
|
|
|
- ICollection keys = _typeIndexDic.Keys;
|
|
|
- foreach (int key in keys)
|
|
|
- {
|
|
|
-
|
|
|
- var names = new string[] { "typeIndex" };
|
|
|
- var values = new string[] { "" + _typeIndexDic[key] };
|
|
|
- SQLiteHelper.Instance.UpdateValues(nameof(ShopCfgCJAArray), names, values, "id", key.ToString());
|
|
|
- }
|
|
|
- }
|
|
|
- catch (Exception e)
|
|
|
- {
|
|
|
- ET.Log.Error(e.ToString());
|
|
|
- }
|
|
|
- finally
|
|
|
- {
|
|
|
- SQLiteHelper.Instance.CloseConnection();
|
|
|
- }
|
|
|
+ // Dictionary<int, string> _typeIndexDic = new Dictionary<int, string>();
|
|
|
+
|
|
|
+ // SQLiteHelper.Instance.OpenConnection();
|
|
|
+ // try
|
|
|
+ // {
|
|
|
+ // string typeIndex = "";
|
|
|
+ // int itemId;
|
|
|
+ // int id;
|
|
|
+ // var reader = SQLiteHelper.Instance.ReadFullTable("ShopCfgCJAArray");
|
|
|
+ // while (reader.Read())
|
|
|
+ // {
|
|
|
+ // typeIndex = reader["_typeIndex"].ToString();
|
|
|
+ // itemId = int.Parse(reader["_itemId"].ToString());
|
|
|
+ // id = int.Parse(reader["_id"].ToString());
|
|
|
+
|
|
|
+ // int count;
|
|
|
+ // if (Array.IndexOf(_shopItemType, typeIndex) >= 0)
|
|
|
+ // {
|
|
|
+ // count = Array.IndexOf(_shopItemType, typeIndex);
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemId);
|
|
|
+ // string itemType = ItemTypeCfgArray.Instance.GetCfg(itemCfg.subType).type.ToString();
|
|
|
+
|
|
|
+ // if (Array.IndexOf(_shopItemType, itemType) >= 0)
|
|
|
+ // {
|
|
|
+ // count = Array.IndexOf(_shopItemType, itemType);
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // count = _shopItemType.Length - 1;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // _typeIndexDic.Add(id, count.ToString());
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // catch (System.Exception e)
|
|
|
+ // {
|
|
|
+ // ET.Log.Error(e);
|
|
|
+ // }
|
|
|
+ // finally
|
|
|
+ // {
|
|
|
+ // SQLiteHelper.Instance.CloseConnection();
|
|
|
+ // }
|
|
|
+
|
|
|
+
|
|
|
+ // SQLiteHelper.Instance.OpenConnection();
|
|
|
+ // try
|
|
|
+ // {
|
|
|
+ // ICollection keys = _typeIndexDic.Keys;
|
|
|
+ // foreach (int key in keys)
|
|
|
+ // {
|
|
|
+
|
|
|
+ // var names = new string[] { "typeIndex" };
|
|
|
+ // var values = new string[] { "" + _typeIndexDic[key] };
|
|
|
+ // SQLiteHelper.Instance.UpdateValues(nameof(ShopCfgCJAArray), names, values, "id", key.ToString());
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // catch (Exception e)
|
|
|
+ // {
|
|
|
+ // ET.Log.Error(e.ToString());
|
|
|
+ // }
|
|
|
+ // finally
|
|
|
+ // {
|
|
|
+ // SQLiteHelper.Instance.CloseConnection();
|
|
|
+ // }
|
|
|
}
|
|
|
|
|
|
|
|
|
public static void WriteGalleryShop()
|
|
|
{
|
|
|
- Dictionary<int, string> _typeIndexDic = new Dictionary<int, string>();
|
|
|
-
|
|
|
- SQLiteHelper.Instance.OpenConnection();
|
|
|
- try
|
|
|
- {
|
|
|
- string typeIndex = "";
|
|
|
- int itemId;
|
|
|
- int id;
|
|
|
- var reader = SQLiteHelper.Instance.ReadFullTable("ShopCfgGalleryArray");
|
|
|
- while (reader.Read())
|
|
|
- {
|
|
|
- typeIndex = reader["_typeIndex"].ToString();
|
|
|
- itemId = int.Parse(reader["_itemId"].ToString());
|
|
|
- id = int.Parse(reader["_id"].ToString());
|
|
|
-
|
|
|
- int count = 2;
|
|
|
-
|
|
|
- ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemId);
|
|
|
-
|
|
|
- if (itemCfg.itemType == ConstItemType.DRESS_UP)
|
|
|
- {
|
|
|
- if (itemCfg.subType == ConstDressUpItemType.BEI_JING)
|
|
|
- {
|
|
|
- count = 0;//背景
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- count = 2;//道具
|
|
|
- }
|
|
|
- }
|
|
|
- else if (itemCfg.itemType == ConstItemType.PHOTOGRAPH)
|
|
|
- {
|
|
|
- if (itemCfg.subType == ConstItemSubType.PHOTOGRAPH_NPC)
|
|
|
- {
|
|
|
- count = 1;//人物
|
|
|
- }
|
|
|
- else if (itemCfg.subType == ConstItemSubType.PHOTOGRAPH_BOREDR)
|
|
|
- {
|
|
|
- count = 3;//npc
|
|
|
- }
|
|
|
- else if (itemCfg.subType == ConstItemSubType.PHOTOGRAPH_EFFECT)
|
|
|
- {
|
|
|
- count = 4;//滤镜
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- _typeIndexDic.Add(id, count.ToString());
|
|
|
- }
|
|
|
- }
|
|
|
- catch (System.Exception e)
|
|
|
- {
|
|
|
- ET.Log.Error(e);
|
|
|
- }
|
|
|
- finally
|
|
|
- {
|
|
|
- SQLiteHelper.Instance.CloseConnection();
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- SQLiteHelper.Instance.OpenConnection();
|
|
|
- try
|
|
|
- {
|
|
|
- ICollection keys = _typeIndexDic.Keys;
|
|
|
- foreach (int key in keys)
|
|
|
- {
|
|
|
-
|
|
|
- var names = new string[] { "typeIndex" };
|
|
|
- var values = new string[] { "" + _typeIndexDic[key] };
|
|
|
- SQLiteHelper.Instance.UpdateValues(nameof(ShopCfgGalleryArray), names, values, "id", key.ToString());
|
|
|
- }
|
|
|
- }
|
|
|
- catch (Exception e)
|
|
|
- {
|
|
|
- ET.Log.Error(e.ToString());
|
|
|
- }
|
|
|
- finally
|
|
|
- {
|
|
|
- SQLiteHelper.Instance.CloseConnection();
|
|
|
- }
|
|
|
+ // Dictionary<int, string> _typeIndexDic = new Dictionary<int, string>();
|
|
|
+
|
|
|
+ // SQLiteHelper.Instance.OpenConnection();
|
|
|
+ // try
|
|
|
+ // {
|
|
|
+ // string typeIndex = "";
|
|
|
+ // int itemId;
|
|
|
+ // int id;
|
|
|
+ // var reader = SQLiteHelper.Instance.ReadFullTable("ShopCfgGalleryArray");
|
|
|
+ // while (reader.Read())
|
|
|
+ // {
|
|
|
+ // typeIndex = reader["_typeIndex"].ToString();
|
|
|
+ // itemId = int.Parse(reader["_itemId"].ToString());
|
|
|
+ // id = int.Parse(reader["_id"].ToString());
|
|
|
+
|
|
|
+ // int count = 2;
|
|
|
+
|
|
|
+ // ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemId);
|
|
|
+
|
|
|
+ // if (itemCfg.itemType == ConstItemType.DRESS_UP)
|
|
|
+ // {
|
|
|
+ // if (itemCfg.subType == ConstDressUpItemType.BEI_JING)
|
|
|
+ // {
|
|
|
+ // count = 0;//背景
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // count = 2;//道具
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // else if (itemCfg.itemType == ConstItemType.PHOTOGRAPH)
|
|
|
+ // {
|
|
|
+ // if (itemCfg.subType == ConstItemSubType.PHOTOGRAPH_NPC)
|
|
|
+ // {
|
|
|
+ // count = 1;//人物
|
|
|
+ // }
|
|
|
+ // else if (itemCfg.subType == ConstItemSubType.PHOTOGRAPH_BOREDR)
|
|
|
+ // {
|
|
|
+ // count = 3;//npc
|
|
|
+ // }
|
|
|
+ // else if (itemCfg.subType == ConstItemSubType.PHOTOGRAPH_EFFECT)
|
|
|
+ // {
|
|
|
+ // count = 4;//滤镜
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+
|
|
|
+ // _typeIndexDic.Add(id, count.ToString());
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // catch (System.Exception e)
|
|
|
+ // {
|
|
|
+ // ET.Log.Error(e);
|
|
|
+ // }
|
|
|
+ // finally
|
|
|
+ // {
|
|
|
+ // SQLiteHelper.Instance.CloseConnection();
|
|
|
+ // }
|
|
|
+
|
|
|
+
|
|
|
+ // SQLiteHelper.Instance.OpenConnection();
|
|
|
+ // try
|
|
|
+ // {
|
|
|
+ // ICollection keys = _typeIndexDic.Keys;
|
|
|
+ // foreach (int key in keys)
|
|
|
+ // {
|
|
|
+
|
|
|
+ // var names = new string[] { "typeIndex" };
|
|
|
+ // var values = new string[] { "" + _typeIndexDic[key] };
|
|
|
+ // SQLiteHelper.Instance.UpdateValues(nameof(ShopCfgGalleryArray), names, values, "id", key.ToString());
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // catch (Exception e)
|
|
|
+ // {
|
|
|
+ // ET.Log.Error(e.ToString());
|
|
|
+ // }
|
|
|
+ // finally
|
|
|
+ // {
|
|
|
+ // SQLiteHelper.Instance.CloseConnection();
|
|
|
+ // }
|
|
|
}
|
|
|
}
|
|
|
}
|