Reference

StandClient

Bases: Services, BaseEvents, Generated

Client, the main means for interacting with game server.

Parameters:
  • handshake (str) –

    Handshake to authorize client

  • ping_timeout

    [Default: 15] Maximum time (in seconds) to wait for a ping response.

  • alias_name

    [Default: class name] The name of the client used in custom logging.

  • reconnect_enable

    [Default: True] If it is True client will try to reconnect after connection closed

OnConnect()

Decorator! Register callback on connect event

idle() async

Block thread while client running.

me() async

Get handshake owner's player profile

send_payload(payload) async

Sends a payload to the server.

Parameters:
  • payload (bytes) –

    The data to be sent.

Returns:
  • True if the payload was successfully sent else False.

send_request(code, request) async

Sending request to game servers

Parameters:
  • code (int) –

    RPC method code

  • request (bytes) –

    RPC payload

start() async

Start the client.

This method connects the client to game.

Raises:
  • ConnectionError

    If the connection to game servers fails

stop() async

Stop the client.

subscribe(topic) async

Parameters:
  • topic (str) –

    topic name