{"action":"closed","issue":{"url":"https://api.github.com/repos/evennia/evennia/issues/707","labels_url":"https://api.github.com/repos/evennia/evennia/issues/707/labels{/name}","comments_url":"https://api.github.com/repos/evennia/evennia/issues/707/comments","events_url":"https://api.github.com/repos/evennia/evennia/issues/707/events","html_url":"https://github.com/evennia/evennia/issues/707","id":61689642,"number":707,"title":"Bug: MSDP OOB errors","user":{"login":"Griatch","id":294267,"avatar_url":"https://avatars.githubusercontent.com/u/294267?v=3","gravatar_id":"","url":"https://api.github.com/users/Griatch","html_url":"https://github.com/Griatch","followers_url":"https://api.github.com/users/Griatch/followers","following_url":"https://api.github.com/users/Griatch/following{/other_user}","gists_url":"https://api.github.com/users/Griatch/gists{/gist_id}","starred_url":"https://api.github.com/users/Griatch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Griatch/subscriptions","organizations_url":"https://api.github.com/users/Griatch/orgs","repos_url":"https://api.github.com/users/Griatch/repos","events_url":"https://api.github.com/users/Griatch/events{/privacy}","received_events_url":"https://api.github.com/users/Griatch/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-14T20:25:46Z","updated_at":"2015-03-14T21:26:30Z","closed_at":"2015-03-14T21:26:30Z","body":"*Copied from the [mailing list posting](https://groups.google.com/forum/#!msg/evennia/8bXr1mU9PLc/xsgIPBAL5IAJ).*\r\n\r\nHello,\r\n\r\nI've been working extensively using Evennia in attempt to help a friend build a project.\r\n\r\nI'm really enjoying working with Evennia.Currently, I'm investing using a lua-based plugin in MushClient to utilize MSDP to orchestrate a gui.\r\n\r\nMind you, I have not overloaded `oob_cmds` or `oobhandler`.\r\n\r\nI have my MushClient lua based plugin send the string: `SendPkt (\"\\255\\250\\69\\1REPORT\\2CHARACTER_NAME\\255\\240\")`\r\n\r\nThe server errors with:\r\n```\r\n2015-03-13 01:01:49+0000 [AMPProtocol,0,127.0.0.1] [::] Traceback (most recent call last):\r\n2015-03-13 01:01:49+0000 [AMPProtocol,0,127.0.0.1] [::]   File \"/opt/evennia/evennia/server/oobhandler.py\", line 427, in execute_cmd\r\n2015-03-13 01:01:49+0000 [AMPProtocol,0,127.0.0.1] [::]     oobfunc(session, *args, **kwargs)\r\n2015-03-13 01:01:49+0000 [AMPProtocol,0,127.0.0.1] [::]   File \"/opt/evennia/evennia/server/oob_cmds.py\", line 254, in oob_report\r\n2015-03-13 01:01:49+0000 [AMPProtocol,0,127.0.0.1] [::]     OOB_HANDLER.add_field_monitor(obj, session.sessid, propname, \"return_field_report\")\r\n2015-03-13 01:01:49+0000 [AMPProtocol,0,127.0.0.1] [::] AttributeError: 'NoneType' object has no attribute 'add_field_monitor'\r\n2015-03-13 01:01:49+0000 [AMPProtocol,0,127.0.0.1] [EE] OOB ERROR: Exception in REPORT(*('CHARACTER_NAME',), **{}):\r\n2015-03-13 01:01:49+0000 [AMPProtocol,0,127.0.0.1] [EE] 'NoneType' object has no attribute 'add_field_monitor'\r\n```\r\n\r\nI work around this by manually applying the monitors via `@py` (to test it prior to doing it post_puppet)\r\n\r\n```\r\n@py from evennia import OOB_HANDLER;sessions = [self.player.get_session(sessid) for sessid in self.sessid.get()]; OOB_HANDLER.add_field_monitor(self, sessions[0].sessid, \"db_location\", \"return_field_report\")\r\n\r\n@py from evennia import OOB_HANDLER;sessions = [self.player.get_session(sessid) for sessid in self.sessid.get()]; OOB_HANDLER.add_attribute_monitor(self, sessions[0].sessid, \"health\", \"return_attribute_report\")\r\n```\r\n\r\nThis works. The lua client plugin sees and receives the updates.\r\n\r\nHowever, when I try to remove them with (pulled from the example in `oob_cmd.py`:\r\n\r\n```\r\n@py from evennia import OOB_HANDLER;sessions = [self.player.get_session(sessid) for sessid in self.sessid.get()]; OOB_HANDLER.remove_attribute_monitor(self, sessions[0].sessid, \"health\", \"oob_return_attribute_report\")\r\n```\r\n\r\n```\r\nI get:\r\n<<<   File \"/opt/evennia/evennia/server/oobhandler.py\", line 369, in remove_attribute_monitor\r\n<<<     self._remove_monitor(attrobj, sessid, \"db_value\", attr_name, oobfuncname)\r\n<<< TypeError: _remove_monitor() takes at most 5 arguments (6 given)\r\n```\r\n\r\nI decided to investigate the source code a bit and found in: [oobhandler.py](https://github.com/evennia/evennia/blob/96ac3f967b123564ff880209643761ec455a2982/evennia/server/oobhandler.py):\r\n\r\n```python\r\n172. def _remove_monitor(self, obj, sessid, fieldname, oobfuncname=None)\r\n....\r\n369. self._remove_monitor(attrobj, sessid, \"db_value\", attr_name, oobfuncname)\r\n```\r\n\r\nIt appears what `_remove_monitor` is expecting and what 'remove_attribute_monitor' is giving are polar opposites. I'm newish to PY, but most languages expect an order into functions and I have no evidence to suggest py is any different.\r\n\r\nThe reason I ask, is because if I have to write a cleanup to remove the monitors on character unpuppet, it needs to work. If I don't remove the monitors, and I disconnect/reconnect, then I have a whole 'nother mess of it not finding the sessions.\r\n\r\nPlease let me know if I'm way off base on this one."}}