#pragma once #include #include using namespace std; using namespace stdext; #define LD_CHANGING_MAP 0 #define LD_NOPASSWORD 1 //Structures struct CHARACTER_CREATE { //Control which step of the character creation process we are on int step; short streamGlue; short itemGlue[5]; short PosGlue; short bpGlue; short itemDivGlue; Item armor[5]; //Filled in from the account int characterCreateCampaign; int characterCreateProfession; //Filled in from user actions int profession; int oldProfession; int campaign; bool isPvP; unsigned char defaultdye; unsigned char dyes[5]; int dyeTimer; bool preventCrash; CHARACTER_CREATE() { isPvP=false; for (int i=0; i<5; i++){itemGlue[i]=-1;} step=0; profession=1; oldProfession=1; memset(dyes, 0x09, 5); defaultdye=0; dyeTimer=0; preventCrash=false; } }; struct PLAYER_DATA { bool establishedEncryptedConnection; //If true this player is connected properly //Stuff for use with queries int (*QueryProcess)(QUERY_RESULT* result, PLAYER_DATA* lir); unsigned long queryId; void *pTempData; short networkId; //Game server specific bool authorized; //This client is authorized to be connected(meaning they are logged in properly on the login server) unsigned long accountId; unsigned long characterId; unsigned short zoneId; unsigned long transferId1; unsigned long transferId2; short lsnetworkId; unsigned long missionId; //used for the ping event unsigned int pingTimer; //used for character creation CHARACTER_CREATE *pCharCreate; //Used for instancing long instanceId; //What instance this player is in void* pPlayer; //Used for both character creation and playing //Note: When in an instance, the items in this list are transferred to the Player class vector myItems; bitset<32> flags; //structure constructor PLAYER_DATA() { missionId=0; lsnetworkId=0; transferId1=0; transferId2=0; pTempData=NULL; establishedEncryptedConnection=false; networkId=0; pCharCreate=0; authorized=false; accountId=0; pingTimer=0; instanceId=0; pPlayer=NULL; flags=0; } ~PLAYER_DATA() { myItems.clear(); if (pCharCreate!=0){delete pCharCreate;} } }; extern hash_map GameServInfo; //Server side client data. 1 for each connection. PLAYER_DATA *AccessLocalData(int id); void DeleteLoginById(int id);