From 7304d76ec957957f3f90f97eb99f207af12f259b Mon Sep 17 00:00:00 2001 From: AURUMVORXX Date: Tue, 15 Apr 2025 13:17:08 +0300 Subject: [PATCH] fix: Removed unused files --- source/bind.cpp | 266 ------------------------------- source/bind.h | 6 - source/constants/sqconstants.cpp | 152 ------------------ source/main.cpp | 72 --------- 4 files changed, 496 deletions(-) delete mode 100644 source/bind.cpp delete mode 100644 source/bind.h delete mode 100644 source/constants/sqconstants.cpp delete mode 100644 source/main.cpp diff --git a/source/bind.cpp b/source/bind.cpp deleted file mode 100644 index 833ffe1..0000000 --- a/source/bind.cpp +++ /dev/null @@ -1,266 +0,0 @@ -#include - -#include "python/Packet.h" -#include "python/DamageDescription.h" -#include "python/ItemGround.h" -#include "python/Daedalus.h" -#include "python/Sky.h" -#include "python/ItemsGround.h" -#include "python/Mds.h" -#include "python/Way.h" - -#include "python/functions.h" - -#include - -namespace py = pybind11; - -void registerSquirrelObjects() -{ - py::module_ m = py::module_::import("sqg2o"); - - py::class_(m, "Packet") - .def(py::init<>()) - .def("reset", &PyPacket::reset) - .def("send", &PyPacket::send) - .def("sendToAll", &PyPacket::sendToAll) - .def("writeInt8", &PyPacket::writeInt8) - .def("writeUInt8", &PyPacket::writeUInt8) - .def("writeInt16", &PyPacket::writeInt16) - .def("writeUInt16", &PyPacket::writeUInt16) - .def("writeInt32", &PyPacket::writeInt32) - .def("writeUInt32", &PyPacket::writeUInt32) - .def("writeFloat", &PyPacket::writeFloat) - .def("writeBool", &PyPacket::writeBool) - .def("writeString", &PyPacket::writeString) - .def("readInt8", &PyPacket::readInt8) - .def("readUInt8", &PyPacket::readUInt8) - .def("readInt16", &PyPacket::readInt16) - .def("readUInt16", &PyPacket::readUInt16) - .def("readInt32", &PyPacket::readInt32) - .def("readUInt32", &PyPacket::readUInt32) - .def("readFloat", &PyPacket::readFloat) - .def("readBool", &PyPacket::readBool) - .def("readString", &PyPacket::readString) - .def("__del__", &PyPacket::del) - - .def_property_readonly("bitsUsed", &PyPacket::getBitsUsed) - .def_property_readonly("bytesUsed", &PyPacket::getBytesUsed); - -// ------------------------------------------------------------------------- - - py::class_(m, "DamageDescription") - - .def_property_readonly("item_instance", &PyDamageDescription::getItemInstance) - - .def_property("flags", &PyDamageDescription::getFlags, &PyDamageDescription::setFlags, py::return_value_policy::reference_internal) - .def_property("damage", &PyDamageDescription::getDamage, &PyDamageDescription::setDamage, py::return_value_policy::reference_internal) - .def_property("distance", &PyDamageDescription::getDistance, &PyDamageDescription::setDistance, py::return_value_policy::reference_internal) - .def_property("spell_id", &PyDamageDescription::getSpellId, &PyDamageDescription::setSpellId, py::return_value_policy::reference_internal) - .def_property("spell_level", &PyDamageDescription::getSpellLevel, &PyDamageDescription::setSpellLevel, py::return_value_policy::reference_internal) - .def_property("node", &PyDamageDescription::getNode, &PyDamageDescription::setNode, py::return_value_policy::reference_internal); - -// ------------------------------------------------------------------------- - - py::class_(m, "ItemGround") - .def("__del__", &PyItemGround::del) - - .def("getPosition", &PyItemGround::getPosition) - .def("getRotation", &PyItemGround::getRotation) - - .def_property_readonly("id", &PyItemGround::getId) - .def_property_readonly("instance", &PyItemGround::getInstance) - .def_property_readonly("amount", &PyItemGround::getAmount) - .def_property_readonly("world", &PyItemGround::getWorld) - - .def_property("virtualWorld", &PyItemGround::getVirtualWorld, &PyItemGround::setVirtualWorld, py::return_value_policy::reference_internal); - -// ------------------------------------------------------------------------- - - py::class_(m, "Daedalus") - .def_static("index", [](std::string value){ return PyDaedalus::index(value); }) - .def_static("symbol", [](std::string value){ return PyDaedalus::symbol(value); }) - .def_static("instance", [](std::string value){ return PyDaedalus::instance(value); }); - -// ------------------------------------------------------------------------- - - py::class_(m, "Sky") - .def_property_static("weather", [](py::object){ return PySky::getWeather(); }, [](py::object, int value) { PySky::setWeather(value); }) - .def_property_static("raining", [](py::object){ return PySky::getRaining(); }, [](py::object, int value) { PySky::setRaining(value); }) - .def_property_static("renderLightning", [](py::object){ return PySky::getRenderLightning(); }, [](py::object, int value) { PySky::setRenderLightning(value); }) - .def_property_static("windScale", [](py::object){ return PySky::getWindScale(); }, [](py::object, int value) { PySky::setWindScale(value); }) - .def_property_static("dontRain", [](py::object){ return PySky::getDontRain(); }, [](py::object, int value) { PySky::setDontRain(value); }) - - .def_static("setRainStartTime", [](int hour, int min){ return PySky::setRainStartTime(hour, min); }) - .def_static("setRainStopTime", [](int hour, int min){ return PySky::setRainStopTime(hour, min); }) - .def_static("getRainStartTime", [](){ return PySky::getRainStartTime(); }) - .def_static("getRainStopTime", [](){ return PySky::getRainStopTime(); }); - -// ------------------------------------------------------------------------- - - py::class_(m, "ItemsGround") - - .def_static("getById", [](int value){ return PyItemsGround::getById(value); }) - .def_static("create", [](py::dict value){ return PyItemsGround::create(value); }) - .def_static("destroy", [](int value){ return PyItemsGround::destroy(value); }); - -// ------------------------------------------------------------------------- - - py::class_(m, "Mds") - - .def_static("id", [](std::string value){ return PyMds::id(value); }) - .def_static("name", [](int value){ return PyMds::name(value); }); - -// ------------------------------------------------------------------------- - - py::class_(m, "Way") - - .def(py::init()) - .def("getWaypoints", &PyWay::getWaypoints) - .def("getCountWaypoints", &PyWay::getCountWaypoints) - .def("__del__", &PyWay::del) - - .def_property_readonly("start", &PyWay::getStart) - .def_property_readonly("end", &PyWay::getEnd); - -// ------------------------------------------------------------------------- - - m.def("getHostname", &py_getHostname); - m.def("getMaxSlots", &py_getMaxSlots); - m.def("getPlayersCount", &py_getPlayersCount); - - m.def("getDistance2d", &py_getDistance2d); - m.def("getDistance3d", &py_getDistance3d); - m.def("getVectorAngle", &py_getVectorAngle); - - m.def("exit", &py_exit, py::arg() = 0); - m.def("getDayLength", &py_getDayLength); - m.def("getServerDescription", &py_getServerDescription); - m.def("getServerWorld", &py_getServerWorld); - m.def("getTime", &py_getTime); - m.def("serverLog", &py_serverLog); - m.def("setDayLength", &py_setDayLength); - m.def("setServerDescription", &py_setServerDescription); - m.def("setServerWorld", &py_setServerWorld); - m.def("setTime", &py_setTime, py::arg(), py::arg(), py::arg() = 0); - - m.def("clearNpcActions", &py_clearNpcActions); - m.def("createNpc", &py_createNpc, py::arg(), py::arg() = "PC_HERO"); - m.def("destroyNpc", &py_destroyNpc); - m.def("getNpcAction", &py_getNpcAction); - // m.def("getNpcActionType", &py_getNpcActionType); - m.def("getNpcActtions", &py_getNpcActions); - m.def("getNpcActtionsCount", &py_getNpcActionsCount); - m.def("getNpcHostPlayer", &py_getNpcHostPlayer); - m.def("getNpcLastActionId", &py_getNpcLastActionId); - m.def("isNpc", &py_isNpc); - m.def("isNpcActionFinished", &py_isNpcActionFinished); - m.def("npcAttackMelee", &py_npcAttackMelee); - m.def("npcAttackRanged", &py_npcAttackRanged); - m.def("npcSpellCast", &py_npcSpellCast); - m.def("npcUseClosestMob", &py_npcUseClosestMob); - // m.def("pushNpcAction", &py_pushNpcAction); - m.def("setNpcHostPlayer", &py_setNpcHostPlayer); - - m.def("sendMessageToAll", &py_sendMessageToAll); - m.def("sendMessageToPlayer", &py_sendMessageToPlayer); - m.def("sendPlayerMessageToAll", &py_sendPlayerMessageToAll); - m.def("sendPlayerMessageToPlayer", &py_sendPlayerMessageToPlayer); - - m.def("addBan", &py_addBan); - m.def("applyPlayerOverlay", &py_applyPlayerOverlay); - m.def("ban", &py_ban, py::arg(), py::arg() = 0, py::arg()); - m.def("drawWeapon", &py_drawWeapon); - m.def("equipItem", &py_equipItem, py::arg(), py::arg(), py::arg() = -1); - m.def("getPlayerAmulet", &py_getPlayerAmulet); - m.def("getPlayerAngle", &py_getPlayerAngle); - m.def("getPlayerAni", &py_getPlayerAni); - m.def("getPlayerArmor", &py_getPlayerArmor); - m.def("getPlayerAtVector", &py_getPlayerAtVector); - m.def("getPlayerBelt", &py_getPlayerBelt); - m.def("getPlayerCameraPosition",&py_getPlayerCameraPosition); - m.def("getPlayerCollision", &py_getPlayerCollision); - m.def("getPlayerColor", &py_getPlayerColor); - m.def("getPlayerContext", &py_getPlayerContext); - m.def("getPlayerDexterity", &py_getPlayerDexterity); - m.def("getPlayerFaceAnis", &py_getPlayerFaceAnis); - m.def("getPlayerFatness", &py_getPlayerFatness); - m.def("getPlayerFocus", &py_getPlayerFocus); - m.def("getPlayerHealth", &py_getPlayerHealth); - m.def("getPlayerHelmet", &py_getPlayerHelmet); - m.def("getPlayerIP", &py_getPlayerIP); - m.def("getPlayerInstance", &py_getPlayerInstance); - m.def("getPlayerMacAddr", &py_getPlayerMacAddr); - m.def("getPlayerMana", &py_getPlayerMana); - m.def("getPlayerMaxHealth", &py_getPlayerMaxHealth); - m.def("getPlayerMaxMana", &py_getPlayerMaxMana); - m.def("getPlayerMeleeWeapon", &py_getPlayerMeleeWeapon); - m.def("getPlayerName", &py_getPlayerName); - m.def("getPlayerPing", &py_getPlayerPing); - m.def("getPlayerPosition", &py_getPlayerPosition); - m.def("getPlayerRangedWeapon", &py_getPlayerRangedWeapon); - m.def("getPlayerRespawnTime", &py_getPlayerRespawnTime); - m.def("getPlayerRing", &py_getPlayerRing); - m.def("getPlayerScale", &py_getPlayerScale); - m.def("getPlayerSerial", &py_getPlayerSerial); - m.def("getPlayerShield", &py_getPlayerShield); - m.def("getPlayerSkillWeapon", &py_getPlayerSkillWeapon); - m.def("getPlayerSpell", &py_getPlayerSpell); - m.def("getPlayerStrength", &py_getPlayerStrength); - m.def("getPlayerTalent", &py_getPlayerTalent); - m.def("getPlayerVirtualWorld", &py_getPlayerVirtualWorld); - m.def("getPlayerVisual", &py_getPlayerVisual); - m.def("getPlayerWeaponMode", &py_getPlayerWeaponMode); - m.def("getPlayerWorld", &py_getPlayerWorld); - m.def("giveItem", &py_giveItem); - m.def("hitPlayer", &py_hitPlayer); - m.def("isPlayerConnected", &py_isPlayerConnected); - m.def("isPlayerDead", &py_isPlayerDead); - m.def("isPlayerUnconscious", &py_isPlayerUnconscious); - m.def("kick", &py_kick); - m.def("playAni", &py_playAni); - m.def("playFaceAni", &py_playFaceAni); - m.def("readySpell", &py_readySpell); - m.def("removeItem", &py_removeItem); - m.def("removePlayerOverlay", &py_removePlayerOverlay); - m.def("removeWeapon", &py_removeWeapon); - m.def("respawnPlayer", &py_respawnPlayer); - m.def("setPlayerAngle", &py_setPlayerAngle); - m.def("setPlayerCollision", &py_setPlayerCollision); - m.def("setPlayerColor", &py_setPlayerColor); - m.def("setPlayerContext", &py_setPlayerContext); - m.def("setPlayerDexterity", &py_setPlayerDexterity); - m.def("setPlayerFatness", &py_setPlayerFatness); - m.def("setPlayerHealth", &py_setPlayerHealth); - m.def("setPlayerInstance", &py_setPlayerInstance); - m.def("setPlayerInvisible", &py_setPlayerInvisible); - m.def("setPlayerMana", &py_setPlayerMana); - m.def("setPlayerMaxHealth", &py_setPlayerMaxHealth); - m.def("setPlayerMaxMana", &py_setPlayerMaxMana); - m.def("setPlayerName", &py_setPlayerName); - m.def("setPlayerPosition", &py_setPlayerPosition); - m.def("setPlayerRespawnTime", &py_setPlayerRespawnTime); - m.def("setPlayerScale", &py_setPlayerScale); - m.def("setPlayerSkillWeapon", &py_setPlayerSkillWeapon); - m.def("setPlayerStrength", &py_setPlayerStrength); - m.def("setPlayerTalent", &py_setPlayerTalent); - m.def("setPlayerVirtualWorld", &py_setPlayerVirtualWorld); - m.def("setPlayerVisual", &py_setPlayerVisual); - m.def("setPlayerWeaponMode", &py_setPlayerWeaponMode); - m.def("setPlayerWorld", &py_setPlayerWorld); - m.def("spawnPlayer", &py_spawnPlayer); - m.def("stopAni", &py_stopAni, py::arg(), py::arg() = ""); - m.def("stopFaceAni", &py_stopFaceAni, py::arg(), py::arg() = ""); - m.def("unequipItem", &py_unequipItem); - m.def("unreadySpell", &py_unreadySpell); - m.def("unspawnPlayer", &py_unspawnPlayer); - m.def("useItem", &py_useItem); - m.def("useItemToState", &py_useItemToState); - - m.def("findNearbyPlayers", &py_findNearbyPlayers); - m.def("getSpawnedPlayersForPlayer", &py_getSpawnedPlayersForPlayer); - m.def("getStreamedPlayersByPlayer", &py_getStreamedPlayersByPlayer); - - m.def("getNearestWaypoint", &py_getNearestWaypoint); - m.def("getWaypoint", &py_getWaypoint); -} \ No newline at end of file diff --git a/source/bind.h b/source/bind.h deleted file mode 100644 index f629a3c..0000000 --- a/source/bind.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _BINDH_ -#define _BINDH_ - -void registerSquirrelObjects(); - -#endif \ No newline at end of file diff --git a/source/constants/sqconstants.cpp b/source/constants/sqconstants.cpp deleted file mode 100644 index b891cf9..0000000 --- a/source/constants/sqconstants.cpp +++ /dev/null @@ -1,152 +0,0 @@ -#include -#include -#include "sqevents.h" -#include "sqconstants.h" - -namespace py = pybind11; - -#define GET_CONST(constName, constType) Sqrat::ConstTable().GetSlot(constName).Cast() - -void registerSquirrelConstants() -{ - py::module_ cts = py::module_::import("sqg2oconst"); - - cts.attr("DAMAGE_CTX") = GET_CONST("DAMAGE_CTX", int); - cts.attr("EQUIPMENT_CTX") = GET_CONST("EQUIPMENT_CTX", int); - - cts.attr("DAMAGE_UNKNOWN") = GET_CONST("DAMAGE_UNKNOWN", int); - cts.attr("DAMAGE_BARRIER") = GET_CONST("DAMAGE_BARRIER", int); - cts.attr("DAMAGE_BLUNT") = GET_CONST("DAMAGE_BLUNT", int); - cts.attr("DAMAGE_EDGE") = GET_CONST("DAMAGE_EDGE", int); - cts.attr("DAMAGE_FIRE") = GET_CONST("DAMAGE_FIRE", int); - cts.attr("DAMAGE_FLY") = GET_CONST("DAMAGE_FLY", int); - cts.attr("DAMAGE_MAGIC") = GET_CONST("DAMAGE_MAGIC", int); - cts.attr("DAMAGE_POINT") = GET_CONST("DAMAGE_POINT", int); - cts.attr("DAMAGE_FALL") = GET_CONST("DAMAGE_FALL", int); - - cts.attr("DEBUG_MODE") = GET_CONST("DEBUG_MODE", bool); - cts.attr("SERVER_SIDE") = GET_CONST("SERVER_SIDE", bool); - cts.attr("CLIENT_SIDE") = GET_CONST("CLIENT_SIDE", bool); - - cts.attr("HAND_LEFT") = GET_CONST("HAND_LEFT", int); - cts.attr("HAND_RIGHT") = GET_CONST("HAND_RIGHT", int); - - cts.attr("ITEM_CAT_NONE") = GET_CONST("ITEM_CAT_NONE", int); - cts.attr("ITEM_CAT_NF") = GET_CONST("ITEM_CAT_NF", int); - cts.attr("ITEM_CAT_FF") = GET_CONST("ITEM_CAT_FF", int); - cts.attr("ITEM_CAT_MUN") = GET_CONST("ITEM_CAT_MUN", int); - cts.attr("ITEM_CAT_ARMOR") = GET_CONST("ITEM_CAT_ARMOR", int); - cts.attr("ITEM_CAT_FOOD") = GET_CONST("ITEM_CAT_FOOD", int); - cts.attr("ITEM_CAT_DOCS") = GET_CONST("ITEM_CAT_DOCS", int); - cts.attr("ITEM_CAT_POTION") = GET_CONST("ITEM_CAT_POTION", int); - cts.attr("ITEM_CAT_LIGHT") = GET_CONST("ITEM_CAT_LIGHT", int); - cts.attr("ITEM_CAT_RUNE") = GET_CONST("ITEM_CAT_RUNE", int); - cts.attr("ITEM_CAT_MAGIC") = GET_CONST("ITEM_CAT_MAGIC", int); - - cts.attr("ITEM_FLAG_DAG") = GET_CONST("ITEM_FLAG_DAG", int); - cts.attr("ITEM_FLAG_SWD") = GET_CONST("ITEM_FLAG_SWD", int); - cts.attr("ITEM_FLAG_AXE") = GET_CONST("ITEM_FLAG_AXE", int); - cts.attr("ITEM_FLAG_2HD_SWD") = GET_CONST("ITEM_FLAG_2HD_SWD", int); - cts.attr("ITEM_FLAG_2HD_AXE") = GET_CONST("ITEM_FLAG_2HD_AXE", int); - cts.attr("ITEM_FLAG_SHIELD") = GET_CONST("ITEM_FLAG_SHIELD", int); - cts.attr("ITEM_FLAG_BOW") = GET_CONST("ITEM_FLAG_BOW", int); - cts.attr("ITEM_FLAG_CROSSBOW") = GET_CONST("ITEM_FLAG_CROSSBOW", int); - cts.attr("ITEM_FLAG_RING") = GET_CONST("ITEM_FLAG_RING", int); - cts.attr("ITEM_FLAG_AMULET") = GET_CONST("ITEM_FLAG_AMULET", int); - cts.attr("ITEM_FLAG_BELT") = GET_CONST("ITEM_FLAG_BELT", int); - cts.attr("ITEM_FLAG_DROPPED") = GET_CONST("ITEM_FLAG_DROPPED", int); - cts.attr("ITEM_FLAG_MI") = GET_CONST("ITEM_FLAG_MI", int); - cts.attr("ITEM_FLAG_MULTI") = GET_CONST("ITEM_FLAG_MULTI", int); - cts.attr("ITEM_FLAG_NFOCUS") = GET_CONST("ITEM_FLAG_NFOCUS", int); - cts.attr("ITEM_FLAG_CREATEAMMO") = GET_CONST("ITEM_FLAG_CREATEAMMO", int); - cts.attr("ITEM_FLAG_NSPLIT") = GET_CONST("ITEM_FLAG_NSPLIT", int); - cts.attr("ITEM_FLAG_DRINK") = GET_CONST("ITEM_FLAG_DRINK", int); - cts.attr("ITEM_FLAG_TORCH") = GET_CONST("ITEM_FLAG_TORCH", int); - cts.attr("ITEM_FLAG_THROW") = GET_CONST("ITEM_FLAG_THROW", int); - cts.attr("ITEM_FLAG_ACTIVE") = GET_CONST("ITEM_FLAG_ACTIVE", int); - - cts.attr("ITEM_WEAR_NO") = GET_CONST("ITEM_WEAR_NO", int); - cts.attr("ITEM_WEAR_TORSO") = GET_CONST("ITEM_WEAR_TORSO", int); - cts.attr("ITEM_WEAR_HEAD") = GET_CONST("ITEM_WEAR_HEAD", int); - cts.attr("ITEM_WEAR_LIGHT") = GET_CONST("ITEM_WEAR_LIGHT", int); - - cts.attr("ATTACK_RUN") = GET_CONST("ATTACK_RUN", int); - cts.attr("ATTACK_FORWARD") = GET_CONST("ATTACK_FORWARD", int); - cts.attr("ATTACK_LEFT") = GET_CONST("ATTACK_LEFT", int); - cts.attr("ATTACK_RIGHT") = GET_CONST("ATTACK_RIGHT", int); - cts.attr("ACTION_CLEAR_QUEUE") = GET_CONST("ACTION_CLEAR_QUEUE", int); - cts.attr("ACTION_APPLY_OVERLAY") = GET_CONST("ACTION_APPLY_OVERLAY", int); - cts.attr("ACTION_REMOVE_OVERLAY") = GET_CONST("ACTION_REMOVE_OVERLAY", int); - cts.attr("ACTION_PLAY_ANI") = GET_CONST("ACTION_PLAY_ANI", int); - cts.attr("ACTION_STOP_ANI") = GET_CONST("ACTION_STOP_ANI", int); - cts.attr("ACTION_EQUIP_ITEM") = GET_CONST("ACTION_EQUIP_ITEM", int); - cts.attr("ACTION_UNEQUIP_ITEM") = GET_CONST("ACTION_UNEQUIP_ITEM", int); - cts.attr("ACTION_WEAPON_MODE") = GET_CONST("ACTION_WEAPON_MODE", int); - cts.attr("ACTION_DRAW_WEAPON") = GET_CONST("ACTION_DRAW_WEAPON", int); - cts.attr("ACTION_REMOVE_WEAPON") = GET_CONST("ACTION_REMOVE_WEAPON", int); - cts.attr("ACTION_USE_ITEM") = GET_CONST("ACTION_USE_ITEM", int); - cts.attr("ACTION_USE_ITEM_TO_STATE") = GET_CONST("ACTION_USE_ITEM_TO_STATE", int); - cts.attr("ACTION_READY_SPELL") = GET_CONST("ACTION_READY_SPELL", int); - cts.attr("ACTION_UNREADY_SPELL") = GET_CONST("ACTION_UNREADY_SPELL", int); - cts.attr("ACTION_ATTACK_MELEE_WEAPON") = GET_CONST("ACTION_ATTACK_MELEE_WEAPON", int); - cts.attr("ACTION_ATTACK_RANGED_WEAPON") = GET_CONST("ACTION_ATTACK_RANGED_WEAPON", int); - cts.attr("ACTION_SPELL_CAST") = GET_CONST("ACTION_SPELL_CAST", int); - cts.attr("ACTION_USE_MOB_SCHEME") = GET_CONST("ACTION_USE_MOB_SCHEME", int); - cts.attr("ACTION_SHOOT_AT") = GET_CONST("ACTION_SHOOT_AT", int); - cts.attr("ACTION_START_AIM_AT") = GET_CONST("ACTION_START_AIM_AT", int); - cts.attr("ACTION_STOP_AIM_AT") = GET_CONST("ACTION_STOP_AIM_AT", int); - cts.attr("ACTION_SCRIPT") = GET_CONST("ACTION_SCRIPT", int); - - cts.attr("UNRELIABLE") = GET_CONST("UNRELIABLE", int); - cts.attr("UNRELIABLE_SEQUENCED") = GET_CONST("UNRELIABLE_SEQUENCED", int); - cts.attr("RELIABLE") = GET_CONST("RELIABLE", int); - cts.attr("RELIABLE_ORDERED") = GET_CONST("RELIABLE_ORDERED", int); - cts.attr("RELIABLE_SEQUENCED") = GET_CONST("RELIABLE_SEQUENCED", int); - - cts.attr("WEAPON_1H") = GET_CONST("WEAPON_1H", int); - cts.attr("WEAPON_2H") = GET_CONST("WEAPON_2H", int); - cts.attr("WEAPON_BOW") = GET_CONST("WEAPON_BOW", int); - cts.attr("WEAPON_CBOW") = GET_CONST("WEAPON_CBOW", int); - - cts.attr("TALENT_1H") = GET_CONST("TALENT_1H", int); - cts.attr("TALENT_2H") = GET_CONST("TALENT_2H", int); - cts.attr("TALENT_BOW") = GET_CONST("TALENT_BOW", int); - cts.attr("TALENT_CROSSBOW") = GET_CONST("TALENT_CROSSBOW", int); - cts.attr("TALENT_PICK_LOCKS") = GET_CONST("TALENT_PICK_LOCKS", int); - cts.attr("TALENT_PICKPOCKET") = GET_CONST("TALENT_PICKPOCKET", int); - cts.attr("TALENT_MAGE") = GET_CONST("TALENT_MAGE", int); - cts.attr("TALENT_SNEAK") = GET_CONST("TALENT_SNEAK", int); - cts.attr("TALENT_REGENERATE") = GET_CONST("TALENT_REGENERATE", int); - cts.attr("TALENT_FIREMASTER") = GET_CONST("TALENT_FIREMASTER", int); - cts.attr("TALENT_ACROBATIC") = GET_CONST("TALENT_ACROBATIC", int); - cts.attr("TALENT_PICKPOCKET_UNUSED") = GET_CONST("TALENT_PICKPOCKET_UNUSED", int); - cts.attr("TALENT_SMITH") = GET_CONST("TALENT_SMITH", int); - cts.attr("TALENT_RUNES") = GET_CONST("TALENT_RUNES", int); - cts.attr("TALENT_ALCHEMY") = GET_CONST("TALENT_ALCHEMY", int); - cts.attr("TALENT_THROPHY") = GET_CONST("TALENT_THROPHY", int); - cts.attr("TALENT_A") = GET_CONST("TALENT_A", int); - cts.attr("TALENT_B") = GET_CONST("TALENT_B", int); - cts.attr("TALENT_C") = GET_CONST("TALENT_C", int); - cts.attr("TALENT_D") = GET_CONST("TALENT_D", int); - cts.attr("TALENT_E") = GET_CONST("TALENT_E", int); - cts.attr("TALENT_MAX") = GET_CONST("TALENT_MAX", int); - - cts.attr("WEAPONMODE_NONE") = GET_CONST("WEAPONMODE_NONE", int); - cts.attr("WEAPONMODE_FIST") = GET_CONST("WEAPONMODE_FIST", int); - cts.attr("WEAPONMODE_DAG") = GET_CONST("WEAPONMODE_DAG", int); - cts.attr("WEAPONMODE_1HS") = GET_CONST("WEAPONMODE_1HS", int); - cts.attr("WEAPONMODE_2HS") = GET_CONST("WEAPONMODE_2HS", int); - cts.attr("WEAPONMODE_BOW") = GET_CONST("WEAPONMODE_BOW", int); - cts.attr("WEAPONMODE_CBOW") = GET_CONST("WEAPONMODE_CBOW", int); - cts.attr("WEAPONMODE_MAG") = GET_CONST("WEAPONMODE_MAG", int); - cts.attr("WEAPONMODE_MAX") = GET_CONST("WEAPONMODE_MAX", int); - - cts.attr("WEATHER_SNOW") = GET_CONST("WEATHER_SNOW", int); - cts.attr("WEATHER_RAIN") = GET_CONST("WEATHER_RAIN", int); - - cts.attr("AC_SPEED_HACK") = GET_CONST("AC_SPEED_HACK", int); - - cts.attr("DISCONNECTED") = GET_CONST("DISCONNECTED", int); - cts.attr("LOST_CONNECTION") = GET_CONST("LOST_CONNECTION", int); - cts.attr("HAS_CRASHED") = GET_CONST("HAS_CRASHED", int); -} \ No newline at end of file diff --git a/source/main.cpp b/source/main.cpp deleted file mode 100644 index 05ffaca..0000000 --- a/source/main.cpp +++ /dev/null @@ -1,72 +0,0 @@ -#include -#include -#include "sqevents.h" -#include "sqconstants.h" -#include "squirrel/functions.h" -#include "bind.h" - -namespace py = pybind11; -py::scoped_interpreter guard{}; - -py::module_ g2o; - -extern "C" SQRESULT SQRAT_API sqmodule_load(HSQUIRRELVM vm, HSQAPI api) -{ - SqModule::Initialize(vm, api); - Sqrat::DefaultVM::Set(vm); - - try - { - py::dict locals = py::dict(); - py::exec(R"( - import site - import json - import sys - import importlib - import importlib.util - site.addsitedir('.') - import os - - if 'VIRTUAL_ENV' in os.environ: - packages_path = os.path.join(os.environ['VIRTUAL_ENV'], 'Lib', 'site-packages') - sys.path.append(packages_path) - - entry_point = 'pyg2o_entry' - try: - with open('pyg2o.json', 'r') as f: - json = json.loads(f.read()) - entry_point = json['entry'] - except Exception as e: - pass - - try: - spec = importlib.util.find_spec(entry_point) - if spec is not None: - if spec.submodule_search_locations: - sys.path.append(spec.submodule_search_locations[0]) - except Exception as e: - print(e) - - spec = importlib.util.find_spec('g2o') - if spec is not None: - if spec.submodule_search_locations: - sys.path.append(spec.submodule_search_locations[0]) - - )", py::globals(), locals); - - registerSquirrelConstants(); - registerSquirrelObjects(); - g2o = py::module_::import("g2o"); - - py::module_ importlib = py::module_::import("importlib"); - importlib.attr("import_module")(locals["entry_point"]); - } - catch (py::error_already_set &e) - { - py::print(e.what()); - return SQ_ERROR; - } - - registerSquirrelEvents(); - return SQ_OK; -} \ No newline at end of file