Began to implement user accounts using the database

I'm mostly just testing the waters at this stage, and i've left some debug
code in. There's no way to unload, delete, etc. the accounts, but that
comes later.
This commit is contained in:
Kayne Ruse
2014-05-05 23:57:07 +10:00
parent 92fc9b4e25
commit 910e51f637
8 changed files with 174 additions and 6 deletions
+7 -1
View File
@@ -46,11 +46,17 @@ void ServerApplication::HandleJoinRequest(SerialPacket packet) {
ClientData newClient;
newClient.address = packet.meta.srcAddress;
//debug
std::cout << "Function Return: " << LoadUserAccount(packet.clientInfo.username, ClientData::uidCounter) << std::endl;
for (auto& it : accountMap) {
std::cout << "Account(" << it.first << "): " << it.second.username << std::endl;
}
//TODO: move this into the character management code
//create the new character
CharacterData newCharacter;
newCharacter.clientIndex = ClientData::uidCounter;
newCharacter.username = packet.clientInfo.username;
newCharacter.handle = packet.clientInfo.handle;
newCharacter.avatar = packet.clientInfo.avatar;