BeamMP / BeamMP-Server

Server for the multiplayer mod BeamMP for BeamNG.drive
https://beammp.com
GNU Affero General Public License v3.0
116 stars 49 forks source link

Please reduce update reminder console spam #321

Closed juniper-folf closed 3 weeks ago

juniper-folf commented 1 month ago

Whenever there's a new version, the server prints an update reminder every 30 seconds or so. I believe there's a bug in src/THeartbeatThread.cpp:132:

    if (!Application::Settings.HideUpdateMessages && UpdateReminderCounter % 5) {

where the server is supposed to check for updates every 5th heartbeat but instead it's checking it on every HB except the 5th ones (I might be wrong, I have very little experience with C++). But even the (I assume) intended period of 2.5 minutes seems pretty spammy, especially for small servers which don't see much traffic, where it would still outnumber all other ouput by an extreme margin.

Is it possible to reduce the frequency of update reminders? Ideally having a parameter that would set the period manually in a configuration file (or at least a switch between minute-interval and day-interval reminders).

Setting the "ImScaredOfUpdates" flag in ServerConfig.toml gets rid of this issue, however it disables update reminders completely when the server is running. I run my server continuously in a detached tmux instance so I don't restart it for weeks or months at a time (usually until there's a kernel update when I have to restart the system) so I do want to be reminded when there's a new version out.

I'm using the Debian 12 build, but I don't think that's relevant here.

Acceptance criteria

lionkor commented 1 month ago

I would recommend updating to fix this issue. You are correct there is a bug, and that'll be fixed.

But really: Update the server. These are minor/patch updates which will not break your existing configuration, mods, plugins etc.

these updates are usually crash fixes and security fixes, you definitely want them.

lionkor commented 1 month ago

But yeah youre right about that bug! Thanks for finding it

lionkor commented 1 month ago

For whoever tackles this, acceptance criteria are:

juniper-folf commented 1 month ago

Hello, I do update the server regularly, which is why I don't want to use the ImScaredOfUpdates flag. But I only get around checking on it every week or so, so if I miss the new release by more than ~12 hours, the console is full of the update reminders and everything else is gone. For usecases like mine a reminder once per day would be frequent enough as I'm only running the server for a couple of friends and it doesn't see much traffic (maybe like one playsession a week)

I do genuinely appreciate all the updates and the hard work you're putting into this project, thank you!

lionkor commented 1 month ago

That makes sense. Then we also want:

lionkor commented 1 month ago

@sla-ppy or @jimkoen this is a good issue if one of you wants to ;)

jimkoen commented 1 month ago

To summarize acceptance criteria:

Neptnium commented 1 month ago

Possible Idea:

But

@lionkor What do you think of this ?

lionkor commented 1 month ago

@Neptnium we could do that, yeah. However, I very much like spamming the living shit out of people so they update, because hundreds of people they still don't, even with this spam.

Pretty much all fixes we do are to game-breaking stuff, or for security, there's never a time where I make an update and then think "ah, that's not important" :D

The other half of this issue is #233 ;)

lionkor commented 1 month ago

For servers, every server which isn't updated, which is missing a bugfix, can quickly become a problem because everyone playing on it can be impacted by the missing update (i.e. can be impacted by a bug).

For client and game I would agree to just do the reminder every day or on startup, because idc what people do with their own game, but for servers you need to update so all players on the servers have a good time

lionkor commented 1 month ago

To be fair, and to conclude my rant; for security patches that are actually dangerous we take all outdated servers from the serverlist automatically anyways.

Neptnium commented 1 month ago

Yeah I understand, and I'm like that too, IF THERE IS AN UPDATE, DOWNLOAD IT !!! Self update that you mentioned would be amazing, I personally have my servers on pterodactyl and I just need to press a button for it to update, but self update would be even better !! Maybe what you could do is like a BootStrap or something, because otherwise I don't know how a program would react if deleted ...

O1LER commented 1 month ago

@Neptnium Adding a self-update function to servers running trough ptero can be done, although not very elegant. The egg has a startup command field, you could add a curl function that goes to grab the latest beammp server. So whenever the server crashes or you (re)start it, it would download the latest binary. The same curl function that is used in the installation process could be used. The startup command is run before the actual server is started.

Im sure you could also do that in a smarter way, but i would have to poke at ptero a bit.

But thats a bit off topic, send me a DM in discord if you want to know more about custom ptero eggs

Neptnium commented 1 month ago

@Neptnium Adding a self-update function to servers running trough ptero can be done, although not very elegant. The egg has a startup command field, you could add a curl function that goes to grab the latest beammp server. So whenever the server crashes or you (re)start it, it would download the latest binary. The same curl function that is used in the installation process could be used. The startup command is run before the actual server is started.

Im sure you could also do that in a smarter way, but i would have to poke at ptero a bit.

But thats a bit off topic, send me a DM in discord if you want to know more about custom ptero eggs

Thx @O1LER, I already know it don't worry, but thx annyways. I don't add it since sometimes i like to have a custom version and it would f* it up. But In my install script I have also download for mods and for a library that I need for my next plugin, allowing me to have all of my servers at the same version.

~Plus I think reinstalling at every start is bad, if everyone did it, it might cause server to overload~ NVM, we download it from github so shoud be fine but anyways.

lionkor commented 1 month ago

@SaltySnail is doing this one