Skip to content

static class Mds


This class represents mds manager for conversion between mds id & mds instance. This manager will work for every registered mds in mds.xml file.
Original: Mds

Source code in src/pyg2o/classes/mds.py
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
class Mds:
    """
    This class represents mds manager for conversion between mds id & mds instance. This manager will work for every registered mds in `mds.xml` file.
    Original: [Mds](https://gothicmultiplayerteam.gitlab.io/docs/0.3.0/script-reference/shared-classes/mds/Mds/)
    """
    @staticmethod
    async def id(mdsName : str) -> int:
        """
        This method will convert the mds name to mds id.
        **Parameters:**
        * `str` **mdsName**: the mds name, e.g: `"HumanS_Sprint.mds"`.

        **Returns `int`:**
        the unique mds id.
        """
        data = f'return Mds.id({mdsName})'

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

    @staticmethod
    async def name(mdsId : int) -> str:
        """
        This method will convert the mds id to mds name.
        **Parameters:**
        * `int` **mdsId**: the mds id.

        **Returns `str`:**
        the mds name, e.g: `"HumanS_Sprint.mds"`.
        """
        data = f'return Mds.id({mdsId})'

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

id(mdsName) async staticmethod

This method will convert the mds name to mds id.
Parameters:
* str mdsName: the mds name, e.g: "HumanS_Sprint.mds".

Returns int:
the unique mds id.

Source code in src/pyg2o/classes/mds.py
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
@staticmethod
async def id(mdsName : str) -> int:
    """
    This method will convert the mds name to mds id.
    **Parameters:**
    * `str` **mdsName**: the mds name, e.g: `"HumanS_Sprint.mds"`.

    **Returns `int`:**
    the unique mds id.
    """
    data = f'return Mds.id({mdsName})'

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

name(mdsId) async staticmethod

This method will convert the mds id to mds name.
Parameters:
* int mdsId: the mds id.

Returns str:
the mds name, e.g: "HumanS_Sprint.mds".

Source code in src/pyg2o/classes/mds.py
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
@staticmethod
async def name(mdsId : int) -> str:
    """
    This method will convert the mds id to mds name.
    **Parameters:**
    * `int` **mdsId**: the mds id.

    **Returns `str`:**
    the mds name, e.g: `"HumanS_Sprint.mds"`.
    """
    data = f'return Mds.id({mdsId})'

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