Home World Forum
Stars! AutoHost web forums

Jump to Stars! AutoHost


 
 
Home » Stars! 2.6/7 » The Bar » Corrupt X and H file?
Corrupt X and H file? Tue, 11 May 2021 12:14 Go to next message
wildcard is currently offline wildcard

 
Crewman 2nd Class

Messages: 18
Registered: May 2005
Anyone heard of this before? I turned my system off after saving last night (almost finished all my orders but wasn't quite done with the turn yet, no new turn generated), powered it back up this morning and now my .X file is corrupt (all my orders I put in are gone, back to the beginning of the turn) and my .H file is corrupt (no planet history, all planets that I am not actively scanning show as grey dots, as in unexplored).

All the files are physically there with the correct time stamp from my last save.

Any ideas?

Report message to a moderator

Re: Corrupt X and H file? Tue, 11 May 2021 14:22 Go to previous messageGo to next message
ricks03 is currently offline ricks03

 
Officer Cadet 1st Year
Creator of TotalHost and Stars! utilities
Created TotalHost and Stars! utilities

Messages: 222
Registered: January 2012
Location: NC
Nope.

In case you don't know, you can recreate the .h file by opening each turn in order (no need to save or anything, just opening it will do).



https://www.irelandbybicycle.com
http://totalhost.sinister.net:999
https://github.com/ricks03/TotalHost

Report message to a moderator

Re: Corrupt X and H file? Tue, 11 May 2021 14:39 Go to previous messageGo to next message
wildcard is currently offline wildcard

 
Crewman 2nd Class

Messages: 18
Registered: May 2005
Hmm, I will try that, thanks.

Any other alternatives if I don't have full backups? I think I only have backups going back about 10 years or so.

Any idea how the X file got corrupted or how to fix?

Report message to a moderator

Re: Corrupt X and H file? Tue, 11 May 2021 18:07 Go to previous messageGo to next message
raptor is currently offline raptor

 
Chief Warrant Officer 1
Creator of StarsWine
Created StarsWine

Messages: 138
Registered: June 2014
It sounds like the file didn't write out to disc and was just cached in memory. How are you running Stars?

There are some utilities in the starsapi project that can decrypt and inspect the file contents. If the file wasn't fully corrupted (e.g. zero-length), then a partial reconstruction of the files could be made. The project is found here:

https://github.com/stars-4x/starsapi

An example decode/encode class is written here:

https://github.com/stars-4x/starsapi/blob/master/src/test/ja va/org/starsautohost/starsapi/TestBlockCoding.java


[Updated on: Tue, 11 May 2021 18:08]

Report message to a moderator

Re: Corrupt X and H file? Tue, 11 May 2021 18:33 Go to previous messageGo to next message
wildcard is currently offline wildcard

 
Crewman 2nd Class

Messages: 18
Registered: May 2005
I am runnning Stars! on a VMWare Player VM, running Windows 10 32-bit.

It's possible that something in memory didn't get written to disk. The files aren't 0-length and were updated (about the time I saved and shutdown?), so it's probably not all gone. Could be a hiccup in the VMWare subsystem writing to disk.

I'll check out those utilities and see if I can re-construct anything.

If you think of anything else, feel free to let me know Smile

Thanks!!

Report message to a moderator

Re: Corrupt X and H file? Tue, 11 May 2021 23:17 Go to previous messageGo to next message
ricks03 is currently offline ricks03

 
Officer Cadet 1st Year
Creator of TotalHost and Stars! utilities
Created TotalHost and Stars! utilities

Messages: 222
Registered: January 2012
Location: NC
The standalone tools in Totalhost (derived in part from the StarsAPI) will actually output content from Stars! files in various ways, without having to build something from the API. https://github.com/ricks03/TotalHost

But that won't help you build a new turn. Nor will it help build a new HST file if you only have 10 years of backups. And it's likely easier to just re-take the turn that the time in attempting to untangle a corrupt file.



https://www.irelandbybicycle.com
http://totalhost.sinister.net:999
https://github.com/ricks03/TotalHost

Report message to a moderator

Re: Corrupt X and H file? Wed, 12 May 2021 09:30 Go to previous messageGo to next message
wildcard is currently offline wildcard

 
Crewman 2nd Class

Messages: 18
Registered: May 2005
Yes, this is the conclusion I am coming to, it's probably faster to just re-do the turn. I will check out the TotalHost tools, to see if anything can be done with that. Right now, I am just trying to see if I can recover any of the .X file.

Your suggestion about loading up old turns to rebuild the history helped. Even though I only have 10 turns worth of history, it helped. At first not all of turns had the history "stick". It seemed like I did have to load the turn, make a change, and then save it to get the history to stick. Then load up the next turn.

Considering the sensitivity of these files, and the time some of us sink into these turns, does what sort of backup does everyone use? Seems like the built in turn backup skips the history file.

I have been thinking of scripting something that backs up the directory every 30 minutes (checks for any changes first and skips if no changes). Anyone else do anything like that?

Report message to a moderator

Re: Corrupt X and H file? Wed, 12 May 2021 11:15 Go to previous messageGo to next message
ricks03 is currently offline ricks03

 
Officer Cadet 1st Year
Creator of TotalHost and Stars! utilities
Created TotalHost and Stars! utilities

Messages: 222
Registered: January 2012
Location: NC
There are a few backup considerations. First, Stars! doesn't generate a .h file at the Host level. So a hosting platform can archive the .x, .xy (which never changes), .m, and .hst file. But the only place the .h file exists is on your local system.

The .x file is not dynamic. It only updates when you select "Save". So any scripting you write will have to include you manually selecting Save on some regular basis. That .x file is then appended to each time you save, which you can see when you "look" at it. If you add something to your queue, then remove it, then add it back, that's three sequential operations in the .x file -- leading to a problem if you do that a LOT, because there's a limited number of orders that can be contained in the .x file. It's a BIG number (32k IIRC); I've only reached it programatically.

It is worth scripting a local copy of each turn tho. Totalhost has the option for a player to download their entire game history precisely so they can recover a (local) lost .h file when they failed to keep a local copy!

The utilities in TH can pretty much tear apart most of the Stars! files, but they're unlikely to output specifically what you're looking for in a ready to use format for manually recreating a .x file, because I didn't really write them for that purpose. They're primarily the foundation for the hosting code that looks for bugs and cheats in the files (like checking to see if someone has submitted a colonizer that exhibits the "free colonizer" bug). I tend to write a utility to search fro something as a standalone, and then integrate it into the hosting code.



https://www.irelandbybicycle.com
http://totalhost.sinister.net:999
https://github.com/ricks03/TotalHost

Report message to a moderator

Re: Corrupt X and H file? Wed, 12 May 2021 12:15 Go to previous messageGo to next message
wildcard is currently offline wildcard

 
Crewman 2nd Class

Messages: 18
Registered: May 2005
Ya, I've been playing around with the idea of scripting a "CTRL+S" every 5 - 10 minutes to save. Then backup the files periodically.

Report message to a moderator

Re: Corrupt X and H file? Wed, 12 May 2021 13:33 Go to previous messageGo to next message
wildcard is currently offline wildcard

 
Crewman 2nd Class

Messages: 18
Registered: May 2005
So is it possible to copy and paste from one .X file to another; does it have to be decrypted first?

Report message to a moderator

Re: Corrupt X and H file? Wed, 12 May 2021 19:38 Go to previous messageGo to next message
ricks03 is currently offline ricks03

 
Officer Cadet 1st Year
Creator of TotalHost and Stars! utilities
Created TotalHost and Stars! utilities

Messages: 222
Registered: January 2012
Location: NC
You would have to decrypt the .x file, extract entry by entry, change/add/modify to the data, then reencrypt it. The TH utilities have that ability (at least in pieces) because I can decrypt an .x file, change the value of things in it, and then reencrypt it. It's how I do things like fix for the colonizer bug; I find the problem when a .x file is uploaded, fix the file, and then save it for turn generation.

I'd be glad to get on a call or email thread if you'd like to discuss in detail, as well as see which TotalHost utilities might best get you there were you so inclined to dig deeper. Everyone probably isn't interested in all the gritty details Smile

Rick



https://www.irelandbybicycle.com
http://totalhost.sinister.net:999
https://github.com/ricks03/TotalHost

Report message to a moderator

Re: Corrupt X and H file? Thu, 13 May 2021 09:40 Go to previous message
wildcard is currently offline wildcard

 
Crewman 2nd Class

Messages: 18
Registered: May 2005
Ya that sounds good. I'll send you a PM Smile

Report message to a moderator

Previous Topic: StarsWine - Stars in BoxedWine on Windows
Next Topic: rec.games.computer.stars or yahoo groops
Goto Forum:
  


Current Time: Thu Mar 28 09:45:41 EDT 2024