Skip to content

Commit

Permalink
Prevent two servers from trading with different versions
Browse files Browse the repository at this point in the history
  • Loading branch information
erikzimmermann committed Jul 13, 2024
1 parent 7da3e8a commit 85786eb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,10 @@ public static void message(Player player, String other, TradeInvitePacket.Result
case INCOMPATIBLE:
assert server != null;
TradeSystem.getInstance().getLogger().log(Level.WARNING,
"\"" + player.getName() + "\" tried to trade with \"" + other + "\" on server \"" + server + "\" but the trade configurations/versions from both servers are incompatible.\n\n" +
"\"" + player.getName() + "\" tried to trade with \"" + other + "\" on server \"" + server + "\" but the server versions, trade configurations or plugin versions from both servers are incompatible.\n\n" +
"You have two options to solve this:\n" +
"1. Use the group function in the trade-configuration file on your proxy to separate both servers from each other or\n" +
"2. Copy the Config.yml from one server to the other server"
"2. Copy the Config.yml from one server to the other server and make sure both server/plugin versions are the same."
);
Lang.send(player, "Trade_Partner_is_Offline");
break;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package de.codingair.tradesystem.spigot.transfer;

import de.codingair.codingapi.server.specification.Version;
import de.codingair.tradesystem.spigot.TradeSystem;
import de.codingair.tradesystem.spigot.extras.blacklist.BlockedItem;
import de.codingair.tradesystem.spigot.trade.ProxyTrade;
Expand Down Expand Up @@ -92,6 +93,7 @@ public int getTradeHash() {
}

return Objects.hash(
Version.get(), // fix: java.lang.IllegalArgumentException: Newer version! Server downgrades are not supported!
patternHash,
cooldown,
TradeSystem.handler().isRevokeReadyOnChange(),
Expand Down

0 comments on commit 85786eb

Please sign in to comment.