private void checkForAnnouncement() { try { int clientAnnouncement = Integer.parseInt(announcementId); int latestAnnouncement = Integer.parseInt(announcementCode); if (clientAnnouncement < latestAnnouncement || latestAnnouncement == -1) { hasAnnouncement = true; if (latestAnnouncement != -1) { NavalBattleIO.saveAttribute("announcementId", announcementCode); } } else { NavalBattle.getDebugWindow().printInfo("No new announcements!"); } } catch (Exception e) { } }
public BroadcastService() { announcementId = NavalBattleIO.getAttribute("announcementId"); broadcastThread = new BroadcastThread(); broadcastThread.run(); }