You are browsing as a guest. Sign up (or log in) to start making projects!

3h 37m 53s logged

I finished implementing the mod resolver for tModLoader. My first thought was to read the .twld file; since it’s generated by tModLoader, it probably held information about the mods. I couldn’t find docs for its file format, so I first used the file tool, which showed that it was a gzipped file. I decompressed the file and tried to see if it was a text format or simple binary format by opening it in a hex editor. It wasn’t though, so I looked harder at the tModLoader docs, and found that it simply saved the WorldFileData to a TagCompound, which is serialized as an NBT.

I then had the problem of storing the world path within the Terraria struct, since it would require a special argument on the server_info function that other implementations wouldn’t need. I thought about creating a new trait that would be passed to server_info, but I realised I could use the V: Variant and detect the world path from the config, since V already is generic. This required changing the trait bound from Copy to Clone, since the ServerType would have to hold a PathBuf which does not implement Copy.

I finally used the Steamworks Web API to search the Steam Workspace, where mods are uploaded, to find info like the icon url, whether it’s client or server sided, etc.

0
1

Comments 0

No comments yet. Be the first!