The Updater

The Updater

So now I am building the update system.

It will pull data from the Client Update endpoints on the API, compare that data to locally cached data(if any) and update as necessary.

This should allow more rapid updates to slime and player data as well as easier rollback if something gets messed up, since the version info is stored in the DB and the sprites are all versioned in the object store, so if something gets screwed up it's very simple to just set the version number back one and restore it.

This can also allow for real-time update checks while the client is running. Very useful in development. I could write a hook on the API that tells the game server that a part is updated, it can send the updated data to all connected clients and they can swap in the new texture, Bam. Done.

Anyway, to do this I need to first write the player updater. Before I started this post I got a good chunk of it done, but it's about lunch time so I figured I would take a break, write a little here and get lunch before I get back to it.

Currently it is able to set up the directory structure and download all the JSON from the API client update endpoints. Right now I am in the middle of writing the code to save the local cache and compare the data on startup.

Starting with Body sprites.

Cached data.

I've also encrypted the data being saved here. It's not terribly important but it should keep the lazier nosy people out of there. I would prefer they could not mine the data. That shit takes away all the fun of discovery.

If it gets to be a problem I will rewrite the cache system to only cache things that have been discovered and add a Discovered property to all parts, so if the part doesn't exist in any slimes it wont be cached. Then send out the new data when it gets discovered. This way it will only be in the DB and remain an unknown.

Anyway, better make some lunch then get back to it. Lots of code to write. Probably wont finish the updates system til tomorrow at this rate.

Updated body to Version 2

I'll need to make sure I call the compare function after all the data has come back from the API, since this happens asynchronously I suppose I could call compare on the handler for the returned data, that would probably be the most efficient way to deal with it.

Update code is firing.

Now I need to make sure files are closed correctly and nothing hangs around longer than it needs to.

All player part DBs are now updating in the cache.

Now to fetch sprites. Yay. Whoopee. What fun this shall be.

There's an encrypted version and a (test)png version of the sprite sheet.

Welp, so far so good. Now I need to change the test body sprite and see if it will update accordingly. If that's all good I will implement the sprite cache system on the rest of the parts.

Indeed it does.

We're good to go.

All parts are updating as I had hoped.

With that I have the first part of the updater system done.

Not much ram usage increase with everything loaded.

Once it finishes the updates for the files it cleans up after itself and removes the node.

Welp, tomorrow will be the slime data updater. Oh boy. Then will come the time of constructing the player and slimes in the client and finally starting on gameplay functions.