فهرست منبع

添加忽略列表。

huangjinghao 1 ماه پیش
والد
کامیت
0d22b5377b
69فایلهای تغییر یافته به همراه0 افزوده شده و 5228 حذف شده
  1. BIN
      GameConfig/Code/.DS_Store
  2. 0 133
      GameConfig/Code/Client/M_Global_Config.cpp
  3. 0 37
      GameConfig/Code/Client/M_Global_Config.h
  4. 0 161
      GameConfig/Code/Client/M_equipment.cpp
  5. 0 49
      GameConfig/Code/Client/M_equipment.h
  6. 0 121
      GameConfig/Code/Client/M_everyday_task.cpp
  7. 0 35
      GameConfig/Code/Client/M_everyday_task.h
  8. 0 121
      GameConfig/Code/Client/M_fish_scheme.cpp
  9. 0 33
      GameConfig/Code/Client/M_fish_scheme.h
  10. 0 121
      GameConfig/Code/Client/M_game_battle_field.cpp
  11. 0 37
      GameConfig/Code/Client/M_game_battle_field.h
  12. 0 105
      GameConfig/Code/Client/M_game_level_config.cpp
  13. 0 31
      GameConfig/Code/Client/M_game_level_config.h
  14. 0 121
      GameConfig/Code/Client/M_hero.cpp
  15. 0 45
      GameConfig/Code/Client/M_hero.h
  16. 0 105
      GameConfig/Code/Client/M_i18n.cpp
  17. 0 29
      GameConfig/Code/Client/M_i18n.h
  18. 0 113
      GameConfig/Code/Client/M_item.cpp
  19. 0 37
      GameConfig/Code/Client/M_item.h
  20. 0 153
      GameConfig/Code/Client/M_magic_array_config.cpp
  21. 0 43
      GameConfig/Code/Client/M_magic_array_config.h
  22. 0 117
      GameConfig/Code/Client/M_monster.cpp
  23. 0 43
      GameConfig/Code/Client/M_monster.h
  24. 0 139
      GameConfig/Code/Client/M_shop.cpp
  25. 0 39
      GameConfig/Code/Client/M_shop.h
  26. 0 115
      GameConfig/Code/Client/M_skill.cpp
  27. 0 39
      GameConfig/Code/Client/M_skill.h
  28. 0 105
      GameConfig/Code/Client/M_test.cpp
  29. 0 29
      GameConfig/Code/Client/M_test.h
  30. 0 137
      GameConfig/Code/Client/M_un_lock_battle.cpp
  31. 0 39
      GameConfig/Code/Client/M_un_lock_battle.h
  32. 0 121
      GameConfig/Code/Client/M_vip_config.cpp
  33. 0 33
      GameConfig/Code/Client/M_vip_config.h
  34. 0 103
      GameConfig/Code/Client/SensitiveWordCFG.cpp
  35. 0 27
      GameConfig/Code/Client/SensitiveWordCFG.h
  36. 0 118
      GameConfig/Code/Server/M_Global_Config.cpp
  37. 0 37
      GameConfig/Code/Server/M_Global_Config.h
  38. 0 140
      GameConfig/Code/Server/M_equipment.cpp
  39. 0 49
      GameConfig/Code/Server/M_equipment.h
  40. 0 114
      GameConfig/Code/Server/M_everyday_task.cpp
  41. 0 35
      GameConfig/Code/Server/M_everyday_task.h
  42. 0 108
      GameConfig/Code/Server/M_fish_scheme.cpp
  43. 0 33
      GameConfig/Code/Server/M_fish_scheme.h
  44. 0 120
      GameConfig/Code/Server/M_game_battle_field.cpp
  45. 0 37
      GameConfig/Code/Server/M_game_battle_field.h
  46. 0 100
      GameConfig/Code/Server/M_game_level_config.cpp
  47. 0 31
      GameConfig/Code/Server/M_game_level_config.h
  48. 0 102
      GameConfig/Code/Server/M_hero.cpp
  49. 0 45
      GameConfig/Code/Server/M_hero.h
  50. 0 94
      GameConfig/Code/Server/M_i18n.cpp
  51. 0 29
      GameConfig/Code/Server/M_i18n.h
  52. 0 98
      GameConfig/Code/Server/M_item.cpp
  53. 0 37
      GameConfig/Code/Server/M_item.h
  54. 0 142
      GameConfig/Code/Server/M_magic_array_config.cpp
  55. 0 43
      GameConfig/Code/Server/M_magic_array_config.h
  56. 0 106
      GameConfig/Code/Server/M_monster.cpp
  57. 0 43
      GameConfig/Code/Server/M_monster.h
  58. 0 123
      GameConfig/Code/Server/M_shop.cpp
  59. 0 39
      GameConfig/Code/Server/M_shop.h
  60. 0 99
      GameConfig/Code/Server/M_skill.cpp
  61. 0 39
      GameConfig/Code/Server/M_skill.h
  62. 0 94
      GameConfig/Code/Server/M_test.cpp
  63. 0 29
      GameConfig/Code/Server/M_test.h
  64. 0 128
      GameConfig/Code/Server/M_un_lock_battle.cpp
  65. 0 39
      GameConfig/Code/Server/M_un_lock_battle.h
  66. 0 108
      GameConfig/Code/Server/M_vip_config.cpp
  67. 0 33
      GameConfig/Code/Server/M_vip_config.h
  68. 0 93
      GameConfig/Code/Server/SensitiveWordCFG.cpp
  69. 0 27
      GameConfig/Code/Server/SensitiveWordCFG.h

BIN
GameConfig/Code/.DS_Store


+ 0 - 133
GameConfig/Code/Client/M_Global_Config.cpp

@@ -1,133 +0,0 @@
-#include "stdafx.h"
-#include "tinyxml2/tinyxml2.h"
-#include "LuaCfgHelper.h"
-#include <iostream>
-#include <boost/algorithm/string.hpp>
-#include "M_Global_Config.h"
-std::auto_ptr<M_Global_Config> M_Global_Config::msSingleton(nullptr);
-
-int M_Global_Config::GetCount()
-{
-	return (int)mMapData.size();
-}
-
-const M_Global_ConfigData* M_Global_Config::GetData(std::string Key)
-{
-	auto it = mMapData.find(Key);
-	if (it != mMapData.end())
-	{
-		return &it->second;
-	}
-	return NULL;
-}
-
-const std::map<std::string, M_Global_ConfigData>& M_Global_Config::GetMapData()
-{
-	return mMapData;
-}
-
-void M_Global_Config::Load()
-{
-	tinyxml2::XMLDocument xmlDoc;
-	std::string content = FileUtils::getInstance()->getStringFromFile("Config/M_Global_Config.xml");
-	auto result = xmlDoc.Parse(content.c_str(), content.length());
-	if (result != tinyxml2::XML_SUCCESS)
-	{
-		CCLOGERROR("Result:%d", result);
-		CCASSERT(false, "result != tinyxml2::XML_SUCCESS");
-		return;
-	}
-	auto root = xmlDoc.RootElement();
-	if (root == NULL)
-	{
-		CCASSERT(false, "root == NULL");
-		return;
-	}
-	auto element = root->FirstChildElement("Data");
-	while (element != NULL)
-	{
-		M_Global_ConfigData data;
-		data.mKey = element->Attribute("Key");
-		data.mDesc = element->Attribute("Desc");
-		data.mIntValue = element->IntAttribute("IntValue");
-		{
-			const char* IntListValue = element->Attribute("IntListValue");
-			std::vector<std::string> vecIntListValue;
-			boost::split(vecIntListValue, IntListValue, boost::is_any_of(","));
-			int temp;
-			for (unsigned int i = 0; i < vecIntListValue.size(); i++)
-			{
-				if (tinyxml2::XMLUtil::ToInt(vecIntListValue[i].c_str(), &temp))
-				{
-					data.mIntListValue.push_back(temp);
-				}
-			}
-		}
-		data.mStrValue = element->Attribute("StrValue");
-		{
-			const char* StrListValue = element->Attribute("StrListValue");
-			std::vector<std::string> vecStrListValue;
-			boost::split(vecStrListValue, StrListValue, boost::is_any_of(","));
-			for (unsigned int i = 0; i < vecStrListValue.size(); i++)
-			{
-				data.mStrListValue.push_back(vecStrListValue[i]);
-			}
-		}
-		data.mBoolValue = element->BoolAttribute("BoolValue");
-		if (mMapData.find(data.mKey) != mMapData.end())std::cout <<"data refind:" << data.mKey << std::endl;
-		CCASSERT(mMapData.find(data.mKey) == mMapData.end(), "data.mKey is exists");
-		mMapData.insert(std::make_pair(data.mKey, data));
-		element = element->NextSiblingElement();
-	}
-	CCLOG("M_Global_Config Loaded. Load Data:%u", mMapData.size());
-}
-
-void M_Global_Config::LoadLua()
-{
-	LuaEngine::getInstance()->executeScriptFile("config/M_Global_Config");
-	lua_State* L = LuaEngine::getInstance()->getLuaStack()->getLuaState();
-	lua_getglobal(L, "M_Global_Config");
-	CCASSERT(lua_istable(L, -1) == 1, "is not table");
-	lua_pushstring(L, "datas");
-	lua_gettable(L, -2);
-	CCASSERT(lua_istable(L, -1) == 1, "is not table");
-	lua_pushnil(L);
-	while(lua_next(L, 2))
-	{
-		CCASSERT(lua_istable(L, -1) == 1, "is not table");
-		M_Global_ConfigData data;
-		LuaCfgHelper::readString(L, "Key", data.mKey);
-		LuaCfgHelper::readString(L, "Desc", data.mDesc);
-		LuaCfgHelper::readInt(L, "IntValue", data.mIntValue);
-		LuaCfgHelper::readVectorInt(L, "IntListValue", data.mIntListValue);
-		LuaCfgHelper::readString(L, "StrValue", data.mStrValue);
-		LuaCfgHelper::readVectorString(L, "StrListValue", data.mStrListValue);
-		LuaCfgHelper::readBool(L, "BoolValue", data.mBoolValue);
-		if (mMapData.find(data.mKey) != mMapData.end())std::cout <<"data refind:" << data.mKey << std::endl;
-		CCASSERT(mMapData.find(data.mKey) == mMapData.end(), "data.mKey is exists");
-		mMapData.insert(std::make_pair(data.mKey, data));
-		lua_pop(L, 1);
-	}
-	lua_settop(L, 0);
-	CCLOG("M_Global_Config Loaded. Load Data:%u", mMapData.size());
-}
-
-void M_Global_Config::Reload()
-{
-	mMapData.clear();
-	Load();
-}
-
-M_Global_Config* M_Global_Config::GetSingleton()
-{
-	if (msSingleton.get() == nullptr)
-	{
-		msSingleton.reset(new M_Global_Config());
-	}
-	return msSingleton.get();
-}
-
-void M_Global_Config::Release()
-{
-	msSingleton.reset(nullptr);
-}

+ 0 - 37
GameConfig/Code/Client/M_Global_Config.h

@@ -1,37 +0,0 @@
-#pragma once
-#include <map>
-struct M_Global_ConfigData
-{
-	//Key
-	std::string mKey;
-	//备注
-	std::string mDesc;
-	//数值
-	int mIntValue;
-	//数值列表
-	std::vector<int> mIntListValue;
-	//字符串
-	std::string mStrValue;
-	//字符串列表
-	std::vector<std::string> mStrListValue;
-	//布尔值参数
-	bool mBoolValue;
-};
-
-class M_Global_Config
-{
-public:
-private:
-	static std::auto_ptr<M_Global_Config> msSingleton;
-public:
-	int GetCount();
-	const M_Global_ConfigData* GetData(std::string Key);
-	const std::map<std::string, M_Global_ConfigData>& GetMapData();
-	void Load();
-	void LoadLua();
-	void Reload();
-	static M_Global_Config* GetSingleton();
-	static void Release();
-private:
-	std::map<std::string, M_Global_ConfigData> mMapData;
-};

+ 0 - 161
GameConfig/Code/Client/M_equipment.cpp

@@ -1,161 +0,0 @@
-#include "stdafx.h"
-#include "tinyxml2/tinyxml2.h"
-#include "LuaCfgHelper.h"
-#include <iostream>
-#include <boost/algorithm/string.hpp>
-#include "M_equipment.h"
-std::auto_ptr<M_equipment> M_equipment::msSingleton(nullptr);
-
-int M_equipment::GetCount()
-{
-	return (int)mMapData.size();
-}
-
-const M_equipmentData* M_equipment::GetData(int ID)
-{
-	auto it = mMapData.find(ID);
-	if (it != mMapData.end())
-	{
-		return &it->second;
-	}
-	return NULL;
-}
-
-const std::map<int, M_equipmentData>& M_equipment::GetMapData()
-{
-	return mMapData;
-}
-
-void M_equipment::Load()
-{
-	tinyxml2::XMLDocument xmlDoc;
-	std::string content = FileUtils::getInstance()->getStringFromFile("Config/M_equipment.xml");
-	auto result = xmlDoc.Parse(content.c_str(), content.length());
-	if (result != tinyxml2::XML_SUCCESS)
-	{
-		CCLOGERROR("Result:%d", result);
-		CCASSERT(false, "result != tinyxml2::XML_SUCCESS");
-		return;
-	}
-	auto root = xmlDoc.RootElement();
-	if (root == NULL)
-	{
-		CCASSERT(false, "root == NULL");
-		return;
-	}
-	auto element = root->FirstChildElement("Data");
-	while (element != NULL)
-	{
-		M_equipmentData data;
-		data.mID = element->IntAttribute("ID");
-		data.mitemType = element->IntAttribute("itemType");
-		data.mleve = element->IntAttribute("leve");
-		data.mquality = element->Attribute("quality");
-		{
-			const char* cost1 = element->Attribute("cost1");
-			std::vector<std::string> veccost1;
-			boost::split(veccost1, cost1, boost::is_any_of(","));
-			int temp;
-			for (unsigned int i = 0; i < veccost1.size(); i++)
-			{
-				if (tinyxml2::XMLUtil::ToInt(veccost1[i].c_str(), &temp))
-				{
-					data.mcost1.push_back(temp);
-				}
-			}
-		}
-		{
-			const char* cost2 = element->Attribute("cost2");
-			std::vector<std::string> veccost2;
-			boost::split(veccost2, cost2, boost::is_any_of(","));
-			int temp;
-			for (unsigned int i = 0; i < veccost2.size(); i++)
-			{
-				if (tinyxml2::XMLUtil::ToInt(veccost2[i].c_str(), &temp))
-				{
-					data.mcost2.push_back(temp);
-				}
-			}
-		}
-		{
-			const char* reward = element->Attribute("reward");
-			std::vector<std::string> vecreward;
-			boost::split(vecreward, reward, boost::is_any_of(","));
-			int temp;
-			for (unsigned int i = 0; i < vecreward.size(); i++)
-			{
-				if (tinyxml2::XMLUtil::ToInt(vecreward[i].c_str(), &temp))
-				{
-					data.mreward.push_back(temp);
-				}
-			}
-		}
-		data.matk = element->IntAttribute("atk");
-		data.mhp = element->IntAttribute("hp");
-		data.matkpct = element->IntAttribute("atkpct");
-		data.mhppct = element->IntAttribute("hppct");
-		data.mcrtpct = element->IntAttribute("crtpct");
-		data.mmovepct = element->IntAttribute("movepct");
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		CCASSERT(mMapData.find(data.mID) == mMapData.end(), "data.mID is exists");
-		mMapData.insert(std::make_pair(data.mID, data));
-		element = element->NextSiblingElement();
-	}
-	CCLOG("M_equipment Loaded. Load Data:%u", mMapData.size());
-}
-
-void M_equipment::LoadLua()
-{
-	LuaEngine::getInstance()->executeScriptFile("config/M_equipment");
-	lua_State* L = LuaEngine::getInstance()->getLuaStack()->getLuaState();
-	lua_getglobal(L, "M_equipment");
-	CCASSERT(lua_istable(L, -1) == 1, "is not table");
-	lua_pushstring(L, "datas");
-	lua_gettable(L, -2);
-	CCASSERT(lua_istable(L, -1) == 1, "is not table");
-	lua_pushnil(L);
-	while(lua_next(L, 2))
-	{
-		CCASSERT(lua_istable(L, -1) == 1, "is not table");
-		M_equipmentData data;
-		LuaCfgHelper::readInt(L, "ID", data.mID);
-		LuaCfgHelper::readInt(L, "itemType", data.mitemType);
-		LuaCfgHelper::readInt(L, "leve", data.mleve);
-		LuaCfgHelper::readString(L, "quality", data.mquality);
-		LuaCfgHelper::readVectorInt(L, "cost1", data.mcost1);
-		LuaCfgHelper::readVectorInt(L, "cost2", data.mcost2);
-		LuaCfgHelper::readVectorInt(L, "reward", data.mreward);
-		LuaCfgHelper::readInt(L, "atk", data.matk);
-		LuaCfgHelper::readInt(L, "hp", data.mhp);
-		LuaCfgHelper::readInt(L, "atkpct", data.matkpct);
-		LuaCfgHelper::readInt(L, "hppct", data.mhppct);
-		LuaCfgHelper::readInt(L, "crtpct", data.mcrtpct);
-		LuaCfgHelper::readInt(L, "movepct", data.mmovepct);
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		CCASSERT(mMapData.find(data.mID) == mMapData.end(), "data.mID is exists");
-		mMapData.insert(std::make_pair(data.mID, data));
-		lua_pop(L, 1);
-	}
-	lua_settop(L, 0);
-	CCLOG("M_equipment Loaded. Load Data:%u", mMapData.size());
-}
-
-void M_equipment::Reload()
-{
-	mMapData.clear();
-	Load();
-}
-
-M_equipment* M_equipment::GetSingleton()
-{
-	if (msSingleton.get() == nullptr)
-	{
-		msSingleton.reset(new M_equipment());
-	}
-	return msSingleton.get();
-}
-
-void M_equipment::Release()
-{
-	msSingleton.reset(nullptr);
-}

+ 0 - 49
GameConfig/Code/Client/M_equipment.h

@@ -1,49 +0,0 @@
-#pragma once
-#include <map>
-struct M_equipmentData
-{
-	//ID
-	int mID;
-	//装备类型
-	int mitemType;
-	//装备等级
-	int mleve;
-	//装备品质
-	std::string mquality;
-	//所需材料(道具ID,数量)
-	std::vector<int> mcost1;
-	//所需材料(道具ID,数量)
-	std::vector<int> mcost2;
-	//奖励(道具ID,数量)
-	std::vector<int> mreward;
-	//攻击
-	int matk;
-	//生命
-	int mhp;
-	//攻击百分比
-	int matkpct;
-	//生命百分比
-	int mhppct;
-	//暴击百分比
-	int mcrtpct;
-	//移动百分比
-	int mmovepct;
-};
-
-class M_equipment
-{
-public:
-private:
-	static std::auto_ptr<M_equipment> msSingleton;
-public:
-	int GetCount();
-	const M_equipmentData* GetData(int ID);
-	const std::map<int, M_equipmentData>& GetMapData();
-	void Load();
-	void LoadLua();
-	void Reload();
-	static M_equipment* GetSingleton();
-	static void Release();
-private:
-	std::map<int, M_equipmentData> mMapData;
-};

+ 0 - 121
GameConfig/Code/Client/M_everyday_task.cpp

@@ -1,121 +0,0 @@
-#include "stdafx.h"
-#include "tinyxml2/tinyxml2.h"
-#include "LuaCfgHelper.h"
-#include <iostream>
-#include <boost/algorithm/string.hpp>
-#include "M_everyday_task.h"
-std::auto_ptr<M_everyday_task> M_everyday_task::msSingleton(nullptr);
-
-int M_everyday_task::GetCount()
-{
-	return (int)mMapData.size();
-}
-
-const M_everyday_taskData* M_everyday_task::GetData(int ID)
-{
-	auto it = mMapData.find(ID);
-	if (it != mMapData.end())
-	{
-		return &it->second;
-	}
-	return NULL;
-}
-
-const std::map<int, M_everyday_taskData>& M_everyday_task::GetMapData()
-{
-	return mMapData;
-}
-
-void M_everyday_task::Load()
-{
-	tinyxml2::XMLDocument xmlDoc;
-	std::string content = FileUtils::getInstance()->getStringFromFile("Config/M_everyday_task.xml");
-	auto result = xmlDoc.Parse(content.c_str(), content.length());
-	if (result != tinyxml2::XML_SUCCESS)
-	{
-		CCLOGERROR("Result:%d", result);
-		CCASSERT(false, "result != tinyxml2::XML_SUCCESS");
-		return;
-	}
-	auto root = xmlDoc.RootElement();
-	if (root == NULL)
-	{
-		CCASSERT(false, "root == NULL");
-		return;
-	}
-	auto element = root->FirstChildElement("Data");
-	while (element != NULL)
-	{
-		M_everyday_taskData data;
-		data.mID = element->IntAttribute("ID");
-		data.mtaskType = element->IntAttribute("taskType");
-		data.mdes = element->Attribute("des");
-		{
-			const char* reward = element->Attribute("reward");
-			std::vector<std::string> vecreward;
-			boost::split(vecreward, reward, boost::is_any_of(","));
-			int temp;
-			for (unsigned int i = 0; i < vecreward.size(); i++)
-			{
-				if (tinyxml2::XMLUtil::ToInt(vecreward[i].c_str(), &temp))
-				{
-					data.mreward.push_back(temp);
-				}
-			}
-		}
-		data.munlock = element->IntAttribute("unlock");
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		CCASSERT(mMapData.find(data.mID) == mMapData.end(), "data.mID is exists");
-		mMapData.insert(std::make_pair(data.mID, data));
-		element = element->NextSiblingElement();
-	}
-	CCLOG("M_everyday_task Loaded. Load Data:%u", mMapData.size());
-}
-
-void M_everyday_task::LoadLua()
-{
-	LuaEngine::getInstance()->executeScriptFile("config/M_everyday_task");
-	lua_State* L = LuaEngine::getInstance()->getLuaStack()->getLuaState();
-	lua_getglobal(L, "M_everyday_task");
-	CCASSERT(lua_istable(L, -1) == 1, "is not table");
-	lua_pushstring(L, "datas");
-	lua_gettable(L, -2);
-	CCASSERT(lua_istable(L, -1) == 1, "is not table");
-	lua_pushnil(L);
-	while(lua_next(L, 2))
-	{
-		CCASSERT(lua_istable(L, -1) == 1, "is not table");
-		M_everyday_taskData data;
-		LuaCfgHelper::readInt(L, "ID", data.mID);
-		LuaCfgHelper::readInt(L, "taskType", data.mtaskType);
-		LuaCfgHelper::readString(L, "des", data.mdes);
-		LuaCfgHelper::readVectorInt(L, "reward", data.mreward);
-		LuaCfgHelper::readInt(L, "unlock", data.munlock);
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		CCASSERT(mMapData.find(data.mID) == mMapData.end(), "data.mID is exists");
-		mMapData.insert(std::make_pair(data.mID, data));
-		lua_pop(L, 1);
-	}
-	lua_settop(L, 0);
-	CCLOG("M_everyday_task Loaded. Load Data:%u", mMapData.size());
-}
-
-void M_everyday_task::Reload()
-{
-	mMapData.clear();
-	Load();
-}
-
-M_everyday_task* M_everyday_task::GetSingleton()
-{
-	if (msSingleton.get() == nullptr)
-	{
-		msSingleton.reset(new M_everyday_task());
-	}
-	return msSingleton.get();
-}
-
-void M_everyday_task::Release()
-{
-	msSingleton.reset(nullptr);
-}

+ 0 - 35
GameConfig/Code/Client/M_everyday_task.h

@@ -1,35 +0,0 @@
-#pragma once
-#include <map>
-struct M_everyday_taskData
-{
-	//ID
-	int mID;
-	//任务类型
-	int mtaskType;
-	//描述
-	std::string mdes;
-	//参数
-	int64_t mparameter;
-	//奖励
-	std::vector<int> mreward;
-	//VIP解锁等级
-	int munlock;
-};
-
-class M_everyday_task
-{
-public:
-private:
-	static std::auto_ptr<M_everyday_task> msSingleton;
-public:
-	int GetCount();
-	const M_everyday_taskData* GetData(int ID);
-	const std::map<int, M_everyday_taskData>& GetMapData();
-	void Load();
-	void LoadLua();
-	void Reload();
-	static M_everyday_task* GetSingleton();
-	static void Release();
-private:
-	std::map<int, M_everyday_taskData> mMapData;
-};

+ 0 - 121
GameConfig/Code/Client/M_fish_scheme.cpp

@@ -1,121 +0,0 @@
-#include "stdafx.h"
-#include "tinyxml2/tinyxml2.h"
-#include "LuaCfgHelper.h"
-#include <iostream>
-#include <boost/algorithm/string.hpp>
-#include "M_fish_scheme.h"
-std::auto_ptr<M_fish_scheme> M_fish_scheme::msSingleton(nullptr);
-
-int M_fish_scheme::GetCount()
-{
-	return (int)mMapData.size();
-}
-
-const M_fish_schemeData* M_fish_scheme::GetData(int ID)
-{
-	auto it = mMapData.find(ID);
-	if (it != mMapData.end())
-	{
-		return &it->second;
-	}
-	return NULL;
-}
-
-const std::map<int, M_fish_schemeData>& M_fish_scheme::GetMapData()
-{
-	return mMapData;
-}
-
-void M_fish_scheme::Load()
-{
-	tinyxml2::XMLDocument xmlDoc;
-	std::string content = FileUtils::getInstance()->getStringFromFile("Config/M_fish_scheme.xml");
-	auto result = xmlDoc.Parse(content.c_str(), content.length());
-	if (result != tinyxml2::XML_SUCCESS)
-	{
-		CCLOGERROR("Result:%d", result);
-		CCASSERT(false, "result != tinyxml2::XML_SUCCESS");
-		return;
-	}
-	auto root = xmlDoc.RootElement();
-	if (root == NULL)
-	{
-		CCASSERT(false, "root == NULL");
-		return;
-	}
-	auto element = root->FirstChildElement("Data");
-	while (element != NULL)
-	{
-		M_fish_schemeData data;
-		data.mID = element->IntAttribute("ID");
-		data.mmonster_id = element->IntAttribute("monster_id");
-		data.mfish_group = element->IntAttribute("fish_group");
-		data.mnum = element->IntAttribute("num");
-		{
-			const char* kill_count = element->Attribute("kill_count");
-			std::vector<std::string> veckill_count;
-			boost::split(veckill_count, kill_count, boost::is_any_of(","));
-			int temp;
-			for (unsigned int i = 0; i < veckill_count.size(); i++)
-			{
-				if (tinyxml2::XMLUtil::ToInt(veckill_count[i].c_str(), &temp))
-				{
-					data.mkill_count.push_back(temp);
-				}
-			}
-		}
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		CCASSERT(mMapData.find(data.mID) == mMapData.end(), "data.mID is exists");
-		mMapData.insert(std::make_pair(data.mID, data));
-		element = element->NextSiblingElement();
-	}
-	CCLOG("M_fish_scheme Loaded. Load Data:%u", mMapData.size());
-}
-
-void M_fish_scheme::LoadLua()
-{
-	LuaEngine::getInstance()->executeScriptFile("config/M_fish_scheme");
-	lua_State* L = LuaEngine::getInstance()->getLuaStack()->getLuaState();
-	lua_getglobal(L, "M_fish_scheme");
-	CCASSERT(lua_istable(L, -1) == 1, "is not table");
-	lua_pushstring(L, "datas");
-	lua_gettable(L, -2);
-	CCASSERT(lua_istable(L, -1) == 1, "is not table");
-	lua_pushnil(L);
-	while(lua_next(L, 2))
-	{
-		CCASSERT(lua_istable(L, -1) == 1, "is not table");
-		M_fish_schemeData data;
-		LuaCfgHelper::readInt(L, "ID", data.mID);
-		LuaCfgHelper::readInt(L, "monster_id", data.mmonster_id);
-		LuaCfgHelper::readInt(L, "fish_group", data.mfish_group);
-		LuaCfgHelper::readInt(L, "num", data.mnum);
-		LuaCfgHelper::readVectorInt(L, "kill_count", data.mkill_count);
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		CCASSERT(mMapData.find(data.mID) == mMapData.end(), "data.mID is exists");
-		mMapData.insert(std::make_pair(data.mID, data));
-		lua_pop(L, 1);
-	}
-	lua_settop(L, 0);
-	CCLOG("M_fish_scheme Loaded. Load Data:%u", mMapData.size());
-}
-
-void M_fish_scheme::Reload()
-{
-	mMapData.clear();
-	Load();
-}
-
-M_fish_scheme* M_fish_scheme::GetSingleton()
-{
-	if (msSingleton.get() == nullptr)
-	{
-		msSingleton.reset(new M_fish_scheme());
-	}
-	return msSingleton.get();
-}
-
-void M_fish_scheme::Release()
-{
-	msSingleton.reset(nullptr);
-}

+ 0 - 33
GameConfig/Code/Client/M_fish_scheme.h

@@ -1,33 +0,0 @@
-#pragma once
-#include <map>
-struct M_fish_schemeData
-{
-	//ID
-	int mID;
-	//怪物ID
-	int mmonster_id;
-	//鱼阵方案组
-	int mfish_group;
-	//数量
-	int mnum;
-	//击杀次数
-	std::vector<int> mkill_count;
-};
-
-class M_fish_scheme
-{
-public:
-private:
-	static std::auto_ptr<M_fish_scheme> msSingleton;
-public:
-	int GetCount();
-	const M_fish_schemeData* GetData(int ID);
-	const std::map<int, M_fish_schemeData>& GetMapData();
-	void Load();
-	void LoadLua();
-	void Reload();
-	static M_fish_scheme* GetSingleton();
-	static void Release();
-private:
-	std::map<int, M_fish_schemeData> mMapData;
-};

+ 0 - 121
GameConfig/Code/Client/M_game_battle_field.cpp

@@ -1,121 +0,0 @@
-#include "stdafx.h"
-#include "tinyxml2/tinyxml2.h"
-#include "LuaCfgHelper.h"
-#include <iostream>
-#include <boost/algorithm/string.hpp>
-#include "M_game_battle_field.h"
-std::auto_ptr<M_game_battle_field> M_game_battle_field::msSingleton(nullptr);
-
-int M_game_battle_field::GetCount()
-{
-	return (int)mMapData.size();
-}
-
-const M_game_battle_fieldData* M_game_battle_field::GetData(int64_t ID)
-{
-	auto it = mMapData.find(ID);
-	if (it != mMapData.end())
-	{
-		return &it->second;
-	}
-	return NULL;
-}
-
-const std::map<int64_t, M_game_battle_fieldData>& M_game_battle_field::GetMapData()
-{
-	return mMapData;
-}
-
-void M_game_battle_field::Load()
-{
-	tinyxml2::XMLDocument xmlDoc;
-	std::string content = FileUtils::getInstance()->getStringFromFile("Config/M_game_battle_field.xml");
-	auto result = xmlDoc.Parse(content.c_str(), content.length());
-	if (result != tinyxml2::XML_SUCCESS)
-	{
-		CCLOGERROR("Result:%d", result);
-		CCASSERT(false, "result != tinyxml2::XML_SUCCESS");
-		return;
-	}
-	auto root = xmlDoc.RootElement();
-	if (root == NULL)
-	{
-		CCASSERT(false, "root == NULL");
-		return;
-	}
-	auto element = root->FirstChildElement("Data");
-	while (element != NULL)
-	{
-		M_game_battle_fieldData data;
-		data.mscene_type = element->IntAttribute("scene_type");
-		data.mweight = element->IntAttribute("weight");
-		data.mmax_num = element->IntAttribute("max_num");
-		{
-			const char* kill_count = element->Attribute("kill_count");
-			std::vector<std::string> veckill_count;
-			boost::split(veckill_count, kill_count, boost::is_any_of(","));
-			int temp;
-			for (unsigned int i = 0; i < veckill_count.size(); i++)
-			{
-				if (tinyxml2::XMLUtil::ToInt(veckill_count[i].c_str(), &temp))
-				{
-					data.mkill_count.push_back(temp);
-				}
-			}
-		}
-		data.maward_drop_prob = element->FloatAttribute("award_drop_prob");
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		CCASSERT(mMapData.find(data.mID) == mMapData.end(), "data.mID is exists");
-		mMapData.insert(std::make_pair(data.mID, data));
-		element = element->NextSiblingElement();
-	}
-	CCLOG("M_game_battle_field Loaded. Load Data:%u", mMapData.size());
-}
-
-void M_game_battle_field::LoadLua()
-{
-	LuaEngine::getInstance()->executeScriptFile("config/M_game_battle_field");
-	lua_State* L = LuaEngine::getInstance()->getLuaStack()->getLuaState();
-	lua_getglobal(L, "M_game_battle_field");
-	CCASSERT(lua_istable(L, -1) == 1, "is not table");
-	lua_pushstring(L, "datas");
-	lua_gettable(L, -2);
-	CCASSERT(lua_istable(L, -1) == 1, "is not table");
-	lua_pushnil(L);
-	while(lua_next(L, 2))
-	{
-		CCASSERT(lua_istable(L, -1) == 1, "is not table");
-		M_game_battle_fieldData data;
-		LuaCfgHelper::readInt(L, "scene_type", data.mscene_type);
-		LuaCfgHelper::readInt(L, "weight", data.mweight);
-		LuaCfgHelper::readInt(L, "max_num", data.mmax_num);
-		LuaCfgHelper::readVectorInt(L, "kill_count", data.mkill_count);
-		LuaCfgHelper::readFloat(L, "award_drop_prob", data.maward_drop_prob);
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		CCASSERT(mMapData.find(data.mID) == mMapData.end(), "data.mID is exists");
-		mMapData.insert(std::make_pair(data.mID, data));
-		lua_pop(L, 1);
-	}
-	lua_settop(L, 0);
-	CCLOG("M_game_battle_field Loaded. Load Data:%u", mMapData.size());
-}
-
-void M_game_battle_field::Reload()
-{
-	mMapData.clear();
-	Load();
-}
-
-M_game_battle_field* M_game_battle_field::GetSingleton()
-{
-	if (msSingleton.get() == nullptr)
-	{
-		msSingleton.reset(new M_game_battle_field());
-	}
-	return msSingleton.get();
-}
-
-void M_game_battle_field::Release()
-{
-	msSingleton.reset(nullptr);
-}

+ 0 - 37
GameConfig/Code/Client/M_game_battle_field.h

@@ -1,37 +0,0 @@
-#pragma once
-#include <map>
-struct M_game_battle_fieldData
-{
-	//ID
-	int64_t mID;
-	//怪物ID
-	int64_t mmonster_id;
-	//场地类型
-	int mscene_type;
-	//出场权重
-	int mweight;
-	//最大数量
-	int mmax_num;
-	//击杀次数
-	std::vector<int> mkill_count;
-	//魔币掉落概率(百分比)
-	float maward_drop_prob;
-};
-
-class M_game_battle_field
-{
-public:
-private:
-	static std::auto_ptr<M_game_battle_field> msSingleton;
-public:
-	int GetCount();
-	const M_game_battle_fieldData* GetData(int64_t ID);
-	const std::map<int64_t, M_game_battle_fieldData>& GetMapData();
-	void Load();
-	void LoadLua();
-	void Reload();
-	static M_game_battle_field* GetSingleton();
-	static void Release();
-private:
-	std::map<int64_t, M_game_battle_fieldData> mMapData;
-};

+ 0 - 105
GameConfig/Code/Client/M_game_level_config.cpp

@@ -1,105 +0,0 @@
-#include "stdafx.h"
-#include "tinyxml2/tinyxml2.h"
-#include "LuaCfgHelper.h"
-#include <iostream>
-#include <boost/algorithm/string.hpp>
-#include "M_game_level_config.h"
-std::auto_ptr<M_game_level_config> M_game_level_config::msSingleton(nullptr);
-
-int M_game_level_config::GetCount()
-{
-	return (int)mMapData.size();
-}
-
-const M_game_level_configData* M_game_level_config::GetData(int64_t ID)
-{
-	auto it = mMapData.find(ID);
-	if (it != mMapData.end())
-	{
-		return &it->second;
-	}
-	return NULL;
-}
-
-const std::map<int64_t, M_game_level_configData>& M_game_level_config::GetMapData()
-{
-	return mMapData;
-}
-
-void M_game_level_config::Load()
-{
-	tinyxml2::XMLDocument xmlDoc;
-	std::string content = FileUtils::getInstance()->getStringFromFile("Config/M_game_level_config.xml");
-	auto result = xmlDoc.Parse(content.c_str(), content.length());
-	if (result != tinyxml2::XML_SUCCESS)
-	{
-		CCLOGERROR("Result:%d", result);
-		CCASSERT(false, "result != tinyxml2::XML_SUCCESS");
-		return;
-	}
-	auto root = xmlDoc.RootElement();
-	if (root == NULL)
-	{
-		CCASSERT(false, "root == NULL");
-		return;
-	}
-	auto element = root->FirstChildElement("Data");
-	while (element != NULL)
-	{
-		M_game_level_configData data;
-		data.mleve = element->IntAttribute("leve");
-		data.mup_exp = element->IntAttribute("up_exp");
-		data.mmonster_num = element->IntAttribute("monster_num");
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		CCASSERT(mMapData.find(data.mID) == mMapData.end(), "data.mID is exists");
-		mMapData.insert(std::make_pair(data.mID, data));
-		element = element->NextSiblingElement();
-	}
-	CCLOG("M_game_level_config Loaded. Load Data:%u", mMapData.size());
-}
-
-void M_game_level_config::LoadLua()
-{
-	LuaEngine::getInstance()->executeScriptFile("config/M_game_level_config");
-	lua_State* L = LuaEngine::getInstance()->getLuaStack()->getLuaState();
-	lua_getglobal(L, "M_game_level_config");
-	CCASSERT(lua_istable(L, -1) == 1, "is not table");
-	lua_pushstring(L, "datas");
-	lua_gettable(L, -2);
-	CCASSERT(lua_istable(L, -1) == 1, "is not table");
-	lua_pushnil(L);
-	while(lua_next(L, 2))
-	{
-		CCASSERT(lua_istable(L, -1) == 1, "is not table");
-		M_game_level_configData data;
-		LuaCfgHelper::readInt(L, "leve", data.mleve);
-		LuaCfgHelper::readInt(L, "up_exp", data.mup_exp);
-		LuaCfgHelper::readInt(L, "monster_num", data.mmonster_num);
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		CCASSERT(mMapData.find(data.mID) == mMapData.end(), "data.mID is exists");
-		mMapData.insert(std::make_pair(data.mID, data));
-		lua_pop(L, 1);
-	}
-	lua_settop(L, 0);
-	CCLOG("M_game_level_config Loaded. Load Data:%u", mMapData.size());
-}
-
-void M_game_level_config::Reload()
-{
-	mMapData.clear();
-	Load();
-}
-
-M_game_level_config* M_game_level_config::GetSingleton()
-{
-	if (msSingleton.get() == nullptr)
-	{
-		msSingleton.reset(new M_game_level_config());
-	}
-	return msSingleton.get();
-}
-
-void M_game_level_config::Release()
-{
-	msSingleton.reset(nullptr);
-}

+ 0 - 31
GameConfig/Code/Client/M_game_level_config.h

@@ -1,31 +0,0 @@
-#pragma once
-#include <map>
-struct M_game_level_configData
-{
-	//ID
-	int64_t mID;
-	//等级
-	int mleve;
-	//所需经验
-	int mup_exp;
-	//同屏怪物数量
-	int mmonster_num;
-};
-
-class M_game_level_config
-{
-public:
-private:
-	static std::auto_ptr<M_game_level_config> msSingleton;
-public:
-	int GetCount();
-	const M_game_level_configData* GetData(int64_t ID);
-	const std::map<int64_t, M_game_level_configData>& GetMapData();
-	void Load();
-	void LoadLua();
-	void Reload();
-	static M_game_level_config* GetSingleton();
-	static void Release();
-private:
-	std::map<int64_t, M_game_level_configData> mMapData;
-};

+ 0 - 121
GameConfig/Code/Client/M_hero.cpp

@@ -1,121 +0,0 @@
-#include "stdafx.h"
-#include "tinyxml2/tinyxml2.h"
-#include "LuaCfgHelper.h"
-#include <iostream>
-#include <boost/algorithm/string.hpp>
-#include "M_hero.h"
-std::auto_ptr<M_hero> M_hero::msSingleton(nullptr);
-
-int M_hero::GetCount()
-{
-	return (int)mMapData.size();
-}
-
-const M_heroData* M_hero::GetData(int ID)
-{
-	auto it = mMapData.find(ID);
-	if (it != mMapData.end())
-	{
-		return &it->second;
-	}
-	return NULL;
-}
-
-const std::map<int, M_heroData>& M_hero::GetMapData()
-{
-	return mMapData;
-}
-
-void M_hero::Load()
-{
-	tinyxml2::XMLDocument xmlDoc;
-	std::string content = FileUtils::getInstance()->getStringFromFile("Config/M_hero.xml");
-	auto result = xmlDoc.Parse(content.c_str(), content.length());
-	if (result != tinyxml2::XML_SUCCESS)
-	{
-		CCLOGERROR("Result:%d", result);
-		CCASSERT(false, "result != tinyxml2::XML_SUCCESS");
-		return;
-	}
-	auto root = xmlDoc.RootElement();
-	if (root == NULL)
-	{
-		CCASSERT(false, "root == NULL");
-		return;
-	}
-	auto element = root->FirstChildElement("Data");
-	while (element != NULL)
-	{
-		M_heroData data;
-		data.mID = element->IntAttribute("ID");
-		data.mname = element->Attribute("name");
-		data.mgrade_type = element->IntAttribute("grade_type");
-		data.mdefault_have = element->IntAttribute("default_have");
-		data.mskill_id = element->IntAttribute("skill_id");
-		data.mattribute = element->IntAttribute("attribute");
-		data.matk = element->IntAttribute("atk");
-		data.micon = element->Attribute("icon");
-		data.maspect = element->Attribute("aspect");
-		data.mspeed = element->FloatAttribute("speed");
-		data.mzoom_factor = element->FloatAttribute("zoom_factor");
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		CCASSERT(mMapData.find(data.mID) == mMapData.end(), "data.mID is exists");
-		mMapData.insert(std::make_pair(data.mID, data));
-		element = element->NextSiblingElement();
-	}
-	CCLOG("M_hero Loaded. Load Data:%u", mMapData.size());
-}
-
-void M_hero::LoadLua()
-{
-	LuaEngine::getInstance()->executeScriptFile("config/M_hero");
-	lua_State* L = LuaEngine::getInstance()->getLuaStack()->getLuaState();
-	lua_getglobal(L, "M_hero");
-	CCASSERT(lua_istable(L, -1) == 1, "is not table");
-	lua_pushstring(L, "datas");
-	lua_gettable(L, -2);
-	CCASSERT(lua_istable(L, -1) == 1, "is not table");
-	lua_pushnil(L);
-	while(lua_next(L, 2))
-	{
-		CCASSERT(lua_istable(L, -1) == 1, "is not table");
-		M_heroData data;
-		LuaCfgHelper::readInt(L, "ID", data.mID);
-		LuaCfgHelper::readString(L, "name", data.mname);
-		LuaCfgHelper::readInt(L, "grade_type", data.mgrade_type);
-		LuaCfgHelper::readInt(L, "default_have", data.mdefault_have);
-		LuaCfgHelper::readInt(L, "skill_id", data.mskill_id);
-		LuaCfgHelper::readInt(L, "attribute", data.mattribute);
-		LuaCfgHelper::readInt(L, "atk", data.matk);
-		LuaCfgHelper::readString(L, "icon", data.micon);
-		LuaCfgHelper::readString(L, "aspect", data.maspect);
-		LuaCfgHelper::readFloat(L, "speed", data.mspeed);
-		LuaCfgHelper::readFloat(L, "zoom_factor", data.mzoom_factor);
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		CCASSERT(mMapData.find(data.mID) == mMapData.end(), "data.mID is exists");
-		mMapData.insert(std::make_pair(data.mID, data));
-		lua_pop(L, 1);
-	}
-	lua_settop(L, 0);
-	CCLOG("M_hero Loaded. Load Data:%u", mMapData.size());
-}
-
-void M_hero::Reload()
-{
-	mMapData.clear();
-	Load();
-}
-
-M_hero* M_hero::GetSingleton()
-{
-	if (msSingleton.get() == nullptr)
-	{
-		msSingleton.reset(new M_hero());
-	}
-	return msSingleton.get();
-}
-
-void M_hero::Release()
-{
-	msSingleton.reset(nullptr);
-}

+ 0 - 45
GameConfig/Code/Client/M_hero.h

@@ -1,45 +0,0 @@
-#pragma once
-#include <map>
-struct M_heroData
-{
-	//ID
-	int mID;
-	//英雄名称
-	std::string mname;
-	//英雄品质
-	int mgrade_type;
-	//默认拥有
-	int mdefault_have;
-	//技能
-	int mskill_id;
-	//属性
-	int mattribute;
-	//攻击力
-	int matk;
-	//英雄图标
-	std::string micon;
-	//英雄形象
-	std::string maspect;
-	//移动速度
-	float mspeed;
-	//缩放倍数
-	float mzoom_factor;
-};
-
-class M_hero
-{
-public:
-private:
-	static std::auto_ptr<M_hero> msSingleton;
-public:
-	int GetCount();
-	const M_heroData* GetData(int ID);
-	const std::map<int, M_heroData>& GetMapData();
-	void Load();
-	void LoadLua();
-	void Reload();
-	static M_hero* GetSingleton();
-	static void Release();
-private:
-	std::map<int, M_heroData> mMapData;
-};

+ 0 - 105
GameConfig/Code/Client/M_i18n.cpp

@@ -1,105 +0,0 @@
-#include "stdafx.h"
-#include "tinyxml2/tinyxml2.h"
-#include "LuaCfgHelper.h"
-#include <iostream>
-#include <boost/algorithm/string.hpp>
-#include "M_i18n.h"
-std::auto_ptr<M_i18n> M_i18n::msSingleton(nullptr);
-
-int M_i18n::GetCount()
-{
-	return (int)mMapData.size();
-}
-
-const M_i18nData* M_i18n::GetData(std::string ID)
-{
-	auto it = mMapData.find(ID);
-	if (it != mMapData.end())
-	{
-		return &it->second;
-	}
-	return NULL;
-}
-
-const std::map<std::string, M_i18nData>& M_i18n::GetMapData()
-{
-	return mMapData;
-}
-
-void M_i18n::Load()
-{
-	tinyxml2::XMLDocument xmlDoc;
-	std::string content = FileUtils::getInstance()->getStringFromFile("Config/M_i18n.xml");
-	auto result = xmlDoc.Parse(content.c_str(), content.length());
-	if (result != tinyxml2::XML_SUCCESS)
-	{
-		CCLOGERROR("Result:%d", result);
-		CCASSERT(false, "result != tinyxml2::XML_SUCCESS");
-		return;
-	}
-	auto root = xmlDoc.RootElement();
-	if (root == NULL)
-	{
-		CCASSERT(false, "root == NULL");
-		return;
-	}
-	auto element = root->FirstChildElement("Data");
-	while (element != NULL)
-	{
-		M_i18nData data;
-		data.mID = element->Attribute("ID");
-		data.mzh = element->Attribute("zh");
-		data.men = element->Attribute("en");
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		CCASSERT(mMapData.find(data.mID) == mMapData.end(), "data.mID is exists");
-		mMapData.insert(std::make_pair(data.mID, data));
-		element = element->NextSiblingElement();
-	}
-	CCLOG("M_i18n Loaded. Load Data:%u", mMapData.size());
-}
-
-void M_i18n::LoadLua()
-{
-	LuaEngine::getInstance()->executeScriptFile("config/M_i18n");
-	lua_State* L = LuaEngine::getInstance()->getLuaStack()->getLuaState();
-	lua_getglobal(L, "M_i18n");
-	CCASSERT(lua_istable(L, -1) == 1, "is not table");
-	lua_pushstring(L, "datas");
-	lua_gettable(L, -2);
-	CCASSERT(lua_istable(L, -1) == 1, "is not table");
-	lua_pushnil(L);
-	while(lua_next(L, 2))
-	{
-		CCASSERT(lua_istable(L, -1) == 1, "is not table");
-		M_i18nData data;
-		LuaCfgHelper::readString(L, "ID", data.mID);
-		LuaCfgHelper::readString(L, "zh", data.mzh);
-		LuaCfgHelper::readString(L, "en", data.men);
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		CCASSERT(mMapData.find(data.mID) == mMapData.end(), "data.mID is exists");
-		mMapData.insert(std::make_pair(data.mID, data));
-		lua_pop(L, 1);
-	}
-	lua_settop(L, 0);
-	CCLOG("M_i18n Loaded. Load Data:%u", mMapData.size());
-}
-
-void M_i18n::Reload()
-{
-	mMapData.clear();
-	Load();
-}
-
-M_i18n* M_i18n::GetSingleton()
-{
-	if (msSingleton.get() == nullptr)
-	{
-		msSingleton.reset(new M_i18n());
-	}
-	return msSingleton.get();
-}
-
-void M_i18n::Release()
-{
-	msSingleton.reset(nullptr);
-}

+ 0 - 29
GameConfig/Code/Client/M_i18n.h

@@ -1,29 +0,0 @@
-#pragma once
-#include <map>
-struct M_i18nData
-{
-	//²ÎÊý±àºÅ
-	std::string mID;
-	//ÖÐÎÄ
-	std::string mzh;
-	//Ó¢ÎÄ
-	std::string men;
-};
-
-class M_i18n
-{
-public:
-private:
-	static std::auto_ptr<M_i18n> msSingleton;
-public:
-	int GetCount();
-	const M_i18nData* GetData(std::string ID);
-	const std::map<std::string, M_i18nData>& GetMapData();
-	void Load();
-	void LoadLua();
-	void Reload();
-	static M_i18n* GetSingleton();
-	static void Release();
-private:
-	std::map<std::string, M_i18nData> mMapData;
-};

+ 0 - 113
GameConfig/Code/Client/M_item.cpp

@@ -1,113 +0,0 @@
-#include "stdafx.h"
-#include "tinyxml2/tinyxml2.h"
-#include "LuaCfgHelper.h"
-#include <iostream>
-#include <boost/algorithm/string.hpp>
-#include "M_item.h"
-std::auto_ptr<M_item> M_item::msSingleton(nullptr);
-
-int M_item::GetCount()
-{
-	return (int)mMapData.size();
-}
-
-const M_itemData* M_item::GetData(int ID)
-{
-	auto it = mMapData.find(ID);
-	if (it != mMapData.end())
-	{
-		return &it->second;
-	}
-	return NULL;
-}
-
-const std::map<int, M_itemData>& M_item::GetMapData()
-{
-	return mMapData;
-}
-
-void M_item::Load()
-{
-	tinyxml2::XMLDocument xmlDoc;
-	std::string content = FileUtils::getInstance()->getStringFromFile("Config/M_item.xml");
-	auto result = xmlDoc.Parse(content.c_str(), content.length());
-	if (result != tinyxml2::XML_SUCCESS)
-	{
-		CCLOGERROR("Result:%d", result);
-		CCASSERT(false, "result != tinyxml2::XML_SUCCESS");
-		return;
-	}
-	auto root = xmlDoc.RootElement();
-	if (root == NULL)
-	{
-		CCASSERT(false, "root == NULL");
-		return;
-	}
-	auto element = root->FirstChildElement("Data");
-	while (element != NULL)
-	{
-		M_itemData data;
-		data.mID = element->IntAttribute("ID");
-		data.mname = element->Attribute("name");
-		data.mdesc = element->Attribute("desc");
-		data.mtype = element->IntAttribute("type");
-		data.mquality = element->IntAttribute("quality");
-		data.micon = element->Attribute("icon");
-		data.mparam1 = element->Attribute("param1");
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		CCASSERT(mMapData.find(data.mID) == mMapData.end(), "data.mID is exists");
-		mMapData.insert(std::make_pair(data.mID, data));
-		element = element->NextSiblingElement();
-	}
-	CCLOG("M_item Loaded. Load Data:%u", mMapData.size());
-}
-
-void M_item::LoadLua()
-{
-	LuaEngine::getInstance()->executeScriptFile("config/M_item");
-	lua_State* L = LuaEngine::getInstance()->getLuaStack()->getLuaState();
-	lua_getglobal(L, "M_item");
-	CCASSERT(lua_istable(L, -1) == 1, "is not table");
-	lua_pushstring(L, "datas");
-	lua_gettable(L, -2);
-	CCASSERT(lua_istable(L, -1) == 1, "is not table");
-	lua_pushnil(L);
-	while(lua_next(L, 2))
-	{
-		CCASSERT(lua_istable(L, -1) == 1, "is not table");
-		M_itemData data;
-		LuaCfgHelper::readInt(L, "ID", data.mID);
-		LuaCfgHelper::readString(L, "name", data.mname);
-		LuaCfgHelper::readString(L, "desc", data.mdesc);
-		LuaCfgHelper::readInt(L, "type", data.mtype);
-		LuaCfgHelper::readInt(L, "quality", data.mquality);
-		LuaCfgHelper::readString(L, "icon", data.micon);
-		LuaCfgHelper::readString(L, "param1", data.mparam1);
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		CCASSERT(mMapData.find(data.mID) == mMapData.end(), "data.mID is exists");
-		mMapData.insert(std::make_pair(data.mID, data));
-		lua_pop(L, 1);
-	}
-	lua_settop(L, 0);
-	CCLOG("M_item Loaded. Load Data:%u", mMapData.size());
-}
-
-void M_item::Reload()
-{
-	mMapData.clear();
-	Load();
-}
-
-M_item* M_item::GetSingleton()
-{
-	if (msSingleton.get() == nullptr)
-	{
-		msSingleton.reset(new M_item());
-	}
-	return msSingleton.get();
-}
-
-void M_item::Release()
-{
-	msSingleton.reset(nullptr);
-}

+ 0 - 37
GameConfig/Code/Client/M_item.h

@@ -1,37 +0,0 @@
-#pragma once
-#include <map>
-struct M_itemData
-{
-	//ID
-	int mID;
-	//物品名称
-	std::string mname;
-	//描述
-	std::string mdesc;
-	//类型
-	int mtype;
-	//品质
-	int mquality;
-	//图标
-	std::string micon;
-	//参数
-	std::string mparam1;
-};
-
-class M_item
-{
-public:
-private:
-	static std::auto_ptr<M_item> msSingleton;
-public:
-	int GetCount();
-	const M_itemData* GetData(int ID);
-	const std::map<int, M_itemData>& GetMapData();
-	void Load();
-	void LoadLua();
-	void Reload();
-	static M_item* GetSingleton();
-	static void Release();
-private:
-	std::map<int, M_itemData> mMapData;
-};

+ 0 - 153
GameConfig/Code/Client/M_magic_array_config.cpp

@@ -1,153 +0,0 @@
-#include "stdafx.h"
-#include "tinyxml2/tinyxml2.h"
-#include "LuaCfgHelper.h"
-#include <iostream>
-#include <boost/algorithm/string.hpp>
-#include "M_magic_array_config.h"
-std::auto_ptr<M_magic_array_config> M_magic_array_config::msSingleton(nullptr);
-
-int M_magic_array_config::GetCount()
-{
-	return (int)mMapData.size();
-}
-
-const M_magic_array_configData* M_magic_array_config::GetData(int64_t ID)
-{
-	auto it = mMapData.find(ID);
-	if (it != mMapData.end())
-	{
-		return &it->second;
-	}
-	return NULL;
-}
-
-const std::map<int64_t, M_magic_array_configData>& M_magic_array_config::GetMapData()
-{
-	return mMapData;
-}
-
-void M_magic_array_config::Load()
-{
-	tinyxml2::XMLDocument xmlDoc;
-	std::string content = FileUtils::getInstance()->getStringFromFile("Config/M_magic_array_config.xml");
-	auto result = xmlDoc.Parse(content.c_str(), content.length());
-	if (result != tinyxml2::XML_SUCCESS)
-	{
-		CCLOGERROR("Result:%d", result);
-		CCASSERT(false, "result != tinyxml2::XML_SUCCESS");
-		return;
-	}
-	auto root = xmlDoc.RootElement();
-	if (root == NULL)
-	{
-		CCASSERT(false, "root == NULL");
-		return;
-	}
-	auto element = root->FirstChildElement("Data");
-	while (element != NULL)
-	{
-		M_magic_array_configData data;
-		data.mlevel = element->IntAttribute("level");
-		{
-			const char* up_cost = element->Attribute("up_cost");
-			std::vector<std::string> vecup_cost;
-			boost::split(vecup_cost, up_cost, boost::is_any_of(","));
-			int temp;
-			for (unsigned int i = 0; i < vecup_cost.size(); i++)
-			{
-				if (tinyxml2::XMLUtil::ToInt(vecup_cost[i].c_str(), &temp))
-				{
-					data.mup_cost.push_back(temp);
-				}
-			}
-		}
-		{
-			const char* atk_cost = element->Attribute("atk_cost");
-			std::vector<std::string> vecatk_cost;
-			boost::split(vecatk_cost, atk_cost, boost::is_any_of(","));
-			int temp;
-			for (unsigned int i = 0; i < vecatk_cost.size(); i++)
-			{
-				if (tinyxml2::XMLUtil::ToInt(vecatk_cost[i].c_str(), &temp))
-				{
-					data.matk_cost.push_back(temp);
-				}
-			}
-		}
-		{
-			const char* un_lock_award = element->Attribute("un_lock_award");
-			std::vector<std::string> vecun_lock_award;
-			boost::split(vecun_lock_award, un_lock_award, boost::is_any_of(","));
-			int temp;
-			for (unsigned int i = 0; i < vecun_lock_award.size(); i++)
-			{
-				if (tinyxml2::XMLUtil::ToInt(vecun_lock_award[i].c_str(), &temp))
-				{
-					data.mun_lock_award.push_back(temp);
-				}
-			}
-		}
-		data.matk = element->IntAttribute("atk");
-		data.mhp = element->IntAttribute("hp");
-		data.micon = element->Attribute("icon");
-		data.mm_stone = element->Attribute("m_stone");
-		data.mmgc_stone = element->FloatAttribute("mgc_stone");
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		CCASSERT(mMapData.find(data.mID) == mMapData.end(), "data.mID is exists");
-		mMapData.insert(std::make_pair(data.mID, data));
-		element = element->NextSiblingElement();
-	}
-	CCLOG("M_magic_array_config Loaded. Load Data:%u", mMapData.size());
-}
-
-void M_magic_array_config::LoadLua()
-{
-	LuaEngine::getInstance()->executeScriptFile("config/M_magic_array_config");
-	lua_State* L = LuaEngine::getInstance()->getLuaStack()->getLuaState();
-	lua_getglobal(L, "M_magic_array_config");
-	CCASSERT(lua_istable(L, -1) == 1, "is not table");
-	lua_pushstring(L, "datas");
-	lua_gettable(L, -2);
-	CCASSERT(lua_istable(L, -1) == 1, "is not table");
-	lua_pushnil(L);
-	while(lua_next(L, 2))
-	{
-		CCASSERT(lua_istable(L, -1) == 1, "is not table");
-		M_magic_array_configData data;
-		LuaCfgHelper::readInt(L, "level", data.mlevel);
-		LuaCfgHelper::readVectorInt(L, "up_cost", data.mup_cost);
-		LuaCfgHelper::readVectorInt(L, "atk_cost", data.matk_cost);
-		LuaCfgHelper::readVectorInt(L, "un_lock_award", data.mun_lock_award);
-		LuaCfgHelper::readInt(L, "atk", data.matk);
-		LuaCfgHelper::readInt(L, "hp", data.mhp);
-		LuaCfgHelper::readString(L, "icon", data.micon);
-		LuaCfgHelper::readString(L, "m_stone", data.mm_stone);
-		LuaCfgHelper::readFloat(L, "mgc_stone", data.mmgc_stone);
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		CCASSERT(mMapData.find(data.mID) == mMapData.end(), "data.mID is exists");
-		mMapData.insert(std::make_pair(data.mID, data));
-		lua_pop(L, 1);
-	}
-	lua_settop(L, 0);
-	CCLOG("M_magic_array_config Loaded. Load Data:%u", mMapData.size());
-}
-
-void M_magic_array_config::Reload()
-{
-	mMapData.clear();
-	Load();
-}
-
-M_magic_array_config* M_magic_array_config::GetSingleton()
-{
-	if (msSingleton.get() == nullptr)
-	{
-		msSingleton.reset(new M_magic_array_config());
-	}
-	return msSingleton.get();
-}
-
-void M_magic_array_config::Release()
-{
-	msSingleton.reset(nullptr);
-}

+ 0 - 43
GameConfig/Code/Client/M_magic_array_config.h

@@ -1,43 +0,0 @@
-#pragma once
-#include <map>
-struct M_magic_array_configData
-{
-	//ID
-	int64_t mID;
-	//等级
-	int mlevel;
-	//升级消耗(道具ID,数量)
-	std::vector<int> mup_cost;
-	//攻击消耗(道具ID,数量)
-	std::vector<int> matk_cost;
-	//解锁奖励(道具ID,数量)
-	std::vector<int> mun_lock_award;
-	//攻击
-	int matk;
-	//生命
-	int mhp;
-	//图标
-	std::string micon;
-	//魔导石掉落
-	std::string mm_stone;
-	//魔法石掉落(百分比)
-	float mmgc_stone;
-};
-
-class M_magic_array_config
-{
-public:
-private:
-	static std::auto_ptr<M_magic_array_config> msSingleton;
-public:
-	int GetCount();
-	const M_magic_array_configData* GetData(int64_t ID);
-	const std::map<int64_t, M_magic_array_configData>& GetMapData();
-	void Load();
-	void LoadLua();
-	void Reload();
-	static M_magic_array_config* GetSingleton();
-	static void Release();
-private:
-	std::map<int64_t, M_magic_array_configData> mMapData;
-};

+ 0 - 117
GameConfig/Code/Client/M_monster.cpp

@@ -1,117 +0,0 @@
-#include "stdafx.h"
-#include "tinyxml2/tinyxml2.h"
-#include "LuaCfgHelper.h"
-#include <iostream>
-#include <boost/algorithm/string.hpp>
-#include "M_monster.h"
-std::auto_ptr<M_monster> M_monster::msSingleton(nullptr);
-
-int M_monster::GetCount()
-{
-	return (int)mMapData.size();
-}
-
-const M_monsterData* M_monster::GetData(int64_t ID)
-{
-	auto it = mMapData.find(ID);
-	if (it != mMapData.end())
-	{
-		return &it->second;
-	}
-	return NULL;
-}
-
-const std::map<int64_t, M_monsterData>& M_monster::GetMapData()
-{
-	return mMapData;
-}
-
-void M_monster::Load()
-{
-	tinyxml2::XMLDocument xmlDoc;
-	std::string content = FileUtils::getInstance()->getStringFromFile("Config/M_monster.xml");
-	auto result = xmlDoc.Parse(content.c_str(), content.length());
-	if (result != tinyxml2::XML_SUCCESS)
-	{
-		CCLOGERROR("Result:%d", result);
-		CCASSERT(false, "result != tinyxml2::XML_SUCCESS");
-		return;
-	}
-	auto root = xmlDoc.RootElement();
-	if (root == NULL)
-	{
-		CCASSERT(false, "root == NULL");
-		return;
-	}
-	auto element = root->FirstChildElement("Data");
-	while (element != NULL)
-	{
-		M_monsterData data;
-		data.mname = element->Attribute("name");
-		data.mtype = element->IntAttribute("type");
-		data.mmultiple = element->IntAttribute("multiple");
-		data.micon = element->Attribute("icon");
-		data.maspect = element->Attribute("aspect");
-		data.mspeed = element->FloatAttribute("speed");
-		data.msuper_speed = element->FloatAttribute("super_speed");
-		data.mzoom_factor = element->FloatAttribute("zoom_factor");
-		data.mexp_value = element->IntAttribute("exp_value");
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		CCASSERT(mMapData.find(data.mID) == mMapData.end(), "data.mID is exists");
-		mMapData.insert(std::make_pair(data.mID, data));
-		element = element->NextSiblingElement();
-	}
-	CCLOG("M_monster Loaded. Load Data:%u", mMapData.size());
-}
-
-void M_monster::LoadLua()
-{
-	LuaEngine::getInstance()->executeScriptFile("config/M_monster");
-	lua_State* L = LuaEngine::getInstance()->getLuaStack()->getLuaState();
-	lua_getglobal(L, "M_monster");
-	CCASSERT(lua_istable(L, -1) == 1, "is not table");
-	lua_pushstring(L, "datas");
-	lua_gettable(L, -2);
-	CCASSERT(lua_istable(L, -1) == 1, "is not table");
-	lua_pushnil(L);
-	while(lua_next(L, 2))
-	{
-		CCASSERT(lua_istable(L, -1) == 1, "is not table");
-		M_monsterData data;
-		LuaCfgHelper::readString(L, "name", data.mname);
-		LuaCfgHelper::readInt(L, "type", data.mtype);
-		LuaCfgHelper::readInt(L, "multiple", data.mmultiple);
-		LuaCfgHelper::readString(L, "icon", data.micon);
-		LuaCfgHelper::readString(L, "aspect", data.maspect);
-		LuaCfgHelper::readFloat(L, "speed", data.mspeed);
-		LuaCfgHelper::readFloat(L, "super_speed", data.msuper_speed);
-		LuaCfgHelper::readFloat(L, "zoom_factor", data.mzoom_factor);
-		LuaCfgHelper::readInt(L, "exp_value", data.mexp_value);
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		CCASSERT(mMapData.find(data.mID) == mMapData.end(), "data.mID is exists");
-		mMapData.insert(std::make_pair(data.mID, data));
-		lua_pop(L, 1);
-	}
-	lua_settop(L, 0);
-	CCLOG("M_monster Loaded. Load Data:%u", mMapData.size());
-}
-
-void M_monster::Reload()
-{
-	mMapData.clear();
-	Load();
-}
-
-M_monster* M_monster::GetSingleton()
-{
-	if (msSingleton.get() == nullptr)
-	{
-		msSingleton.reset(new M_monster());
-	}
-	return msSingleton.get();
-}
-
-void M_monster::Release()
-{
-	msSingleton.reset(nullptr);
-}

+ 0 - 43
GameConfig/Code/Client/M_monster.h

@@ -1,43 +0,0 @@
-#pragma once
-#include <map>
-struct M_monsterData
-{
-	//ID
-	int64_t mID;
-	//怪物名称
-	std::string mname;
-	//怪物类型
-	int mtype;
-	//击杀倍数
-	int mmultiple;
-	//怪物图标
-	std::string micon;
-	//怪物形象
-	std::string maspect;
-	//移动速度
-	float mspeed;
-	//鱼阵移动速度
-	float msuper_speed;
-	//缩放倍数
-	float mzoom_factor;
-	//经验掉落(道具ID)
-	int mexp_value;
-};
-
-class M_monster
-{
-public:
-private:
-	static std::auto_ptr<M_monster> msSingleton;
-public:
-	int GetCount();
-	const M_monsterData* GetData(int64_t ID);
-	const std::map<int64_t, M_monsterData>& GetMapData();
-	void Load();
-	void LoadLua();
-	void Reload();
-	static M_monster* GetSingleton();
-	static void Release();
-private:
-	std::map<int64_t, M_monsterData> mMapData;
-};

+ 0 - 139
GameConfig/Code/Client/M_shop.cpp

@@ -1,139 +0,0 @@
-#include "stdafx.h"
-#include "tinyxml2/tinyxml2.h"
-#include "LuaCfgHelper.h"
-#include <iostream>
-#include <boost/algorithm/string.hpp>
-#include "M_shop.h"
-std::auto_ptr<M_shop> M_shop::msSingleton(nullptr);
-
-int M_shop::GetCount()
-{
-	return (int)mMapData.size();
-}
-
-const M_shopData* M_shop::GetData(int ID)
-{
-	auto it = mMapData.find(ID);
-	if (it != mMapData.end())
-	{
-		return &it->second;
-	}
-	return NULL;
-}
-
-const std::map<int, M_shopData>& M_shop::GetMapData()
-{
-	return mMapData;
-}
-
-void M_shop::Load()
-{
-	tinyxml2::XMLDocument xmlDoc;
-	std::string content = FileUtils::getInstance()->getStringFromFile("Config/M_shop.xml");
-	auto result = xmlDoc.Parse(content.c_str(), content.length());
-	if (result != tinyxml2::XML_SUCCESS)
-	{
-		CCLOGERROR("Result:%d", result);
-		CCASSERT(false, "result != tinyxml2::XML_SUCCESS");
-		return;
-	}
-	auto root = xmlDoc.RootElement();
-	if (root == NULL)
-	{
-		CCASSERT(false, "root == NULL");
-		return;
-	}
-	auto element = root->FirstChildElement("Data");
-	while (element != NULL)
-	{
-		M_shopData data;
-		data.mID = element->IntAttribute("ID");
-		data.mshop_type = element->IntAttribute("shop_type");
-		{
-			const char* cost_Item = element->Attribute("cost_Item");
-			std::vector<std::string> veccost_Item;
-			boost::split(veccost_Item, cost_Item, boost::is_any_of(","));
-			int temp;
-			for (unsigned int i = 0; i < veccost_Item.size(); i++)
-			{
-				if (tinyxml2::XMLUtil::ToInt(veccost_Item[i].c_str(), &temp))
-				{
-					data.mcost_Item.push_back(temp);
-				}
-			}
-		}
-		{
-			const char* reward = element->Attribute("reward");
-			std::vector<std::string> vecreward;
-			boost::split(vecreward, reward, boost::is_any_of(","));
-			int temp;
-			for (unsigned int i = 0; i < vecreward.size(); i++)
-			{
-				if (tinyxml2::XMLUtil::ToInt(vecreward[i].c_str(), &temp))
-				{
-					data.mreward.push_back(temp);
-				}
-			}
-		}
-		data.micon = element->Attribute("icon");
-		data.msort = element->IntAttribute("sort");
-		data.mcondition = element->IntAttribute("condition");
-		data.mvalue = element->Attribute("value");
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		CCASSERT(mMapData.find(data.mID) == mMapData.end(), "data.mID is exists");
-		mMapData.insert(std::make_pair(data.mID, data));
-		element = element->NextSiblingElement();
-	}
-	CCLOG("M_shop Loaded. Load Data:%u", mMapData.size());
-}
-
-void M_shop::LoadLua()
-{
-	LuaEngine::getInstance()->executeScriptFile("config/M_shop");
-	lua_State* L = LuaEngine::getInstance()->getLuaStack()->getLuaState();
-	lua_getglobal(L, "M_shop");
-	CCASSERT(lua_istable(L, -1) == 1, "is not table");
-	lua_pushstring(L, "datas");
-	lua_gettable(L, -2);
-	CCASSERT(lua_istable(L, -1) == 1, "is not table");
-	lua_pushnil(L);
-	while(lua_next(L, 2))
-	{
-		CCASSERT(lua_istable(L, -1) == 1, "is not table");
-		M_shopData data;
-		LuaCfgHelper::readInt(L, "ID", data.mID);
-		LuaCfgHelper::readInt(L, "shop_type", data.mshop_type);
-		LuaCfgHelper::readVectorInt(L, "cost_Item", data.mcost_Item);
-		LuaCfgHelper::readVectorInt(L, "reward", data.mreward);
-		LuaCfgHelper::readString(L, "icon", data.micon);
-		LuaCfgHelper::readInt(L, "sort", data.msort);
-		LuaCfgHelper::readInt(L, "condition", data.mcondition);
-		LuaCfgHelper::readString(L, "value", data.mvalue);
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		CCASSERT(mMapData.find(data.mID) == mMapData.end(), "data.mID is exists");
-		mMapData.insert(std::make_pair(data.mID, data));
-		lua_pop(L, 1);
-	}
-	lua_settop(L, 0);
-	CCLOG("M_shop Loaded. Load Data:%u", mMapData.size());
-}
-
-void M_shop::Reload()
-{
-	mMapData.clear();
-	Load();
-}
-
-M_shop* M_shop::GetSingleton()
-{
-	if (msSingleton.get() == nullptr)
-	{
-		msSingleton.reset(new M_shop());
-	}
-	return msSingleton.get();
-}
-
-void M_shop::Release()
-{
-	msSingleton.reset(nullptr);
-}

+ 0 - 39
GameConfig/Code/Client/M_shop.h

@@ -1,39 +0,0 @@
-#pragma once
-#include <map>
-struct M_shopData
-{
-	//ID
-	int mID;
-	//ÀàÐÍ
-	int mshop_type;
-	//¹ºÂòÏûºÄ
-	std::vector<int> mcost_Item;
-	//¹ºÂò»ñµÃ
-	std::vector<int> mreward;
-	//ͼ±ê
-	std::string micon;
-	//ÅÅÐò
-	int msort;
-	//¿ªÆôÌõ¼þ(VIPµÈ¼¶)
-	int mcondition;
-	//³¬Öµ½Ç±ê
-	std::string mvalue;
-};
-
-class M_shop
-{
-public:
-private:
-	static std::auto_ptr<M_shop> msSingleton;
-public:
-	int GetCount();
-	const M_shopData* GetData(int ID);
-	const std::map<int, M_shopData>& GetMapData();
-	void Load();
-	void LoadLua();
-	void Reload();
-	static M_shop* GetSingleton();
-	static void Release();
-private:
-	std::map<int, M_shopData> mMapData;
-};

+ 0 - 115
GameConfig/Code/Client/M_skill.cpp

@@ -1,115 +0,0 @@
-#include "stdafx.h"
-#include "tinyxml2/tinyxml2.h"
-#include "LuaCfgHelper.h"
-#include <iostream>
-#include <boost/algorithm/string.hpp>
-#include "M_skill.h"
-std::auto_ptr<M_skill> M_skill::msSingleton(nullptr);
-
-int M_skill::GetCount()
-{
-	return (int)mMapData.size();
-}
-
-const M_skillData* M_skill::GetData(int ID)
-{
-	auto it = mMapData.find(ID);
-	if (it != mMapData.end())
-	{
-		return &it->second;
-	}
-	return NULL;
-}
-
-const std::map<int, M_skillData>& M_skill::GetMapData()
-{
-	return mMapData;
-}
-
-void M_skill::Load()
-{
-	tinyxml2::XMLDocument xmlDoc;
-	std::string content = FileUtils::getInstance()->getStringFromFile("Config/M_skill.xml");
-	auto result = xmlDoc.Parse(content.c_str(), content.length());
-	if (result != tinyxml2::XML_SUCCESS)
-	{
-		CCLOGERROR("Result:%d", result);
-		CCASSERT(false, "result != tinyxml2::XML_SUCCESS");
-		return;
-	}
-	auto root = xmlDoc.RootElement();
-	if (root == NULL)
-	{
-		CCASSERT(false, "root == NULL");
-		return;
-	}
-	auto element = root->FirstChildElement("Data");
-	while (element != NULL)
-	{
-		M_skillData data;
-		data.mID = element->IntAttribute("ID");
-		data.mhero_id = element->IntAttribute("hero_id");
-		data.mskill_leve = element->IntAttribute("skill_leve");
-		data.mbullet_num = element->IntAttribute("bullet_num");
-		data.mbullet_radius = element->IntAttribute("bullet_radius");
-		data.mattack_distance = element->IntAttribute("attack_distance");
-		data.mattack_Interval = element->FloatAttribute("attack_Interval");
-		data.mskill_des = element->Attribute("skill_des");
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		CCASSERT(mMapData.find(data.mID) == mMapData.end(), "data.mID is exists");
-		mMapData.insert(std::make_pair(data.mID, data));
-		element = element->NextSiblingElement();
-	}
-	CCLOG("M_skill Loaded. Load Data:%u", mMapData.size());
-}
-
-void M_skill::LoadLua()
-{
-	LuaEngine::getInstance()->executeScriptFile("config/M_skill");
-	lua_State* L = LuaEngine::getInstance()->getLuaStack()->getLuaState();
-	lua_getglobal(L, "M_skill");
-	CCASSERT(lua_istable(L, -1) == 1, "is not table");
-	lua_pushstring(L, "datas");
-	lua_gettable(L, -2);
-	CCASSERT(lua_istable(L, -1) == 1, "is not table");
-	lua_pushnil(L);
-	while(lua_next(L, 2))
-	{
-		CCASSERT(lua_istable(L, -1) == 1, "is not table");
-		M_skillData data;
-		LuaCfgHelper::readInt(L, "ID", data.mID);
-		LuaCfgHelper::readInt(L, "hero_id", data.mhero_id);
-		LuaCfgHelper::readInt(L, "skill_leve", data.mskill_leve);
-		LuaCfgHelper::readInt(L, "bullet_num", data.mbullet_num);
-		LuaCfgHelper::readInt(L, "bullet_radius", data.mbullet_radius);
-		LuaCfgHelper::readInt(L, "attack_distance", data.mattack_distance);
-		LuaCfgHelper::readFloat(L, "attack_Interval", data.mattack_Interval);
-		LuaCfgHelper::readString(L, "skill_des", data.mskill_des);
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		CCASSERT(mMapData.find(data.mID) == mMapData.end(), "data.mID is exists");
-		mMapData.insert(std::make_pair(data.mID, data));
-		lua_pop(L, 1);
-	}
-	lua_settop(L, 0);
-	CCLOG("M_skill Loaded. Load Data:%u", mMapData.size());
-}
-
-void M_skill::Reload()
-{
-	mMapData.clear();
-	Load();
-}
-
-M_skill* M_skill::GetSingleton()
-{
-	if (msSingleton.get() == nullptr)
-	{
-		msSingleton.reset(new M_skill());
-	}
-	return msSingleton.get();
-}
-
-void M_skill::Release()
-{
-	msSingleton.reset(nullptr);
-}

+ 0 - 39
GameConfig/Code/Client/M_skill.h

@@ -1,39 +0,0 @@
-#pragma once
-#include <map>
-struct M_skillData
-{
-	//ID
-	int mID;
-	//英雄ID
-	int mhero_id;
-	//技能等级
-	int mskill_leve;
-	//子弹数量
-	int mbullet_num;
-	//子弹半径
-	int mbullet_radius;
-	//攻击距离
-	int mattack_distance;
-	//攻击间隔
-	float mattack_Interval;
-	//技能描述
-	std::string mskill_des;
-};
-
-class M_skill
-{
-public:
-private:
-	static std::auto_ptr<M_skill> msSingleton;
-public:
-	int GetCount();
-	const M_skillData* GetData(int ID);
-	const std::map<int, M_skillData>& GetMapData();
-	void Load();
-	void LoadLua();
-	void Reload();
-	static M_skill* GetSingleton();
-	static void Release();
-private:
-	std::map<int, M_skillData> mMapData;
-};

+ 0 - 105
GameConfig/Code/Client/M_test.cpp

@@ -1,105 +0,0 @@
-#include "stdafx.h"
-#include "tinyxml2/tinyxml2.h"
-#include "LuaCfgHelper.h"
-#include <iostream>
-#include <boost/algorithm/string.hpp>
-#include "M_test.h"
-std::auto_ptr<M_test> M_test::msSingleton(nullptr);
-
-int M_test::GetCount()
-{
-	return (int)mMapData.size();
-}
-
-const M_testData* M_test::GetData(std::string ID)
-{
-	auto it = mMapData.find(ID);
-	if (it != mMapData.end())
-	{
-		return &it->second;
-	}
-	return NULL;
-}
-
-const std::map<std::string, M_testData>& M_test::GetMapData()
-{
-	return mMapData;
-}
-
-void M_test::Load()
-{
-	tinyxml2::XMLDocument xmlDoc;
-	std::string content = FileUtils::getInstance()->getStringFromFile("Config/M_test.xml");
-	auto result = xmlDoc.Parse(content.c_str(), content.length());
-	if (result != tinyxml2::XML_SUCCESS)
-	{
-		CCLOGERROR("Result:%d", result);
-		CCASSERT(false, "result != tinyxml2::XML_SUCCESS");
-		return;
-	}
-	auto root = xmlDoc.RootElement();
-	if (root == NULL)
-	{
-		CCASSERT(false, "root == NULL");
-		return;
-	}
-	auto element = root->FirstChildElement("Data");
-	while (element != NULL)
-	{
-		M_testData data;
-		data.mID = element->Attribute("ID");
-		data.mxxx = element->Attribute("xxx");
-		data.mttt = element->Attribute("ttt");
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		CCASSERT(mMapData.find(data.mID) == mMapData.end(), "data.mID is exists");
-		mMapData.insert(std::make_pair(data.mID, data));
-		element = element->NextSiblingElement();
-	}
-	CCLOG("M_test Loaded. Load Data:%u", mMapData.size());
-}
-
-void M_test::LoadLua()
-{
-	LuaEngine::getInstance()->executeScriptFile("config/M_test");
-	lua_State* L = LuaEngine::getInstance()->getLuaStack()->getLuaState();
-	lua_getglobal(L, "M_test");
-	CCASSERT(lua_istable(L, -1) == 1, "is not table");
-	lua_pushstring(L, "datas");
-	lua_gettable(L, -2);
-	CCASSERT(lua_istable(L, -1) == 1, "is not table");
-	lua_pushnil(L);
-	while(lua_next(L, 2))
-	{
-		CCASSERT(lua_istable(L, -1) == 1, "is not table");
-		M_testData data;
-		LuaCfgHelper::readString(L, "ID", data.mID);
-		LuaCfgHelper::readString(L, "xxx", data.mxxx);
-		LuaCfgHelper::readString(L, "ttt", data.mttt);
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		CCASSERT(mMapData.find(data.mID) == mMapData.end(), "data.mID is exists");
-		mMapData.insert(std::make_pair(data.mID, data));
-		lua_pop(L, 1);
-	}
-	lua_settop(L, 0);
-	CCLOG("M_test Loaded. Load Data:%u", mMapData.size());
-}
-
-void M_test::Reload()
-{
-	mMapData.clear();
-	Load();
-}
-
-M_test* M_test::GetSingleton()
-{
-	if (msSingleton.get() == nullptr)
-	{
-		msSingleton.reset(new M_test());
-	}
-	return msSingleton.get();
-}
-
-void M_test::Release()
-{
-	msSingleton.reset(nullptr);
-}

+ 0 - 29
GameConfig/Code/Client/M_test.h

@@ -1,29 +0,0 @@
-#pragma once
-#include <map>
-struct M_testData
-{
-	//²ÎÊý±àºÅ
-	std::string mID;
-	//ÖÐÎÄ
-	std::string mxxx;
-	//Ó¢ÎÄ
-	std::string mttt;
-};
-
-class M_test
-{
-public:
-private:
-	static std::auto_ptr<M_test> msSingleton;
-public:
-	int GetCount();
-	const M_testData* GetData(std::string ID);
-	const std::map<std::string, M_testData>& GetMapData();
-	void Load();
-	void LoadLua();
-	void Reload();
-	static M_test* GetSingleton();
-	static void Release();
-private:
-	std::map<std::string, M_testData> mMapData;
-};

+ 0 - 137
GameConfig/Code/Client/M_un_lock_battle.cpp

@@ -1,137 +0,0 @@
-#include "stdafx.h"
-#include "tinyxml2/tinyxml2.h"
-#include "LuaCfgHelper.h"
-#include <iostream>
-#include <boost/algorithm/string.hpp>
-#include "M_un_lock_battle.h"
-std::auto_ptr<M_un_lock_battle> M_un_lock_battle::msSingleton(nullptr);
-
-int M_un_lock_battle::GetCount()
-{
-	return (int)mMapData.size();
-}
-
-const M_un_lock_battleData* M_un_lock_battle::GetData(int64_t ID)
-{
-	auto it = mMapData.find(ID);
-	if (it != mMapData.end())
-	{
-		return &it->second;
-	}
-	return NULL;
-}
-
-const std::map<int64_t, M_un_lock_battleData>& M_un_lock_battle::GetMapData()
-{
-	return mMapData;
-}
-
-void M_un_lock_battle::Load()
-{
-	tinyxml2::XMLDocument xmlDoc;
-	std::string content = FileUtils::getInstance()->getStringFromFile("Config/M_un_lock_battle.xml");
-	auto result = xmlDoc.Parse(content.c_str(), content.length());
-	if (result != tinyxml2::XML_SUCCESS)
-	{
-		CCLOGERROR("Result:%d", result);
-		CCASSERT(false, "result != tinyxml2::XML_SUCCESS");
-		return;
-	}
-	auto root = xmlDoc.RootElement();
-	if (root == NULL)
-	{
-		CCASSERT(false, "root == NULL");
-		return;
-	}
-	auto element = root->FirstChildElement("Data");
-	while (element != NULL)
-	{
-		M_un_lock_battleData data;
-		data.mbattle_type = element->IntAttribute("battle_type");
-		data.mun_lock_magic = element->IntAttribute("un_lock_magic");
-		data.mdemand = element->IntAttribute("demand");
-		data.mprohibit = element->IntAttribute("prohibit");
-		{
-			const char* use_magic = element->Attribute("use_magic");
-			std::vector<std::string> vecuse_magic;
-			boost::split(vecuse_magic, use_magic, boost::is_any_of(","));
-			int temp;
-			for (unsigned int i = 0; i < vecuse_magic.size(); i++)
-			{
-				if (tinyxml2::XMLUtil::ToInt(vecuse_magic[i].c_str(), &temp))
-				{
-					data.muse_magic.push_back(temp);
-				}
-			}
-		}
-		{
-			const char* fish_wave = element->Attribute("fish_wave");
-			std::vector<std::string> vecfish_wave;
-			boost::split(vecfish_wave, fish_wave, boost::is_any_of(","));
-			int temp;
-			for (unsigned int i = 0; i < vecfish_wave.size(); i++)
-			{
-				if (tinyxml2::XMLUtil::ToInt(vecfish_wave[i].c_str(), &temp))
-				{
-					data.mfish_wave.push_back(temp);
-				}
-			}
-		}
-		data.mfish_scheme = element->Attribute("fish_scheme");
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		CCASSERT(mMapData.find(data.mID) == mMapData.end(), "data.mID is exists");
-		mMapData.insert(std::make_pair(data.mID, data));
-		element = element->NextSiblingElement();
-	}
-	CCLOG("M_un_lock_battle Loaded. Load Data:%u", mMapData.size());
-}
-
-void M_un_lock_battle::LoadLua()
-{
-	LuaEngine::getInstance()->executeScriptFile("config/M_un_lock_battle");
-	lua_State* L = LuaEngine::getInstance()->getLuaStack()->getLuaState();
-	lua_getglobal(L, "M_un_lock_battle");
-	CCASSERT(lua_istable(L, -1) == 1, "is not table");
-	lua_pushstring(L, "datas");
-	lua_gettable(L, -2);
-	CCASSERT(lua_istable(L, -1) == 1, "is not table");
-	lua_pushnil(L);
-	while(lua_next(L, 2))
-	{
-		CCASSERT(lua_istable(L, -1) == 1, "is not table");
-		M_un_lock_battleData data;
-		LuaCfgHelper::readInt(L, "battle_type", data.mbattle_type);
-		LuaCfgHelper::readInt(L, "un_lock_magic", data.mun_lock_magic);
-		LuaCfgHelper::readInt(L, "demand", data.mdemand);
-		LuaCfgHelper::readInt(L, "prohibit", data.mprohibit);
-		LuaCfgHelper::readVectorInt(L, "use_magic", data.muse_magic);
-		LuaCfgHelper::readVectorInt(L, "fish_wave", data.mfish_wave);
-		LuaCfgHelper::readString(L, "fish_scheme", data.mfish_scheme);
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		CCASSERT(mMapData.find(data.mID) == mMapData.end(), "data.mID is exists");
-		mMapData.insert(std::make_pair(data.mID, data));
-		lua_pop(L, 1);
-	}
-	lua_settop(L, 0);
-	CCLOG("M_un_lock_battle Loaded. Load Data:%u", mMapData.size());
-}
-
-void M_un_lock_battle::Reload()
-{
-	mMapData.clear();
-	Load();
-}
-
-M_un_lock_battle* M_un_lock_battle::GetSingleton()
-{
-	if (msSingleton.get() == nullptr)
-	{
-		msSingleton.reset(new M_un_lock_battle());
-	}
-	return msSingleton.get();
-}
-
-void M_un_lock_battle::Release()
-{
-	msSingleton.reset(nullptr);
-}

+ 0 - 39
GameConfig/Code/Client/M_un_lock_battle.h

@@ -1,39 +0,0 @@
-#pragma once
-#include <map>
-struct M_un_lock_battleData
-{
-	//ID
-	int64_t mID;
-	//场地类型
-	int mbattle_type;
-	//魔法阵解锁
-	int mun_lock_magic;
-	//魔币准入金额
-	int mdemand;
-	//魔币禁止金额
-	int mprohibit;
-	//魔法阵使用等级
-	std::vector<int> muse_magic;
-	//鱼阵波数
-	std::vector<int> mfish_wave;
-	//鱼阵方案(方案,权重|方案,权重)
-	std::string mfish_scheme;
-};
-
-class M_un_lock_battle
-{
-public:
-private:
-	static std::auto_ptr<M_un_lock_battle> msSingleton;
-public:
-	int GetCount();
-	const M_un_lock_battleData* GetData(int64_t ID);
-	const std::map<int64_t, M_un_lock_battleData>& GetMapData();
-	void Load();
-	void LoadLua();
-	void Reload();
-	static M_un_lock_battle* GetSingleton();
-	static void Release();
-private:
-	std::map<int64_t, M_un_lock_battleData> mMapData;
-};

+ 0 - 121
GameConfig/Code/Client/M_vip_config.cpp

@@ -1,121 +0,0 @@
-#include "stdafx.h"
-#include "tinyxml2/tinyxml2.h"
-#include "LuaCfgHelper.h"
-#include <iostream>
-#include <boost/algorithm/string.hpp>
-#include "M_vip_config.h"
-std::auto_ptr<M_vip_config> M_vip_config::msSingleton(nullptr);
-
-int M_vip_config::GetCount()
-{
-	return (int)mMapData.size();
-}
-
-const M_vip_configData* M_vip_config::GetData(int ID)
-{
-	auto it = mMapData.find(ID);
-	if (it != mMapData.end())
-	{
-		return &it->second;
-	}
-	return NULL;
-}
-
-const std::map<int, M_vip_configData>& M_vip_config::GetMapData()
-{
-	return mMapData;
-}
-
-void M_vip_config::Load()
-{
-	tinyxml2::XMLDocument xmlDoc;
-	std::string content = FileUtils::getInstance()->getStringFromFile("Config/M_vip_config.xml");
-	auto result = xmlDoc.Parse(content.c_str(), content.length());
-	if (result != tinyxml2::XML_SUCCESS)
-	{
-		CCLOGERROR("Result:%d", result);
-		CCASSERT(false, "result != tinyxml2::XML_SUCCESS");
-		return;
-	}
-	auto root = xmlDoc.RootElement();
-	if (root == NULL)
-	{
-		CCASSERT(false, "root == NULL");
-		return;
-	}
-	auto element = root->FirstChildElement("Data");
-	while (element != NULL)
-	{
-		M_vip_configData data;
-		data.mID = element->IntAttribute("ID");
-		data.mleve = element->IntAttribute("leve");
-		data.mvipexp = element->IntAttribute("vipexp");
-		{
-			const char* everdayreward = element->Attribute("everdayreward");
-			std::vector<std::string> veceverdayreward;
-			boost::split(veceverdayreward, everdayreward, boost::is_any_of(","));
-			int temp;
-			for (unsigned int i = 0; i < veceverdayreward.size(); i++)
-			{
-				if (tinyxml2::XMLUtil::ToInt(veceverdayreward[i].c_str(), &temp))
-				{
-					data.meverdayreward.push_back(temp);
-				}
-			}
-		}
-		data.mskillquantity = element->IntAttribute("skillquantity");
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		CCASSERT(mMapData.find(data.mID) == mMapData.end(), "data.mID is exists");
-		mMapData.insert(std::make_pair(data.mID, data));
-		element = element->NextSiblingElement();
-	}
-	CCLOG("M_vip_config Loaded. Load Data:%u", mMapData.size());
-}
-
-void M_vip_config::LoadLua()
-{
-	LuaEngine::getInstance()->executeScriptFile("config/M_vip_config");
-	lua_State* L = LuaEngine::getInstance()->getLuaStack()->getLuaState();
-	lua_getglobal(L, "M_vip_config");
-	CCASSERT(lua_istable(L, -1) == 1, "is not table");
-	lua_pushstring(L, "datas");
-	lua_gettable(L, -2);
-	CCASSERT(lua_istable(L, -1) == 1, "is not table");
-	lua_pushnil(L);
-	while(lua_next(L, 2))
-	{
-		CCASSERT(lua_istable(L, -1) == 1, "is not table");
-		M_vip_configData data;
-		LuaCfgHelper::readInt(L, "ID", data.mID);
-		LuaCfgHelper::readInt(L, "leve", data.mleve);
-		LuaCfgHelper::readInt(L, "vipexp", data.mvipexp);
-		LuaCfgHelper::readVectorInt(L, "everdayreward", data.meverdayreward);
-		LuaCfgHelper::readInt(L, "skillquantity", data.mskillquantity);
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		CCASSERT(mMapData.find(data.mID) == mMapData.end(), "data.mID is exists");
-		mMapData.insert(std::make_pair(data.mID, data));
-		lua_pop(L, 1);
-	}
-	lua_settop(L, 0);
-	CCLOG("M_vip_config Loaded. Load Data:%u", mMapData.size());
-}
-
-void M_vip_config::Reload()
-{
-	mMapData.clear();
-	Load();
-}
-
-M_vip_config* M_vip_config::GetSingleton()
-{
-	if (msSingleton.get() == nullptr)
-	{
-		msSingleton.reset(new M_vip_config());
-	}
-	return msSingleton.get();
-}
-
-void M_vip_config::Release()
-{
-	msSingleton.reset(nullptr);
-}

+ 0 - 33
GameConfig/Code/Client/M_vip_config.h

@@ -1,33 +0,0 @@
-#pragma once
-#include <map>
-struct M_vip_configData
-{
-	//ID
-	int mID;
-	//Vip等级
-	int mleve;
-	//所需经验
-	int mvipexp;
-	//每日奖励(道具ID,数量)
-	std::vector<int> meverdayreward;
-	//额外技能数量
-	int mskillquantity;
-};
-
-class M_vip_config
-{
-public:
-private:
-	static std::auto_ptr<M_vip_config> msSingleton;
-public:
-	int GetCount();
-	const M_vip_configData* GetData(int ID);
-	const std::map<int, M_vip_configData>& GetMapData();
-	void Load();
-	void LoadLua();
-	void Reload();
-	static M_vip_config* GetSingleton();
-	static void Release();
-private:
-	std::map<int, M_vip_configData> mMapData;
-};

+ 0 - 103
GameConfig/Code/Client/SensitiveWordCFG.cpp

@@ -1,103 +0,0 @@
-#include "stdafx.h"
-#include "tinyxml2/tinyxml2.h"
-#include "LuaCfgHelper.h"
-#include <iostream>
-#include <boost/algorithm/string.hpp>
-#include "SensitiveWordCFG.h"
-std::auto_ptr<SensitiveWordCFG> SensitiveWordCFG::msSingleton(nullptr);
-
-int SensitiveWordCFG::GetCount()
-{
-	return (int)mMapData.size();
-}
-
-const SensitiveWordCFGData* SensitiveWordCFG::GetData(int ID)
-{
-	auto it = mMapData.find(ID);
-	if (it != mMapData.end())
-	{
-		return &it->second;
-	}
-	return NULL;
-}
-
-const std::map<int, SensitiveWordCFGData>& SensitiveWordCFG::GetMapData()
-{
-	return mMapData;
-}
-
-void SensitiveWordCFG::Load()
-{
-	tinyxml2::XMLDocument xmlDoc;
-	std::string content = FileUtils::getInstance()->getStringFromFile("Config/SensitiveWordCFG.xml");
-	auto result = xmlDoc.Parse(content.c_str(), content.length());
-	if (result != tinyxml2::XML_SUCCESS)
-	{
-		CCLOGERROR("Result:%d", result);
-		CCASSERT(false, "result != tinyxml2::XML_SUCCESS");
-		return;
-	}
-	auto root = xmlDoc.RootElement();
-	if (root == NULL)
-	{
-		CCASSERT(false, "root == NULL");
-		return;
-	}
-	auto element = root->FirstChildElement("Data");
-	while (element != NULL)
-	{
-		SensitiveWordCFGData data;
-		data.mID = element->IntAttribute("ID");
-		data.mSensitiveWord = element->Attribute("SensitiveWord");
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		CCASSERT(mMapData.find(data.mID) == mMapData.end(), "data.mID is exists");
-		mMapData.insert(std::make_pair(data.mID, data));
-		element = element->NextSiblingElement();
-	}
-	CCLOG("SensitiveWordCFG Loaded. Load Data:%u", mMapData.size());
-}
-
-void SensitiveWordCFG::LoadLua()
-{
-	LuaEngine::getInstance()->executeScriptFile("config/SensitiveWordCFG");
-	lua_State* L = LuaEngine::getInstance()->getLuaStack()->getLuaState();
-	lua_getglobal(L, "SensitiveWordCFG");
-	CCASSERT(lua_istable(L, -1) == 1, "is not table");
-	lua_pushstring(L, "datas");
-	lua_gettable(L, -2);
-	CCASSERT(lua_istable(L, -1) == 1, "is not table");
-	lua_pushnil(L);
-	while(lua_next(L, 2))
-	{
-		CCASSERT(lua_istable(L, -1) == 1, "is not table");
-		SensitiveWordCFGData data;
-		LuaCfgHelper::readInt(L, "ID", data.mID);
-		LuaCfgHelper::readString(L, "SensitiveWord", data.mSensitiveWord);
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		CCASSERT(mMapData.find(data.mID) == mMapData.end(), "data.mID is exists");
-		mMapData.insert(std::make_pair(data.mID, data));
-		lua_pop(L, 1);
-	}
-	lua_settop(L, 0);
-	CCLOG("SensitiveWordCFG Loaded. Load Data:%u", mMapData.size());
-}
-
-void SensitiveWordCFG::Reload()
-{
-	mMapData.clear();
-	Load();
-}
-
-SensitiveWordCFG* SensitiveWordCFG::GetSingleton()
-{
-	if (msSingleton.get() == nullptr)
-	{
-		msSingleton.reset(new SensitiveWordCFG());
-	}
-	return msSingleton.get();
-}
-
-void SensitiveWordCFG::Release()
-{
-	msSingleton.reset(nullptr);
-}

+ 0 - 27
GameConfig/Code/Client/SensitiveWordCFG.h

@@ -1,27 +0,0 @@
-#pragma once
-#include <map>
-struct SensitiveWordCFGData
-{
-	//ÐòºÅ
-	int mID;
-	//×Ö·û
-	std::string mSensitiveWord;
-};
-
-class SensitiveWordCFG
-{
-public:
-private:
-	static std::auto_ptr<SensitiveWordCFG> msSingleton;
-public:
-	int GetCount();
-	const SensitiveWordCFGData* GetData(int ID);
-	const std::map<int, SensitiveWordCFGData>& GetMapData();
-	void Load();
-	void LoadLua();
-	void Reload();
-	static SensitiveWordCFG* GetSingleton();
-	static void Release();
-private:
-	std::map<int, SensitiveWordCFGData> mMapData;
-};

+ 0 - 118
GameConfig/Code/Server/M_Global_Config.cpp

@@ -1,118 +0,0 @@
-#include "stdafx.h"
-#include <cassert>
-#include <fstream>
-#include <iostream>
-#include <iostream>
-#include <boost/smart_ptr.hpp>
-#include <boost/algorithm/string.hpp>
-#include "tinyxml2.h"
-#include "M_Global_Config.h"
-#include "FileEncrypt.h"
-std::auto_ptr<M_Global_Config> M_Global_Config::msSingleton(nullptr);
-
-int M_Global_Config::GetCount()
-{
-	return (int)mMapData.size();
-}
-
-const M_Global_ConfigData* M_Global_Config::GetData(std::string Key)
-{
-	auto it = mMapData.find(Key);
-	if (it != mMapData.end())
-	{
-		return &it->second;
-	}
-	return NULL;
-}
-
-boost::unordered_map<std::string, M_Global_ConfigData>& M_Global_Config::GetMapData()
-{
-	return mMapData;
-}
-
-void M_Global_Config::Reload()
-{
-	mMapData.clear();
-	Load();
-}
-
-void M_Global_Config::Load(const std::string& path)
-{
-	std::ifstream readStream(path, std::ios::binary);
-	if (!readStream.is_open())
-	{
-		assert(false);
-		return;
-	}
-	readStream.seekg(0, std::ios::end);
-	int fileSize = readStream.tellg();
-	boost::shared_array<char> buffer(new char[fileSize+1]);
-	buffer.get()[fileSize] = '\0';
-	readStream.seekg(0, std::ios::beg);
-	readStream.read(buffer.get(), fileSize);
-	readStream.close();
-	FileEncrypt::decryptBuffer( buffer, fileSize );
-	tinyxml2::XMLDocument xmlDoc;
-	auto result = xmlDoc.Parse(buffer.get(), fileSize);
-	if (result != tinyxml2::XML_SUCCESS)
-	{
-		assert(false);
-		return;
-	}
-	auto root = xmlDoc.RootElement();
-	if (root == NULL)
-	{
-		assert(false);
-		return;
-	}
-	auto element = root->FirstChildElement("Data");
-	while (element != NULL)
-	{
-		M_Global_ConfigData data;
-		data.mKey = element->Attribute("Key");
-		data.mDesc = element->Attribute("Desc");
-		data.mIntValue = element->IntAttribute("IntValue");
-		{
-			const char* IntListValue = element->Attribute("IntListValue");
-			std::vector<std::string> vecIntListValue;
-			boost::split(vecIntListValue, IntListValue, boost::is_any_of(","));
-			int temp;
-			for (unsigned int i = 0; i < vecIntListValue.size(); i++)
-			{
-				if (tinyxml2::XMLUtil::ToInt(vecIntListValue[i].c_str(), &temp))
-				{
-					data.mIntListValue.push_back(temp);
-				}
-			}
-		}
-		data.mStrValue = element->Attribute("StrValue");
-		{
-			const char* StrListValue = element->Attribute("StrListValue");
-			std::vector<std::string> vecStrListValue;
-			boost::split(vecStrListValue, StrListValue, boost::is_any_of(","));
-			for (unsigned int i = 0; i < vecStrListValue.size(); i++)
-			{
-				data.mStrListValue.push_back(vecStrListValue[i]);
-			}
-		}
-		data.mBoolValue = element->BoolAttribute("BoolValue");
-		if (mMapData.find(data.mKey) != mMapData.end())std::cout <<"data refind:" << data.mKey << std::endl;
-		assert(mMapData.find(data.mKey) == mMapData.end());
-		mMapData.insert(std::make_pair(data.mKey, data));
-		element = element->NextSiblingElement();
-	}
-}
-
-void M_Global_Config::Load()
-{
-	Load("../Config/M_Global_Config.xml");
-}
-
-M_Global_Config* M_Global_Config::GetSingleton()
-{
-	if (msSingleton.get() == nullptr)
-	{
-		msSingleton.reset(new M_Global_Config());
-	}
-	return msSingleton.get();
-}

+ 0 - 37
GameConfig/Code/Server/M_Global_Config.h

@@ -1,37 +0,0 @@
-#pragma once
-#include <boost/unordered_map.hpp>
-#include <vector>
-struct M_Global_ConfigData
-{
-	//Key
-	std::string mKey;
-	//备注
-	std::string mDesc;
-	//数值
-	int mIntValue;
-	//数值列表
-	std::vector<int> mIntListValue;
-	//字符串
-	std::string mStrValue;
-	//字符串列表
-	std::vector<std::string> mStrListValue;
-	//布尔值参数
-	bool mBoolValue;
-};
-
-class M_Global_Config
-{
-public:
-private:
-	static std::auto_ptr<M_Global_Config> msSingleton;
-public:
-	int GetCount();
-	const M_Global_ConfigData* GetData(std::string Key);
-	boost::unordered_map<std::string, M_Global_ConfigData>& GetMapData();
-	void Reload();
-	void Load(const std::string& path);
-	void Load();
-	static M_Global_Config* GetSingleton();
-private:
-	boost::unordered_map<std::string, M_Global_ConfigData> mMapData;
-};

+ 0 - 140
GameConfig/Code/Server/M_equipment.cpp

@@ -1,140 +0,0 @@
-#include "stdafx.h"
-#include <cassert>
-#include <fstream>
-#include <iostream>
-#include <iostream>
-#include <boost/smart_ptr.hpp>
-#include <boost/algorithm/string.hpp>
-#include "tinyxml2.h"
-#include "M_equipment.h"
-#include "FileEncrypt.h"
-std::auto_ptr<M_equipment> M_equipment::msSingleton(nullptr);
-
-int M_equipment::GetCount()
-{
-	return (int)mMapData.size();
-}
-
-const M_equipmentData* M_equipment::GetData(int ID)
-{
-	auto it = mMapData.find(ID);
-	if (it != mMapData.end())
-	{
-		return &it->second;
-	}
-	return NULL;
-}
-
-boost::unordered_map<int, M_equipmentData>& M_equipment::GetMapData()
-{
-	return mMapData;
-}
-
-void M_equipment::Reload()
-{
-	mMapData.clear();
-	Load();
-}
-
-void M_equipment::Load(const std::string& path)
-{
-	std::ifstream readStream(path, std::ios::binary);
-	if (!readStream.is_open())
-	{
-		assert(false);
-		return;
-	}
-	readStream.seekg(0, std::ios::end);
-	int fileSize = readStream.tellg();
-	boost::shared_array<char> buffer(new char[fileSize+1]);
-	buffer.get()[fileSize] = '\0';
-	readStream.seekg(0, std::ios::beg);
-	readStream.read(buffer.get(), fileSize);
-	readStream.close();
-	FileEncrypt::decryptBuffer( buffer, fileSize );
-	tinyxml2::XMLDocument xmlDoc;
-	auto result = xmlDoc.Parse(buffer.get(), fileSize);
-	if (result != tinyxml2::XML_SUCCESS)
-	{
-		assert(false);
-		return;
-	}
-	auto root = xmlDoc.RootElement();
-	if (root == NULL)
-	{
-		assert(false);
-		return;
-	}
-	auto element = root->FirstChildElement("Data");
-	while (element != NULL)
-	{
-		M_equipmentData data;
-		data.mID = element->IntAttribute("ID");
-		data.mitemType = element->IntAttribute("itemType");
-		data.mleve = element->IntAttribute("leve");
-		data.mquality = element->Attribute("quality");
-		{
-			const char* cost1 = element->Attribute("cost1");
-			std::vector<std::string> veccost1;
-			boost::split(veccost1, cost1, boost::is_any_of(","));
-			int temp;
-			for (unsigned int i = 0; i < veccost1.size(); i++)
-			{
-				if (tinyxml2::XMLUtil::ToInt(veccost1[i].c_str(), &temp))
-				{
-					data.mcost1.push_back(temp);
-				}
-			}
-		}
-		{
-			const char* cost2 = element->Attribute("cost2");
-			std::vector<std::string> veccost2;
-			boost::split(veccost2, cost2, boost::is_any_of(","));
-			int temp;
-			for (unsigned int i = 0; i < veccost2.size(); i++)
-			{
-				if (tinyxml2::XMLUtil::ToInt(veccost2[i].c_str(), &temp))
-				{
-					data.mcost2.push_back(temp);
-				}
-			}
-		}
-		{
-			const char* reward = element->Attribute("reward");
-			std::vector<std::string> vecreward;
-			boost::split(vecreward, reward, boost::is_any_of(","));
-			int temp;
-			for (unsigned int i = 0; i < vecreward.size(); i++)
-			{
-				if (tinyxml2::XMLUtil::ToInt(vecreward[i].c_str(), &temp))
-				{
-					data.mreward.push_back(temp);
-				}
-			}
-		}
-		data.matk = element->IntAttribute("atk");
-		data.mhp = element->IntAttribute("hp");
-		data.matkpct = element->IntAttribute("atkpct");
-		data.mhppct = element->IntAttribute("hppct");
-		data.mcrtpct = element->IntAttribute("crtpct");
-		data.mmovepct = element->IntAttribute("movepct");
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		assert(mMapData.find(data.mID) == mMapData.end());
-		mMapData.insert(std::make_pair(data.mID, data));
-		element = element->NextSiblingElement();
-	}
-}
-
-void M_equipment::Load()
-{
-	Load("../Config/M_equipment.xml");
-}
-
-M_equipment* M_equipment::GetSingleton()
-{
-	if (msSingleton.get() == nullptr)
-	{
-		msSingleton.reset(new M_equipment());
-	}
-	return msSingleton.get();
-}

+ 0 - 49
GameConfig/Code/Server/M_equipment.h

@@ -1,49 +0,0 @@
-#pragma once
-#include <boost/unordered_map.hpp>
-#include <vector>
-struct M_equipmentData
-{
-	//ID
-	int mID;
-	//装备类型
-	int mitemType;
-	//装备等级
-	int mleve;
-	//装备品质
-	std::string mquality;
-	//所需材料(道具ID,数量)
-	std::vector<int> mcost1;
-	//所需材料(道具ID,数量)
-	std::vector<int> mcost2;
-	//奖励(道具ID,数量)
-	std::vector<int> mreward;
-	//攻击
-	int matk;
-	//生命
-	int mhp;
-	//攻击百分比
-	int matkpct;
-	//生命百分比
-	int mhppct;
-	//暴击百分比
-	int mcrtpct;
-	//移动百分比
-	int mmovepct;
-};
-
-class M_equipment
-{
-public:
-private:
-	static std::auto_ptr<M_equipment> msSingleton;
-public:
-	int GetCount();
-	const M_equipmentData* GetData(int ID);
-	boost::unordered_map<int, M_equipmentData>& GetMapData();
-	void Reload();
-	void Load(const std::string& path);
-	void Load();
-	static M_equipment* GetSingleton();
-private:
-	boost::unordered_map<int, M_equipmentData> mMapData;
-};

+ 0 - 114
GameConfig/Code/Server/M_everyday_task.cpp

@@ -1,114 +0,0 @@
-#include "stdafx.h"
-#include <cassert>
-#include <fstream>
-#include <iostream>
-#include <iostream>
-#include <boost/smart_ptr.hpp>
-#include <boost/algorithm/string.hpp>
-#include "tinyxml2.h"
-#include "M_everyday_task.h"
-#include "FileEncrypt.h"
-std::auto_ptr<M_everyday_task> M_everyday_task::msSingleton(nullptr);
-
-int M_everyday_task::GetCount()
-{
-	return (int)mMapData.size();
-}
-
-const M_everyday_taskData* M_everyday_task::GetData(int ID)
-{
-	auto it = mMapData.find(ID);
-	if (it != mMapData.end())
-	{
-		return &it->second;
-	}
-	return NULL;
-}
-
-boost::unordered_map<int, M_everyday_taskData>& M_everyday_task::GetMapData()
-{
-	return mMapData;
-}
-
-void M_everyday_task::Reload()
-{
-	mMapData.clear();
-	Load();
-}
-
-void M_everyday_task::Load(const std::string& path)
-{
-	std::ifstream readStream(path, std::ios::binary);
-	if (!readStream.is_open())
-	{
-		assert(false);
-		return;
-	}
-	readStream.seekg(0, std::ios::end);
-	int fileSize = readStream.tellg();
-	boost::shared_array<char> buffer(new char[fileSize+1]);
-	buffer.get()[fileSize] = '\0';
-	readStream.seekg(0, std::ios::beg);
-	readStream.read(buffer.get(), fileSize);
-	readStream.close();
-	FileEncrypt::decryptBuffer( buffer, fileSize );
-	tinyxml2::XMLDocument xmlDoc;
-	auto result = xmlDoc.Parse(buffer.get(), fileSize);
-	if (result != tinyxml2::XML_SUCCESS)
-	{
-		assert(false);
-		return;
-	}
-	auto root = xmlDoc.RootElement();
-	if (root == NULL)
-	{
-		assert(false);
-		return;
-	}
-	auto element = root->FirstChildElement("Data");
-	while (element != NULL)
-	{
-		M_everyday_taskData data;
-		data.mID = element->IntAttribute("ID");
-		data.mtaskType = element->IntAttribute("taskType");
-		data.mdes = element->Attribute("des");
-		{
-			int64_t temp = 0;
-			const char* str = element->Attribute("parameter");
-			tinyxml2::XMLUtil::ToInt64(str, &temp);
-			data.mparameter = temp;
-		}
-		{
-			const char* reward = element->Attribute("reward");
-			std::vector<std::string> vecreward;
-			boost::split(vecreward, reward, boost::is_any_of(","));
-			int temp;
-			for (unsigned int i = 0; i < vecreward.size(); i++)
-			{
-				if (tinyxml2::XMLUtil::ToInt(vecreward[i].c_str(), &temp))
-				{
-					data.mreward.push_back(temp);
-				}
-			}
-		}
-		data.munlock = element->IntAttribute("unlock");
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		assert(mMapData.find(data.mID) == mMapData.end());
-		mMapData.insert(std::make_pair(data.mID, data));
-		element = element->NextSiblingElement();
-	}
-}
-
-void M_everyday_task::Load()
-{
-	Load("../Config/M_everyday_task.xml");
-}
-
-M_everyday_task* M_everyday_task::GetSingleton()
-{
-	if (msSingleton.get() == nullptr)
-	{
-		msSingleton.reset(new M_everyday_task());
-	}
-	return msSingleton.get();
-}

+ 0 - 35
GameConfig/Code/Server/M_everyday_task.h

@@ -1,35 +0,0 @@
-#pragma once
-#include <boost/unordered_map.hpp>
-#include <vector>
-struct M_everyday_taskData
-{
-	//ID
-	int mID;
-	//任务类型
-	int mtaskType;
-	//描述
-	std::string mdes;
-	//参数
-	int64_t mparameter;
-	//奖励
-	std::vector<int> mreward;
-	//VIP解锁等级
-	int munlock;
-};
-
-class M_everyday_task
-{
-public:
-private:
-	static std::auto_ptr<M_everyday_task> msSingleton;
-public:
-	int GetCount();
-	const M_everyday_taskData* GetData(int ID);
-	boost::unordered_map<int, M_everyday_taskData>& GetMapData();
-	void Reload();
-	void Load(const std::string& path);
-	void Load();
-	static M_everyday_task* GetSingleton();
-private:
-	boost::unordered_map<int, M_everyday_taskData> mMapData;
-};

+ 0 - 108
GameConfig/Code/Server/M_fish_scheme.cpp

@@ -1,108 +0,0 @@
-#include "stdafx.h"
-#include <cassert>
-#include <fstream>
-#include <iostream>
-#include <iostream>
-#include <boost/smart_ptr.hpp>
-#include <boost/algorithm/string.hpp>
-#include "tinyxml2.h"
-#include "M_fish_scheme.h"
-#include "FileEncrypt.h"
-std::auto_ptr<M_fish_scheme> M_fish_scheme::msSingleton(nullptr);
-
-int M_fish_scheme::GetCount()
-{
-	return (int)mMapData.size();
-}
-
-const M_fish_schemeData* M_fish_scheme::GetData(int ID)
-{
-	auto it = mMapData.find(ID);
-	if (it != mMapData.end())
-	{
-		return &it->second;
-	}
-	return NULL;
-}
-
-boost::unordered_map<int, M_fish_schemeData>& M_fish_scheme::GetMapData()
-{
-	return mMapData;
-}
-
-void M_fish_scheme::Reload()
-{
-	mMapData.clear();
-	Load();
-}
-
-void M_fish_scheme::Load(const std::string& path)
-{
-	std::ifstream readStream(path, std::ios::binary);
-	if (!readStream.is_open())
-	{
-		assert(false);
-		return;
-	}
-	readStream.seekg(0, std::ios::end);
-	int fileSize = readStream.tellg();
-	boost::shared_array<char> buffer(new char[fileSize+1]);
-	buffer.get()[fileSize] = '\0';
-	readStream.seekg(0, std::ios::beg);
-	readStream.read(buffer.get(), fileSize);
-	readStream.close();
-	FileEncrypt::decryptBuffer( buffer, fileSize );
-	tinyxml2::XMLDocument xmlDoc;
-	auto result = xmlDoc.Parse(buffer.get(), fileSize);
-	if (result != tinyxml2::XML_SUCCESS)
-	{
-		assert(false);
-		return;
-	}
-	auto root = xmlDoc.RootElement();
-	if (root == NULL)
-	{
-		assert(false);
-		return;
-	}
-	auto element = root->FirstChildElement("Data");
-	while (element != NULL)
-	{
-		M_fish_schemeData data;
-		data.mID = element->IntAttribute("ID");
-		data.mmonster_id = element->IntAttribute("monster_id");
-		data.mfish_group = element->IntAttribute("fish_group");
-		data.mnum = element->IntAttribute("num");
-		{
-			const char* kill_count = element->Attribute("kill_count");
-			std::vector<std::string> veckill_count;
-			boost::split(veckill_count, kill_count, boost::is_any_of(","));
-			int temp;
-			for (unsigned int i = 0; i < veckill_count.size(); i++)
-			{
-				if (tinyxml2::XMLUtil::ToInt(veckill_count[i].c_str(), &temp))
-				{
-					data.mkill_count.push_back(temp);
-				}
-			}
-		}
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		assert(mMapData.find(data.mID) == mMapData.end());
-		mMapData.insert(std::make_pair(data.mID, data));
-		element = element->NextSiblingElement();
-	}
-}
-
-void M_fish_scheme::Load()
-{
-	Load("../Config/M_fish_scheme.xml");
-}
-
-M_fish_scheme* M_fish_scheme::GetSingleton()
-{
-	if (msSingleton.get() == nullptr)
-	{
-		msSingleton.reset(new M_fish_scheme());
-	}
-	return msSingleton.get();
-}

+ 0 - 33
GameConfig/Code/Server/M_fish_scheme.h

@@ -1,33 +0,0 @@
-#pragma once
-#include <boost/unordered_map.hpp>
-#include <vector>
-struct M_fish_schemeData
-{
-	//ID
-	int mID;
-	//怪物ID
-	int mmonster_id;
-	//鱼阵方案组
-	int mfish_group;
-	//数量
-	int mnum;
-	//击杀次数
-	std::vector<int> mkill_count;
-};
-
-class M_fish_scheme
-{
-public:
-private:
-	static std::auto_ptr<M_fish_scheme> msSingleton;
-public:
-	int GetCount();
-	const M_fish_schemeData* GetData(int ID);
-	boost::unordered_map<int, M_fish_schemeData>& GetMapData();
-	void Reload();
-	void Load(const std::string& path);
-	void Load();
-	static M_fish_scheme* GetSingleton();
-private:
-	boost::unordered_map<int, M_fish_schemeData> mMapData;
-};

+ 0 - 120
GameConfig/Code/Server/M_game_battle_field.cpp

@@ -1,120 +0,0 @@
-#include "stdafx.h"
-#include <cassert>
-#include <fstream>
-#include <iostream>
-#include <iostream>
-#include <boost/smart_ptr.hpp>
-#include <boost/algorithm/string.hpp>
-#include "tinyxml2.h"
-#include "M_game_battle_field.h"
-#include "FileEncrypt.h"
-std::auto_ptr<M_game_battle_field> M_game_battle_field::msSingleton(nullptr);
-
-int M_game_battle_field::GetCount()
-{
-	return (int)mMapData.size();
-}
-
-const M_game_battle_fieldData* M_game_battle_field::GetData(int64_t ID)
-{
-	auto it = mMapData.find(ID);
-	if (it != mMapData.end())
-	{
-		return &it->second;
-	}
-	return NULL;
-}
-
-boost::unordered_map<int64_t, M_game_battle_fieldData>& M_game_battle_field::GetMapData()
-{
-	return mMapData;
-}
-
-void M_game_battle_field::Reload()
-{
-	mMapData.clear();
-	Load();
-}
-
-void M_game_battle_field::Load(const std::string& path)
-{
-	std::ifstream readStream(path, std::ios::binary);
-	if (!readStream.is_open())
-	{
-		assert(false);
-		return;
-	}
-	readStream.seekg(0, std::ios::end);
-	int fileSize = readStream.tellg();
-	boost::shared_array<char> buffer(new char[fileSize+1]);
-	buffer.get()[fileSize] = '\0';
-	readStream.seekg(0, std::ios::beg);
-	readStream.read(buffer.get(), fileSize);
-	readStream.close();
-	FileEncrypt::decryptBuffer( buffer, fileSize );
-	tinyxml2::XMLDocument xmlDoc;
-	auto result = xmlDoc.Parse(buffer.get(), fileSize);
-	if (result != tinyxml2::XML_SUCCESS)
-	{
-		assert(false);
-		return;
-	}
-	auto root = xmlDoc.RootElement();
-	if (root == NULL)
-	{
-		assert(false);
-		return;
-	}
-	auto element = root->FirstChildElement("Data");
-	while (element != NULL)
-	{
-		M_game_battle_fieldData data;
-		{
-			int64_t temp = 0;
-			const char* str = element->Attribute("ID");
-			tinyxml2::XMLUtil::ToInt64(str, &temp);
-			data.mID = temp;
-		}
-		{
-			int64_t temp = 0;
-			const char* str = element->Attribute("monster_id");
-			tinyxml2::XMLUtil::ToInt64(str, &temp);
-			data.mmonster_id = temp;
-		}
-		data.mscene_type = element->IntAttribute("scene_type");
-		data.mweight = element->IntAttribute("weight");
-		data.mmax_num = element->IntAttribute("max_num");
-		{
-			const char* kill_count = element->Attribute("kill_count");
-			std::vector<std::string> veckill_count;
-			boost::split(veckill_count, kill_count, boost::is_any_of(","));
-			int temp;
-			for (unsigned int i = 0; i < veckill_count.size(); i++)
-			{
-				if (tinyxml2::XMLUtil::ToInt(veckill_count[i].c_str(), &temp))
-				{
-					data.mkill_count.push_back(temp);
-				}
-			}
-		}
-		data.maward_drop_prob = element->FloatAttribute("award_drop_prob");
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		assert(mMapData.find(data.mID) == mMapData.end());
-		mMapData.insert(std::make_pair(data.mID, data));
-		element = element->NextSiblingElement();
-	}
-}
-
-void M_game_battle_field::Load()
-{
-	Load("../Config/M_game_battle_field.xml");
-}
-
-M_game_battle_field* M_game_battle_field::GetSingleton()
-{
-	if (msSingleton.get() == nullptr)
-	{
-		msSingleton.reset(new M_game_battle_field());
-	}
-	return msSingleton.get();
-}

+ 0 - 37
GameConfig/Code/Server/M_game_battle_field.h

@@ -1,37 +0,0 @@
-#pragma once
-#include <boost/unordered_map.hpp>
-#include <vector>
-struct M_game_battle_fieldData
-{
-	//ID
-	int64_t mID;
-	//怪物ID
-	int64_t mmonster_id;
-	//场地类型
-	int mscene_type;
-	//出场权重
-	int mweight;
-	//最大数量
-	int mmax_num;
-	//击杀次数
-	std::vector<int> mkill_count;
-	//魔币掉落概率(百分比)
-	float maward_drop_prob;
-};
-
-class M_game_battle_field
-{
-public:
-private:
-	static std::auto_ptr<M_game_battle_field> msSingleton;
-public:
-	int GetCount();
-	const M_game_battle_fieldData* GetData(int64_t ID);
-	boost::unordered_map<int64_t, M_game_battle_fieldData>& GetMapData();
-	void Reload();
-	void Load(const std::string& path);
-	void Load();
-	static M_game_battle_field* GetSingleton();
-private:
-	boost::unordered_map<int64_t, M_game_battle_fieldData> mMapData;
-};

+ 0 - 100
GameConfig/Code/Server/M_game_level_config.cpp

@@ -1,100 +0,0 @@
-#include "stdafx.h"
-#include <cassert>
-#include <fstream>
-#include <iostream>
-#include <iostream>
-#include <boost/smart_ptr.hpp>
-#include <boost/algorithm/string.hpp>
-#include "tinyxml2.h"
-#include "M_game_level_config.h"
-#include "FileEncrypt.h"
-std::auto_ptr<M_game_level_config> M_game_level_config::msSingleton(nullptr);
-
-int M_game_level_config::GetCount()
-{
-	return (int)mMapData.size();
-}
-
-const M_game_level_configData* M_game_level_config::GetData(int64_t ID)
-{
-	auto it = mMapData.find(ID);
-	if (it != mMapData.end())
-	{
-		return &it->second;
-	}
-	return NULL;
-}
-
-boost::unordered_map<int64_t, M_game_level_configData>& M_game_level_config::GetMapData()
-{
-	return mMapData;
-}
-
-void M_game_level_config::Reload()
-{
-	mMapData.clear();
-	Load();
-}
-
-void M_game_level_config::Load(const std::string& path)
-{
-	std::ifstream readStream(path, std::ios::binary);
-	if (!readStream.is_open())
-	{
-		assert(false);
-		return;
-	}
-	readStream.seekg(0, std::ios::end);
-	int fileSize = readStream.tellg();
-	boost::shared_array<char> buffer(new char[fileSize+1]);
-	buffer.get()[fileSize] = '\0';
-	readStream.seekg(0, std::ios::beg);
-	readStream.read(buffer.get(), fileSize);
-	readStream.close();
-	FileEncrypt::decryptBuffer( buffer, fileSize );
-	tinyxml2::XMLDocument xmlDoc;
-	auto result = xmlDoc.Parse(buffer.get(), fileSize);
-	if (result != tinyxml2::XML_SUCCESS)
-	{
-		assert(false);
-		return;
-	}
-	auto root = xmlDoc.RootElement();
-	if (root == NULL)
-	{
-		assert(false);
-		return;
-	}
-	auto element = root->FirstChildElement("Data");
-	while (element != NULL)
-	{
-		M_game_level_configData data;
-		{
-			int64_t temp = 0;
-			const char* str = element->Attribute("ID");
-			tinyxml2::XMLUtil::ToInt64(str, &temp);
-			data.mID = temp;
-		}
-		data.mleve = element->IntAttribute("leve");
-		data.mup_exp = element->IntAttribute("up_exp");
-		data.mmonster_num = element->IntAttribute("monster_num");
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		assert(mMapData.find(data.mID) == mMapData.end());
-		mMapData.insert(std::make_pair(data.mID, data));
-		element = element->NextSiblingElement();
-	}
-}
-
-void M_game_level_config::Load()
-{
-	Load("../Config/M_game_level_config.xml");
-}
-
-M_game_level_config* M_game_level_config::GetSingleton()
-{
-	if (msSingleton.get() == nullptr)
-	{
-		msSingleton.reset(new M_game_level_config());
-	}
-	return msSingleton.get();
-}

+ 0 - 31
GameConfig/Code/Server/M_game_level_config.h

@@ -1,31 +0,0 @@
-#pragma once
-#include <boost/unordered_map.hpp>
-#include <vector>
-struct M_game_level_configData
-{
-	//ID
-	int64_t mID;
-	//等级
-	int mleve;
-	//所需经验
-	int mup_exp;
-	//同屏怪物数量
-	int mmonster_num;
-};
-
-class M_game_level_config
-{
-public:
-private:
-	static std::auto_ptr<M_game_level_config> msSingleton;
-public:
-	int GetCount();
-	const M_game_level_configData* GetData(int64_t ID);
-	boost::unordered_map<int64_t, M_game_level_configData>& GetMapData();
-	void Reload();
-	void Load(const std::string& path);
-	void Load();
-	static M_game_level_config* GetSingleton();
-private:
-	boost::unordered_map<int64_t, M_game_level_configData> mMapData;
-};

+ 0 - 102
GameConfig/Code/Server/M_hero.cpp

@@ -1,102 +0,0 @@
-#include "stdafx.h"
-#include <cassert>
-#include <fstream>
-#include <iostream>
-#include <iostream>
-#include <boost/smart_ptr.hpp>
-#include <boost/algorithm/string.hpp>
-#include "tinyxml2.h"
-#include "M_hero.h"
-#include "FileEncrypt.h"
-std::auto_ptr<M_hero> M_hero::msSingleton(nullptr);
-
-int M_hero::GetCount()
-{
-	return (int)mMapData.size();
-}
-
-const M_heroData* M_hero::GetData(int ID)
-{
-	auto it = mMapData.find(ID);
-	if (it != mMapData.end())
-	{
-		return &it->second;
-	}
-	return NULL;
-}
-
-boost::unordered_map<int, M_heroData>& M_hero::GetMapData()
-{
-	return mMapData;
-}
-
-void M_hero::Reload()
-{
-	mMapData.clear();
-	Load();
-}
-
-void M_hero::Load(const std::string& path)
-{
-	std::ifstream readStream(path, std::ios::binary);
-	if (!readStream.is_open())
-	{
-		assert(false);
-		return;
-	}
-	readStream.seekg(0, std::ios::end);
-	int fileSize = readStream.tellg();
-	boost::shared_array<char> buffer(new char[fileSize+1]);
-	buffer.get()[fileSize] = '\0';
-	readStream.seekg(0, std::ios::beg);
-	readStream.read(buffer.get(), fileSize);
-	readStream.close();
-	FileEncrypt::decryptBuffer( buffer, fileSize );
-	tinyxml2::XMLDocument xmlDoc;
-	auto result = xmlDoc.Parse(buffer.get(), fileSize);
-	if (result != tinyxml2::XML_SUCCESS)
-	{
-		assert(false);
-		return;
-	}
-	auto root = xmlDoc.RootElement();
-	if (root == NULL)
-	{
-		assert(false);
-		return;
-	}
-	auto element = root->FirstChildElement("Data");
-	while (element != NULL)
-	{
-		M_heroData data;
-		data.mID = element->IntAttribute("ID");
-		data.mname = element->Attribute("name");
-		data.mgrade_type = element->IntAttribute("grade_type");
-		data.mdefault_have = element->IntAttribute("default_have");
-		data.mskill_id = element->IntAttribute("skill_id");
-		data.mattribute = element->IntAttribute("attribute");
-		data.matk = element->IntAttribute("atk");
-		data.micon = element->Attribute("icon");
-		data.maspect = element->Attribute("aspect");
-		data.mspeed = element->FloatAttribute("speed");
-		data.mzoom_factor = element->FloatAttribute("zoom_factor");
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		assert(mMapData.find(data.mID) == mMapData.end());
-		mMapData.insert(std::make_pair(data.mID, data));
-		element = element->NextSiblingElement();
-	}
-}
-
-void M_hero::Load()
-{
-	Load("../Config/M_hero.xml");
-}
-
-M_hero* M_hero::GetSingleton()
-{
-	if (msSingleton.get() == nullptr)
-	{
-		msSingleton.reset(new M_hero());
-	}
-	return msSingleton.get();
-}

+ 0 - 45
GameConfig/Code/Server/M_hero.h

@@ -1,45 +0,0 @@
-#pragma once
-#include <boost/unordered_map.hpp>
-#include <vector>
-struct M_heroData
-{
-	//ID
-	int mID;
-	//英雄名称
-	std::string mname;
-	//英雄品质
-	int mgrade_type;
-	//默认拥有
-	int mdefault_have;
-	//技能
-	int mskill_id;
-	//属性
-	int mattribute;
-	//攻击力
-	int matk;
-	//英雄图标
-	std::string micon;
-	//英雄形象
-	std::string maspect;
-	//移动速度
-	float mspeed;
-	//缩放倍数
-	float mzoom_factor;
-};
-
-class M_hero
-{
-public:
-private:
-	static std::auto_ptr<M_hero> msSingleton;
-public:
-	int GetCount();
-	const M_heroData* GetData(int ID);
-	boost::unordered_map<int, M_heroData>& GetMapData();
-	void Reload();
-	void Load(const std::string& path);
-	void Load();
-	static M_hero* GetSingleton();
-private:
-	boost::unordered_map<int, M_heroData> mMapData;
-};

+ 0 - 94
GameConfig/Code/Server/M_i18n.cpp

@@ -1,94 +0,0 @@
-#include "stdafx.h"
-#include <cassert>
-#include <fstream>
-#include <iostream>
-#include <iostream>
-#include <boost/smart_ptr.hpp>
-#include <boost/algorithm/string.hpp>
-#include "tinyxml2.h"
-#include "M_i18n.h"
-#include "FileEncrypt.h"
-std::auto_ptr<M_i18n> M_i18n::msSingleton(nullptr);
-
-int M_i18n::GetCount()
-{
-	return (int)mMapData.size();
-}
-
-const M_i18nData* M_i18n::GetData(std::string ID)
-{
-	auto it = mMapData.find(ID);
-	if (it != mMapData.end())
-	{
-		return &it->second;
-	}
-	return NULL;
-}
-
-boost::unordered_map<std::string, M_i18nData>& M_i18n::GetMapData()
-{
-	return mMapData;
-}
-
-void M_i18n::Reload()
-{
-	mMapData.clear();
-	Load();
-}
-
-void M_i18n::Load(const std::string& path)
-{
-	std::ifstream readStream(path, std::ios::binary);
-	if (!readStream.is_open())
-	{
-		assert(false);
-		return;
-	}
-	readStream.seekg(0, std::ios::end);
-	int fileSize = readStream.tellg();
-	boost::shared_array<char> buffer(new char[fileSize+1]);
-	buffer.get()[fileSize] = '\0';
-	readStream.seekg(0, std::ios::beg);
-	readStream.read(buffer.get(), fileSize);
-	readStream.close();
-	FileEncrypt::decryptBuffer( buffer, fileSize );
-	tinyxml2::XMLDocument xmlDoc;
-	auto result = xmlDoc.Parse(buffer.get(), fileSize);
-	if (result != tinyxml2::XML_SUCCESS)
-	{
-		assert(false);
-		return;
-	}
-	auto root = xmlDoc.RootElement();
-	if (root == NULL)
-	{
-		assert(false);
-		return;
-	}
-	auto element = root->FirstChildElement("Data");
-	while (element != NULL)
-	{
-		M_i18nData data;
-		data.mID = element->Attribute("ID");
-		data.mzh = element->Attribute("zh");
-		data.men = element->Attribute("en");
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		assert(mMapData.find(data.mID) == mMapData.end());
-		mMapData.insert(std::make_pair(data.mID, data));
-		element = element->NextSiblingElement();
-	}
-}
-
-void M_i18n::Load()
-{
-	Load("../Config/M_i18n.xml");
-}
-
-M_i18n* M_i18n::GetSingleton()
-{
-	if (msSingleton.get() == nullptr)
-	{
-		msSingleton.reset(new M_i18n());
-	}
-	return msSingleton.get();
-}

+ 0 - 29
GameConfig/Code/Server/M_i18n.h

@@ -1,29 +0,0 @@
-#pragma once
-#include <boost/unordered_map.hpp>
-#include <vector>
-struct M_i18nData
-{
-	//²ÎÊý±àºÅ
-	std::string mID;
-	//ÖÐÎÄ
-	std::string mzh;
-	//Ó¢ÎÄ
-	std::string men;
-};
-
-class M_i18n
-{
-public:
-private:
-	static std::auto_ptr<M_i18n> msSingleton;
-public:
-	int GetCount();
-	const M_i18nData* GetData(std::string ID);
-	boost::unordered_map<std::string, M_i18nData>& GetMapData();
-	void Reload();
-	void Load(const std::string& path);
-	void Load();
-	static M_i18n* GetSingleton();
-private:
-	boost::unordered_map<std::string, M_i18nData> mMapData;
-};

+ 0 - 98
GameConfig/Code/Server/M_item.cpp

@@ -1,98 +0,0 @@
-#include "stdafx.h"
-#include <cassert>
-#include <fstream>
-#include <iostream>
-#include <iostream>
-#include <boost/smart_ptr.hpp>
-#include <boost/algorithm/string.hpp>
-#include "tinyxml2.h"
-#include "M_item.h"
-#include "FileEncrypt.h"
-std::auto_ptr<M_item> M_item::msSingleton(nullptr);
-
-int M_item::GetCount()
-{
-	return (int)mMapData.size();
-}
-
-const M_itemData* M_item::GetData(int ID)
-{
-	auto it = mMapData.find(ID);
-	if (it != mMapData.end())
-	{
-		return &it->second;
-	}
-	return NULL;
-}
-
-boost::unordered_map<int, M_itemData>& M_item::GetMapData()
-{
-	return mMapData;
-}
-
-void M_item::Reload()
-{
-	mMapData.clear();
-	Load();
-}
-
-void M_item::Load(const std::string& path)
-{
-	std::ifstream readStream(path, std::ios::binary);
-	if (!readStream.is_open())
-	{
-		assert(false);
-		return;
-	}
-	readStream.seekg(0, std::ios::end);
-	int fileSize = readStream.tellg();
-	boost::shared_array<char> buffer(new char[fileSize+1]);
-	buffer.get()[fileSize] = '\0';
-	readStream.seekg(0, std::ios::beg);
-	readStream.read(buffer.get(), fileSize);
-	readStream.close();
-	FileEncrypt::decryptBuffer( buffer, fileSize );
-	tinyxml2::XMLDocument xmlDoc;
-	auto result = xmlDoc.Parse(buffer.get(), fileSize);
-	if (result != tinyxml2::XML_SUCCESS)
-	{
-		assert(false);
-		return;
-	}
-	auto root = xmlDoc.RootElement();
-	if (root == NULL)
-	{
-		assert(false);
-		return;
-	}
-	auto element = root->FirstChildElement("Data");
-	while (element != NULL)
-	{
-		M_itemData data;
-		data.mID = element->IntAttribute("ID");
-		data.mname = element->Attribute("name");
-		data.mdesc = element->Attribute("desc");
-		data.mtype = element->IntAttribute("type");
-		data.mquality = element->IntAttribute("quality");
-		data.micon = element->Attribute("icon");
-		data.mparam1 = element->Attribute("param1");
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		assert(mMapData.find(data.mID) == mMapData.end());
-		mMapData.insert(std::make_pair(data.mID, data));
-		element = element->NextSiblingElement();
-	}
-}
-
-void M_item::Load()
-{
-	Load("../Config/M_item.xml");
-}
-
-M_item* M_item::GetSingleton()
-{
-	if (msSingleton.get() == nullptr)
-	{
-		msSingleton.reset(new M_item());
-	}
-	return msSingleton.get();
-}

+ 0 - 37
GameConfig/Code/Server/M_item.h

@@ -1,37 +0,0 @@
-#pragma once
-#include <boost/unordered_map.hpp>
-#include <vector>
-struct M_itemData
-{
-	//ID
-	int mID;
-	//物品名称
-	std::string mname;
-	//描述
-	std::string mdesc;
-	//类型
-	int mtype;
-	//品质
-	int mquality;
-	//图标
-	std::string micon;
-	//参数
-	std::string mparam1;
-};
-
-class M_item
-{
-public:
-private:
-	static std::auto_ptr<M_item> msSingleton;
-public:
-	int GetCount();
-	const M_itemData* GetData(int ID);
-	boost::unordered_map<int, M_itemData>& GetMapData();
-	void Reload();
-	void Load(const std::string& path);
-	void Load();
-	static M_item* GetSingleton();
-private:
-	boost::unordered_map<int, M_itemData> mMapData;
-};

+ 0 - 142
GameConfig/Code/Server/M_magic_array_config.cpp

@@ -1,142 +0,0 @@
-#include "stdafx.h"
-#include <cassert>
-#include <fstream>
-#include <iostream>
-#include <iostream>
-#include <boost/smart_ptr.hpp>
-#include <boost/algorithm/string.hpp>
-#include "tinyxml2.h"
-#include "M_magic_array_config.h"
-#include "FileEncrypt.h"
-std::auto_ptr<M_magic_array_config> M_magic_array_config::msSingleton(nullptr);
-
-int M_magic_array_config::GetCount()
-{
-	return (int)mMapData.size();
-}
-
-const M_magic_array_configData* M_magic_array_config::GetData(int64_t ID)
-{
-	auto it = mMapData.find(ID);
-	if (it != mMapData.end())
-	{
-		return &it->second;
-	}
-	return NULL;
-}
-
-boost::unordered_map<int64_t, M_magic_array_configData>& M_magic_array_config::GetMapData()
-{
-	return mMapData;
-}
-
-void M_magic_array_config::Reload()
-{
-	mMapData.clear();
-	Load();
-}
-
-void M_magic_array_config::Load(const std::string& path)
-{
-	std::ifstream readStream(path, std::ios::binary);
-	if (!readStream.is_open())
-	{
-		assert(false);
-		return;
-	}
-	readStream.seekg(0, std::ios::end);
-	int fileSize = readStream.tellg();
-	boost::shared_array<char> buffer(new char[fileSize+1]);
-	buffer.get()[fileSize] = '\0';
-	readStream.seekg(0, std::ios::beg);
-	readStream.read(buffer.get(), fileSize);
-	readStream.close();
-	FileEncrypt::decryptBuffer( buffer, fileSize );
-	tinyxml2::XMLDocument xmlDoc;
-	auto result = xmlDoc.Parse(buffer.get(), fileSize);
-	if (result != tinyxml2::XML_SUCCESS)
-	{
-		assert(false);
-		return;
-	}
-	auto root = xmlDoc.RootElement();
-	if (root == NULL)
-	{
-		assert(false);
-		return;
-	}
-	auto element = root->FirstChildElement("Data");
-	while (element != NULL)
-	{
-		M_magic_array_configData data;
-		{
-			int64_t temp = 0;
-			const char* str = element->Attribute("ID");
-			tinyxml2::XMLUtil::ToInt64(str, &temp);
-			data.mID = temp;
-		}
-		data.mlevel = element->IntAttribute("level");
-		{
-			const char* up_cost = element->Attribute("up_cost");
-			std::vector<std::string> vecup_cost;
-			boost::split(vecup_cost, up_cost, boost::is_any_of(","));
-			int temp;
-			for (unsigned int i = 0; i < vecup_cost.size(); i++)
-			{
-				if (tinyxml2::XMLUtil::ToInt(vecup_cost[i].c_str(), &temp))
-				{
-					data.mup_cost.push_back(temp);
-				}
-			}
-		}
-		{
-			const char* atk_cost = element->Attribute("atk_cost");
-			std::vector<std::string> vecatk_cost;
-			boost::split(vecatk_cost, atk_cost, boost::is_any_of(","));
-			int temp;
-			for (unsigned int i = 0; i < vecatk_cost.size(); i++)
-			{
-				if (tinyxml2::XMLUtil::ToInt(vecatk_cost[i].c_str(), &temp))
-				{
-					data.matk_cost.push_back(temp);
-				}
-			}
-		}
-		{
-			const char* un_lock_award = element->Attribute("un_lock_award");
-			std::vector<std::string> vecun_lock_award;
-			boost::split(vecun_lock_award, un_lock_award, boost::is_any_of(","));
-			int temp;
-			for (unsigned int i = 0; i < vecun_lock_award.size(); i++)
-			{
-				if (tinyxml2::XMLUtil::ToInt(vecun_lock_award[i].c_str(), &temp))
-				{
-					data.mun_lock_award.push_back(temp);
-				}
-			}
-		}
-		data.matk = element->IntAttribute("atk");
-		data.mhp = element->IntAttribute("hp");
-		data.micon = element->Attribute("icon");
-		data.mm_stone = element->Attribute("m_stone");
-		data.mmgc_stone = element->FloatAttribute("mgc_stone");
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		assert(mMapData.find(data.mID) == mMapData.end());
-		mMapData.insert(std::make_pair(data.mID, data));
-		element = element->NextSiblingElement();
-	}
-}
-
-void M_magic_array_config::Load()
-{
-	Load("../Config/M_magic_array_config.xml");
-}
-
-M_magic_array_config* M_magic_array_config::GetSingleton()
-{
-	if (msSingleton.get() == nullptr)
-	{
-		msSingleton.reset(new M_magic_array_config());
-	}
-	return msSingleton.get();
-}

+ 0 - 43
GameConfig/Code/Server/M_magic_array_config.h

@@ -1,43 +0,0 @@
-#pragma once
-#include <boost/unordered_map.hpp>
-#include <vector>
-struct M_magic_array_configData
-{
-	//ID
-	int64_t mID;
-	//等级
-	int mlevel;
-	//升级消耗(道具ID,数量)
-	std::vector<int> mup_cost;
-	//攻击消耗(道具ID,数量)
-	std::vector<int> matk_cost;
-	//解锁奖励(道具ID,数量)
-	std::vector<int> mun_lock_award;
-	//攻击
-	int matk;
-	//生命
-	int mhp;
-	//图标
-	std::string micon;
-	//魔导石掉落
-	std::string mm_stone;
-	//魔法石掉落(百分比)
-	float mmgc_stone;
-};
-
-class M_magic_array_config
-{
-public:
-private:
-	static std::auto_ptr<M_magic_array_config> msSingleton;
-public:
-	int GetCount();
-	const M_magic_array_configData* GetData(int64_t ID);
-	boost::unordered_map<int64_t, M_magic_array_configData>& GetMapData();
-	void Reload();
-	void Load(const std::string& path);
-	void Load();
-	static M_magic_array_config* GetSingleton();
-private:
-	boost::unordered_map<int64_t, M_magic_array_configData> mMapData;
-};

+ 0 - 106
GameConfig/Code/Server/M_monster.cpp

@@ -1,106 +0,0 @@
-#include "stdafx.h"
-#include <cassert>
-#include <fstream>
-#include <iostream>
-#include <iostream>
-#include <boost/smart_ptr.hpp>
-#include <boost/algorithm/string.hpp>
-#include "tinyxml2.h"
-#include "M_monster.h"
-#include "FileEncrypt.h"
-std::auto_ptr<M_monster> M_monster::msSingleton(nullptr);
-
-int M_monster::GetCount()
-{
-	return (int)mMapData.size();
-}
-
-const M_monsterData* M_monster::GetData(int64_t ID)
-{
-	auto it = mMapData.find(ID);
-	if (it != mMapData.end())
-	{
-		return &it->second;
-	}
-	return NULL;
-}
-
-boost::unordered_map<int64_t, M_monsterData>& M_monster::GetMapData()
-{
-	return mMapData;
-}
-
-void M_monster::Reload()
-{
-	mMapData.clear();
-	Load();
-}
-
-void M_monster::Load(const std::string& path)
-{
-	std::ifstream readStream(path, std::ios::binary);
-	if (!readStream.is_open())
-	{
-		assert(false);
-		return;
-	}
-	readStream.seekg(0, std::ios::end);
-	int fileSize = readStream.tellg();
-	boost::shared_array<char> buffer(new char[fileSize+1]);
-	buffer.get()[fileSize] = '\0';
-	readStream.seekg(0, std::ios::beg);
-	readStream.read(buffer.get(), fileSize);
-	readStream.close();
-	FileEncrypt::decryptBuffer( buffer, fileSize );
-	tinyxml2::XMLDocument xmlDoc;
-	auto result = xmlDoc.Parse(buffer.get(), fileSize);
-	if (result != tinyxml2::XML_SUCCESS)
-	{
-		assert(false);
-		return;
-	}
-	auto root = xmlDoc.RootElement();
-	if (root == NULL)
-	{
-		assert(false);
-		return;
-	}
-	auto element = root->FirstChildElement("Data");
-	while (element != NULL)
-	{
-		M_monsterData data;
-		{
-			int64_t temp = 0;
-			const char* str = element->Attribute("ID");
-			tinyxml2::XMLUtil::ToInt64(str, &temp);
-			data.mID = temp;
-		}
-		data.mname = element->Attribute("name");
-		data.mtype = element->IntAttribute("type");
-		data.mmultiple = element->IntAttribute("multiple");
-		data.micon = element->Attribute("icon");
-		data.maspect = element->Attribute("aspect");
-		data.mspeed = element->FloatAttribute("speed");
-		data.msuper_speed = element->FloatAttribute("super_speed");
-		data.mzoom_factor = element->FloatAttribute("zoom_factor");
-		data.mexp_value = element->IntAttribute("exp_value");
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		assert(mMapData.find(data.mID) == mMapData.end());
-		mMapData.insert(std::make_pair(data.mID, data));
-		element = element->NextSiblingElement();
-	}
-}
-
-void M_monster::Load()
-{
-	Load("../Config/M_monster.xml");
-}
-
-M_monster* M_monster::GetSingleton()
-{
-	if (msSingleton.get() == nullptr)
-	{
-		msSingleton.reset(new M_monster());
-	}
-	return msSingleton.get();
-}

+ 0 - 43
GameConfig/Code/Server/M_monster.h

@@ -1,43 +0,0 @@
-#pragma once
-#include <boost/unordered_map.hpp>
-#include <vector>
-struct M_monsterData
-{
-	//ID
-	int64_t mID;
-	//怪物名称
-	std::string mname;
-	//怪物类型
-	int mtype;
-	//击杀倍数
-	int mmultiple;
-	//怪物图标
-	std::string micon;
-	//怪物形象
-	std::string maspect;
-	//移动速度
-	float mspeed;
-	//鱼阵移动速度
-	float msuper_speed;
-	//缩放倍数
-	float mzoom_factor;
-	//经验掉落(道具ID)
-	int mexp_value;
-};
-
-class M_monster
-{
-public:
-private:
-	static std::auto_ptr<M_monster> msSingleton;
-public:
-	int GetCount();
-	const M_monsterData* GetData(int64_t ID);
-	boost::unordered_map<int64_t, M_monsterData>& GetMapData();
-	void Reload();
-	void Load(const std::string& path);
-	void Load();
-	static M_monster* GetSingleton();
-private:
-	boost::unordered_map<int64_t, M_monsterData> mMapData;
-};

+ 0 - 123
GameConfig/Code/Server/M_shop.cpp

@@ -1,123 +0,0 @@
-#include "stdafx.h"
-#include <cassert>
-#include <fstream>
-#include <iostream>
-#include <iostream>
-#include <boost/smart_ptr.hpp>
-#include <boost/algorithm/string.hpp>
-#include "tinyxml2.h"
-#include "M_shop.h"
-#include "FileEncrypt.h"
-std::auto_ptr<M_shop> M_shop::msSingleton(nullptr);
-
-int M_shop::GetCount()
-{
-	return (int)mMapData.size();
-}
-
-const M_shopData* M_shop::GetData(int ID)
-{
-	auto it = mMapData.find(ID);
-	if (it != mMapData.end())
-	{
-		return &it->second;
-	}
-	return NULL;
-}
-
-boost::unordered_map<int, M_shopData>& M_shop::GetMapData()
-{
-	return mMapData;
-}
-
-void M_shop::Reload()
-{
-	mMapData.clear();
-	Load();
-}
-
-void M_shop::Load(const std::string& path)
-{
-	std::ifstream readStream(path, std::ios::binary);
-	if (!readStream.is_open())
-	{
-		assert(false);
-		return;
-	}
-	readStream.seekg(0, std::ios::end);
-	int fileSize = readStream.tellg();
-	boost::shared_array<char> buffer(new char[fileSize+1]);
-	buffer.get()[fileSize] = '\0';
-	readStream.seekg(0, std::ios::beg);
-	readStream.read(buffer.get(), fileSize);
-	readStream.close();
-	FileEncrypt::decryptBuffer( buffer, fileSize );
-	tinyxml2::XMLDocument xmlDoc;
-	auto result = xmlDoc.Parse(buffer.get(), fileSize);
-	if (result != tinyxml2::XML_SUCCESS)
-	{
-		assert(false);
-		return;
-	}
-	auto root = xmlDoc.RootElement();
-	if (root == NULL)
-	{
-		assert(false);
-		return;
-	}
-	auto element = root->FirstChildElement("Data");
-	while (element != NULL)
-	{
-		M_shopData data;
-		data.mID = element->IntAttribute("ID");
-		data.mshop_type = element->IntAttribute("shop_type");
-		{
-			const char* cost_Item = element->Attribute("cost_Item");
-			std::vector<std::string> veccost_Item;
-			boost::split(veccost_Item, cost_Item, boost::is_any_of(","));
-			int temp;
-			for (unsigned int i = 0; i < veccost_Item.size(); i++)
-			{
-				if (tinyxml2::XMLUtil::ToInt(veccost_Item[i].c_str(), &temp))
-				{
-					data.mcost_Item.push_back(temp);
-				}
-			}
-		}
-		{
-			const char* reward = element->Attribute("reward");
-			std::vector<std::string> vecreward;
-			boost::split(vecreward, reward, boost::is_any_of(","));
-			int temp;
-			for (unsigned int i = 0; i < vecreward.size(); i++)
-			{
-				if (tinyxml2::XMLUtil::ToInt(vecreward[i].c_str(), &temp))
-				{
-					data.mreward.push_back(temp);
-				}
-			}
-		}
-		data.micon = element->Attribute("icon");
-		data.msort = element->IntAttribute("sort");
-		data.mcondition = element->IntAttribute("condition");
-		data.mvalue = element->Attribute("value");
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		assert(mMapData.find(data.mID) == mMapData.end());
-		mMapData.insert(std::make_pair(data.mID, data));
-		element = element->NextSiblingElement();
-	}
-}
-
-void M_shop::Load()
-{
-	Load("../Config/M_shop.xml");
-}
-
-M_shop* M_shop::GetSingleton()
-{
-	if (msSingleton.get() == nullptr)
-	{
-		msSingleton.reset(new M_shop());
-	}
-	return msSingleton.get();
-}

+ 0 - 39
GameConfig/Code/Server/M_shop.h

@@ -1,39 +0,0 @@
-#pragma once
-#include <boost/unordered_map.hpp>
-#include <vector>
-struct M_shopData
-{
-	//ID
-	int mID;
-	//ÀàÐÍ
-	int mshop_type;
-	//¹ºÂòÏûºÄ
-	std::vector<int> mcost_Item;
-	//¹ºÂò»ñµÃ
-	std::vector<int> mreward;
-	//ͼ±ê
-	std::string micon;
-	//ÅÅÐò
-	int msort;
-	//¿ªÆôÌõ¼þ(VIPµÈ¼¶)
-	int mcondition;
-	//³¬Öµ½Ç±ê
-	std::string mvalue;
-};
-
-class M_shop
-{
-public:
-private:
-	static std::auto_ptr<M_shop> msSingleton;
-public:
-	int GetCount();
-	const M_shopData* GetData(int ID);
-	boost::unordered_map<int, M_shopData>& GetMapData();
-	void Reload();
-	void Load(const std::string& path);
-	void Load();
-	static M_shop* GetSingleton();
-private:
-	boost::unordered_map<int, M_shopData> mMapData;
-};

+ 0 - 99
GameConfig/Code/Server/M_skill.cpp

@@ -1,99 +0,0 @@
-#include "stdafx.h"
-#include <cassert>
-#include <fstream>
-#include <iostream>
-#include <iostream>
-#include <boost/smart_ptr.hpp>
-#include <boost/algorithm/string.hpp>
-#include "tinyxml2.h"
-#include "M_skill.h"
-#include "FileEncrypt.h"
-std::auto_ptr<M_skill> M_skill::msSingleton(nullptr);
-
-int M_skill::GetCount()
-{
-	return (int)mMapData.size();
-}
-
-const M_skillData* M_skill::GetData(int ID)
-{
-	auto it = mMapData.find(ID);
-	if (it != mMapData.end())
-	{
-		return &it->second;
-	}
-	return NULL;
-}
-
-boost::unordered_map<int, M_skillData>& M_skill::GetMapData()
-{
-	return mMapData;
-}
-
-void M_skill::Reload()
-{
-	mMapData.clear();
-	Load();
-}
-
-void M_skill::Load(const std::string& path)
-{
-	std::ifstream readStream(path, std::ios::binary);
-	if (!readStream.is_open())
-	{
-		assert(false);
-		return;
-	}
-	readStream.seekg(0, std::ios::end);
-	int fileSize = readStream.tellg();
-	boost::shared_array<char> buffer(new char[fileSize+1]);
-	buffer.get()[fileSize] = '\0';
-	readStream.seekg(0, std::ios::beg);
-	readStream.read(buffer.get(), fileSize);
-	readStream.close();
-	FileEncrypt::decryptBuffer( buffer, fileSize );
-	tinyxml2::XMLDocument xmlDoc;
-	auto result = xmlDoc.Parse(buffer.get(), fileSize);
-	if (result != tinyxml2::XML_SUCCESS)
-	{
-		assert(false);
-		return;
-	}
-	auto root = xmlDoc.RootElement();
-	if (root == NULL)
-	{
-		assert(false);
-		return;
-	}
-	auto element = root->FirstChildElement("Data");
-	while (element != NULL)
-	{
-		M_skillData data;
-		data.mID = element->IntAttribute("ID");
-		data.mhero_id = element->IntAttribute("hero_id");
-		data.mskill_leve = element->IntAttribute("skill_leve");
-		data.mbullet_num = element->IntAttribute("bullet_num");
-		data.mbullet_radius = element->IntAttribute("bullet_radius");
-		data.mattack_distance = element->IntAttribute("attack_distance");
-		data.mattack_Interval = element->FloatAttribute("attack_Interval");
-		data.mskill_des = element->Attribute("skill_des");
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		assert(mMapData.find(data.mID) == mMapData.end());
-		mMapData.insert(std::make_pair(data.mID, data));
-		element = element->NextSiblingElement();
-	}
-}
-
-void M_skill::Load()
-{
-	Load("../Config/M_skill.xml");
-}
-
-M_skill* M_skill::GetSingleton()
-{
-	if (msSingleton.get() == nullptr)
-	{
-		msSingleton.reset(new M_skill());
-	}
-	return msSingleton.get();
-}

+ 0 - 39
GameConfig/Code/Server/M_skill.h

@@ -1,39 +0,0 @@
-#pragma once
-#include <boost/unordered_map.hpp>
-#include <vector>
-struct M_skillData
-{
-	//ID
-	int mID;
-	//英雄ID
-	int mhero_id;
-	//技能等级
-	int mskill_leve;
-	//子弹数量
-	int mbullet_num;
-	//子弹半径
-	int mbullet_radius;
-	//攻击距离
-	int mattack_distance;
-	//攻击间隔
-	float mattack_Interval;
-	//技能描述
-	std::string mskill_des;
-};
-
-class M_skill
-{
-public:
-private:
-	static std::auto_ptr<M_skill> msSingleton;
-public:
-	int GetCount();
-	const M_skillData* GetData(int ID);
-	boost::unordered_map<int, M_skillData>& GetMapData();
-	void Reload();
-	void Load(const std::string& path);
-	void Load();
-	static M_skill* GetSingleton();
-private:
-	boost::unordered_map<int, M_skillData> mMapData;
-};

+ 0 - 94
GameConfig/Code/Server/M_test.cpp

@@ -1,94 +0,0 @@
-#include "stdafx.h"
-#include <cassert>
-#include <fstream>
-#include <iostream>
-#include <iostream>
-#include <boost/smart_ptr.hpp>
-#include <boost/algorithm/string.hpp>
-#include "tinyxml2.h"
-#include "M_test.h"
-#include "FileEncrypt.h"
-std::auto_ptr<M_test> M_test::msSingleton(nullptr);
-
-int M_test::GetCount()
-{
-	return (int)mMapData.size();
-}
-
-const M_testData* M_test::GetData(std::string ID)
-{
-	auto it = mMapData.find(ID);
-	if (it != mMapData.end())
-	{
-		return &it->second;
-	}
-	return NULL;
-}
-
-boost::unordered_map<std::string, M_testData>& M_test::GetMapData()
-{
-	return mMapData;
-}
-
-void M_test::Reload()
-{
-	mMapData.clear();
-	Load();
-}
-
-void M_test::Load(const std::string& path)
-{
-	std::ifstream readStream(path, std::ios::binary);
-	if (!readStream.is_open())
-	{
-		assert(false);
-		return;
-	}
-	readStream.seekg(0, std::ios::end);
-	int fileSize = readStream.tellg();
-	boost::shared_array<char> buffer(new char[fileSize+1]);
-	buffer.get()[fileSize] = '\0';
-	readStream.seekg(0, std::ios::beg);
-	readStream.read(buffer.get(), fileSize);
-	readStream.close();
-	FileEncrypt::decryptBuffer( buffer, fileSize );
-	tinyxml2::XMLDocument xmlDoc;
-	auto result = xmlDoc.Parse(buffer.get(), fileSize);
-	if (result != tinyxml2::XML_SUCCESS)
-	{
-		assert(false);
-		return;
-	}
-	auto root = xmlDoc.RootElement();
-	if (root == NULL)
-	{
-		assert(false);
-		return;
-	}
-	auto element = root->FirstChildElement("Data");
-	while (element != NULL)
-	{
-		M_testData data;
-		data.mID = element->Attribute("ID");
-		data.mxxx = element->Attribute("xxx");
-		data.mttt = element->Attribute("ttt");
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		assert(mMapData.find(data.mID) == mMapData.end());
-		mMapData.insert(std::make_pair(data.mID, data));
-		element = element->NextSiblingElement();
-	}
-}
-
-void M_test::Load()
-{
-	Load("../Config/M_test.xml");
-}
-
-M_test* M_test::GetSingleton()
-{
-	if (msSingleton.get() == nullptr)
-	{
-		msSingleton.reset(new M_test());
-	}
-	return msSingleton.get();
-}

+ 0 - 29
GameConfig/Code/Server/M_test.h

@@ -1,29 +0,0 @@
-#pragma once
-#include <boost/unordered_map.hpp>
-#include <vector>
-struct M_testData
-{
-	//²ÎÊý±àºÅ
-	std::string mID;
-	//ÖÐÎÄ
-	std::string mxxx;
-	//Ó¢ÎÄ
-	std::string mttt;
-};
-
-class M_test
-{
-public:
-private:
-	static std::auto_ptr<M_test> msSingleton;
-public:
-	int GetCount();
-	const M_testData* GetData(std::string ID);
-	boost::unordered_map<std::string, M_testData>& GetMapData();
-	void Reload();
-	void Load(const std::string& path);
-	void Load();
-	static M_test* GetSingleton();
-private:
-	boost::unordered_map<std::string, M_testData> mMapData;
-};

+ 0 - 128
GameConfig/Code/Server/M_un_lock_battle.cpp

@@ -1,128 +0,0 @@
-#include "stdafx.h"
-#include <cassert>
-#include <fstream>
-#include <iostream>
-#include <iostream>
-#include <boost/smart_ptr.hpp>
-#include <boost/algorithm/string.hpp>
-#include "tinyxml2.h"
-#include "M_un_lock_battle.h"
-#include "FileEncrypt.h"
-std::auto_ptr<M_un_lock_battle> M_un_lock_battle::msSingleton(nullptr);
-
-int M_un_lock_battle::GetCount()
-{
-	return (int)mMapData.size();
-}
-
-const M_un_lock_battleData* M_un_lock_battle::GetData(int64_t ID)
-{
-	auto it = mMapData.find(ID);
-	if (it != mMapData.end())
-	{
-		return &it->second;
-	}
-	return NULL;
-}
-
-boost::unordered_map<int64_t, M_un_lock_battleData>& M_un_lock_battle::GetMapData()
-{
-	return mMapData;
-}
-
-void M_un_lock_battle::Reload()
-{
-	mMapData.clear();
-	Load();
-}
-
-void M_un_lock_battle::Load(const std::string& path)
-{
-	std::ifstream readStream(path, std::ios::binary);
-	if (!readStream.is_open())
-	{
-		assert(false);
-		return;
-	}
-	readStream.seekg(0, std::ios::end);
-	int fileSize = readStream.tellg();
-	boost::shared_array<char> buffer(new char[fileSize+1]);
-	buffer.get()[fileSize] = '\0';
-	readStream.seekg(0, std::ios::beg);
-	readStream.read(buffer.get(), fileSize);
-	readStream.close();
-	FileEncrypt::decryptBuffer( buffer, fileSize );
-	tinyxml2::XMLDocument xmlDoc;
-	auto result = xmlDoc.Parse(buffer.get(), fileSize);
-	if (result != tinyxml2::XML_SUCCESS)
-	{
-		assert(false);
-		return;
-	}
-	auto root = xmlDoc.RootElement();
-	if (root == NULL)
-	{
-		assert(false);
-		return;
-	}
-	auto element = root->FirstChildElement("Data");
-	while (element != NULL)
-	{
-		M_un_lock_battleData data;
-		{
-			int64_t temp = 0;
-			const char* str = element->Attribute("ID");
-			tinyxml2::XMLUtil::ToInt64(str, &temp);
-			data.mID = temp;
-		}
-		data.mbattle_type = element->IntAttribute("battle_type");
-		data.mun_lock_magic = element->IntAttribute("un_lock_magic");
-		data.mdemand = element->IntAttribute("demand");
-		data.mprohibit = element->IntAttribute("prohibit");
-		{
-			const char* use_magic = element->Attribute("use_magic");
-			std::vector<std::string> vecuse_magic;
-			boost::split(vecuse_magic, use_magic, boost::is_any_of(","));
-			int temp;
-			for (unsigned int i = 0; i < vecuse_magic.size(); i++)
-			{
-				if (tinyxml2::XMLUtil::ToInt(vecuse_magic[i].c_str(), &temp))
-				{
-					data.muse_magic.push_back(temp);
-				}
-			}
-		}
-		{
-			const char* fish_wave = element->Attribute("fish_wave");
-			std::vector<std::string> vecfish_wave;
-			boost::split(vecfish_wave, fish_wave, boost::is_any_of(","));
-			int temp;
-			for (unsigned int i = 0; i < vecfish_wave.size(); i++)
-			{
-				if (tinyxml2::XMLUtil::ToInt(vecfish_wave[i].c_str(), &temp))
-				{
-					data.mfish_wave.push_back(temp);
-				}
-			}
-		}
-		data.mfish_scheme = element->Attribute("fish_scheme");
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		assert(mMapData.find(data.mID) == mMapData.end());
-		mMapData.insert(std::make_pair(data.mID, data));
-		element = element->NextSiblingElement();
-	}
-}
-
-void M_un_lock_battle::Load()
-{
-	Load("../Config/M_un_lock_battle.xml");
-}
-
-M_un_lock_battle* M_un_lock_battle::GetSingleton()
-{
-	if (msSingleton.get() == nullptr)
-	{
-		msSingleton.reset(new M_un_lock_battle());
-	}
-	return msSingleton.get();
-}

+ 0 - 39
GameConfig/Code/Server/M_un_lock_battle.h

@@ -1,39 +0,0 @@
-#pragma once
-#include <boost/unordered_map.hpp>
-#include <vector>
-struct M_un_lock_battleData
-{
-	//ID
-	int64_t mID;
-	//场地类型
-	int mbattle_type;
-	//魔法阵解锁
-	int mun_lock_magic;
-	//魔币准入金额
-	int mdemand;
-	//魔币禁止金额
-	int mprohibit;
-	//魔法阵使用等级
-	std::vector<int> muse_magic;
-	//鱼阵波数
-	std::vector<int> mfish_wave;
-	//鱼阵方案(方案,权重|方案,权重)
-	std::string mfish_scheme;
-};
-
-class M_un_lock_battle
-{
-public:
-private:
-	static std::auto_ptr<M_un_lock_battle> msSingleton;
-public:
-	int GetCount();
-	const M_un_lock_battleData* GetData(int64_t ID);
-	boost::unordered_map<int64_t, M_un_lock_battleData>& GetMapData();
-	void Reload();
-	void Load(const std::string& path);
-	void Load();
-	static M_un_lock_battle* GetSingleton();
-private:
-	boost::unordered_map<int64_t, M_un_lock_battleData> mMapData;
-};

+ 0 - 108
GameConfig/Code/Server/M_vip_config.cpp

@@ -1,108 +0,0 @@
-#include "stdafx.h"
-#include <cassert>
-#include <fstream>
-#include <iostream>
-#include <iostream>
-#include <boost/smart_ptr.hpp>
-#include <boost/algorithm/string.hpp>
-#include "tinyxml2.h"
-#include "M_vip_config.h"
-#include "FileEncrypt.h"
-std::auto_ptr<M_vip_config> M_vip_config::msSingleton(nullptr);
-
-int M_vip_config::GetCount()
-{
-	return (int)mMapData.size();
-}
-
-const M_vip_configData* M_vip_config::GetData(int ID)
-{
-	auto it = mMapData.find(ID);
-	if (it != mMapData.end())
-	{
-		return &it->second;
-	}
-	return NULL;
-}
-
-boost::unordered_map<int, M_vip_configData>& M_vip_config::GetMapData()
-{
-	return mMapData;
-}
-
-void M_vip_config::Reload()
-{
-	mMapData.clear();
-	Load();
-}
-
-void M_vip_config::Load(const std::string& path)
-{
-	std::ifstream readStream(path, std::ios::binary);
-	if (!readStream.is_open())
-	{
-		assert(false);
-		return;
-	}
-	readStream.seekg(0, std::ios::end);
-	int fileSize = readStream.tellg();
-	boost::shared_array<char> buffer(new char[fileSize+1]);
-	buffer.get()[fileSize] = '\0';
-	readStream.seekg(0, std::ios::beg);
-	readStream.read(buffer.get(), fileSize);
-	readStream.close();
-	FileEncrypt::decryptBuffer( buffer, fileSize );
-	tinyxml2::XMLDocument xmlDoc;
-	auto result = xmlDoc.Parse(buffer.get(), fileSize);
-	if (result != tinyxml2::XML_SUCCESS)
-	{
-		assert(false);
-		return;
-	}
-	auto root = xmlDoc.RootElement();
-	if (root == NULL)
-	{
-		assert(false);
-		return;
-	}
-	auto element = root->FirstChildElement("Data");
-	while (element != NULL)
-	{
-		M_vip_configData data;
-		data.mID = element->IntAttribute("ID");
-		data.mleve = element->IntAttribute("leve");
-		data.mvipexp = element->IntAttribute("vipexp");
-		{
-			const char* everdayreward = element->Attribute("everdayreward");
-			std::vector<std::string> veceverdayreward;
-			boost::split(veceverdayreward, everdayreward, boost::is_any_of(","));
-			int temp;
-			for (unsigned int i = 0; i < veceverdayreward.size(); i++)
-			{
-				if (tinyxml2::XMLUtil::ToInt(veceverdayreward[i].c_str(), &temp))
-				{
-					data.meverdayreward.push_back(temp);
-				}
-			}
-		}
-		data.mskillquantity = element->IntAttribute("skillquantity");
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		assert(mMapData.find(data.mID) == mMapData.end());
-		mMapData.insert(std::make_pair(data.mID, data));
-		element = element->NextSiblingElement();
-	}
-}
-
-void M_vip_config::Load()
-{
-	Load("../Config/M_vip_config.xml");
-}
-
-M_vip_config* M_vip_config::GetSingleton()
-{
-	if (msSingleton.get() == nullptr)
-	{
-		msSingleton.reset(new M_vip_config());
-	}
-	return msSingleton.get();
-}

+ 0 - 33
GameConfig/Code/Server/M_vip_config.h

@@ -1,33 +0,0 @@
-#pragma once
-#include <boost/unordered_map.hpp>
-#include <vector>
-struct M_vip_configData
-{
-	//ID
-	int mID;
-	//Vip等级
-	int mleve;
-	//所需经验
-	int mvipexp;
-	//每日奖励(道具ID,数量)
-	std::vector<int> meverdayreward;
-	//额外技能数量
-	int mskillquantity;
-};
-
-class M_vip_config
-{
-public:
-private:
-	static std::auto_ptr<M_vip_config> msSingleton;
-public:
-	int GetCount();
-	const M_vip_configData* GetData(int ID);
-	boost::unordered_map<int, M_vip_configData>& GetMapData();
-	void Reload();
-	void Load(const std::string& path);
-	void Load();
-	static M_vip_config* GetSingleton();
-private:
-	boost::unordered_map<int, M_vip_configData> mMapData;
-};

+ 0 - 93
GameConfig/Code/Server/SensitiveWordCFG.cpp

@@ -1,93 +0,0 @@
-#include "stdafx.h"
-#include <cassert>
-#include <fstream>
-#include <iostream>
-#include <iostream>
-#include <boost/smart_ptr.hpp>
-#include <boost/algorithm/string.hpp>
-#include "tinyxml2.h"
-#include "SensitiveWordCFG.h"
-#include "FileEncrypt.h"
-std::auto_ptr<SensitiveWordCFG> SensitiveWordCFG::msSingleton(nullptr);
-
-int SensitiveWordCFG::GetCount()
-{
-	return (int)mMapData.size();
-}
-
-const SensitiveWordCFGData* SensitiveWordCFG::GetData(int ID)
-{
-	auto it = mMapData.find(ID);
-	if (it != mMapData.end())
-	{
-		return &it->second;
-	}
-	return NULL;
-}
-
-boost::unordered_map<int, SensitiveWordCFGData>& SensitiveWordCFG::GetMapData()
-{
-	return mMapData;
-}
-
-void SensitiveWordCFG::Reload()
-{
-	mMapData.clear();
-	Load();
-}
-
-void SensitiveWordCFG::Load(const std::string& path)
-{
-	std::ifstream readStream(path, std::ios::binary);
-	if (!readStream.is_open())
-	{
-		assert(false);
-		return;
-	}
-	readStream.seekg(0, std::ios::end);
-	int fileSize = readStream.tellg();
-	boost::shared_array<char> buffer(new char[fileSize+1]);
-	buffer.get()[fileSize] = '\0';
-	readStream.seekg(0, std::ios::beg);
-	readStream.read(buffer.get(), fileSize);
-	readStream.close();
-	FileEncrypt::decryptBuffer( buffer, fileSize );
-	tinyxml2::XMLDocument xmlDoc;
-	auto result = xmlDoc.Parse(buffer.get(), fileSize);
-	if (result != tinyxml2::XML_SUCCESS)
-	{
-		assert(false);
-		return;
-	}
-	auto root = xmlDoc.RootElement();
-	if (root == NULL)
-	{
-		assert(false);
-		return;
-	}
-	auto element = root->FirstChildElement("Data");
-	while (element != NULL)
-	{
-		SensitiveWordCFGData data;
-		data.mID = element->IntAttribute("ID");
-		data.mSensitiveWord = element->Attribute("SensitiveWord");
-		if (mMapData.find(data.mID) != mMapData.end())std::cout <<"data refind:" << data.mID << std::endl;
-		assert(mMapData.find(data.mID) == mMapData.end());
-		mMapData.insert(std::make_pair(data.mID, data));
-		element = element->NextSiblingElement();
-	}
-}
-
-void SensitiveWordCFG::Load()
-{
-	Load("../Config/SensitiveWordCFG.xml");
-}
-
-SensitiveWordCFG* SensitiveWordCFG::GetSingleton()
-{
-	if (msSingleton.get() == nullptr)
-	{
-		msSingleton.reset(new SensitiveWordCFG());
-	}
-	return msSingleton.get();
-}

+ 0 - 27
GameConfig/Code/Server/SensitiveWordCFG.h

@@ -1,27 +0,0 @@
-#pragma once
-#include <boost/unordered_map.hpp>
-#include <vector>
-struct SensitiveWordCFGData
-{
-	//ÐòºÅ
-	int mID;
-	//×Ö·û
-	std::string mSensitiveWord;
-};
-
-class SensitiveWordCFG
-{
-public:
-private:
-	static std::auto_ptr<SensitiveWordCFG> msSingleton;
-public:
-	int GetCount();
-	const SensitiveWordCFGData* GetData(int ID);
-	boost::unordered_map<int, SensitiveWordCFGData>& GetMapData();
-	void Reload();
-	void Load(const std::string& path);
-	void Load();
-	static SensitiveWordCFG* GetSingleton();
-private:
-	boost::unordered_map<int, SensitiveWordCFGData> mMapData;
-};