mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
Making the course limits change when a new xml packet is received..
#story[889]
This commit is contained in:
@@ -31,6 +31,7 @@ public class StreamParser extends Thread{
|
||||
public static ConcurrentHashMap<Long, PriorityBlockingQueue<BoatPositionPacket>> boatPositions = new ConcurrentHashMap<>();
|
||||
private String threadName;
|
||||
private Thread t;
|
||||
private static boolean newXmlRecieved = false;
|
||||
private static boolean raceStarted = false;
|
||||
private static XMLParser xmlObject;
|
||||
private static boolean raceFinished = false;
|
||||
@@ -122,6 +123,8 @@ public class StreamParser extends Thread{
|
||||
extractDisplayMessage(packet);
|
||||
break;
|
||||
case XML_MESSAGE:
|
||||
System.out.println("XML MESSAGE GOT");
|
||||
newXmlRecieved = true;
|
||||
extractXmlMessage(packet);
|
||||
break;
|
||||
case RACE_START_STATUS:
|
||||
@@ -313,6 +316,9 @@ public class StreamParser extends Thread{
|
||||
if (messageType == 7) { //7 is the boat XML
|
||||
boats = xmlObject.getBoatXML().getCompetingBoats();
|
||||
}
|
||||
if (messageType == 6) { //6 is race info xml
|
||||
newXmlRecieved = true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -579,5 +585,14 @@ public class StreamParser extends Thread{
|
||||
appRunning = false;
|
||||
System.out.println("[CLIENT] Shutting down stream parser");
|
||||
}
|
||||
|
||||
public static boolean isNewXmlRecieved(){
|
||||
if (newXmlRecieved){
|
||||
newXmlRecieved = false;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user