Convert Minecraft server world files into MCserver world files. - Printable Version +- Cuberite Forum (https://forum.cuberite.org) +-- Forum: Cuberite (https://forum.cuberite.org/forum-4.html) +--- Forum: Development (https://forum.cuberite.org/forum-13.html) +--- Thread: Convert Minecraft server world files into MCserver world files. (/thread-195.html) |
RE: Convert Minecraft server world files into MCserver world files. - FakeTruth - 10-30-2011 I fixed it for ya, check out the changes The fix should be quite obvious, though hard to fix yourself when you're not familiar with the parser http://code.google.com/p/mc-server/source/detail?r=27&path=/trunk/ RE: Convert Minecraft server world files into MCserver world files. - rs2k - 10-31-2011 (10-30-2011, 09:43 PM)FakeTruth Wrote: I fixed it for ya, check out the changes The fix should be quite obvious, though hard to fix yourself when you're not familiar with the parser Thanks! I made a few more changes, and cleaned up the code quite a bit in cConvert.cpp as well as split off a few of the functions. The current problem is the converter seems to bug out when it gets to the entity lists when it contains entities. Some chunks also cause the parser to segfault. I'll have to do more printf troubleshooting. RE: Convert Minecraft server world files into MCserver world files. - FakeTruth - 10-31-2011 If you can't figure it out, upload the segfaulting chunk and I'll take a look RE: Convert Minecraft server world files into MCserver world files. - rs2k - 10-31-2011 Thanks, I think it will be best to fix the entities tag first though. I have a feeling it might have to do with that. 2 chunks before the first one that segfaults throws an unknown tag error while parsing what looks like this tag: TAG_List("Motion"): 3 TAG_Doubles describing the current dX,dY,dZ velocity of the entity. (Note: Falling into the Void appears to set this to ridiculously high speeds. 0,0,0 is no motion.) Code: UNKNOWN TAG 3b RE: Convert Minecraft server world files into MCserver world files. - rs2k - 10-31-2011 I'm pretty sure the segfault happens when it tries to parse a tag and doesn't do it right. The seg fault happens when it tries to parse what it thinks is Tag: 63. (This was the same tag is segfaulted on when I first added the bytearray tag incorrectly) The problem only seems to happen when the program loops through multiple chunks. (Starts with chunk 0) Chunk 3 and 4 both show unknown tag, and chunk 32 throws a segfault. When I run those chunks separately it parses them without trouble. If I skip those chunks it will process the other chunks around them just fine. I think there might be a problem with data carrying over between chunks in the parser (My guess is the compound tag since that's what the entity tag is). Am I supposed to clear the data with a function I'm not aware of? Is this just a bug with the parser? RE: Convert Minecraft server world files into MCserver world files. - rs2k - 10-31-2011 I was wrong about parsing the chunks separately didn't throw the error, when I tried to parse the chunks separate the program foes for chunk 0 first. The tag it is having trouble with is here: Code: Tag: 4 I'll take a look at what the program is doing one byte at a time to see what's going on. RE: Convert Minecraft server world files into MCserver world files. - FakeTruth - 10-31-2011 Remember that the error in parsing (which needs fixing) happens anywhere before (or during) the segfault, so it can happen a couple of tags before the crash RE: Convert Minecraft server world files into MCserver world files. - rs2k - 10-31-2011 I've got the converter parsing everything without crashing or coming up with unknown tag errors now. There's still a problem with the converter closing compound tags too early if there's an entity list that contains double or float tags though. http://code.google.com/p/mc-server/source/diff?spec=svn30&r=30&format=side&path=/trunk/converter/cNBTData.cpp The converter is closing the compound before it parses a list that should belong to that compound. Here's an example: Code: Coord(X,Z): 29,13 and how it *should* look: Code: Coord(X,Z): 29,13 I'm not sure what's up with "FLOAT (0.000000)" That would be another tag that's not getting parsed correctly. RE: Convert Minecraft server world files into MCserver world files. - FakeTruth - 10-31-2011 Fixed it for ya. It had something to do with inconsistent incrementing m_Index http://code.google.com/p/mc-server/source/detail?r=32 RE: Convert Minecraft server world files into MCserver world files. - rs2k - 10-31-2011 Thanks again. I got the converter to the point where it can create the files, but everything after the pak header is one byte off and loading the map causes the server to crash. I'll fix it tomorrow. |