mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-03 00:31:51 +00:00
Add close shop command
This commit is contained in:
@@ -102,6 +102,13 @@ public class BotHandler
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void closeShop(Client player){
|
||||
Client shop = getPlayerShop(player);
|
||||
if (shop == null) return;
|
||||
shop.disconnected = true;
|
||||
shop.logout(true);
|
||||
}
|
||||
|
||||
public static void addCoins(int shop_id, int amount){
|
||||
Client shop = getPlayerShop(shop_id);
|
||||
if (shop == null) return;
|
||||
|
||||
@@ -820,7 +820,8 @@ public class Client extends Player {
|
||||
getSummon().pickUpClean(this, summonId);
|
||||
}
|
||||
if (forceLogout || System.currentTimeMillis() - logoutDelay > 2500) {
|
||||
outStream.createFrame(109);
|
||||
if (!isBot)
|
||||
outStream.createFrame(109);
|
||||
properLogout = true;
|
||||
} else {
|
||||
getActionSender().sendMessage("You must wait a few seconds from being out of combat to logout.");
|
||||
|
||||
@@ -34,8 +34,7 @@ public class ConnectionHandler implements IoHandler {
|
||||
public void sessionClosed(IoSession arg0) throws Exception {
|
||||
if (arg0.getAttachment() != null) {
|
||||
Client plr = (Client) arg0.getAttachment();
|
||||
if (!plr.isBot)
|
||||
plr.disconnected = true;
|
||||
plr.disconnected = true;
|
||||
}
|
||||
HostList.getHostList().remove(arg0);
|
||||
}
|
||||
|
||||
@@ -96,9 +96,14 @@ public class Commands implements PacketType {
|
||||
case "shop":
|
||||
BotHandler.playerShop(player);
|
||||
break;
|
||||
case "withdrawshop":
|
||||
case "wshop":
|
||||
BotHandler.takeCoins(player);
|
||||
break;
|
||||
case "closeshop":
|
||||
case "cshop":
|
||||
BotHandler.closeShop(player);
|
||||
break;
|
||||
case "wealth":
|
||||
int totalWealth = player.getPlayerAssistant().totalGold();
|
||||
player.getActionSender().sendMessage("You currently have " + totalWealth + "gp.");
|
||||
@@ -137,7 +142,7 @@ public class Commands implements PacketType {
|
||||
player.getPlayerAssistant().closeAllWindows();
|
||||
break;
|
||||
case "commands":
|
||||
player.getActionSender().sendMessage("::players, ::highscores, ::loc, ::stuck, ::randomtoggle, ::debug, ::togglegfx, ::shop, ::wshop");
|
||||
player.getActionSender().sendMessage("::players, ::highscores, ::loc, ::stuck, ::randomtoggle, ::debug, ::togglegfx, ::shop, ::withdrawshop, ::closeshop");
|
||||
break;
|
||||
case "loc":
|
||||
player.getActionSender().sendMessage(player.absX + "," + player.absY);
|
||||
|
||||
@@ -15,7 +15,6 @@ public class IdleLogout implements PacketType {
|
||||
return;
|
||||
} else {
|
||||
player.logout();
|
||||
//Misc.println(player.playerName + " is idle, kicked.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user