Switching to lobbies from Spring.exe
Posted: 05 Aug 2009, 20:12
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
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