mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 06:18:44 +00:00
Fixed race timer & Added boats to team position list
- Race status messages are sent at regular intervals instead of once at race start - Boat positions are initialised on the Team Position list - Timer counts up from when host clicks ready Tags: #story[377]
This commit is contained in:
@@ -11,7 +11,10 @@ import java.io.IOException;
|
||||
import java.net.ServerSocket;
|
||||
import java.net.Socket;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
import java.util.concurrent.PriorityBlockingQueue;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
* A class describing the overall server, which creates and collects server threads for each client
|
||||
@@ -133,8 +136,16 @@ public class MainServerThread extends Observable implements Runnable, ClientConn
|
||||
}
|
||||
|
||||
public void startGame() {
|
||||
for (ServerToClientThread serverToClientThread : serverToClientThreads) {
|
||||
serverToClientThread.sendRaceStatusMessage();
|
||||
}
|
||||
Timer t = new Timer();
|
||||
|
||||
t.schedule(new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
for (ServerToClientThread serverToClientThread : serverToClientThreads) {
|
||||
serverToClientThread.sendRaceStatusMessage();
|
||||
}
|
||||
}
|
||||
}, 0, 500);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user