#include "StdAfx.h"
#ifdef __USE_CYTHON__
#include "PythonrootlibManager.h"
#include "../../extern/include/Python-2.7/Python.h"
#ifdef _DEBUG
#pragma comment (lib, "rootlib_d.lib")
#else
#pragma comment (lib, "rootlib.lib")
#endif
struct rootlib_SMethodDef
{
char* func_name;
void (*func)();
};
PyMODINIT_FUNC initblend_table();
PyMODINIT_FUNC initcolorInfo();
PyMODINIT_FUNC initconsoleModule();
PyMODINIT_FUNC initconstfunctions();
PyMODINIT_FUNC initconstInfo();
PyMODINIT_FUNC initconstinfo2();
PyMODINIT_FUNC initdebugInfo();
PyMODINIT_FUNC initdragon_soul_refine_settings();
PyMODINIT_FUNC initemotion();
PyMODINIT_FUNC initexception();
PyMODINIT_FUNC initextended_sell();
PyMODINIT_FUNC initgame();
PyMODINIT_FUNC initimport_manager();
PyMODINIT_FUNC initinterfaceModule();
PyMODINIT_FUNC initintroCreate();
PyMODINIT_FUNC initintroEmpire();
PyMODINIT_FUNC initintroLoading();
PyMODINIT_FUNC initintroLogin();
PyMODINIT_FUNC initintroLogo();
PyMODINIT_FUNC initintrooverfallnetwork();
PyMODINIT_FUNC initintroSelect();
PyMODINIT_FUNC inititem_names_searchshop();
PyMODINIT_FUNC initlocaleInfo();
PyMODINIT_FUNC initmouseModule();
PyMODINIT_FUNC initmusicInfo();
PyMODINIT_FUNC initnetworkModule();
PyMODINIT_FUNC initnew_introcreate();
PyMODINIT_FUNC initnew_introselect();
PyMODINIT_FUNC initplayerSettingModule();
PyMODINIT_FUNC initPrototype();
PyMODINIT_FUNC initsearchprivateshop_cfg();
PyMODINIT_FUNC initserverCommandParser();
PyMODINIT_FUNC initserverInfo();
PyMODINIT_FUNC initstringCommander();
PyMODINIT_FUNC initsystem();
PyMODINIT_FUNC inittest_affect();
PyMODINIT_FUNC initui();
PyMODINIT_FUNC inituiacce();
PyMODINIT_FUNC inituiAffectShower();
PyMODINIT_FUNC inituiantimultiplefarm();
PyMODINIT_FUNC inituiAttachMetin();
PyMODINIT_FUNC inituiAuction();
PyMODINIT_FUNC inituiAutoban();
PyMODINIT_FUNC inituibufferinfo();
PyMODINIT_FUNC inituiCandidate();
PyMODINIT_FUNC inituicaptcha();
PyMODINIT_FUNC inituichangelook();
PyMODINIT_FUNC inituiCharacter();
PyMODINIT_FUNC inituicharacterdetails();
PyMODINIT_FUNC inituiChat();
PyMODINIT_FUNC inituiCommon();
PyMODINIT_FUNC inituiCube();
PyMODINIT_FUNC inituicuberenewal();
PyMODINIT_FUNC inituidragonlairranking();
PyMODINIT_FUNC inituiDragonSoul();
PyMODINIT_FUNC inituidungeoninfo();
PyMODINIT_FUNC inituiemojis();
PyMODINIT_FUNC inituiemojispm();
PyMODINIT_FUNC inituiEquipmentDialog();
PyMODINIT_FUNC inituiEx();
PyMODINIT_FUNC inituiExchange();
PyMODINIT_FUNC inituiGameButton();
PyMODINIT_FUNC inituiGameOption();
PyMODINIT_FUNC inituigayanew();
PyMODINIT_FUNC inituigemshop();
PyMODINIT_FUNC inituigiveitem();
PyMODINIT_FUNC inituiGuild();
PyMODINIT_FUNC inituiguilddragonlairranking();
PyMODINIT_FUNC inituiHelp();
PyMODINIT_FUNC inituihelp_new();
PyMODINIT_FUNC inituiInventory();
PyMODINIT_FUNC inituimailbox();
PyMODINIT_FUNC inituimaintenance();
PyMODINIT_FUNC inituiMapNameShower();
PyMODINIT_FUNC inituiMessenger();
PyMODINIT_FUNC inituiminigame();
PyMODINIT_FUNC inituiminigamecatchking();
PyMODINIT_FUNC inituiminigamerumi();
PyMODINIT_FUNC inituiMiniMap();
PyMODINIT_FUNC inituinewoptions();
PyMODINIT_FUNC inituinewprivateshopsearch();
PyMODINIT_FUNC inituiofflineshop();
PyMODINIT_FUNC inituiofflineshopbuilder();
PyMODINIT_FUNC inituiopengiftbox();
PyMODINIT_FUNC inituiOption();
PyMODINIT_FUNC inituiParty();
PyMODINIT_FUNC inituipartychallenge();
PyMODINIT_FUNC inituipetinfo();
PyMODINIT_FUNC inituiPhaseCurtain();
PyMODINIT_FUNC inituipicketc();
PyMODINIT_FUNC inituiPickMoney();
PyMODINIT_FUNC inituiPlayerGauge();
PyMODINIT_FUNC inituiPointReset();
PyMODINIT_FUNC inituiPrivateShopBuilder();
PyMODINIT_FUNC inituiprivateshopsearch();
PyMODINIT_FUNC inituiQuest();
PyMODINIT_FUNC inituiquestcategory();
PyMODINIT_FUNC inituiRefine();
PyMODINIT_FUNC inituiRestart();
PyMODINIT_FUNC inituiSafebox();
PyMODINIT_FUNC inituiScriptLocale();
PyMODINIT_FUNC inituiselectitem();
PyMODINIT_FUNC inituiselectitemex();
PyMODINIT_FUNC inituiSelectMusic();
PyMODINIT_FUNC inituiShop();
PyMODINIT_FUNC inituiskillcolor();
PyMODINIT_FUNC inituispecialinventory();
PyMODINIT_FUNC inituiswitchbot();
PyMODINIT_FUNC inituiSystem();
PyMODINIT_FUNC inituiSystemOption();
PyMODINIT_FUNC inituiTarget();
PyMODINIT_FUNC inituiTaskBar();
PyMODINIT_FUNC inituiTip();
PyMODINIT_FUNC inituiToolTip();
PyMODINIT_FUNC inituitradebonuscostume();
PyMODINIT_FUNC inituiUploadMark();
PyMODINIT_FUNC inituiWeb();
PyMODINIT_FUNC inituiWhisper();
rootlib_SMethodDef rootlib_init_methods[] =
{
{ "blend_table", initblend_table },
{ "colorInfo", initcolorInfo },
{ "consoleModule", initconsoleModule },
{ "constfunctions", initconstfunctions },
{ "constInfo", initconstInfo },
{ "constinfo2", initconstinfo2 },
{ "debugInfo", initdebugInfo },
{ "dragon_soul_refine_settings", initdragon_soul_refine_settings },
{ "emotion", initemotion },
{ "exception", initexception },
{ "extended_sell", initextended_sell },
{ "game", initgame },
{ "import_manager", initimport_manager },
{ "interfaceModule", initinterfaceModule },
{ "introCreate", initintroCreate },
{ "introEmpire", initintroEmpire },
{ "introLoading", initintroLoading },
{ "introLogin", initintroLogin },
{ "introLogo", initintroLogo },
{ "introoverfallnetwork", initintrooverfallnetwork },
{ "introSelect", initintroSelect },
{ "item_names_searchshop", inititem_names_searchshop },
{ "localeInfo", initlocaleInfo },
{ "mouseModule", initmouseModule },
{ "musicInfo", initmusicInfo },
{ "networkModule", initnetworkModule },
{ "new_introcreate", initnew_introcreate },
{ "new_introselect", initnew_introselect },
{ "playerSettingModule", initplayerSettingModule },
{ "Prototype", initPrototype },
{ "searchprivateshop_cfg", initsearchprivateshop_cfg },
{ "serverCommandParser", initserverCommandParser },
{ "serverInfo", initserverInfo },
{ "stringCommander", initstringCommander },
{ "system", initsystem },
{ "test_affect", inittest_affect },
{ "ui", initui },
{ "uiacce", inituiacce },
{ "uiAffectShower", inituiAffectShower },
{ "uiantimultiplefarm", inituiantimultiplefarm },
{ "uiAttachMetin", inituiAttachMetin },
{ "uiAuction", inituiAuction },
{ "uiAutoban", inituiAutoban },
{ "uibufferinfo", inituibufferinfo },
{ "uiCandidate", inituiCandidate },
{ "uicaptcha", inituicaptcha },
{ "uichangelook", inituichangelook },
{ "uiCharacter", inituiCharacter },
{ "uicharacterdetails", inituicharacterdetails },
{ "uiChat", inituiChat },
{ "uiCommon", inituiCommon },
{ "uiCube", inituiCube },
{ "uicuberenewal", inituicuberenewal },
{ "uidragonlairranking", inituidragonlairranking },
{ "uiDragonSoul", inituiDragonSoul },
{ "uidungeoninfo", inituidungeoninfo },
{ "uiemojis", inituiemojis },
{ "uiemojispm", inituiemojispm },
{ "uiEquipmentDialog", inituiEquipmentDialog },
{ "uiEx", inituiEx },
{ "uiExchange", inituiExchange },
{ "uiGameButton", inituiGameButton },
{ "uiGameOption", inituiGameOption },
{ "uigayanew", inituigayanew },
{ "uigemshop", inituigemshop },
{ "uigiveitem", inituigiveitem },
{ "uiGuild", inituiGuild },
{ "uiguilddragonlairranking", inituiguilddragonlairranking },
{ "uiHelp", inituiHelp },
{ "uihelp_new", inituihelp_new },
{ "uiInventory", inituiInventory },
{ "uimailbox", inituimailbox },
{ "uimaintenance", inituimaintenance },
{ "uiMapNameShower", inituiMapNameShower },
{ "uiMessenger", inituiMessenger },
{ "uiminigame", inituiminigame },
{ "uiminigamecatchking", inituiminigamecatchking },
{ "uiminigamerumi", inituiminigamerumi },
{ "uiMiniMap", inituiMiniMap },
{ "uinewoptions", inituinewoptions },
{ "uinewprivateshopsearch", inituinewprivateshopsearch },
{ "uiofflineshop", inituiofflineshop },
{ "uiofflineshopbuilder", inituiofflineshopbuilder },
{ "uiopengiftbox", inituiopengiftbox },
{ "uiOption", inituiOption },
{ "uiParty", inituiParty },
{ "uipartychallenge", inituipartychallenge },
{ "uipetinfo", inituipetinfo },
{ "uiPhaseCurtain", inituiPhaseCurtain },
{ "uipicketc", inituipicketc },
{ "uiPickMoney", inituiPickMoney },
{ "uiPlayerGauge", inituiPlayerGauge },
{ "uiPointReset", inituiPointReset },
{ "uiPrivateShopBuilder", inituiPrivateShopBuilder },
{ "uiprivateshopsearch", inituiprivateshopsearch },
{ "uiQuest", inituiQuest },
{ "uiquestcategory", inituiquestcategory },
{ "uiRefine", inituiRefine },
{ "uiRestart", inituiRestart },
{ "uiSafebox", inituiSafebox },
{ "uiScriptLocale", inituiScriptLocale },
{ "uiselectitem", inituiselectitem },
{ "uiselectitemex", inituiselectitemex },
{ "uiSelectMusic", inituiSelectMusic },
{ "uiShop", inituiShop },
{ "uiskillcolor", inituiskillcolor },
{ "uispecialinventory", inituispecialinventory },
{ "uiswitchbot", inituiswitchbot },
{ "uiSystem", inituiSystem },
{ "uiSystemOption", inituiSystemOption },
{ "uiTarget", inituiTarget },
{ "uiTaskBar", inituiTaskBar },
{ "uiTip", inituiTip },
{ "uiToolTip", inituiToolTip },
{ "uitradebonuscostume", inituitradebonuscostume },
{ "uiUploadMark", inituiUploadMark },
{ "uiWeb", inituiWeb },
{ "uiWhisper", inituiWhisper },
{ NULL, NULL },
};
static PyObject* rootlib_isExist(PyObject* self, PyObject* args)
{
char* func_name;
if (!PyArg_ParseTuple(args, "s", &func_name))
return NULL;
for (int i = 0; NULL != rootlib_init_methods[i].func_name; i++)
{
if (0 == _stricmp(rootlib_init_methods[i].func_name, func_name))
{
return Py_BuildValue("i", 1);
}
}
return Py_BuildValue("i", 0);
}
static PyObject* rootlib_moduleImport(PyObject* self, PyObject* args)
{
char* func_name;
if (!PyArg_ParseTuple(args, "s", &func_name))
return NULL;
for (int i = 0; NULL != rootlib_init_methods[i].func_name; i++)
{
if (0 == _stricmp(rootlib_init_methods[i].func_name, func_name))
{
rootlib_init_methods[i].func();
if (PyErr_Occurred())
return NULL;
PyObject* m = PyDict_GetItemString(PyImport_GetModuleDict(), rootlib_init_methods[i].func_name);
if (m == NULL) {
PyErr_SetString(PyExc_SystemError,
"dynamic module not initialized properly");
return NULL;
}
Py_INCREF(m);
return Py_BuildValue("S", m);
}
}
return NULL;
}
static PyObject* rootlib_getList(PyObject* self, PyObject* args)
{
int iTupleSize = 0;
while (NULL != rootlib_init_methods[iTupleSize].func_name) { iTupleSize++; }
PyObject* retTuple = PyTuple_New(iTupleSize);
for (int i = 0; NULL != rootlib_init_methods[i].func_name; i++)
{
PyObject* retSubString = PyString_FromString(rootlib_init_methods[i].func_name);
PyTuple_SetItem(retTuple, i, retSubString);
}
return retTuple;
}
void initrootlibManager()
{
static struct PyMethodDef methods[] =
{
{"isExist", rootlib_isExist, METH_VARARGS},
{"moduleImport", rootlib_moduleImport, METH_VARARGS},
{"getList", rootlib_getList, METH_VARARGS},
{NULL, NULL},
};
PyObject* m;
m = Py_InitModule("rootlib", methods);
}
#endif