mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-05 18:24:12 +00:00
breakout gmlevel into a scoped enum (#996)
* breakout gmlevel enum and make it a class tested that things still work slash command, chat restrictions, packets and serializations * fix GM level for some slash commands * fix new use of this enum
This commit is contained in:
@@ -70,6 +70,7 @@
|
||||
#include "RailActivatorComponent.h"
|
||||
#include "LUPExhibitComponent.h"
|
||||
#include "TriggerComponent.h"
|
||||
#include "eGameMasterLevel.h"
|
||||
#include "eReplicaComponentType.h"
|
||||
|
||||
// Table includes
|
||||
@@ -89,7 +90,7 @@ Entity::Entity(const LWOOBJID& objectID, EntityInfo info, Entity* parentEntity)
|
||||
m_TemplateID = info.lot;
|
||||
m_ParentEntity = parentEntity;
|
||||
m_Character = nullptr;
|
||||
m_GMLevel = 0;
|
||||
m_GMLevel = eGameMasterLevel::CIVILIAN;
|
||||
m_CollectibleID = 0;
|
||||
m_NetworkID = 0;
|
||||
m_Groups = {};
|
||||
@@ -857,7 +858,7 @@ void Entity::SetProximityRadius(dpEntity* entity, std::string name) {
|
||||
proxMon->SetProximityRadius(entity, name);
|
||||
}
|
||||
|
||||
void Entity::SetGMLevel(uint8_t value) {
|
||||
void Entity::SetGMLevel(eGameMasterLevel value) {
|
||||
m_GMLevel = value;
|
||||
if (GetParentUser()) {
|
||||
Character* character = GetParentUser()->GetLastUsedChar();
|
||||
@@ -969,7 +970,7 @@ void Entity::WriteBaseReplicaData(RakNet::BitStream* outBitStream, eReplicaPacke
|
||||
|
||||
outBitStream->Write0(); //ObjectWorldState
|
||||
|
||||
if (m_GMLevel != 0) {
|
||||
if (m_GMLevel != eGameMasterLevel::CIVILIAN) {
|
||||
outBitStream->Write1();
|
||||
outBitStream->Write(m_GMLevel);
|
||||
} else outBitStream->Write0(); //No GM Level
|
||||
|
Reference in New Issue
Block a user