diff --git a/2006Redone Server/src/com/rebotted/game/items/ItemAssistant.java b/2006Redone Server/src/com/rebotted/game/items/ItemAssistant.java index c24c6fc5..ffc5271c 100644 --- a/2006Redone Server/src/com/rebotted/game/items/ItemAssistant.java +++ b/2006Redone Server/src/com/rebotted/game/items/ItemAssistant.java @@ -7,6 +7,7 @@ import com.rebotted.game.npcs.NpcHandler; import com.rebotted.game.players.Client; import com.rebotted.game.players.Player; import com.rebotted.game.players.PlayerHandler; +import com.rebotted.util.MainFrameIDs; import com.rebotted.util.Misc; public class ItemAssistant { @@ -1804,6 +1805,12 @@ public class ItemAssistant { c.otherBank = false; return false; } + + if (!(c.lastMainFrameInterface == MainFrameIDs.DEPOSIT_BOX || c.lastMainFrameInterface == MainFrameIDs.BANK)) { //Packet exploit prevention + c.getPacketSender().sendMessage("You don't have a bank open! Report this ID to developers: " + c.lastMainFrameInterface); + return false; + } + if (c.playerItemsN[fromSlot] <= 0) { return false; } diff --git a/2006Redone Server/src/com/rebotted/game/objects/ObjectsActions.java b/2006Redone Server/src/com/rebotted/game/objects/ObjectsActions.java index 7f39ff86..9c44401b 100644 --- a/2006Redone Server/src/com/rebotted/game/objects/ObjectsActions.java +++ b/2006Redone Server/src/com/rebotted/game/objects/ObjectsActions.java @@ -1080,7 +1080,7 @@ public class ObjectsActions { } break; - case 9299: + case 9299: //Lumbridge squeeze-through fence if (player.absX == 3240) { if (player.absY == 3191) { player.getPlayerAssistant().walkTo(0, -1); diff --git a/2006Redone Server/src/com/rebotted/game/players/Player.java b/2006Redone Server/src/com/rebotted/game/players/Player.java index 5710fa47..f3f66be9 100644 --- a/2006Redone Server/src/com/rebotted/game/players/Player.java +++ b/2006Redone Server/src/com/rebotted/game/players/Player.java @@ -121,7 +121,7 @@ public abstract class Player { private final ObjectManager objectManager = new ObjectManager(); public ArrayList fishingTrawlerReward = new ArrayList(); private final RangersGuild rangersGuild = new RangersGuild(this); - private GlassBlowing glassBlowing = new GlassBlowing(this); + private GlassBlowing glassBlowing = new GlassBlowing(this); private Barrows barrows = new Barrows(this); private Mining mining = new Mining(); private ChallengePlayer challengePlayer = new ChallengePlayer(); @@ -130,7 +130,8 @@ public abstract class Player { private GateHandler gateHandler = new GateHandler(); private SingleGates singleGates = new SingleGates(); private DoubleGates doubleGates = new DoubleGates(); - + public int lastMainFrameInterface = -1; //Possibly used in future to prevent packet exploits + public SingleGates getSingleGates() { return singleGates; } diff --git a/2006Redone Server/src/com/rebotted/net/PacketSender.java b/2006Redone Server/src/com/rebotted/net/PacketSender.java index feb0706e..f94e7da7 100644 --- a/2006Redone Server/src/com/rebotted/net/PacketSender.java +++ b/2006Redone Server/src/com/rebotted/net/PacketSender.java @@ -14,6 +14,7 @@ import com.rebotted.game.items.impl.LightSources; import com.rebotted.game.players.Client; import com.rebotted.game.players.Player; import com.rebotted.game.players.PlayerHandler; +import com.rebotted.util.MainFrameIDs; import com.rebotted.util.Misc; import com.rebotted.world.clip.Region; @@ -278,7 +279,7 @@ public class PacketSender { return this; } - public PacketSender sendFrame126(String s, int id) { + public PacketSender sendFrame126(String s, int id) { //Seems to be about chat messsages if(!player.checkPacket126Update(s, id)) { return this; } @@ -320,8 +321,9 @@ public class PacketSender { return this; } - public PacketSender sendFrame248(int MainFrame, int SubFrame) { + public PacketSender sendFrame248(int MainFrame, int SubFrame) { //Trade-like interfaces // synchronized(c) { + player.lastMainFrameInterface = MainFrame; if (player.getOutStream() != null && player != null) { player.getOutStream().createFrame(248); player.getOutStream().writeWordA(MainFrame); @@ -331,7 +333,8 @@ public class PacketSender { return this; } - public PacketSender sendFrame246(int MainFrame, int SubFrame, int SubFrame2) { + public PacketSender sendFrame246(int MainFrame, int SubFrame, int SubFrame2) { //A lot of generic interfaces; cooking, etc + player.lastMainFrameInterface = MainFrame; // synchronized(c) { if (player.getOutStream() != null && player != null) { player.getOutStream().createFrame(246); @@ -343,7 +346,7 @@ public class PacketSender { return this; } - public PacketSender sendFrame171(int MainFrame, int SubFrame) { + public PacketSender sendFrame171(int MainFrame, int SubFrame) { //Special attack bar? // synchronized(c) { if (player.getOutStream() != null && player != null) { player.getOutStream().createFrame(171); @@ -379,7 +382,7 @@ public class PacketSender { return this; } - public PacketSender sendFrame106(int sideIcon) { + public PacketSender sendFrame106(int sideIcon) { //Something to do with magic if (player.getOutStream() != null && player != null) { player.getOutStream().createFrame(106); player.getOutStream().writeByteC(sideIcon); @@ -389,7 +392,7 @@ public class PacketSender { return this; } - public PacketSender sendFrame70(int i, int o, int id) { + public PacketSender sendFrame70(int i, int o, int id) { //Ranging guild minigame if (player.getOutStream() != null && player != null) { player.getOutStream().createFrame(70); player.getOutStream().writeWord(i); @@ -442,7 +445,7 @@ public class PacketSender { return this; } - public PacketSender sendFrame87(int id, int state) { + public PacketSender sendFrame87(int id, int state) { //Castlewars and duel arena texts // synchronized(c) { if (player.getOutStream() != null && player != null) { player.getOutStream().createFrame(87); @@ -487,6 +490,7 @@ public class PacketSender { } public PacketSender closeAllWindows() { + player.lastMainFrameInterface = -1; if (player.getOutStream() != null && player != null) { player.getOutStream().createFrame(219); player.flushOutStream(); @@ -594,6 +598,7 @@ public class PacketSender { player.getItemAssistant().resetTempItems(); player.getOutStream().createFrame(248); player.getOutStream().writeWordA(5292); + player.lastMainFrameInterface = MainFrameIDs.BANK; //Setting it to 5292, since I *think* that's what interface got opened player.getOutStream().writeWord(5063); player.flushOutStream(); player.isBanking = true; diff --git a/2006Redone Server/src/com/rebotted/util/MainFrameIDs.java b/2006Redone Server/src/com/rebotted/util/MainFrameIDs.java new file mode 100644 index 00000000..05f41c0f --- /dev/null +++ b/2006Redone Server/src/com/rebotted/util/MainFrameIDs.java @@ -0,0 +1,9 @@ +package com.rebotted.util; + +/** + * Easy access to common interface IDs + */ +public class MainFrameIDs { + public static final int DEPOSIT_BOX = 4465; + public static final int BANK = 5292; //Might be incorrect!! +} diff --git a/CompiledServer/artifacts/localhost_2006rebotted_jar/localhost_2006rebotted.jar b/CompiledServer/artifacts/localhost_2006rebotted_jar/localhost_2006rebotted.jar index a010c674..b1184010 100644 Binary files a/CompiledServer/artifacts/localhost_2006rebotted_jar/localhost_2006rebotted.jar and b/CompiledServer/artifacts/localhost_2006rebotted_jar/localhost_2006rebotted.jar differ diff --git a/CompiledServer/production/2006rebotted/com/rebotted/game/items/ItemAssistant.class b/CompiledServer/production/2006rebotted/com/rebotted/game/items/ItemAssistant.class index 37b349c3..113be870 100644 Binary files a/CompiledServer/production/2006rebotted/com/rebotted/game/items/ItemAssistant.class and b/CompiledServer/production/2006rebotted/com/rebotted/game/items/ItemAssistant.class differ diff --git a/CompiledServer/production/2006rebotted/com/rebotted/game/players/Player$1.class b/CompiledServer/production/2006rebotted/com/rebotted/game/players/Player$1.class index 0180afa1..55a59155 100644 Binary files a/CompiledServer/production/2006rebotted/com/rebotted/game/players/Player$1.class and b/CompiledServer/production/2006rebotted/com/rebotted/game/players/Player$1.class differ diff --git a/CompiledServer/production/2006rebotted/com/rebotted/game/players/Player$2.class b/CompiledServer/production/2006rebotted/com/rebotted/game/players/Player$2.class index dc2c0cb6..daacf368 100644 Binary files a/CompiledServer/production/2006rebotted/com/rebotted/game/players/Player$2.class and b/CompiledServer/production/2006rebotted/com/rebotted/game/players/Player$2.class differ diff --git a/CompiledServer/production/2006rebotted/com/rebotted/game/players/Player$3.class b/CompiledServer/production/2006rebotted/com/rebotted/game/players/Player$3.class index ecce467b..f1479168 100644 Binary files a/CompiledServer/production/2006rebotted/com/rebotted/game/players/Player$3.class and b/CompiledServer/production/2006rebotted/com/rebotted/game/players/Player$3.class differ diff --git a/CompiledServer/production/2006rebotted/com/rebotted/game/players/Player$4.class b/CompiledServer/production/2006rebotted/com/rebotted/game/players/Player$4.class index 8680e0f8..b7871ff9 100644 Binary files a/CompiledServer/production/2006rebotted/com/rebotted/game/players/Player$4.class and b/CompiledServer/production/2006rebotted/com/rebotted/game/players/Player$4.class differ diff --git a/CompiledServer/production/2006rebotted/com/rebotted/game/players/Player$TinterfaceText.class b/CompiledServer/production/2006rebotted/com/rebotted/game/players/Player$TinterfaceText.class index 244fb1d6..0ae8f9b0 100644 Binary files a/CompiledServer/production/2006rebotted/com/rebotted/game/players/Player$TinterfaceText.class and b/CompiledServer/production/2006rebotted/com/rebotted/game/players/Player$TinterfaceText.class differ diff --git a/CompiledServer/production/2006rebotted/com/rebotted/game/players/Player.class b/CompiledServer/production/2006rebotted/com/rebotted/game/players/Player.class index bb2dcef0..b82f4693 100644 Binary files a/CompiledServer/production/2006rebotted/com/rebotted/game/players/Player.class and b/CompiledServer/production/2006rebotted/com/rebotted/game/players/Player.class differ diff --git a/CompiledServer/production/2006rebotted/com/rebotted/net/PacketSender.class b/CompiledServer/production/2006rebotted/com/rebotted/net/PacketSender.class index 3bca0335..0ad51365 100644 Binary files a/CompiledServer/production/2006rebotted/com/rebotted/net/PacketSender.class and b/CompiledServer/production/2006rebotted/com/rebotted/net/PacketSender.class differ diff --git a/CompiledServer/production/2006rebotted/com/rebotted/util/MainFrameIDs.class b/CompiledServer/production/2006rebotted/com/rebotted/util/MainFrameIDs.class new file mode 100644 index 00000000..c8469821 Binary files /dev/null and b/CompiledServer/production/2006rebotted/com/rebotted/util/MainFrameIDs.class differ