当前成功落下时才下

main
dai_48k 2024-01-24 16:22:38 +08:00
parent 45dfc21713
commit 429f53c7bb
1 changed files with 11 additions and 9 deletions

View File

@ -61,16 +61,18 @@ public class UserThread extends Thread{
NewClick newClick = (NewClick) o; NewClick newClick = (NewClick) o;
if (newClick.color == (cur.get() ? Cross.BLACK : Cross.WHITE) && newClick.color == self){ if (newClick.color == (cur.get() ? Cross.BLACK : Cross.WHITE) && newClick.color == self){
CalDataUtil.draw(newClick, map); boolean result = CalDataUtil.draw(newClick, map);
cur.set(!cur.get()); if (result) {
cur.set(!cur.get());
users.forEach(u -> { users.forEach(u -> {
try { try {
if (u.isAlive) u.sendMsg(DataUtil.parseData(map, newClick)); if (u.isAlive) u.sendMsg(DataUtil.parseData(map, newClick));
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
}); });
}
} }
} catch (Exception e){ } catch (Exception e){
System.out.println("::" + e.getMessage()); System.out.println("::" + e.getMessage());