Put all gmcp commands under the Core module for simplicity and compatibility with all the other protocols.
This commit is contained in:
parent
1ac81205c3
commit
4ccd78a97e
2 changed files with 9 additions and 35 deletions
|
|
@ -335,23 +335,3 @@ def unmonitor(session, *args, **kwargs):
|
|||
"""
|
||||
kwargs["stop"] = True
|
||||
monitor(session, *args, **kwargs)
|
||||
|
||||
|
||||
# aliases for GMCP
|
||||
gmcp_core_hello = client_options # Core.Hello
|
||||
gmcp_core_supports_set = client_options # Core.Supports.Set
|
||||
gmcp_core_supports_get = get_client_options # Evennia.Core.Supports.Get
|
||||
gmcp_core_commands_get = get_inputfuncs # Core.Commands.Get
|
||||
gmcp_char_login = login # Char.Login
|
||||
gmcp_char_value_get = get_value # Char.Value.Get
|
||||
gmcp_char_repeat_on = repeat # Char.Repeat.On
|
||||
gmcp_char_repeat_off = unrepeat # Char.Repeat.Off
|
||||
gmcp_char_monitor_on = monitor # Char.Monitor.On
|
||||
gmcp_char_monitor_off = unmonitor # Char.Monitor.Off
|
||||
|
||||
# aliases for MSDP
|
||||
#SEND = get_value # SEND
|
||||
#REPEAT = repeat # REPEAT
|
||||
#UNREPEAT = unrepeat # UNREPEAT
|
||||
#MONITOR = monitor # REPORT
|
||||
#LIST = get_inputfuncs # LIST
|
||||
|
|
|
|||
|
|
@ -348,11 +348,11 @@ class TelnetOOB(object):
|
|||
|
||||
The following is parsed into Evennia's formal structure:
|
||||
|
||||
Module.Name -> [Module_Name, [], {}]
|
||||
Module.Name string -> [Module_Name, [string], {}]
|
||||
Module.Name [arg, arg,...] -> [Module_Name, [args], {}]
|
||||
Module.Name {key:arg, key:arg, ...} -> [Module_Name, [], {kwargs}]
|
||||
Module.Name [[args], {kwargs}] -> [Module_Name, [args], {kwargs}]
|
||||
Core.Name -> [name, [], {}]
|
||||
Core.Name string -> [name, [string], {}]
|
||||
Core.Name [arg, arg,...] -> [name, [args], {}]
|
||||
Core.Name {key:arg, key:arg, ...} -> [name, [], {kwargs}]
|
||||
Core.Name [[args], {kwargs}] -> [name, [args], {kwargs}]
|
||||
|
||||
"""
|
||||
if hasattr(data, "__iter__"):
|
||||
|
|
@ -377,16 +377,10 @@ class TelnetOOB(object):
|
|||
args = list(structure)
|
||||
else:
|
||||
args = (structure,)
|
||||
if cmdname.startswith("Custom.Cmd."):
|
||||
# if Custom.Cmd.Cmdname, then use Cmdname
|
||||
cmdname = cmdname[11:]
|
||||
else:
|
||||
# not a custom command - convert the input name to a
|
||||
# Python form such that Core.Supports.Get ->
|
||||
# gmcp_core_supports_get
|
||||
cmdname = "gmcp_%s" % "_".join(part.lower() for part in cmdname.split("."))
|
||||
print "gmcp data in:", {cmdname: [args, kwargs]}
|
||||
self.protocol.data_in(**{cmdname: [args, kwargs]})
|
||||
if cmdname.lower().startswith("core_"):
|
||||
# if Core.cmdname, then use cmdname
|
||||
cmdname = cmdname[5:]
|
||||
self.protocol.data_in(**{cmdname.lower(): [args, kwargs]})
|
||||
|
||||
# access methods
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue