Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Easier disabling of (OpenRA-)server-based multiplayer code #21342

Open
reaperrr opened this issue Feb 13, 2024 · 2 comments
Open

Easier disabling of (OpenRA-)server-based multiplayer code #21342

reaperrr opened this issue Feb 13, 2024 · 2 comments

Comments

@reaperrr
Copy link
Contributor

reaperrr commented Feb 13, 2024

One of the issues that sank my efforts of making a singleplayer-focused commercial game based on this engine ~2-3 years ago was that when I tried to disable any calls to the OpenRA server and the bulk of multiplayer code, it turned out to be such an incredible cluster of spaghetti that not only was it an insane amount of work and trial + error (at the very least, for someone not that familiar with this part of the engine), but also any upstream changes to this part of the code turned any rebase onto bleed into a nightmare.

I don't have the coding knowledge in general and about server/web/UI in particular to untangle any of this, but at the very least, it would be nice if it was easier to remove/disable any map look-ups and server pings to the OpenRA server, basically make the game behave as if there was no internet connection all the time.
Personally, I don't care how hacky the solution would be, as long as it gives the end result I want and doesn't require some huge downstream diff with all the rebase horrors to come along with it.

Bonus points if anyone has workaround ideas or could implement changes that allow to disable all MP/server-related elements except DirectConnect, as for a solo dev with no understanding of server code, I wouldn't want to support any multiplayer outside of LAN or DirectConnect out of maintenance, cost and security concerns, but offering at least some form of multiplayer would still be nice all the same.

@pchote
Copy link
Member

pchote commented Feb 13, 2024

The web requests for things like master server, map downloads, news, etc all fetch their urls from the WebServices IGlobalModData. This is currently implicitly defined with defaults to the default services if not overridden in mod.yaml.

IMO it wouldn't be unreasonable to instead default these to null and have them explicitly defined in mod.yaml. The places that call these should then do a null check and skip the calls if they are not defined.

At a minimum we should at least add the null checks which would allow projects to override them to null in their mod.yaml or by changing only that one c# file.

@michaeldgg2
Copy link
Contributor

I think it should be the other way around: WebServices class should get interface IWebServices, which would contain methods that operate on the web services and fetch/send data, i.e.:

  • GetServers()
  • GetRemoteMapsDetails()
  • GetGameNews()
  • CheckModVersion()
  • PingMasterServer()

Put IWebServices into OpenRA.Game and WebServices class into OpenRA.Mods.Common. Or if it's undesirable for OpenRA.Game to have access to all of these features:

  • create separate interface (such as IRemoteMapsProvider, IRemoteMapsInfoDownloader, IRemoteMaps, etc.)
    • put it into OpenRA.Game
  • put IWebServices into OpenRA.Mods.Common
  • have WebServices class implement both IWebServices and the first interface (IRemoteMapsProvider, ...)

That way not only you could make dummy implementation, but also you could implement it in any number of ways in your mod.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants