markweirath/big-brother-bot

Adv plugin : remove unsupported commands

Closed this issue · 4 comments

The adv plugin has commands that do not work (and will not) such as the one that would rewrite the plugin config file.

It would be better to remove them from the plugin

100614 22:15:09 DEBUG AdminPlugin: OnSay handle 5:"!advadd def"
100614 22:15:09 DEBUG AdminPlugin: Handle command !advadd def
100614 22:15:09 VERBOSE AdvPlugin: Save to XML config not supported
100614 22:15:09 DEBUG getCommand: ('admin.say', '[b3] [pm] Adv: "def" added', 'player', 'Garbitos')
100614 22:15:09 VERBOSE RCON (1/1) ('admin.say', '[b3] [pm] Adv: "def" added', 'player', 'Garbitos')
100614 22:15:09 ERROR handler AdminPlugin could not handle event Say: Exception: Save to XML config not supported [('D:\xampp\b3-1.3.2-src\b3\parser.py', 765, 'handleEvents', 'hfunc.parseEvent(event)'), ('D:\xampp\b3-1.3.2-src\b3\plugin.py', 157, 'parseEvent', 'self.onEvent(event)'), ('D:\xampp\b3-1.3.2-src\b3\plugin.py', 175, 'onEvent', 'self.handle(event)'), ('D:\xampp\b3-1.3.2-src\b3\plugins\admin.py', 172, 'handle', 'self.OnSay(event)'), ('D:\xampp\b3-1.3.2-src\b3\plugins\admin.py', 306, 'OnSay', 'results = command.execute(data, event.client)'), ('D:\xampp\b3-1.3.2-src\b3\plugins\admin.py', 1902, 'execute', 'self.func(data, client, copy.copy(self))'), ('D:\xampp\b3-1.3.2-src\b3\plugins\adv.py', 173, 'cmd_advadd', 'self.save()'), ('D:\xampp\b3-1.3.2-src\b3\plugins\adv.py', 133, 'save', "raise Exception('Save to XML config not supported')")]

100614 22:15:56 VERBOSE Queueing event Say !advrem
100614 22:15:56 VERBOSE Parsing Event: Say: CensorPlugin
100614 22:15:56 VERBOSE Parsing Event: Say: SpamcontrolPlugin
100614 22:15:56 VERBOSE Parsing Event: Say: AdminPlugin
100614 22:15:56 DEBUG AdminPlugin: OnSay handle 5:"!advrem"
100614 22:15:56 DEBUG AdminPlugin: Handle command !advrem
100614 22:15:56 DEBUG getCommand: ('admin.say', '[b3] [pm] There was an error processing your command', 'player', 'Garbitos')
100614 22:15:56 ERROR handler AdminPlugin could not handle event Say: ValueError: invalid literal for int() with base 10: '' [('D:\xampp\b3-1.3.2-src\b3\parser.py', 765, 'handleEvents', 'hfunc.parseEvent(event)'), ('D:\xampp\b3-1.3.2-src\b3\plugin.py', 157, 'parseEvent', 'self.onEvent(event)'), ('D:\xampp\b3-1.3.2-src\b3\plugin.py', 175, 'onEvent', 'self.handle(event)'), ('D:\xampp\b3-1.3.2-src\b3\plugins\admin.py', 172, 'handle', 'self.OnSay(event)'), ('D:\xampp\b3-1.3.2-src\b3\plugins\admin.py', 306, 'OnSay', 'results = command.execute(data, event.client)'), ('D:\xampp\b3-1.3.2-src\b3\plugins\admin.py', 1902, 'execute', 'self.func(data, client, copy.copy(self))'), ('D:\xampp\b3-1.3.2-src\b3\plugins\adv.py', 193, 'cmd_advrem', 'item = self._msg.getitem(int(data) - 1)')]

Yeah I dont see why you don't just remove the commands alltogether or simplify adv plugin.
1.) static advertisements added in .xml
2.) two commands to add/clear (!advadd/!advclear) for temporary advertisements that will show until b3 is shutdown maybe call them !promoadd/!promoclear (promotion).

I am not familiar with python at all...moderate experience with php,mysql,linux server...some lua. Have been running game servers in one form or another for like 8 years. Hopefully i can help you guys squash some bugs like this one.

When not using the XML adds, but instead load them from a .txt file, all commands work. It would be a loss of functionality to remove them from the plugin.

I'll unregister the !advsave command when XML adds are used, so it will no longer show up in the commandlist.

Fixed in the next version of B3 along with the other errors that went with this issue.