Added more error checking to the oob function launch code.
This commit is contained in:
parent
d928d25ac7
commit
329a13bf8a
1 changed files with 10 additions and 1 deletions
|
|
@ -232,11 +232,20 @@ class ServerSession(Session):
|
||||||
print "server: "
|
print "server: "
|
||||||
outdata = {}
|
outdata = {}
|
||||||
|
|
||||||
|
entity = self.get_character()
|
||||||
|
if not entity:
|
||||||
|
entity = self.get_player()
|
||||||
|
if not entity:
|
||||||
|
entity = self
|
||||||
|
|
||||||
for funcname, argtuple in data.items():
|
for funcname, argtuple in data.items():
|
||||||
# loop through the data, calling available functions.
|
# loop through the data, calling available functions.
|
||||||
func = OOB_FUNC_MODULE.__dict__.get(funcname, None)
|
func = OOB_FUNC_MODULE.__dict__.get(funcname, None)
|
||||||
if func:
|
if func:
|
||||||
outdata[funcname] = func(*argtuple[0], **argtuple[1])
|
try:
|
||||||
|
outdata[funcname] = func(entity, *argtuple[0], **argtuple[1])
|
||||||
|
except Exception:
|
||||||
|
logger.log_trace()
|
||||||
else:
|
else:
|
||||||
logger.log_errmsg("oob_data_in error: funcname '%s' not found in OOB_FUNC_MODULE." % funcname)
|
logger.log_errmsg("oob_data_in error: funcname '%s' not found in OOB_FUNC_MODULE." % funcname)
|
||||||
if outdata:
|
if outdata:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue