TeamHypersomnia / Hypersomnia

Multiplayer top-down shooter made from scratch in C++. Play in your Browser! https://hypersomnia.io Made in 🇵🇱
https://hypersomnia.io/
GNU Affero General Public License v3.0
1.14k stars 49 forks source link

If the server is started via Systemd, then it will not start when rebooting via RCON. #279

Open Timofei302 opened 11 months ago

Timofei302 commented 11 months ago

Systemd service config: Screenshot_20231017_190858

geneotech commented 11 months ago

I see. I haven't really designed it yet to be run as a service, will have to look into it later. Would probably need a separate flag --as-service and have a separate restart logic for it. Do you think a service can update and restart itself though? Especially with additional flags?

geneotech commented 11 months ago

Actually wouldn't it be enough for the game to return 1; since you've set Restart=on-failure?

Timofei302 commented 11 months ago

Actually wouldn't it be enough for the game to return 1; since you've set Restart=on-failure?

Logically, this should be enough, but I think it's worth doing research first by making a script that will return exit code 1 and see how systemd behaves.

geneotech commented 11 months ago

Hey, I think your server keeps restarting or perhaps has a high send_heartbeat_to_server_list_once_every_secs set (I should probably clamp the value automatically), because the server list detects it as a new server once every few minutes, and it keeps spamming new server notifications :) The timeout for a server to be removed from the server list is 60 seconds.

Timofei302 commented 11 months ago

Hey, I think your server keeps restarting or perhaps has a high send_heartbeat_to_server_list_once_every_secs set (I should probably clamp the value automatically), because the server list detects it as a new server once every few minutes, and it keeps spamming new server notifications :) The timeout for a server to be removed from the server list is 60 seconds.

idk what caused this, since everything is fine with my settings (at least everything was fine), and I am not reconfiguring the server now (so that when I configure the server, I often reboot hypersomnia via systemctl).

Screenshot_20231017-212317.jpg

Timofei302 commented 11 months ago

Screenshot_20231017-213115.jpg

geneotech commented 11 months ago

It seems the problem is fixed, it now sends the heartbeats correctly :+1:

Timofei302 commented 11 months ago

The server still goes missing every 5 minutes :/

geneotech commented 11 months ago

Yeah, just noticed, not sure what could be the cause, perhaps packet loss? What if you set send_heartbeat_to_server_list_once_every_secs to e.g. 3?

Timofei302 commented 11 months ago

Yeah, just noticed, not sure what could be the cause, perhaps packet loss? What if you set send_heartbeat_to_server_list_once_every_secs to e.g. 3?

Hmm. By default, my server is already configured to send a "heartbeat" every 10 seconds. Screenshot_20231017-220755.jpg

Therefore, there are two possible reasons - my hosting provider is still under ddos attack and this has started to negatively affect the operation of my vds, or someone or something is trying to break the connection of my vds with your master server on your side.

I can't think of any other assumptions.