docs: Updated docs for 2.0.0 version

This commit is contained in:
AURUMVORXX
2025-04-15 13:13:31 +03:00
parent 988f901dc8
commit 7ff72c7887
347 changed files with 530 additions and 700 deletions

View File

@@ -19,5 +19,4 @@ jobs:
pip install mkdocs-material pip install mkdocs-material
pip install mkdocs-callouts pip install mkdocs-callouts
pip install mkdocs-glightbox pip install mkdocs-glightbox
cd python/
mkdocs gh-deploy --force mkdocs gh-deploy --force

View File

@@ -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

View File

@@ -4,11 +4,8 @@ Python support for server-side scripts in [Gothic 2 Online](https://gothic-onlin
**Documentation:** https://aurumvorxx.github.io/PyG2O/ **Documentation:** https://aurumvorxx.github.io/PyG2O/
## How to build
Requirements: Requirements:
- Python 3.13 - websockets
- CMake
Steps: Steps:
1. Copy this repo to your local machine 1. Copy this repo to your local machine

View File

@@ -0,0 +1,3 @@
# `static class` Daedalus
---
::: src.pyg2o.classes.daedalus.Daedalus

View File

@@ -0,0 +1,3 @@
# `class` DamageDescription
---
::: src.pyg2o.classes.damage.DamageDescription

3
docs/classes/game/Sky.md Normal file
View File

@@ -0,0 +1,3 @@
# `static class` Sky
---
::: src.pyg2o.classes.sky.Sky

View File

@@ -0,0 +1,3 @@
# `static class` ItemGround
---
::: src.pyg2o.classes.items.ItemGround

View File

@@ -0,0 +1,3 @@
# `static class` ItemsGround
---
::: src.pyg2o.classes.items.ItemsGround

3
docs/classes/mds/Mds.md Normal file
View File

@@ -0,0 +1,3 @@
# `static class` Mds
---
::: src.pyg2o.classes.mds.Mds

View File

@@ -1,55 +1,55 @@
* `addEventHandler` replaced with decorator [event](functions/event/event.md) * `addEventHandler` replaced with decorator [event](functions/event/event.md)
```python ```python
@g2o.event('onInit') @pyg2o.event('onInit')
def evtInitFirst(**kwargs): async def evtInitFirst():
print('Hello') print('Hello')
@g2o.event('onInit', 100) # '100' is priority @pyg2o.event('onInit', 100) # '100' is priority
def evtInitSecond(**kwargs): async def evtInitSecond():
print('World') print('World')
``` ```
--- ---
* Positional arguments inside event handles replaced with keyword arguments (see names of all keywords on the each event page) * Positional arguments inside event handles replaced with keyword arguments (see names of all keywords on the each event page)
```python ```python
@g2o.event('onPlayerChangeColor') @pyg2o.event('onPlayerChangeColor')
def evtColor(**kwargs): async def evtColor(playerid, r, g, b):
playerid = kwargs['playerid'] pass
r = kwargs['r']
b = kwargs['b']
``` ```
--- ---
* `callEvent` now also requires to pass keyword arguments instead of positional arguments * `callEvent` now also requires to pass keyword arguments instead of positional arguments
```python ```python
@g2o.event('MyTestEvent') @pyg2o.event('MyTestEvent')
def testEvt(**kwargs): async def testEvt(name, id):
print(kwargs) print(name, id)
g2o.callEvent('MyTestEvent', name = 'aurumvorax', id = 15) g2o.callEvent('MyTestEvent', name = 'aurumvorax', id = 15)
# OR # OR
g2o.callEvent('MyTestEvent', {'name': 'aurumvorax', 'id': 15}) g2o.callEvent('MyTestEvent', {'name': 'aurumvorax', 'id': 15})
# OR # OR
args = {'name': 'aurumvorax', 'id': 15} args = {'name': 'aurumvorax', 'id': 15}
g2o.callEvent('MyTestEvent', args) asyncio.create_task(pyg2o.callEvent('MyTestEvent', args))
``` ```
--- ---
* `cancelEvent` replaced with returning `False` inside the handler * `cancelEvent` temporarily disabled
<sup>*(you don't need to explicitly return `True` if you don't want to cancel the event)*</sup>
```python
@g2o.event('onPlayerTakeItem')
def evtTake(**kwargs):
return False
```
--- ---
* `isEventCancelled` replaced with built-in function property `cancelled`, alongside with the `eventName` * `isEventCancelled` replaced with built-in function property `cancelled`, alongside with the `eventName`
```python ```python
@g2o.event('onPlayerDropItem') @pyg2o.event('onPlayerDropItem')
def evtDrop(**kwargs): async def evtDrop(**kwargs):
print(evtDrop.cancelled) print(evtDrop.cancelled)
print(evtDrop.eventName) print(evtDrop.eventName)
``` ```
----- ---
* Following functions have been removed <sub><sup>RIP :(</sub></sup> 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 <sub><sup>RIP :(</sub></sup>
* `md5` * `md5`
* `sha1` * `sha1`
@@ -71,7 +71,17 @@ def evtDrop(**kwargs):
* `eventValue` * `eventValue`
* `getPlayerMagicLevel` * `getPlayerMagicLevel`
* `setPlayerMagicLevel` * `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 * 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` * `onPlayerEquipAmulet`
@@ -93,5 +103,3 @@ def evtDrop(**kwargs):
* `getPlayerRing` * `getPlayerRing`
* `getPlayerShield` * `getPlayerShield`
* `getPlayerSpell` * `getPlayerSpell`
---
* `ItemsGround.getById` throws an exception instead of returning `null` if there's no item with given ID

View File

@@ -13,9 +13,9 @@ Original: [onPlayerUseCheat](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/
## Usage ## Usage
```python ```python
import g2o import pyg2o
@g2o.event('onPlayerUseCheat') @pyg2o.event('onPlayerUseCheat')
def onCheat(**kwargs): async def onCheat(playerid, type):
print(f'Player {kwargs['playerid']} used forbidden cheat tool type {kwargs['type']}.') print(f'Player {playerid} used forbidden cheat tool type {type}.')
``` ```

View File

@@ -18,13 +18,13 @@ Original: [onBan](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-refe
## Usage ## Usage
```python ```python
import g2o import pyg2o as g2o
from datetime import datetime from datetime import datetime
@g2o.event('onBan') @g2o.event('onBan')
def onBan(**kwargs): async def onBan(banInfo):
print(f'Player {kwargs['name']} has been banned.') print(f'Player {banInfo['name']} has been banned.')
if ('timestamp' in kwargs): if ('timestamp' in banInfo):
banExpires = datetime.fromtimestamp(kwargs['timestamp']) banExpires = datetime.fromtimestamp(banInfo['timestamp'])
print(f'Ban expires at {banExpires}') print(f'Ban expires at {banExpires}')
``` ```

View File

@@ -9,9 +9,9 @@ No parameters.
## Usage ## Usage
```python ```python
import g2o import pyg2o as g2o
@g2o.event('onExit') @g2o.event('onExit')
def onExitEvt(**kwargs): async def onExitEvt():
print('Bye') print('Bye')
``` ```

View File

@@ -8,9 +8,9 @@ No parameters.
## Usage ## Usage
```python ```python
import g2o import pyg2o as g2o
@g2o.event('onInit') @g2o.event('onInit')
def onInitEventHandler(**kwargs): async def onInitEventHandler():
print('Called onInit event') print('Called onInit event')
``` ```

View File

@@ -8,9 +8,9 @@ No parameters.
## Usage ## Usage
```python ```python
import g2o import pyg2o as g2o
@g2o.event('onTick') @g2o.event('onTick')
def onTickEvt(**kwargs): async def onTickEvt():
print('Tock') print('Tock')
``` ```

View File

@@ -11,12 +11,9 @@ Original: [onExit](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-ref
## Usage ## Usage
```python ```python
import g2o import pyg2o as g2o
@g2o.event('onTick') @g2o.event('onTime')
def onTickEvt(**kwargs): async def onTickEvt(day, hour, min):
day = kwargs['day']
hour = kwargs['hour']
mins = kwargs['min']
print(f'Current time: Day {day}, Hour {hour}, Min {mins}') print(f'Current time: Day {day}, Hour {hour}, Min {mins}')
``` ```

View File

@@ -18,9 +18,9 @@ Original: [onExit](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-ref
## Usage ## Usage
```python ```python
import g2o import pyg2o as g2o
@g2o.event('onUnban') @g2o.event('onUnban')
def onUnban(**kwargs): async def onUnban(banInfo):
print(f'Player {kwargs['name']} has been unbanned.') print(f'Player {banInfo['name']} has been unbanned.')
``` ```

View File

@@ -13,9 +13,9 @@ Original: [onNpcActionFinished](https://gothicmultiplayerteam.gitlab.io/docs/0.3
## Usage ## Usage
```python ```python
import g2o import pyg2o as g2o
@g2o.event('onNpcActionFinished') @g2o.event('onNpcActionFinished')
def onActionFinished(**kwargs): async def onActionFinished(npc_id, action_type, action_id, result):
print(f'NPC {kwargs['npc_id']} finished action {kwargs['action_type']} with the result {kwargs['result']}.') print(f'NPC {npc_id} finished action {action_type} with the result {result}.')
``` ```

View File

@@ -12,9 +12,9 @@ Original: [onNpcActionSent](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/s
## Usage ## Usage
```python ```python
import g2o import pyg2o as g2o
@g2o.event('onNpcActionSent') @g2o.event('onNpcActionSent')
def onActionSent(**kwargs): async def onActionSent(npc_id, action_type, action_id):
print(f'NPC {kwargs['npc_id']} changed host from {kwargs['previous_id']} to {kwargs['current_id']}.') print(f'NPC {npc_id} sent action {action_id}.')
``` ```

View File

@@ -12,9 +12,9 @@ Original: [onNpcChangeHostPlayer](https://gothicmultiplayerteam.gitlab.io/docs/0
## Usage ## Usage
```python ```python
import g2o import pyg2o as g2o
@g2o.event('onNpcChangeHostPlayer') @g2o.event('onNpcChangeHostPlayer')
def onChangeHostPlayer(**kwargs): async def onChangeHostPlayer(npc_id, previous_id, current_id):
print(f'NPC {kwargs['npc_id']} sent {kwargs['action_type']} to all players.') print(f'NPC {npc_id} changed host to {current_id}')
``` ```

View File

@@ -10,9 +10,9 @@ Original: [onNpcCreated](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/scri
## Usage ## Usage
```python ```python
import g2o import pyg2o as g2o
@g2o.event('onNpcCreated') @g2o.event('onNpcCreated')
def onNpcCreate(**kwargs): async def onNpcCreate(npc_id):
print(f'NPC {kwargs['npc_id']} has been created.') print(f'NPC {npc_id} has been created.')
``` ```

View File

@@ -10,9 +10,9 @@ Original: [onNpcDestroyed](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/sc
## Usage ## Usage
```python ```python
import g2o import pyg2o as g2o
@g2o.event('onNpcDestroyed') @g2o.event('onNpcDestroyed')
def onNpcDestroy(**kwargs): async def onNpcDestroy(npc_id):
print(f'NPC {kwargs['npc_id']} has been destroyed.') print(f'NPC {npc_id} has been destroyed.')
``` ```

View File

@@ -12,14 +12,11 @@ Original: [onPlayerChangeColor](https://gothicmultiplayerteam.gitlab.io/docs/0.3
## Usage ## Usage
```python ```python
import g2o import pyg2o as g2o
@g2o.event('onPlayerChangeColor') @g2o.event('onPlayerChangeColor')
def onChangeColor(**kwargs): async def onChangeColor(playerid, r, g, b):
# Slicing out playerid and converting from {r: num, g: num, b: num} rgbColor = tuple(r, g, b)
# to (num, num, num)
rgbColor = tuple(list(kwargs.values())[1:])
# Formating rgb into hex color
hexColor = '#%02x%02x%02x' % rgbColor hexColor = '#%02x%02x%02x' % rgbColor
print(f'Player {kwargs['playerid']} changed his color to {hexColor}') print(f'Player {playerid} changed his color to {hexColor}')
``` ```

View File

@@ -11,13 +11,12 @@ Original: [onPlayerChangeFocus](https://gothicmultiplayerteam.gitlab.io/docs/0.3
## Usage ## Usage
```python ```python
import g2o import pyg2o as g2o
@g2o.event('onPlayerChangeFocus') @g2o.event('onPlayerChangeFocus')
def onChangeFocus(**kwargs): async def onChangeFocus(playerid, oldFocusId, newFocusId):
focusId = kwargs['newFocusId'] if newFocusId != -1:
if focusId != -1: print(f'Player {playerid} is looking at {newFocusId}')
print(f'Player {kwargs['playerid']} is looking at {focusId}')
else else
print(f'Player {kwargs['playerid']} is looking at... who?') print(f'Player {playerid} is looking at... who?')
``` ```

View File

@@ -6,14 +6,14 @@ Original: [onPlayerChangeHealth](https://gothicmultiplayerteam.gitlab.io/docs/0.
## Parameters ## Parameters
* `dict` **kwargs**: * `dict` **kwargs**:
* `int` **playerid**: the id of the player whose health points gets changed. * `int` **playerid**: the id of the player whose health points gets changed.
* `int` **oldHP**: the previous health points of the player. * `int` **previous**: the previous health points of the player.
* `int` **newHP**: the new health points of the player. * `int` **current**: the new health points of the player.
## Usage ## Usage
```python ```python
import g2o import pyg2o as g2o
@g2o.event('onPlayerChangeHealth') @g2o.event('onPlayerChangeHealth')
def onChangeHealth(**kwargs): async def onChangeHealth(playerid, previous, current):
print(f'Player {kwargs['playerid']} changed health: {kwargs['oldHP']} -> {kwargs['newHP']}') print(f'Player {playerid} changed health: {previous} -> {current}')
``` ```

View File

@@ -6,14 +6,14 @@ Original: [onPlayerChangeMana](https://gothicmultiplayerteam.gitlab.io/docs/0.3.
## Parameters ## Parameters
* `dict` **kwargs**: * `dict` **kwargs**:
* `int` **playerid**: the id of the player mana points gets changed. * `int` **playerid**: the id of the player mana points gets changed.
* `int` **oldMP**: the previous mana points of the player. * `int` **previous**: the previous mana points of the player.
* `int` **newMP**: the new mana points of the player. * `int` **current**: the new mana points of the player.
## Usage ## Usage
```python ```python
import g2o import pyg2o as g2o
@g2o.event('onPlayerChangeMana') @g2o.event('onPlayerChangeMana')
def onChangeMana(**kwargs): async def onChangeMana(playerid, previous, current):
print(f'Player {kwargs['playerid']} changed mana: {kwargs['oldMP']} -> {kwargs['newMP']}') print(f'Player {playerid} changed mana: {previous} -> {current}')
``` ```

View File

@@ -6,14 +6,14 @@ Original: [onPlayerChangeMaxHealth](https://gothicmultiplayerteam.gitlab.io/docs
## Parameters ## Parameters
* `dict` **kwargs**: * `dict` **kwargs**:
* `int` **playerid**: the id of the player whose maxium health points gets changed. * `int` **playerid**: the id of the player whose maxium health points gets changed.
* `int` **oldMaxHP**: the previous maximum health points of the player. * `int` **previous**: the previous maximum health points of the player.
* `int` **newMaxHP**: the new maximum health points of the player. * `int` **current**: the new maximum health points of the player.
## Usage ## Usage
```python ```python
import g2o import pyg2o as g2o
@g2o.event('onPlayerChangeMaxHealth') @g2o.event('onPlayerChangeMaxHealth')
def onChangeMaxHealth(**kwargs): async def onChangeMaxHealth(playerid, previous, current):
print(f'Player {kwargs['playerid']} changed maximum health: {kwargs['oldMaxHP']} -> {kwargs['newMaxHP']}') print(f'Player {playerid} changed maximum health: {previous} -> {current}')
``` ```

View File

@@ -6,14 +6,14 @@ Original: [onPlayerChangeMaxMana](https://gothicmultiplayerteam.gitlab.io/docs/0
## Parameters ## Parameters
* `dict` **kwargs**: * `dict` **kwargs**:
* `int` **playerid**: the id of the player maximum mana points gets changed. * `int` **playerid**: the id of the player maximum mana points gets changed.
* `int` **oldMaxMP**: the previous maximum mana points of the player. * `int` **previous**: the previous maximum mana points of the player.
* `int` **newMaxMP**: the new maximum mana points of the player. * `int` **current**: the new maximum mana points of the player.
## Usage ## Usage
```python ```python
import g2o import pyg2o as g2o
@g2o.event('onPlayerChangeMaxMana') @g2o.event('onPlayerChangeMaxMana')
def onChangeMaxMana(**kwargs): async def onChangeMaxMana(playerid, previous, current):
print(f'Player {kwargs['playerid']} changed maximum mana: {kwargs['oldMaxMP']} -> {kwargs['newMaxMP']}') print(f'Player {playerid} changed maximum mana: {previous} -> {current}')
``` ```

View File

@@ -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}')
```

View File

@@ -12,9 +12,9 @@ Original: [onPlayerChangeWorld](https://gothicmultiplayerteam.gitlab.io/docs/0.3
## Usage ## Usage
```python ```python
import g2o import pyg2o as g2o
@g2o.event('onPlayerChangeWorld') @g2o.event('onPlayerChangeWorld')
def onChangeWorld(**kwargs): async def onChangeWorld(playerid, world, waypoint):
print(f'Player {kwargs['playerid']} teleported to {kwargs['world']} at {kwargs['waypoint']}') print(f'Player {playerid} teleported to {world} at {waypoint}')
``` ```

View File

@@ -12,13 +12,13 @@ Original: [onPlayerCommand](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/s
## Usage ## Usage
```python ```python
import g2o import pyg2o as g2o
@g2o.event('onPlayerCommand') @g2o.event('onPlayerCommand')
def onCommand(**kwargs): async def onCommand(playerid, command, params):
# Spliting and formating 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 print('Sum is: ', params[0] + params[1]) # /add 5 10 -> output: Sum is 15
``` ```

View File

@@ -12,10 +12,9 @@ Original: [onPlayerDamage](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/sc
## Usage ## Usage
```python ```python
import g2o import pyg2o as g2o
@g2o.event('onPlayerDamage') @g2o.event('onPlayerDamage')
def onDamage(**kwargs): async def onDamage(playerid, killerid, description):
desc = kwargs['description'] print(f'Ouch! Player {playerid} just received {description.damage} damage.')
print(f'Ouch! Player {kwargs['playerid']} just received {desc.damage} damage.')
``` ```

View File

@@ -10,9 +10,9 @@ Original: [onPlayerDead](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/scri
## Usage ## Usage
```python ```python
import g2o import pyg2o as g2o
@g2o.event('onPlayerDead') @g2o.event('onPlayerDead')
def onDead(**kwargs): async def onDead(playerid, killerid):
print(kwargs['playerid'], 'killed by', kwargs['killerid']) print(playerid, 'killed by', killerid)
``` ```

View File

@@ -10,9 +10,9 @@ Original: [onPlayerDisconnect](https://gothicmultiplayerteam.gitlab.io/docs/0.3.
## Usage ## Usage
```python ```python
import g2o import pyg2o as g2o
@g2o.event('onPlayerDisconnect') @g2o.event('onPlayerDisconnect')
def onDC(**kwargs): async def onDC(playerid, reason):
print(f'Player {kwargs['playerid']} has left from the server') print(f'Player {playerid} has left from the server')
``` ```

View File

@@ -11,10 +11,9 @@ Original: [onPlayerDropItem](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/
## Usage ## Usage
```python ```python
import g2o import pyg2o as g2o
@g2o.event('onPlayerDropItem') @g2o.event('onPlayerDropItem')
def onDropItem(**kwargs): async def onDropItem(playerid, itemGround):
item = itemm['itemGround'] print(f'Player {playerid} dropped {itemGround.instance} x{itemGround.amount}')
print(f'Player {kwargs['playerid']} dropped {item.instance} x{item.amount}')
``` ```

View File

@@ -10,9 +10,9 @@ Original: [onPlayerEnterWorld](https://gothicmultiplayerteam.gitlab.io/docs/0.3.
## Usage ## Usage
```python ```python
import g2o import pyg2o as g2o
@g2o.event('onPlayerEnterWorld') @g2o.event('onPlayerEnterWorld')
def onEnterWorld(**kwargs): async def onEnterWorld(playerid, world):
print(f'Player {kwargs['playerid']} entered world {kwargs['world']}') print(f'Player {playerid} entered world {world}')
``` ```

View File

@@ -10,9 +10,9 @@ Original: [onPlayerEquipAmulet](https://gothicmultiplayerteam.gitlab.io/docs/0.3
## Usage ## Usage
```python ```python
import g2o import pyg2o as g2o
@g2o.event('onPlayerEquipAmulet') @g2o.event('onPlayerEquipAmulet')
def onEquip(**kwargs): async def onEquip(playerid, instance):
print(f'Player {kwargs['playerid']} equipped {kwargs['instance']}') print(f'Player {playerid} equipped {instance}')
``` ```

View File

@@ -10,9 +10,9 @@ Original: [onPlayerEquipArmor](https://gothicmultiplayerteam.gitlab.io/docs/0.3.
## Usage ## Usage
```python ```python
import g2o import pyg2o as g2o
@g2o.event('onPlayerEquipArmor') @g2o.event('onPlayerEquipArmor')
def onEquip(**kwargs): async def onEquip(playerid, instance):
print(f'Player {kwargs['playerid']} equipped {kwargs['instance']}') print(f'Player {playerid} equipped {instance}')
``` ```

View File

@@ -10,9 +10,9 @@ Original: [onPlayerEquipBelt](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0
## Usage ## Usage
```python ```python
import g2o import pyg2o as g2o
@g2o.event('onPlayerEquipBelt') @g2o.event('onPlayerEquipBelt')
def onEquip(**kwargs): async def onEquip(playerid, instance):
print(f'Player {kwargs['playerid']} equipped {kwargs['instance']}') print(f'Player {playerid} equipped {instance}')
``` ```

View File

@@ -11,9 +11,9 @@ Original: [onPlayerEquipHandItem](https://gothicmultiplayerteam.gitlab.io/docs/0
## Usage ## Usage
```python ```python
import g2o import pyg2o as g2o
@g2o.event('onPlayerEquipHandItem') @g2o.event('onPlayerEquipHandItem')
def onEquip(**kwargs): async def onEquip(playerid, hand, instance):
print(f'Player {kwargs['playerid']} has {kwargs['instance']}, used hand with id {kwargs['hand']}') print(f'Player {playerid} equipped {instance}')
``` ```

View File

@@ -10,9 +10,9 @@ Original: [onPlayerEquipHelmet](https://gothicmultiplayerteam.gitlab.io/docs/0.3
## Usage ## Usage
```python ```python
import g2o import pyg2o as g2o
@g2o.event('onPlayerEquipHelmet') @g2o.event('onPlayerEquipHelmet')
def onEquip(**kwargs): async def onEquip(playerid, instance):
print(f'Player {kwargs['playerid']} equipped {kwargs['instance']}') print(f'Player {playerid} equipped {instance}')
``` ```

View File

@@ -10,9 +10,9 @@ Original: [onPlayerEquipMeleeWeapon](https://gothicmultiplayerteam.gitlab.io/doc
## Usage ## Usage
```python ```python
import g2o import pyg2o as g2o
@g2o.event('onPlayerEquipMeleeWeapon') @g2o.event('onPlayerEquipMeleeWeapon')
def onEquip(**kwargs): async def onEquip(playerid, instance):
print(f'Player {kwargs['playerid']} equipped {kwargs['instance']}') print(f'Player {playerid} equipped {instance}')
``` ```

View File

@@ -10,9 +10,9 @@ Original: [onPlayerEquipRangedWeapon](https://gothicmultiplayerteam.gitlab.io/do
## Usage ## Usage
```python ```python
import g2o import pyg2o as g2o
@g2o.event('onPlayerEquipRangedWeapon') @g2o.event('onPlayerEquipRangedWeapon')
def onEquip(**kwargs): async def onEquip(playerid, instance):
print(f'Player {kwargs['playerid']} equipped {kwargs['instance']}') print(f'Player {playerid} equipped {instance}')
``` ```

View File

@@ -11,9 +11,9 @@ Original: [onPlayerEquipRing](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0
## Usage ## Usage
```python ```python
import g2o import pyg2o as g2o
@g2o.event('onPlayerEquipRing') @g2o.event('onPlayerEquipRing')
def onEquip(**kwargs): async def onEquip(playerid, hand, instance):
print(f'Player {kwargs['playerid']} has {kwargs['instance']}, used hand with id {kwargs['hand']}') print(f'Player {playerid} equipped {instance}')
``` ```

View File

@@ -10,9 +10,9 @@ Original: [onPlayerEquipShield](https://gothicmultiplayerteam.gitlab.io/docs/0.3
## Usage ## Usage
```python ```python
import g2o import pyg2o as g2o
@g2o.event('onPlayerEquipShield') @g2o.event('onPlayerEquipShield')
def onEquip(**kwargs): async def onEquip(playerid, instance):
print(f'Player {kwargs['playerid']} equipped {kwargs['instance']}') print(f'Player {playerid} equipped {instance}')
``` ```

View File

@@ -11,9 +11,9 @@ Original: [onPlayerEquipSpell](https://gothicmultiplayerteam.gitlab.io/docs/0.3.
## Usage ## Usage
```python ```python
import g2o import pyg2o as g2o
@g2o.event('onPlayerSpell') @g2o.event('onPlayerSpell')
def onEquip(**kwargs): async def onEquip(playerid, slotId, instance):
print(f'Player {kwargs['playerid']} equipped spell {kwargs['instance']} at slot {kwargs['slotId']}') print(f'Player {playerid} equipped {instance}')
``` ```

View File

@@ -9,9 +9,9 @@ Original: [onPlayerJoin](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/scri
## Usage ## Usage
```python ```python
import g2o import pyg2o as g2o
@g2o.event('onPlayerJoin') @g2o.event('onPlayerJoin')
def onJoin(**kwargs): async def onJoin(playerid):
print(kwargs['playerid'], 'joined to the server.') print(pyg2o.getPlayerName(playerid), ' joined to the server.')
``` ```

View File

@@ -10,9 +10,9 @@ Original: [onPlayerMessage](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/s
## Usage ## Usage
```python ```python
import g2o import pyg2o as g2o
@g2o.event('onPlayerMessage') @g2o.event('onPlayerMessage')
def onMessage(**kwargs): async def onMessage(playerid, message):
print(kwargs['playerid'], 'says', kwargs['message']) print(pyg2o.getPlayerName(playerid), ' says ', message)
``` ```

View File

@@ -10,10 +10,10 @@ Original: [onPlayerMobInteract](https://gothicmultiplayerteam.gitlab.io/docs/0.3
## Usage ## Usage
```python ```python
import g2o import pyg2o as g2o
@g2o.event('onPlayerMobInteract') @g2o.event('onPlayerMobInteract')
def onMobInteract(**kwargs): async def onMobInteract(playerid, from, to):
if kwargs['to'] == 1: if to == 1:
print(kwargs['playerid'], 'started interaction with the MOB') print(playerid, 'started interaction with the MOB')
``` ```

View File

@@ -9,9 +9,9 @@ Original: [onPlayerRespawn](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/s
## Usage ## Usage
```python ```python
import g2o import pyg2o as g2o
@g2o.event('onPlayerRespawn') @g2o.event('onPlayerRespawn')
def onRespawn(**kwargs): async def onRespawn(playerid):
print(kwargs['playerid'], 'respawned.') print(playerid, 'respawned.')
``` ```

View File

@@ -10,9 +10,9 @@ Original: [onPlayerShoot](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/scr
## Usage ## Usage
```python ```python
import g2o import pyg2o as g2o
@g2o.event('onPlayerShoot') @g2o.event('onPlayerShoot')
def onShoot(**kwargs): async def onShoot(playerid, munition):
print(kwargs['playerid'], 'made a shot.') print(playerid, 'made a shot.')
``` ```

View File

@@ -15,9 +15,9 @@ Original: [onPlayerSpellCast](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0
## Usage ## Usage
```python ```python
import g2o import pyg2o as g2o
@g2o.event('onPlayerSpellCast') @g2o.event('onPlayerSpellCast')
def onSpellCast(**kwargs): async def onSpellCast(playerid, instance, spellLevel):
print(kwargs['player'], 'casted a spell', kwargs['instance']) print(playerid, 'casted a spell', instance)
``` ```

View File

@@ -10,9 +10,9 @@ Original: [onPlayerSpellSetup](https://gothicmultiplayerteam.gitlab.io/docs/0.3.
## Usage ## Usage
```python ```python
import g2o import pyg2o as g2o
@g2o.event('onPlayerSpellSetup') @g2o.event('onPlayerSpellSetup')
def onSpellSetup(**kwargs): async def onSpellSetup(playerid, instance):
print(kwargs['player'], 'setuped a spell', kwargs['instance']) print(playerid, 'setuped a spell', instance)
``` ```

View File

@@ -14,10 +14,9 @@ Original: [onPlayerTakeItem](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/
## Usage ## Usage
```python ```python
import g2o import pyg2o as g2o
@g2o.event('onPlayerTakeItem') @g2o.event('onPlayerTakeItem')
def onTakeItem(**kwargs): async def onTakeItem(playerid, itemGround):
item = itemm['itemGround'] print(f'Player {playerid} took {itemGround.instance} x{itemGround.amount}')
print(f'Player {kwargs['playerid']} took {item.instance} x{item.amount}')
``` ```

View File

@@ -10,9 +10,9 @@ Original: [onPlayerTeleport](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/
## Usage ## Usage
```python ```python
import g2o import pyg2o as g2o
@g2o.event('onPlayerTeleport') @g2o.event('onPlayerTeleport')
def onTeleport(**kwargs): async def onTeleport(playerid, vobName):
print(kwargs['player'], 'teleported to', kwargs['vobName']) print(playerid, 'teleported to', vobName)
``` ```

View File

@@ -14,7 +14,7 @@ Original: [onPlayerToggleFaceAni](https://gothicmultiplayerteam.gitlab.io/docs/0
import g2o import g2o
@g2o.event('onPlayerToggleFaceAni') @g2o.event('onPlayerToggleFaceAni')
def onToggleFA(**kwargs): async def onToggleFA(playerid, aniName, toggle):
if kwargs['toggle']: if toggle:
print(kwargs['player'], 'started face ani',kwargs['aniName']) print(playerid, 'started face ani', aniName)
``` ```

View File

@@ -0,0 +1,2 @@
# `function` sendMessageToAll
::: src.pyg2o.functions.chat.sendMessageToAll

View File

@@ -0,0 +1,2 @@
# `function` sendMessageToPlayer
::: src.pyg2o.functions.chat.sendMessageToPlayer

View File

@@ -0,0 +1,2 @@
# `function` sendPlayerMessageToAll
::: src.pyg2o.functions.chat.sendPlayerMessageToAll

View File

@@ -0,0 +1,2 @@
# `function` sendPlayerMessageToPlayer
::: src.pyg2o.functions.chat.sendPlayerMessageToPlayer

View File

@@ -0,0 +1,2 @@
# `function` addEvent
::: src.pyg2o.functions.event.addEvent

View File

@@ -0,0 +1,2 @@
# `function` callEvent
::: src.pyg2o.functions.event.callEvent

View File

@@ -0,0 +1,2 @@
# `function` event
::: src.pyg2o.functions.event.event

View File

@@ -0,0 +1,2 @@
# `function` removeEvent
::: src.pyg2o.functions.event.removeEvent

View File

@@ -0,0 +1,2 @@
# `function` removeEventHandler
::: src.pyg2o.functions.event.removeEventHandler

View File

@@ -0,0 +1,2 @@
# `function` toggleEvent
::: src.pyg2o.functions.event.toggleEvent

View File

@@ -0,0 +1,2 @@
# `function` exit
::: src.pyg2o.functions.game.exit

View File

@@ -0,0 +1,2 @@
# `function` getDayLength
::: src.pyg2o.functions.game.getDayLength

View File

@@ -0,0 +1,2 @@
# `function` getHostname
::: src.pyg2o.functions.game.getHostname

View File

@@ -0,0 +1,2 @@
# `function` getMaxSlots
::: src.pyg2o.functions.game.getMaxSlots

View File

@@ -0,0 +1,2 @@
# `function` getPlayersCount
::: src.pyg2o.functions.game.getPlayersCount

View File

@@ -0,0 +1,2 @@
# `function` getServerDescription
::: src.pyg2o.functions.game.getServerDescription

View File

@@ -0,0 +1,2 @@
# `function` getServerWorld
::: src.pyg2o.functions.game.getServerWorld

View File

@@ -0,0 +1,2 @@
# `function` getTime
::: src.pyg2o.functions.game.getTime

View File

@@ -0,0 +1,2 @@
# `function` serverLog
::: src.pyg2o.functions.game.serverLog

View File

@@ -0,0 +1,2 @@
# `function` setDayLength
::: src.pyg2o.functions.game.setDayLength

View File

@@ -0,0 +1,2 @@
# `function` setServerDescription
::: src.pyg2o.functions.game.setServerDescription

View File

@@ -0,0 +1,2 @@
# `function` setServerWorld
::: src.pyg2o.functions.game.setServerWorld

View File

@@ -0,0 +1,2 @@
# `function` setTime
::: src.pyg2o.functions.game.setTime

View File

@@ -0,0 +1,2 @@
# `function` clearNpcActions
::: src.pyg2o.functions.npc.clearNpcActions

View File

@@ -0,0 +1,2 @@
# `function` createNpc
::: src.pyg2o.functions.npc.createNpc

View File

@@ -0,0 +1,2 @@
# `function` destroyNpc
::: src.pyg2o.functions.npc.destroyNpc

View File

@@ -0,0 +1,2 @@
# `function` getNpcAction
::: src.pyg2o.functions.npc.getNpcAction

View File

@@ -0,0 +1,2 @@
# `function` getNpcActions
::: src.pyg2o.functions.npc.getNpcActions

View File

@@ -0,0 +1,2 @@
# `function` getNpcActionsCount
::: src.pyg2o.functions.npc.getNpcActionsCount

View File

@@ -0,0 +1,2 @@
# `function` getNpcHostPlayer
::: src.pyg2o.functions.npc.getNpcHostPlayer

View File

@@ -0,0 +1,2 @@
# `function` getNpcLastActionId
::: src.pyg2o.functions.npc.getNpcLastActionId

Some files were not shown because too many files have changed in this diff Show More