Skip to content

function exit

This function will close the server with specified exit code.
Original: exit

Declaration

async def exit(exitCode : int = 0)

Parameters

  • int exitCode: exit status for g2o server.
Source code in src/pyg2o/functions/game.py
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
async def exit(exitCode : int = 0):
    """
    This function will close the server with specified exit code.
    Original: [exit](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/server-functions/game/exit/)

    ## Declaration
    ```python
    async def exit(exitCode : int = 0)
    ```
    ## Parameters
    * `int` **exitCode**: exit status for g2o server.
    """
    data = f'return {get_call_repr()}'

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