Add /unwarpable command

GMs should use this before going to weird places where their non-GM
buddies might warp to them and get stuck.
This commit is contained in:
dongresource 2020-12-28 16:24:24 +01:00
parent 81d0964971
commit fc45775666
3 changed files with 17 additions and 0 deletions

View File

@ -528,6 +528,10 @@ void BuddyManager::reqBuddyWarp(CNSocket* sock, CNPacketData* data) {
if (otherPlr->onMonkey) if (otherPlr->onMonkey)
goto fail; goto fail;
// does the player disallow warping?
if (otherPlr->unwarpable)
goto fail;
// otherPlr->instanceID should always be INSTANCE_OVERWORLD at this point // otherPlr->instanceID should always be INSTANCE_OVERWORLD at this point
PlayerManager::sendPlayerTo(sock, otherPlr->x, otherPlr->y, otherPlr->z, otherPlr->instanceID); PlayerManager::sendPlayerTo(sock, otherPlr->x, otherPlr->y, otherPlr->z, otherPlr->instanceID);
return; return;

View File

@ -792,6 +792,16 @@ void redeemCommand(std::string full, std::vector<std::string>& args, CNSocket* s
ChatManager::sendServerMessage(sock, msg); ChatManager::sendServerMessage(sock, msg);
} }
void unwarpableCommand(std::string full, std::vector<std::string>& args, CNSocket* sock) {
Player *plr = PlayerManager::getPlayer(sock);
plr->unwarpable = true;
}
void warpableCommand(std::string full, std::vector<std::string>& args, CNSocket* sock) {
Player *plr = PlayerManager::getPlayer(sock);
plr->unwarpable = false;
}
void ChatManager::init() { void ChatManager::init() {
REGISTER_SHARD_PACKET(P_CL2FE_REQ_SEND_FREECHAT_MESSAGE, chatHandler); REGISTER_SHARD_PACKET(P_CL2FE_REQ_SEND_FREECHAT_MESSAGE, chatHandler);
REGISTER_SHARD_PACKET(P_CL2FE_REQ_PC_AVATAR_EMOTES_CHAT, emoteHandler); REGISTER_SHARD_PACKET(P_CL2FE_REQ_PC_AVATAR_EMOTES_CHAT, emoteHandler);
@ -824,6 +834,8 @@ void ChatManager::init() {
registerCommand("lair", 50, lairUnlockCommand, "get the required mission for the nearest fusion lair"); registerCommand("lair", 50, lairUnlockCommand, "get the required mission for the nearest fusion lair");
registerCommand("hide", 100, hideCommand, "hide yourself from the global player map"); registerCommand("hide", 100, hideCommand, "hide yourself from the global player map");
registerCommand("unhide", 100, unhideCommand, "un-hide yourself from the global player map"); registerCommand("unhide", 100, unhideCommand, "un-hide yourself from the global player map");
registerCommand("unwarpable", 100, unwarpableCommand, "prevent buddies from warping to you");
registerCommand("warpable", 100, warpableCommand, "re-allow buddies to warp to you");
registerCommand("redeem", 100, redeemCommand, "redeem a code item"); registerCommand("redeem", 100, redeemCommand, "redeem a code item");
} }

View File

@ -74,6 +74,7 @@ struct Player {
bool notify; bool notify;
bool hidden; bool hidden;
bool unwarpable;
bool buddiesSynced; bool buddiesSynced;
int64_t buddyIDs[50]; int64_t buddyIDs[50];