Added more overloading modules and cleaned up the template some more.

This commit is contained in:
Griatch 2015-01-07 18:21:28 +01:00
parent ad3f19896c
commit 2c46ede247
19 changed files with 269 additions and 236 deletions

View file

@ -1,33 +1,30 @@
"""
Lockfuncs module template
Lockfuncs
Copy this module one level up, to gamesrc/conf/, name it what
you will and edit it to your liking.
Then add the new module's path to the end of the tuple
defined in settings.LOCK_FUNC_MODULES.
Lock functions are functions available when defining lock strings,
which in turn limits access to various game systems.
All functions defined globally in this module are assumed to be
available for use in lockstrings to determine access. See
http://code.google.com/p/evennia/wiki/Locks
available for use in lockstrings to determine access. See the
Evennia documentation for more info on locks.
A lock function is always called with two arguments, accessing_obj and
accessed_obj, followed by any number of arguments. All possible
arguments should be handled (excess ones calling magic (*args,
**kwargs) to avoid errors). The lock function should handle all
eventual tracebacks by logging the error and returning False.
arguments should be handled with *args, **kwargs. The lock function
should handle all eventual tracebacks by logging the error and
returning False.
See many more examples of lock functions in src.locks.lockfuncs.
Lock functions in this module extend (and will overload same-named)
lock functions from evennia.locks.lockfuncs.
"""
def myfalse(accessing_obj, accessed_obj, *args, **kwargs):
"""
called in lockstring with myfalse().
A simple logger that always returns false. Prints to stdout
for simplicity, should use utils.logger for real operation.
"""
print "%s tried to access %s. Access denied." % (accessing_obj, accessed_obj)
return False
#def myfalse(accessing_obj, accessed_obj, *args, **kwargs):
# """
# called in lockstring with myfalse().
# A simple logger that always returns false. Prints to stdout
# for simplicity, should use utils.logger for real operation.
# """
# print "%s tried to access %s. Access denied." % (accessing_obj, accessed_obj)
# return False