Validating GMCP/MSDP protocol commands, first debugging run and fixes to make a few of the default inputfuncs work. Added INPUTDEBUG to the options dict, to echo input function errors directly.

This commit is contained in:
Griatch 2016-04-06 16:42:11 +02:00
parent 76dc51f885
commit 043be6dba4
6 changed files with 43 additions and 40 deletions

View file

@ -645,14 +645,18 @@ class ServerSessionHandler(SessionHandler):
# distribute incoming data to the correct receiving methods.
if session:
input_debug = session.protocol_flags.get("INPUTDEBUG", False)
for cmdname, (cmdargs, cmdkwargs) in kwargs.iteritems():
cname = cmdname.strip().lower()
try:
cmdkwargs.pop("options", None)
if cname in _INPUT_FUNCS:
_INPUT_FUNCS[cname](session, *cmdargs, **cmdkwargs)
else:
_INPUT_FUNCS["default"](session, cname, *cmdargs, **cmdkwargs)
except Exception:
except Exception, err:
if input_debug:
session.msg(err)
log_trace()
SESSION_HANDLER = ServerSessionHandler()