mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-05 06:50:04 +00:00
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:
parent
81d0964971
commit
fc45775666
@ -528,6 +528,10 @@ void BuddyManager::reqBuddyWarp(CNSocket* sock, CNPacketData* data) {
|
||||
if (otherPlr->onMonkey)
|
||||
goto fail;
|
||||
|
||||
// does the player disallow warping?
|
||||
if (otherPlr->unwarpable)
|
||||
goto fail;
|
||||
|
||||
// otherPlr->instanceID should always be INSTANCE_OVERWORLD at this point
|
||||
PlayerManager::sendPlayerTo(sock, otherPlr->x, otherPlr->y, otherPlr->z, otherPlr->instanceID);
|
||||
return;
|
||||
|
@ -792,6 +792,16 @@ void redeemCommand(std::string full, std::vector<std::string>& args, CNSocket* s
|
||||
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() {
|
||||
REGISTER_SHARD_PACKET(P_CL2FE_REQ_SEND_FREECHAT_MESSAGE, chatHandler);
|
||||
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("hide", 100, hideCommand, "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");
|
||||
}
|
||||
|
||||
|
@ -74,6 +74,7 @@ struct Player {
|
||||
|
||||
bool notify;
|
||||
bool hidden;
|
||||
bool unwarpable;
|
||||
|
||||
bool buddiesSynced;
|
||||
int64_t buddyIDs[50];
|
||||
|
Loading…
Reference in New Issue
Block a user