mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-04 09:44:10 +00:00
Merge remote-tracking branch 'upstream/main' into more-cdclient-cleanup
This commit is contained in:
@@ -75,6 +75,7 @@
|
||||
#include "eMissionState.h"
|
||||
#include "TriggerComponent.h"
|
||||
#include "eServerDisconnectIdentifiers.h"
|
||||
#include "eGameMasterLevel.h"
|
||||
#include "eReplicaComponentType.h"
|
||||
#include "RenderComponent.h"
|
||||
|
||||
@@ -122,19 +123,20 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
//Game::logger->Log("SlashCommandHandler", "Received chat command \"%s\"", GeneralUtils::UTF16ToWTF8(command).c_str());
|
||||
|
||||
User* user = UserManager::Instance()->GetUser(sysAddr);
|
||||
if ((chatCommand == "setgmlevel" || chatCommand == "makegm" || chatCommand == "gmlevel") && user->GetMaxGMLevel() > GAME_MASTER_LEVEL_CIVILIAN) {
|
||||
if ((chatCommand == "setgmlevel" || chatCommand == "makegm" || chatCommand == "gmlevel") && user->GetMaxGMLevel() > eGameMasterLevel::CIVILIAN) {
|
||||
if (args.size() != 1) return;
|
||||
|
||||
uint32_t level;
|
||||
uint32_t level_intermed = 0;
|
||||
|
||||
if (!GeneralUtils::TryParse(args[0], level)) {
|
||||
if (!GeneralUtils::TryParse(args[0], level_intermed)) {
|
||||
ChatPackets::SendSystemMessage(sysAddr, u"Invalid gm level.");
|
||||
return;
|
||||
}
|
||||
eGameMasterLevel level = static_cast<eGameMasterLevel>(level_intermed);
|
||||
|
||||
#ifndef DEVELOPER_SERVER
|
||||
if (user->GetMaxGMLevel() == GAME_MASTER_LEVEL_JUNIOR_DEVELOPER) {
|
||||
level = GAME_MASTER_LEVEL_CIVILIAN;
|
||||
if (user->GetMaxGMLevel() == eGameMasterLevel::JUNIOR_DEVELOPER) {
|
||||
level = eGameMasterLevel::CIVILIAN;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -147,9 +149,9 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
|
||||
if (success) {
|
||||
|
||||
if (entity->GetGMLevel() > GAME_MASTER_LEVEL_CIVILIAN && level == GAME_MASTER_LEVEL_CIVILIAN) {
|
||||
if (entity->GetGMLevel() > eGameMasterLevel::CIVILIAN && level == eGameMasterLevel::CIVILIAN) {
|
||||
GameMessages::SendToggleGMInvis(entity->GetObjectID(), false, UNASSIGNED_SYSTEM_ADDRESS);
|
||||
} else if (entity->GetGMLevel() == GAME_MASTER_LEVEL_CIVILIAN && level > GAME_MASTER_LEVEL_CIVILIAN) {
|
||||
} else if (entity->GetGMLevel() == eGameMasterLevel::CIVILIAN && level > eGameMasterLevel::CIVILIAN) {
|
||||
GameMessages::SendToggleGMInvis(entity->GetObjectID(), true, UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
@@ -161,10 +163,10 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
}
|
||||
|
||||
#ifndef DEVELOPER_SERVER
|
||||
if ((entity->GetGMLevel() > user->GetMaxGMLevel()) || (entity->GetGMLevel() > GAME_MASTER_LEVEL_CIVILIAN && user->GetMaxGMLevel() == GAME_MASTER_LEVEL_JUNIOR_DEVELOPER)) {
|
||||
WorldPackets::SendGMLevelChange(sysAddr, true, user->GetMaxGMLevel(), entity->GetGMLevel(), GAME_MASTER_LEVEL_CIVILIAN);
|
||||
GameMessages::SendChatModeUpdate(entity->GetObjectID(), GAME_MASTER_LEVEL_CIVILIAN);
|
||||
entity->SetGMLevel(GAME_MASTER_LEVEL_CIVILIAN);
|
||||
if ((entity->GetGMLevel() > user->GetMaxGMLevel()) || (entity->GetGMLevel() > eGameMasterLevel::CIVILIAN && user->GetMaxGMLevel() == eGameMasterLevel::JUNIOR_DEVELOPER)) {
|
||||
WorldPackets::SendGMLevelChange(sysAddr, true, user->GetMaxGMLevel(), entity->GetGMLevel(), eGameMasterLevel::CIVILIAN);
|
||||
GameMessages::SendChatModeUpdate(entity->GetObjectID(), eGameMasterLevel::CIVILIAN);
|
||||
entity->SetGMLevel(eGameMasterLevel::CIVILIAN);
|
||||
|
||||
GameMessages::SendToggleGMInvis(entity->GetObjectID(), false, UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
@@ -172,6 +174,19 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
}
|
||||
#endif
|
||||
|
||||
if (chatCommand == "togglenameplate" && (Game::config->GetValue("allownameplateoff") == "1" || entity->GetGMLevel() > eGameMasterLevel::DEVELOPER)) {
|
||||
auto* character = entity->GetCharacter();
|
||||
|
||||
if (character && character->GetBillboardVisible()) {
|
||||
character->SetBillboardVisible(false);
|
||||
ChatPackets::SendSystemMessage(sysAddr, u"Your nameplate has been turned off and is not visible to players currently in this zone.");
|
||||
} else {
|
||||
character->SetBillboardVisible(true);
|
||||
ChatPackets::SendSystemMessage(sysAddr, u"Your nameplate is now on and visible to all players.");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
//HANDLE ALL NON GM SLASH COMMANDS RIGHT HERE!
|
||||
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
@@ -337,7 +352,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
});
|
||||
}
|
||||
|
||||
if (user->GetMaxGMLevel() == 0 || entity->GetGMLevel() >= 0) {
|
||||
if (user->GetMaxGMLevel() == eGameMasterLevel::CIVILIAN || entity->GetGMLevel() >= eGameMasterLevel::CIVILIAN) {
|
||||
if (chatCommand == "die") {
|
||||
entity->Smash(entity->GetObjectID());
|
||||
}
|
||||
@@ -363,7 +378,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
ChatPackets::SendSystemMessage(sysAddr, u"Map: " + (GeneralUtils::to_u16string(zoneId.GetMapID())) + u"\nClone: " + (GeneralUtils::to_u16string(zoneId.GetCloneID())) + u"\nInstance: " + (GeneralUtils::to_u16string(zoneId.GetInstanceID())));
|
||||
}
|
||||
|
||||
if (entity->GetGMLevel() == 0) return;
|
||||
if (entity->GetGMLevel() == eGameMasterLevel::CIVILIAN) return;
|
||||
}
|
||||
|
||||
// Log command to database
|
||||
@@ -373,7 +388,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
stmt->execute();
|
||||
delete stmt;
|
||||
|
||||
if (chatCommand == "setminifig" && args.size() == 2 && entity->GetGMLevel() >= GAME_MASTER_LEVEL_FORUM_MODERATOR) { // could break characters so only allow if GM > 0
|
||||
if (chatCommand == "setminifig" && args.size() == 2 && entity->GetGMLevel() >= eGameMasterLevel::FORUM_MODERATOR) { // could break characters so only allow if GM > 0
|
||||
int32_t minifigItemId;
|
||||
if (!GeneralUtils::TryParse(args[1], minifigItemId)) {
|
||||
ChatPackets::SendSystemMessage(sysAddr, u"Invalid Minifig Item Id ID.");
|
||||
@@ -417,7 +432,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
GameMessages::SendToggleGMInvis(entity->GetObjectID(), false, UNASSIGNED_SYSTEM_ADDRESS); // need to retoggle because it gets reenabled on creation of new character
|
||||
}
|
||||
|
||||
if ((chatCommand == "playanimation" || chatCommand == "playanim") && args.size() == 1 && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) {
|
||||
if ((chatCommand == "playanimation" || chatCommand == "playanim") && args.size() == 1 && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||
std::u16string anim = GeneralUtils::ASCIIToUTF16(args[0], args[0].size());
|
||||
RenderComponent::PlayAnimation(entity, anim);
|
||||
auto* possessorComponent = entity->GetComponent<PossessorComponent>();
|
||||
@@ -427,7 +442,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
}
|
||||
}
|
||||
|
||||
if (chatCommand == "list-spawns" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) {
|
||||
if (chatCommand == "list-spawns" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||
for (const auto& pair : EntityManager::Instance()->GetSpawnPointEntities()) {
|
||||
ChatPackets::SendSystemMessage(sysAddr, GeneralUtils::ASCIIToUTF16(pair.first));
|
||||
}
|
||||
@@ -437,7 +452,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
return;
|
||||
}
|
||||
|
||||
if (chatCommand == "unlock-emote" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) {
|
||||
if (chatCommand == "unlock-emote" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||
int32_t emoteID;
|
||||
|
||||
if (!GeneralUtils::TryParse(args[0], emoteID)) {
|
||||
@@ -448,11 +463,11 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
entity->GetCharacter()->UnlockEmote(emoteID);
|
||||
}
|
||||
|
||||
if (chatCommand == "force-save" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) {
|
||||
if (chatCommand == "force-save" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||
entity->GetCharacter()->SaveXMLToDatabase();
|
||||
}
|
||||
|
||||
if (chatCommand == "kill" && args.size() == 1 && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) {
|
||||
if (chatCommand == "kill" && args.size() == 1 && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||
ChatPackets::SendSystemMessage(sysAddr, u"Brutally murdering that player, if online on this server.");
|
||||
|
||||
auto* user = UserManager::Instance()->GetUser(args[0]);
|
||||
@@ -467,7 +482,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
return;
|
||||
}
|
||||
|
||||
if (chatCommand == "speedboost" && args.size() == 1 && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) {
|
||||
if (chatCommand == "speedboost" && args.size() == 1 && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||
float boost;
|
||||
|
||||
if (!GeneralUtils::TryParse(args[0], boost)) {
|
||||
@@ -498,7 +513,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
EntityManager::Instance()->SerializeEntity(entity);
|
||||
}
|
||||
|
||||
if (chatCommand == "freecam" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) {
|
||||
if (chatCommand == "freecam" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||
const auto state = !entity->GetVar<bool>(u"freecam");
|
||||
entity->SetVar<bool>(u"freecam", state);
|
||||
|
||||
@@ -508,7 +523,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
return;
|
||||
}
|
||||
|
||||
if (chatCommand == "setcontrolscheme" && args.size() == 1 && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) {
|
||||
if (chatCommand == "setcontrolscheme" && args.size() == 1 && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||
uint32_t scheme;
|
||||
|
||||
if (!GeneralUtils::TryParse(args[0], scheme)) {
|
||||
@@ -522,7 +537,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
return;
|
||||
}
|
||||
|
||||
if (chatCommand == "approveproperty" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_LEAD_MODERATOR) {
|
||||
if (chatCommand == "approveproperty" && entity->GetGMLevel() >= eGameMasterLevel::LEAD_MODERATOR) {
|
||||
|
||||
if (PropertyManagementComponent::Instance() != nullptr) {
|
||||
PropertyManagementComponent::Instance()->UpdateApprovedStatus(true);
|
||||
@@ -531,7 +546,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
return;
|
||||
}
|
||||
|
||||
if (chatCommand == "setuistate" && args.size() == 1 && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) {
|
||||
if (chatCommand == "setuistate" && args.size() == 1 && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||
AMFStringValue* value = new AMFStringValue();
|
||||
value->SetStringValue(args[0]);
|
||||
|
||||
@@ -544,7 +559,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
return;
|
||||
}
|
||||
|
||||
if (chatCommand == "toggle" && args.size() == 1 && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) {
|
||||
if (chatCommand == "toggle" && args.size() == 1 && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||
AMFTrueValue* value = new AMFTrueValue();
|
||||
|
||||
AMFArrayValue amfArgs;
|
||||
@@ -556,7 +571,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
return;
|
||||
}
|
||||
|
||||
if ((chatCommand == "setinventorysize" || chatCommand == "setinvsize") && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER && args.size() >= 1) {
|
||||
if ((chatCommand == "setinventorysize" || chatCommand == "setinvsize") && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER && args.size() >= 1) {
|
||||
uint32_t size;
|
||||
|
||||
if (!GeneralUtils::TryParse(args.at(0), size)) {
|
||||
@@ -597,7 +612,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
return;
|
||||
}
|
||||
|
||||
if (chatCommand == "runmacro" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) {
|
||||
if (chatCommand == "runmacro" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||
if (args.size() != 1) return;
|
||||
|
||||
// Only process if input does not contain separator charaters
|
||||
@@ -627,7 +642,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
return;
|
||||
}
|
||||
|
||||
if (chatCommand == "addmission" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) {
|
||||
if (chatCommand == "addmission" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||
if (args.size() == 0) return;
|
||||
|
||||
uint32_t missionID;
|
||||
@@ -642,7 +657,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
return;
|
||||
}
|
||||
|
||||
if (chatCommand == "completemission" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) {
|
||||
if (chatCommand == "completemission" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||
if (args.size() == 0) return;
|
||||
|
||||
uint32_t missionID;
|
||||
@@ -657,7 +672,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
return;
|
||||
}
|
||||
|
||||
if (chatCommand == "setflag" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER && args.size() == 1) {
|
||||
if (chatCommand == "setflag" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER && args.size() == 1) {
|
||||
uint32_t flagId;
|
||||
|
||||
if (!GeneralUtils::TryParse(args[0], flagId)) {
|
||||
@@ -668,7 +683,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
entity->GetCharacter()->SetPlayerFlag(flagId, true);
|
||||
}
|
||||
|
||||
if (chatCommand == "setflag" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER && args.size() == 2) {
|
||||
if (chatCommand == "setflag" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER && args.size() == 2) {
|
||||
uint32_t flagId;
|
||||
std::string onOffFlag = args[0];
|
||||
if (!GeneralUtils::TryParse(args[1], flagId)) {
|
||||
@@ -681,7 +696,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
}
|
||||
entity->GetCharacter()->SetPlayerFlag(flagId, onOffFlag == "on");
|
||||
}
|
||||
if (chatCommand == "clearflag" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER && args.size() == 1) {
|
||||
if (chatCommand == "clearflag" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER && args.size() == 1) {
|
||||
uint32_t flagId;
|
||||
|
||||
if (!GeneralUtils::TryParse(args[0], flagId)) {
|
||||
@@ -692,7 +707,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
entity->GetCharacter()->SetPlayerFlag(flagId, false);
|
||||
}
|
||||
|
||||
if (chatCommand == "resetmission" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) {
|
||||
if (chatCommand == "resetmission" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||
if (args.size() == 0) return;
|
||||
|
||||
uint32_t missionID;
|
||||
@@ -719,7 +734,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
return;
|
||||
}
|
||||
|
||||
if (chatCommand == "playeffect" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER && args.size() >= 3) {
|
||||
if (chatCommand == "playeffect" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER && args.size() >= 3) {
|
||||
int32_t effectID = 0;
|
||||
|
||||
if (!GeneralUtils::TryParse(args[0], effectID)) {
|
||||
@@ -730,11 +745,11 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
GameMessages::SendPlayFXEffect(entity->GetObjectID(), effectID, GeneralUtils::ASCIIToUTF16(args[1]), args[2]);
|
||||
}
|
||||
|
||||
if (chatCommand == "stopeffect" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER && args.size() >= 1) {
|
||||
if (chatCommand == "stopeffect" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER && args.size() >= 1) {
|
||||
GameMessages::SendStopFXEffect(entity, true, args[0]);
|
||||
}
|
||||
|
||||
if (chatCommand == "setanntitle" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) {
|
||||
if (chatCommand == "setanntitle" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||
if (args.size() < 0) return;
|
||||
|
||||
std::stringstream ss;
|
||||
@@ -745,7 +760,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
return;
|
||||
}
|
||||
|
||||
if (chatCommand == "setannmsg" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) {
|
||||
if (chatCommand == "setannmsg" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||
if (args.size() < 0) return;
|
||||
|
||||
std::stringstream ss;
|
||||
@@ -756,7 +771,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
return;
|
||||
}
|
||||
|
||||
if (chatCommand == "announce" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) {
|
||||
if (chatCommand == "announce" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||
if (entity->GetCharacter()->GetAnnouncementTitle().size() == 0 || entity->GetCharacter()->GetAnnouncementMessage().size() == 0) {
|
||||
ChatPackets::SendSystemMessage(sysAddr, u"Use /setanntitle <title> & /setannmsg <msg> first!");
|
||||
return;
|
||||
@@ -766,7 +781,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
return;
|
||||
}
|
||||
|
||||
if (chatCommand == "shutdownuniverse" && entity->GetGMLevel() == GAME_MASTER_LEVEL_OPERATOR) {
|
||||
if (chatCommand == "shutdownuniverse" && entity->GetGMLevel() == eGameMasterLevel::OPERATOR) {
|
||||
//Tell the master server that we're going to be shutting down whole "universe":
|
||||
CBITSTREAM;
|
||||
PacketUtils::WriteHeader(bitStream, MASTER, MSG_MASTER_SHUTDOWN_UNIVERSE);
|
||||
@@ -778,7 +793,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
return;
|
||||
}
|
||||
|
||||
if (chatCommand == "getnavmeshheight" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) {
|
||||
if (chatCommand == "getnavmeshheight" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||
auto control = static_cast<ControllablePhysicsComponent*>(entity->GetComponent(eReplicaComponentType::CONTROLLABLE_PHYSICS));
|
||||
if (!control) return;
|
||||
|
||||
@@ -787,7 +802,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
ChatPackets::SendSystemMessage(sysAddr, msg);
|
||||
}
|
||||
|
||||
if (chatCommand == "gmadditem" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) {
|
||||
if (chatCommand == "gmadditem" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||
if (args.size() == 1) {
|
||||
uint32_t itemLOT;
|
||||
|
||||
@@ -822,7 +837,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
}
|
||||
}
|
||||
|
||||
if (chatCommand == "mailitem" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_MODERATOR && args.size() >= 2) {
|
||||
if (chatCommand == "mailitem" && entity->GetGMLevel() >= eGameMasterLevel::MODERATOR && args.size() >= 2) {
|
||||
const auto& playerName = args[0];
|
||||
|
||||
sql::PreparedStatement* stmt = Database::CreatePreppedStmt("SELECT id from charinfo WHERE name=? LIMIT 1;");
|
||||
@@ -871,7 +886,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
return;
|
||||
}
|
||||
|
||||
if (chatCommand == "setname" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) {
|
||||
if (chatCommand == "setname" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||
std::string name = "";
|
||||
|
||||
for (const auto& arg : args) {
|
||||
@@ -881,7 +896,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
GameMessages::SendSetName(entity->GetObjectID(), GeneralUtils::UTF8ToUTF16(name), UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
if (chatCommand == "title" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) {
|
||||
if (chatCommand == "title" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||
std::string name = entity->GetCharacter()->GetName() + " - ";
|
||||
|
||||
for (const auto& arg : args) {
|
||||
@@ -891,7 +906,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
GameMessages::SendSetName(entity->GetObjectID(), GeneralUtils::UTF8ToUTF16(name), UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
if ((chatCommand == "teleport" || chatCommand == "tele") && entity->GetGMLevel() >= GAME_MASTER_LEVEL_JUNIOR_MODERATOR) {
|
||||
if ((chatCommand == "teleport" || chatCommand == "tele") && entity->GetGMLevel() >= eGameMasterLevel::JUNIOR_MODERATOR) {
|
||||
NiPoint3 pos{};
|
||||
if (args.size() == 3) {
|
||||
|
||||
@@ -957,7 +972,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
}
|
||||
}
|
||||
|
||||
if (chatCommand == "tpall" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) {
|
||||
if (chatCommand == "tpall" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||
const auto pos = entity->GetPosition();
|
||||
|
||||
const auto characters = EntityManager::Instance()->GetEntitiesByComponent(eReplicaComponentType::CHARACTER);
|
||||
@@ -969,7 +984,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
return;
|
||||
}
|
||||
|
||||
if (chatCommand == "dismount" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) {
|
||||
if (chatCommand == "dismount" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||
auto* possessorComponent = entity->GetComponent<PossessorComponent>();
|
||||
if (possessorComponent) {
|
||||
auto possessableId = possessorComponent->GetPossessable();
|
||||
@@ -980,7 +995,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
}
|
||||
}
|
||||
|
||||
if (chatCommand == "fly" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_JUNIOR_DEVELOPER) {
|
||||
if (chatCommand == "fly" && entity->GetGMLevel() >= eGameMasterLevel::JUNIOR_DEVELOPER) {
|
||||
auto* character = entity->GetCharacter();
|
||||
|
||||
if (character) {
|
||||
@@ -1016,7 +1031,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
|
||||
//------- GM COMMANDS TO ACTUALLY MODERATE --------
|
||||
|
||||
if (chatCommand == "mute" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_JUNIOR_DEVELOPER) {
|
||||
if (chatCommand == "mute" && entity->GetGMLevel() >= eGameMasterLevel::JUNIOR_DEVELOPER) {
|
||||
if (args.size() >= 1) {
|
||||
auto* player = Player::GetPlayer(args[0]);
|
||||
|
||||
@@ -1111,7 +1126,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
}
|
||||
}
|
||||
|
||||
if (chatCommand == "kick" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_JUNIOR_MODERATOR) {
|
||||
if (chatCommand == "kick" && entity->GetGMLevel() >= eGameMasterLevel::JUNIOR_MODERATOR) {
|
||||
if (args.size() == 1) {
|
||||
auto* player = Player::GetPlayer(args[0]);
|
||||
|
||||
@@ -1129,7 +1144,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
}
|
||||
}
|
||||
|
||||
if (chatCommand == "ban" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_SENIOR_MODERATOR) {
|
||||
if (chatCommand == "ban" && entity->GetGMLevel() >= eGameMasterLevel::SENIOR_MODERATOR) {
|
||||
if (args.size() == 1) {
|
||||
auto* player = Player::GetPlayer(args[0]);
|
||||
|
||||
@@ -1178,7 +1193,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
|
||||
//-------------------------------------------------
|
||||
|
||||
if (chatCommand == "buffme" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) {
|
||||
if (chatCommand == "buffme" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||
auto dest = static_cast<DestroyableComponent*>(entity->GetComponent(eReplicaComponentType::DESTROYABLE));
|
||||
if (dest) {
|
||||
dest->SetHealth(999);
|
||||
@@ -1191,7 +1206,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
EntityManager::Instance()->SerializeEntity(entity);
|
||||
}
|
||||
|
||||
if (chatCommand == "startcelebration" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER && args.size() == 1) {
|
||||
if (chatCommand == "startcelebration" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER && args.size() == 1) {
|
||||
int32_t celebration;
|
||||
|
||||
if (!GeneralUtils::TryParse(args[0], celebration)) {
|
||||
@@ -1202,7 +1217,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
GameMessages::SendStartCelebrationEffect(entity, entity->GetSystemAddress(), celebration);
|
||||
}
|
||||
|
||||
if (chatCommand == "buffmed" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) {
|
||||
if (chatCommand == "buffmed" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||
auto dest = static_cast<DestroyableComponent*>(entity->GetComponent(eReplicaComponentType::DESTROYABLE));
|
||||
if (dest) {
|
||||
dest->SetHealth(9);
|
||||
@@ -1215,7 +1230,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
EntityManager::Instance()->SerializeEntity(entity);
|
||||
}
|
||||
|
||||
if (chatCommand == "refillstats" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) {
|
||||
if (chatCommand == "refillstats" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||
|
||||
auto dest = static_cast<DestroyableComponent*>(entity->GetComponent(eReplicaComponentType::DESTROYABLE));
|
||||
if (dest) {
|
||||
@@ -1227,7 +1242,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
EntityManager::Instance()->SerializeEntity(entity);
|
||||
}
|
||||
|
||||
if (chatCommand == "lookup" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER && args.size() >= 1) {
|
||||
if (chatCommand == "lookup" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER && args.size() >= 1) {
|
||||
auto query = CDClientDatabase::CreatePreppedStmt(
|
||||
"SELECT `id`, `name` FROM `Objects` WHERE `displayName` LIKE ?1 OR `name` LIKE ?1 OR `description` LIKE ?1 LIMIT 50");
|
||||
// Concatenate all of the arguments into a single query so a multi word query can be used properly.
|
||||
@@ -1249,7 +1264,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
}
|
||||
}
|
||||
|
||||
if (chatCommand == "spawn" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER && args.size() >= 1) {
|
||||
if (chatCommand == "spawn" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER && args.size() >= 1) {
|
||||
ControllablePhysicsComponent* comp = static_cast<ControllablePhysicsComponent*>(entity->GetComponent(eReplicaComponentType::CONTROLLABLE_PHYSICS));
|
||||
if (!comp) return;
|
||||
|
||||
@@ -1290,7 +1305,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
EntityManager::Instance()->ConstructEntity(newEntity);
|
||||
}
|
||||
|
||||
if (chatCommand == "spawngroup" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER && args.size() >= 3) {
|
||||
if (chatCommand == "spawngroup" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER && args.size() >= 3) {
|
||||
auto controllablePhysicsComponent = entity->GetComponent<ControllablePhysicsComponent>();
|
||||
if (!controllablePhysicsComponent) return;
|
||||
|
||||
@@ -1341,7 +1356,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
}
|
||||
}
|
||||
|
||||
if ((chatCommand == "giveuscore") && args.size() >= 1 && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) {
|
||||
if ((chatCommand == "giveuscore") && args.size() >= 1 && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||
int32_t uscore;
|
||||
|
||||
if (!GeneralUtils::TryParse(args[0], uscore)) {
|
||||
@@ -1363,7 +1378,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
GameMessages::SendModifyLEGOScore(entity, entity->GetSystemAddress(), uscore, lootType);
|
||||
}
|
||||
|
||||
if ((chatCommand == "setlevel") && args.size() >= 1 && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) {
|
||||
if ((chatCommand == "setlevel") && args.size() >= 1 && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||
// We may be trying to set a specific players level to a level. If so override the entity with the requested players.
|
||||
std::string requestedPlayerToSetLevelOf = "";
|
||||
if (args.size() > 1) {
|
||||
@@ -1431,7 +1446,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
return;
|
||||
}
|
||||
|
||||
if (chatCommand == "pos" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) {
|
||||
if (chatCommand == "pos" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||
const auto position = entity->GetPosition();
|
||||
|
||||
ChatPackets::SendSystemMessage(sysAddr, u"<" + (GeneralUtils::to_u16string(position.x)) + u", " + (GeneralUtils::to_u16string(position.y)) + u", " + (GeneralUtils::to_u16string(position.z)) + u">");
|
||||
@@ -1439,7 +1454,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
std::cout << position.x << ", " << position.y << ", " << position.z << std::endl;
|
||||
}
|
||||
|
||||
if (chatCommand == "rot" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) {
|
||||
if (chatCommand == "rot" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||
const auto rotation = entity->GetRotation();
|
||||
|
||||
ChatPackets::SendSystemMessage(sysAddr, u"<" + (GeneralUtils::to_u16string(rotation.w)) + u", " + (GeneralUtils::to_u16string(rotation.x)) + u", " + (GeneralUtils::to_u16string(rotation.y)) + u", " + (GeneralUtils::to_u16string(rotation.z)) + u">");
|
||||
@@ -1447,22 +1462,22 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
std::cout << rotation.w << ", " << rotation.x << ", " << rotation.y << ", " << rotation.z << std::endl;
|
||||
}
|
||||
|
||||
if (chatCommand == "locrow" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) {
|
||||
if (chatCommand == "locrow" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||
const auto position = entity->GetPosition();
|
||||
const auto rotation = entity->GetRotation();
|
||||
|
||||
std::cout << "<location x=\"" << position.x << "\" y=\"" << position.y << "\" z=\"" << position.z << "\" rw=\"" << rotation.w << "\" rx=\"" << rotation.x << "\" ry=\"" << rotation.y << "\" rz=\"" << rotation.z << "\" />" << std::endl;
|
||||
}
|
||||
|
||||
if (chatCommand == "playlvlfx" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) {
|
||||
if (chatCommand == "playlvlfx" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||
GameMessages::SendPlayFXEffect(entity, 7074, u"create", "7074", LWOOBJID_EMPTY, 1.0f, 1.0f, true);
|
||||
}
|
||||
|
||||
if (chatCommand == "playrebuildfx" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) {
|
||||
if (chatCommand == "playrebuildfx" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||
GameMessages::SendPlayFXEffect(entity, 230, u"rebuild", "230", LWOOBJID_EMPTY, 1.0f, 1.0f, true);
|
||||
}
|
||||
|
||||
if ((chatCommand == "freemoney" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) && args.size() == 1) {
|
||||
if ((chatCommand == "freemoney" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) && args.size() == 1) {
|
||||
int32_t money;
|
||||
|
||||
if (!GeneralUtils::TryParse(args[0], money)) {
|
||||
@@ -1474,7 +1489,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
ch->SetCoins(ch->GetCoins() + money, eLootSourceType::LOOT_SOURCE_MODERATION);
|
||||
}
|
||||
|
||||
if ((chatCommand == "setcurrency") && args.size() == 1 && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) {
|
||||
if ((chatCommand == "setcurrency") && args.size() == 1 && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||
int32_t money;
|
||||
|
||||
if (!GeneralUtils::TryParse(args[0], money)) {
|
||||
@@ -1487,13 +1502,13 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
}
|
||||
|
||||
// Allow for this on even while not a GM, as it sometimes toggles incorrrectly.
|
||||
if (chatCommand == "gminvis" && entity->GetParentUser()->GetMaxGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) {
|
||||
if (chatCommand == "gminvis" && entity->GetParentUser()->GetMaxGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||
GameMessages::SendToggleGMInvis(entity->GetObjectID(), true, UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (chatCommand == "gmimmune" && args.size() >= 1 && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) {
|
||||
if (chatCommand == "gmimmune" && args.size() >= 1 && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||
auto* destroyableComponent = entity->GetComponent<DestroyableComponent>();
|
||||
|
||||
int32_t state = false;
|
||||
@@ -1510,7 +1525,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
return;
|
||||
}
|
||||
|
||||
if (chatCommand == "buff" && args.size() >= 2 && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) {
|
||||
if (chatCommand == "buff" && args.size() >= 2 && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||
auto* buffComponent = entity->GetComponent<BuffComponent>();
|
||||
|
||||
int32_t id = 0;
|
||||
@@ -1533,7 +1548,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
return;
|
||||
}
|
||||
|
||||
if ((chatCommand == "testmap" && args.size() >= 1) && entity->GetGMLevel() >= GAME_MASTER_LEVEL_FORUM_MODERATOR) {
|
||||
if ((chatCommand == "testmap" && args.size() >= 1) && entity->GetGMLevel() >= eGameMasterLevel::FORUM_MODERATOR) {
|
||||
ChatPackets::SendSystemMessage(sysAddr, u"Requesting map change...");
|
||||
uint32_t reqZone;
|
||||
LWOCLONEID cloneId = 0;
|
||||
@@ -1592,7 +1607,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
}
|
||||
}
|
||||
|
||||
if (chatCommand == "createprivate" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER && args.size() >= 3) {
|
||||
if (chatCommand == "createprivate" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER && args.size() >= 3) {
|
||||
uint32_t zone;
|
||||
|
||||
if (!GeneralUtils::TryParse(args[0], zone)) {
|
||||
@@ -1616,13 +1631,13 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
return;
|
||||
}
|
||||
|
||||
if ((chatCommand == "debugui") && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) {
|
||||
if ((chatCommand == "debugui") && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||
ChatPackets::SendSystemMessage(sysAddr, u"Opening UIDebugger...");
|
||||
AMFArrayValue args;
|
||||
GameMessages::SendUIMessageServerToSingleClient(entity, sysAddr, "ToggleUIDebugger;", nullptr);
|
||||
}
|
||||
|
||||
if ((chatCommand == "boost") && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) {
|
||||
if ((chatCommand == "boost") && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||
auto* possessorComponent = entity->GetComponent<PossessorComponent>();
|
||||
|
||||
if (possessorComponent == nullptr) {
|
||||
@@ -1654,7 +1669,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
|
||||
}
|
||||
|
||||
if ((chatCommand == "unboost") && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) {
|
||||
if ((chatCommand == "unboost") && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||
auto* possessorComponent = entity->GetComponent<PossessorComponent>();
|
||||
|
||||
if (possessorComponent == nullptr) return;
|
||||
@@ -1664,7 +1679,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
GameMessages::SendVehicleRemovePassiveBoostAction(vehicle->GetObjectID(), UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
|
||||
if (chatCommand == "activatespawner" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER && args.size() >= 1) {
|
||||
if (chatCommand == "activatespawner" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER && args.size() >= 1) {
|
||||
auto spawners = dZoneManager::Instance()->GetSpawnersByName(args[0]);
|
||||
|
||||
for (auto* spawner : spawners) {
|
||||
@@ -1678,7 +1693,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
}
|
||||
}
|
||||
|
||||
if (chatCommand == "spawnphysicsverts" && entity->GetGMLevel() >= 6) {
|
||||
if (chatCommand == "spawnphysicsverts" && entity->GetGMLevel() >= eGameMasterLevel::JUNIOR_DEVELOPER) {
|
||||
//Go tell physics to spawn all the vertices:
|
||||
auto entities = EntityManager::Instance()->GetEntitiesByComponent(eReplicaComponentType::PHANTOM_PHYSICS);
|
||||
for (auto en : entities) {
|
||||
@@ -1688,7 +1703,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
}
|
||||
}
|
||||
|
||||
if (chatCommand == "reportproxphys" && entity->GetGMLevel() >= 6) {
|
||||
if (chatCommand == "reportproxphys" && entity->GetGMLevel() >= eGameMasterLevel::JUNIOR_DEVELOPER) {
|
||||
auto entities = EntityManager::Instance()->GetEntitiesByComponent(eReplicaComponentType::PROXIMITY_MONITOR);
|
||||
for (auto en : entities) {
|
||||
auto phys = static_cast<ProximityMonitorComponent*>(en->GetComponent(eReplicaComponentType::PROXIMITY_MONITOR));
|
||||
@@ -1704,7 +1719,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
}
|
||||
}
|
||||
|
||||
if (chatCommand == "triggerspawner" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER && args.size() >= 1) {
|
||||
if (chatCommand == "triggerspawner" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER && args.size() >= 1) {
|
||||
auto spawners = dZoneManager::Instance()->GetSpawnersByName(args[0]);
|
||||
|
||||
for (auto* spawner : spawners) {
|
||||
@@ -1718,7 +1733,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
}
|
||||
}
|
||||
|
||||
if (chatCommand == "reforge" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER && args.size() >= 2) {
|
||||
if (chatCommand == "reforge" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER && args.size() >= 2) {
|
||||
LOT baseItem;
|
||||
LOT reforgedItem;
|
||||
|
||||
@@ -1735,7 +1750,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
inventoryComponent->AddItem(baseItem, 1, eLootSourceType::LOOT_SOURCE_MODERATION, eInventoryType::INVALID, data);
|
||||
}
|
||||
|
||||
if (chatCommand == "crash" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_OPERATOR) {
|
||||
if (chatCommand == "crash" && entity->GetGMLevel() >= eGameMasterLevel::OPERATOR) {
|
||||
ChatPackets::SendSystemMessage(sysAddr, u"Crashing...");
|
||||
|
||||
int* badPtr = nullptr;
|
||||
@@ -1744,7 +1759,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
return;
|
||||
}
|
||||
|
||||
if (chatCommand == "metrics" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) {
|
||||
if (chatCommand == "metrics" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||
for (const auto variable : Metrics::GetAllMetrics()) {
|
||||
auto* metric = Metrics::GetMetric(variable);
|
||||
|
||||
@@ -1781,7 +1796,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
return;
|
||||
}
|
||||
|
||||
if (chatCommand == "reloadconfig" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER) {
|
||||
if (chatCommand == "reloadconfig" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||
Game::config->ReloadConfig();
|
||||
VanityUtilities::SpawnVanity();
|
||||
dpWorld::Instance().Reload();
|
||||
@@ -1797,7 +1812,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
ChatPackets::SendSystemMessage(sysAddr, u"Successfully reloaded config for world!");
|
||||
}
|
||||
|
||||
if (chatCommand == "rollloot" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_OPERATOR && args.size() >= 3) {
|
||||
if (chatCommand == "rollloot" && entity->GetGMLevel() >= eGameMasterLevel::OPERATOR && args.size() >= 3) {
|
||||
uint32_t lootMatrixIndex = 0;
|
||||
uint32_t targetLot = 0;
|
||||
uint32_t loops = 1;
|
||||
@@ -1834,7 +1849,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
ChatPackets::SendSystemMessage(sysAddr, message);
|
||||
}
|
||||
|
||||
if (chatCommand == "deleteinven" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER && args.size() >= 1) {
|
||||
if (chatCommand == "deleteinven" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER && args.size() >= 1) {
|
||||
eInventoryType inventoryType = eInventoryType::INVALID;
|
||||
if (!GeneralUtils::TryParse(args[0], inventoryType)) {
|
||||
// In this case, we treat the input as a string and try to find it in the reflection list
|
||||
@@ -1861,7 +1876,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
ChatPackets::SendSystemMessage(sysAddr, u"Deleted inventory " + GeneralUtils::UTF8ToUTF16(args[0]));
|
||||
}
|
||||
|
||||
if (chatCommand == "inspect" && entity->GetGMLevel() >= GAME_MASTER_LEVEL_DEVELOPER && args.size() >= 1) {
|
||||
if (chatCommand == "inspect" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER && args.size() >= 1) {
|
||||
Entity* closest = nullptr;
|
||||
|
||||
eReplicaComponentType component;
|
||||
@@ -2004,7 +2019,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
||||
auto* phantomPhysicsComponent = closest->GetComponent<PhantomPhysicsComponent>();
|
||||
|
||||
if (phantomPhysicsComponent != nullptr) {
|
||||
ChatPackets::SendSystemMessage(sysAddr, u"Type: " + (GeneralUtils::to_u16string(phantomPhysicsComponent->GetEffectType())));
|
||||
ChatPackets::SendSystemMessage(sysAddr, u"Type: " + (GeneralUtils::to_u16string(static_cast<uint32_t>(phantomPhysicsComponent->GetEffectType()))));
|
||||
const auto dir = phantomPhysicsComponent->GetDirection();
|
||||
ChatPackets::SendSystemMessage(sysAddr, u"Direction: <" + (GeneralUtils::to_u16string(dir.x)) + u", " + (GeneralUtils::to_u16string(dir.y)) + u", " + (GeneralUtils::to_u16string(dir.z)) + u">");
|
||||
ChatPackets::SendSystemMessage(sysAddr, u"Multiplier: " + (GeneralUtils::to_u16string(phantomPhysicsComponent->GetDirectionalMultiplier())));
|
||||
|
Reference in New Issue
Block a user