Skip to content

Commit

Permalink
t
Browse files Browse the repository at this point in the history
  • Loading branch information
xdnw committed May 10, 2024
1 parent 92f3a22 commit 473e7df
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3463,7 +3463,7 @@ public String send(@Me IMessageIO channel, @Me JSONObject command, @Me GuildDB s
@Default DBAlliance sender_alliance,

@Switch("f") boolean force) throws IOException {
if (OffshoreInstance.DISABLE_TRANSFERS) throw new IllegalArgumentException("Error: Maintenance");
if (OffshoreInstance.DISABLE_TRANSFERS && user.getIdLong() != Settings.INSTANCE.ADMIN_USER_ID) throw new IllegalArgumentException("Error: Maintenance");
return sendAA(channel, command, senderDB, user, me, amount, receiver_account, receiver_nation, sender_alliance, me, force);
}

Expand Down Expand Up @@ -3495,8 +3495,8 @@ public String sendAA(@Me IMessageIO channel, @Me JSONObject command, @Me GuildDB
"Defaults to your nation", group = 2)
@Default DBNation sender_nation,
@Switch("f") boolean force) throws IOException {
if (me.getId() != Settings.INSTANCE.NATION_ID) return "WIP";
if (OffshoreInstance.DISABLE_TRANSFERS) throw new IllegalArgumentException("Error: Maintenance");
if (user.getIdLong() != Settings.INSTANCE.ADMIN_USER_ID) return "WIP";
if (OffshoreInstance.DISABLE_TRANSFERS && user.getIdLong() != Settings.INSTANCE.ADMIN_USER_ID) throw new IllegalArgumentException("Error: Maintenance");
if (sender_alliance != null && !senderDB.isAllianceId(sender_alliance.getId())) {
throw new IllegalArgumentException("Sender alliance is not in this guild");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import link.locutus.discord.apiv1.enums.ResourceType;
import link.locutus.discord.commands.manager.v2.binding.annotation.Me;
import link.locutus.discord.commands.manager.v2.impl.pw.refs.CM;
import link.locutus.discord.config.Settings;
import link.locutus.discord.db.GuildDB;
import link.locutus.discord.db.entities.DBAlliance;
import link.locutus.discord.db.entities.DBNation;
Expand Down Expand Up @@ -52,7 +53,7 @@ public class SendInternalTask {
private final OffshoreInstance receiverOffshore;

public SendInternalTask(@Me User banker, @Me DBNation bankerNation, GuildDB senderDB, DBAlliance senderAlliance, DBNation senderNation, GuildDB receiverDB, DBAlliance receiverAlliance, DBNation receiverNation, double[] amount) throws IOException {
if (OffshoreInstance.DISABLE_TRANSFERS) throw new IllegalArgumentException("Error: Maintenance");
if (OffshoreInstance.DISABLE_TRANSFERS && banker.getIdLong() != Settings.INSTANCE.ADMIN_USER_ID) throw new IllegalArgumentException("Error: Maintenance");
checkNotNull(bankerNation, "No banker specified. Register with " + CM.register.cmd.toSlashMention());
checkArgsNotNull(senderDB, senderAlliance, senderNation, receiverDB, receiverAlliance, receiverNation);
checkNonNegative(amount);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public class OffshoreInstance {
public static final ConcurrentHashMap<Integer, Object> NATION_LOCKS = new ConcurrentHashMap<>();
public static final ConcurrentHashMap<Integer, Boolean> FROZEN_ESCROW = new ConcurrentHashMap<>();

public static final boolean DISABLE_TRANSFERS = false;
public static final boolean DISABLE_TRANSFERS = true;
private final int allianceId;

private GuildDB guildDBCached;
Expand Down

0 comments on commit 473e7df

Please sign in to comment.