mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 06:18:44 +00:00
Fixed the parsing of bytes being off by one byte in the stream parser fr the race status packet.
#story[924] #pair[kre39,zyt10]
This commit is contained in:
@@ -62,7 +62,9 @@ public class App extends Application
|
||||
}
|
||||
//Change the StreamReceiver in this else block to change the default data source.
|
||||
else{
|
||||
sr = new StreamReceiver("localhost", 4949, "RaceStream");
|
||||
sr = new StreamReceiver("livedata.americascup.com", 4941, "RaceStream");
|
||||
|
||||
// sr = new StreamReceiver("localhost", 4949, "RaceStream");
|
||||
}
|
||||
|
||||
sr.start();
|
||||
|
||||
@@ -114,10 +114,10 @@ public class Yacht {
|
||||
this.penaltiesServed = penaltiesServed;
|
||||
}
|
||||
|
||||
public Long getEstimateTimeAtNextMark() {
|
||||
// DateFormat format = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
|
||||
// return format.format(estimateTimeAtNextMark);
|
||||
return estimateTimeAtNextMark;
|
||||
public String getEstimateTimeAtNextMark() {
|
||||
DateFormat format = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
|
||||
return format.format(estimateTimeAtNextMark);
|
||||
// return estimateTimeAtNextMark;
|
||||
}
|
||||
|
||||
public void setEstimateTimeAtNextMark(Long estimateTimeAtNextMark) {
|
||||
|
||||
@@ -236,11 +236,11 @@ public class StreamParser extends Thread{
|
||||
Yacht boat = boats.get((int)(long) boatStatusSourceID);
|
||||
boat.setBoatStatus((int)payload[28 + (i * 20)]);
|
||||
boat.setLegNumber((int)payload[29 + (i * 20)]);
|
||||
boat.setPenaltiesAwarded((int)payload[29 + (i * 20)]);
|
||||
boat.setPenaltiesServed((int)payload[30 + (i * 20)]);
|
||||
Long estTimeAtNextMark = bytesToLong(Arrays.copyOfRange(payload,31 + (i * 20),37+ (i * 20)));
|
||||
boat.setPenaltiesAwarded((int)payload[30 + (i * 20)]);
|
||||
boat.setPenaltiesServed((int)payload[31 + (i * 20)]);
|
||||
Long estTimeAtNextMark = bytesToLong(Arrays.copyOfRange(payload,32 + (i * 20),38+ (i * 20)));
|
||||
boat.setEstimateTimeAtNextMark(estTimeAtNextMark);
|
||||
Long estTimeAtFinish = bytesToLong(Arrays.copyOfRange(payload,37 + (i * 20),43+ (i * 20)));
|
||||
Long estTimeAtFinish = bytesToLong(Arrays.copyOfRange(payload,38 + (i * 20),44+ (i * 20)));
|
||||
boat.setEstimateTimeAtFinish(estTimeAtFinish);
|
||||
boatsPos.put(estTimeAtFinish, boat);
|
||||
// String boatStatus = "SourceID: " + boatStatusSourceID;
|
||||
|
||||
Reference in New Issue
Block a user