MineColonies

MineColonies

53M Downloads

Workers aren't being saved once dedicated server restarts.

NuL1F3 opened this issue · 29 comments

commented

Minecolonies version

0.8.4191

Expected behavior

  • From a dedicated server, after hiring NPC's, workers should still be 'employed' after server restarts.

Actual behaviour

  • After the server restarts, all NPC's are in the state they were in before they were hired.

Steps to reproduce the problem

UPDATE: Run latest Minecolonies mod in a dedicated 1.12.2 Forge server.

I have no idea really, I updated the server from 1.12 to 1.12.1 and things were still running as it should, then after a minecolonies update (I didn't take note of which one) the issue presented. The first indication was all the 'workers', still in their respective uniforms, just stood there as if in limbo. Moving the 'world' to the client side and rehiring NPC's proved successful, and upon running with the server maintained their positions, however, hiring new NPC's in the server presents the same issue and once the server restarts, are no longer hired.

commented

I believe this issue may have been resolved. Had newly hired worker, soon after the server crashed (unrelated issues) and upon restart worker maintained position. I have not tested if the same occurs if I just close the server though (clicking X).

commented

Okay, please close it it's working again

commented

Try restoring an older colonies.dat file on your server. no idea if that will work. @Raycoms, it looks like we broke serverUtils in the last update cycle. This issue is probably related to #1504

commented

Tried restoring all the way back to July to no avail.

commented

@Raycoms did we miss something with the security patch?!?!?!?

commented

I just wonder if it isn't a combination of things? Am I the only one to have this issue? As much as I don't want to, I might have to bite the bullet and create a new world and start over. Please let me know if there is any additional information you require or steps you want me to trial.

UPDATE: I decided to run the world as it was before updating minecraft to 1.12.1 in the updated 1.12.2 server and have the same result. At least we can rule out any of the 'world' data. I wonder if another mod might be slightly incompatible even though they all seem to work in harmony in SP? A 'forge' server jar perhaps? I'm using version 14.23.0.2494

commented

Can you check if the newest update fixes this?

commented
commented

After more testing, if the server is shut down properly state IS being saved. Strange as I have since using forge servers simply closed the window and last state was always saved. This is a problem if the server crashes but I don't believe it is an issue for Minecolonies and suspect something has changed with the forge server itself? Sincere apologies if I have wasted everyone's time. Thank you for all your help with this matter.

Still don't know why workers entered limbo in the first place and needed re-hiring, though that is a separate issue and my colony isn't too big so re-hiring was not a big task.

commented

@Raycoms remember that we moved the save methods a couple of months ago. Would they have changed the Shutdown hooks on us? So that the save call is not being made? @NuL1F3 Can you give me the entire log of a session. I need to check if our save calls are being made when you click the cross.

commented

Workers still not being saved after server restart I'm afraid. I'm pretty sure it was before the barracks update.

commented

I have rebuilt the server and client with only minecolonies and the issue still exists. First I tested with my current world then created a new one. What I noticed is nothing is being saved, I changed the hiring mode in the town hall from automatic to manual and after server restart, mode is back to automatic. In fact it seems that after the server restarts the citizens also respawn, like it goes back to the state the world was in before the last command block was placed. I hope that helps? Remembering in SP everything saves perfectly, it is only with a dedicated server minecolonies changes aren't being saved.

UPDATE: Confirmed, minecolonies changes saved after a command block is placed, after server restart minecolonies resumes from the state before the last command block was placed.

commented
commented

fml-junk-earlystartup.log

I hope this is what you were asking for.

commented

Not sure if it's the same problem with me, but my brother and I are playing on a LAN world and before the first barracks update, everything worked fine everytime we logged back in.
With the first barracks update, when I tried it in single player, all my workers were unemployed, but this issue was supposedly fixed.
However, with the newest version: minecolonies-universal-1.10.2-0.8.4208.jar, when my brother and I started the LAN world, everyone was unemployed. They kept their workplaces' clothes so it was no problem rehiring them, but some of them lost their xp.

commented

This is how it all started to go bad for me Rosomah, only I use a dedicated server. I thought it was before the barracks update but in all honesty I didn't pay enough attention.

commented
commented

The problem we are facing here, is that what you guys are describing is hard to trace. You are basically telling us, that your colony saved just fine, but the worker configuration did not, which is impossible.

We are currently trying to figure this out. But this will take time. @NuL1F3 you send me a client log (an incomplete one none the less), not a server log. I need the log from the server.

commented

Well before the first barracks update, I never had this issue occur, but after I updated the mod to the first barracks update, all of them were unemployed (single player world).

commented

What is the server log file name and where do I find it? The file I uploaded is from the server log directory and the only one with that much information. The file is also unedited so it is as complete as I can share it.

commented
commented
commented

Yes there are, would you like them also? 1,2 and 3?

commented
commented
commented

I suggest you create a new world with the minecolonies version just before the first barracks version and then the barracks one (that's where I encountered the issue) or go straight to the latest version (where me and my brother encountered the issue on a LAN world).

commented

Still happening?

commented

Worker still not saved if server is just closed. Must /stop for state to be saved (or place a new command/build block).