Some fixes to the connection wizard; Add MSSP guide.

This commit is contained in:
Griatch 2020-09-16 19:55:10 +02:00
parent 488707b5b9
commit 68f4e9041a
4 changed files with 91 additions and 50 deletions

View file

@ -20,11 +20,11 @@ needed on the Evennia side.
MSSPTable = { MSSPTable = {
# Required fields # Required fields
"NAME": "Evennia", "NAME": "Mygame", # usually the same as SERVERNAME
# Generic # Generic
"CRAWL DELAY": "-1", # limit how often crawler updates the listing. -1 for no limit "CRAWL DELAY": "-1", # limit how often crawler may update the listing. -1 for no limit
"HOSTNAME": "", # current or new hostname "HOSTNAME": "", # telnet hostname
"PORT": ["4000"], # most important port should be *last* in list! "PORT": ["4000"], # telnet port - most important port should be *last* in list!
"CODEBASE": "Evennia", "CODEBASE": "Evennia",
"CONTACT": "", # email for contacting the mud "CONTACT": "", # email for contacting the mud
"CREATED": "", # year MUD was created "CREATED": "", # year MUD was created
@ -33,7 +33,7 @@ MSSPTable = {
"LANGUAGE": "", # name of language used, e.g. English "LANGUAGE": "", # name of language used, e.g. English
"LOCATION": "", # full English name of server country "LOCATION": "", # full English name of server country
"MINIMUM AGE": "0", # set to 0 if not applicable "MINIMUM AGE": "0", # set to 0 if not applicable
"WEBSITE": "www.evennia.com", "WEBSITE": "", # http:// address to your game website
# Categorisation # Categorisation
"FAMILY": "Custom", # evennia goes under 'Custom' "FAMILY": "Custom", # evennia goes under 'Custom'
"GENRE": "None", # Adult, Fantasy, Historical, Horror, Modern, None, or Science Fiction "GENRE": "None", # Adult, Fantasy, Historical, Horror, Modern, None, or Science Fiction
@ -41,10 +41,10 @@ MSSPTable = {
# Player versus Player, Player versus Environment, # Player versus Player, Player versus Environment,
# Roleplaying, Simulation, Social or Strategy # Roleplaying, Simulation, Social or Strategy
"GAMEPLAY": "", "GAMEPLAY": "",
"STATUS": "Open Beta", # Alpha, Closed Beta, Open Beta, Live "STATUS": "Open Beta", # Allowed: Alpha, Closed Beta, Open Beta, Live
"GAMESYSTEM": "Custom", # D&D, d20 System, World of Darkness, etc. Use Custom if homebrew "GAMESYSTEM": "Custom", # D&D, d20 System, World of Darkness, etc. Use Custom if homebrew
# Subgenre: LASG, Medieval Fantasy, World War II, Frankenstein, # Subgenre: LASG, Medieval Fantasy, World War II, Frankenstein,
# Cyberpunk, Dragonlance, etc. Or None if not available. # Cyberpunk, Dragonlance, etc. Or None if not applicable.
"SUBGENRE": "None", "SUBGENRE": "None",
# World # World
"AREAS": "0", "AREAS": "0",
@ -56,7 +56,7 @@ MSSPTable = {
"LEVELS": "0", # use 0 if level-less "LEVELS": "0", # use 0 if level-less
"RACES": "0", # use 0 if race-less "RACES": "0", # use 0 if race-less
"SKILLS": "0", # use 0 if skill-less "SKILLS": "0", # use 0 if skill-less
# Protocols set to 1 or 0) # Protocols set to 1 or 0; should usually not be changed)
"ANSI": "1", "ANSI": "1",
"GMCP": "1", "GMCP": "1",
"MSDP": "1", "MSDP": "1",

View file

@ -44,7 +44,7 @@ class ConnectionWizard(object):
resp = str(default) resp = str(default)
if resp.lower() in options: if resp.lower() in options:
self.display(f" Selected '{resp}'.") # self.display(f" Selected '{resp}'.")
desc, callback, kwargs = options[resp.lower()] desc, callback, kwargs = options[resp.lower()]
callback(self, **kwargs) callback(self, **kwargs)
elif resp.lower() in ("quit", "q"): elif resp.lower() in ("quit", "q"):
@ -161,8 +161,10 @@ class ConnectionWizard(object):
def node_start(wizard): def node_start(wizard):
text = """ text = """
This wizard helps activate external networks with Evennia. It will create This wizard helps to attach your Evennia server to external networks. It
a config that will be attached to the bottom of the game settings file. will save to a file `server/conf/connection_settings.py` that will be
imported from the bottom of your game settings file. Once generated you can
also modify that file directly.
Make sure you have at least started the game once before continuing! Make sure you have at least started the game once before continuing!
@ -174,11 +176,18 @@ def node_start(wizard):
node_game_index_start, node_game_index_start,
{}, {},
), ),
# "2": ("Add MSSP information (for mud-list crawlers)", "2": ("MSSP setup (for mud-list crawlers)",
# node_mssp_start, {}), node_mssp_start, {}
),
# "3": ("Add Grapevine listing", # "3": ("Add Grapevine listing",
# node_grapevine_start, {}), # node_grapevine_start, {}),
"2": ("View and Save created settings", node_view_and_apply_settings, {}), # "4": ("Add IRC link",
# "node_irc_start", {}),
# "5" ("Add RSS feed",
# "node_rss_start", {}),
"s": ("View and (optionally) Save created settings",
node_view_and_apply_settings, {}),
"q": ("Quit", lambda *args: sys.exit(), {}),
} }
wizard.display(text) wizard.display(text)
@ -189,13 +198,13 @@ def node_start(wizard):
def node_game_index_start(wizard, **kwargs): def node_game_index_start(wizard, **kwargs):
text = f""" text = """
The Evennia game index (http://games.evennia.com) lists both active Evennia The Evennia game index (http://games.evennia.com) lists both active Evennia
games as well as games in various stages of development. games as well as games in various stages of development.
You can put up your game in the index also if you are not (yet) open for You can put up your game in the index also if you are not (yet) open for
players. If so, put 'None' for the connection details. Just tell us you players. If so, put 'None' for the connection details - you are just telling
are out there and make us excited about your upcoming game! us that you are out there, making us excited about your upcoming game!
Please check the listing online first to see that your exact game name is Please check the listing online first to see that your exact game name is
not colliding with an existing game-name in the list (be nice!). not colliding with an existing game-name in the list (be nice!).
@ -222,9 +231,9 @@ def node_game_index_fields(wizard, status=None):
- pre-alpha: a game in its very early stages, mostly unfinished or unstarted - pre-alpha: a game in its very early stages, mostly unfinished or unstarted
- alpha: a working concept, probably lots of bugs and incomplete features - alpha: a working concept, probably lots of bugs and incomplete features
- beta: a working game, but expect bugs and changing features - beta: a working game, but expect bugs and changing features
- launched: a full, working game that may still be expanded upon and improved later - launched: a full, working game (that may still be expanded upon and improved later)
Current value: Current value (return to keep):
{status_default} {status_default}
""" """
@ -233,6 +242,31 @@ def node_game_index_fields(wizard, status=None):
wizard.display(text) wizard.display(text)
wizard.game_index_listing["game_status"] = wizard.ask_choice("Select one: ", options) wizard.game_index_listing["game_status"] = wizard.ask_choice("Select one: ", options)
# game name
name_default = settings.SERVERNAME
text = f"""
Your game's name should usually be the same as `settings.SERVERNAME`, but
you can set it to something else here if you want.
Current value:
{name_default}
"""
def name_validator(inp):
tmax = 80
tlen = len(inp)
if tlen > tmax:
print(f"The name must be shorter than {tmax} characters (was {tlen}).")
wizard.ask_continue()
return False
return True
wizard.display(text)
wizard.game_index_listing['game_name'] = wizard.ask_input(
default=name_default, validator=name_validator
)
# short desc # short desc
sdesc_default = wizard.game_index_listing.get("short_description", None) sdesc_default = wizard.game_index_listing.get("short_description", None)
@ -249,7 +283,7 @@ def node_game_index_fields(wizard, status=None):
def sdesc_validator(inp): def sdesc_validator(inp):
tmax = 255 tmax = 255
tlen = len(inp) tlen = len(inp)
if tlen > 255: if tlen > tmax:
print(f"The short desc must be shorter than {tmax} characters (was {tlen}).") print(f"The short desc must be shorter than {tmax} characters (was {tlen}).")
wizard.ask_continue() wizard.ask_continue()
return False return False
@ -341,7 +375,7 @@ def node_game_index_fields(wizard, status=None):
Evennia is its own web server and runs your game's website. Enter the Evennia is its own web server and runs your game's website. Enter the
URL of the website here, like http://yourwebsite.com, here. URL of the website here, like http://yourwebsite.com, here.
Wtite 'None' if you are not offering a publicly visible website at this time. Write 'None' if you are not offering a publicly visible website at this time.
Current value: Current value:
{website_default} {website_default}
@ -359,7 +393,7 @@ def node_game_index_fields(wizard, status=None):
your specific URL here (when clicking this link you should launch into the your specific URL here (when clicking this link you should launch into the
web client) web client)
Wtite 'None' if you don't want to list a publicly accessible webclient. Write 'None' if you don't want to list a publicly accessible webclient.
Current value: Current value:
{webclient_default} {webclient_default}
@ -388,24 +422,26 @@ def node_game_index_fields(wizard, status=None):
def node_mssp_start(wizard): def node_mssp_start(wizard):
mssp_module = mod_import(settings.MSSP_META_MODULE) mssp_module = mod_import(settings.MSSP_META_MODULE or "server.conf.mssp")
try:
filename = mssp_module.__file__ filename = mssp_module.__file__
except AttributeError:
filename = "server/conf/mssp.py"
text = f""" text = f"""
MSSP (Mud Server Status Protocol) allows online MUD-listing sites/crawlers MSSP (Mud Server Status Protocol) has a vast amount of options so it must
to continuously monitor your game and list information about it. Some of be modified outside this wizard by directly editing its config file here:
this, like active player-count, Evennia will automatically add for you,
whereas many fields are manually added info about your game. '{filename}'
MSSP allows traditional online MUD-listing sites/crawlers to continuously
monitor your game and list information about it. Some of this, like active
player-count, Evennia will automatically add for you, whereas most fields
you need to set manually.
To use MSSP you should generally have a publicly open game that external To use MSSP you should generally have a publicly open game that external
players can connect to. You also need to register at a MUD listing site to players can connect to. You also need to register at a MUD listing site to
tell them to list your game. tell them to crawl your game.
MSSP has a large number of configuration options and we found it was simply
a lot easier to set them in a file rather than using this wizard. So to
configure MSSP, edit the empty template listing found here:
'{filename}'
""" """
wizard.display(text) wizard.display(text)
@ -456,25 +492,31 @@ def node_view_and_apply_settings(wizard):
pp = pprint.PrettyPrinter(indent=4) pp = pprint.PrettyPrinter(indent=4)
saves = False saves = False
game_index_txt = "No changes to save for Game Index." # game index
if hasattr(wizard, "game_index_listing"): game_index_save_text = ""
if wizard.game_index_listing != settings.GAME_INDEX_LISTING: game_index_listing = (wizard.game_index_listing if
game_index_txt = "No changes to save for Game Index." hasattr(wizard, "game_index_listing") else None)
else: if not game_index_listing and settings.GAME_INDEX_ENABLED:
game_index_txt = "GAME_INDEX_ENABLED = True\n" "GAME_INDEX_LISTING = \\\n" + pp.pformat( game_index_listing = settings.GAME_INDEX_LISTING
wizard.game_index_listing if game_index_listing:
game_index_save_text = (
"GAME_INDEX_ENABLED = True\n"
"GAME_INDEX_LISTING = \\\n" + pp.pformat(game_index_listing)
) )
saves = True saves = True
else:
game_index_save_text = "# No Game Index settings found."
text = game_index_txt # potentially add other wizards in the future
text = game_index_save_text
wizard.display(f"Settings to save:\n\n{text}") wizard.display(f"Settings to save:\n\n{text}")
if saves: if saves:
if wizard.ask_yesno("Do you want to save these settings?") == "yes": if wizard.ask_yesno("\nDo you want to save these settings?") == "yes":
wizard.save_output = text wizard.save_output = text
_save_changes(wizard) _save_changes(wizard)
wizard.display("... saved!") wizard.display("... saved!\nThe changes will apply after you reload your server.")
else: else:
wizard.display("... cancelled.") wizard.display("... cancelled.")
wizard.ask_continue() wizard.ask_continue()

View file

@ -1277,7 +1277,6 @@ def check_main_evennia_dependencies():
dversion = ".".join(str(num) for num in django.VERSION if isinstance(num, int)) dversion = ".".join(str(num) for num in django.VERSION if isinstance(num, int))
# only the main version (1.5, not 1.5.4.0) # only the main version (1.5, not 1.5.4.0)
dversion_main = ".".join(dversion.split(".")[:2]) dversion_main = ".".join(dversion.split(".")[:2])
print("dversion", dversion, DJANGO_MIN, DJANGO_LT)
if LooseVersion(dversion) < LooseVersion(DJANGO_MIN): if LooseVersion(dversion) < LooseVersion(DJANGO_MIN):
print(ERROR_DJANGO_MIN.format(dversion=dversion_main, django_min=DJANGO_MIN, print(ERROR_DJANGO_MIN.format(dversion=dversion_main, django_min=DJANGO_MIN,
django_lt=DJANGO_LT)) django_lt=DJANGO_LT))

View file

@ -730,9 +730,9 @@ CHANNEL_CONNECTINFO = None
GAME_INDEX_ENABLED = False GAME_INDEX_ENABLED = False
# This dict # This dict
GAME_INDEX_LISTING = { GAME_INDEX_LISTING = {
"game_name": SERVERNAME, "game_name": "Mygame", # usually SERVERNAME
"game_status": "pre-alpha", # pre-alpha, alpha, beta or launched "game_status": "pre-alpha", # pre-alpha, alpha, beta or launched
"short_description": GAME_SLOGAN, "short_description": "", # could be GAME_SLOGAN
"long_description": "", "long_description": "",
"listing_contact": "", # email "listing_contact": "", # email
"telnet_hostname": "", # mygame.com "telnet_hostname": "", # mygame.com