Pryaxis / TShock

☕️⚡️TShock provides Terraria servers with server-side characters, anti-cheat, and community management tools.
GNU General Public License v3.0
2.41k stars 377 forks source link

Commandline flag -forceupdate does not prevent the server from hibernating when empty #2205

Closed Kojirremer closed 3 years ago

Kojirremer commented 3 years ago

As stated in the title, the -forceupdate commandline flag has been broken for quite a while. I don't know when it started failing, but I'm pretty sure it didn't work already by the time 1.3 dropped.

As for how to reproduce:

  1. Open TShock with the -forceupdate parameter.
  2. Mow down all grass near your spawn point.
  3. Leave the server open but deserted for 5 minutes or so.
  4. When you come back, the grass will still not have grown at all.

Tested in both my public server with plugins, and also on a fresh installation. Since it gives no error message, I can't really present any.

According to quake:

fixing -forceupdate is omega easy all you have to do is set Netplay.HasClients to true every tick which will in turn force the server to run a world update: image

QuiCM commented 3 years ago

Completed in b478960

Kojirremer commented 2 years ago

This is still not fixed, unfortunately. I did a quick test last year and didn't work, but since I wasn't really invested in the game anymore I didn't do further tests. However, @RonQen from Discord confirmed today that -forceupdate is indeed still broken: imagen

PotatoCider commented 2 years ago

I've looked into this before. It's an chicken and egg problem.

TShock's OnUpdate hook, which force sets Netplay.HasClients isn't called after Netplay.HasClients is set to false by Netplay.UpdateConnectedClients in the Netplay thread