Add syntax hilighting in egi_client/README.md.

This commit is contained in:
Greg Taylor 2016-10-18 20:57:00 -07:00
parent 8561e3de23
commit 1781a5acda

View file

@ -19,50 +19,52 @@ Start by `cd`'ing to your game directory. From there, open up
`server/conf/server_services_plugins.py`. It might look something like this `server/conf/server_services_plugins.py`. It might look something like this
if you don't have any other optional add-ons enabled: if you don't have any other optional add-ons enabled:
""" ```python
Server plugin services """
Server plugin services
This plugin module can define user-created services for the Server to This plugin module can define user-created services for the Server to
start. start.
This module must handle all imports and setups required to start a This module must handle all imports and setups required to start a
twisted service (see examples in evennia.server.server). It must also twisted service (see examples in evennia.server.server). It must also
contain a function start_plugin_services(application). Evennia will contain a function start_plugin_services(application). Evennia will
call this function with the main Server application (so your services call this function with the main Server application (so your services
can be added to it). The function should not return anything. Plugin can be added to it). The function should not return anything. Plugin
services are started last in the Server startup process. services are started last in the Server startup process.
""" """
def start_plugin_services(server): def start_plugin_services(server):
""" """
This hook is called by Evennia, last in the Server startup process. This hook is called by Evennia, last in the Server startup process.
server - a reference to the main server application. server - a reference to the main server application.
""" """
pass pass
```
To enable the client, import `EvenniaGameIndexService` and fire it up after the To enable the client, import `EvenniaGameIndexService` and fire it up after the
Evennia server has finished starting: Evennia server has finished starting:
""" ```python
Server plugin services """
Server plugin services
This plugin module can define user-created services for the Server to This plugin module can define user-created services for the Server to
start. start.
This module must handle all imports and setups required to start a This module must handle all imports and setups required to start a
twisted service (see examples in evennia.server.server). It must also twisted service (see examples in evennia.server.server). It must also
contain a function start_plugin_services(application). Evennia will contain a function start_plugin_services(application). Evennia will
call this function with the main Server application (so your services call this function with the main Server application (so your services
can be added to it). The function should not return anything. Plugin can be added to it). The function should not return anything. Plugin
services are started last in the Server startup process. services are started last in the Server startup process.
""" """
from evennia.contrib.egi_client import EvenniaGameIndexService from evennia.contrib.egi_client import EvenniaGameIndexService
def start_plugin_services(server): def start_plugin_services(server):
""" """
This hook is called by Evennia, last in the Server startup process. This hook is called by Evennia, last in the Server startup process.
@ -70,16 +72,17 @@ Evennia server has finished starting:
""" """
egi_service = EvenniaGameIndexService() egi_service = EvenniaGameIndexService()
server.services.addService(egi_service) server.services.addService(egi_service)
```
Next, configure your game listing by opening up `server/conf/settings.py` and Next, configure your game listing by opening up `server/conf/settings.py` and
using the following as a starting point: using the following as a starting point:
###################################################################### ```python
# Contrib config ######################################################################
###################################################################### # Contrib config
######################################################################
GAME_INDEX_LISTING = { GAME_INDEX_LISTING = {
'game_status': 'pre-alpha', 'game_status': 'pre-alpha',
# Optional, comment out or remove if N/A # Optional, comment out or remove if N/A
'game_website': 'http://my-game.com', 'game_website': 'http://my-game.com',
@ -97,7 +100,8 @@ Next, configure your game listing by opening up `server/conf/settings.py` and
'telnet_port': 1234, 'telnet_port': 1234,
# At minimum, specify this or the telnet_* options. Both is fine, too. # At minimum, specify this or the telnet_* options. Both is fine, too.
'web_client_url': 'http://my-game.com/webclient', 'web_client_url': 'http://my-game.com/webclient',
} }
```
The following section in this README.md will go over all possible values. The following section in this README.md will go over all possible values.