Development status update (August 2016)

Monthly status updates about Source.Python development.
User avatar
Doldol
Senior Member
Posts: 200
Joined: Sat Jul 07, 2012 7:09 pm
Location: Belgium

Re: Development status update (August 2016)

Postby Doldol » Fri Sep 02, 2016 12:18 am

Removed sp load/reload/unload/list. Use sp plugin <command> instead.


You monsters!
User avatar
Ayuto
Project Leader
Posts: 2193
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: Development status update (August 2016)

Postby Ayuto » Fri Sep 02, 2016 4:55 am

That has been announced last month and they are raising a warning since two months. :D
User avatar
Doldol
Senior Member
Posts: 200
Joined: Sat Jul 07, 2012 7:09 pm
Location: Belgium

Re: Development status update (August 2016)

Postby Doldol » Fri Sep 02, 2016 11:22 pm

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.
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Re: Development status update (August 2016)

Postby satoon101 » Fri Sep 02, 2016 11:33 pm

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,
)
)
Image
User avatar
Doldol
Senior Member
Posts: 200
Joined: Sat Jul 07, 2012 7:09 pm
Location: Belgium

Re: Development status update (August 2016)

Postby Doldol » Sat Sep 03, 2016 12:30 am

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?
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Re: Development status update (August 2016)

Postby satoon101 » Sat Sep 03, 2016 1:34 am

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.
Image
User avatar
Ayuto
Project Leader
Posts: 2193
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: Development status update (August 2016)

Postby Ayuto » Sat Sep 03, 2016 6:21 am

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).

Return to “Development Status Updates”

Who is online

Users browsing this forum: No registered users and 12 guests