Testing the Slime Generator and Populating the server with Slime Data

Last night I did a little overtime, today I wrote a little test function so I could rapidly generate a whole lot of slimes for SonOfTesticlese, as long as I hold Page Up while in the server window it will rapidly create new slimes. I was looking for any crashes and surprisingly after I found one bug I have not had one.

Many Geru.

Of course now I have to deal with going through these and making sure they are generating correctly, no weirdness happening.

So far it looks like things are generating as intended, I suppose I can get on with the code to load the slimes into the server when a player logs in.

Alright, constructed a node to hold and handle the data, wrote the code to actually load it in and add it as a child of the player node. It also adds itself to a few groups, "Slime" and <player_id>. I don't know that I will need these but I have a feeling they will come in handy later.

Lunch now, then I will be working on formatting the data to send it over to the client and setting up the client to receive it and handle it when it does.

Alright, so packaging the data... I could package it as an array, overwrite the sensitive data and send it out which would be fastest or I could rebuild the array into a dict. If I send the data over as an array I will have to set the enum up on the client as well and overwrite a couple things.

There's far less work for the server to load slimes if I just send over the array with a couple things modified so I think I would prefer that. It does mean I need to send over the enum on login, this will prevent me having to change it in multiple places if I have to modify it.

So first I need to send over the enum to make operating on the array easier.

Then I need to update the array, changing a few things. Some IDs need to be swapped out for dictionaries containing the data required and IDs need to be overwritten.

Then I will send over the array to the client and have it process the data and add it to the PLAYERSLIMES singleton.

After the client has the data I need to do some things to the Apartment Server, mainly the tanks. Though I suppose I could modify the tanks from the slime server... setting the first slime generated as the resident of the player's first tank. I guess because this is more to do with the slimes themselves and they will be outgrowing the tanks eventually I should probably handle it on the slime server? Hmmmm...

Can you even create an enum at runtime?

Nope, as I thought, a constant. Welp, looks like I will just have to do some copy-paste and hope I remember that the two have to match up. Gonna make note of it in my notes to write documentation by.

The Slime server will have to interact with data from the apartment server's tables often. At first just tanks but it will also need to know about ambient apartment data so I will have to write a few DBMan funcs to handle that. I could use the connection between the Slime Server and the Apartment server to handle this but I think I will end up over-saturating the networking if I do. I could be wrong but I think it's safer to just directly work with the DB.

Of course, to get a Tank ID I need the Apartment ID I need to get the Player ID, the slime server only knows the Character ID though. Hm, well then. I could reverse lookup the Player ID for now, I will have to send it over from the Apartment Server or handle it with the SlimeServ <-> ApartmentServ Connection later.  

Tripped myself up on checking for nulls, used = instead of IS;

WHERE x = NULL; /* Bad, not gonna return anything. */
WHERE x IS NULL;

But now that that's sorted I can at least assign the first Slime to the first Tank.

Tank now contains a resident.

Well, one step closer now.

Next up... formatting and sending slime data to the client.

This means writing some lookup funcs in the DBMan and changing values at indices to be what is returned from the lookup. Should be relatively simple. Should.

Slime Data on the client

Well, we have the slime data appearing on the client, now to make sure it's all correct.

Well, seems fine for this simple slime. It has no markings or parts, I will modify the bugger to be a complex bugger and then see what's up.

Slime node on Client

Now I have to set up the data in that node, but I have it all (or so it seems).

I don't trust things being easy. I suspect something is terribly wrong just beneath the surface ready to explode. This is what testing is for. First I need to extract the data from the big ol' array into bits I can operate on more easily and debug on the client.

Then I need to go do some work on the tanks in the client so they can load in their resident Geru.

THEN I need to set up the Geru node to load all it's appearance data from the stuff we got from the server.

Finally I will be on to making them move around, setting their moods and handling their care systems and the great and powerful Timer-chan.

On to the data extraction.

Extracted data.
Wings match up.

Looks like I got it. Still got one more bit to extract and then I am out of here, it's 5 already.

Hello Drubbo.

Alright, everything is now accessible client-side and tomorrow I can start constructing the little slime inside it's tank so all of this work can start to bare visible fruit.

Clocking out.