mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-22 21:40:05 +00:00
Allow GMs to enter private instances
This commit is contained in:
parent
26f4767082
commit
868dc8485e
@ -371,12 +371,25 @@ void instanceCommand(std::string full, std::vector<std::string>& args, CNSocket*
|
|||||||
// move player to specified instance
|
// move player to specified instance
|
||||||
// validate instance ID
|
// validate instance ID
|
||||||
char* instanceS;
|
char* instanceS;
|
||||||
int instance = std::strtol(args[1].c_str(), &instanceS, 10);
|
uint64_t instance = std::strtoll(args[1].c_str(), &instanceS, 10);
|
||||||
if (*instanceS) {
|
if (*instanceS) {
|
||||||
ChatManager::sendServerMessage(sock, "[INST] Invalid instance ID: " + args[1]);
|
ChatManager::sendServerMessage(sock, "[INST] Invalid instance ID: " + args[1]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (args.size() >= 3) {
|
||||||
|
char* playeridS;
|
||||||
|
uint64_t playerid = std::strtoll(args[2].c_str(), &playeridS, 10);
|
||||||
|
|
||||||
|
if (playerid != 0) {
|
||||||
|
instance |= playerid << 32ULL;
|
||||||
|
ChunkManager::createInstance(instance);
|
||||||
|
|
||||||
|
// a precaution
|
||||||
|
plr->recallInstance = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
PlayerManager::sendPlayerTo(sock, plr->x, plr->y, plr->z, instance);
|
PlayerManager::sendPlayerTo(sock, plr->x, plr->y, plr->z, instance);
|
||||||
ChatManager::sendServerMessage(sock, "[INST] Switched to instance with ID " + std::to_string(instance));
|
ChatManager::sendServerMessage(sock, "[INST] Switched to instance with ID " + std::to_string(instance));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user