mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-02 16:49:03 +00:00
Merge branch 'fix_packet_exploits'
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -121,7 +121,7 @@ public abstract class Player {
|
||||
private final ObjectManager objectManager = new ObjectManager();
|
||||
public ArrayList<GameItem> fishingTrawlerReward = new ArrayList<GameItem>();
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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!!
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user