This function will get the max number of slots available on the server.
Original: getMaxSlots
Declaration
async def getMaxSlots() -> int
Returns
int: Max slots number on the server.
Usage
import g2o
@g2o.event('onInit')
def evtInit(**kwargs):
print('Server max slots:', g2o.getMaxSlots())
Source code in src/pyg2o/functions/game.py
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64 | async def getMaxSlots() -> int:
"""
This function will get the max number of slots available on the server.
Original: [getMaxSlots](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/shared-functions/game/getMaxSlots/)
## Declaration
```python
async def getMaxSlots() -> int
```
## Returns
`int`: Max slots number on the server.
## Usage
```python
import g2o
@g2o.event('onInit')
def evtInit(**kwargs):
print('Server max slots:', g2o.getMaxSlots())
```
"""
data = f'return {get_call_repr()}'
server = await PythonWebsocketServer.get_server()
result = await server.make_request(data)
return result
|