Getting fuzzyyy. Added LLIST server response. cannot continue.
This commit is contained in:
parent
e9cade1528
commit
7df07b490a
@ -5,6 +5,7 @@ import ch.unibas.dmi.dbis.cs108.multiplayer.helpers.ClientPinger;
|
|||||||
|
|
||||||
|
|
||||||
import ch.unibas.dmi.dbis.cs108.multiplayer.helpers.Protocol;
|
import ch.unibas.dmi.dbis.cs108.multiplayer.helpers.Protocol;
|
||||||
|
import ch.unibas.dmi.dbis.cs108.sebaschi.CentralClientData;
|
||||||
import java.net.Socket;
|
import java.net.Socket;
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.net.UnknownHostException;
|
import java.net.UnknownHostException;
|
||||||
@ -23,6 +24,8 @@ public class Client {
|
|||||||
private BufferedWriter out;
|
private BufferedWriter out;
|
||||||
public ClientPinger clientPinger;
|
public ClientPinger clientPinger;
|
||||||
|
|
||||||
|
private CentralClientData data;
|
||||||
|
|
||||||
public Client(Socket socket) {
|
public Client(Socket socket) {
|
||||||
try {
|
try {
|
||||||
this.socket = socket;
|
this.socket = socket;
|
||||||
@ -177,6 +180,10 @@ public class Client {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CentralClientData getData(){
|
||||||
|
return this.data;
|
||||||
|
}
|
||||||
|
|
||||||
public Socket getSocket() {
|
public Socket getSocket() {
|
||||||
return socket;
|
return socket;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -50,6 +50,7 @@ public class JClientProtocolParser {
|
|||||||
System.out.println("Human received Vote request");
|
System.out.println("Human received Vote request");
|
||||||
//TODO(Seraina): How can be enforced, that clients won't vote otherwise? Trigger a methode here that listens to input
|
//TODO(Seraina): How can be enforced, that clients won't vote otherwise? Trigger a methode here that listens to input
|
||||||
break;
|
break;
|
||||||
|
case Protocol.serverDeliversLobbyList:
|
||||||
default:
|
default:
|
||||||
System.out.println("Received unknown command");
|
System.out.println("Received unknown command");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -100,5 +100,10 @@ public class Protocol {
|
|||||||
*/
|
*/
|
||||||
public static final String serverRequestsHumanVote = "HVOTR";
|
public static final String serverRequestsHumanVote = "HVOTR";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* todo: doch
|
||||||
|
*/
|
||||||
|
public static final String serverDeliversLobbyList = "LLIST";
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,6 +29,8 @@ Implemented:
|
|||||||
* SPING Ping from server to client
|
* SPING Ping from server to client
|
||||||
* PINGB Pingback from client to server.
|
* PINGB Pingback from client to server.
|
||||||
* QUITC Confirms to the client that they are being disconnected from the server.
|
* QUITC Confirms to the client that they are being disconnected from the server.
|
||||||
|
* LLIST$LobbyIDAndAdmin
|
||||||
|
Response to LISTL. Parameter is a string.
|
||||||
|
|
||||||
Future / planned:
|
Future / planned:
|
||||||
* MSGRS "Message received": Paramaters: a string detailing to the client that and what the server received as command.
|
* MSGRS "Message received": Paramaters: a string detailing to the client that and what the server received as command.
|
||||||
|
|||||||
@ -0,0 +1,10 @@
|
|||||||
|
package ch.unibas.dmi.dbis.cs108.sebaschi;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Each Clients copy of data. In principle it is CentralServerData.
|
||||||
|
* The Client must update himself.
|
||||||
|
*/
|
||||||
|
public class CentralClientData extends CentralServerData{
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user