multitheftauto / mtasa-blue

Multi Theft Auto is a game engine that incorporates an extendable network play element into a proprietary commercial single-player game.
https://multitheftauto.com
GNU General Public License v3.0
1.38k stars 424 forks source link

Windows Server support base features #3292

Open Disinterpreter opened 8 months ago

Disinterpreter commented 8 months ago

Is your feature request related to a problem? Please describe.

Due to discussion about server OS, i want to remind https://forum.multitheftauto.com/topic/101326-which-os-is-best-for-the-server/#comment-888542 but mta server still not ready to work on Windows. This issue is about adding need features for Windows.

Describe the solution you'd like

  1. Windows service API. The server must work like service (C# example https://learn.microsoft.com/en-us/dotnet/framework/windows-services/walkthrough-creating-a-windows-service-application-in-the-component-designer)
  2. All logs must be written to Windows Event Log system (C# example https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.eventlog.writeentry?view=dotnet-plat-ext-8.0)

Describe alternatives you've considered

No response

Additional context

Why? The service is really convenient for managing. You can set it up automatically restart by schedule, start after OS running, automatically running after crash and so on. Event Log need as a part of it. You should see MTA logs in EventLog system. Without that things, the point that "Windows implementation better" has no point.

Security Policy

TracerDS commented 8 months ago

Everything except events can already be done in Windows.

Although it would indeed be a neat feature in some way

Disinterpreter commented 8 months ago

Everything except events can already be done in Windows.

* Load when OS starts? Autostart

* Load when it crashes? Simple batch script
  iirc you can also set it up in schedules directly without making it a service.

Although it would indeed be a neat feature in some way

  1. Does autostart work when I not logged on?
  2. workaround, can you write it down to wiki? I suggest dry good thing.
TracerDS commented 8 months ago

Everything except events can already be done in Windows.

* Load when OS starts? Autostart

* Load when it crashes? Simple batch script
  iirc you can also set it up in schedules directly without making it a service.

Although it would indeed be a neat feature in some way

  1. Does autostart work when I not logged on?

I dont think so. You have to login for windows to run autostart

  1. workaround, can you write it down to wiki? I suggest dry good thing.

You mean the script? just a simple while true loop will do probably