mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-09-06 07:18:42 +00:00
Consolidate serviceID enums into one enum (#1855)
* merge ServerType and ServiceID enums * rename eConnectionType to ServiceType in preparation for enum unification * unify ServiceID and ServiceType enums * shrink ServiceType to an 8-bit integer * fix linux compilation error and update gamemsg test * return to uint16_t * Update dNet/AuthPackets.cpp Use cast instead of padding Co-authored-by: David Markowitz <39972741+EmosewaMC@users.noreply.github.com> * Add default case to MasterServer.cpp * move ref back to type * Another formatting fix * Fix comment to be more accurate --------- Co-authored-by: jadebenn <9892985+jadebenn@users.noreply.github.com> Co-authored-by: David Markowitz <39972741+EmosewaMC@users.noreply.github.com>
This commit is contained in:
@@ -9,21 +9,7 @@
|
||||
class Logger;
|
||||
class dConfig;
|
||||
enum class eServerDisconnectIdentifiers : uint32_t;
|
||||
|
||||
enum class ServerType : uint32_t {
|
||||
Master,
|
||||
Auth,
|
||||
Chat,
|
||||
World
|
||||
};
|
||||
|
||||
enum class ServiceId : uint32_t{
|
||||
General = 0,
|
||||
Auth = 1,
|
||||
Chat = 2,
|
||||
World = 4,
|
||||
Client = 5,
|
||||
};
|
||||
enum class ServiceType : uint16_t;
|
||||
|
||||
namespace Game {
|
||||
using signal_t = volatile std::sig_atomic_t;
|
||||
@@ -43,7 +29,7 @@ public:
|
||||
Logger* logger,
|
||||
const std::string masterIP,
|
||||
int masterPort,
|
||||
ServerType serverType,
|
||||
ServiceType serverType,
|
||||
dConfig* config,
|
||||
Game::signal_t* shouldShutdown,
|
||||
const std::string& masterPassword,
|
||||
@@ -80,7 +66,7 @@ public:
|
||||
|
||||
NetworkIDManager* GetNetworkIDManager() { return mNetIDManager; }
|
||||
|
||||
const ServerType GetServerType() const { return mServerType; }
|
||||
ServiceType GetServerType() const { return mServerType; }
|
||||
|
||||
[[nodiscard]]
|
||||
std::chrono::steady_clock::duration GetUptime() const {
|
||||
@@ -114,7 +100,7 @@ protected:
|
||||
bool mIsInternal;
|
||||
bool mIsOkay;
|
||||
bool mMasterConnectionActive;
|
||||
ServerType mServerType;
|
||||
ServiceType mServerType;
|
||||
|
||||
RakPeerInterface* mMasterPeer = nullptr;
|
||||
SocketDescriptor mMasterSocketDescriptor;
|
||||
|
Reference in New Issue
Block a user