Skip to content

function setServerWorld

Note

The server world limit is set to 32 characters.

Note

If the target world path is written with backslashes instead of normal slashes, you need to escape it with another backslashes e.g. "NEWWORLD\NEWWORLD.ZEN".

This function will change the default world to which players will enter after joining.
Original: setServerWorld

Declaration

async def setServerWorld(world : str)

Parameters

str world: the path to the target world.

Source code in src/pyg2o/functions/game.py
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
async def setServerWorld(world : str):
    """
    !!! note
        The server world limit is set to 32 characters.

    !!! note
        If the target world path is written with backslashes instead of normal slashes, you need to escape it with another backslashes e.g. "NEWWORLD\\NEWWORLD.ZEN".

    This function will change the default world to which players will enter after joining.
    Original: [setServerWorld](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/game/setServerWorld/)

    ## Declaration
    ```python
    async def setServerWorld(world : str)
    ```
    ## Parameters
    `str` **world**: the path to the target world.
    """
    data = f'return {get_call_repr()}'

    server = await PythonWebsocketServer.get_server()
    result = await server.make_request(data)
    return result