Switching to lobbies from Spring.exe

Switching to lobbies from Spring.exe

Requests for features in the spring code.

Moderator: Moderators

Post Reply
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Switching to lobbies from Spring.exe

Post by zwzsg »

So, now I can restart Spring.exe from within itself, and that is good. It allows me to have an ingame menu to manage campaigns and skirmishes, all done in Lua within the mod, so customised, cross-platform and easy to develop.

So now that step 1 (single player) is covered, let's move to step 2 (multiplayer): While writing a single player battleroom with the existing Lua is now very doable, I don't think making an in-Spring.exe multiplayer lobby as feature full as the current lobby would be ever feasible, or even a good idea. Seem to me better to still have them as an external application. But I'd still like Spring.exe to be able to redirect to them multiplayer lobby.

So my feature request is for a way for Spring.exe to launch a multiplayer lobby.

However, Spring doesn't have one lobby, but several competing ones. With challengers appearing, old projects getting abandonned, and many mysterious side projects each promising its own revolution. So we can't just have one call to one hard coded lobby name.


So I'd like a new Lua command, let's say:
Spring.Run(string applicationName,string parameters, boolean closeSpring) -> boolean foundIt


Having the ability for a widget to drop and launch anything would open alot of possibilities, but that is including lots of malicious ones. To limit the possibilities of harmful exploit, I would limit the possible applications to the one that are .exe and that are in Spring folder. (And also make sure the widgets file write command are forbidden to write .exes). That way, if I want to link to my custom app, I still can, but only my custom app has already been installed in Spring folder, I can't have a widget just open up Excel an run deltree bunch of macro, or have a mere widget extract and run a FormatC.exe, or things like that.

The last argument would say whether spring keeps on running or not. If the application to run is never found, Spring would keep on running either way and the call would return false. So for instance I can write a widget that try launching each known lobby until one works (hmm, maybe that it superfluous, I could just test if files exist with Lua.

The ability to pass argument to the other app is pretty important: Both TASClient and SpringLobby can now switch to mod-customised skin with the right option.

I know Linux doesn't have exe, but I forgot how Linux work, but hopefully the same principle could be applied when that command is run in a Linux-Spring.

I said "lobbies", but that same command should also be useable to run springsettings.exe, SelectionEditor.exe, my own ugly frontends exe, ...

While I needed my previous feature request about restarting Spring with startscript pretty badly, this one about launching a lobby or settings from Spring.exe, less important, more vague, and probably has alot more implications that should be carefully pondered.

Maybe a similar functionnality could be implemented in a better way, I'm not really sure the command I described would really be ideal. Maybe I should have sticked to describe the functionnality I want, instead of trying to already think of the syntax.



Need:
- Ability to quit Spring and run a lobby by sending a command in a Lua widget
- Support all lobbies, including ones yet unknown
- Not actually limited to lobbies
- Can pass parameters to them
User avatar
det
Moderator
Posts: 737
Joined: 26 Nov 2005, 11:22

Re: Switching to lobbies from Spring.exe

Post by det »

This has too much potential for exploits. I doubt any dev would seriously consider this.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Switching to lobbies from Spring.exe

Post by zwzsg »

Well, I hope that we can find a middle ground that doesn't leave huge exploits, but still allow mods to run SpringLobby, TASClient, and springsettings.exe from their lua menu.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Switching to lobbies from Spring.exe

Post by knorke »

instead of
Spring.Run(string applicationName,string parameters, boolean closeSpring) -> boolean foundIt

wouldn't
spring.runTASClient (string modname, other parameters),
spring.runSpringlobby (string modname, other parameters)
spring.runSettings (...)
be better even if it is more restricted?

The filenames for these applications would be hardcoded in spring.exe which might also be better for crossplattform stuff?
Because if the modfile wants to launch an .exe it will not work under linux but the "linuxversion of spring.exe" would have the correct filenames stored to run them.
(I think under linux there are no real .exe file but instead applicationfiles have an "x-attribute" that toggles if the file can be executed)
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Switching to lobbies from Spring.exe

Post by AF »

What about QTLobby Winter Sefilobby Uberlobby?

Make a spring setting for the path to the preferred lobby executable, and allow a single LaunchLobby type command and a few other clalouts to find out what the lobby currently is.
User avatar
Neddie
Community Lead
Posts: 9406
Joined: 10 Apr 2006, 05:05

Re: Switching to lobbies from Spring.exe

Post by Neddie »

knorke wrote:hardcoded in spring.exe
No.
User avatar
SinbadEV
Posts: 6475
Joined: 02 May 2005, 03:56

Re: Switching to lobbies from Spring.exe

Post by SinbadEV »

AF wrote:Make a spring setting for the path to the preferred lobby executable, and allow a single LaunchLobby type command...
This is basically what I was going to suggest, coupled with a setting for "allow widgets to launch external lobby".

Also, maybe have a few settings available like default single player exe, default multi-player exe... then make a link to these in the default spring.exe executable.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Switching to lobbies from Spring.exe

Post by zwzsg »

SinbadEV wrote:Also, maybe have a few settings available like default single player exe, default multi-player exe... then make a link to these in the default spring.exe executable.
I sorta wanted to specify those mod per mod, not have a single default per Spring installs.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Switching to lobbies from Spring.exe

Post by AF »

Make gadgets only able to do it, and let widgets go via gadgets, we dont want widgets randomly launching the lobby in actual games
Post Reply

Return to “Feature Requests”