Here's a code snippet on how to request a user from the database:
CDatabase::Result theResult;User* pUser = CDatabase::Get().AllocateUser();HANDLE h = CDatabase::Get().RequestUser(1,pUser);while(!CDatabase::Get().OperationComplete(h,theResult)) Sleep(10);CDatabase::Get().FreeUser(pUser);
In my test, it took 4 loops in there (~40ms) to actually get the user data out, so this should definitely give me a performance boost.
The AllocateUser() and FreeUser() functions use a templated free list inside the database class, just to save the app calling new and delete. It might be better placed elsewhere, but I figure it's a good place for it, since only really the database deals with User structures.
A bit of info on what happens internally:
The Result structure contains a pointer to a buffer, the length of the buffer, and an error code for if the query failed.
Anyway, I suppose I'd better go do some other code now. I was considering re-tackling IO Completion Ports, but I might leave that for another day.
EDIT:
Yay, I can now happily connect through the login server to a game server, with all nice authentication. Next up, I need to make some fake code for sending messages to players, then I can get stress testing.
Hopefully, it should all be ready for a first stress test in a couple of days.