Obs:Migrate. Made Comm system more generic, including the ability to connect arbitrary protocols to channels. Re-worked the IRC connectivity system - you can now again communicate between IRC and in-game evennia channels.

This commit is contained in:
Griatch 2011-04-10 12:39:07 +00:00
parent c81d238b0c
commit 52785e8f3e
20 changed files with 960 additions and 258 deletions

View file

@ -317,3 +317,30 @@ def superuser(*args, **kwargs):
"""
return False
def serversetting(accessing_obj, accessed_obj, *args, **kwargs):
"""
Only returns true if the Evennia settings exists, alternatively has a certain value.
Usage:
serversetting(IRC_ENABLED)
serversetting(BASE_SCRIPT_PATH, game.gamesrc.scripts)
A given True/False or integers will be converted properly.
"""
if not args:
return False
if len(args) < 2:
setting = args[0]
val = "True"
else:
setting, val = args[0], args[1]
# convert
if val == 'True':
val = True
elif val == 'False':
val = False
elif val.isdigit():
val = int(val)
if setting in settings._wrapped.__dict__:
return settings._wrapped.__dict__[setting] == val
return False