#pragma once #include "../../src/GWLPDatabase.h" #include #define LD_ESTABLISHED_ENCRYPTED_CONNECTION 0x01 #define LD_LOAD_INTO_INSTANCE 0x02 #define LD_KEY_VALIDATED 0x04 #define LD_AUTHENTICATED 0x08 #define LD_UPDATE_CONNECTION 0x10 #define LD_DISPATCHED 0x20 struct LOCAL_DATA { short networkId; //This clients NetworkID unsigned long loginAttempts; //How many login or play attempts this Player has made. unsigned long accountId; //The unique AccountID used for referencing account info in the database. unsigned long accessLevel; unsigned long ownedCampaigns; unsigned char ownsEotn; //Stuff for use with queries int (*QueryProcess)(QUERY_RESULT *result, LOCAL_DATA* lir); unsigned long queryId; void* pTempData; //Used for character playing char name[40]; //Name of the currently selected character unsigned short zoneId; //The ZoneID. Specifies what zone the player is loading into. unsigned int characterId; //Character id. Used to find character information in the database. unsigned char compHash[32]; //The hash of the players computer information short gameServerId; //The ID of the game server the player was sent to unsigned long timesZoned; //The number of times this player has zoned unsigned long missionId; //The mission the player is in. //Used for account creation char* pAccessKey; char* pEmail; //Used when a client is authenticated unsigned long transferId1; unsigned long transferId2; unsigned char bitfield; void* pTemporaryData; unsigned short temporaryDataSize; unsigned long keepAlive; LOCAL_DATA() { keepAlive=0; missionId=0; ownsEotn=0; ownedCampaigns=0; timesZoned=0; temporaryDataSize=0; pTemporaryData=NULL; bitfield=0; gameServerId=0; transferId1=0; transferId2=0; pEmail=NULL; pAccessKey=NULL; zoneId=0; memset(name, 0, 40); networkId=0; accountId=0; characterId=0; QueryProcess=NULL; pTempData=NULL; queryId=0; accessLevel=0; memset(compHash, 0, 32); } ~LOCAL_DATA() { if (pTempData!=NULL) { delete pTempData; } if (pAccessKey!=NULL) { delete [] pAccessKey; } if (pEmail!=NULL) { delete [] pEmail; } } void Reset() { zoneId=0; memset(name, 0, 20); characterId=0; } }; extern hash_map gLoginInfo; LOCAL_DATA* FindLIRByID(short networkId); //Find the local info reference by NetworkID LOCAL_DATA* FindAuthenticatedClientWithIP(unsigned char* ip); //Find a player that is connected on the specified IP LOCAL_DATA* AccessLocalData(int id); void DeleteLocalInfoById(short networkId); //Delete local info for specified NetworkID void RevokeAuthentication(short networkId); //Deletes a logged-in player from the ActiveClients list