Make sure to read this document, and look at examples in the codebase before starting!
The master branch will only support game versions that are at least a half-step down from what is currently live in arcades. PRs for newer versions will be rejected.
The MegAime core represents the bundle of services that make up the aime network. This includes Allnet auth service, Billing service, Aimedb service, the Title service (see below), and the Frontend service. The server is designed in such a way that, if you are just adding game support, you should never have to modify the core.
The Allnet service provides the initial cabinet network authentication, as well as providing the url of the title server that the game will use.
The Billing service does credit management for games that use SEGA's billing service.
The AimeDB service manages cards and users network-wide. Games will make contact with this service when a user cards in to get their network-wide aime id, which they usually pass onto their title servers to get the user's data. It is noteable in that unlike the other services, it is a socket server instead of an HTTP one. You must also provide the AES key used to decrypt the requests. Server owners are responsible for finding this themselves.
The Title services manages the available title servers. No actual dispatching is done via this service, it just exists to give the core a way to know that each title server is availble. See below for more details.
The Frontend service manages the webui, the web interface that users can use to view scores, change settings, and other functions. It is up to title server developers to make their frontends.
Title servers add support for games. Every title server will be it's own independant server listening on it's own port. This means title servers are responsible for their own request handling, from start to finish. No title server dispatching is done by the core.
Every title server must be entirely located in a file in the titles directory, and have an __init__.py file that defines the following:
main- Title server entry point class. This class must have the following:
- An
__init__function that take 3 arguments:self, the core config as a Config object, and the directory to the config folder as a string - A
setupfunction who's only argument isself, which sets up the server's twistedendpoint
- An
- Title server entry point class. This class must have the following:
game_code- String containing the game's 4 letter game code (ex. SDFE for Wacca)
config_name- String containing the name of the config file for the game. Should end in ".yaml"
uri_hosts- Tuple containing the allnet startup uri at position 0, and the allnet startup host at position 1
alt_uri_hosts- Dict where keys are versions and values are
uri_hoststuples, used when the same game has different startup uri requirements across versions
- Dict where keys are versions and values are
dev_uri_hostsanddev_alt_uri_hosts- Alternet startup uris to use when running in development mode
frontend- Title server's frontend handling class
importer- Title server's data import handling class
MegAime uses a common database for all games, and has several general-purpose functions to interact with the database such that a developer should never be writing actual SQL code.