Jump to content

[41.73][Multiplayer] Right-Click Context Menu non-functional in safehouses


Bambino

Recommended Posts

If you are not an admin/moderator, the safehouse owner or on the safehouse perm list, the right-click context menu is non-functional in that particular safehouse.

• 41.73
• Multiplayer.
• Dedicated Server.
• No Mods.
• Still occurs on new save
• Reproduction steps:
  1. Claim a safehouse as a player with no admin perms.
  2. Bring another player over to right-click anywhere in the area the safehouse occupies.
  3. None of the right-click context menu options appear.
It doesn't matter what safehouse options are enabled/disabled in the server settings.

I could be mistaken, but it doesn't seem like there is a check for this taking place place in the Java or LUA code base. 
I assume it would take place in ISWorldObjectContextMenu.lua, but seems I'm wrong. 
The check seems to consider admin powers, safehouse perms and where you are clicking.

If this is for some reason intended, could someone guide me to the source of this check so I can make a quick mod to bypass it?

Preventing the context menu from appearing does not impact whether players can enter a safehouse, loot safehouse containers, or demolish within a safehouse. 
I need to check dismanstle, but other than that blanketly preventing the context menu from appearing for players without safehouse perms seems unnecessarily limiting.
Edited by Bambino
format
Link to comment
Share on other sites

After debugging a bit, looking at the java source (UIManager.java) It seems like the OnObjectRightMouseButtonDown event is met. However, the line containing the OnObjectRightMouseButtonUp event is never met. Seemingly isSafeHouse is returning something other than null.

boolean var17 = true;
if (GameClient.bClient && Picked.tile.getSquare() != null) {
  SafeHouse var12 = SafeHouse.isSafeHouse(Picked.tile.getSquare(), IsoPlayer.getInstance().getUsername(), true);
  if (var12 != null) {
    var17 = false;
  }
}

if (var17) {
  LuaEventManager.triggerEvent("OnObjectRightMouseButtonUp", Picked.tile, BoxedStaticValues.toDouble((double)var5), BoxedStaticValues.toDouble((double)var6));
}

Looking at public static SafeHouse isSafeHouse in SafeHouse.java, It seems to be returning something other than null when right-clicking within a safehouse area IF you do not have an accesslevel, you are safehouse owner, or you are on the safehouse perm list.

There is only one line that returns something other than null, but it baffles me bc it leads me to think players that are on the safehouse list or owner would return true thus bypassing the OnObjectRightMouseButtonUp trigger.

return !var4 || (var1 == null || var6 == null || var6.getPlayers().contains(var1) || var6.getOwner().equals(var1)) && var1 != null ? null : var6;


Either I'm looking at it the wrong way, or someone else smarter may figure it out.

Edited by Bambino
format
Link to comment
Share on other sites

I'm familiar with this behavior, it's been my assumption that it is intended, personally. It only happens when someone who isn't authorized is in a safehouse with the invisible walls disabled ("allow tresspass"). It's my understanding that this is the security method for the safehouses without preventing entry, and that it'd be better if certain actions were blacklisted instead like opening containers and grabbing and picking tiles up, etc.. I've considered making a mod for this myself with a configurable list of context options that would be disallowed or allowed for mod support.

 

Edit: I believe if you allow "stealing" from safehouses then the context menu is enabled, by the way.

Edited by UdderlyEvelyn
Link to comment
Share on other sites

4 hours ago, UdderlyEvelyn said:

I'm familiar with this behavior, it's been my assumption that it is intended, personally. It only happens when someone who isn't authorized is in a safehouse with the invisible walls disabled ("allow tresspass"). It's my understanding that this is the security method for the safehouses without preventing entry, and that it'd be better if certain actions were blacklisted instead like opening containers and grabbing and picking tiles up, etc.. I've considered making a mod for this myself with a configurable list of context options that would be disallowed or allowed for mod support.

 

Edit: I believe if you allow "stealing" from safehouses then the context menu is enabled, by the way.

I have both of these options enabled as well. The context menu still does not appear. Are you sure?

# Allow non-members to enter a safehouse without being invited
SafehouseAllowTrepass=true

# Allow non-members to take items from safehouses
SafehouseAllowLoot=true

My assumption is that using the context menu in the given circumstances should be possible due to there being checks for specific context menu entries related to admin & safehouse perms. 

Edited by Bambino
error
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...