mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
Fixed develop merge and now collision works
This commit is contained in:
@@ -146,8 +146,6 @@ public class MainServerThread extends Observable implements Runnable, ClientConn
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
serverToClientThreads.remove(closedConnection);
|
serverToClientThreads.remove(closedConnection);
|
||||||
setChanged();
|
|
||||||
notifyObservers("send setup message");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void startGame() {
|
public void startGame() {
|
||||||
|
|||||||
@@ -37,13 +37,6 @@ import seng302.gameServer.server.messages.RegistrationResponseMessage;
|
|||||||
import seng302.gameServer.server.messages.RegistrationResponseStatus;
|
import seng302.gameServer.server.messages.RegistrationResponseStatus;
|
||||||
import seng302.gameServer.server.messages.XMLMessage;
|
import seng302.gameServer.server.messages.XMLMessage;
|
||||||
import seng302.gameServer.server.messages.XMLMessageSubType;
|
import seng302.gameServer.server.messages.XMLMessageSubType;
|
||||||
import seng302.model.Player;
|
|
||||||
import seng302.model.Yacht;
|
|
||||||
import seng302.model.stream.packets.PacketType;
|
|
||||||
import seng302.model.stream.packets.StreamPacket;
|
|
||||||
import seng302.model.stream.xml.generator.Race;
|
|
||||||
import seng302.model.stream.xml.generator.Regatta;
|
|
||||||
import seng302.utilities.XMLGenerator;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A class describing a single connection to a Client for the purposes of sending and receiving on
|
* A class describing a single connection to a Client for the purposes of sending and receiving on
|
||||||
@@ -121,23 +114,11 @@ public class ServerToClientThread implements Runnable {
|
|||||||
"/server_config/CSV_Database_of_Last_Names.csv"
|
"/server_config/CSV_Database_of_Last_Names.csv"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
|
||||||
all = ln.lines().collect(Collectors.toList());
|
|
||||||
lName = all.get(ThreadLocalRandom.current().nextInt(0, all.size()));
|
|
||||||
} catch (IOException e) {
|
|
||||||
serverLog("IO error in server thread upon grabbing streams", 1);
|
|
||||||
}
|
|
||||||
//Attempt threeway handshake with connection
|
|
||||||
sourceId = GameState.getUniquePlayerID();
|
|
||||||
if (threeWayHandshake(sourceId)) {
|
|
||||||
serverLog("Successful handshake. Client allocated id: " + sourceId, 0);
|
|
||||||
yacht = new Yacht(
|
|
||||||
);
|
);
|
||||||
all = ln.lines().collect(Collectors.toList());
|
all = ln.lines().collect(Collectors.toList());
|
||||||
lName = all.get(ThreadLocalRandom.current().nextInt(0, all.size()));
|
lName = all.get(ThreadLocalRandom.current().nextInt(0, all.size()));
|
||||||
|
|
||||||
|
yacht = new Yacht(
|
||||||
Yacht yacht = new Yacht(
|
|
||||||
"Yacht", sourceId, sourceId.toString(), fName, fName + " " + lName, "NZ"
|
"Yacht", sourceId, sourceId.toString(), fName, fName + " " + lName, "NZ"
|
||||||
);
|
);
|
||||||
GameState.addYacht(sourceId, yacht);
|
GameState.addYacht(sourceId, yacht);
|
||||||
@@ -151,13 +132,6 @@ public class ServerToClientThread implements Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void update(Observable o, Object arg) {
|
|
||||||
if (arg.equals("send setup message")) {
|
|
||||||
sendSetupMessages();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void completeRegistration(ClientType clientType) throws IOException {
|
private void completeRegistration(ClientType clientType) throws IOException {
|
||||||
// Fail if not a player
|
// Fail if not a player
|
||||||
if (!clientType.equals(ClientType.PLAYER)){
|
if (!clientType.equals(ClientType.PLAYER)){
|
||||||
|
|||||||
@@ -623,7 +623,6 @@ public class GameView extends Pane {
|
|||||||
timer.start();
|
timer.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setBoatAsPlayer(Yacht playerYacht) {
|
|
||||||
public Yacht getPlayerYacht() {
|
public Yacht getPlayerYacht() {
|
||||||
return playerYacht;
|
return playerYacht;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user