mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2025-01-19 07:56:26 +01:00
Refactor trade start and disallow trading ignored users
This commit is contained in:
parent
a0c1973622
commit
6bf8bd14db
@ -33,25 +33,31 @@ public class TradeStartEvent extends MessageHandler {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (targetUser != null) {
|
if (targetUser == null) return;
|
||||||
if (!this.client.getHabbo().getRoomUnit().hasStatus(RoomUnitStatus.TRADING)) {
|
|
||||||
if (this.client.getHabbo().getHabboStats().allowTrade()) {
|
if (targetUser.getHabboStats().userIgnored(this.client.getHabbo().getHabboInfo().getId())) return;
|
||||||
if (!targetUser.getRoomUnit().hasStatus(RoomUnitStatus.TRADING)) {
|
|
||||||
if (targetUser.getHabboStats().allowTrade()) {
|
if (this.client.getHabbo().getRoomUnit().hasStatus(RoomUnitStatus.TRADING)) {
|
||||||
room.startTrade(this.client.getHabbo(), targetUser);
|
this.client.sendResponse(new TradeStartFailComposer(TradeStartFailComposer.YOU_ALREADY_TRADING));
|
||||||
} else {
|
return;
|
||||||
this.client.sendResponse(new TradeStartFailComposer(TradeStartFailComposer.TARGET_TRADING_NOT_ALLOWED, targetUser.getHabboInfo().getUsername()));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.client.sendResponse(new TradeStartFailComposer(TradeStartFailComposer.TARGET_ALREADY_TRADING, targetUser.getHabboInfo().getUsername()));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.client.sendResponse(new TradeStartFailComposer(TradeStartFailComposer.YOU_TRADING_OFF));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.client.sendResponse(new TradeStartFailComposer(TradeStartFailComposer.YOU_ALREADY_TRADING));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!this.client.getHabbo().getHabboStats().allowTrade()) {
|
||||||
|
this.client.sendResponse(new TradeStartFailComposer(TradeStartFailComposer.YOU_TRADING_OFF));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (targetUser.getRoomUnit().hasStatus(RoomUnitStatus.TRADING)) {
|
||||||
|
this.client.sendResponse(new TradeStartFailComposer(TradeStartFailComposer.TARGET_ALREADY_TRADING, targetUser.getHabboInfo().getUsername()));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!targetUser.getHabboStats().allowTrade() {
|
||||||
|
this.client.sendResponse(new TradeStartFailComposer(TradeStartFailComposer.TARGET_TRADING_NOT_ALLOWED, targetUser.getHabboInfo().getUsername()));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
room.startTrade(this.client.getHabbo(), targetUser);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user