Working on world <-> zone communication needs a ton of work really need to rewrite how world works with zones.

This commit is contained in:
KimLS
2017-01-02 22:38:47 -08:00
parent 0264c0d60a
commit 2447c38c82
28 changed files with 3080 additions and 3304 deletions
+12 -8
View File
@@ -19,7 +19,9 @@
#define ZONESERVER_H
#include "world_tcp_connection.h"
#include "../common/emu_tcp_connection.h"
#include "../net/servertalk_server.h"
#include "../event/timer.h"
#include "../timer.h"
#include <string.h>
#include <string>
@@ -29,17 +31,16 @@ class ServerPacket;
class ZoneServer : public WorldTCPConnection {
public:
ZoneServer(EmuTCPConnection* itcpc);
ZoneServer(std::shared_ptr<EQ::Net::ServertalkServerConnection> connection);
~ZoneServer();
virtual inline bool IsZoneServer() { return true; }
bool Process();
bool SendPacket(ServerPacket* pack) { return tcpc->SendPacket(pack); }
void SendPacket(ServerPacket* pack) { tcpc->SendPacket(pack); }
void SendEmoteMessage(const char* to, uint32 to_guilddbid, int16 to_minstatus, uint32 type, const char* message, ...);
void SendEmoteMessageRaw(const char* to, uint32 to_guilddbid, int16 to_minstatus, uint32 type, const char* message);
bool SetZone(uint32 iZoneID, uint32 iInstanceID = 0, bool iStaticZone = false);
void TriggerBootup(uint32 iZoneID = 0, uint32 iInstanceID = 0, const char* iAdminName = 0, bool iMakeStatic = false);
void Disconnect() { tcpc->Disconnect(); }
void Disconnect() { auto handle = tcpc->Handle(); if (handle) { handle->Disconnect(); } }
void IncomingClient(Client* client);
void LSBootUpdate(uint32 zoneid, uint32 iInstanceID = 0, bool startup = false);
void LSSleepUpdate(uint32 zoneid);
@@ -47,14 +48,15 @@ public:
uint32 GetPrevZoneID() { return zone_server_previous_zone_id; }
void ChangeWID(uint32 iCharID, uint32 iWID);
void SendGroupIDs();
void HandleMessage(uint16 opcode, const EQ::Net::Packet &p);
inline const char* GetZoneName() const { return zone_name; }
inline const char* GetZoneLongName() const { return long_name; }
const char* GetCompileTime() const{ return compiled; }
void SetCompile(char* in_compile){ strcpy(compiled,in_compile); }
inline uint32 GetZoneID() const { return zone_server_zone_id; }
inline uint32 GetIP() const { return tcpc->GetrIP(); }
inline uint16 GetPort() const { return tcpc->GetrPort(); }
inline std::string GetIP() const { return tcpc->Handle() ? tcpc->Handle()->RemoteIP() : ""; }
inline uint16 GetPort() const { return tcpc->Handle() ? tcpc->Handle()->RemotePort() : 0; }
inline const char* GetCAddress() const { return client_address; }
inline const char* GetCLocalAddress() const { return client_local_address; }
inline uint16 GetCPort() const { return client_port; }
@@ -66,6 +68,7 @@ public:
inline void RemovePlayer() { zone_player_count--; }
inline const char * GetLaunchName() const { return(launcher_name.c_str()); }
inline const char * GetLaunchedName() const { return(launched_name.c_str()); }
std::string GetUUID() const { return tcpc->GetUUID(); }
inline uint32 GetInstanceID() { return instance_id; }
inline void SetInstanceID(uint32 i) { instance_id = i; }
@@ -73,7 +76,8 @@ public:
inline uint32 GetZoneOSProcessID() { return zone_os_process_id; }
private:
EmuTCPConnection* const tcpc;
std::shared_ptr<EQ::Net::ServertalkServerConnection> tcpc;
std::unique_ptr<EQ::Timer> boot_timer_obj;
uint32 zone_server_id;
char client_address[250];