// *************************************************************** // Function: CharacterCreated.cpp // *************************************************************** #include "Main.h" unsigned int GetClientByAccountId(unsigned long accountId); //************************************ // Name: GetClientByAccountId // // Gets the client's network id. // // Parameters: // accountId - The player's account id // // Return: // 0 - No player found with account id // >0 - Player's network id //************************************ unsigned int GetClientByAccountId(unsigned long accountId) { hash_map::iterator itr; for (itr=GameServInfo.begin(); itr!=GameServInfo.end(); itr++) { if ((itr)->second.accountId==accountId) { return (itr)->second.networkId; } } return 0; } void IcProcessCharacterCreated(NetMessage* pData, NetMessage *s, unsigned char* pDest, bool charCreated) { //Extract the account ID unsigned int accountId=0; memcpy(&accountId, pDest+2, 4); //THIS IS TEMPORARY NetMessage m(0, 1, GetClientByAccountId(accountId), 0); gpGameServer->SendControl(&m); }