CubeCoders / AMP

Issue tracking and documentation for AMP
https://cubecoders.com/AMP
207 stars 38 forks source link

SRCDS Instances cannot be bound to 0.0.0.0 because of UI restriction #935

Closed Bryantdl7 closed 9 months ago

Bryantdl7 commented 1 year ago

Bug Report

System Information

I confirm:

Symptoms

Reproduction

Enter reproductions steps here.

  1. Create a new tf2 instance
  2. open the instance
  3. click update on the orange button
  4. once complete click start
  5. You'll be greeted with this lovely error

Assigning an SRCDS server to quad zero is a very common practice making the server listen on all IP addresses of the interface in question, it is supported by srcds itself, along with many other game server tools, such as SeDirector.

I believe there is a bug with linux-based SRCDS which dislikes certain IP assignments, but as the old valve documentation hints-but-never-confirms, windows (sadly) is the more ideal srcds platform. Perhaps instead of a hard failure change the flow of this to instead be a warning that can be bypassed? Maybe a check box in the source server settings saying allow 0.0.0.0?

Either way, the default for all SRCDS templates is to bind to 0.0.0.0, and for people to make a brand new server and always get an error isn't fun :)

xLeviNx commented 1 year ago

Yeah, its expected of the user to assign the IP which I prefer as a fellow scrds user

Greelan commented 1 year ago

I agree with the OP, I've never understood the reason why the srcds module forces the binding

PhonicUK commented 11 months ago

Not an issue. This is a deliberate design choice. The UDP logger does not work properly in SRCDS when it's bound to 0.0.0.0. This prevents AMP from monitoring the server or showing you any log output. The requirement to be bound to a specific IP is to avoid this issue and to allow AMP to work properly. The limitation isn't a UI issue or an arbritary restriction.

Bryantdl7 commented 11 months ago

Ok, can amp be reconfigured to not default to 0.0.0.0 then? Its not fun that SRCDS instances do not work with default settings and require manual intervention of some form.

Oct 14, 2023 2:58:17 PM PhonicUK @.***>:

Not an issue. This is a deliberate design choice. The UDP logger does not work properly in SRCDS when it's bound to 0.0.0.0. This prevents AMP from monitoring the server or showing you any log output. The requirement to be bound to a specific IP is to avoid this issue and to allow AMP to work properly. The limitation isn't a UI issue or an arbritary restriction.

— Reply to this email directly, view it on GitHub[https://github.com/CubeCoders/AMP/issues/935#issuecomment-1763126710], or unsubscribe[https://github.com/notifications/unsubscribe-auth/ABKOR5OLWNLSQKRVD4H7MMTX7LOELAVCNFSM6AAAAAA5UGN5AKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONRTGEZDMNZRGA]. You are receiving this because you authored the thread. [Tracking image][https://github.com/notifications/beacon/ABKOR5KITCN5UR7MWGGHMY3X7LOELA5CNFSM6AAAAAA5UGN5AKWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTJC4W3M.gif]

Greelan commented 11 months ago

Not an issue. This is a deliberate design choice. The UDP logger does not work properly in SRCDS when it's bound to 0.0.0.0. This prevents AMP from monitoring the server or showing you any log output. The requirement to be bound to a specific IP is to avoid this issue and to allow AMP to work properly. The limitation isn't a UI issue or an arbritary restriction.

Presumably you're referring to logaddress_add needing to point to a specific IP to log to? That sounds more like a binding issue for the AMP endpoint receiving the logs, rather than the srcds server itself needing to bound to an IP?

More importantly, what does AMP use to receive and parse the logs, and can that be used with the generic module (thinking of CS2)?

PhonicUK commented 11 months ago

Ok, can amp be reconfigured to not default to 0.0.0.0 then? Its not fun that SRCDS instances do not work with default settings and require manual intervention of some form. Oct 14, 2023 2:58:17 PM PhonicUK @.***>:

Yes, you can set the default application IP binding in ADSs network settings.

PhonicUK commented 11 months ago

Presumably you're referring to logaddress_add needing to point to a specific IP to log to? That sounds more like a binding issue for the AMP endpoint receiving the logs, rather than the srcds server itself needing to bound to an IP?

More importantly, what does AMP use to receive and parse the logs, and can that be used with the generic module (thinking of CS2)?

There's a bug in srcds whereby logaddress_add doesn't work even with a specific IP if the game server itself is bound to 0.0.0.0. It's why it's an absolute pain because the game server IP binding alters its behaviour even though it's completely unrelated.

Bryantdl7 commented 11 months ago

It defaults to 0.0.0.0, which errors. Can it be defaulted to something else out of the box?

Very well aware I can change it myself, but having a default value be something that isn't allowed doesn't make sense...

Oct 20, 2023 9:18:52 AM PhonicUK @.***>:

Ok, can amp be reconfigured to not default to 0.0.0.0 then? Its not fun that SRCDS instances do not work with default settings and require manual intervention of some form. Oct 14, 2023 2:58:17 PM PhonicUK /@/.***>:

Yes, you can set the default application IP binding in ADSs network settings.

— Reply to this email directly, view it on GitHub[https://github.com/CubeCoders/AMP/issues/935#issuecomment-1772727387], or unsubscribe[https://github.com/notifications/unsubscribe-auth/ABKOR5KQIN3MLSGNVR5NSELYAJ23RAVCNFSM6AAAAAA5UGN5AKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZSG4ZDOMZYG4]. You are receiving this because you authored the thread. [Tracking image][https://github.com/notifications/beacon/ABKOR5NC6L43ONY3NJVYEADYAJ23RA5CNFSM6AAAAAA5UGN5AKWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTJVGWFW.gif]

Greelan commented 11 months ago

Presumably you're referring to logaddress_add needing to point to a specific IP to log to? That sounds more like a binding issue for the AMP endpoint receiving the logs, rather than the srcds server itself needing to bound to an IP? More importantly, what does AMP use to receive and parse the logs, and can that be used with the generic module (thinking of CS2)?

There's a bug in srcds whereby logaddress_add doesn't work even with a specific IP if the game server itself is bound to 0.0.0.0. It's why it's an absolute pain because the game server IP binding alters its behaviour even though it's completely unrelated.

Any insights on my second question?

PhonicUK commented 10 months ago

What AMP uses is a UDP logger source. So AMP receives those UDP packets.

Greelan commented 10 months ago

...

I understand that. The question is how AMP receives the packets, and whether that can replicated in generic.

Bryantdl7 commented 10 months ago

Why doesnt amp just view the console the same way STEAMCMD is read into the AMP console? Then you don't need any networking at all. There's got to be a way to do it this way. Would make debugging issues way more verbose. In the current implementation developer 1 outputs aren't even made into the amp console.

I can understand potential limitations to this approach, but at least give us a toggle for viewing the console this way.

PhonicUK commented 10 months ago

Why doesnt amp just view the console the same way STEAMCMD is read into the AMP console?

Because it doesn't work. Source games do not write data to standard output, they write it directly to the console display buffer which isn't readable. For SteamCMD AMP uses an ugly, unstable and unreliable hack that only works if you don't care about missing the odd line - which for getting download progress is fine but not for anything important.

IceOfWraith commented 9 months ago

It defaults to 0.0.0.0, which errors. Can it be defaulted to something else out of the box? Very well aware I can change it myself, but having a default value be something that isn't allowed doesn't make sense... Oct 20, 2023 9:18:52 AM PhonicUK @.>: Ok, can amp be reconfigured to not default to 0.0.0.0 then? Its not fun that SRCDS instances do not work with default settings and require manual intervention of some form. Oct 14, 2023 2:58:17 PM PhonicUK /@/.>: Yes, you can set the default application IP binding in ADSs network settings. — Reply to this email directly, view it on GitHub[#935 (comment)], or unsubscribe[https://github.com/notifications/unsubscribe-auth/ABKOR5KQIN3MLSGNVR5NSELYAJ23RAVCNFSM6AAAAAA5UGN5AKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZSG4ZDOMZYG4]. You are receiving this because you authored the thread. [Tracking image][https://github.com/notifications/beacon/ABKOR5NC6L43ONY3NJVYEADYAJ23RA5CNFSM6AAAAAA5UGN5AKWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTJVGWFW.gif]

Looks like this question got overlooked. 0.0.0.0 is preferred for almost every game server out there. It's only an issue with SRCDS servers within AMP because of the need for the UDP Logging. AMP on Windows can read the console properly, but on Linux it cannot, so it relies on the logger as Mike stated. If instances are bound to specific IP addresses it can get messy. Servers with multiple network adapters or moving servers requires a lot of intervention as opposed to having it set to 0.0.0.0.

IceOfWraith commented 9 months ago

Here's a couple sources that back what is done by AMP. Unfortunately, it is a long-standing SRCDS bug. The only work around is that AMP be able to read the console in Linux, but that too seems to be a limitation of the game server.

https://github.com/stevenocchipinti/CS_Scoreboard#logging-statistics-on-localhost

https://github.com/startersclan/source-udp-forwarder#demo

Greelan commented 9 months ago

Those links have alternative solutions?

IceOfWraith commented 9 months ago

Sorry, I'm not following. What solution are you wanting AMP to handle from those?

Greelan commented 9 months ago

In one of them it suggests having the UDP logger endpoint as 0.0.0.0, and in the other it suggests using the hostname

Greelan commented 9 months ago

Specifically for the first:

Start the gameserver with cvar logaddress_add_http "http://127.0.0.1:26999" for Counter-Strike 2, logaddress_add 0.0.0.0:26999 for srcds (srcds refuses to log to logaddress_add 127.0.0.1:<PORT> for some reason), or logaddress_add 127.0.0.1 26999 for hlds servers, and cvar log on, to ensure the gameserver send logs to source-udp-forwarder.

No mention of any binding limitations for the srcds server itself.

IceOfWraith commented 9 months ago

The hostname fix requires editing the hosts file so not really a useful solution for AMP.

I just tested 0.0.0.0 for the logaddress_add on Garry's Mod and 127.0.0.1 as the address for the UDP Logger to connect to and it didn't see any packets. I'm not sure that one is a fix. I'm open to be proven wrong though.

PhonicUK commented 9 months ago

Maybe ::1 would work if the problems are specifically with localhost and 127.0.0.1 ? Or perhaps using something like 127.10.0.1 on both ends instead?