mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-07 08:39:07 +00:00
Fix noclip (#302)
* Add bank area checks back since previously you could open a bank, and as long as you didn't open another interface you could abuse it * Fix noclip (NEEDS TESTING)
This commit is contained in:
@@ -511,7 +511,7 @@ public abstract class Player {
|
|||||||
PestControl.leaveWaitingBoat(this);
|
PestControl.leaveWaitingBoat(this);
|
||||||
getPlayerAssistant().movePlayer(2657, 2639, 0);
|
getPlayerAssistant().movePlayer(2657, 2639, 0);
|
||||||
}
|
}
|
||||||
if (hasNpc == true) {
|
if (hasNpc) {
|
||||||
getSummon().pickUpClean(this, summonId);
|
getSummon().pickUpClean(this, summonId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -599,7 +599,7 @@ public abstract class Player {
|
|||||||
lastY = absY;
|
lastY = absY;
|
||||||
lastH = heightLevel;
|
lastH = heightLevel;
|
||||||
CycleEventHandler.getSingleton().stopEvents(this);
|
CycleEventHandler.getSingleton().stopEvents(this);
|
||||||
if (hasNpc == true) {
|
if (hasNpc) {
|
||||||
getSummon().pickUpClean(this, summonId);
|
getSummon().pickUpClean(this, summonId);
|
||||||
}
|
}
|
||||||
if (forceLogout || System.currentTimeMillis() - logoutDelay > 2500) {
|
if (forceLogout || System.currentTimeMillis() - logoutDelay > 2500) {
|
||||||
@@ -725,10 +725,6 @@ public abstract class Player {
|
|||||||
return validClient(getClient(id));
|
return validClient(getClient(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean validClient(String name) {
|
|
||||||
return validClient(getClient(name));
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean validClient(Client client) {
|
public boolean validClient(Client client) {
|
||||||
return client != null && !client.disconnected;
|
return client != null && !client.disconnected;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1858,6 +1858,8 @@ public class PlayerAssistant {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void walkTo(int i, int j) {
|
public void walkTo(int i, int j) {
|
||||||
|
PathFinder.getPathFinder().findRoute(player, i, j, false, 1, 1);
|
||||||
|
/*
|
||||||
player.newWalkCmdSteps = 0;
|
player.newWalkCmdSteps = 0;
|
||||||
if (++player.newWalkCmdSteps > 50) {
|
if (++player.newWalkCmdSteps > 50) {
|
||||||
player.newWalkCmdSteps = 0;
|
player.newWalkCmdSteps = 0;
|
||||||
@@ -1871,13 +1873,15 @@ public class PlayerAssistant {
|
|||||||
for (int n = 0; n < player.newWalkCmdSteps; n++) {
|
for (int n = 0; n < player.newWalkCmdSteps; n++) {
|
||||||
player.getNewWalkCmdX()[n] += k;
|
player.getNewWalkCmdX()[n] += k;
|
||||||
player.getNewWalkCmdY()[n] += l;
|
player.getNewWalkCmdY()[n] += l;
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
public void walkTo2(int i, int j) {
|
public void walkTo2(int i, int j) {
|
||||||
if (player.freezeDelay > 0) {
|
if (player.freezeDelay > 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
PathFinder.getPathFinder().findRoute(player, i, j, false, 1, 1);
|
||||||
|
/*
|
||||||
player.newWalkCmdSteps = 0;
|
player.newWalkCmdSteps = 0;
|
||||||
if (++player.newWalkCmdSteps > 50) {
|
if (++player.newWalkCmdSteps > 50) {
|
||||||
player.newWalkCmdSteps = 0;
|
player.newWalkCmdSteps = 0;
|
||||||
@@ -1891,7 +1895,7 @@ public class PlayerAssistant {
|
|||||||
for (int n = 0; n < player.newWalkCmdSteps; n++) {
|
for (int n = 0; n < player.newWalkCmdSteps; n++) {
|
||||||
player.getNewWalkCmdX()[n] += k;
|
player.getNewWalkCmdX()[n] += k;
|
||||||
player.getNewWalkCmdY()[n] += l;
|
player.getNewWalkCmdY()[n] += l;
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
public void stopDiagonal(int otherX, int otherY) {
|
public void stopDiagonal(int otherX, int otherY) {
|
||||||
|
|||||||
@@ -12,9 +12,9 @@ import com.rebotted.world.GlobalDropsHandler;
|
|||||||
|
|
||||||
public class PlayerHandler {
|
public class PlayerHandler {
|
||||||
|
|
||||||
public static Player players[] = new Player[GameConstants.MAX_PLAYERS];
|
public static Player[] players = new Player[GameConstants.MAX_PLAYERS];
|
||||||
public static int playerCount = 0, playerShopCount = 0;
|
public static int playerCount = 0, playerShopCount = 0;
|
||||||
public static String playersCurrentlyOn[] = new String[GameConstants.MAX_PLAYERS];
|
public static String[] playersCurrentlyOn = new String[GameConstants.MAX_PLAYERS];
|
||||||
public static boolean updateAnnounced;
|
public static boolean updateAnnounced;
|
||||||
public static boolean updateRunning;
|
public static boolean updateRunning;
|
||||||
public static int updateSeconds;
|
public static int updateSeconds;
|
||||||
@@ -74,19 +74,7 @@ public class PlayerHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getPlayerID(String playerName) {
|
|
||||||
for (int i = 0; i < PlayerHandler.players.length; i++) {
|
|
||||||
if (playersCurrentlyOn[i] != null) {
|
|
||||||
if (playersCurrentlyOn[i].equalsIgnoreCase(playerName)) {
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean isPlayerOn(String playerName) {
|
public static boolean isPlayerOn(String playerName) {
|
||||||
// synchronized (PlayerHandler.players) {
|
|
||||||
for (int i = 0; i < PlayerHandler.players.length; i++) {
|
for (int i = 0; i < PlayerHandler.players.length; i++) {
|
||||||
if (playersCurrentlyOn[i] != null) {
|
if (playersCurrentlyOn[i] != null) {
|
||||||
if (playersCurrentlyOn[i].equalsIgnoreCase(playerName)) {
|
if (playersCurrentlyOn[i].equalsIgnoreCase(playerName)) {
|
||||||
@@ -98,12 +86,11 @@ public class PlayerHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void process() {
|
public void process() {
|
||||||
// synchronized (PlayerHandler.players) {
|
|
||||||
updatePlayerNames();
|
updatePlayerNames();
|
||||||
if (kickAllPlayers) {
|
if (kickAllPlayers) {
|
||||||
for (int i = 0; i < PlayerHandler.players.length; i++) {
|
for (Player player : PlayerHandler.players) {
|
||||||
if (players[i] != null) {
|
if (player != null) {
|
||||||
players[i].disconnected = true;
|
player.disconnected = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (updateRunning) //If there's an update intended, and that's why we kicked everyone:
|
if (updateRunning) //If there's an update intended, and that's why we kicked everyone:
|
||||||
@@ -135,13 +122,11 @@ public class PlayerHandler {
|
|||||||
o.getTrading().declineTrade();
|
o.getTrading().declineTrade();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(GameEngine.trawler.players.contains(players[i])) {
|
GameEngine.trawler.players.remove(players[i]);
|
||||||
GameEngine.trawler.players.remove(players[i]);
|
|
||||||
}
|
|
||||||
players[i].lastX = players[i].absX;
|
players[i].lastX = players[i].absX;
|
||||||
players[i].lastY = players[i].absY;
|
players[i].lastY = players[i].absY;
|
||||||
players[i].lastH = players[i].heightLevel;
|
players[i].lastH = players[i].heightLevel;
|
||||||
if (players[i].hasNpc == true) {
|
if (players[i].hasNpc) {
|
||||||
t.getSummon().pickUpClean(t, players[i].summonId);
|
t.getSummon().pickUpClean(t, players[i].summonId);
|
||||||
}
|
}
|
||||||
if (players[i].duelStatus == 5) {
|
if (players[i].duelStatus == 5) {
|
||||||
@@ -206,13 +191,11 @@ public class PlayerHandler {
|
|||||||
o.getTrading().declineTrade();
|
o.getTrading().declineTrade();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(GameEngine.trawler.players.contains(players[i])) {
|
GameEngine.trawler.players.remove(players[i]);
|
||||||
GameEngine.trawler.players.remove(players[i]);
|
|
||||||
}
|
|
||||||
players[i].lastX = players[i].absX;
|
players[i].lastX = players[i].absX;
|
||||||
players[i].lastY = players[i].absY;
|
players[i].lastY = players[i].absY;
|
||||||
players[i].lastH = players[i].heightLevel;
|
players[i].lastH = players[i].heightLevel;
|
||||||
if (players[i].hasNpc == true) {
|
if (players[i].hasNpc) {
|
||||||
t.getSummon().pickUpClean(t, players[i].summonId);
|
t.getSummon().pickUpClean(t, players[i].summonId);
|
||||||
}
|
}
|
||||||
if (players[i].duelStatus == 5) {
|
if (players[i].duelStatus == 5) {
|
||||||
@@ -258,12 +241,12 @@ public class PlayerHandler {
|
|||||||
kickAllPlayers = true;
|
kickAllPlayers = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < PlayerHandler.players.length; i++) {
|
for (Player player : PlayerHandler.players) {
|
||||||
if (players[i] == null || !players[i].isActive) {
|
if (player == null || !player.isActive) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
players[i].clearUpdateFlags();
|
player.clearUpdateFlags();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -282,7 +265,7 @@ public class PlayerHandler {
|
|||||||
int size = plr.npcListSize;
|
int size = plr.npcListSize;
|
||||||
plr.npcListSize = 0;
|
plr.npcListSize = 0;
|
||||||
for (int i = 0; i < size; i++) {
|
for (int i = 0; i < size; i++) {
|
||||||
if (plr.rebuildNPCList == false && plr.withinDistance(plr.npcList[i]) == true) {
|
if (!plr.rebuildNPCList && plr.withinDistance(plr.npcList[i])) {
|
||||||
plr.npcList[i].updateNPCMovement(str);
|
plr.npcList[i].updateNPCMovement(str);
|
||||||
plr.npcList[i].appendNPCUpdateBlock(updateBlock);
|
plr.npcList[i].appendNPCUpdateBlock(updateBlock);
|
||||||
plr.npcList[plr.npcListSize++] = plr.npcList[i];
|
plr.npcList[plr.npcListSize++] = plr.npcList[i];
|
||||||
@@ -298,9 +281,9 @@ public class PlayerHandler {
|
|||||||
for (Npc i : NpcHandler.npcs) {
|
for (Npc i : NpcHandler.npcs) {
|
||||||
if (i != null) {
|
if (i != null) {
|
||||||
int id = i.npcId;
|
int id = i.npcId;
|
||||||
if (plr.rebuildNPCList == false
|
if (!plr.rebuildNPCList
|
||||||
&& (plr.npcInListBitmap[id >> 3] & 1 << (id & 7)) != 0) {
|
&& (plr.npcInListBitmap[id >> 3] & 1 << (id & 7)) != 0) {
|
||||||
} else if (plr.withinDistance(i) == false) {
|
} else if (!plr.withinDistance(i)) {
|
||||||
} else {
|
} else {
|
||||||
plr.addNewNPC(i, str, updateBlock);
|
plr.addNewNPC(i, str, updateBlock);
|
||||||
}
|
}
|
||||||
@@ -360,18 +343,18 @@ public class PlayerHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (int i = 0; i < PlayerHandler.players.length; i++) {
|
for (Player player : PlayerHandler.players) {
|
||||||
if (players[i] == null || !players[i].isActive || players[i] == plr) {
|
if (player == null || !player.isActive || player == plr) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int id = players[i].playerId;
|
int id = player.playerId;
|
||||||
if ((plr.playerInListBitmap[id >> 3] & 1 << (id & 7)) != 0) {
|
if ((plr.playerInListBitmap[id >> 3] & 1 << (id & 7)) != 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!plr.withinDistance(players[i])) {
|
if (!plr.withinDistance(player)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
plr.addNewPlayer(players[i], outStr, updateBlock);
|
plr.addNewPlayer(player, outStr, updateBlock);
|
||||||
}
|
}
|
||||||
if (outStr != null) {
|
if (outStr != null) {
|
||||||
if (updateBlock.currentOffset > 0) {
|
if (updateBlock.currentOffset > 0) {
|
||||||
@@ -386,7 +369,7 @@ public class PlayerHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (plr.refresh) {
|
if (plr.refresh) {
|
||||||
GlobalDropsHandler.reset((Client)plr);
|
GlobalDropsHandler.reset(plr);
|
||||||
plr.refresh = false;
|
plr.refresh = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -394,7 +377,7 @@ public class PlayerHandler {
|
|||||||
private void removePlayer(Player plr) {
|
private void removePlayer(Player plr) {
|
||||||
if (plr.privateChat != 2) {
|
if (plr.privateChat != 2) {
|
||||||
for (int i = 1; i < PlayerHandler.players.length; i++) {
|
for (int i = 1; i < PlayerHandler.players.length; i++) {
|
||||||
if (players[i] == null || players[i].isActive == false) {
|
if (players[i] == null || !players[i].isActive) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Client o = (Client) PlayerHandler.players[i];
|
Client o = (Client) PlayerHandler.players[i];
|
||||||
|
|||||||
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.
Reference in New Issue
Block a user