forked from vantablack/vantaMOO
Merge pull request 'Hide creator_ip from non-admins' (#31) from oreolek/vantaMOO:hiddenip into vanta
Reviewed-on: vantablack/vantaMOO#31
This commit is contained in:
commit
02e2c8832c
|
@ -0,0 +1,14 @@
|
||||||
|
from evennia.commands.default.building import CmdExamine
|
||||||
|
|
||||||
|
class CmdCustomExamine(CmdExamine):
|
||||||
|
def format_attributes(self, obj):
|
||||||
|
caller = self.caller
|
||||||
|
output = "\n "
|
||||||
|
for attr in obj.db_attributes.all():
|
||||||
|
if attr.db_key == "creator_ip" and not caller.permissions.check("Admin"):
|
||||||
|
continue
|
||||||
|
output += self.format_single_attribute(attr)
|
||||||
|
output += "\n "
|
||||||
|
if output.strip():
|
||||||
|
# we don't want just an empty line
|
||||||
|
return output
|
|
@ -23,6 +23,7 @@ from evennia.contrib.grid.ingame_map_display import MapDisplayCmdSet
|
||||||
from evennia.contrib.grid import simpledoor
|
from evennia.contrib.grid import simpledoor
|
||||||
from lib.rpsystem.rpsystem import RPSystemCmdSet
|
from lib.rpsystem.rpsystem import RPSystemCmdSet
|
||||||
from evennia.contrib.game_systems.clothing import ClothedCharacterCmdSet
|
from evennia.contrib.game_systems.clothing import ClothedCharacterCmdSet
|
||||||
|
from commands.cmdcustomexamine import CmdCustomExamine
|
||||||
|
|
||||||
|
|
||||||
class CharacterCmdSet(default_cmds.CharacterCmdSet):
|
class CharacterCmdSet(default_cmds.CharacterCmdSet):
|
||||||
|
@ -65,6 +66,9 @@ class CharacterCmdSet(default_cmds.CharacterCmdSet):
|
||||||
# Clothing: wear
|
# Clothing: wear
|
||||||
self.add(ClothedCharacterCmdSet())
|
self.add(ClothedCharacterCmdSet())
|
||||||
|
|
||||||
|
# Overrides @examine
|
||||||
|
self.add(CmdCustomExamine())
|
||||||
|
|
||||||
class AccountCmdSet(default_cmds.AccountCmdSet):
|
class AccountCmdSet(default_cmds.AccountCmdSet):
|
||||||
"""
|
"""
|
||||||
This is the cmdset available to the Account at all times. It is
|
This is the cmdset available to the Account at all times. It is
|
||||||
|
|
Loading…
Reference in New Issue