“I melted the ice of the polar caps, found the raiders of the lost ark, solved a case for the genius from Baker Street, helped to clean the Central Park. I created the plan for the Chinese wall, went to desert, made it rain, swam through a shark tank bloodily, (found Atlantis, by the way),
But today…”
Coding #
Ok, we’ve had some fun putting together a few tests, but time to get a bit more methodical about it. Digging into the server code, where do we first show up?
|
|
So it lets me connect if the server state is Running
or Locked
, but what other states are there?
|
|
A little digging further shows that Starting
is (as you’d expect) set early in Main
, switching to Running
when the main game loop starts once everything’s loaded.
A developer-level account issuing either the /lockserver
or /bootplayers
command will set the server to Locked
, preventing any non-GMs from entering the game world until a
/unlockserver
command sets the state back to Running
. Similarly, a developer-level account issuing /shutdown
will put the server in ShuttingDown
, which has the same effect
(oddly, it doesn’t actually start any shutting down of the server as far as I can see). I find no reference to Restarting
outside of this enum.
So that presents us with a nice little set of tests:
|
|
Some of these steps require us to get our hands pretty dirty. First, thing, how do we know that the server is running? With our database connection,
we could make sure the Live* tables are updating, but that’s not guaranteed if the ProcessEmptyWorld
server parameter has been set to false and no one is logged in.
We need access to the logs or some other indicator of server activity. We can:
- Access the logs via Windows file-share shenanigans
- Set up a file server (TFTP?) to allow us to grab the logs
- Be forced to run the server local to where the tests are running
- Modify the server to put state info into the DB
- Modify the server to put log entries into the DB
- other
For a relatively clean solution (we’ll need the server to be as “run anywhere” as possible), I’m going to try #5. Tomorrow.
