mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 14:41:28 +00:00
* [Feature] Add additional Guild Features This adds the following guild features and design pattern - the existing guild system was used - guild features are based on RoF2 within source with translaters used to converted between client differences - backward compatible with Ti and UF, and allows for mixed client servers - Guild Back for Ti and UF is based on RoF2 Permissions for banking if Guild Leader does not use Ti/UF - Guild Ranks and Permissions are enabled. - Guild Tributes are enabled. - Event logging via rules for donating tribute items and plat - Rules to limit Guild Tributes based on max level of server - Rewrote guild communications to client using specific opcodes -- Server no longer sends a guild member list on each zone -- Guild window is updated when a member levels, rank changes, zone changes, banker/alt status using individual opcodes -- When a member is removed or added to a guild, a single opcode is sent to each guild member -- This reduces network traffic considerably Known issues: - Visual bug only. Guild Tributes window will display a 0 for level if tribute is above max level rule setting. - Visual bug only. Guild Mgmt Window will not display an online member if the player has 'show offline' unchecked and a guild member zones within the Notes/Tribute tab. This is resolved by selecting and de-selecting the 'Show Offline' checkbox. * Updated RoF2 Guild Comms Updated RoF2 Guild Comms Update RoF2 Opcodes Rewrote RoF2 Guild Communications using specific opcodes. Added database changes - they are irreversible * Formatting * Update base_guild_members_repository.h * Format GuildInfo * Format GuildAction enum * Formatting in clientlist * quantity vs quantity * desc vs description * Format structs * Inline struct values * Formatting * Formatting * Formatting fixes * Formatting items * Formatting * Formatting * struct formatting updates * Updated formatting * Updated - std:string items - naming conventions - magic numbers * Repo refactors Other formatting updates * Remove test guild commands * Updated #guild info command * Add new repo methods for Neckolla ReplaceOne and ReplaceMany * Fix guild_tributes repo * Update database_update_manifest.cpp * Phase 1 of final testing with RoF2 -> RoF2. Next phase will be inter compatibility review * Remove #guild testing commands * Fix uf translator error Rewrite LoadGuilds * Use extended repository * FIx guild window on member add * LoadGuild Changes * Update guild_base.cpp * Few small fixes for display issue with UF * Update guild_base.cpp * Update guild_members_repository.h * Update zoneserver.cpp * Update guild.cpp * Update entity.h * Switch formatting * Formatting * Update worldserver.cpp * Switch formatting * Formatting switch statement * Update guild.cpp * Formatting in guild_base * We don't need to validate m_db everywhere * More formatting / spacing issues * Switch format * Update guild_base.cpp * Fix an UF issue displaying incorrect guildtag as <> * Updated several constants, fixed a few issues with Ti/UF and guild tributes not being removed or sent when a member is removed/disbands from a guild. * Formatting and logging updates * Fix for Loadguilds and permissions after repo updates. * Cleanup unnecessary m_db checks * Updated logging to use player_event_logs * Updated to use the single opcodes for guild traffic for Ti/UF/RoF2. Several enhancements for guild functionality for more reusable code and readability. * Update to fix Demote Self and guild invites declining when option set to not accept guild invites * Potential fix for guild notes/tribute display issues when client has 'Show Offline' unchecked. * Updates to fox recent master changes Updates to fix recent master changes * Updates in response to comments * Further Updates in response to comments * Comment updates and refactor for SendAppearance functions * Comment updates * Update client spawn process for show guild name Add show guild tag to default spawn process * Update to use zone spawn packets for RoF2 Removed several unused functions as a result Updated MemberRankUpdate to properly update guild_show on rank change. Updated OP_GuildURLAndChannel opcode for UF/RoF2 * Cleanup of world changes Created function for repetitive zonelist sendpackets to only booted zones Re-Inserted accidental delete of scanclosemobs * Fixes * Further world cleanup * Fix a few test guild bank cases for backward compat Removed a duplicate db call Fixed a fallthrough issue * Update guild_mgr.cpp * Cleanup --------- Co-authored-by: Akkadius <akkadius1@gmail.com>
184 lines
5.6 KiB
C++
184 lines
5.6 KiB
C++
#ifndef CLIENTENTRY_H_
|
|
#define CLIENTENTRY_H_
|
|
|
|
#include "../common/types.h"
|
|
#include "../common/md5.h"
|
|
//#include "../common/eq_packet_structs.h"
|
|
#include "../common/servertalk.h"
|
|
#include "../common/rulesys.h"
|
|
#include <vector>
|
|
|
|
typedef enum
|
|
{
|
|
Never,
|
|
Offline,
|
|
Online,
|
|
CharSelect,
|
|
Zoning,
|
|
InZone
|
|
} CLE_Status;
|
|
|
|
static const char * CLEStatusString[] = {
|
|
"Never",
|
|
"Offline",
|
|
"Online",
|
|
"CharSelect",
|
|
"Zoning",
|
|
"InZone"
|
|
};
|
|
|
|
class ZoneServer;
|
|
struct ServerClientList_Struct;
|
|
|
|
class ClientListEntry {
|
|
public:
|
|
|
|
/**
|
|
* @param id
|
|
* @param in_loginserver_id
|
|
* @param in_loginserver_name
|
|
* @param in_login_name
|
|
* @param in_login_key
|
|
* @param in_is_world_admin
|
|
* @param ip
|
|
* @param local
|
|
*/
|
|
ClientListEntry(
|
|
uint32 id,
|
|
uint32 in_loginserver_id,
|
|
const char *in_loginserver_name,
|
|
const char *in_login_name,
|
|
const char *in_login_key,
|
|
int16 in_is_world_admin = 0,
|
|
uint32 ip = 0,
|
|
uint8 local = 0
|
|
);
|
|
|
|
/**
|
|
* @param id
|
|
* @param iZS
|
|
* @param scl
|
|
* @param iOnline
|
|
*/
|
|
ClientListEntry(uint32 id, uint32 iAccID, const char* iAccName, MD5& iMD5Pass, int16 iAdmin = AccountStatus::Player);
|
|
ClientListEntry(uint32 id, ZoneServer* iZS, ServerClientList_Struct* scl, CLE_Status iOnline);
|
|
~ClientListEntry();
|
|
bool CheckStale();
|
|
void Update(ZoneServer* zoneserver, ServerClientList_Struct* scl, CLE_Status iOnline = CLE_Status::InZone);
|
|
void LSUpdate(ZoneServer* zoneserver);
|
|
void LSZoneChange(ZoneToZone_Struct* ztz);
|
|
bool CheckAuth(uint32 loginserver_account_id, const char* key_password);
|
|
void SetOnline(CLE_Status iOnline = CLE_Status::Online);
|
|
void SetChar(uint32 iCharID, const char* iCharName);
|
|
inline CLE_Status Online() { return pOnline; }
|
|
inline const uint32 GetID() const { return id; }
|
|
inline const uint32 GetIP() const { return pIP; }
|
|
inline void SetIP(const uint32& iIP) { pIP = iIP; }
|
|
inline void KeepAlive() { stale = 0; }
|
|
inline uint8 GetStaleCounter() const { return stale; }
|
|
void LeavingZone(ZoneServer* iZS = 0, CLE_Status iOnline = CLE_Status::Offline);
|
|
void Camp(ZoneServer* iZS = 0);
|
|
|
|
// Login Server stuff
|
|
inline const char* LoginServer() const { return source_loginserver; }
|
|
inline uint32 LSID() const { return pLSID; }
|
|
inline uint32 LSAccountID() const { return pLSID; }
|
|
inline const char* LSName() const { return loginserver_account_name; }
|
|
inline int16 WorldAdmin() const { return pworldadmin; }
|
|
inline const char* GetLSKey() const { return plskey; }
|
|
inline const CLE_Status GetOnline() const { return pOnline; }
|
|
|
|
// Account stuff
|
|
inline uint32 AccountID() const { return paccountid; }
|
|
inline const char* AccountName() const { return paccountname; }
|
|
inline int16 Admin() const { return padmin; }
|
|
inline void SetAdmin(uint16 iAdmin) { padmin = iAdmin; }
|
|
|
|
// Character info
|
|
inline ZoneServer *Server() const { return pzoneserver; }
|
|
inline void ClearServer() { pzoneserver = 0; }
|
|
inline uint32 CharID() const { return pcharid; }
|
|
inline const char *name() const { return pname; }
|
|
inline uint32 zone() const { return pzone; }
|
|
inline uint16 instance() const { return pinstance; }
|
|
inline uint8 level() const { return plevel; }
|
|
inline uint8 class_() const { return pclass_; }
|
|
inline uint16 race() const { return prace; }
|
|
inline uint8 Anon() { return panon; }
|
|
inline uint8 TellsOff() const { return ptellsoff; }
|
|
inline uint32 GuildID() const { return pguild_id; }
|
|
inline uint32 GuildRank() const { return pguild_rank; }
|
|
inline bool GuildTributeOptIn() const { return pguild_tribute_opt_in; }
|
|
inline void SetGuild(uint32 guild_id) { pguild_id = guild_id; }
|
|
inline void SetGuildTributeOptIn(bool opt) { pguild_tribute_opt_in = opt; }
|
|
inline bool LFG() const { return pLFG; }
|
|
inline uint8 GetGM() const { return gm; }
|
|
inline void SetGM(uint8 igm) { gm = igm; }
|
|
inline void SetZone(uint32 zone) { pzone = zone; }
|
|
inline bool IsLocalClient() const { return plocal; }
|
|
inline uint8 GetLFGFromLevel() const { return pLFGFromLevel; }
|
|
inline uint8 GetLFGToLevel() const { return pLFGToLevel; }
|
|
inline bool GetLFGMatchFilter() const { return pLFGMatchFilter; }
|
|
inline const char *GetLFGComments() const { return pLFGComments; }
|
|
inline uint8 GetClientVersion() { return pClientVersion; }
|
|
|
|
inline bool TellQueueFull() const { return tell_queue.size() >= RuleI(World, TellQueueSize); }
|
|
inline bool TellQueueEmpty() const { return tell_queue.empty(); }
|
|
inline void PushToTellQueue(ServerChannelMessage_Struct *scm) { tell_queue.push_back(scm); }
|
|
void ProcessTellQueue();
|
|
|
|
void SetPendingExpeditionInvite(ServerPacket* pack) { p_pending_expedition_invite.reset(pack->Copy()); };
|
|
std::unique_ptr<ServerPacket> GetPendingExpeditionInvite() { return std::move(p_pending_expedition_invite); }
|
|
|
|
private:
|
|
void ClearVars(bool iAll = false);
|
|
|
|
const uint32 id;
|
|
uint32 pIP;
|
|
CLE_Status pOnline;
|
|
uint8 stale;
|
|
|
|
// Login Server stuff
|
|
char source_loginserver[64]{}; //Loginserver we came from.
|
|
uint32 pLSID;
|
|
char loginserver_account_name[32]{};
|
|
char plskey[16]{};
|
|
int16 pworldadmin; // Login server's suggested admin status setting
|
|
bool plocal;
|
|
|
|
// Account stuff
|
|
uint32 paccountid;
|
|
char paccountname[32]{};
|
|
int16 padmin{};
|
|
|
|
// Character info
|
|
ZoneServer* pzoneserver{};
|
|
uint32 pzone{};
|
|
uint16 pinstance{};
|
|
uint32 pcharid{};
|
|
char pname[64]{};
|
|
uint8 plevel{};
|
|
uint8 pclass_{};
|
|
uint16 prace{};
|
|
uint8 panon{};
|
|
uint8 ptellsoff{};
|
|
uint32 pguild_id{};
|
|
uint32 pguild_rank;
|
|
bool pguild_tribute_opt_in{};
|
|
bool pLFG{};
|
|
uint8 gm{};
|
|
uint8 pClientVersion{};
|
|
uint8 pLFGFromLevel{};
|
|
uint8 pLFGToLevel{};
|
|
bool pLFGMatchFilter{};
|
|
char pLFGComments[64]{};
|
|
|
|
// Tell Queue -- really a vector :D
|
|
std::vector<ServerChannelMessage_Struct *> tell_queue;
|
|
|
|
std::unique_ptr<ServerPacket> p_pending_expedition_invite = nullptr;
|
|
};
|
|
|
|
#endif /*CLIENTENTRY_H_*/
|
|
|