Changed cmdhandler to include Session-level cmdset.

This commit is contained in:
Griatch 2013-09-08 00:14:06 +02:00
parent 07b1e40299
commit 1e96b13920
11 changed files with 205 additions and 80 deletions

View file

@ -1673,7 +1673,7 @@ class CmdExamine(ObjManipCommand):
caller.execute_cmd('look %s' % obj.name)
return
# using callback for printing result whenever function returns.
get_and_merge_cmdsets(obj).addCallback(get_cmdset_callback)
get_and_merge_cmdsets(obj, self.session, self.player, obj, "session").addCallback(get_cmdset_callback)
else:
self.msg("You need to supply a target to examine.")
return
@ -1708,7 +1708,7 @@ class CmdExamine(ObjManipCommand):
caller.msg(self.format_attributes(obj, attrname, crop=False))
else:
# using callback to print results whenever function returns.
get_and_merge_cmdsets(obj).addCallback(get_cmdset_callback)
get_and_merge_cmdsets(obj, self.session, self.player, obj, "session").addCallback(get_cmdset_callback)
class CmdFind(MuxCommand):

View file

@ -29,7 +29,7 @@ class PlayerCmdSet(CmdSet):
self.add(player.CmdIC())
self.add(player.CmdOOC())
self.add(player.CmdCharCreate())
self.add(player.CmdSessions())
#self.add(player.CmdSessions())
self.add(player.CmdWho())
self.add(player.CmdEncoding())
self.add(player.CmdQuit())

View file

@ -0,0 +1,16 @@
"""
This module stores session-level commands.
"""
from src.commands.cmdset import CmdSet
from src.commands.default import player
class SessionCmdSet(CmdSet):
"""
Sets up the unlogged cmdset.
"""
key = "DefaultSession"
priority = 0
def at_cmdset_creation(self):
"Populate the cmdset"
self.add(player.CmdSessions())