diff --git a/.github/workflows/docs_pages.yml b/.github/workflows/docs_pages.yml index a28989d..b07b9fc 100644 --- a/.github/workflows/docs_pages.yml +++ b/.github/workflows/docs_pages.yml @@ -19,5 +19,4 @@ jobs: pip install mkdocs-material pip install mkdocs-callouts pip install mkdocs-glightbox - cd python/ mkdocs gh-deploy --force \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index ebc5e4a..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,92 +0,0 @@ -name: release - -on: workflow_dispatch - -jobs: - create-new-release: - runs-on: ubuntu-latest - permissions: - contents: write - outputs: - assets_url: ${{ steps.create-release.outputs.upload_url }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Create release - id: create-release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.run_number }} - release_name: Release Title - body_path: CHANGELOG.md - draft: true - release-win64: - runs-on: windows-latest - needs: create-new-release - permissions: - contents: write - outputs: - assets_url: ${{ steps.create-release.outputs.upload_url }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Install MSVC - uses: ilammy/msvc-dev-cmd@v1 - - name: Install Python - uses: actions/setup-python@v5 - with: - python-version: '3.13' - - name: Install CMake - uses: lukka/get-cmake@latest - - name: Init submodules - run: git submodule update --init --recursive - - name: CMake - Configure - run: cmake . --preset Windows-x64-Release -DCMAKE_BUILD_TYPE="Release" -DCOUT_FILE_SUFFIX="x64" - - name: CMake - Build - run: cmake --build --preset Windows-x64-Release - - name: Archive output files - run: Compress-Archive -Path "python/g2o", "build/Windows-x64-Release/source/PyG2O.x64.dll" -Destination Windows-x64-Release.zip - - name: Upload release - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.create-new-release.outputs.assets_url }} - asset_path: ./Windows-x64-Release.zip - asset_name: Windows-x64-Release.zip - asset_content_type: application/zip - release-arm64: - runs-on: ubuntu-latest - needs: create-new-release - permissions: - contents: write - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Install Python - uses: actions/setup-python@v5 - with: - python-version: '3.13' - - name: Install CMake - uses: lukka/get-cmake@latest - - name: Init submodules - run: git submodule update --init --recursive - - name: CMake - Configure - run: cmake . --preset Linux-x64-Release -DCMAKE_BUILD_TYPE="Release" -DCOUT_FILE_SUFFIX="x64" - - name: CMake - Build - run: cmake --build --preset Linux-x64-Release - - name: Archive files - uses: montudor/action-zip@v1 - with: - args: zip -r Linux-x64-Release.zip python/g2o build/Linux-x64-Release/source/PyG2O.x64.so - - name: Upload release - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.create-new-release.outputs.assets_url }} - asset_path: ./Linux-x64-Release.zip - asset_name: Linux-x64-Release.zip - asset_content_type: application/zip \ No newline at end of file diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index f6f44fd..0000000 --- a/.gitmodules +++ /dev/null @@ -1,6 +0,0 @@ -[submodule "source/dependencies/sqapi"] - path = source/dependencies/sqapi - url = https://gitlab.com/GothicMultiplayerTeam/dependencies/sqapi.git -[submodule "source/dependencies/pybind11"] - path = source/dependencies/pybind11 - url = https://github.com/pybind/pybind11.git diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index f848768..0000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.21) -set(CMAKE_CXX_STANDARD 20) -set(CMAKE_CXX_STANDARD_REQUIRED TRUE) - -project(PyG2O VERSION 1.3.1.0) -set(PYG2O_MODULE_NAME PyG2O) - -add_subdirectory(source) \ No newline at end of file diff --git a/CMakePresets.json b/CMakePresets.json deleted file mode 100644 index ebb9832..0000000 --- a/CMakePresets.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "version": 3, - "configurePresets": [ - { - "name": "windows", - "hidden": true, - "generator": "Ninja", - "binaryDir": "${sourceDir}/build/${presetName}", - "condition": { - "type": "equals", - "lhs": "${hostSystemName}", - "rhs": "Windows" - }, - "cacheVariables": { - "CMAKE_C_COMPILER": "cl.exe", - "CMAKE_CXX_COMPILER": "cl.exe" - } - }, - { - "name": "linux", - "hidden": true, - "generator": "Unix Makefiles", - "binaryDir": "${sourceDir}/build/${presetName}", - "condition": { - "type": "equals", - "lhs": "${hostSystemName}", - "rhs": "Linux" - }, - "cacheVariables": { - "CMAKE_CXX_FLAGS": "-static-libgcc -static-libstdc++" - } - }, - { - "name": "x64", - "hidden": true, - "architecture": { - "value": "x64", - "strategy": "external" - }, - "cacheVariables": { - "OUT_FILE_SUFFIX": "x64" - } - }, - { - "name": "arm64", - "hidden": true, - "architecture": { - "value": "arm64", - "strategy": "external" - }, - "cacheVariables": { - "OUT_FILE_SUFFIX": "arm64" - } - }, - { - "name": "debug", - "hidden": true, - "cacheVariables": { - "CMAKE_BUILD_TYPE": "Debug" - } - }, - { - "name": "release", - "hidden": true, - "cacheVariables": { - "CMAKE_BUILD_TYPE": "Release" - } - }, - - { "name": "Windows-x64-Debug", "inherits": ["windows", "x64", "debug"] }, - { "name": "Windows-x64-Release", "inherits": ["windows", "x64", "release"] }, - { "name": "Linux-x64-Debug", "inherits": ["linux", "x64", "debug"] }, - { "name": "Linux-x64-Release", "inherits": ["linux", "x64", "release"] }, - { "name": "Linux-arm64-Debug", "inherits": ["linux", "arm64", "debug"] }, - { "name": "Linux-arm64-Release", "inherits": ["linux", "arm64", "release"] } - ], - "buildPresets": [ - { "name": "Windows-x64-Debug", "configurePreset": "Windows-x64-Debug" }, - { "name": "Windows-x64-Release", "configurePreset": "Windows-x64-Release" }, - { "name": "Linux-x64-Debug", "configurePreset": "Linux-x64-Debug" }, - { "name": "Linux-x64-Release", "configurePreset": "Linux-x64-Release" }, - { "name": "Linux-arm64-Debug", "configurePreset": "Linux-arm64-Debug" }, - { "name": "Linux-arm64-Release", "configurePreset": "Linux-arm64-Release" } - ] -} \ No newline at end of file diff --git a/README.md b/README.md index cff5f17..c736013 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,8 @@ Python support for server-side scripts in [Gothic 2 Online](https://gothic-onlin **Documentation:** https://aurumvorxx.github.io/PyG2O/ -## How to build - Requirements: -- Python 3.13 -- CMake +- websockets Steps: 1. Copy this repo to your local machine diff --git a/docs/classes/game/Daedalus.md b/docs/classes/game/Daedalus.md new file mode 100644 index 0000000..3954c34 --- /dev/null +++ b/docs/classes/game/Daedalus.md @@ -0,0 +1,3 @@ +# `static class` Daedalus +--- +::: src.pyg2o.classes.daedalus.Daedalus \ No newline at end of file diff --git a/docs/classes/game/DamageDescription.md b/docs/classes/game/DamageDescription.md new file mode 100644 index 0000000..c7439cb --- /dev/null +++ b/docs/classes/game/DamageDescription.md @@ -0,0 +1,3 @@ +# `class` DamageDescription +--- +::: src.pyg2o.classes.damage.DamageDescription \ No newline at end of file diff --git a/docs/classes/game/Sky.md b/docs/classes/game/Sky.md new file mode 100644 index 0000000..517e994 --- /dev/null +++ b/docs/classes/game/Sky.md @@ -0,0 +1,3 @@ +# `static class` Sky +--- +::: src.pyg2o.classes.sky.Sky \ No newline at end of file diff --git a/docs/classes/item/ItemGround.md b/docs/classes/item/ItemGround.md new file mode 100644 index 0000000..40cfa9d --- /dev/null +++ b/docs/classes/item/ItemGround.md @@ -0,0 +1,3 @@ +# `static class` ItemGround +--- +::: src.pyg2o.classes.items.ItemGround \ No newline at end of file diff --git a/docs/classes/item/ItemsGround.md b/docs/classes/item/ItemsGround.md new file mode 100644 index 0000000..e00cfa2 --- /dev/null +++ b/docs/classes/item/ItemsGround.md @@ -0,0 +1,3 @@ +# `static class` ItemsGround +--- +::: src.pyg2o.classes.items.ItemsGround \ No newline at end of file diff --git a/docs/classes/mds/Mds.md b/docs/classes/mds/Mds.md new file mode 100644 index 0000000..3279ac6 --- /dev/null +++ b/docs/classes/mds/Mds.md @@ -0,0 +1,3 @@ +# `static class` Mds +--- +::: src.pyg2o.classes.mds.Mds \ No newline at end of file diff --git a/python/docs/comparing.md b/docs/comparing.md similarity index 66% rename from python/docs/comparing.md rename to docs/comparing.md index f5714cf..500ec74 100644 --- a/python/docs/comparing.md +++ b/docs/comparing.md @@ -1,55 +1,55 @@ * `addEventHandler` replaced with decorator [event](functions/event/event.md) ```python -@g2o.event('onInit') -def evtInitFirst(**kwargs): +@pyg2o.event('onInit') +async def evtInitFirst(): print('Hello') -@g2o.event('onInit', 100) # '100' is priority -def evtInitSecond(**kwargs): +@pyg2o.event('onInit', 100) # '100' is priority +async def evtInitSecond(): print('World') ``` --- * Positional arguments inside event handles replaced with keyword arguments (see names of all keywords on the each event page) ```python -@g2o.event('onPlayerChangeColor') -def evtColor(**kwargs): - playerid = kwargs['playerid'] - r = kwargs['r'] - b = kwargs['b'] +@pyg2o.event('onPlayerChangeColor') +async def evtColor(playerid, r, g, b): + pass ``` --- * `callEvent` now also requires to pass keyword arguments instead of positional arguments ```python -@g2o.event('MyTestEvent') -def testEvt(**kwargs): - print(kwargs) +@pyg2o.event('MyTestEvent') +async def testEvt(name, id): + print(name, id) g2o.callEvent('MyTestEvent', name = 'aurumvorax', id = 15) # OR g2o.callEvent('MyTestEvent', {'name': 'aurumvorax', 'id': 15}) # OR args = {'name': 'aurumvorax', 'id': 15} -g2o.callEvent('MyTestEvent', args) +asyncio.create_task(pyg2o.callEvent('MyTestEvent', args)) ``` --- -* `cancelEvent` replaced with returning `False` inside the handler -*(you don't need to explicitly return `True` if you don't want to cancel the event)* -```python -@g2o.event('onPlayerTakeItem') -def evtTake(**kwargs): - return False -``` +* `cancelEvent` temporarily disabled --- * `isEventCancelled` replaced with built-in function property `cancelled`, alongside with the `eventName` ```python -@g2o.event('onPlayerDropItem') -def evtDrop(**kwargs): +@pyg2o.event('onPlayerDropItem') +async def evtDrop(**kwargs): print(evtDrop.cancelled) print(evtDrop.eventName) ``` ------ -* Following functions have been removed RIP :( +--- +Now all constants should be called via **Constant** class +```pyton +import pyg2o + +@pyg2o.event('onInit') +async def evt_init(): + print(pyg2o.Constant.SERVER_SIDE) +``` +* Following functions and classes have been removed RIP :( * `md5` * `sha1` @@ -71,7 +71,17 @@ def evtDrop(**kwargs): * `eventValue` * `getPlayerMagicLevel` * `setPlayerMagicLevel` + * `Packet` + * `Way` + * `NpcAction` + +* Following constants has been removed: + * `UNRELIABLE` + * `UNRELIABLE_SEQUENCED` + * `RELIABLE` + * `RELIABLE_SEQUENCED` + * `RELIABLE_ORDERED` --- * All functions and events that returned/passed a `null` in the Squirrel, now passes an empty string. Most notable in this list are all equipment related functions and events * `onPlayerEquipAmulet` @@ -92,6 +102,4 @@ def evtDrop(**kwargs): * `getPlayerRangedWeapon` * `getPlayerRing` * `getPlayerShield` - * `getPlayerSpell` ---- -* `ItemsGround.getById` throws an exception instead of returning `null` if there's no item with given ID \ No newline at end of file + * `getPlayerSpell` \ No newline at end of file diff --git a/python/docs/constants/anticheat.md b/docs/constants/anticheat.md similarity index 100% rename from python/docs/constants/anticheat.md rename to docs/constants/anticheat.md diff --git a/python/docs/constants/context.md b/docs/constants/context.md similarity index 100% rename from python/docs/constants/context.md rename to docs/constants/context.md diff --git a/python/docs/constants/damage.md b/docs/constants/damage.md similarity index 100% rename from python/docs/constants/damage.md rename to docs/constants/damage.md diff --git a/python/docs/constants/general.md b/docs/constants/general.md similarity index 100% rename from python/docs/constants/general.md rename to docs/constants/general.md diff --git a/python/docs/constants/hand.md b/docs/constants/hand.md similarity index 100% rename from python/docs/constants/hand.md rename to docs/constants/hand.md diff --git a/python/docs/constants/item.md b/docs/constants/item.md similarity index 100% rename from python/docs/constants/item.md rename to docs/constants/item.md diff --git a/python/docs/constants/network.md b/docs/constants/network.md similarity index 100% rename from python/docs/constants/network.md rename to docs/constants/network.md diff --git a/python/docs/constants/npc.md b/docs/constants/npc.md similarity index 100% rename from python/docs/constants/npc.md rename to docs/constants/npc.md diff --git a/python/docs/constants/reliability.md b/docs/constants/reliability.md similarity index 100% rename from python/docs/constants/reliability.md rename to docs/constants/reliability.md diff --git a/python/docs/constants/skill-weapon.md b/docs/constants/skill-weapon.md similarity index 100% rename from python/docs/constants/skill-weapon.md rename to docs/constants/skill-weapon.md diff --git a/python/docs/constants/talent.md b/docs/constants/talent.md similarity index 100% rename from python/docs/constants/talent.md rename to docs/constants/talent.md diff --git a/python/docs/constants/weapon-mode.md b/docs/constants/weapon-mode.md similarity index 100% rename from python/docs/constants/weapon-mode.md rename to docs/constants/weapon-mode.md diff --git a/python/docs/constants/weather.md b/docs/constants/weather.md similarity index 100% rename from python/docs/constants/weather.md rename to docs/constants/weather.md diff --git a/python/docs/defaultEvents/anticheat/onPlayerUseCheat.md b/docs/defaultEvents/anticheat/onPlayerUseCheat.md similarity index 80% rename from python/docs/defaultEvents/anticheat/onPlayerUseCheat.md rename to docs/defaultEvents/anticheat/onPlayerUseCheat.md index 5735c60..8eb53d3 100644 --- a/python/docs/defaultEvents/anticheat/onPlayerUseCheat.md +++ b/docs/defaultEvents/anticheat/onPlayerUseCheat.md @@ -13,9 +13,9 @@ Original: [onPlayerUseCheat](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/ ## Usage ```python -import g2o +import pyg2o -@g2o.event('onPlayerUseCheat') -def onCheat(**kwargs): - print(f'Player {kwargs['playerid']} used forbidden cheat tool type {kwargs['type']}.') +@pyg2o.event('onPlayerUseCheat') +async def onCheat(playerid, type): + print(f'Player {playerid} used forbidden cheat tool type {type}.') ``` \ No newline at end of file diff --git a/python/docs/defaultEvents/general/onBan.md b/docs/defaultEvents/general/onBan.md similarity index 80% rename from python/docs/defaultEvents/general/onBan.md rename to docs/defaultEvents/general/onBan.md index 203a546..9491ca1 100644 --- a/python/docs/defaultEvents/general/onBan.md +++ b/docs/defaultEvents/general/onBan.md @@ -18,13 +18,13 @@ Original: [onBan](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-refe ## Usage ```python -import g2o +import pyg2o as g2o from datetime import datetime @g2o.event('onBan') -def onBan(**kwargs): - print(f'Player {kwargs['name']} has been banned.') - if ('timestamp' in kwargs): - banExpires = datetime.fromtimestamp(kwargs['timestamp']) +async def onBan(banInfo): + print(f'Player {banInfo['name']} has been banned.') + if ('timestamp' in banInfo): + banExpires = datetime.fromtimestamp(banInfo['timestamp']) print(f'Ban expires at {banExpires}') ``` \ No newline at end of file diff --git a/python/docs/defaultEvents/general/onExit.md b/docs/defaultEvents/general/onExit.md similarity index 89% rename from python/docs/defaultEvents/general/onExit.md rename to docs/defaultEvents/general/onExit.md index c0690c0..b3aa8fa 100644 --- a/python/docs/defaultEvents/general/onExit.md +++ b/docs/defaultEvents/general/onExit.md @@ -9,9 +9,9 @@ No parameters. ## Usage ```python -import g2o +import pyg2o as g2o @g2o.event('onExit') -def onExitEvt(**kwargs): +async def onExitEvt(): print('Bye') ``` \ No newline at end of file diff --git a/python/docs/defaultEvents/general/onInit.md b/docs/defaultEvents/general/onInit.md similarity index 85% rename from python/docs/defaultEvents/general/onInit.md rename to docs/defaultEvents/general/onInit.md index 1434dad..6c5e878 100644 --- a/python/docs/defaultEvents/general/onInit.md +++ b/docs/defaultEvents/general/onInit.md @@ -8,9 +8,9 @@ No parameters. ## Usage ```python -import g2o +import pyg2o as g2o @g2o.event('onInit') -def onInitEventHandler(**kwargs): +async def onInitEventHandler(): print('Called onInit event') ``` \ No newline at end of file diff --git a/python/docs/defaultEvents/general/onTick.md b/docs/defaultEvents/general/onTick.md similarity index 87% rename from python/docs/defaultEvents/general/onTick.md rename to docs/defaultEvents/general/onTick.md index f73a90a..5c0c7b7 100644 --- a/python/docs/defaultEvents/general/onTick.md +++ b/docs/defaultEvents/general/onTick.md @@ -8,9 +8,9 @@ No parameters. ## Usage ```python -import g2o +import pyg2o as g2o @g2o.event('onTick') -def onTickEvt(**kwargs): +async def onTickEvt(): print('Tock') ``` \ No newline at end of file diff --git a/python/docs/defaultEvents/general/onTime.md b/docs/defaultEvents/general/onTime.md similarity index 78% rename from python/docs/defaultEvents/general/onTime.md rename to docs/defaultEvents/general/onTime.md index 4f21a22..8e068ea 100644 --- a/python/docs/defaultEvents/general/onTime.md +++ b/docs/defaultEvents/general/onTime.md @@ -11,12 +11,9 @@ Original: [onExit](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-ref ## Usage ```python -import g2o +import pyg2o as g2o -@g2o.event('onTick') -def onTickEvt(**kwargs): - day = kwargs['day'] - hour = kwargs['hour'] - mins = kwargs['min'] +@g2o.event('onTime') +async def onTickEvt(day, hour, min): print(f'Current time: Day {day}, Hour {hour}, Min {mins}') ``` \ No newline at end of file diff --git a/python/docs/defaultEvents/general/onUnban.md b/docs/defaultEvents/general/onUnban.md similarity index 88% rename from python/docs/defaultEvents/general/onUnban.md rename to docs/defaultEvents/general/onUnban.md index 981cf16..7ecaecf 100644 --- a/python/docs/defaultEvents/general/onUnban.md +++ b/docs/defaultEvents/general/onUnban.md @@ -18,9 +18,9 @@ Original: [onExit](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-ref ## Usage ```python -import g2o +import pyg2o as g2o @g2o.event('onUnban') -def onUnban(**kwargs): - print(f'Player {kwargs['name']} has been unbanned.') +async def onUnban(banInfo): + print(f'Player {banInfo['name']} has been unbanned.') ``` \ No newline at end of file diff --git a/python/docs/defaultEvents/npc/onNpcActionFinished.md b/docs/defaultEvents/npc/onNpcActionFinished.md similarity index 75% rename from python/docs/defaultEvents/npc/onNpcActionFinished.md rename to docs/defaultEvents/npc/onNpcActionFinished.md index 38abf55..9a68b75 100644 --- a/python/docs/defaultEvents/npc/onNpcActionFinished.md +++ b/docs/defaultEvents/npc/onNpcActionFinished.md @@ -13,9 +13,9 @@ Original: [onNpcActionFinished](https://gothicmultiplayerteam.gitlab.io/docs/0.3 ## Usage ```python -import g2o +import pyg2o as g2o @g2o.event('onNpcActionFinished') -def onActionFinished(**kwargs): - print(f'NPC {kwargs['npc_id']} finished action {kwargs['action_type']} with the result {kwargs['result']}.') +async def onActionFinished(npc_id, action_type, action_id, result): + print(f'NPC {npc_id} finished action {action_type} with the result {result}.') ``` \ No newline at end of file diff --git a/python/docs/defaultEvents/npc/onNpcActionSent.md b/docs/defaultEvents/npc/onNpcActionSent.md similarity index 79% rename from python/docs/defaultEvents/npc/onNpcActionSent.md rename to docs/defaultEvents/npc/onNpcActionSent.md index e7e328f..a845011 100644 --- a/python/docs/defaultEvents/npc/onNpcActionSent.md +++ b/docs/defaultEvents/npc/onNpcActionSent.md @@ -12,9 +12,9 @@ Original: [onNpcActionSent](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/s ## Usage ```python -import g2o +import pyg2o as g2o @g2o.event('onNpcActionSent') -def onActionSent(**kwargs): - print(f'NPC {kwargs['npc_id']} changed host from {kwargs['previous_id']} to {kwargs['current_id']}.') +async def onActionSent(npc_id, action_type, action_id): + print(f'NPC {npc_id} sent action {action_id}.') ``` \ No newline at end of file diff --git a/python/docs/defaultEvents/npc/onNpcChangeHostPlayer.md b/docs/defaultEvents/npc/onNpcChangeHostPlayer.md similarity index 81% rename from python/docs/defaultEvents/npc/onNpcChangeHostPlayer.md rename to docs/defaultEvents/npc/onNpcChangeHostPlayer.md index 6e929e6..1a8bb0f 100644 --- a/python/docs/defaultEvents/npc/onNpcChangeHostPlayer.md +++ b/docs/defaultEvents/npc/onNpcChangeHostPlayer.md @@ -12,9 +12,9 @@ Original: [onNpcChangeHostPlayer](https://gothicmultiplayerteam.gitlab.io/docs/0 ## Usage ```python -import g2o +import pyg2o as g2o @g2o.event('onNpcChangeHostPlayer') -def onChangeHostPlayer(**kwargs): - print(f'NPC {kwargs['npc_id']} sent {kwargs['action_type']} to all players.') +async def onChangeHostPlayer(npc_id, previous_id, current_id): + print(f'NPC {npc_id} changed host to {current_id}') ``` \ No newline at end of file diff --git a/python/docs/defaultEvents/npc/onNpcCreated.md b/docs/defaultEvents/npc/onNpcCreated.md similarity index 79% rename from python/docs/defaultEvents/npc/onNpcCreated.md rename to docs/defaultEvents/npc/onNpcCreated.md index 9ecad00..00e1000 100644 --- a/python/docs/defaultEvents/npc/onNpcCreated.md +++ b/docs/defaultEvents/npc/onNpcCreated.md @@ -10,9 +10,9 @@ Original: [onNpcCreated](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/scri ## Usage ```python -import g2o +import pyg2o as g2o @g2o.event('onNpcCreated') -def onNpcCreate(**kwargs): - print(f'NPC {kwargs['npc_id']} has been created.') +async def onNpcCreate(npc_id): + print(f'NPC {npc_id} has been created.') ``` \ No newline at end of file diff --git a/python/docs/defaultEvents/npc/onNpcDestroyed.md b/docs/defaultEvents/npc/onNpcDestroyed.md similarity index 78% rename from python/docs/defaultEvents/npc/onNpcDestroyed.md rename to docs/defaultEvents/npc/onNpcDestroyed.md index ba6c21d..ce3371e 100644 --- a/python/docs/defaultEvents/npc/onNpcDestroyed.md +++ b/docs/defaultEvents/npc/onNpcDestroyed.md @@ -10,9 +10,9 @@ Original: [onNpcDestroyed](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/sc ## Usage ```python -import g2o +import pyg2o as g2o @g2o.event('onNpcDestroyed') -def onNpcDestroy(**kwargs): - print(f'NPC {kwargs['npc_id']} has been destroyed.') +async def onNpcDestroy(npc_id): + print(f'NPC {npc_id} has been destroyed.') ``` \ No newline at end of file diff --git a/python/docs/defaultEvents/player/onPlayerChangeColor.md b/docs/defaultEvents/player/onPlayerChangeColor.md similarity index 70% rename from python/docs/defaultEvents/player/onPlayerChangeColor.md rename to docs/defaultEvents/player/onPlayerChangeColor.md index 7017fc5..641838a 100644 --- a/python/docs/defaultEvents/player/onPlayerChangeColor.md +++ b/docs/defaultEvents/player/onPlayerChangeColor.md @@ -12,14 +12,11 @@ Original: [onPlayerChangeColor](https://gothicmultiplayerteam.gitlab.io/docs/0.3 ## Usage ```python -import g2o +import pyg2o as g2o @g2o.event('onPlayerChangeColor') -def onChangeColor(**kwargs): - # Slicing out playerid and converting from {r: num, g: num, b: num} - # to (num, num, num) - rgbColor = tuple(list(kwargs.values())[1:]) - # Formating rgb into hex color +async def onChangeColor(playerid, r, g, b): + rgbColor = tuple(r, g, b) hexColor = '#%02x%02x%02x' % rgbColor - print(f'Player {kwargs['playerid']} changed his color to {hexColor}') + print(f'Player {playerid} changed his color to {hexColor}') ``` \ No newline at end of file diff --git a/python/docs/defaultEvents/player/onPlayerChangeFocus.md b/docs/defaultEvents/player/onPlayerChangeFocus.md similarity index 73% rename from python/docs/defaultEvents/player/onPlayerChangeFocus.md rename to docs/defaultEvents/player/onPlayerChangeFocus.md index ef6dfbf..a9a5ac0 100644 --- a/python/docs/defaultEvents/player/onPlayerChangeFocus.md +++ b/docs/defaultEvents/player/onPlayerChangeFocus.md @@ -11,13 +11,12 @@ Original: [onPlayerChangeFocus](https://gothicmultiplayerteam.gitlab.io/docs/0.3 ## Usage ```python -import g2o +import pyg2o as g2o @g2o.event('onPlayerChangeFocus') -def onChangeFocus(**kwargs): - focusId = kwargs['newFocusId'] - if focusId != -1: - print(f'Player {kwargs['playerid']} is looking at {focusId}') +async def onChangeFocus(playerid, oldFocusId, newFocusId): + if newFocusId != -1: + print(f'Player {playerid} is looking at {newFocusId}') else - print(f'Player {kwargs['playerid']} is looking at... who?') + print(f'Player {playerid} is looking at... who?') ``` \ No newline at end of file diff --git a/python/docs/defaultEvents/player/onPlayerChangeHealth.md b/docs/defaultEvents/player/onPlayerChangeHealth.md similarity index 60% rename from python/docs/defaultEvents/player/onPlayerChangeHealth.md rename to docs/defaultEvents/player/onPlayerChangeHealth.md index 250bca1..f1796bb 100644 --- a/python/docs/defaultEvents/player/onPlayerChangeHealth.md +++ b/docs/defaultEvents/player/onPlayerChangeHealth.md @@ -6,14 +6,14 @@ Original: [onPlayerChangeHealth](https://gothicmultiplayerteam.gitlab.io/docs/0. ## Parameters * `dict` **kwargs**: * `int` **playerid**: the id of the player whose health points gets changed. - * `int` **oldHP**: the previous health points of the player. - * `int` **newHP**: the new health points of the player. + * `int` **previous**: the previous health points of the player. + * `int` **current**: the new health points of the player. ## Usage ```python -import g2o +import pyg2o as g2o @g2o.event('onPlayerChangeHealth') -def onChangeHealth(**kwargs): - print(f'Player {kwargs['playerid']} changed health: {kwargs['oldHP']} -> {kwargs['newHP']}') +async def onChangeHealth(playerid, previous, current): + print(f'Player {playerid} changed health: {previous} -> {current}') ``` \ No newline at end of file diff --git a/python/docs/defaultEvents/player/onPlayerChangeMana.md b/docs/defaultEvents/player/onPlayerChangeMana.md similarity index 59% rename from python/docs/defaultEvents/player/onPlayerChangeMana.md rename to docs/defaultEvents/player/onPlayerChangeMana.md index c53c01d..17ff417 100644 --- a/python/docs/defaultEvents/player/onPlayerChangeMana.md +++ b/docs/defaultEvents/player/onPlayerChangeMana.md @@ -6,14 +6,14 @@ Original: [onPlayerChangeMana](https://gothicmultiplayerteam.gitlab.io/docs/0.3. ## Parameters * `dict` **kwargs**: * `int` **playerid**: the id of the player mana points gets changed. - * `int` **oldMP**: the previous mana points of the player. - * `int` **newMP**: the new mana points of the player. + * `int` **previous**: the previous mana points of the player. + * `int` **current**: the new mana points of the player. ## Usage ```python -import g2o +import pyg2o as g2o @g2o.event('onPlayerChangeMana') -def onChangeMana(**kwargs): - print(f'Player {kwargs['playerid']} changed mana: {kwargs['oldMP']} -> {kwargs['newMP']}') +async def onChangeMana(playerid, previous, current): + print(f'Player {playerid} changed mana: {previous} -> {current}') ``` \ No newline at end of file diff --git a/python/docs/defaultEvents/player/onPlayerChangeMaxHealth.md b/docs/defaultEvents/player/onPlayerChangeMaxHealth.md similarity index 60% rename from python/docs/defaultEvents/player/onPlayerChangeMaxHealth.md rename to docs/defaultEvents/player/onPlayerChangeMaxHealth.md index 33b8024..015b984 100644 --- a/python/docs/defaultEvents/player/onPlayerChangeMaxHealth.md +++ b/docs/defaultEvents/player/onPlayerChangeMaxHealth.md @@ -6,14 +6,14 @@ Original: [onPlayerChangeMaxHealth](https://gothicmultiplayerteam.gitlab.io/docs ## Parameters * `dict` **kwargs**: * `int` **playerid**: the id of the player whose maxium health points gets changed. - * `int` **oldMaxHP**: the previous maximum health points of the player. - * `int` **newMaxHP**: the new maximum health points of the player. + * `int` **previous**: the previous maximum health points of the player. + * `int` **current**: the new maximum health points of the player. ## Usage ```python -import g2o +import pyg2o as g2o @g2o.event('onPlayerChangeMaxHealth') -def onChangeMaxHealth(**kwargs): - print(f'Player {kwargs['playerid']} changed maximum health: {kwargs['oldMaxHP']} -> {kwargs['newMaxHP']}') +async def onChangeMaxHealth(playerid, previous, current): + print(f'Player {playerid} changed maximum health: {previous} -> {current}') ``` \ No newline at end of file diff --git a/python/docs/defaultEvents/player/onPlayerChangeMaxMana.md b/docs/defaultEvents/player/onPlayerChangeMaxMana.md similarity index 60% rename from python/docs/defaultEvents/player/onPlayerChangeMaxMana.md rename to docs/defaultEvents/player/onPlayerChangeMaxMana.md index e68ffc0..e807125 100644 --- a/python/docs/defaultEvents/player/onPlayerChangeMaxMana.md +++ b/docs/defaultEvents/player/onPlayerChangeMaxMana.md @@ -6,14 +6,14 @@ Original: [onPlayerChangeMaxMana](https://gothicmultiplayerteam.gitlab.io/docs/0 ## Parameters * `dict` **kwargs**: * `int` **playerid**: the id of the player maximum mana points gets changed. - * `int` **oldMaxMP**: the previous maximum mana points of the player. - * `int` **newMaxMP**: the new maximum mana points of the player. + * `int` **previous**: the previous maximum mana points of the player. + * `int` **current**: the new maximum mana points of the player. ## Usage ```python -import g2o +import pyg2o as g2o @g2o.event('onPlayerChangeMaxMana') -def onChangeMaxMana(**kwargs): - print(f'Player {kwargs['playerid']} changed maximum mana: {kwargs['oldMaxMP']} -> {kwargs['newMaxMP']}') +async def onChangeMaxMana(playerid, previous, current): + print(f'Player {playerid} changed maximum mana: {previous} -> {current}') ``` \ No newline at end of file diff --git a/docs/defaultEvents/player/onPlayerChangeWeaponMode.md b/docs/defaultEvents/player/onPlayerChangeWeaponMode.md new file mode 100644 index 0000000..f897c93 --- /dev/null +++ b/docs/defaultEvents/player/onPlayerChangeWeaponMode.md @@ -0,0 +1,19 @@ +# `event` onPlayerChangeWeaponMode +This event is triggered when player changes the weapon mode. + +Original: [onPlayerChangeWeaponMode](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-events/player/onPlayerChangeWeaponMode/) + +## Parameters +* `dict` **kwargs**: + * `int` **playerid**: the id of the player which changes the weapon mode. + * `int` **previous**: the old weapon mode which was used by the player. For more information see [Weapon mode](../../constants/weapon-mode.md). + * `int` **current**: the new weapon mode in which player is currently using. For more information see [Weapon mode](../../constants/weapon-mode.md). + +## Usage +```python +import pyg2o as g2o + +@g2o.event('onPlayerChangeWeaponMode') +async def onChangeWM(playerid, previous, current): + print(f'Player {playerid} changed wm: {previous} -> {current}') +``` \ No newline at end of file diff --git a/python/docs/defaultEvents/player/onPlayerChangeWorld.md b/docs/defaultEvents/player/onPlayerChangeWorld.md similarity index 81% rename from python/docs/defaultEvents/player/onPlayerChangeWorld.md rename to docs/defaultEvents/player/onPlayerChangeWorld.md index 44c08b1..ca78f54 100644 --- a/python/docs/defaultEvents/player/onPlayerChangeWorld.md +++ b/docs/defaultEvents/player/onPlayerChangeWorld.md @@ -12,9 +12,9 @@ Original: [onPlayerChangeWorld](https://gothicmultiplayerteam.gitlab.io/docs/0.3 ## Usage ```python -import g2o +import pyg2o as g2o @g2o.event('onPlayerChangeWorld') -def onChangeWorld(**kwargs): - print(f'Player {kwargs['playerid']} teleported to {kwargs['world']} at {kwargs['waypoint']}') +async def onChangeWorld(playerid, world, waypoint): + print(f'Player {playerid} teleported to {world} at {waypoint}') ``` \ No newline at end of file diff --git a/python/docs/defaultEvents/player/onPlayerCommand.md b/docs/defaultEvents/player/onPlayerCommand.md similarity index 79% rename from python/docs/defaultEvents/player/onPlayerCommand.md rename to docs/defaultEvents/player/onPlayerCommand.md index c1977ff..8950aee 100644 --- a/python/docs/defaultEvents/player/onPlayerCommand.md +++ b/docs/defaultEvents/player/onPlayerCommand.md @@ -12,13 +12,13 @@ Original: [onPlayerCommand](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/s ## Usage ```python -import g2o +import pyg2o as g2o @g2o.event('onPlayerCommand') -def onCommand(**kwargs): +async def onCommand(playerid, command, params): # Spliting and formating params - params = [eval(x) if not x.isalpha() else x for kwargs['params'].split()] + params = [eval(x) if not x.isalpha() else x for params.split()] - if kwargs['command'] == 'add' and len(params) == 2: + if command == 'add' and len(params) == 2: print('Sum is: ', params[0] + params[1]) # /add 5 10 -> output: Sum is 15 ``` \ No newline at end of file diff --git a/python/docs/defaultEvents/player/onPlayerDamage.md b/docs/defaultEvents/player/onPlayerDamage.md similarity index 83% rename from python/docs/defaultEvents/player/onPlayerDamage.md rename to docs/defaultEvents/player/onPlayerDamage.md index 017cef0..9119e66 100644 --- a/python/docs/defaultEvents/player/onPlayerDamage.md +++ b/docs/defaultEvents/player/onPlayerDamage.md @@ -12,10 +12,9 @@ Original: [onPlayerDamage](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/sc ## Usage ```python -import g2o +import pyg2o as g2o @g2o.event('onPlayerDamage') -def onDamage(**kwargs): - desc = kwargs['description'] - print(f'Ouch! Player {kwargs['playerid']} just received {desc.damage} damage.') +async def onDamage(playerid, killerid, description): + print(f'Ouch! Player {playerid} just received {description.damage} damage.') ``` \ No newline at end of file diff --git a/python/docs/defaultEvents/player/onPlayerDead.md b/docs/defaultEvents/player/onPlayerDead.md similarity index 83% rename from python/docs/defaultEvents/player/onPlayerDead.md rename to docs/defaultEvents/player/onPlayerDead.md index 1805ddc..6ab1c04 100644 --- a/python/docs/defaultEvents/player/onPlayerDead.md +++ b/docs/defaultEvents/player/onPlayerDead.md @@ -10,9 +10,9 @@ Original: [onPlayerDead](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/scri ## Usage ```python -import g2o +import pyg2o as g2o @g2o.event('onPlayerDead') -def onDead(**kwargs): - print(kwargs['playerid'], 'killed by', kwargs['killerid']) +async def onDead(playerid, killerid): + print(playerid, 'killed by', killerid) ``` \ No newline at end of file diff --git a/python/docs/defaultEvents/player/onPlayerDisconnect.md b/docs/defaultEvents/player/onPlayerDisconnect.md similarity index 83% rename from python/docs/defaultEvents/player/onPlayerDisconnect.md rename to docs/defaultEvents/player/onPlayerDisconnect.md index 6591c4c..2cb50c3 100644 --- a/python/docs/defaultEvents/player/onPlayerDisconnect.md +++ b/docs/defaultEvents/player/onPlayerDisconnect.md @@ -10,9 +10,9 @@ Original: [onPlayerDisconnect](https://gothicmultiplayerteam.gitlab.io/docs/0.3. ## Usage ```python -import g2o +import pyg2o as g2o @g2o.event('onPlayerDisconnect') -def onDC(**kwargs): - print(f'Player {kwargs['playerid']} has left from the server') +async def onDC(playerid, reason): + print(f'Player {playerid} has left from the server') ``` \ No newline at end of file diff --git a/python/docs/defaultEvents/player/onPlayerDropItem.md b/docs/defaultEvents/player/onPlayerDropItem.md similarity index 79% rename from python/docs/defaultEvents/player/onPlayerDropItem.md rename to docs/defaultEvents/player/onPlayerDropItem.md index 578b622..b933634 100644 --- a/python/docs/defaultEvents/player/onPlayerDropItem.md +++ b/docs/defaultEvents/player/onPlayerDropItem.md @@ -11,10 +11,9 @@ Original: [onPlayerDropItem](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/ ## Usage ```python -import g2o +import pyg2o as g2o @g2o.event('onPlayerDropItem') -def onDropItem(**kwargs): - item = itemm['itemGround'] - print(f'Player {kwargs['playerid']} dropped {item.instance} x{item.amount}') +async def onDropItem(playerid, itemGround): + print(f'Player {playerid} dropped {itemGround.instance} x{itemGround.amount}') ``` \ No newline at end of file diff --git a/python/docs/defaultEvents/player/onPlayerEnterWorld.md b/docs/defaultEvents/player/onPlayerEnterWorld.md similarity index 81% rename from python/docs/defaultEvents/player/onPlayerEnterWorld.md rename to docs/defaultEvents/player/onPlayerEnterWorld.md index 23c9c09..8e4a843 100644 --- a/python/docs/defaultEvents/player/onPlayerEnterWorld.md +++ b/docs/defaultEvents/player/onPlayerEnterWorld.md @@ -10,9 +10,9 @@ Original: [onPlayerEnterWorld](https://gothicmultiplayerteam.gitlab.io/docs/0.3. ## Usage ```python -import g2o +import pyg2o as g2o @g2o.event('onPlayerEnterWorld') -def onEnterWorld(**kwargs): - print(f'Player {kwargs['playerid']} entered world {kwargs['world']}') +async def onEnterWorld(playerid, world): + print(f'Player {playerid} entered world {world}') ``` \ No newline at end of file diff --git a/python/docs/defaultEvents/player/onPlayerEquipAmulet.md b/docs/defaultEvents/player/onPlayerEquipAmulet.md similarity index 82% rename from python/docs/defaultEvents/player/onPlayerEquipAmulet.md rename to docs/defaultEvents/player/onPlayerEquipAmulet.md index 62dff20..527c87c 100644 --- a/python/docs/defaultEvents/player/onPlayerEquipAmulet.md +++ b/docs/defaultEvents/player/onPlayerEquipAmulet.md @@ -10,9 +10,9 @@ Original: [onPlayerEquipAmulet](https://gothicmultiplayerteam.gitlab.io/docs/0.3 ## Usage ```python -import g2o +import pyg2o as g2o @g2o.event('onPlayerEquipAmulet') -def onEquip(**kwargs): - print(f'Player {kwargs['playerid']} equipped {kwargs['instance']}') +async def onEquip(playerid, instance): + print(f'Player {playerid} equipped {instance}') ``` \ No newline at end of file diff --git a/python/docs/defaultEvents/player/onPlayerEquipArmor.md b/docs/defaultEvents/player/onPlayerEquipArmor.md similarity index 82% rename from python/docs/defaultEvents/player/onPlayerEquipArmor.md rename to docs/defaultEvents/player/onPlayerEquipArmor.md index 6854e2a..29350cc 100644 --- a/python/docs/defaultEvents/player/onPlayerEquipArmor.md +++ b/docs/defaultEvents/player/onPlayerEquipArmor.md @@ -10,9 +10,9 @@ Original: [onPlayerEquipArmor](https://gothicmultiplayerteam.gitlab.io/docs/0.3. ## Usage ```python -import g2o +import pyg2o as g2o @g2o.event('onPlayerEquipArmor') -def onEquip(**kwargs): - print(f'Player {kwargs['playerid']} equipped {kwargs['instance']}') +async def onEquip(playerid, instance): + print(f'Player {playerid} equipped {instance}') ``` \ No newline at end of file diff --git a/python/docs/defaultEvents/player/onPlayerEquipBelt.md b/docs/defaultEvents/player/onPlayerEquipBelt.md similarity index 82% rename from python/docs/defaultEvents/player/onPlayerEquipBelt.md rename to docs/defaultEvents/player/onPlayerEquipBelt.md index 469bf79..ca41ee8 100644 --- a/python/docs/defaultEvents/player/onPlayerEquipBelt.md +++ b/docs/defaultEvents/player/onPlayerEquipBelt.md @@ -10,9 +10,9 @@ Original: [onPlayerEquipBelt](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0 ## Usage ```python -import g2o +import pyg2o as g2o @g2o.event('onPlayerEquipBelt') -def onEquip(**kwargs): - print(f'Player {kwargs['playerid']} equipped {kwargs['instance']}') +async def onEquip(playerid, instance): + print(f'Player {playerid} equipped {instance}') ``` \ No newline at end of file diff --git a/python/docs/defaultEvents/player/onPlayerEquipHandItem.md b/docs/defaultEvents/player/onPlayerEquipHandItem.md similarity index 84% rename from python/docs/defaultEvents/player/onPlayerEquipHandItem.md rename to docs/defaultEvents/player/onPlayerEquipHandItem.md index 04437f8..aefa5c0 100644 --- a/python/docs/defaultEvents/player/onPlayerEquipHandItem.md +++ b/docs/defaultEvents/player/onPlayerEquipHandItem.md @@ -11,9 +11,9 @@ Original: [onPlayerEquipHandItem](https://gothicmultiplayerteam.gitlab.io/docs/0 ## Usage ```python -import g2o +import pyg2o as g2o @g2o.event('onPlayerEquipHandItem') -def onEquip(**kwargs): - print(f'Player {kwargs['playerid']} has {kwargs['instance']}, used hand with id {kwargs['hand']}') +async def onEquip(playerid, hand, instance): + print(f'Player {playerid} equipped {instance}') ``` \ No newline at end of file diff --git a/python/docs/defaultEvents/player/onPlayerEquipHelmet.md b/docs/defaultEvents/player/onPlayerEquipHelmet.md similarity index 82% rename from python/docs/defaultEvents/player/onPlayerEquipHelmet.md rename to docs/defaultEvents/player/onPlayerEquipHelmet.md index 6d11b31..5b16101 100644 --- a/python/docs/defaultEvents/player/onPlayerEquipHelmet.md +++ b/docs/defaultEvents/player/onPlayerEquipHelmet.md @@ -10,9 +10,9 @@ Original: [onPlayerEquipHelmet](https://gothicmultiplayerteam.gitlab.io/docs/0.3 ## Usage ```python -import g2o +import pyg2o as g2o @g2o.event('onPlayerEquipHelmet') -def onEquip(**kwargs): - print(f'Player {kwargs['playerid']} equipped {kwargs['instance']}') +async def onEquip(playerid, instance): + print(f'Player {playerid} equipped {instance}') ``` \ No newline at end of file diff --git a/python/docs/defaultEvents/player/onPlayerEquipMeleeWeapon.md b/docs/defaultEvents/player/onPlayerEquipMeleeWeapon.md similarity index 83% rename from python/docs/defaultEvents/player/onPlayerEquipMeleeWeapon.md rename to docs/defaultEvents/player/onPlayerEquipMeleeWeapon.md index 41a7ecc..fe0e556 100644 --- a/python/docs/defaultEvents/player/onPlayerEquipMeleeWeapon.md +++ b/docs/defaultEvents/player/onPlayerEquipMeleeWeapon.md @@ -10,9 +10,9 @@ Original: [onPlayerEquipMeleeWeapon](https://gothicmultiplayerteam.gitlab.io/doc ## Usage ```python -import g2o +import pyg2o as g2o @g2o.event('onPlayerEquipMeleeWeapon') -def onEquip(**kwargs): - print(f'Player {kwargs['playerid']} equipped {kwargs['instance']}') +async def onEquip(playerid, instance): + print(f'Player {playerid} equipped {instance}') ``` \ No newline at end of file diff --git a/python/docs/defaultEvents/player/onPlayerEquipRangedWeapon.md b/docs/defaultEvents/player/onPlayerEquipRangedWeapon.md similarity index 83% rename from python/docs/defaultEvents/player/onPlayerEquipRangedWeapon.md rename to docs/defaultEvents/player/onPlayerEquipRangedWeapon.md index 0315a9b..9b67d70 100644 --- a/python/docs/defaultEvents/player/onPlayerEquipRangedWeapon.md +++ b/docs/defaultEvents/player/onPlayerEquipRangedWeapon.md @@ -10,9 +10,9 @@ Original: [onPlayerEquipRangedWeapon](https://gothicmultiplayerteam.gitlab.io/do ## Usage ```python -import g2o +import pyg2o as g2o @g2o.event('onPlayerEquipRangedWeapon') -def onEquip(**kwargs): - print(f'Player {kwargs['playerid']} equipped {kwargs['instance']}') +async def onEquip(playerid, instance): + print(f'Player {playerid} equipped {instance}') ``` \ No newline at end of file diff --git a/python/docs/defaultEvents/player/onPlayerEquipRing.md b/docs/defaultEvents/player/onPlayerEquipRing.md similarity index 82% rename from python/docs/defaultEvents/player/onPlayerEquipRing.md rename to docs/defaultEvents/player/onPlayerEquipRing.md index 0fd08e6..cb91174 100644 --- a/python/docs/defaultEvents/player/onPlayerEquipRing.md +++ b/docs/defaultEvents/player/onPlayerEquipRing.md @@ -11,9 +11,9 @@ Original: [onPlayerEquipRing](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0 ## Usage ```python -import g2o +import pyg2o as g2o @g2o.event('onPlayerEquipRing') -def onEquip(**kwargs): - print(f'Player {kwargs['playerid']} has {kwargs['instance']}, used hand with id {kwargs['hand']}') +async def onEquip(playerid, hand, instance): + print(f'Player {playerid} equipped {instance}') ``` \ No newline at end of file diff --git a/python/docs/defaultEvents/player/onPlayerEquipShield.md b/docs/defaultEvents/player/onPlayerEquipShield.md similarity index 82% rename from python/docs/defaultEvents/player/onPlayerEquipShield.md rename to docs/defaultEvents/player/onPlayerEquipShield.md index 2098ef0..bf6245f 100644 --- a/python/docs/defaultEvents/player/onPlayerEquipShield.md +++ b/docs/defaultEvents/player/onPlayerEquipShield.md @@ -10,9 +10,9 @@ Original: [onPlayerEquipShield](https://gothicmultiplayerteam.gitlab.io/docs/0.3 ## Usage ```python -import g2o +import pyg2o as g2o @g2o.event('onPlayerEquipShield') -def onEquip(**kwargs): - print(f'Player {kwargs['playerid']} equipped {kwargs['instance']}') +async def onEquip(playerid, instance): + print(f'Player {playerid} equipped {instance}') ``` \ No newline at end of file diff --git a/python/docs/defaultEvents/player/onPlayerEquipSpell.md b/docs/defaultEvents/player/onPlayerEquipSpell.md similarity index 81% rename from python/docs/defaultEvents/player/onPlayerEquipSpell.md rename to docs/defaultEvents/player/onPlayerEquipSpell.md index c4cc779..c90de19 100644 --- a/python/docs/defaultEvents/player/onPlayerEquipSpell.md +++ b/docs/defaultEvents/player/onPlayerEquipSpell.md @@ -11,9 +11,9 @@ Original: [onPlayerEquipSpell](https://gothicmultiplayerteam.gitlab.io/docs/0.3. ## Usage ```python -import g2o +import pyg2o as g2o @g2o.event('onPlayerSpell') -def onEquip(**kwargs): - print(f'Player {kwargs['playerid']} equipped spell {kwargs['instance']} at slot {kwargs['slotId']}') +async def onEquip(playerid, slotId, instance): + print(f'Player {playerid} equipped {instance}') ``` \ No newline at end of file diff --git a/python/docs/defaultEvents/player/onPlayerJoin.md b/docs/defaultEvents/player/onPlayerJoin.md similarity index 77% rename from python/docs/defaultEvents/player/onPlayerJoin.md rename to docs/defaultEvents/player/onPlayerJoin.md index db1ff15..630702d 100644 --- a/python/docs/defaultEvents/player/onPlayerJoin.md +++ b/docs/defaultEvents/player/onPlayerJoin.md @@ -9,9 +9,9 @@ Original: [onPlayerJoin](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/scri ## Usage ```python -import g2o +import pyg2o as g2o @g2o.event('onPlayerJoin') -def onJoin(**kwargs): - print(kwargs['playerid'], 'joined to the server.') +async def onJoin(playerid): + print(pyg2o.getPlayerName(playerid), ' joined to the server.') ``` \ No newline at end of file diff --git a/python/docs/defaultEvents/player/onPlayerMessage.md b/docs/defaultEvents/player/onPlayerMessage.md similarity index 79% rename from python/docs/defaultEvents/player/onPlayerMessage.md rename to docs/defaultEvents/player/onPlayerMessage.md index a94cf0b..63a4792 100644 --- a/python/docs/defaultEvents/player/onPlayerMessage.md +++ b/docs/defaultEvents/player/onPlayerMessage.md @@ -10,9 +10,9 @@ Original: [onPlayerMessage](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/s ## Usage ```python -import g2o +import pyg2o as g2o @g2o.event('onPlayerMessage') -def onMessage(**kwargs): - print(kwargs['playerid'], 'says', kwargs['message']) +async def onMessage(playerid, message): + print(pyg2o.getPlayerName(playerid), ' says ', message) ``` \ No newline at end of file diff --git a/python/docs/defaultEvents/player/onPlayerMobInteract.md b/docs/defaultEvents/player/onPlayerMobInteract.md similarity index 83% rename from python/docs/defaultEvents/player/onPlayerMobInteract.md rename to docs/defaultEvents/player/onPlayerMobInteract.md index c8e28d1..c7cb3d7 100644 --- a/python/docs/defaultEvents/player/onPlayerMobInteract.md +++ b/docs/defaultEvents/player/onPlayerMobInteract.md @@ -10,10 +10,10 @@ Original: [onPlayerMobInteract](https://gothicmultiplayerteam.gitlab.io/docs/0.3 ## Usage ```python -import g2o +import pyg2o as g2o @g2o.event('onPlayerMobInteract') -def onMobInteract(**kwargs): - if kwargs['to'] == 1: - print(kwargs['playerid'], 'started interaction with the MOB') +async def onMobInteract(playerid, from, to): + if to == 1: + print(playerid, 'started interaction with the MOB') ``` \ No newline at end of file diff --git a/python/docs/defaultEvents/player/onPlayerRespawn.md b/docs/defaultEvents/player/onPlayerRespawn.md similarity index 82% rename from python/docs/defaultEvents/player/onPlayerRespawn.md rename to docs/defaultEvents/player/onPlayerRespawn.md index a8f0656..8ad5c9d 100644 --- a/python/docs/defaultEvents/player/onPlayerRespawn.md +++ b/docs/defaultEvents/player/onPlayerRespawn.md @@ -9,9 +9,9 @@ Original: [onPlayerRespawn](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/s ## Usage ```python -import g2o +import pyg2o as g2o @g2o.event('onPlayerRespawn') -def onRespawn(**kwargs): - print(kwargs['playerid'], 'respawned.') +async def onRespawn(playerid): + print(playerid, 'respawned.') ``` \ No newline at end of file diff --git a/python/docs/defaultEvents/player/onPlayerShoot.md b/docs/defaultEvents/player/onPlayerShoot.md similarity index 82% rename from python/docs/defaultEvents/player/onPlayerShoot.md rename to docs/defaultEvents/player/onPlayerShoot.md index eac507c..6a78ca7 100644 --- a/python/docs/defaultEvents/player/onPlayerShoot.md +++ b/docs/defaultEvents/player/onPlayerShoot.md @@ -10,9 +10,9 @@ Original: [onPlayerShoot](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/scr ## Usage ```python -import g2o +import pyg2o as g2o @g2o.event('onPlayerShoot') -def onShoot(**kwargs): - print(kwargs['playerid'], 'made a shot.') +async def onShoot(playerid, munition): + print(playerid, 'made a shot.') ``` \ No newline at end of file diff --git a/python/docs/defaultEvents/player/onPlayerSpellCast.md b/docs/defaultEvents/player/onPlayerSpellCast.md similarity index 86% rename from python/docs/defaultEvents/player/onPlayerSpellCast.md rename to docs/defaultEvents/player/onPlayerSpellCast.md index c39c5c0..8458d6f 100644 --- a/python/docs/defaultEvents/player/onPlayerSpellCast.md +++ b/docs/defaultEvents/player/onPlayerSpellCast.md @@ -15,9 +15,9 @@ Original: [onPlayerSpellCast](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0 ## Usage ```python -import g2o +import pyg2o as g2o @g2o.event('onPlayerSpellCast') -def onSpellCast(**kwargs): - print(kwargs['player'], 'casted a spell', kwargs['instance']) +async def onSpellCast(playerid, instance, spellLevel): + print(playerid, 'casted a spell', instance) ``` \ No newline at end of file diff --git a/python/docs/defaultEvents/player/onPlayerSpellSetup.md b/docs/defaultEvents/player/onPlayerSpellSetup.md similarity index 80% rename from python/docs/defaultEvents/player/onPlayerSpellSetup.md rename to docs/defaultEvents/player/onPlayerSpellSetup.md index 5afaccb..abb500b 100644 --- a/python/docs/defaultEvents/player/onPlayerSpellSetup.md +++ b/docs/defaultEvents/player/onPlayerSpellSetup.md @@ -10,9 +10,9 @@ Original: [onPlayerSpellSetup](https://gothicmultiplayerteam.gitlab.io/docs/0.3. ## Usage ```python -import g2o +import pyg2o as g2o @g2o.event('onPlayerSpellSetup') -def onSpellSetup(**kwargs): - print(kwargs['player'], 'setuped a spell', kwargs['instance']) +async def onSpellSetup(playerid, instance): + print(playerid, 'setuped a spell', instance) ``` \ No newline at end of file diff --git a/python/docs/defaultEvents/player/onPlayerTakeItem.md b/docs/defaultEvents/player/onPlayerTakeItem.md similarity index 85% rename from python/docs/defaultEvents/player/onPlayerTakeItem.md rename to docs/defaultEvents/player/onPlayerTakeItem.md index 31acf84..cd6addb 100644 --- a/python/docs/defaultEvents/player/onPlayerTakeItem.md +++ b/docs/defaultEvents/player/onPlayerTakeItem.md @@ -14,10 +14,9 @@ Original: [onPlayerTakeItem](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/ ## Usage ```python -import g2o +import pyg2o as g2o @g2o.event('onPlayerTakeItem') -def onTakeItem(**kwargs): - item = itemm['itemGround'] - print(f'Player {kwargs['playerid']} took {item.instance} x{item.amount}') +async def onTakeItem(playerid, itemGround): + print(f'Player {playerid} took {itemGround.instance} x{itemGround.amount}') ``` \ No newline at end of file diff --git a/python/docs/defaultEvents/player/onPlayerTeleport.md b/docs/defaultEvents/player/onPlayerTeleport.md similarity index 82% rename from python/docs/defaultEvents/player/onPlayerTeleport.md rename to docs/defaultEvents/player/onPlayerTeleport.md index 3a7a91f..3ae38fe 100644 --- a/python/docs/defaultEvents/player/onPlayerTeleport.md +++ b/docs/defaultEvents/player/onPlayerTeleport.md @@ -10,9 +10,9 @@ Original: [onPlayerTeleport](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/ ## Usage ```python -import g2o +import pyg2o as g2o @g2o.event('onPlayerTeleport') -def onTeleport(**kwargs): - print(kwargs['player'], 'teleported to', kwargs['vobName']) +async def onTeleport(playerid, vobName): + print(playerid, 'teleported to', vobName) ``` \ No newline at end of file diff --git a/python/docs/defaultEvents/player/onPlayerToggleFaceAni.md b/docs/defaultEvents/player/onPlayerToggleFaceAni.md similarity index 84% rename from python/docs/defaultEvents/player/onPlayerToggleFaceAni.md rename to docs/defaultEvents/player/onPlayerToggleFaceAni.md index 702e1b9..51c472b 100644 --- a/python/docs/defaultEvents/player/onPlayerToggleFaceAni.md +++ b/docs/defaultEvents/player/onPlayerToggleFaceAni.md @@ -14,7 +14,7 @@ Original: [onPlayerToggleFaceAni](https://gothicmultiplayerteam.gitlab.io/docs/0 import g2o @g2o.event('onPlayerToggleFaceAni') -def onToggleFA(**kwargs): - if kwargs['toggle']: - print(kwargs['player'], 'started face ani',kwargs['aniName']) +async def onToggleFA(playerid, aniName, toggle): + if toggle: + print(playerid, 'started face ani', aniName) ``` \ No newline at end of file diff --git a/docs/functions/chat/sendMessageToAll.md b/docs/functions/chat/sendMessageToAll.md new file mode 100644 index 0000000..7abba91 --- /dev/null +++ b/docs/functions/chat/sendMessageToAll.md @@ -0,0 +1,2 @@ +# `function` sendMessageToAll +::: src.pyg2o.functions.chat.sendMessageToAll \ No newline at end of file diff --git a/docs/functions/chat/sendMessageToPlayer.md b/docs/functions/chat/sendMessageToPlayer.md new file mode 100644 index 0000000..a685748 --- /dev/null +++ b/docs/functions/chat/sendMessageToPlayer.md @@ -0,0 +1,2 @@ +# `function` sendMessageToPlayer +::: src.pyg2o.functions.chat.sendMessageToPlayer \ No newline at end of file diff --git a/docs/functions/chat/sendPlayerMessageToAll.md b/docs/functions/chat/sendPlayerMessageToAll.md new file mode 100644 index 0000000..a5ae015 --- /dev/null +++ b/docs/functions/chat/sendPlayerMessageToAll.md @@ -0,0 +1,2 @@ +# `function` sendPlayerMessageToAll +::: src.pyg2o.functions.chat.sendPlayerMessageToAll \ No newline at end of file diff --git a/docs/functions/chat/sendPlayerMessageToPlayer.md b/docs/functions/chat/sendPlayerMessageToPlayer.md new file mode 100644 index 0000000..1c51460 --- /dev/null +++ b/docs/functions/chat/sendPlayerMessageToPlayer.md @@ -0,0 +1,2 @@ +# `function` sendPlayerMessageToPlayer +::: src.pyg2o.functions.chat.sendPlayerMessageToPlayer \ No newline at end of file diff --git a/docs/functions/event/addEvent.md b/docs/functions/event/addEvent.md new file mode 100644 index 0000000..2be33d0 --- /dev/null +++ b/docs/functions/event/addEvent.md @@ -0,0 +1,2 @@ +# `function` addEvent +::: src.pyg2o.functions.event.addEvent \ No newline at end of file diff --git a/docs/functions/event/callEvent.md b/docs/functions/event/callEvent.md new file mode 100644 index 0000000..ce90251 --- /dev/null +++ b/docs/functions/event/callEvent.md @@ -0,0 +1,2 @@ +# `function` callEvent +::: src.pyg2o.functions.event.callEvent \ No newline at end of file diff --git a/docs/functions/event/event.md b/docs/functions/event/event.md new file mode 100644 index 0000000..d2abff5 --- /dev/null +++ b/docs/functions/event/event.md @@ -0,0 +1,2 @@ +# `function` event +::: src.pyg2o.functions.event.event \ No newline at end of file diff --git a/docs/functions/event/removeEvent.md b/docs/functions/event/removeEvent.md new file mode 100644 index 0000000..2a23e87 --- /dev/null +++ b/docs/functions/event/removeEvent.md @@ -0,0 +1,2 @@ +# `function` removeEvent +::: src.pyg2o.functions.event.removeEvent \ No newline at end of file diff --git a/docs/functions/event/removeEventHandler.md b/docs/functions/event/removeEventHandler.md new file mode 100644 index 0000000..2af917a --- /dev/null +++ b/docs/functions/event/removeEventHandler.md @@ -0,0 +1,2 @@ +# `function` removeEventHandler +::: src.pyg2o.functions.event.removeEventHandler \ No newline at end of file diff --git a/docs/functions/event/toggleEvent.md b/docs/functions/event/toggleEvent.md new file mode 100644 index 0000000..d734e0f --- /dev/null +++ b/docs/functions/event/toggleEvent.md @@ -0,0 +1,2 @@ +# `function` toggleEvent +::: src.pyg2o.functions.event.toggleEvent \ No newline at end of file diff --git a/docs/functions/game/exit.md b/docs/functions/game/exit.md new file mode 100644 index 0000000..63eb8a8 --- /dev/null +++ b/docs/functions/game/exit.md @@ -0,0 +1,2 @@ +# `function` exit +::: src.pyg2o.functions.game.exit \ No newline at end of file diff --git a/docs/functions/game/getDayLength.md b/docs/functions/game/getDayLength.md new file mode 100644 index 0000000..00c8ad6 --- /dev/null +++ b/docs/functions/game/getDayLength.md @@ -0,0 +1,2 @@ +# `function` getDayLength +::: src.pyg2o.functions.game.getDayLength \ No newline at end of file diff --git a/docs/functions/game/getHostname.md b/docs/functions/game/getHostname.md new file mode 100644 index 0000000..260f6a4 --- /dev/null +++ b/docs/functions/game/getHostname.md @@ -0,0 +1,2 @@ +# `function` getHostname +::: src.pyg2o.functions.game.getHostname \ No newline at end of file diff --git a/docs/functions/game/getMaxSlots.md b/docs/functions/game/getMaxSlots.md new file mode 100644 index 0000000..b5c1b46 --- /dev/null +++ b/docs/functions/game/getMaxSlots.md @@ -0,0 +1,2 @@ +# `function` getMaxSlots +::: src.pyg2o.functions.game.getMaxSlots \ No newline at end of file diff --git a/docs/functions/game/getPlayersCount.md b/docs/functions/game/getPlayersCount.md new file mode 100644 index 0000000..a7e193b --- /dev/null +++ b/docs/functions/game/getPlayersCount.md @@ -0,0 +1,2 @@ +# `function` getPlayersCount +::: src.pyg2o.functions.game.getPlayersCount \ No newline at end of file diff --git a/docs/functions/game/getServerDescription.md b/docs/functions/game/getServerDescription.md new file mode 100644 index 0000000..c2a91b7 --- /dev/null +++ b/docs/functions/game/getServerDescription.md @@ -0,0 +1,2 @@ +# `function` getServerDescription +::: src.pyg2o.functions.game.getServerDescription \ No newline at end of file diff --git a/docs/functions/game/getServerWorld.md b/docs/functions/game/getServerWorld.md new file mode 100644 index 0000000..20fcc7d --- /dev/null +++ b/docs/functions/game/getServerWorld.md @@ -0,0 +1,2 @@ +# `function` getServerWorld +::: src.pyg2o.functions.game.getServerWorld \ No newline at end of file diff --git a/docs/functions/game/getTime.md b/docs/functions/game/getTime.md new file mode 100644 index 0000000..c4e13c6 --- /dev/null +++ b/docs/functions/game/getTime.md @@ -0,0 +1,2 @@ +# `function` getTime +::: src.pyg2o.functions.game.getTime \ No newline at end of file diff --git a/docs/functions/game/serverLog.md b/docs/functions/game/serverLog.md new file mode 100644 index 0000000..99a9903 --- /dev/null +++ b/docs/functions/game/serverLog.md @@ -0,0 +1,2 @@ +# `function` serverLog +::: src.pyg2o.functions.game.serverLog \ No newline at end of file diff --git a/docs/functions/game/setDayLength.md b/docs/functions/game/setDayLength.md new file mode 100644 index 0000000..18cc6a4 --- /dev/null +++ b/docs/functions/game/setDayLength.md @@ -0,0 +1,2 @@ +# `function` setDayLength +::: src.pyg2o.functions.game.setDayLength \ No newline at end of file diff --git a/docs/functions/game/setServerDescription.md b/docs/functions/game/setServerDescription.md new file mode 100644 index 0000000..4613d6f --- /dev/null +++ b/docs/functions/game/setServerDescription.md @@ -0,0 +1,2 @@ +# `function` setServerDescription +::: src.pyg2o.functions.game.setServerDescription \ No newline at end of file diff --git a/docs/functions/game/setServerWorld.md b/docs/functions/game/setServerWorld.md new file mode 100644 index 0000000..60ecc11 --- /dev/null +++ b/docs/functions/game/setServerWorld.md @@ -0,0 +1,2 @@ +# `function` setServerWorld +::: src.pyg2o.functions.game.setServerWorld \ No newline at end of file diff --git a/docs/functions/game/setTime.md b/docs/functions/game/setTime.md new file mode 100644 index 0000000..0907d93 --- /dev/null +++ b/docs/functions/game/setTime.md @@ -0,0 +1,2 @@ +# `function` setTime +::: src.pyg2o.functions.game.setTime \ No newline at end of file diff --git a/docs/functions/npc/clearNpcActions.md b/docs/functions/npc/clearNpcActions.md new file mode 100644 index 0000000..4224d04 --- /dev/null +++ b/docs/functions/npc/clearNpcActions.md @@ -0,0 +1,2 @@ +# `function` clearNpcActions +::: src.pyg2o.functions.npc.clearNpcActions \ No newline at end of file diff --git a/docs/functions/npc/createNpc.md b/docs/functions/npc/createNpc.md new file mode 100644 index 0000000..eef6e58 --- /dev/null +++ b/docs/functions/npc/createNpc.md @@ -0,0 +1,2 @@ +# `function` createNpc +::: src.pyg2o.functions.npc.createNpc \ No newline at end of file diff --git a/docs/functions/npc/destroyNpc.md b/docs/functions/npc/destroyNpc.md new file mode 100644 index 0000000..105d618 --- /dev/null +++ b/docs/functions/npc/destroyNpc.md @@ -0,0 +1,2 @@ +# `function` destroyNpc +::: src.pyg2o.functions.npc.destroyNpc \ No newline at end of file diff --git a/docs/functions/npc/getNpcAction.md b/docs/functions/npc/getNpcAction.md new file mode 100644 index 0000000..3271f5b --- /dev/null +++ b/docs/functions/npc/getNpcAction.md @@ -0,0 +1,2 @@ +# `function` getNpcAction +::: src.pyg2o.functions.npc.getNpcAction \ No newline at end of file diff --git a/docs/functions/npc/getNpcActions.md b/docs/functions/npc/getNpcActions.md new file mode 100644 index 0000000..81480ab --- /dev/null +++ b/docs/functions/npc/getNpcActions.md @@ -0,0 +1,2 @@ +# `function` getNpcActions +::: src.pyg2o.functions.npc.getNpcActions \ No newline at end of file diff --git a/docs/functions/npc/getNpcActionsCount.md b/docs/functions/npc/getNpcActionsCount.md new file mode 100644 index 0000000..9f23287 --- /dev/null +++ b/docs/functions/npc/getNpcActionsCount.md @@ -0,0 +1,2 @@ +# `function` getNpcActionsCount +::: src.pyg2o.functions.npc.getNpcActionsCount \ No newline at end of file diff --git a/docs/functions/npc/getNpcHostPlayer.md b/docs/functions/npc/getNpcHostPlayer.md new file mode 100644 index 0000000..b4c5d84 --- /dev/null +++ b/docs/functions/npc/getNpcHostPlayer.md @@ -0,0 +1,2 @@ +# `function` getNpcHostPlayer +::: src.pyg2o.functions.npc.getNpcHostPlayer \ No newline at end of file diff --git a/docs/functions/npc/getNpcLastActionId.md b/docs/functions/npc/getNpcLastActionId.md new file mode 100644 index 0000000..0ab0cde --- /dev/null +++ b/docs/functions/npc/getNpcLastActionId.md @@ -0,0 +1,2 @@ +# `function` getNpcLastActionId +::: src.pyg2o.functions.npc.getNpcLastActionId \ No newline at end of file diff --git a/docs/functions/npc/isNpc.md b/docs/functions/npc/isNpc.md new file mode 100644 index 0000000..34939e2 --- /dev/null +++ b/docs/functions/npc/isNpc.md @@ -0,0 +1,2 @@ +# `function` isNpc +::: src.pyg2o.functions.npc.isNpc \ No newline at end of file diff --git a/docs/functions/npc/isNpcActionFinished.md b/docs/functions/npc/isNpcActionFinished.md new file mode 100644 index 0000000..c8f43b9 --- /dev/null +++ b/docs/functions/npc/isNpcActionFinished.md @@ -0,0 +1,2 @@ +# `function` isNpcActionFinished +::: src.pyg2o.functions.npc.isNpcActionFinished \ No newline at end of file diff --git a/docs/functions/npc/npcAttackMelee.md b/docs/functions/npc/npcAttackMelee.md new file mode 100644 index 0000000..2cb52df --- /dev/null +++ b/docs/functions/npc/npcAttackMelee.md @@ -0,0 +1,2 @@ +# `function` npcAttackMelee +::: src.pyg2o.functions.npc.npcAttackMelee \ No newline at end of file diff --git a/docs/functions/npc/npcAttackRanged.md b/docs/functions/npc/npcAttackRanged.md new file mode 100644 index 0000000..b3b751d --- /dev/null +++ b/docs/functions/npc/npcAttackRanged.md @@ -0,0 +1,2 @@ +# `function` npcAttackRanged +::: src.pyg2o.functions.npc.npcAttackRanged \ No newline at end of file diff --git a/docs/functions/npc/npcSpellCast.md b/docs/functions/npc/npcSpellCast.md new file mode 100644 index 0000000..2944f58 --- /dev/null +++ b/docs/functions/npc/npcSpellCast.md @@ -0,0 +1,2 @@ +# `function` npcSpellCast +::: src.pyg2o.functions.npc.npcSpellCast \ No newline at end of file diff --git a/docs/functions/npc/npcUseClosestMob.md b/docs/functions/npc/npcUseClosestMob.md new file mode 100644 index 0000000..7bb175a --- /dev/null +++ b/docs/functions/npc/npcUseClosestMob.md @@ -0,0 +1,2 @@ +# `function` npcUseClosestMob +::: src.pyg2o.functions.npc.npcUseClosestMob \ No newline at end of file diff --git a/docs/functions/npc/setNpcHostPlayer.md b/docs/functions/npc/setNpcHostPlayer.md new file mode 100644 index 0000000..038a3ed --- /dev/null +++ b/docs/functions/npc/setNpcHostPlayer.md @@ -0,0 +1,2 @@ +# `function` setNpcHostPlayer +::: src.pyg2o.functions.npc.setNpcHostPlayer \ No newline at end of file diff --git a/docs/functions/player/addBan.md b/docs/functions/player/addBan.md new file mode 100644 index 0000000..47b8910 --- /dev/null +++ b/docs/functions/player/addBan.md @@ -0,0 +1,2 @@ +#`function` addBan +::: src.pyg2o.functions.player.addBan \ No newline at end of file diff --git a/docs/functions/player/applyPlayerOverlay.md b/docs/functions/player/applyPlayerOverlay.md new file mode 100644 index 0000000..48a6524 --- /dev/null +++ b/docs/functions/player/applyPlayerOverlay.md @@ -0,0 +1,2 @@ +#`function` applyPlayerOverlay +::: src.pyg2o.functions.player.applyPlayerOverlay \ No newline at end of file diff --git a/docs/functions/player/ban.md b/docs/functions/player/ban.md new file mode 100644 index 0000000..30aafa1 --- /dev/null +++ b/docs/functions/player/ban.md @@ -0,0 +1,2 @@ +#`function` ban +::: src.pyg2o.functions.player.ban \ No newline at end of file diff --git a/docs/functions/player/drawWeapon.md b/docs/functions/player/drawWeapon.md new file mode 100644 index 0000000..9b0cd5c --- /dev/null +++ b/docs/functions/player/drawWeapon.md @@ -0,0 +1,2 @@ +#`function` drawWeapon +::: src.pyg2o.functions.player.drawWeapon \ No newline at end of file diff --git a/docs/functions/player/equipItem.md b/docs/functions/player/equipItem.md new file mode 100644 index 0000000..800a592 --- /dev/null +++ b/docs/functions/player/equipItem.md @@ -0,0 +1,2 @@ +#`function` equipItem +::: src.pyg2o.functions.player.equipItem \ No newline at end of file diff --git a/docs/functions/player/getPlayerAmulet.md b/docs/functions/player/getPlayerAmulet.md new file mode 100644 index 0000000..701e7dd --- /dev/null +++ b/docs/functions/player/getPlayerAmulet.md @@ -0,0 +1,2 @@ +#`function` getPlayerAmulet +::: src.pyg2o.functions.player.getPlayerAmulet \ No newline at end of file diff --git a/docs/functions/player/getPlayerAngle.md b/docs/functions/player/getPlayerAngle.md new file mode 100644 index 0000000..97011eb --- /dev/null +++ b/docs/functions/player/getPlayerAngle.md @@ -0,0 +1,2 @@ +#`function` getPlayerAngle +::: src.pyg2o.functions.player.getPlayerAngle \ No newline at end of file diff --git a/docs/functions/player/getPlayerAni.md b/docs/functions/player/getPlayerAni.md new file mode 100644 index 0000000..2354d68 --- /dev/null +++ b/docs/functions/player/getPlayerAni.md @@ -0,0 +1,2 @@ +#`function` getPlayerAni +::: src.pyg2o.functions.player.getPlayerAni \ No newline at end of file diff --git a/docs/functions/player/getPlayerArmor.md b/docs/functions/player/getPlayerArmor.md new file mode 100644 index 0000000..1e9de82 --- /dev/null +++ b/docs/functions/player/getPlayerArmor.md @@ -0,0 +1,2 @@ +#`function` getPlayerArmor +::: src.pyg2o.functions.player.getPlayerArmor \ No newline at end of file diff --git a/docs/functions/player/getPlayerAtVector.md b/docs/functions/player/getPlayerAtVector.md new file mode 100644 index 0000000..3b6e191 --- /dev/null +++ b/docs/functions/player/getPlayerAtVector.md @@ -0,0 +1,2 @@ +#`function` getPlayerAtVector +::: src.pyg2o.functions.player.getPlayerAtVector \ No newline at end of file diff --git a/docs/functions/player/getPlayerBelt.md b/docs/functions/player/getPlayerBelt.md new file mode 100644 index 0000000..76acbd1 --- /dev/null +++ b/docs/functions/player/getPlayerBelt.md @@ -0,0 +1,2 @@ +#`function` getPlayerBelt +::: src.pyg2o.functions.player.getPlayerBelt \ No newline at end of file diff --git a/docs/functions/player/getPlayerCameraPosition.md b/docs/functions/player/getPlayerCameraPosition.md new file mode 100644 index 0000000..42e8632 --- /dev/null +++ b/docs/functions/player/getPlayerCameraPosition.md @@ -0,0 +1,2 @@ +#`function` getPlayerCameraPosition +::: src.pyg2o.functions.player.getPlayerCameraPosition \ No newline at end of file diff --git a/docs/functions/player/getPlayerCollision.md b/docs/functions/player/getPlayerCollision.md new file mode 100644 index 0000000..6dd79a7 --- /dev/null +++ b/docs/functions/player/getPlayerCollision.md @@ -0,0 +1,2 @@ +#`function` getPlayerCollision +::: src.pyg2o.functions.player.getPlayerCollision \ No newline at end of file diff --git a/docs/functions/player/getPlayerColor.md b/docs/functions/player/getPlayerColor.md new file mode 100644 index 0000000..d86b523 --- /dev/null +++ b/docs/functions/player/getPlayerColor.md @@ -0,0 +1,2 @@ +#`function` getPlayerColor +::: src.pyg2o.functions.player.getPlayerColor \ No newline at end of file diff --git a/docs/functions/player/getPlayerContext.md b/docs/functions/player/getPlayerContext.md new file mode 100644 index 0000000..39a6d1c --- /dev/null +++ b/docs/functions/player/getPlayerContext.md @@ -0,0 +1,2 @@ +#`function` getPlayerContext +::: src.pyg2o.functions.player.getPlayerContext \ No newline at end of file diff --git a/docs/functions/player/getPlayerDexterity.md b/docs/functions/player/getPlayerDexterity.md new file mode 100644 index 0000000..40d9471 --- /dev/null +++ b/docs/functions/player/getPlayerDexterity.md @@ -0,0 +1,2 @@ +#`function` getPlayerDexterity +::: src.pyg2o.functions.player.getPlayerDexterity \ No newline at end of file diff --git a/docs/functions/player/getPlayerFaceAnis.md b/docs/functions/player/getPlayerFaceAnis.md new file mode 100644 index 0000000..df0295b --- /dev/null +++ b/docs/functions/player/getPlayerFaceAnis.md @@ -0,0 +1,2 @@ +#`function` getPlayerFaceAnis +::: src.pyg2o.functions.player.getPlayerFaceAnis \ No newline at end of file diff --git a/docs/functions/player/getPlayerFatness.md b/docs/functions/player/getPlayerFatness.md new file mode 100644 index 0000000..6b2f95e --- /dev/null +++ b/docs/functions/player/getPlayerFatness.md @@ -0,0 +1,2 @@ +#`function` getPlayerFatness +::: src.pyg2o.functions.player.getPlayerFatness \ No newline at end of file diff --git a/docs/functions/player/getPlayerFocus.md b/docs/functions/player/getPlayerFocus.md new file mode 100644 index 0000000..27d572a --- /dev/null +++ b/docs/functions/player/getPlayerFocus.md @@ -0,0 +1,2 @@ +#`function` getPlayerFocus +::: src.pyg2o.functions.player.getPlayerFocus \ No newline at end of file diff --git a/docs/functions/player/getPlayerHealth.md b/docs/functions/player/getPlayerHealth.md new file mode 100644 index 0000000..340b6c0 --- /dev/null +++ b/docs/functions/player/getPlayerHealth.md @@ -0,0 +1,2 @@ +#`function` getPlayerHealth +::: src.pyg2o.functions.player.getPlayerHealth \ No newline at end of file diff --git a/docs/functions/player/getPlayerHelmet.md b/docs/functions/player/getPlayerHelmet.md new file mode 100644 index 0000000..afcfd9e --- /dev/null +++ b/docs/functions/player/getPlayerHelmet.md @@ -0,0 +1,2 @@ +#`function` getPlayerHelmet +::: src.pyg2o.functions.player.getPlayerHelmet \ No newline at end of file diff --git a/docs/functions/player/getPlayerIP.md b/docs/functions/player/getPlayerIP.md new file mode 100644 index 0000000..9b7e7d8 --- /dev/null +++ b/docs/functions/player/getPlayerIP.md @@ -0,0 +1,2 @@ +#`function` getPlayerIP +::: src.pyg2o.functions.player.getPlayerIP \ No newline at end of file diff --git a/docs/functions/player/getPlayerInstance.md b/docs/functions/player/getPlayerInstance.md new file mode 100644 index 0000000..a6a65ad --- /dev/null +++ b/docs/functions/player/getPlayerInstance.md @@ -0,0 +1,2 @@ +#`function` getPlayerInstance +::: src.pyg2o.functions.player.getPlayerInstance \ No newline at end of file diff --git a/docs/functions/player/getPlayerInvisible.md b/docs/functions/player/getPlayerInvisible.md new file mode 100644 index 0000000..6743e74 --- /dev/null +++ b/docs/functions/player/getPlayerInvisible.md @@ -0,0 +1,2 @@ +#`function` getPlayerInvisible +::: src.pyg2o.functions.player.getPlayerInvisible \ No newline at end of file diff --git a/docs/functions/player/getPlayerMacAddr.md b/docs/functions/player/getPlayerMacAddr.md new file mode 100644 index 0000000..b7d5f40 --- /dev/null +++ b/docs/functions/player/getPlayerMacAddr.md @@ -0,0 +1,2 @@ +#`function` getPlayerMacAddr +::: src.pyg2o.functions.player.getPlayerMacAddr \ No newline at end of file diff --git a/docs/functions/player/getPlayerMana.md b/docs/functions/player/getPlayerMana.md new file mode 100644 index 0000000..905d716 --- /dev/null +++ b/docs/functions/player/getPlayerMana.md @@ -0,0 +1,2 @@ +#`function` getPlayerMana +::: src.pyg2o.functions.player.getPlayerMana \ No newline at end of file diff --git a/docs/functions/player/getPlayerMaxHealth.md b/docs/functions/player/getPlayerMaxHealth.md new file mode 100644 index 0000000..05bdae7 --- /dev/null +++ b/docs/functions/player/getPlayerMaxHealth.md @@ -0,0 +1,2 @@ +#`function` getPlayerMaxHealth +::: src.pyg2o.functions.player.getPlayerMaxHealth \ No newline at end of file diff --git a/docs/functions/player/getPlayerMaxMana.md b/docs/functions/player/getPlayerMaxMana.md new file mode 100644 index 0000000..13626ad --- /dev/null +++ b/docs/functions/player/getPlayerMaxMana.md @@ -0,0 +1,2 @@ +#`function` getPlayerMaxMana +::: src.pyg2o.functions.player.getPlayerMaxMana \ No newline at end of file diff --git a/docs/functions/player/getPlayerMeleeWeapon.md b/docs/functions/player/getPlayerMeleeWeapon.md new file mode 100644 index 0000000..a8da63d --- /dev/null +++ b/docs/functions/player/getPlayerMeleeWeapon.md @@ -0,0 +1,2 @@ +#`function` getPlayerMeleeWeapon +::: src.pyg2o.functions.player.getPlayerMeleeWeapon \ No newline at end of file diff --git a/docs/functions/player/getPlayerName.md b/docs/functions/player/getPlayerName.md new file mode 100644 index 0000000..f02c11b --- /dev/null +++ b/docs/functions/player/getPlayerName.md @@ -0,0 +1,2 @@ +#`function` getPlayerName +::: src.pyg2o.functions.player.getPlayerName \ No newline at end of file diff --git a/docs/functions/player/getPlayerPing.md b/docs/functions/player/getPlayerPing.md new file mode 100644 index 0000000..fddcd4a --- /dev/null +++ b/docs/functions/player/getPlayerPing.md @@ -0,0 +1,2 @@ +#`function` getPlayerPing +::: src.pyg2o.functions.player.getPlayerPing \ No newline at end of file diff --git a/docs/functions/player/getPlayerPosition.md b/docs/functions/player/getPlayerPosition.md new file mode 100644 index 0000000..bc6fd3f --- /dev/null +++ b/docs/functions/player/getPlayerPosition.md @@ -0,0 +1,2 @@ +#`function` getPlayerPosition +::: src.pyg2o.functions.player.getPlayerPosition \ No newline at end of file diff --git a/docs/functions/player/getPlayerRangedWeapon.md b/docs/functions/player/getPlayerRangedWeapon.md new file mode 100644 index 0000000..f8657af --- /dev/null +++ b/docs/functions/player/getPlayerRangedWeapon.md @@ -0,0 +1,2 @@ +#`function` getPlayerRangedWeapon +::: src.pyg2o.functions.player.getPlayerRangedWeapon \ No newline at end of file diff --git a/docs/functions/player/getPlayerRespawnTime.md b/docs/functions/player/getPlayerRespawnTime.md new file mode 100644 index 0000000..701339a --- /dev/null +++ b/docs/functions/player/getPlayerRespawnTime.md @@ -0,0 +1,2 @@ +#`function` getPlayerRespawnTime +::: src.pyg2o.functions.player.getPlayerRespawnTime \ No newline at end of file diff --git a/docs/functions/player/getPlayerRing.md b/docs/functions/player/getPlayerRing.md new file mode 100644 index 0000000..5ada2c3 --- /dev/null +++ b/docs/functions/player/getPlayerRing.md @@ -0,0 +1,2 @@ +#`function` getPlayerRing +::: src.pyg2o.functions.player.getPlayerRing \ No newline at end of file diff --git a/docs/functions/player/getPlayerScale.md b/docs/functions/player/getPlayerScale.md new file mode 100644 index 0000000..688cdde --- /dev/null +++ b/docs/functions/player/getPlayerScale.md @@ -0,0 +1,2 @@ +#`function` getPlayerScale +::: src.pyg2o.functions.player.getPlayerScale \ No newline at end of file diff --git a/docs/functions/player/getPlayerSerial.md b/docs/functions/player/getPlayerSerial.md new file mode 100644 index 0000000..70fe4cb --- /dev/null +++ b/docs/functions/player/getPlayerSerial.md @@ -0,0 +1,2 @@ +#`function` getPlayerSerial +::: src.pyg2o.functions.player.getPlayerSerial \ No newline at end of file diff --git a/docs/functions/player/getPlayerShield.md b/docs/functions/player/getPlayerShield.md new file mode 100644 index 0000000..2847a44 --- /dev/null +++ b/docs/functions/player/getPlayerShield.md @@ -0,0 +1,2 @@ +#`function` getPlayerShield +::: src.pyg2o.functions.player.getPlayerShield \ No newline at end of file diff --git a/docs/functions/player/getPlayerSkillWeapon.md b/docs/functions/player/getPlayerSkillWeapon.md new file mode 100644 index 0000000..b2efb92 --- /dev/null +++ b/docs/functions/player/getPlayerSkillWeapon.md @@ -0,0 +1,2 @@ +#`function` getPlayerSkillWeapon +::: src.pyg2o.functions.player.getPlayerSkillWeapon \ No newline at end of file diff --git a/docs/functions/player/getPlayerSpell.md b/docs/functions/player/getPlayerSpell.md new file mode 100644 index 0000000..48ff84d --- /dev/null +++ b/docs/functions/player/getPlayerSpell.md @@ -0,0 +1,2 @@ +#`function` getPlayerSpell +::: src.pyg2o.functions.player.getPlayerSpell \ No newline at end of file diff --git a/docs/functions/player/getPlayerStrength.md b/docs/functions/player/getPlayerStrength.md new file mode 100644 index 0000000..6de5b44 --- /dev/null +++ b/docs/functions/player/getPlayerStrength.md @@ -0,0 +1,2 @@ +#`function` getPlayerStrength +::: src.pyg2o.functions.player.getPlayerStrength \ No newline at end of file diff --git a/docs/functions/player/getPlayerTalent.md b/docs/functions/player/getPlayerTalent.md new file mode 100644 index 0000000..2c2e056 --- /dev/null +++ b/docs/functions/player/getPlayerTalent.md @@ -0,0 +1,2 @@ +#`function` getPlayerTalent +::: src.pyg2o.functions.player.getPlayerTalent \ No newline at end of file diff --git a/docs/functions/player/getPlayerUID.md b/docs/functions/player/getPlayerUID.md new file mode 100644 index 0000000..0684e17 --- /dev/null +++ b/docs/functions/player/getPlayerUID.md @@ -0,0 +1,2 @@ +#`function` getPlayerUID +::: src.pyg2o.functions.player.getPlayerUID \ No newline at end of file diff --git a/docs/functions/player/getPlayerVirtualWorld.md b/docs/functions/player/getPlayerVirtualWorld.md new file mode 100644 index 0000000..9bf90d5 --- /dev/null +++ b/docs/functions/player/getPlayerVirtualWorld.md @@ -0,0 +1,2 @@ +#`function` getPlayerVirtualWorld +::: src.pyg2o.functions.player.getPlayerVirtualWorld \ No newline at end of file diff --git a/python/docs/functions/player/unreadySpell.md b/docs/functions/player/getPlayerVisual.md similarity index 50% rename from python/docs/functions/player/unreadySpell.md rename to docs/functions/player/getPlayerVisual.md index af8a8aa..ef1f6f1 100644 --- a/python/docs/functions/player/unreadySpell.md +++ b/docs/functions/player/getPlayerVisual.md @@ -1,2 +1,2 @@ -#`function` unreadySpell -::: g2o.functions.player.unreadySpell \ No newline at end of file +#`function` getPlayerVisual +::: src.pyg2o.functions.player.getPlayerVisual \ No newline at end of file diff --git a/docs/functions/player/getPlayerWeaponMode.md b/docs/functions/player/getPlayerWeaponMode.md new file mode 100644 index 0000000..6db2404 --- /dev/null +++ b/docs/functions/player/getPlayerWeaponMode.md @@ -0,0 +1,2 @@ +#`function` getPlayerWeaponMode +::: src.pyg2o.functions.player.getPlayerWeaponMode \ No newline at end of file diff --git a/docs/functions/player/getPlayerWorld.md b/docs/functions/player/getPlayerWorld.md new file mode 100644 index 0000000..cf7b11b --- /dev/null +++ b/docs/functions/player/getPlayerWorld.md @@ -0,0 +1,2 @@ +#`function` getPlayerWorld +::: src.pyg2o.functions.player.getPlayerWorld \ No newline at end of file diff --git a/docs/functions/player/giveItem.md b/docs/functions/player/giveItem.md new file mode 100644 index 0000000..4f84e28 --- /dev/null +++ b/docs/functions/player/giveItem.md @@ -0,0 +1,2 @@ +#`function` giveItem +::: src.pyg2o.functions.player.giveItem \ No newline at end of file diff --git a/docs/functions/player/hitPlayer.md b/docs/functions/player/hitPlayer.md new file mode 100644 index 0000000..ff92919 --- /dev/null +++ b/docs/functions/player/hitPlayer.md @@ -0,0 +1,2 @@ +#`function` hitPlayer +::: src.pyg2o.functions.player.hitPlayer \ No newline at end of file diff --git a/docs/functions/player/isPlayerConnected.md b/docs/functions/player/isPlayerConnected.md new file mode 100644 index 0000000..ac85b41 --- /dev/null +++ b/docs/functions/player/isPlayerConnected.md @@ -0,0 +1,2 @@ +#`function` isPlayerConnected +::: src.pyg2o.functions.player.isPlayerConnected \ No newline at end of file diff --git a/docs/functions/player/isPlayerDead.md b/docs/functions/player/isPlayerDead.md new file mode 100644 index 0000000..b3d2d0f --- /dev/null +++ b/docs/functions/player/isPlayerDead.md @@ -0,0 +1,2 @@ +#`function` isPlayerDead +::: src.pyg2o.functions.player.isPlayerDead \ No newline at end of file diff --git a/docs/functions/player/isPlayerSpawned.md b/docs/functions/player/isPlayerSpawned.md new file mode 100644 index 0000000..4c90a52 --- /dev/null +++ b/docs/functions/player/isPlayerSpawned.md @@ -0,0 +1,2 @@ +#`function` isPlayerSpawned +::: src.pyg2o.functions.player.isPlayerSpawned \ No newline at end of file diff --git a/docs/functions/player/isPlayerUnconscious.md b/docs/functions/player/isPlayerUnconscious.md new file mode 100644 index 0000000..f39ded9 --- /dev/null +++ b/docs/functions/player/isPlayerUnconscious.md @@ -0,0 +1,2 @@ +#`function` isPlayerUnconscious +::: src.pyg2o.functions.player.isPlayerUnconscious \ No newline at end of file diff --git a/docs/functions/player/kick.md b/docs/functions/player/kick.md new file mode 100644 index 0000000..3e80c57 --- /dev/null +++ b/docs/functions/player/kick.md @@ -0,0 +1,2 @@ +#`function` kick +::: src.pyg2o.functions.player.kick \ No newline at end of file diff --git a/docs/functions/player/playAni.md b/docs/functions/player/playAni.md new file mode 100644 index 0000000..2fb4be1 --- /dev/null +++ b/docs/functions/player/playAni.md @@ -0,0 +1,2 @@ +#`function` playAni +::: src.pyg2o.functions.player.playAni \ No newline at end of file diff --git a/docs/functions/player/playFaceAni.md b/docs/functions/player/playFaceAni.md new file mode 100644 index 0000000..f4546fe --- /dev/null +++ b/docs/functions/player/playFaceAni.md @@ -0,0 +1,2 @@ +#`function` playFaceAni +::: src.pyg2o.functions.player.playFaceAni \ No newline at end of file diff --git a/docs/functions/player/readySpell.md b/docs/functions/player/readySpell.md new file mode 100644 index 0000000..62fb8b1 --- /dev/null +++ b/docs/functions/player/readySpell.md @@ -0,0 +1,2 @@ +#`function` readySpell +::: src.pyg2o.functions.player.readySpell \ No newline at end of file diff --git a/docs/functions/player/removeItem.md b/docs/functions/player/removeItem.md new file mode 100644 index 0000000..ee1d942 --- /dev/null +++ b/docs/functions/player/removeItem.md @@ -0,0 +1,2 @@ +#`function` removeItem +::: src.pyg2o.functions.player.removeItem \ No newline at end of file diff --git a/docs/functions/player/removePlayerOverlay.md b/docs/functions/player/removePlayerOverlay.md new file mode 100644 index 0000000..d97725c --- /dev/null +++ b/docs/functions/player/removePlayerOverlay.md @@ -0,0 +1,2 @@ +#`function` removePlayerOverlay +::: src.pyg2o.functions.player.removePlayerOverlay \ No newline at end of file diff --git a/docs/functions/player/removeWeapon.md b/docs/functions/player/removeWeapon.md new file mode 100644 index 0000000..ac89432 --- /dev/null +++ b/docs/functions/player/removeWeapon.md @@ -0,0 +1,2 @@ +#`function` removeWeapon +::: src.pyg2o.functions.player.removeWeapon \ No newline at end of file diff --git a/docs/functions/player/setPlayerAngle.md b/docs/functions/player/setPlayerAngle.md new file mode 100644 index 0000000..0dcb0c7 --- /dev/null +++ b/docs/functions/player/setPlayerAngle.md @@ -0,0 +1,2 @@ +#`function` setPlayerAngle +::: src.pyg2o.functions.player.setPlayerAngle \ No newline at end of file diff --git a/docs/functions/player/setPlayerCollision.md b/docs/functions/player/setPlayerCollision.md new file mode 100644 index 0000000..9de559b --- /dev/null +++ b/docs/functions/player/setPlayerCollision.md @@ -0,0 +1,2 @@ +#`function` setPlayerCollision +::: src.pyg2o.functions.player.setPlayerCollision \ No newline at end of file diff --git a/docs/functions/player/setPlayerColor.md b/docs/functions/player/setPlayerColor.md new file mode 100644 index 0000000..9dc9397 --- /dev/null +++ b/docs/functions/player/setPlayerColor.md @@ -0,0 +1,2 @@ +#`function` setPlayerColor +::: src.pyg2o.functions.player.setPlayerColor \ No newline at end of file diff --git a/docs/functions/player/setPlayerDexterity.md b/docs/functions/player/setPlayerDexterity.md new file mode 100644 index 0000000..e838ead --- /dev/null +++ b/docs/functions/player/setPlayerDexterity.md @@ -0,0 +1,2 @@ +#`function` setPlayerDexterity +::: src.pyg2o.functions.player.setPlayerDexterity \ No newline at end of file diff --git a/docs/functions/player/setPlayerFatness.md b/docs/functions/player/setPlayerFatness.md new file mode 100644 index 0000000..edc0a41 --- /dev/null +++ b/docs/functions/player/setPlayerFatness.md @@ -0,0 +1,2 @@ +#`function` setPlayerFatness +::: src.pyg2o.functions.player.setPlayerFatness \ No newline at end of file diff --git a/docs/functions/player/setPlayerHealth.md b/docs/functions/player/setPlayerHealth.md new file mode 100644 index 0000000..6641a8c --- /dev/null +++ b/docs/functions/player/setPlayerHealth.md @@ -0,0 +1,2 @@ +#`function` setPlayerHealth +::: src.pyg2o.functions.player.setPlayerHealth \ No newline at end of file diff --git a/docs/functions/player/setPlayerInstance.md b/docs/functions/player/setPlayerInstance.md new file mode 100644 index 0000000..9339968 --- /dev/null +++ b/docs/functions/player/setPlayerInstance.md @@ -0,0 +1,2 @@ +#`function` setPlayerInstance +::: src.pyg2o.functions.player.setPlayerInstance \ No newline at end of file diff --git a/docs/functions/player/setPlayerInvisible.md b/docs/functions/player/setPlayerInvisible.md new file mode 100644 index 0000000..d9b4c70 --- /dev/null +++ b/docs/functions/player/setPlayerInvisible.md @@ -0,0 +1,2 @@ +#`function` setPlayerInvisible +::: src.pyg2o.functions.player.setPlayerInvisible \ No newline at end of file diff --git a/docs/functions/player/setPlayerMana.md b/docs/functions/player/setPlayerMana.md new file mode 100644 index 0000000..8034911 --- /dev/null +++ b/docs/functions/player/setPlayerMana.md @@ -0,0 +1,2 @@ +#`function` setPlayerMana +::: src.pyg2o.functions.player.setPlayerMana \ No newline at end of file diff --git a/docs/functions/player/setPlayerMaxHealth.md b/docs/functions/player/setPlayerMaxHealth.md new file mode 100644 index 0000000..0a6c7c8 --- /dev/null +++ b/docs/functions/player/setPlayerMaxHealth.md @@ -0,0 +1,2 @@ +#`function` setPlayerMaxHealth +::: src.pyg2o.functions.player.setPlayerMaxHealth \ No newline at end of file diff --git a/docs/functions/player/setPlayerMaxMana.md b/docs/functions/player/setPlayerMaxMana.md new file mode 100644 index 0000000..c13bc48 --- /dev/null +++ b/docs/functions/player/setPlayerMaxMana.md @@ -0,0 +1,2 @@ +#`function` setPlayerMaxMana +::: src.pyg2o.functions.player.setPlayerMaxMana \ No newline at end of file diff --git a/docs/functions/player/setPlayerName.md b/docs/functions/player/setPlayerName.md new file mode 100644 index 0000000..ca0279f --- /dev/null +++ b/docs/functions/player/setPlayerName.md @@ -0,0 +1,2 @@ +#`function` setPlayerName +::: src.pyg2o.functions.player.setPlayerName \ No newline at end of file diff --git a/docs/functions/player/setPlayerRespawnTime.md b/docs/functions/player/setPlayerRespawnTime.md new file mode 100644 index 0000000..940c484 --- /dev/null +++ b/docs/functions/player/setPlayerRespawnTime.md @@ -0,0 +1,2 @@ +#`function` setPlayerRespawnTime +::: src.pyg2o.functions.player.setPlayerRespawnTime \ No newline at end of file diff --git a/docs/functions/player/setPlayerScale.md b/docs/functions/player/setPlayerScale.md new file mode 100644 index 0000000..faad1a3 --- /dev/null +++ b/docs/functions/player/setPlayerScale.md @@ -0,0 +1,2 @@ +#`function` setPlayerScale +::: src.pyg2o.functions.player.setPlayerScale \ No newline at end of file diff --git a/docs/functions/player/setPlayerSkillWeapon.md b/docs/functions/player/setPlayerSkillWeapon.md new file mode 100644 index 0000000..ea04299 --- /dev/null +++ b/docs/functions/player/setPlayerSkillWeapon.md @@ -0,0 +1,2 @@ +#`function` setPlayerSkillWeapon +::: src.pyg2o.functions.player.setPlayerSkillWeapon \ No newline at end of file diff --git a/docs/functions/player/setPlayerStrength.md b/docs/functions/player/setPlayerStrength.md new file mode 100644 index 0000000..63edfde --- /dev/null +++ b/docs/functions/player/setPlayerStrength.md @@ -0,0 +1,2 @@ +#`function` setPlayerStrength +::: src.pyg2o.functions.player.setPlayerStrength \ No newline at end of file diff --git a/docs/functions/player/setPlayerTalent.md b/docs/functions/player/setPlayerTalent.md new file mode 100644 index 0000000..79fce76 --- /dev/null +++ b/docs/functions/player/setPlayerTalent.md @@ -0,0 +1,2 @@ +#`function` setPlayerTalent +::: src.pyg2o.functions.player.setPlayerTalent \ No newline at end of file diff --git a/docs/functions/player/setPlayerVirtualWorld.md b/docs/functions/player/setPlayerVirtualWorld.md new file mode 100644 index 0000000..3eb85b3 --- /dev/null +++ b/docs/functions/player/setPlayerVirtualWorld.md @@ -0,0 +1,2 @@ +#`function` setPlayerVirtualWorld +::: src.pyg2o.functions.player.setPlayerVirtualWorld \ No newline at end of file diff --git a/docs/functions/player/setPlayerVisual.md b/docs/functions/player/setPlayerVisual.md new file mode 100644 index 0000000..332bb0d --- /dev/null +++ b/docs/functions/player/setPlayerVisual.md @@ -0,0 +1,2 @@ +#`function` setPlayerVisual +::: src.pyg2o.functions.player.setPlayerVisual \ No newline at end of file diff --git a/docs/functions/player/setPlayerWeaponMode.md b/docs/functions/player/setPlayerWeaponMode.md new file mode 100644 index 0000000..c71421e --- /dev/null +++ b/docs/functions/player/setPlayerWeaponMode.md @@ -0,0 +1,2 @@ +#`function` setPlayerWeaponMode +::: src.pyg2o.functions.player.setPlayerWeaponMode \ No newline at end of file diff --git a/docs/functions/player/setPlayerWorld.md b/docs/functions/player/setPlayerWorld.md new file mode 100644 index 0000000..1ed2106 --- /dev/null +++ b/docs/functions/player/setPlayerWorld.md @@ -0,0 +1,2 @@ +#`function` setPlayerWorld +::: src.pyg2o.functions.player.setPlayerWorld \ No newline at end of file diff --git a/docs/functions/player/spawnPlayer.md b/docs/functions/player/spawnPlayer.md new file mode 100644 index 0000000..2b469f9 --- /dev/null +++ b/docs/functions/player/spawnPlayer.md @@ -0,0 +1,2 @@ +#`function` spawnPlayer +::: src.pyg2o.functions.player.spawnPlayer \ No newline at end of file diff --git a/docs/functions/player/stopAni.md b/docs/functions/player/stopAni.md new file mode 100644 index 0000000..972354a --- /dev/null +++ b/docs/functions/player/stopAni.md @@ -0,0 +1,2 @@ +#`function` stopAni +::: src.pyg2o.functions.player.stopAni \ No newline at end of file diff --git a/docs/functions/player/stopFaceAni.md b/docs/functions/player/stopFaceAni.md new file mode 100644 index 0000000..bad90cd --- /dev/null +++ b/docs/functions/player/stopFaceAni.md @@ -0,0 +1,2 @@ +#`function` stopFaceAni +::: src.pyg2o.functions.player.stopFaceAni \ No newline at end of file diff --git a/docs/functions/player/unequipItem.md b/docs/functions/player/unequipItem.md new file mode 100644 index 0000000..ad4b195 --- /dev/null +++ b/docs/functions/player/unequipItem.md @@ -0,0 +1,2 @@ +#`function` unequipItem +::: src.pyg2o.functions.player.unequipItem \ No newline at end of file diff --git a/docs/functions/player/unreadySpell.md b/docs/functions/player/unreadySpell.md new file mode 100644 index 0000000..02c13ab --- /dev/null +++ b/docs/functions/player/unreadySpell.md @@ -0,0 +1,2 @@ +#`function` unreadySpell +::: src.pyg2o.functions.player.unreadySpell \ No newline at end of file diff --git a/docs/functions/player/unspawnPlayer.md b/docs/functions/player/unspawnPlayer.md new file mode 100644 index 0000000..3d8484d --- /dev/null +++ b/docs/functions/player/unspawnPlayer.md @@ -0,0 +1,2 @@ +#`function` unspawnPlayer +::: src.pyg2o.functions.player.unspawnPlayer \ No newline at end of file diff --git a/docs/functions/player/useItem.md b/docs/functions/player/useItem.md new file mode 100644 index 0000000..d0eb9ab --- /dev/null +++ b/docs/functions/player/useItem.md @@ -0,0 +1,2 @@ +#`function` useItem +::: src.pyg2o.functions.player.useItem \ No newline at end of file diff --git a/docs/functions/player/useItemToState.md b/docs/functions/player/useItemToState.md new file mode 100644 index 0000000..619bd9d --- /dev/null +++ b/docs/functions/player/useItemToState.md @@ -0,0 +1,2 @@ +#`function` useItemToState +::: src.pyg2o.functions.player.useItemToState \ No newline at end of file diff --git a/docs/functions/streamer/findNearbyPlayers.md b/docs/functions/streamer/findNearbyPlayers.md new file mode 100644 index 0000000..9f93d59 --- /dev/null +++ b/docs/functions/streamer/findNearbyPlayers.md @@ -0,0 +1,2 @@ +#`function` findNearbyPlayers +::: src.pyg2o.functions.streamer.findNearbyPlayers \ No newline at end of file diff --git a/docs/functions/streamer/getSpawnedPlayersForPlayer.md b/docs/functions/streamer/getSpawnedPlayersForPlayer.md new file mode 100644 index 0000000..2e12592 --- /dev/null +++ b/docs/functions/streamer/getSpawnedPlayersForPlayer.md @@ -0,0 +1,2 @@ +#`function` getSpawnedPlayersForPlayer +::: src.pyg2o.functions.streamer.getSpawnedPlayersForPlayer \ No newline at end of file diff --git a/docs/functions/streamer/getStreamedPlayersByPlayer.md b/docs/functions/streamer/getStreamedPlayersByPlayer.md new file mode 100644 index 0000000..d30494d --- /dev/null +++ b/docs/functions/streamer/getStreamedPlayersByPlayer.md @@ -0,0 +1,2 @@ +#`function` getStreamedPlayersByPlayer +::: src.pyg2o.functions.streamer.getStreamedPlayersByPlayer \ No newline at end of file diff --git a/docs/functions/waypoint/getNearestWaypoint.md b/docs/functions/waypoint/getNearestWaypoint.md new file mode 100644 index 0000000..0812790 --- /dev/null +++ b/docs/functions/waypoint/getNearestWaypoint.md @@ -0,0 +1,2 @@ +#`function` getNearestWaypoint +::: src.pyg2o.functions.waypoint.getNearestWaypoint \ No newline at end of file diff --git a/docs/functions/waypoint/getWaypoint.md b/docs/functions/waypoint/getWaypoint.md new file mode 100644 index 0000000..1a93388 --- /dev/null +++ b/docs/functions/waypoint/getWaypoint.md @@ -0,0 +1,2 @@ +#`function` getWaypoint +::: src.pyg2o.functions.waypoint.getWaypoint \ No newline at end of file diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..23c9316 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,45 @@ +## How to use +1. Install [G2O WebSocket module](https://github.com/AURUMVORXX/G2O-WebSocket) to your server +1. Download **include/** folder and import the Squirrel part of the library: +```xml + +``` +2. Install python library to your application +``` +pip install git+https://github.com/AURUMVORXX/PyG2O.git +``` +3. Launch websocket client in your Squirrel scripts +``` +// PyG2O_Start(url, reconnect, silent) +// reconnect - auto reconnect if server stopped +// silent - disable information prints + +// Start server before any events +PyG2O_Start("ws://localhost:8080", true, false) + +addEventHandler("onInit"... +``` +4. In your application, launch asyncio event loop and websocket server +```python +import pyg2o +import asyncio + +srv = None + +async def main(): + global srv + srv = pyg2o.PythonWebsocketServer( + host='localhost', + port=8080, + ping_interval=30, + silent=False, + whitelist=['::1'], + ) + try: + await srv.start() + except asyncio.CancelledError: + await srv.stop() + +if __name__ == '__main__': + asyncio.run(main()) +``` \ No newline at end of file diff --git a/python/docs/qna.md b/docs/qna.md similarity index 100% rename from python/docs/qna.md rename to docs/qna.md diff --git a/include/events.nut b/include/events.nut new file mode 100644 index 0000000..24e8c6d --- /dev/null +++ b/include/events.nut @@ -0,0 +1,626 @@ + +addEventHandler("onPlayerUseCheat", function(playerid, type) +{ + local data = { + event = "onPlayerUseCheat", + args = { + playerid = playerid, + type = type + } + } + + _PyG2O_Send(data); +}); + +addEventHandler("onBan", function(banInfo) +{ + local data = { + event = "onBan", + args = { + ban = { + mac = "mac" in banInfo ? banInfo["mac"] : "-1", + ip = "ip" in banInfo ? banInfo["ip"] : "-1", + serial = "serial" in banInfo ? banInfo["serial"] : "-1", + name = "name" in banInfo ? banInfo["name"] : "-1", + timestamp = "timestamp" in banInfo ? banInfo["timestamp"] : -1 + } + } + } + + _PyG2O_Send(data); +}); + +addEventHandler("onInit", function() +{ + local data = { + event = "onInit", + args = {} + } + + _PyG2O_Send(data); +}); + +addEventHandler("onExit", function() +{ + local data = { + event = "onExit", + args = {} + } + + _PyG2O_Send(data); +}); + +addEventHandler("onTick", function() +{ + local data = { + event = "onTick", + args = {} + } + + _PyG2O_Send(data); +}); + +addEventHandler("onTime", function(day, hour, min) +{ + local data = { + event = "onTime", + args = { + day = day, + hour = hour, + min = min, + } + } + + _PyG2O_Send(data); +}); + +addEventHandler("onUnban", function(banInfo) +{ + local data = { + event = "onUnban", + args = { + ban = { + mac = "mac" in banInfo ? banInfo["mac"] : "-1", + ip = "ip" in banInfo ? banInfo["ip"] : "-1", + serial = "serial" in banInfo ? banInfo["serial"] : "-1", + name = "name" in banInfo ? banInfo["name"] : "-1", + timestamp = "timestamp" in banInfo ? banInfo["timestamp"] : -1 + } + } + } + + _PyG2O_Send(data); +}); + +addEventHandler("onNpcActionFinished", function(npc_id, action_type, action_id, result) +{ + local data = { + event = "onNpcActionFinished", + args = { + npc_id = npc_id, + action_type = action_type, + action_id = action_id, + result = result + } + } + + _PyG2O_Send(data); +}); + +addEventHandler("onNpcActionSent", function(npc_id, action_type, action_id) +{ + local data = { + event = "onNpcActionSent", + args = { + npc_id = npc_id, + action_type = action_type, + action_id = action_id, + } + } + + _PyG2O_Send(data); +}); + +addEventHandler("onNpcChangeHostPlayer", function(npc_id, current_id, previous_id) +{ + local data = { + event = "onNpcChangeHostPlayer", + args = { + npc_id = npc_id, + current_id = current_id, + previous_id = previous_id + } + } + + _PyG2O_Send(data); +}); + +addEventHandler("onNpcCreated", function(npc_id) +{ + local data = { + event = "onNpcCreated", + args = { + npc_id = npc_id + } + } + + _PyG2O_Send(data); +}); + +addEventHandler("onNpcDestroyed", function(npc_id) +{ + local data = { + event = "onNpcDestroyed", + args = { + npc_id = npc_id + } + } + + _PyG2O_Send(data); +}); + +addEventHandler("onPlayerChangeColor", function(playerid, r, g, b) +{ + local data = { + event = "onPlayerChangeColor", + args = { + playerid = playerid, + r = r, + g = g, + b = b + } + } + + _PyG2O_Send(data); +}); + +addEventHandler("onPlayerChangeFocus", function(playerid, oldFocusId, newFocusId) +{ + local data = { + event = "onPlayerChangeFocus", + args = { + playerid = playerid, + oldFocusId = oldFocusId, + newFocusId = newFocusId + } + } + + _PyG2O_Send(data); +}); + +addEventHandler("onPlayerChangeHealth", function(playerid, previous, current) +{ + local data = { + event = "onPlayerChangeHealth", + args = { + playerid = playerid, + previous = previous, + current = current + } + } + + _PyG2O_Send(data); +}); + +addEventHandler("onPlayerChangeMana", function(playerid, previous, current) +{ + local data = { + event = "onPlayerChangeMana", + args = { + playerid = playerid, + previous = previous, + current = current + } + } + + _PyG2O_Send(data); +}); + +addEventHandler("onPlayerChangeMaxHealth", function(playerid, previous, current) +{ + local data = { + event = "onPlayerChangeMaxHealth", + args = { + playerid = playerid, + previous = previous, + current = current + } + } + + _PyG2O_Send(data); +}); + +addEventHandler("onPlayerChangeMaxMana", function(playerid, previous, current) +{ + local data = { + event = "onPlayerChangeMaxMana", + args = { + playerid = playerid, + previous = previous, + current = current + } + } + + _PyG2O_Send(data); +}); + +addEventHandler("onPlayerChangeWeaponMode", function(playerid, previous, current) +{ + local data = { + event = "onPlayerChangeWeaponMode", + args = { + playerid = playerid, + previous = previous, + current = current + } + } + + _PyG2O_Send(data); +}); + +addEventHandler("onPlayerChangeWorld", function(playerid, previous, current) +{ + local data = { + event = "onPlayerChangeWorld", + args = { + playerid = playerid, + previous = previous, + current = current + } + } + + _PyG2O_Send(data); +}); + +addEventHandler("onPlayerCommand", function(playerid, command, params) +{ + local data = { + event = "onPlayerCommand", + args = { + playerid = playerid, + command = command, + params = params + } + } + + _PyG2O_Send(data); +}); + +addEventHandler("onPlayerDamage", function(playerid, killerid, description) +{ + local data = { + event = "onPlayerDamage", + args = { + playerid = playerid, + killerid = killerid, + obj_DamageDescription = { + name = "desc", + data = _PyG2O_Serialize(description) + } + } + } + + _PyG2O_Send(data); +}); + +addEventHandler("onPlayerDead", function(playerid, killerid) +{ + local data = { + event = "onPlayerDead", + args = { + playerid = playerid, + killerid = killerid + } + } + + _PyG2O_Send(data); +}); + +addEventHandler("onPlayerDisconnect", function(playerid, reason) +{ + local data = { + event = "onPlayerDisconnect", + args = { + playerid = playerid, + reason = reason + } + } + + _PyG2O_Send(data); +}); + +addEventHandler("onPlayerDropItem", function(playerid, itemGround) +{ + local data = { + event = "onPlayerDropItem", + args = { + playerid = playerid, + obj_ItemGround = { + name = "itemGround", + data = _PyG2O_Serialize(itemGround) + } + } + } + + _PyG2O_Send(data); +}); + +addEventHandler("onPlayerEnterWorld", function(playerid, world) +{ + local data = { + event = "onPlayerEnterWorld", + args = { + playerid = playerid, + world = world + } + } + + _PyG2O_Send(data); +}); + +addEventHandler("onPlayerEquipAmulet", function(playerid, instance) +{ + local data = { + event = "onPlayerEquipAmulet", + args = { + playerid = playerid, + instance = instance + } + } + + _PyG2O_Send(data); +}); + +addEventHandler("onPlayerEquipArmor", function(playerid, instance) +{ + local data = { + event = "onPlayerEquipArmor", + args = { + playerid = playerid, + instance = instance + } + } + + _PyG2O_Send(data); +}); + +addEventHandler("onPlayerEquipBelt", function(playerid, instance) +{ + local data = { + event = "onPlayerEquipBelt", + args = { + playerid = playerid, + instance = instance + } + } + + _PyG2O_Send(data); +}); + +addEventHandler("onPlayerEquipHandItem", function(playerid, hand, instance) +{ + local data = { + event = "onPlayerEquipHandItem", + args = { + playerid = playerid, + hand = hand, + instance = instance + } + } + + _PyG2O_Send(data); +}); + +addEventHandler("onPlayerEquipHelmet", function(playerid, instance) +{ + local data = { + event = "onPlayerEquipHelmet", + args = { + playerid = playerid, + instance = instance + } + } + + _PyG2O_Send(data); +}); + +addEventHandler("onPlayerEquipMeleeWeapon", function(playerid, instance) +{ + local data = { + event = "onPlayerEquipMeleeWeapon", + args = { + playerid = playerid, + instance = instance + } + } + + _PyG2O_Send(data); +}); + +addEventHandler("onPlayerEquipRangedWeapon", function(playerid, instance) +{ + local data = { + event = "onPlayerEquipRangedWeapon", + args = { + playerid = playerid, + instance = instance + } + } + + _PyG2O_Send(data); +}); + +addEventHandler("onPlayerEquipRing", function(playerid, handId, instance) +{ + local data = { + event = "onPlayerEquipRing", + args = { + playerid = playerid, + handId = handId, + instance = instance + } + } + + _PyG2O_Send(data); +}); + +addEventHandler("onPlayerEquipShield", function(playerid, instance) +{ + local data = { + event = "onPlayerEquipShield", + args = { + playerid = playerid, + instance = instance + } + } + + _PyG2O_Send(data); +}); + +addEventHandler("onPlayerEquipSpell", function(playerid, slotId, instance) +{ + local data = { + event = "onPlayerEquipSpell", + args = { + playerid = playerid, + slotId = slotId, + instance = instance + } + } + + _PyG2O_Send(data); +}); + +addEventHandler("onPlayerJoin", function(playerid) +{ + local data = { + event = "onPlayerJoin", + args = { + playerid = playerid + } + } + + _PyG2O_Send(data); +}); + +addEventHandler("onPlayerMessage", function(playerid, message) +{ + local data = { + event = "onPlayerMessage", + args = { + playerid = playerid, + message = message + } + } + + _PyG2O_Send(data); +}); + +addEventHandler("onPlayerMobInteract", function(playerid, from, to) +{ + local data = { + event = "onPlayerMobInteract", + args = { + playerid = playerid, + from = from, + to = to + } + } + + _PyG2O_Send(data); +}); + +addEventHandler("onPlayerRespawn", function(playerid) +{ + local data = { + event = "onPlayerRespawn", + args = { + playerid = playerid + } + } + + _PyG2O_Send(data); +}); + +addEventHandler("onPlayerShoot", function(playerid, munition) +{ + local data = { + event = "onPlayerShoot", + args = { + playerid = playerid, + munition = munition + } + } + + _PyG2O_Send(data); +}); + +addEventHandler("onPlayerSpellCast", function(playerid, instance, spellLevel) +{ + local data = { + event = "onPlayerSpellCast", + args = { + playerid = playerid, + instance = instance, + spellLevel = spellLevel + } + } + + _PyG2O_Send(data); +}); + +addEventHandler("onPlayerSpellSetup", function(playerid, instance) +{ + local data = { + event = "onPlayerSpellSetup", + args = { + playerid = playerid, + instance = instance + } + } + + _PyG2O_Send(data); +}); + +addEventHandler("onPlayerTakeItem", function(playerid, itemGround) +{ + local data = { + event = "onPlayerTakeItem", + args = { + playerid = playerid, + obj_ItemGround = { + name = "itemGround", + data = _PyG2O_Serialize(itemGround) + } + } + } + + _PyG2O_Send(data); +}); + +addEventHandler("onPlayerTeleport", function(playerid, vobName) +{ + local data = { + event = "onPlayerTeleport", + args = { + playerid = playerid, + vobName = vobName + } + } + + _PyG2O_Send(data); +}); + +addEventHandler("onPlayerToggleFaceAni", function(playerid, aniName, toggle) +{ + local data = { + event = "onPlayerToggleFaceAni", + args = { + playerid = playerid, + aniName = aniName, + toggle = toggle + } + } + + _PyG2O_Send(data); +}); \ No newline at end of file diff --git a/include/main.nut b/include/main.nut new file mode 100644 index 0000000..d6178d9 --- /dev/null +++ b/include/main.nut @@ -0,0 +1,128 @@ + +local _pyg2o_server_connection = -1; +local _silent = false; +local _url = -1 +local _reconnect = false; + +function PyG2O_Start(url, reconnect = false, silent = false) +{ + _silent = silent; + _url = url; + _reconnect = reconnect; + + _pyg2o_server_connection = WebsocketClient(); + _pyg2o_server_connection.silent = true; + _pyg2o_server_connection.setUrl("ws://localhost:8080"); + _pyg2o_server_connection.start(); + + if (!_silent) + print("[PyG2O] Initializing connection on " + url) +} + +function _PyG2O_Send(data) +{ + if (_pyg2o_server_connection == -1) + return; + + _pyg2o_server_connection.send(JSON.dump_ansi(data)); +} + +function _PyG2O_InitializeConstants() +{ + local const_data = { + "type": "const_init", + "args": getconsttable() + }; + + _PyG2O_Send(const_data); +} + +function _PyG2O_GetClassName(object) +{ + if (object instanceof DamageDescription) + return "DamageDescription"; + else if (object instanceof ItemGround) + return "ItemGround"; + + return null; +} + +function _PyG2O_Serialize(object) +{ + local cls = object.getclass(); + local tab = {}; + + if (object instanceof DamageDescription) + { + tab["_flags"] <- object.flags; + tab["_damage"] <- object.damage; + tab["_item_instance"] <- object.item_instance; + tab["_distance"] <- object.distance; + tab["_spell_id"] <- object.spell_id; + tab["_spell_level"] <- object.spell_level; + tab["_node"] <- object.node; + } + else if (object instanceof ItemGround) + { + tab["_id"] <- object.id; + tab["_instance"] <- object.instance; + tab["_amount"] <- object.amount; + tab["_world"] <- object.world; + tab["_virtualWorld"] <- object.virtualWorld; + tab["_position"] <- object.getPosition(); + tab["_rotation"] <- object.getRotation(); + } + + return tab; +} + +addEventHandler("onWebsocketConnect", function(socket, url) +{ + if (socket != _pyg2o_server_connection) + return; + + if (!_silent) + { + print("[PyG2O] Successfully connected to " + url); + _PyG2O_InitializeConstants(); + } +}); + +addEventHandler("onWebsocketDisconnect", function(socket, url) +{ + if (socket != _pyg2o_server_connection || _reconnect) + return; + + _pyg2o_server_connection = -1; +}); + +addEventHandler("onWebsocketMessage", function(socket, url, message) +{ + if (socket != _pyg2o_server_connection) + return; + + local request = JSON.parse_ansi(message); + if ("uuid" in request) + { + local result = compilestring(request["args"])(); + local className = _PyG2O_GetClassName(result); + if (className != null) + { + className = format("obj_%s", className) + + request["args"] = {}; + request["args"].rawset(className, {}); + local objTab = request["args"].rawget(className); + objTab["name"] <- "result"; + objTab["data"] <- _PyG2O_Serialize(result); + } + else + { + request["args"] = + { + "result": result + }; + } + _pyg2o_server_connection.send(JSON.dump_ansi(request, 2)); + } +}); diff --git a/include/pyg2o.xml b/include/pyg2o.xml new file mode 100644 index 0000000..37df48a --- /dev/null +++ b/include/pyg2o.xml @@ -0,0 +1,4 @@ + +