9
3

client.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546
  1. /*
  2. EQ2Emulator: Everquest II Server Emulator
  3. Copyright (C) 2007 EQ2EMulator Development Team (http://www.eq2emulator.net)
  4. This file is part of EQ2Emulator.
  5. EQ2Emulator is free software: you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation, either version 3 of the License, or
  8. (at your option) any later version.
  9. EQ2Emulator is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with EQ2Emulator. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #ifndef CLIENT_H
  17. #define CLIENT_H
  18. #include "../common/EQStream.h"
  19. #include <list>
  20. #include "../common/timer.h"
  21. #include "zoneserver.h"
  22. #include "Player.h"
  23. #include "Quests.h"
  24. using namespace std;
  25. #define CLIENT_TIMEOUT 60000
  26. struct TransportDestination;
  27. struct ConversationOption;
  28. #define MAIL_SEND_RESULT_SUCCESS 0
  29. #define MAIL_SEND_RESULT_UNKNOWN_PLAYER 1
  30. #define MAIL_SEND_RESULT_CANNOT_SEND_TO_PLAYER 2
  31. #define MAIL_SEND_RESULT_GIFT_WRONG_SERVER 3 /* Cannot send gifts across worlds */
  32. #define MAIL_SEND_RESULT_CANNOT_SEND_TO_SELF 4
  33. #define MAIL_SEND_RESULT_MAILBOX_FULL 5
  34. #define MAIL_SEND_RESULT_NOT_ENOUGH_COIN 6
  35. #define MAIL_SEND_RESULT_ITEM_IN_BAG 7 /* Cannot send non-empty bags as gifts */
  36. #define MAIL_SEND_RESULT_NOT_IN_GUILD 8
  37. #define MAIL_SEND_RESULT_GUILD_ACCESS_DENIED 9
  38. #define MAIL_SEND_RESULT_GIFTS_TO_GUILD 10 /* Cannot send gifts to entire guild */
  39. #define MAIL_SEND_RESULT_EMPTY_TO_LIST 11 /* Empty recipient list */
  40. #define MAIL_SEND_RESULT_TRIAL_PLAYERS 12 /* Cannot send mail to trial players */
  41. #define MAIL_SEND_RESULT_MAIL_WRONG_SERVER 13 /* Cannot send mail across worlds */
  42. #define MAIL_SEND_RESULT_UNKNOWN_ERROR 14
  43. #define MAIL_TYPE_REGULAR 0
  44. #define MAIL_TYPE_SPAM 1
  45. #define MAIL_TYPE_GM 2
  46. struct QueuedQuest{
  47. Quest* quest;
  48. int32 step;
  49. bool display_quest_helper;
  50. };
  51. struct BuyBackItem{
  52. int32 item_id;
  53. int32 unique_id;
  54. int16 quantity;
  55. int32 price;
  56. bool save_needed;
  57. };
  58. struct MacroData{
  59. string name;
  60. string text;
  61. int16 icon;
  62. };
  63. struct Mail {
  64. int32 mail_id;
  65. int32 player_to_id;
  66. string player_from;
  67. string subject;
  68. string mail_body;
  69. int8 already_read;
  70. int8 mail_type;
  71. int32 coin_copper;
  72. int32 coin_silver;
  73. int32 coin_gold;
  74. int32 coin_plat;
  75. int16 stack;
  76. int32 postage_cost;
  77. int32 attachment_cost;
  78. int32 char_item_id;
  79. int32 time_sent;
  80. int32 expire_time;
  81. int8 save_needed;
  82. };
  83. struct MailWindow {
  84. int32 coin_copper;
  85. int32 coin_silver;
  86. int32 coin_gold;
  87. int32 coin_plat;
  88. int32 char_item_id;
  89. };
  90. struct PendingGuildInvite {
  91. Guild* guild;
  92. Player* invited_by;
  93. };
  94. struct PendingResurrection {
  95. Spawn* caster;
  96. Timer* expire_timer;
  97. string spell_name;
  98. string heal_name;
  99. bool active;
  100. float hp_perc;
  101. float mp_perc;
  102. float range;
  103. int8 crit_mod;
  104. bool no_calcs;
  105. int32 subspell;
  106. bool crit;
  107. bool should_delete;
  108. int32 spell_visual;
  109. };
  110. #define PAPERDOLL_TYPE_FULL 0
  111. #define PAPERDOLL_TYPE_HEAD 1
  112. struct IncomingPaperdollImage {
  113. uchar* image_bytes;
  114. int32 current_size_bytes;
  115. int8 image_num_packets;
  116. int8 last_received_packet_index;
  117. int8 image_type;
  118. };
  119. class Client {
  120. public:
  121. Client(EQStream* ieqs);
  122. ~Client();
  123. bool Process(bool zone_process = false);
  124. void Disconnect(bool send_disconnect = true);
  125. void SetConnected(bool val){ connected = val; }
  126. bool IsConnected(){ return connected; }
  127. bool IsReadyForSpawns(){ return ready_for_spawns; }
  128. bool IsReadyForUpdates() { return ready_for_updates; }
  129. bool IsZoning(){ return client_zoning; }
  130. void SetReadyForSpawns(bool val);
  131. void QueuePacket(EQ2Packet* app, bool attemptedCombine=false);
  132. void SendLoginInfo();
  133. void SimpleMessage(int8 color, const char* message);
  134. void Message(int8 type, const char* message, ...);
  135. void SendSpellUpdate(Spell* spell);
  136. void Zone(ZoneServer* new_zone, bool set_coords = true);
  137. void Zone(const char* new_zone, bool set_coords = true);
  138. void Zone(int32 zoneid, bool set_coords = true);
  139. void Zone(int32 instanceid, bool set_coords = true, bool byInstanceID=false);
  140. void SendZoneInfo();
  141. void SendZoneSpawns();
  142. void HandleVerbRequest(EQApplicationPacket* app);
  143. void SendCharInfo();
  144. void SendLoginDeniedBadVersion();
  145. void SendCharPOVGhost();
  146. void SendPlayerDeathWindow();
  147. float DistanceFrom(Client* client);
  148. void SendDefaultGroupOptions();
  149. bool HandleLootItem(Entity* entity, int32 item_id);
  150. bool HandleLootItem(Entity* entity, Item* item);
  151. void HandleLoot(EQApplicationPacket* app);
  152. void HandleSkillInfoRequest(EQApplicationPacket* app);
  153. void HandleExamineInfoRequest(EQApplicationPacket* app);
  154. void HandleQuickbarUpdateRequest(EQApplicationPacket* app);
  155. void SendPopupMessage(int8 unknown, const char* text, const char* type, float size, int8 red, int8 green, int8 blue);
  156. void PopulateSkillMap();
  157. void ChangeLevel(int16 old_level, int16 new_level);
  158. void ChangeTSLevel(int16 old_level, int16 new_level);
  159. bool Summon(const char* search_name);
  160. bool TryZoneInstance(int32 zoneID, bool zone_coords_valid=false);
  161. bool GotoSpawn(const char* search_name, bool forceTarget=false);
  162. void DisplayDeadWindow();
  163. void HandlePlayerRevive(int32 point_id);
  164. void Bank(Spawn* banker, bool cancel = false);
  165. void BankWithdrawal(int64 amount);
  166. void BankDeposit(int64 amount);
  167. Spawn* GetBanker();
  168. void SetBanker(Spawn* in_banker);
  169. bool AddItem(int32 item_id, int16 quantity = 0);
  170. bool AddItem(Item* item);
  171. bool AddItemToBank(int32 item_id, int16 quantity = 0);
  172. bool AddItemToBank(Item* item);
  173. bool RemoveItem(Item *item, int16 quantity);
  174. void ProcessTeleport(Spawn* spawn, vector<TransportDestination*>* destinations, int32 transport_id = 0);
  175. void ProcessTeleportLocation(EQApplicationPacket* app);
  176. void UpdateCharacterInstances();
  177. void SetLastSavedTimeStamp(int32 unixts) { last_saved_timestamp = unixts; }
  178. int32 GetLastSavedTimeStamp() { return last_saved_timestamp; }
  179. bool CheckZoneAccess(const char* zoneName);
  180. ZoneServer* GetCurrentZone();
  181. void SetCurrentZoneByInstanceID(int32 id, int32 zoneid);
  182. //void SetCurrentZoneByInstanceID(instanceid, zoneid);
  183. void SetCurrentZone(int32 id);
  184. void SetCurrentZone(ZoneServer* zone) {
  185. current_zone = zone;
  186. player->SetZone(zone);
  187. }
  188. Player* GetPlayer(){ return player; }
  189. EQStream* getConnection(){ return eqs; }
  190. inline int32 GetIP() { return ip; }
  191. inline int16 GetPort() { return port; }
  192. inline int32 WaitingForBootup() { return pwaitingforbootup; }
  193. inline int32 GetCharacterID() { return character_id; }
  194. inline int32 GetAccountID() { return account_id; }
  195. inline const char* GetAccountName() { return account_name; }
  196. inline sint16 GetAdminStatus() { return admin_status; }
  197. inline int16 GetVersion() { return version; }
  198. void SetNameCRC(int32 val){ name_crc = val; }
  199. int32 GetNameCRC(){ return name_crc; }
  200. void SetVersion(int16 new_version){ version = new_version; }
  201. void SetAccountID(int32 in_accountid) { account_id = in_accountid; }
  202. void SetCharacterID(int32 in_characterid) { character_id = in_characterid; }
  203. void SetAdminStatus(sint16 in_status) { admin_status = in_status; }
  204. void DetermineCharacterUpdates ( );
  205. void UpdateTimeStampFlag ( int8 flagType )
  206. {
  207. if(! (timestamp_flag & flagType ) )
  208. timestamp_flag |= flagType;
  209. }
  210. int8 GetTimeStampFlag ( ) { return timestamp_flag; }
  211. bool UpdateQuickbarNeeded();
  212. void Save();
  213. bool remove_from_list;
  214. void CloseLoot();
  215. void SendPendingLoot(int32 total_coins, Entity* entity);
  216. void Loot(int32 total_coins, vector<Item*>* items, Entity* entity);
  217. void Loot(Entity* entity, bool attemptDisarm=true);
  218. void OpenChest(Entity* entity, bool attemptDisarm=true);
  219. void CastGroupOrSelf(Entity* source, uint32 spellID, uint32 spellTier=1, float restrictiveRadius=0.0f);
  220. void CheckPlayerQuestsKillUpdate(Spawn* spawn);
  221. void CheckPlayerQuestsChatUpdate(Spawn* spawn);
  222. void CheckPlayerQuestsItemUpdate(Item* item);
  223. void CheckPlayerQuestsSpellUpdate(Spell* spell);
  224. void CheckPlayerQuestsLocationUpdate();
  225. void AddPendingQuest(Quest* quest);
  226. Quest* GetPendingQuest(int32 id);
  227. void RemovePendingQuest(Quest* quest);
  228. void SetPlayerQuest(Quest* quest, map<int32, int32>* progress);
  229. void AddPlayerQuest(Quest* quest, bool call_accepted = true, bool send_packets = true);
  230. void RemovePlayerQuest(int32 id, bool send_update = true, bool delete_quest = true);
  231. void SendQuestJournal(bool all_quests = false, Client* client = 0);
  232. void SendQuestUpdate(Quest* quest);
  233. void SendQuestFailure(Quest* quest);
  234. void SendQuestUpdateStep(Quest* quest, int32 step, bool display_quest_helper = true);
  235. void SendQuestUpdateStepImmediately(Quest* quest, int32 step, bool display_quest_helper = true);
  236. void DisplayQuestComplete(Quest* quest);
  237. void DisplayRandomizeFeatures(int32 features);
  238. void AcceptQuestReward(Quest* quest, int32 item_id);
  239. Quest* GetPendingQuestAcceptance(int32 item_id);
  240. Quest* GetActiveQuest(int32 quest_id);
  241. void DisplayConversation(int32 conversation_id, int32 spawn_id, vector<ConversationOption>* conversations, const char* text, const char* mp3, int32 key1, int32 key2);
  242. void DisplayConversation(Item* item, vector<ConversationOption>* conversations, const char* text, int8 type, const char* mp3 = 0, int32 key1 = 0, int32 key2 = 0);
  243. void DisplayConversation(Entity* npc, int8 type, vector<ConversationOption>* conversations, const char* text, const char* mp3 = 0, int32 key1 = 0, int32 key2 = 0);
  244. void CloseDialog(int32 conversation_id);
  245. int32 GetConversationID(Spawn* spawn, Item* item);
  246. void CombineSpawns(float radius, Spawn* spawn);
  247. void AddCombineSpawn(Spawn* spawn);
  248. void RemoveCombineSpawn(Spawn* spawn);
  249. void SaveCombineSpawns(const char* name = 0);
  250. Spawn* GetCombineSpawn();
  251. bool ShouldTarget();
  252. void TargetSpawn(Spawn* spawn);
  253. void ReloadQuests();
  254. int32 GetCurrentQuestID(){ return current_quest_id; }
  255. void SetLuaDebugClient(bool val);
  256. void SetMerchantTransaction(Spawn* spawn);
  257. Spawn* GetMerchantTransaction();
  258. void SetMailTransaction(Spawn* spawn);
  259. Spawn* GetMailTransaction();
  260. void PlaySound(const char* name);
  261. void SendBuyMerchantList(bool sell = false);
  262. void SendSellMerchantList(bool sell = false);
  263. void SendBuyBackList(bool sell = false);
  264. void SendRepairList();
  265. void ShowLottoWindow();
  266. void PlayLotto(int32 price, int32 ticket_item_id);
  267. void SendGuildCreateWindow();
  268. float CalculateBuyMultiplier(int32 merchant_id);
  269. float CalculateSellMultiplier(int32 merchant_id);
  270. void BuyItem(int32 item_id, int16 quantity);
  271. void SellItem(int32 item_id, int16 quantity, int32 unique_id = 0);
  272. void BuyBack(int32 item_id, int16 quantity);
  273. void RepairItem(int32 item_id);
  274. void RepairAllItems();
  275. void AddBuyBack(int32 unique_id, int32 item_id, int16 quantity, int32 price, bool save_needed = true);
  276. deque<BuyBackItem*>* GetBuyBacks();
  277. vector<Item*>* GetRepairableItems();
  278. void SendMailList();
  279. void DisplayMailMessage(int32 mail_id);
  280. void HandleSentMail(EQApplicationPacket* app);
  281. void DeleteMail(int32 mail_id, bool from_database = false);
  282. bool AddMailCoin(int32 copper, int32 silver = 0, int32 gold = 0, int32 plat = 0);
  283. bool RemoveMailCoin(int32 copper, int32 silver = 0, int32 gold = 0, int32 plat = 0);
  284. void TakeMailAttachments(int32 mail_id);
  285. void CancelSendMail();
  286. bool GateAllowed();
  287. bool BindAllowed();
  288. bool Bind();
  289. bool Gate();
  290. void SendChatRelationship(int8 type, const char* name);
  291. void SendFriendList();
  292. void SendIgnoreList();
  293. void SendNewSpells(int8 class_id);
  294. string GetCoinMessage(int32 total_coins);
  295. void SetItemSearch(vector<Item*>* items);
  296. vector<Item*>* GetSearchItems();
  297. void SearchStore(int32 page);
  298. void SetPlayer(Player* new_player){
  299. player = new_player;
  300. }
  301. void AddPendingQuestReward(Quest* quest);
  302. void AddPendingQuestUpdate(int32 quest_id, int32 step_id, int32 progress = 0xFFFFFFFF);
  303. void ProcessQuestUpdates();
  304. void AddWaypoint(const char* waypoint_name, int8 waypoint_category, int32 spawn_id);
  305. void BeginWaypoint(const char* waypoint_name, float x, float y, float z);
  306. void InspectPlayer(Player* player_to_inspect);
  307. void SetPendingGuildInvite(Guild* guild, Player* invited_by = 0);
  308. PendingGuildInvite* GetPendingGuildInvite() {return &pending_guild_invite;}
  309. void ShowClaimWindow();
  310. void ShowGuildSearchWindow();
  311. void CheckQuestQueue();
  312. void ShowDressingRoom(Item *item, sint32 crc);
  313. void SendCollectionList();
  314. bool SendCollectionsForItem(Item *item);
  315. void HandleCollectionAddItem(int32 collection_id, Item *item);
  316. void DisplayCollectionComplete(Collection *collection);
  317. void HandInCollections();
  318. void AcceptCollectionRewards(Collection *collection, int32 selectable_item_id = 0);
  319. void SendRecipeList();
  320. void SendTitleUpdate();
  321. void SendUpdateTitles(sint16 prefix, sint16 suffix);
  322. void SendLanguagesUpdate(int32 id);
  323. void SendAchievementsList();
  324. void SendAchievementUpdate(bool first_login = false);
  325. ///<summary>Send the pet options window to the client</summary>
  326. ///<param name="type">Type of pet, 1 = combat 0 = non combat</param>
  327. void SendPetOptionsWindow(const char* pet_name, int8 type = 1);
  328. void SendBiography();
  329. bool IsCrafting();
  330. void SetRecipeListSent(bool val) {m_recipeListSent = val; }
  331. bool GetRecipeListSent() { return m_recipeListSent; }
  332. void ShowRecipeBook();
  333. PendingResurrection* GetCurrentRez();
  334. void SendResurrectionWindow();
  335. void AcceptResurrection();
  336. Mutex m_resurrect;
  337. Mutex* GetResurrectMutex();
  338. void SetPendingLastName(string last_name);
  339. void RemovePendingLastName();
  340. string* GetPendingLastName();
  341. void SendLastNameConfirmation();
  342. void SetInitialSpawnsSent(bool val) { initial_spawns_sent = val; }
  343. bool GetInitialSpawnsSent() { return initial_spawns_sent; }
  344. void SendQuestJournalUpdate(Quest* quest);
  345. void AddQuestTimer(int32 quest_id);
  346. void RemoveQuestTimer(int32 quest_id);
  347. void SetPendingFlightPath(int32 val) { pending_flight_path = val; }
  348. int32 GetPendingFlightPath() { return pending_flight_path; }
  349. void EndAutoMount();
  350. bool GetOnAutoMount() { return on_auto_mount; }
  351. bool IsCurrentTransmuteID(int32 trans_id);
  352. void SetTransmuteID(int32 trans_id);
  353. int32 GetTransmuteID();
  354. enum ServerSpawnPlacementMode { DEFAULT, OPEN_HEADING, CLOSE_HEADING };
  355. void SetSpawnPlacementMode(ServerSpawnPlacementMode mode) { spawnPlacementMode = mode; }
  356. ServerSpawnPlacementMode GetSpawnPlacementMode() { return spawnPlacementMode; }
  357. bool HandleNewLogin(int32 account_id, int32 access_code);
  358. void SendSpawnChanges(set<Spawn*>& spawns);
  359. void MakeSpawnChangePacket(map<int32, SpawnData> info_changes, map<int32, SpawnData> pos_changes, map<int32, SpawnData> vis_changes, int32 info_size, int32 pos_size, int32 vis_size);
  360. bool IsZonedIn() { return connected_to_zone; }
  361. void SendHailCommand(Spawn* target);
  362. void SendDefaultCommand(Spawn* spawn, const char* command, float distance);
  363. void SetTempPlacementSpawn(Spawn* tmp) { tempPlacementSpawn = tmp; }
  364. Spawn* GetTempPlacementSpawn() { return tempPlacementSpawn; }
  365. void SetPlacementUniqueItemID(int32 id) { placement_unique_item_id = id; }
  366. int32 GetPlacementUniqueItemID() { return placement_unique_item_id; }
  367. void SetHasOwnerOrEditAccess(bool val) { hasOwnerOrEditAccess = val; }
  368. bool HasOwnerOrEditAccess() { return hasOwnerOrEditAccess; }
  369. bool HandleHouseEntityCommands(Spawn* spawn, int32 spawnid, string command);
  370. // find an appropriate spawn to use for the house object, save spawn location/entry data to DB
  371. bool PopulateHouseSpawn(PacketStruct* place_object);
  372. // finalize the spawn-in of the object in world, remove the item from player inventory, set the spawned in object item id (for future pickup)
  373. bool PopulateHouseSpawnFinalize();
  374. void SendMoveObjectMode(Spawn* spawn, uint8 placementMode, float unknown2_3=0.0f);
  375. private:
  376. void SavePlayerImages();
  377. void SkillChanged(Skill* skill, int16 previous_value, int16 new_value);
  378. void GiveQuestReward(Quest* quest);
  379. void SetStepComplete(int32 quest_id, int32 step);
  380. void AddStepProgress(int32 quest_id, int32 step, int32 progress);
  381. map<int32, map<int32, int32> > quest_pending_updates;
  382. vector<QueuedQuest*> quest_queue;
  383. vector<Quest*> quest_pending_reward;
  384. volatile bool quest_updates;
  385. Mutex MQuestPendingUpdates;
  386. Mutex MQuestQueue;
  387. Mutex MDeletePlayer;
  388. vector<Item*>* search_items;
  389. Spawn* transport_spawn;
  390. Mutex MBuyBack;
  391. deque<BuyBackItem*> buy_back_items;
  392. Spawn* merchant_transaction;
  393. Spawn* mail_transaction;
  394. Mutex MPendingQuestAccept;
  395. vector<Quest*> pending_quest_accept;
  396. bool lua_debug;
  397. bool should_target;
  398. Spawn* combine_spawn;
  399. int8 num_active_failures;
  400. int32 next_conversation_id;
  401. map<int32, Spawn*> conversation_spawns;
  402. map<int32, Item*> conversation_items;
  403. map<int32, map<int8, string> > conversation_map;
  404. int32 current_quest_id;
  405. Spawn* banker;
  406. map<int32, bool> sent_spell_details;
  407. map<int32, bool> sent_item_details;
  408. Player* player;
  409. int16 version;
  410. int8 timestamp_flag;
  411. int32 ip;
  412. int16 port;
  413. int32 account_id;
  414. int32 character_id;
  415. sint16 admin_status; // -2 Banned, -1 Suspended, 0 User, etc.
  416. char account_name[64];
  417. char zone_name[64];
  418. int32 zoneID;
  419. int32 instanceID;
  420. Timer* autobootup_timeout;
  421. int32 pwaitingforbootup;
  422. int32 last_update_time;
  423. int32 last_saved_timestamp;
  424. Timer* CLE_keepalive_timer;
  425. Timer* connect;
  426. Timer* camp_timer;
  427. Timer* disconnect_timer;
  428. bool connected;
  429. bool ready_for_spawns;
  430. bool ready_for_updates;
  431. bool seencharsel;
  432. bool connected_to_zone;
  433. bool client_zoning;
  434. bool firstlogin;
  435. bool new_client_login;
  436. Timer pos_update;
  437. Timer quest_pos_timer;
  438. Timer lua_debug_timer;
  439. bool player_pos_changed;
  440. bool HandlePacket(EQApplicationPacket *app);
  441. EQStream* eqs;
  442. bool quickbar_changed;
  443. ZoneServer* current_zone;
  444. int32 name_crc;
  445. MailWindow mail_window;
  446. PendingGuildInvite pending_guild_invite;
  447. PendingResurrection current_rez;
  448. string* pending_last_name;
  449. IncomingPaperdollImage incoming_paperdoll;
  450. int32 transmuteID;
  451. bool m_recipeListSent;
  452. bool initial_spawns_sent;
  453. bool should_load_spells;
  454. // int32 = quest id
  455. vector<int32> quest_timers;
  456. Mutex MQuestTimers;
  457. int32 pending_flight_path;
  458. ServerSpawnPlacementMode spawnPlacementMode;
  459. bool on_auto_mount;
  460. bool EntityCommandPrecheck(Spawn* spawn, const char* command);
  461. bool delayedLogin;
  462. int32 delayedAccountID;
  463. int32 delayedAccessKey;
  464. Timer delayTimer;
  465. Spawn* tempPlacementSpawn;
  466. int32 placement_unique_item_id;
  467. bool hasOwnerOrEditAccess;
  468. };
  469. class ClientList {
  470. public:
  471. ClientList();
  472. ~ClientList();
  473. bool ContainsStream(EQStream* eqs);
  474. void Add(Client* client);
  475. Client* Get(int32 ip, int16 port);
  476. Client* FindByAccountID(int32 account_id);
  477. Client* FindByName(char* charname);
  478. void Remove(Client* client, bool delete_data = false);
  479. void RemoveConnection(EQStream* eqs);
  480. void Process();
  481. int32 Count();
  482. void ReloadQuests();
  483. void CheckPlayersInvisStatus(Client* owner);
  484. void RemovePlayerFromInvisHistory(int32 spawnID);
  485. private:
  486. Mutex MClients;
  487. list<Client*> client_list;
  488. };
  489. #endif