mirror of
https://github.com/evennia/evennia.git
synced 2026-03-17 05:16:31 +01:00
Lots of debug messages.
This commit is contained in:
parent
cc76de348e
commit
1981f8073f
3 changed files with 14 additions and 4 deletions
|
|
@ -272,30 +272,39 @@ def get_and_merge_cmdsets(caller, session, player, obj, callertype):
|
|||
except AttributeError:
|
||||
returnValue(((None, None, None), []))
|
||||
|
||||
print "callertype:", callertype
|
||||
local_obj_cmdsets = []
|
||||
if callertype == "session":
|
||||
# we are calling the command from the session level
|
||||
report_to = session
|
||||
current, cmdsets = yield _get_cmdsets(session)
|
||||
print "session cmdsets:", len(cmdsets)
|
||||
if player: # this automatically implies logged-in
|
||||
pcurrent, player_cmdsets = yield _get_cmdsets(player)
|
||||
print "player cmdsets:", len(player_cmdsets)
|
||||
cmdsets += player_cmdsets
|
||||
current = current + pcurrent
|
||||
if obj:
|
||||
ocurrent, obj_cmdsets = yield _get_cmdsets(obj)
|
||||
print "obj_cmdsets:", len(obj_cmdsets), [cmdset.key for cmdset in obj_cmdsets]
|
||||
current = current + ocurrent
|
||||
cmdsets += obj_cmdsets
|
||||
if not current.no_objs:
|
||||
local_obj_cmdsets = yield _get_local_obj_cmdsets(obj)
|
||||
print "local_obj_cmdsets:", len(local_obj_cmdsets), [cmdset.key for cmdset in local_obj_cmdsets]
|
||||
if current.no_exits:
|
||||
# filter out all exits
|
||||
local_obj_cmdsets = [cmdset for cmdset in local_obj_cmdsets if cmdset.key != "ExitCmdSet"]
|
||||
cmdsets += local_obj_cmdsets
|
||||
if not current.no_channels:
|
||||
# also objs may have channels
|
||||
cmdsets += yield _get_channel_cmdset(obj)
|
||||
channel_cmdsets = yield _get_channel_cmdset(obj)
|
||||
print "obj channel cmdsets:", len(channel_cmdsets), [cmdset.key for cmdset in channel_cmdsets]
|
||||
cmdsets += channel_cmdsets
|
||||
if not current.no_channels:
|
||||
cmdsets += yield _get_channel_cmdset(player)
|
||||
channel_cmdsets = yield _get_channel_cmdset(obj)
|
||||
print "player channel cmdsets:", len(channel_cmdsets), [cmdset.key for cmdset in channel_cmdsets]
|
||||
cmdsets += channel_cmdsets
|
||||
|
||||
elif callertype == "player":
|
||||
# we are calling the command from the player level
|
||||
|
|
@ -343,6 +352,7 @@ def get_and_merge_cmdsets(caller, session, player, obj, callertype):
|
|||
if cmdsets:
|
||||
# faster to do tuple on list than to build tuple directly
|
||||
mergehash = tuple([id(cmdset) for cmdset in cmdsets])
|
||||
print "len(mergehash):", len(mergehash)
|
||||
if mergehash in _CMDSET_MERGE_CACHE:
|
||||
# cached merge exist; use that
|
||||
cmdset = _CMDSET_MERGE_CACHE[mergehash]
|
||||
|
|
@ -372,7 +382,6 @@ def get_and_merge_cmdsets(caller, session, player, obj, callertype):
|
|||
_CMDSET_MERGE_CACHE[mergehash] = cmdset
|
||||
else:
|
||||
cmdset = None
|
||||
|
||||
for cset in (cset for cset in local_obj_cmdsets if cset):
|
||||
cset.duplicates = cset.old_duplicates
|
||||
returnValue(cmdset)
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ class CmdLook(COMMAND_DEFAULT_CLASS):
|
|||
target = self.caller.search(self.args)
|
||||
if not target:
|
||||
return
|
||||
print "cmdlook:", id(self), id(self.cmdset)
|
||||
self.msg(self.caller.at_look(target))
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ command definition too) with function defintions:
|
|||
# code
|
||||
return text, options
|
||||
|
||||
def node_with_other_namen(caller, input_string):
|
||||
def node_with_other_name(caller, input_string):
|
||||
# code
|
||||
return text, options
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue