Icehawk78 wrote:MrAdam wrote:Why? Well, I was thinking about making a mod manager with a bit more features than the existing one.
Im an Android developer and I don't have much experience with Java desktop development (started programming Java when I started working with Android), so my skillset is mostly for mobile stuff. Anyways, for what I can see, the .dat files are just binary encoded C objects? I would just like to know the basic structure of those objects, as it would make it much easier for me to work with
EDIT: Right now Im trying to get the data reading to work using a library called Preon, which enables be to define the structure of the byte-data, and it can then map it to java classes to make it easier to work with, like this:Code: Select all
public class FTLData {
@BoundNumber(byteOrder = ByteOrder.LittleEndian, size = "32")
public long indexSize;
}
Ah, gotcha. That makes sense (I'm looking into doing something similar with Ruby), then.
From what I can gather, the file format looks to just be this:Code: Select all
4: Index Size
4*Index Size: Indices
Files: (For each Index)
4: File Size
4: Filename Size
Filename Size: Filename
File Size: File
Looking up Preon, I'd think you'd want something like this:Code: Select all
public class BinFile {
@BoundNumber(size="32", byteOrder=LittleEndian) Integer index_size
@BoundList(type=Integer.class, size="index_size", byteOrder=LittleEndian)
@BoundList(type=DataFile.class, size="index_size", byteOrder=LittleEndian)
public class DataFile {
@BoundNumber(size="32", byteOrder=LittleEndian) Integer file_size
@BoundNumber(size="32", byteOrder=LittleEndian) Integer filename_size
@BoundString(size="filename_size", byteOrder=LittleEndian) String filename
//@Bound(size="file_size", byteOrder=LittleEndian) ChunkOfData file - not sure offhand how you'd populate this
}
}
Note: None of this is tested, it's just what I gleaned from the python.
Wow, thanks for the info

