micdoodle8 / Galacticraft

An advanced Space Dimension Mod for Minecraft
Other
617 stars 333 forks source link

Custom flag and team information not saved. (server) #957

Closed BBoldt closed 9 years ago

BBoldt commented 10 years ago

I know the whole "space race" feature isn't really complete yet, but the flag creation, teams, and colors all look like they should work. It kinda sucks when a player spends some time making a flag and it doesn't end up saving.

This isn't really a critical issue, it can probably wait. I just wanted to make sure you guys knew it was an issue.

Keep up the good work! I'm loving the new stuff in 1.7.10 so far.

radfast commented 10 years ago

It should work, we'll take a look. We don't want players to lose something they have created.

BBoldt commented 10 years ago

It turns out the player in question was crashing for an unrelated reason some time after creating the flag, instead of exiting the game normally, which is apparently why it wasn't saving.

radfast commented 10 years ago

ok thanks for coming back with that update. We can probably do something to help that situation, we can set the flag data to save earlier so that it will survive crashes. I'll leave this open for now.

ghost commented 10 years ago

What exactly is space race?

radfast commented 10 years ago

What exactly is space race?

It times players in 'minutes of gameplay' from starting the game with wooden tools until getting into space. The idea is that servers can then have a leaderboard - either on the server website or on signs in-game (that would have to be done manually, for now - we might do something about that some day) - so that it's a competition to find the really good players.

Because different modpacks help or hinder the speed (e.g. Buildcraft, Mekanism, IC2 or Thermal Expansion would really help with mining or with doubling metal output from your ores - or a hard-mode modpack like Magic Farm 2 or End of Light would slow things down) it's not fair to compare the scores between different servers.

Speed also depends on help from other players - so a team should be way faster - and on starting items or server shops - for example some servers might give iron armour or iron tools, or if a rocket can be bought in the shop that would make this race somewhat pointless!

A team of players can also have a flag, and the flag will be shown on the rockets and can be planted on the Moon etc, so you can play at USA vs. USSR type of historic scenarios.

A suggestion has been made for the Space Race team also to have automatic invitations to each other's space stations, which seems like a good idea (once we have multiplayer space station access working again).

ghost commented 10 years ago

Hmmm I like.............................. So minutes of gameplay from point of team formation or joining server?

radfast commented 10 years ago

umm, seems to be from Team Formation time. I guess that could be a problem as people could wait until they have already built a rocket before forming a team. I'll talk to micdoodle8 about it. Sensible suggestions please ... ? I guess it really needs to be from the time when the first player in the team first joined the server. If the player played for days doing other stuff before deciding to aim for space, could work out a bit unfair but I think that's tough luck - the other stuff and base building will be of some help towards the space race. There's also always going to be some scope for cheating, for example players could play with an alt account until they have quite an advanced base then switch accounts - it would be up to server admins to look out for that type of behaviour, it's not really any different from using dupes or other exploits.

Space Race tracks the time for the team to reach each planet, not just getting into space, so the competition is ongoing as we add new planets.

micdoodle8 commented 10 years ago

@BBoldt Was this a one-time issue, or is it recreatable on your server?

Basically, the server data is set to automatically write the save file for space race data whenever the server is saved.

The clients will send new data to the server every 5 seconds if something has changed. So unless they completed a lot of changes within 5 seconds, something else is wrong here. Please let me know if it's recreatable for you, because I can't recreate it myself.

BBoldt commented 10 years ago

I just had 4 people make flags and I caused an intentional server crash. All of them saved.

I talked more to the player having the problem: [10:57:09 PM] BBoldt: how many times did your flag not save? [10:57:20 PM] Timo4545: twice [10:57:29 PM] BBoldt: did you crash both times? [10:57:40 PM] Timo4545: i think so [10:57:44 PM] BBoldt: did the server crash? [10:57:53 PM] Timo4545: probably not [10:57:56 PM] BBoldt: did you crash while making the flag? [10:58:14 PM] Timo4545: no [10:58:24 PM] BBoldt: how fast after making it did you crash? [10:58:45 PM] Timo4545: over 10 minutes of sitting there after making it and closing the thing [10:58:57 PM] BBoldt: okay

So, I'm not really sure what the cause is and I can't seem to replicate it. The player was able to save his flag the third time he tried to make one.

radfast commented 10 years ago

Seems to me if the player's client is crashing for a reason unconnected with Galacticraft, that can have a knock-on effect on Galacticraft either communicating with the server or saving stuff. Maybe whatever caused the crash started to make problems earlier.

I don't see what more we can do here without Timo4545's logs, and I don't want this to become an issue that sits here for weeks unresolvable.

So, I'm going to close this now. @BBoldt please re-open if there are any more issues of this kind, but we will really need some pointers on how to replicate this.

rufo123 commented 9 years ago

I have the same issue when on server with Build: 229 This problem always appears when i login to server.

radfast commented 9 years ago

@rufo123 any crashes or other issues on server or client? If possible please post logs from both (client + server logs covering the same time period).

BBoldt commented 9 years ago

I should probably mention that this is still happening on my server too, every once in a while flags get erased. I still have no clue what causes it which is why I haven't said anything.

I'll see if I can get logs of some sort, but they would probably be from a period of a day to a week. It's extremely difficult to catch when it happens. Most the time it just happens what feels like randomly.

rufo123 commented 9 years ago

Tommorow I try post a logs...

rufo123 commented 9 years ago

Wow it's not crashing anymore O_O. But now i have problem with space race. When i create a Space Race and when i log aut and log in, I am like magically kicked out of Space Race... I's normal or no? (Tested on a server with forge build:1232 and galacticraft build:229)

knownwolfy commented 9 years ago

I'm having the same issue but it looks like the server is saving the information but not giving it back to the players.

radfast commented 9 years ago

oho, thanks @christopherftw09 that may help to shed some light on this mystery Please explain more what you mean by "the server is saving the information", have you looked at the save files using NBTExplorer or similar?

Hazado commented 9 years ago

You can open the dat file with winrar and look at the plain text the server saves for galacticraft

Hazado commented 9 years ago

on my server there is a file called GCSpaceRaceData.dat. Ive made a flag twice already, and had it disappear both times. Figured it was because I dont have a space station yet. Inside it is this information. http://pastebin.com/iWbtwg3D

Its located at /world/data/GCSpaceRaceData.dat

knownwolfy commented 9 years ago

@radfast it is saving the information in a GCSpaceRaceData.dat file inside the world's data folder (/[worldname]/data/GCSpaceRaceData.dat)

I've checked in there and it contains all the information about team name, team member names, flag design.

radfast commented 9 years ago

Server owners, please try out new build 3.0.8.263 (it's OK for your players to stay on some earlier 3.0.8.xxx version, there will be no issues if the players are not yet updated to .263).

There's a chance this will fix the problem, but if not I also included some logging to help see what's going on here. To see the logging, in Galacticraft core.conf please switch on:

B:"Enable Debug Messages"=true

This will create a small amount of log spam as it enables all of Galacticraft's debug messages, so you'll likely want to switch that back to false when we are done testing the space race.

(The real problem here is I cannot reproduce the issue in my own testing, which always makes things hard to figure out - could be an obscure issue that depends on the Java version or it is different on a Linux server or something.)

knownwolfy commented 9 years ago

Don't look like it worked

I have setup a server for you to check out the issue on.

[removed]

radfast commented 9 years ago

@christopherftw09 that's really kind of you and good thinking re the Github Collaborator approach. But to "check out the issue" I need to make, and run on a server, temporary test builds of Galacticraft with extra logging added, see if that shows up any meaningful clues, then rinse and repeat. Possibly also delve into the saved .dat file using the proper tool which is NBTExplorer. I can only realistically do all that on my own LAN.

Let me try it on my LAN with a full Cauldron setup and that same modpack that you are using. As soon as I can make the problem happen, then I can work on finding a fix. (If not then I will speculate again that it could be due to differences in Java implementations - all my machines are Windows boxes running Java 7 - but let's not worry about that unless we need to.)

radfast commented 9 years ago

I made a new build 3.0.8.264 which may come closer to fixing this issue.

When testing it on a server, please do set the "enable debug" in the config to true, and then look in your logs at server startup (map load) and shutdown (map save) for lines like these:

[13:50:57] [Server thread/INFO] [Galacticraft]: Registered Dimension: -30 [13:50:57] [Server thread/INFO] [Galacticraft]: Registered Dimension: -29 [13:50:57] [Server thread/INFO] [Galacticraft]: Registered Dimension: -28 [13:50:57] [Server thread/INFO] [Galacticraft]: Loading spacerace data for team TeamRad [13:50:57] [Server thread/INFO] [Galacticraft]: Loaded spacerace team data OK.

[13:51:07] [Server thread/INFO]: Saving worlds [13:51:07] [Server thread/INFO]: Saving chunks for level 'Flagtest'/Overworld [13:51:07] [Server thread/INFO] [Galacticraft]: Saving spacerace data for team TeamRad [13:51:07] [Server thread/INFO] [Galacticraft]: Saved spacerace team data OK. [13:51:07] [Server thread/INFO]: Saving chunks for level 'Flagtest'/Nether [13:51:07] [Server thread/INFO]: Saving chunks for level 'Flagtest'/The End [13:51:07] [Server thread/INFO]: Saving chunks for level 'Flagtest'/moon.moon [13:51:07] [Server thread/INFO]: Saving chunks for level 'Flagtest'/planet.mars [13:51:07] [Server thread/INFO]: Saving chunks for level 'Flagtest'/planet.asteroids

Normally the spacerace data should load right after Galacticraft registers its dimensions.

knownwolfy commented 9 years ago

Yeah radfast,

I have the messages for server start up and shutdown but looks like 'Chris's Team is being overwritten' or something when connected to the server.

[02:35:28] [Server thread/INFO]: Registered Dimension: -30
[02:35:28] [Server thread/INFO]: Registered Dimension: -29
[02:35:28] [Server thread/INFO]: Registered Dimension: -28
[02:35:28] [Server thread/INFO]: Loading spacerace data for team Chris's Team
[02:35:28] [Server thread/INFO]: Loaded spacerace team data OK.
[02:35:28] [Server thread/INFO]: Loading spacerace data for team Unnamed Team
[02:35:28] [Server thread/INFO]: Loaded spacerace team data OK.

[02:38:33] [Server thread/INFO]: Saving worlds
[02:38:33] [Server thread/INFO]: Saving chunks for level 'world'/Overworld
[02:38:33] [Server thread/INFO]: Saving spacerace data for team Unnamed Team
[02:38:33] [Server thread/INFO]: Saved spacerace team data OK.
[02:38:33] [Server thread/INFO]: Saving spacerace data for team Unnamed Team
[02:38:33] [Server thread/INFO]: Saved spacerace team data OK.
[02:38:34] [Server thread/INFO]: Saving chunks for level 'DIM1'/The End
[02:38:34] [Server thread/INFO]: Saving spacerace data for team Unnamed Team
[02:38:34] [Server thread/INFO]: Saved spacerace team data OK.
[02:38:34] [Server thread/INFO]: Saving spacerace data for team Unnamed Team
[02:38:34] [Server thread/INFO]: Saved spacerace team data OK.
[02:38:34] [Server thread/INFO]: Saving chunks for level 'DIM-1'/Nether
[02:38:34] [Server thread/INFO]: Saving spacerace data for team Unnamed Team
[02:38:34] [Server thread/INFO]: Saved spacerace team data OK.
[02:38:34] [Server thread/INFO]: Saving spacerace data for team Unnamed Team
[02:38:34] [Server thread/INFO]: Saved spacerace team data OK.
[02:38:34] [Server thread/INFO]: Unloading dimension 0
[02:38:34] [Server thread/INFO]: Unloading dimension -1
[02:38:34] [Server thread/INFO]: Unloading dimension 1
radfast commented 9 years ago

This issue should be fixed now.

The issue was that although servers were saving and loading the flag data correctly, servers were not always sending it to clients (players) when players login, unless the player happened to be standing close to a Flag. This meant that when the player went to Space Race, the player was given a new blank Space Race with name Unnamed Team.

If this happened over and over, you would end up with a lot of (unwanted) Unnamed Teams on the server.

I'm not sure if those Unnamed Teams will cause an issue or not, if they do then we can look at this further. (It's something server owners can fix themselves if you know how to use a tool NBTExplorer.)

Also note that flags that players saved previously, should now load OK for the players. (Again if the player made a lot of teams, due to this saving issue, then I'm not too sure which one of those teams will be the one which loads up - I hope it will be the most recent.)

radfast commented 9 years ago

Thanks are also due to babybasher on the forum for additional testing which led to the solution to this. http://forum.micdoodle8.com/index.php?threads/space-race-flag-saving.4944/

radfast commented 9 years ago

Any more flag issues, please post 'em up here. It would be great if someone could test, 2 players on a server, 2 teams, 2 flags - does each player see the other player's flag correctly?

radfast commented 9 years ago

Build 3.0.8.269 with the flags fix is now available.