Page 1 of 1

Development status update (August 2016)

Posted: Thu Sep 01, 2016 6:13 pm
by Ayuto

Re: Development status update (August 2016)

Posted: Fri Sep 02, 2016 12:18 am
by Doldol
Removed sp load/reload/unload/list. Use sp plugin <command> instead.


You monsters!

Re: Development status update (August 2016)

Posted: Fri Sep 02, 2016 4:55 am
by Ayuto
That has been announced last month and they are raising a warning since two months. :D

Re: Development status update (August 2016)

Posted: Fri Sep 02, 2016 11:22 pm
by Doldol
Ayuto wrote:That has been announced last month and they are raising a warning since two months. :D


I've noticed, it's just that when you're testing, typing the old syntax was noticeably less annoying. Oh well, nothing serious.

Re: Development status update (August 2016)

Posted: Fri Sep 02, 2016 11:33 pm
by satoon101
Well, if you still want that functionality on your test server, you can always use something like this:

Syntax: Select all

from commands.typed import TypedServerCommand
from engines.server import engine_server

@TypedServerCommand(['sp', 'load'])
@TypedServerCommand(['sp', 'unload'])
@TypedServerCommand(['sp', 'reload'])
def _plugin_action(command_info, plugin):
engine_server.server_command(
'sp plugin {action} {plugin}'.format(
action=command_info.command[1],
plugin=plugin,
)
)

Re: Development status update (August 2016)

Posted: Sat Sep 03, 2016 12:30 am
by Doldol
satoon101 wrote:Well, if you still want that functionality on your test server, you can always use something like this:


Thanks, but I already took the opportunity and went a bit further and implemented the commands spl, spu and spr for these actions ^^.

But is there a reason for using TypedServerCommand in your code, since you don't specify a type for any arguments?

Re: Development status update (August 2016)

Posted: Sat Sep 03, 2016 1:34 am
by satoon101
Typed<type>Commands take sub-commands into account. If you notice, I pass the sub-commands load, unload, and reload. If I used ServerCommand instead, I would have to check for the sub-command. Either that, or I would just accept all sub-commands and pass them. I chose to do the former because that is specifically what was necessary to implement the 3 sub-commands.

Re: Development status update (August 2016)

Posted: Sat Sep 03, 2016 6:21 am
by Ayuto
Moreover, you don't need to check the number of arguments and a help text is displayed if you do something wrong.

For spl, spr and spu you could also define aliases (alias spl sp plugin load).