eqemu-server/zone/worldserver.h
Knightly 7ab909ee47 Standardize Licensing
- License was intended to be GPLv3 per earlier commit of GPLv3 LICENSE FILE
- This is confirmed by the inclusion of libraries that are incompatible with GPLv2
- This is also confirmed by KLS and the agreement of KLS's predecessors
- Added GPLv3 license headers to the compilable source files
- Removed Folly licensing in strings.h since the string functions do not match the Folly functions and are standard functions - this must have been left over from previous implementations
- Removed individual contributor license headers since the project has been under the "developer" mantle for many years
- Removed comments on files that were previously automatically generated since they've been manually modified multiple times and there are no automatic scripts referencing them (removed in 2023)
2026-04-01 17:09:57 -07:00

90 lines
3.1 KiB
C++

/* EQEmu: EQEmulator
Copyright (C) 2001-2026 EQEmu Development Team
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "common/eq_packet_structs.h"
#include "common/net/servertalk_client_connection.h"
#include "common/server_reload_types.h"
#include "zone/zone_event_scheduler.h"
class ServerPacket;
class EQApplicationPacket;
class Client;
class WorldServer {
public:
WorldServer();
~WorldServer();
void Process();
void Connect();
bool SendPacket(ServerPacket* pack);
std::string GetIP() const;
uint16 GetPort() const;
bool Connected() const;
void HandleMessage(uint16 opcode, const EQ::Net::Packet &p);
bool SendChannelMessage(Client* from, const char* to, uint8 chan_num, uint32 guilddbid, uint8 language, uint8 lang_skill, const char* message, ...);
bool SendEmoteMessage(const char* to, uint32 to_guilddbid, uint32 type, const char* message, ...);
bool SendEmoteMessage(const char* to, uint32 to_guilddbid, int16 to_minstatus, uint32 type, const char* message, ...);
bool SendVoiceMacro(Client* From, uint32 Type, char* Target, uint32 MacroNumber, uint32 GroupOrRaidID = 0);
void SetZoneData(uint32 iZoneID, uint32 iInstanceID = 0);
bool RezzPlayer(EQApplicationPacket* rpack, uint32 rezzexp, uint32 dbid, uint16 opcode);
bool IsOOCMuted() const { return(oocmuted); }
uint32 NextGroupID();
void SetLaunchedName(const char *n) { m_launchedName = n; }
void SetLauncherName(const char *n) { m_launcherName = n; }
void SendReloadTasks(uint8 reload_type, uint32 task_id = 0);
void UpdateLFP(uint32 LeaderID, uint8 Action, uint8 MatchFilter, uint32 FromLevel, uint32 ToLevel, uint32 Classes, const char *Comments,
GroupLFPMemberEntry *LFPMembers);
void UpdateLFP(uint32 LeaderID, GroupLFPMemberEntry *LFPMembers);
void StopLFP(uint32 LeaderID);
void HandleLFGMatches(ServerPacket *pack);
void HandleLFPMatches(ServerPacket *pack);
void RequestTellQueue(const char *who);
void QueueReload(ServerReload::Request r);
void ProcessReload(const ServerReload::Request &request);
private:
virtual void OnConnected();
std::string m_launchedName;
std::string m_launcherName;
bool oocmuted;
uint32 cur_groupid;
uint32 last_groupid;
std::unique_ptr<EQ::Net::ServertalkClient> m_connection;
std::unique_ptr<EQ::Timer> m_keepalive;
ZoneEventScheduler *m_zone_scheduler;
// server reload queue
std::mutex m_reload_mutex = {};
std::map<int, ServerReload::Request> m_reload_queue = {};
public:
ZoneEventScheduler *GetScheduler() const;
void SetScheduler(ZoneEventScheduler *scheduler);
void SendReload(ServerReload::Type type, bool is_global = true);
};