mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
Host also can be it's own client.
The host can connect to itself to become a client, packets are also sending from the host to client, update method should be ready to fully implemented. Added chatter packets to packet types to be used mostly for testing but can be further implemented for proper use in the future. #story[1055]
This commit is contained in:
@@ -58,9 +58,10 @@ public class MainServerThread extends Thread implements PacketBufferDelegate, Cl
|
||||
}
|
||||
|
||||
|
||||
|
||||
//RACING
|
||||
if (GameState.getCurrentStage() == GameStages.RACING) {
|
||||
|
||||
updateClients();
|
||||
}
|
||||
|
||||
|
||||
@@ -68,9 +69,9 @@ public class MainServerThread extends Thread implements PacketBufferDelegate, Cl
|
||||
else if (GameState.getCurrentStage() == GameStages.FINISHED) {
|
||||
|
||||
}
|
||||
|
||||
updateClients();
|
||||
|
||||
|
||||
while (!packetBuffer.isEmpty()){
|
||||
System.out.println("WHATUPPP");
|
||||
try {
|
||||
@@ -114,6 +115,13 @@ public class MainServerThread extends Thread implements PacketBufferDelegate, Cl
|
||||
return packetBuffer.add(streamPacket);
|
||||
}
|
||||
|
||||
private void initializeRace(){
|
||||
for (ServerToClientThread serverToClientThread : serverToClientThreads) {
|
||||
serverToClientThread.updateClient();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* A client has tried to connect to the server
|
||||
* @param serverToClientThread The player that connected
|
||||
|
||||
Reference in New Issue
Block a user