fixup close shop, re-open shop

This commit is contained in:
RedSparr0w
2019-11-23 14:01:42 +13:00
parent a1ff2458f1
commit 3a4895590e
2 changed files with 18 additions and 8 deletions
@@ -1,5 +1,6 @@
package redone.game.bots; package redone.game.bots;
import io.netty.util.Timeout;
import redone.Constants; import redone.Constants;
import redone.game.players.Client; import redone.game.players.Client;
import redone.game.players.PlayerHandler; import redone.game.players.PlayerHandler;
@@ -105,6 +106,10 @@ public class BotHandler
public static void closeShop(Client player) { public static void closeShop(Client player) {
Client shop = getPlayerShop(player); Client shop = getPlayerShop(player);
if (shop == null) return; if (shop == null) return;
shop.getPlayerAssistant().movePlayer(0,0,0);
new Thread(() -> {
try {
Thread.sleep(500);
shop.disconnected = true; shop.disconnected = true;
shop.logout(true); shop.logout(true);
for (int index = 0; index < botList.size(); index++){ for (int index = 0; index < botList.size(); index++){
@@ -115,6 +120,11 @@ public class BotHandler
index++; index++;
} }
} }
catch (Exception e){
System.err.println(e);
}
}).start();
}
public static void addCoins(int shop_id, int amount){ public static void addCoins(int shop_id, int amount){
Client shop = getPlayerShop(shop_id); Client shop = getPlayerShop(shop_id);