Check building access on every vendor production action
ItemProductionMsgHandler trusted the client to send production, recycle, junk, deposit, price and take requests only from an open management window. It now applies the window's own rule (owner, guild leader or IC, or building friends) before any action. Value changes: none for players who can open the window; others are silently ignored. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4b50a4f74b
commit
807a806a0d
1 file changed
+6
@@ -62,6 +62,12 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler {
|
||||
if (vendor == null)
|
||||
return true;
|
||||
|
||||
// Same access rule as opening the vendor's management window (OrderNPCMsgHandler); never trust the client
|
||||
|
||||
if (!BuildingManager.PlayerCanControlNotOwner(vendor.getBuilding(), player)
|
||||
&& !BuildingManager.playerCanManage(player, vendor.getBuilding()))
|
||||
return true;
|
||||
|
||||
// Process Request
|
||||
|
||||
switch (msg.actionType) {
|
||||
|
||||
Reference in new issue
Block a user