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

[Feature] Implementing ServiceMain in Server.exe? #73

Open
TLeonardUK opened this issue Feb 1, 2022 · 1 comment
Open

[Feature] Implementing ServiceMain in Server.exe? #73

TLeonardUK opened this issue Feb 1, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@TLeonardUK
Copy link
Owner

Discussed in https://github.com/TLeonardUK/ds3os/discussions/72

Originally posted by rscales2929 February 1, 2022
Hi, are there any plans to implement ServiceMain in Server.exe, allowing it to run as a Windows service? I'm not a professional C++ dev, but it seems like it would fit right into Entry.cpp.

Right now you can get a t2.micro Amazon AWS EC2 Windows Server 2019 instance for free, meaning those inclined to put in the leg work can set up a hosted DS3 Open Server. They can keep it running for 750 hours/month at no cost. To me, this is infinitely preferable to opening my personal computer to the Internet.

I used NSSM to create a wrapper for Server.exe on my EC2 instance, but being able to run DS3OS directly as a service would be preferable. (Btw, happy to share my AMI for those interested in spinning up their own instances.)

@TLeonardUK TLeonardUK added the enhancement New feature or request label Feb 7, 2022
@FracturedShader
Copy link

I put together a working sample of this on my fork: https://github.com/FracturedShader/ds3os/tree/feature/run-as-service

There are a few TODOs left before it is fully ready, but the main goal was to preserve all current functionality precisely as it is while enabling the ability to register the server as a service. This way it can be run directly (how it currently works), or as a service without any special configurations on the part of the user.

Remaining TODOs:

  • Proper reporting to the Windows Event Log requires very custom message file compilation that also must be linked in the Registry to work
  • The service must run as the same user as the Steam client for the Steam APIs to work. This could be setup dependent

If the approach so far seems reasonable it should be possible to handle these remaining items in a fairly straightforward way so long as we assume anyone doing this is comfortable with manipulating Windows Services.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants