Questions about engines downloads

Questions about engines downloads

SpringRTS Perl Autohost for Dedicated Server

Moderators: Moderators, Lobby Developers, SPADS AutoHost

Post Reply
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Questions about engines downloads

Post by Jools »

How does spads download a new engine if this isn't found? Does it use pr-downbloader?

Because there's a small issue: pr-downloader puts the stuff in a folder called:

Code: Select all

springdatadir/engine/103.0/
Whereas spads appends -linux64 to the folder name:

Code: Select all

springdatadir/engine/103.0-linux64/
Is it possible to make both systems use same syntax?
User avatar
bibim
Lobby Developer
Posts: 952
Joined: 06 Dec 2007, 11:12

Re: SPADS AutoHost

Post by bibim »

Jools wrote:How does spads download a new engine if this isn't found?
SPADS just retrieves the official Spring static binary packages and extracts the files required for autohosting only.
Jools wrote:Does it use pr-downbloader?
No, SPADS doesn't use pr-downloader.

SPADS doesn't store engines in Spring data dir, new engines are stored in the directory configured by the autoManagedSpringDir setting.
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: SPADS AutoHost

Post by Jools »

Would it be possible to have a an accessor to the module in spads that loads those files? Because it's obviously better to just download what you need, but ity's also better to download the engine before you restart the autohost. I'm thinking about the DownLoadArchives and SetEngine plugins.
User avatar
bibim
Lobby Developer
Posts: 952
Joined: 06 Dec 2007, 11:12

Re: SPADS AutoHost

Post by bibim »

Jools wrote:Would it be possible to have a an accessor to the module in spads that loads those files? Because it's obviously better to just download what you need, but ity's also better to download the engine before you restart the autohost. I'm thinking about the DownLoadArchives and SetEngine plugins.
Sure, if you don't want to let SPADS core auto-manage Spring engines, you can call the SpadsUpdater module from a plugin instead (in particular the setupSpring function).
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Questions about engines downloads

Post by Jools »

Yes, for the purposes of testing the game, it's not always the latest test version that we want, so its better if it's easy to switch between versions easily.

Luckily it's just a matter of changing the automanaged setting in spads.conf, but the problem I have is finding the path and name of the config file itself, I do not always have it called spads.conf
User avatar
bibim
Lobby Developer
Posts: 952
Joined: 06 Dec 2007, 11:12

Re: Questions about engines downloads

Post by bibim »

Jools wrote:the problem I have is finding the path and name of the config file itself, I do not always have it called spads.conf
Why do you need several spads.conf files?
Personally I find it much easier to manage when you use only one spads.conf file and declare several presets in it. That way, you just need to change the defaultPreset value for each autohost instance.

Also, fortunately you don't need to edit the spads.conf file each time you want to change Spring version. You just need to use a config macro for the autoManagedSpringVersion setting, so that you can declare the Spring version as command line parameter.
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Questions about engines downloads

Post by Jools »

bibim wrote:
Jools wrote:the problem I have is finding the path and name of the config file itself, I do not always have it called spads.conf
Why do you need several spads.conf files?
In case I need to write to one conf file while another host is running. That way you can take down one host and do maintenance without affecting the others.

bibim wrote:Also, fortunately you don't need to edit the spads.conf file each time you want to change Spring version. You just need to use a config macro for the autoManagedSpringVersion setting, so that you can declare the Spring version as command line parameter.
[/quote]
Nice, I'll look into this. Are there any examples of this? I'm rusty with perl/spads again.
User avatar
bibim
Lobby Developer
Posts: 952
Joined: 06 Dec 2007, 11:12

Re: Questions about engines downloads

Post by bibim »

Jools wrote:
bibim wrote:Why do you need several spads.conf files?
In case I need to write to one conf file while another host is running. That way you can take down one host and do maintenance without affecting the others.
There is a much simpler way to do that using config macros. You don't need to actually write a new conf file each time you change Spring version.
Jools wrote:Are there any examples of this? I'm rusty with perl/spads again.
Sure, config macros are explained in this post.

In your case, you could edit your spads.conf so that the autoManagedSpringVersion setting is defined using a config macro:

Code: Select all

autoManagedSpringVersion:%mySpringVersion%
Once you have done that, you just need to launch SPADS adding the config macro definition as command line parameter, for example:

Code: Select all

./spads.pl etc/spads.conf mySpringVersion=104.0
Don't hesitate if you need more details/explanations.
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Questions about engines downloads

Post by Jools »

bibim wrote: In your case, you could edit your spads.conf so that the autoManagedSpringVersion setting is defined using a config macro:

Code: Select all

autoManagedSpringVersion:%mySpringVersion%
Once you have done that, you just need to launch SPADS adding the config macro definition as command line parameter, for example:

Code: Select all

./spads.pl etc/spads.conf mySpringVersion=104.0
Don't hesitate if you need more details/explanations.
I'm not restarting via the command line but via spads method restartAfterGame(). Would it be possible to pass that parameter to that function instead?
User avatar
bibim
Lobby Developer
Posts: 952
Joined: 06 Dec 2007, 11:12

Re: Questions about engines downloads

Post by bibim »

If you want to change the Spring version used by SPADS from lobby, you can directly use the restart command, which accepts config macros redefinitions as parameters.

For example, if you used the mySpringVersion config macro as explained previously:

Code: Select all

!restart empty mySpringVersion=104.0
If you want to restart SPADS from a plugin, you could call the hRestart function which is the handler of the restart command, and redefine the config macros by passing the correct parameters as well.
Post Reply

Return to “SPADS AutoHost”