evennia.server.game_index_client package

Submodules

evennia.server.game_index_client.client module

The client for sending data to the Evennia Game Index

class evennia.server.game_index_client.client.EvenniaGameIndexClient(on_bad_request=None)[source]

Bases: object

This client class is used for gathering and sending game details to the Evennia Game Index. Since EGI is in the early goings, this isn’t incredibly configurable as far as to what is being sent.

__init__(on_bad_request=None)[source]
Parameters

on_bad_request – Optional callable to trigger when a bad request was sent. This is almost always going to be due to bad config.

_form_and_send_request()[source]

Build the request to send to the index.

handle_egd_response(response)[source]
send_game_details()[source]

This is where the magic happens. Send details about the game to the Evennia Game Index.

class evennia.server.game_index_client.client.QuietHTTP11ClientFactory(quiescentCallback, metadata)[source]

Bases: twisted.web.client._HTTP11ClientFactory

Silences the obnoxious factory start/stop messages in the default client.

noisy = False
class evennia.server.game_index_client.client.SimpleResponseReceiver(status_code, d)[source]

Bases: twisted.internet.protocol.Protocol

Used for pulling the response body out of an HTTP response.

__init__(status_code, d)[source]

Initialize self. See help(type(self)) for accurate signature.

connectionLost(reason=<twisted.python.failure.Failure twisted.internet.error.ConnectionDone: Connection was closed cleanly.>)[source]

Called when the connection is shut down.

Clear any circular references here, and any external references to this Protocol. The connection has been closed.

@type reason: L{twisted.python.failure.Failure}

dataReceived(data)[source]

Called whenever data is received.

Use this method to translate to a higher-level message. Usually, some callback will be made upon the receipt of each complete protocol message.

@param data: a string of indeterminate length. Please keep in mind

that you will probably need to buffer some data, as partial (or multiple) protocol messages may be received! I recommend that unit tests for protocols call through to this method with differing chunk sizes, down to one byte at a time.

class evennia.server.game_index_client.client.StringProducer(body)[source]

Bases: object

Used for feeding a request body to the tx HTTP client.

__init__(body)[source]

Initialize self. See help(type(self)) for accurate signature.

pauseProducing()[source]
startProducing(consumer)[source]
stopProducing()[source]

evennia.server.game_index_client.service module

Service for integrating the Evennia Game Index client into Evennia.

class evennia.server.game_index_client.service.EvenniaGameIndexService[source]

Bases: twisted.application.service.Service

Twisted Service that contains a LoopingCall for regularly sending game details to the Evennia Game Index.

__init__()[source]

Initialize self. See help(type(self)) for accurate signature.

_die_on_bad_request()[source]

If it becomes apparent that our configuration is generating improperly formed messages to EGI, we don’t want to keep sending bad messages. Stop the service so we’re not wasting resources.

name = 'GameIndexClient'
startService()[source]
stopService()[source]