Added more permission info to ooclook.

This commit is contained in:
Griatch 2013-03-12 10:29:21 +01:00
parent de076d4af4
commit 11d612a72a
2 changed files with 22 additions and 19 deletions

View file

@ -9,6 +9,8 @@ from src.utils import utils, search, create
from src.objects.models import ObjectNick as Nick from src.objects.models import ObjectNick as Nick
from src.commands.default.muxcommand import MuxCommand, MuxCommandOOC from src.commands.default.muxcommand import MuxCommand, MuxCommandOOC
from settings import MAX_NR_CHARACTERS
# limit symbol import for API # limit symbol import for API
__all__ = ("CmdHome", "CmdLook", "CmdPassword", "CmdNick", __all__ = ("CmdHome", "CmdLook", "CmdPassword", "CmdNick",
"CmdInventory", "CmdGet", "CmdDrop", "CmdGive", "CmdQuit", "CmdWho", "CmdInventory", "CmdGet", "CmdDrop", "CmdGive", "CmdQuit", "CmdWho",
@ -835,17 +837,18 @@ class CmdOOCLook(MuxCommandOOC, CmdLook):
# character is already puppeted # character is already puppeted
sess = player.get_session(csessid) sess = player.get_session(csessid)
if hasattr(char.locks, "lock_bypass") and char.locks.lock_bypass: if hasattr(char.locks, "lock_bypass") and char.locks.lock_bypass:
string += "\n - {G%s{n (superuser character) (played by you from session with id %i)" % (char.key, sess.sessid) string += "\n - {G%s{n [superuser character] (played by you from session with id %i)" % (char.key, sess.sessid)
elif sess: elif sess:
string += "\n - {G%s{n (played by you from session with id %i)" % (char.key, sess.sessid) string += "\n - {G%s{n [%s] (played by you session id %i)" % (char.key, ", ".join(char.permissions), sess.sessid)
else: else:
string += "\n - {R%s{n (played by someone else)" % char.key string += "\n - {R%s{n [%s] (played by someone else)" % (char.key, ", ".join(char.permissions))
else: else:
# character is "free to puppet" # character is "free to puppet"
if player.is_superuser and char.get_attribute("_superuser_character"): if player.is_superuser and char.get_attribute("_superuser_character"):
string += "\n - %s (superuser character)" % (char.key) string += "\n - %s [Superuser character]" % (char.key)
else: else:
string += "\n - %s" % char.key string += "\n - %s [%s]" % (char.key, ", ".join(char.permissions))
string = ("-" * 68) + "\n" + string + "\n" + ("-" * 68)
self.msg(string) self.msg(string)
def func(self): def func(self):
@ -872,8 +875,6 @@ class CmdCharCreate(MuxCommandOOC):
locks = "cmd:all()" locks = "cmd:all()"
help_category = "General" help_category = "General"
MAX_NR_CHARACTERS = 2
def func(self): def func(self):
"create the new character" "create the new character"
player = self.caller player = self.caller

View file

@ -62,12 +62,6 @@ SSL_ENABLED = False
SSL_PORTS = [4001] SSL_PORTS = [4001]
# Interface addresses to listen to. If 0.0.0.0, listen to all. # Interface addresses to listen to. If 0.0.0.0, listen to all.
SSL_INTERFACES = ['0.0.0.0'] SSL_INTERFACES = ['0.0.0.0']
# Multisession modes allow a player (=account) to connect to the game simultaneously
# with multiple clients (=sessions) in various ways according to the set mode:
# 0 - no multisession - when a new session is connected, the old one is disconnected
# 1 - multiple sessions, one player, one character, each session getting the same data
# 2 - multiple sessions, one player, each session controlling different characters
MULTISESSION_MODE = 0
# The path that contains this settings.py file (no trailing slash). # The path that contains this settings.py file (no trailing slash).
BASE_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) BASE_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Path to the src directory containing the bulk of the codebase's code. # Path to the src directory containing the bulk of the codebase's code.
@ -203,6 +197,9 @@ MSSP_META_MODULE = ""
# Module holding server-side custom functions for out-of-band protocols to call. # Module holding server-side custom functions for out-of-band protocols to call.
# Note that OOB_ENABLED must be True for this to be used. # Note that OOB_ENABLED must be True for this to be used.
OOB_FUNC_MODULE = "" # Not yet available in Evennia - do not use! OOB_FUNC_MODULE = "" # Not yet available in Evennia - do not use!
# Tuple of modules implementing lock functions. All callable functions
# inside these modules will be available as lock functions.
LOCK_FUNC_MODULES = ("src.locks.lockfuncs",)
###################################################################### ######################################################################
# Default command sets # Default command sets
@ -285,18 +282,23 @@ TIME_MONTH_PER_YEAR = 12
###################################################################### ######################################################################
# In-Game access # Default Player setup and access
###################################################################### ######################################################################
# Multisession modes allow a player (=account) to connect to the game simultaneously
# with multiple clients (=sessions) in various ways according to the set mode:
# 0 - no multisession - when a new session is connected, the old one is disconnected
# 1 - multiple sessions, one player, one character, each session getting the same data
# 2 - multiple sessions, one player, each session controlling different characters
MULTISESSION_MODE = 0
# The maximum number of characters allowed for MULTISESSION_MODE 1 or 2. This is checked
# by the default char-creation commands in this mode. Forced to 1 for MULTISESSION_MODE=0.
MAX_NR_CHARACTERS = 2
# The access hiearchy, in climbing order. A higher permission in the # The access hiearchy, in climbing order. A higher permission in the
# hierarchy includes access of all levels below it. # hierarchy includes access of all levels below it.
PERMISSION_HIERARCHY = ("Players","PlayerHelpers","Builders", "Wizards", "Immortals") PERMISSION_HIERARCHY = ("Players","PlayerHelpers","Builders", "Wizards", "Immortals")
# The default permission given to all new players # The default permission given to all new players
PERMISSION_PLAYER_DEFAULT = "Players" PERMISSION_PLAYER_DEFAULT = "Players"
# Tuple of modules implementing lock functions. All callable functions
# inside these modules will be available as lock functions.
LOCK_FUNC_MODULES = ("src.locks.lockfuncs",)
###################################################################### ######################################################################
# In-game Channels created from server start # In-game Channels created from server start