diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/BudaClientServerStuff/BudaClient.java b/src/main/java/ch/unibas/dmi/dbis/cs108/BudaClientServerStuff/BudaClient.java deleted file mode 100644 index 5eba931..0000000 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/BudaClientServerStuff/BudaClient.java +++ /dev/null @@ -1,30 +0,0 @@ -package ch.unibas.dmi.dbis.cs108.BudaClientServerStuff; - -import java.io.*; -import java.net.Socket; - -public class BudaClient { - public static void main(String[] args) { - Socket sock = null; - try { - sock = new Socket("localhost", 8090); - OutputStream out= sock.getOutputStream(); - BufferedReader conin = new BufferedReader(new InputStreamReader(System.in)); - String line = ""; //this String is the line that will be sent to the server - while (true) { - line = conin.readLine(); - out.write(line.getBytes()); - if (line.equalsIgnoreCase("Quitx")) { - break; - } - //line.startsWith() //todo: automatically handle name lengths - //TODO: Implement inputStream in. - } - - - } catch (IOException e) { - e.printStackTrace(); - } - } - -} diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/BudaClientServerStuff/BudaClientThread.java b/src/main/java/ch/unibas/dmi/dbis/cs108/BudaClientServerStuff/BudaClientThread.java deleted file mode 100644 index ac774c1..0000000 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/BudaClientServerStuff/BudaClientThread.java +++ /dev/null @@ -1,66 +0,0 @@ -package ch.unibas.dmi.dbis.cs108.BudaClientServerStuff; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.Socket; - -public class BudaClientThread implements Runnable { - int number; - Socket socket; - String name; - - - public BudaClientThread(int number, Socket socket) { - this.number = number; - this.socket = socket; - name = ""; - } - - public void run() { - System.out.println("Connection " + number + " established."); - try { - InputStream in = socket.getInputStream(); - OutputStream out = socket.getOutputStream(); - byte[] command; - String comString; - while (true) { - command = new byte[5]; - in.read(command); //BudaClientThread waits to receive a line from the inputstream. - comString = new String(command); - if (comString.equalsIgnoreCase("Quitx")) { //todo: do as switch. - BudaServer.quit = true; - System.out.println("I just set quit to true!"); - break; - } else if (comString.equalsIgnoreCase("NAME:")) { - setName(in); - } else if (comString.equalsIgnoreCase("NAMES")) { - printnames(); - } else { - System.out.println("Client number " + number + " sent this message: \"" + comString + "\" and I'm not sure what it means."); - } - } - } catch (IOException e) { - e.printStackTrace(); - } - } - - public void printnames() { - for (BudaClientThread t: BudaServer.Clients) { - System.out.println("user named "+ t.name + " is connected (#" + t.number + ")"); - } - } - - public void setName(InputStream in) throws IOException { - String nameString = ""; - int i; - while (true) { - i = in.read(); - if (i == 46) break; //the name ends with a "." - nameString = nameString + (char) i; - } - this.name = nameString; - System.out.println("Client number " + number + " changed their name to: " + nameString); - } - -} diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/BudaClientServerStuff/BudaServer.java b/src/main/java/ch/unibas/dmi/dbis/cs108/BudaClientServerStuff/BudaServer.java deleted file mode 100644 index d9e8b8d..0000000 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/BudaClientServerStuff/BudaServer.java +++ /dev/null @@ -1,24 +0,0 @@ -package ch.unibas.dmi.dbis.cs108.BudaClientServerStuff; - -import java.io.IOException; -import java.net.ServerSocket; -import java.net.Socket; -import java.util.HashSet; - -public class BudaServer { - public static boolean quit = false; //todo: meaningfully implement this - public static HashSet Clients = new HashSet(); - static int connections = 0; - - public static void main(String[] args) { - ServerConnector ServC = new ServerConnector(); - Thread ServCThread = new Thread(ServC); - ServCThread.start(); //the ServCThread listens for new connections so the server can do other things - while (!quit) { - //Main server stuff goes here - } - //ServCThread.stop(); //todo: find some alternative for this. - System.out.println("stopping the main BudaServer thread."); - System.out.println("Quitting after the next connection is made."); - } -} diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/BudaClientServerStuff/ClientListener.java b/src/main/java/ch/unibas/dmi/dbis/cs108/BudaClientServerStuff/ClientListener.java deleted file mode 100644 index 6fe4639..0000000 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/BudaClientServerStuff/ClientListener.java +++ /dev/null @@ -1,25 +0,0 @@ -import java.io.*; -import java.net.Socket; - -public class ClientListener implements Runnable{ - private final Socket sock; - - public ClientListener(Socket sock) { - this.sock = sock; - } - - public void run(){ - byte[] command = new byte[5]; - String comString; - - try { - InputStream in = sock.getInputStream(); - in.read(command); - System.out.println("Got a line!"); - comString = new String(command); - } catch (IOException e) { - e.printStackTrace(); - - } - } -} diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/BudaClientServerStuff/README.txt b/src/main/java/ch/unibas/dmi/dbis/cs108/BudaClientServerStuff/README.txt deleted file mode 100644 index 7b0648a..0000000 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/BudaClientServerStuff/README.txt +++ /dev/null @@ -1,14 +0,0 @@ -This is a demo of some (basic) client / server functionality. -Run BudaClient.java for the Client and BudaServer.java for the Server. Everything connects locally via port 8090 - -The client reads from the console input and sends that to the server. The Server generally reads messages in five characters (so a text-based protocol could be based on commands of five characters). - -The server can connect to an arbitrary number of clients. - -Type "Name:Jonas B." to change the client's name to Jonas B (the "." is where the name stops). - -Type "Names" for the Server to display everyone who is connected along with their name (if they have set a name). - -Typing "Quitx" should quit everything but I havent quite managed to implement that yet so just repeatedly use ctrl+c to quit everything. - --Jonas \ No newline at end of file diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/BudaClientServerStuff/ServerConnector.java b/src/main/java/ch/unibas/dmi/dbis/cs108/BudaClientServerStuff/ServerConnector.java deleted file mode 100644 index 9965650..0000000 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/BudaClientServerStuff/ServerConnector.java +++ /dev/null @@ -1,29 +0,0 @@ -package ch.unibas.dmi.dbis.cs108.BudaClientServerStuff; - -import java.io.IOException; -import java.net.ServerSocket; -import java.net.Socket; - -public class ServerConnector implements Runnable{ - public void run() { - try { - System.out.println( - "Warte auf Verbindungen auf Port 8090..."); - ServerSocket servSock = new ServerSocket(8090); - while (true) { - Socket socket = servSock.accept(); - System.out.println("got a connection: socket " + BudaServer.connections + socket.toString()); - BudaClientThread newClientThread = new BudaClientThread(++BudaServer.connections, socket); - BudaServer.Clients.add(newClientThread); - Thread bCT = new Thread(newClientThread); - bCT.start(); - } - } catch (IOException e) { - System.out.println("server got an error"); - System.err.println(e); - System.exit(1); - } - - - } -} diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/Klassenstruktur/Ghost.java b/src/main/java/ch/unibas/dmi/dbis/cs108/Klassenstruktur/Ghost.java index 9e5fc16..45b5f2d 100644 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/Klassenstruktur/Ghost.java +++ b/src/main/java/ch/unibas/dmi/dbis/cs108/Klassenstruktur/Ghost.java @@ -1,9 +1,10 @@ package ch.unibas.dmi.dbis.cs108.Klassenstruktur; public class Ghost extends Passenger { - protected boolean isOG; //true if the Ghost is the original ghost. - public boolean getIsOG() { - return isOG; - } + protected boolean isOG; //true if the Ghost is the original ghost. + + public boolean getIsOG() { + return isOG; + } } diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/Klassenstruktur/GhostNPC.java b/src/main/java/ch/unibas/dmi/dbis/cs108/Klassenstruktur/GhostNPC.java index 18ca04c..58b014e 100644 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/Klassenstruktur/GhostNPC.java +++ b/src/main/java/ch/unibas/dmi/dbis/cs108/Klassenstruktur/GhostNPC.java @@ -1,22 +1,25 @@ package ch.unibas.dmi.dbis.cs108.Klassenstruktur; -public class GhostNPC extends Ghost{ +public class GhostNPC extends Ghost { - /** - * Creates a new GhostNPC. Should be used at game start or if a HumanNPC is turned into a ghost. - * @param position position on the train - * @param name player name. if null, then a default name is used. - * @param isOG true if the ghost is the original ghost. - */ - public GhostNPC(int position, String name, boolean isOG) { - this.isOG = isOG; - this.position = position; - this.clientHandler = null; - isGhost = true; - isPlayer = false; - kickedOff = false; - if (name == null) { - this.name = "Robot Nr. " + position; - } else this.name = name; - } + /** + * Creates a new GhostNPC. Should be used at game start or if a HumanNPC is turned into a ghost. + * + * @param position position on the train + * @param name player name. if null, then a default name is used. + * @param isOG true if the ghost is the original ghost. + */ + public GhostNPC(int position, String name, boolean isOG) { + this.isOG = isOG; + this.position = position; + this.clientHandler = null; + isGhost = true; + isPlayer = false; + kickedOff = false; + if (name == null) { + this.name = "Robot Nr. " + position; + } else { + this.name = name; + } + } } diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/Klassenstruktur/GhostPlayer.java b/src/main/java/ch/unibas/dmi/dbis/cs108/Klassenstruktur/GhostPlayer.java index 3e61bf9..24657c8 100644 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/Klassenstruktur/GhostPlayer.java +++ b/src/main/java/ch/unibas/dmi/dbis/cs108/Klassenstruktur/GhostPlayer.java @@ -2,28 +2,32 @@ package ch.unibas.dmi.dbis.cs108.Klassenstruktur; import ch.unibas.dmi.dbis.cs108.multiplayer.server.ClientHandler; -public class GhostPlayer extends Ghost{ +public class GhostPlayer extends Ghost { - /** - * Creates a new GhostPlayer. Should be used at game start or if a HumanPlayer is turned into a ghost. - * @param position position on the train - * @param name name. if null, then a default name is used. - * @param isOG true if the ghost is the original ghost. - */ - public GhostPlayer(int position, String name, ClientHandler clientHandler, boolean isOG) { - this.position = position; - this.clientHandler = clientHandler; - this.isOG = isOG; - isGhost = true; - isPlayer = true; - kickedOff = false; - if (name == null) { - this.name = "Player Nr. " + position; - } else this.name = name; + /** + * Creates a new GhostPlayer. Should be used at game start or if a HumanPlayer is turned into a + * ghost. + * + * @param position position on the train + * @param name name. if null, then a default name is used. + * @param isOG true if the ghost is the original ghost. + */ + public GhostPlayer(int position, String name, ClientHandler clientHandler, boolean isOG) { + this.position = position; + this.clientHandler = clientHandler; + this.isOG = isOG; + isGhost = true; + isPlayer = true; + kickedOff = false; + if (name == null) { + this.name = "Player Nr. " + position; + } else { + this.name = name; } + } - public void send(String msg) { - //todo(Jonas): pass message along to client. - } + public void send(String msg) { + //todo(Jonas): pass message along to client. + } } diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/Klassenstruktur/Human.java b/src/main/java/ch/unibas/dmi/dbis/cs108/Klassenstruktur/Human.java index eeda085..e3cd48c 100644 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/Klassenstruktur/Human.java +++ b/src/main/java/ch/unibas/dmi/dbis/cs108/Klassenstruktur/Human.java @@ -1,4 +1,5 @@ package ch.unibas.dmi.dbis.cs108.Klassenstruktur; public class Human extends Passenger { + } diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/Klassenstruktur/HumanNPC.java b/src/main/java/ch/unibas/dmi/dbis/cs108/Klassenstruktur/HumanNPC.java index ad593f7..7b789a6 100644 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/Klassenstruktur/HumanNPC.java +++ b/src/main/java/ch/unibas/dmi/dbis/cs108/Klassenstruktur/HumanNPC.java @@ -1,20 +1,23 @@ package ch.unibas.dmi.dbis.cs108.Klassenstruktur; public class HumanNPC extends Human { - /** - * Creates a new HumanNPC. - * @param position position on the train - * @param name player name. if null, then a default name is used. - * - */ - public HumanNPC(int position, String name) { - this.position = position; - this.clientHandler = null; - isGhost = false; - isPlayer = false; - kickedOff = false; - if (name == null) { - this.name = "Robot Nr. " + position; - } else this.name = name; + + /** + * Creates a new HumanNPC. + * + * @param position position on the train + * @param name player name. if null, then a default name is used. + */ + public HumanNPC(int position, String name) { + this.position = position; + this.clientHandler = null; + isGhost = false; + isPlayer = false; + kickedOff = false; + if (name == null) { + this.name = "Robot Nr. " + position; + } else { + this.name = name; } + } } diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/Klassenstruktur/HumanPlayer.java b/src/main/java/ch/unibas/dmi/dbis/cs108/Klassenstruktur/HumanPlayer.java index 934e760..7a41a22 100644 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/Klassenstruktur/HumanPlayer.java +++ b/src/main/java/ch/unibas/dmi/dbis/cs108/Klassenstruktur/HumanPlayer.java @@ -2,22 +2,27 @@ package ch.unibas.dmi.dbis.cs108.Klassenstruktur; import ch.unibas.dmi.dbis.cs108.multiplayer.server.ClientHandler; -public class HumanPlayer extends Human{ - /** - * Creates a new GhostPlayer. Should be used at game start or if a HumanPlayer is turned into a ghost. - * @param position position on the train - * @param name name. if null, then a default name is used. - */ - public HumanPlayer(int position, String name, ClientHandler clientHandler, boolean isOG) { - this.position = position; - this.clientHandler = clientHandler; - isGhost = false; - isPlayer = true; - kickedOff = false; - if (name == null) { - this.name = "Player Nr. " + position; - } else this.name = name; +public class HumanPlayer extends Human { + + /** + * Creates a new GhostPlayer. Should be used at game start or if a HumanPlayer is turned into a + * ghost. + * + * @param position position on the train + * @param name name. if null, then a default name is used. + */ + public HumanPlayer(int position, String name, ClientHandler clientHandler, boolean isOG) { + this.position = position; + this.clientHandler = clientHandler; + isGhost = false; + isPlayer = true; + kickedOff = false; + if (name == null) { + this.name = "Player Nr. " + position; + } else { + this.name = name; } + } } diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/Klassenstruktur/Passenger.java b/src/main/java/ch/unibas/dmi/dbis/cs108/Klassenstruktur/Passenger.java index 373f171..b8dd656 100644 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/Klassenstruktur/Passenger.java +++ b/src/main/java/ch/unibas/dmi/dbis/cs108/Klassenstruktur/Passenger.java @@ -3,67 +3,72 @@ package ch.unibas.dmi.dbis.cs108.Klassenstruktur; import ch.unibas.dmi.dbis.cs108.multiplayer.server.ClientHandler; public class Passenger { - protected int position; //the player's Cabin number (0 to 5) - protected String name; //the player's Name - protected Boolean isGhost; //boolean regarding if the player is a ghost. Could probably be removed since ghost is a subclass but I'm keeping it in. - protected Boolean isPlayer; //same here - protected Boolean kickedOff; //true if the player has been voted off. - protected ClientHandler clientHandler; //the socket for the client associated with this Passenger, for NPCs, this can be null. - /** - * Sends a protocol message to the respective player. - * @param msg the message that is sent to this player. - **/ - public void send(String msg) { - //todo: send protocol message to the respective client OR process messages for NPCS - } + protected int position; //the player's Cabin number (0 to 5) + protected String name; //the player's Name + protected Boolean isGhost; //boolean regarding if the player is a ghost. Could probably be removed since ghost is a subclass but I'm keeping it in. + protected Boolean isPlayer; //same here + protected Boolean kickedOff; //true if the player has been voted off. + protected ClientHandler clientHandler; //the socket for the client associated with this Passenger, for NPCs, this can be null. - /** - * sets the Position of this passenger - * @param position the position of this passenger - */ - public void setPosition(int position) { - this.position = position; - } + /** + * Sends a protocol message to the respective player. + * + * @param msg the message that is sent to this player. + **/ + public void send(String msg) { + //todo: send protocol message to the respective client OR process messages for NPCS + } - /** - * sets the name of this passenger. - * @param name the new name for this passenger. - */ - public void setName(String name) { - this.name = name; - } + /** + * sets the Position of this passenger + * + * @param position the position of this passenger + */ + public void setPosition(int position) { + this.position = position; + } - /** - * sets the kickedOff status of this Passenger - * @param kickedOff should be set to true if the passenger has been kicked off. - */ - public void setKickedOff(boolean kickedOff) { - this.kickedOff = kickedOff; - } + /** + * sets the name of this passenger. + * + * @param name the new name for this passenger. + */ + public void setName(String name) { + this.name = name; + } - public int getPosition() { - return position; - } + /** + * sets the kickedOff status of this Passenger + * + * @param kickedOff should be set to true if the passenger has been kicked off. + */ + public void setKickedOff(boolean kickedOff) { + this.kickedOff = kickedOff; + } + + public int getPosition() { + return position; + } - public String getName() { - return name; - } + public String getName() { + return name; + } - public Boolean getIsGhost() { - return isGhost; - } + public Boolean getIsGhost() { + return isGhost; + } - public Boolean getKickedOff() { - return kickedOff; - } + public Boolean getKickedOff() { + return kickedOff; + } - public Boolean getIsPlayer() { - return isPlayer; - } + public Boolean getIsPlayer() { + return isPlayer; + } - public ClientHandler getClientHandler() { - return clientHandler; - } + public ClientHandler getClientHandler() { + return clientHandler; + } } diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/Spiellogikentwurf/GameFunctions.java b/src/main/java/ch/unibas/dmi/dbis/cs108/Spiellogikentwurf/GameFunctions.java index c48e1b2..50a184b 100644 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/Spiellogikentwurf/GameFunctions.java +++ b/src/main/java/ch/unibas/dmi/dbis/cs108/Spiellogikentwurf/GameFunctions.java @@ -10,8 +10,8 @@ public class GameFunctions { **/ int nrOfPlayers; //sets the length of the train int nrOfGhosts; // sets how many Ghosts we start witch - int nrOfUsers; // safes how many clients are active in this Game - Train train; // safes who sits where + int nrOfUsers; // saves how many clients are active in this Game + Train train; // saves who sits where Passenger[] passengerTrain; /** diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/jonasStuff/ClientProtocol.java b/src/main/java/ch/unibas/dmi/dbis/cs108/jonasStuff/ClientProtocol.java deleted file mode 100644 index 346bb0f..0000000 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/jonasStuff/ClientProtocol.java +++ /dev/null @@ -1,8 +0,0 @@ -package ch.unibas.dmi.dbis.cs108.jonasStuff; - -public enum ClientProtocol { - MSGRS, //"Message received": Parameters: a string detailing to the client that and what the server received as command. - SEROR, //Server had an error. (used for debugging) - SPING, //Ping from server to client; - NOCMD //No command found. -} diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/jonasStuff/ClientProtocolParser.java b/src/main/java/ch/unibas/dmi/dbis/cs108/jonasStuff/ClientProtocolParser.java deleted file mode 100644 index 54aecb7..0000000 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/jonasStuff/ClientProtocolParser.java +++ /dev/null @@ -1,4 +0,0 @@ -package ch.unibas.dmi.dbis.cs108.jonasStuff; - -public class ClientProtocolParser { -} diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/jonasStuff/ServerProtocol.java b/src/main/java/ch/unibas/dmi/dbis/cs108/jonasStuff/ServerProtocol.java deleted file mode 100644 index e214c3f..0000000 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/jonasStuff/ServerProtocol.java +++ /dev/null @@ -1,15 +0,0 @@ -package ch.unibas.dmi.dbis.cs108.jonasStuff; - -public enum ServerProtocol { - CRTGM, //Create a new game - CHATA, //chat to all - CHATW, //whisper chat - CHATG, //ghost chat - LEAVG, //leave a game - JOING, //join a game - VOTEG, //ghost voting who to infect - VOTEH, //humans voting who is the ghost - QUITS, //quit server/ leave server - LISTP, //list players/clients in session with the Server - CPING, //Ping from client to server. -} diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/client/Client.java b/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/client/Client.java index 9a4e3cc..47d82df 100644 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/client/Client.java +++ b/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/client/Client.java @@ -1,7 +1,6 @@ package ch.unibas.dmi.dbis.cs108.multiplayer.client; import ch.unibas.dmi.dbis.cs108.multiplayer.helpers.ClientPinger; -import ch.unibas.dmi.dbis.cs108.multiplayer.protocol.NoLegalProtocolCommandStringFoundException; import java.net.Socket; import java.io.*; @@ -50,23 +49,10 @@ public class Client { } } - /** - * Uses NTtBProtocolParser to turn Client input into the NTtB Protocol format. Must - * be called before a client input is sent to the server. - * - * @param msg the msg to be encoded. - * @return Message encoded adhering to the NTtB Protocoll. - */ - private String encodeMessage(String msg) - throws NoLegalProtocolCommandStringFoundException, EmptyClientInputException { - NTtBProtocolParser pp = new NTtBProtocolParser(this); - return pp.parseMsg(msg); - } - //TODO implement decoding of server input - private String decodeServerMsg(String msg){return null;} + /** - * Listens for incoming messages + * Starts a thread which listens for incoming messages */ public void chatListener() { /*TODO: what type of decoding has to be done @@ -92,6 +78,10 @@ public class Client { }).start(); } + /** + * Sends a message to the server, as is. + * @param msg the message sent. Should already be protocol-formatted. + */ public void sendMsgToServer(String msg) { try { out.write(msg); @@ -103,6 +93,10 @@ public class Client { } + /** + * parses a received message according to the client protocol. + * @param msg the message to be parsed. + */ public void parse(String msg) { JClientProtocolParser.parse(msg, this); } diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/client/EmptyClientInputException.java b/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/client/EmptyClientInputException.java deleted file mode 100644 index 6d9f814..0000000 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/client/EmptyClientInputException.java +++ /dev/null @@ -1,15 +0,0 @@ -package ch.unibas.dmi.dbis.cs108.multiplayer.client; - -public class EmptyClientInputException extends Exception { - String exceptionMsg; - Client whoDunIt; - public EmptyClientInputException(Client whoDunIt) { - this.whoDunIt = whoDunIt; - this.exceptionMsg = whoDunIt.getUsername() + " tried to send an empty message"; - } - - public String getExceptionMsg(){ - return exceptionMsg; - } - -} diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/client/InputToProtocolMap.java b/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/client/InputToProtocolMap.java deleted file mode 100644 index 9cdddd0..0000000 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/client/InputToProtocolMap.java +++ /dev/null @@ -1,36 +0,0 @@ -package ch.unibas.dmi.dbis.cs108.multiplayer.client; - -import ch.unibas.dmi.dbis.cs108.multiplayer.protocol.NightTrainProtocol; -import ch.unibas.dmi.dbis.cs108.multiplayer.protocol.NoLegalProtocolCommandStringFoundException; - -import java.util.HashMap; -import java.util.HashSet; - -public class InputToProtocolMap { - - private static final HashMap encoding; - private static final HashSet legalClientInput; - - static { - //First add all legal commands to a map - HashMap builder = new HashMap<>(); - builder.put("chat", NightTrainProtocol.NTtBCommands.CHATA); - builder.put("cn", NightTrainProtocol.NTtBCommands.CUSRN); - builder.put("list", NightTrainProtocol.NTtBCommands.LISTP); - builder.put("exit", NightTrainProtocol.NTtBCommands.LEAVG); - //TODO extend according to extended function - //Initialize static final map and set - legalClientInput = new HashSet<>(builder.keySet()); - encoding = new HashMap<>(builder); - } - - public static String encode(String toEncode) throws NoLegalProtocolCommandStringFoundException { - if (legalClientInput.contains(toEncode)) { - return encoding.get(toEncode).toString(); - } else { - throw new NoLegalProtocolCommandStringFoundException(); - } - } - - -} diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/client/NTtBProtocolParser.java b/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/client/NTtBProtocolParser.java deleted file mode 100644 index 1b859f5..0000000 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/client/NTtBProtocolParser.java +++ /dev/null @@ -1,76 +0,0 @@ -package ch.unibas.dmi.dbis.cs108.multiplayer.client; - -import ch.unibas.dmi.dbis.cs108.multiplayer.protocol.NoLegalProtocolCommandStringFoundException; - -import java.util.ArrayList; -import java.util.Scanner; - -/** - * Implements a protocol parser for the NTtB protocoll, that transforms client input into a server - * readable format. - */ -public class NTtBProtocolParser implements ProtocolParser { - - //TODO Possibly bad name, rename to clientMsgParser? - public final Client caller; - public static InputToProtocolMap legalCommands = new InputToProtocolMap(); - - - public NTtBProtocolParser(Client caller) { - this.caller = caller; - } - - @Override - public String parseMsg(String msg) - throws NoLegalProtocolCommandStringFoundException, EmptyClientInputException { - Scanner sc = new Scanner(msg); - ArrayList input = new ArrayList<>(); - String parsedMsg; - - while (sc.hasNext()) { - input.add(sc.next()); - } - return buildProtocolMsg(input); - } - - - private String buildProtocolMsg(ArrayList input) - throws EmptyClientInputException, NoLegalProtocolCommandStringFoundException { - //TODO - if (emptyClientInput(input)) { - throw new EmptyClientInputException(caller); - } - StringBuilder s = new StringBuilder(); //friendly little helper - s.append(InputToProtocolMap.encode(input.get(0))); - if (containsParameters(input)) { - int size = input.size(); - for (int i = 1; i < size; i++) { - s.append("$"); - s.append(input.get(i).toLowerCase()); //parameters are always lower case (is that good?) - } - } - return s.toString(); - } - - /** - * Checks if input has parameters - *

- * if the list size is smaller than 2, i.e. not larger than 1, the input only contains a command. - * - * @param input the tokenized input string. - * @return true if input list is larger than 2. - */ - private boolean containsParameters(ArrayList input) { - return input.size() > 1; - } - - /** - * checks if client input is empty - * - * @param clientInput the clients input. - * @return true if client didn't send any input besides whitespace - */ - private boolean emptyClientInput(ArrayList clientInput) { - return clientInput.isEmpty(); - } -} diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/client/ProtocolParser.java b/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/client/ProtocolParser.java deleted file mode 100644 index 6787bad..0000000 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/client/ProtocolParser.java +++ /dev/null @@ -1,12 +0,0 @@ -package ch.unibas.dmi.dbis.cs108.multiplayer.client; - -public interface ProtocolParser { - - /** - * Takes a String from client input and parses into server readable message. - * - * @param msg the message to be parsed - * @return a String message formatted for the specific protocol - */ - String parseMsg(String msg) throws Exception; -} diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/protocol/NTtBFormatMsg.java b/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/protocol/NTtBFormatMsg.java deleted file mode 100644 index f06df05..0000000 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/protocol/NTtBFormatMsg.java +++ /dev/null @@ -1,50 +0,0 @@ -package ch.unibas.dmi.dbis.cs108.multiplayer.protocol; - -import java.util.LinkedList; -import java.util.Queue; - -/** - * This class defines what type the ClientMsgDecoder returns after decoding the message. This is - * done so the output can be split into a response to the client and action in to the game logik. - * commands should map to methods(maybe classes) parameters map to method parameters - */ - -public class NTtBFormatMsg { - - private String msgToClient; - private NightTrainProtocol.NTtBCommands command; - private final String[] parameters; //TODO maybe use array? - - public NTtBFormatMsg(String msgToClient, NightTrainProtocol.NTtBCommands command, - String[] parameters) { - this.msgToClient = msgToClient; - this.command = command; - this.parameters = parameters; - } - - public NTtBFormatMsg() { - this.msgToClient = ""; - this.command = null; - this.parameters = new String[]{""}; - } - - public String getMessage() { - return msgToClient; - } - - public NightTrainProtocol.NTtBCommands getCommand() { - return command; - } - - public String[] getParameters() { - return parameters; - } - - protected void setMsgToClient(String msgToClient) { - this.msgToClient = msgToClient; - } - - protected void setCommand(NightTrainProtocol.NTtBCommands command) { - this.command = command; - } -} diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/protocol/NTtBInputType.java b/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/protocol/NTtBInputType.java deleted file mode 100644 index 6f1d378..0000000 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/protocol/NTtBInputType.java +++ /dev/null @@ -1,9 +0,0 @@ -package ch.unibas.dmi.dbis.cs108.multiplayer.protocol; - -public interface NTtBInputType { - String msg = null; - public String getValue(); - public void setValue(); - - -} diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/protocol/NTtBParameter.java b/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/protocol/NTtBParameter.java deleted file mode 100644 index 3169953..0000000 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/protocol/NTtBParameter.java +++ /dev/null @@ -1,18 +0,0 @@ -package ch.unibas.dmi.dbis.cs108.multiplayer.protocol; - -public class NTtBParameter implements NTtBInputType { - String parameterValue; - - public NTtBParameter(String parameterValue) { - this.parameterValue = parameterValue; - } - @Override - public String getValue() { - return parameterValue; - } - - @Override - public void setValue() { - //Possibly do not need - } -} diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/protocol/NTtB_Protocol_Definition.txt b/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/protocol/NTtB_Protocol_Definition.txt deleted file mode 100644 index 59a5969..0000000 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/protocol/NTtB_Protocol_Definition.txt +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Client commands: - * CRTGM: Create a new game - * CHATA: chat to all - * CHATW: whisper chat - * CHATG: ghost chat - * LEAVG: leave a game - * JOING: join a game - * VOTEG: ghost voting who to infect - * VOTEH: humans voting who is the ghost - * QUITS: quit server/ leave server - * LISTP: list players/clients in session with the Server - * CPING: Ping from client to server. - */ - /** - Server Commands: - * MSGRS: "Message received": Parameters: a string detailing to the client that and what the server received as command. - * SEROR: Server had an error. (used for debugging) - * SPING: Ping from server to client; - * NOCMD: Co command found. - * CHATM: Incoming Chat message. - */ \ No newline at end of file diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/protocol/NightTrainProtocol.java b/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/protocol/NightTrainProtocol.java deleted file mode 100644 index f85492d..0000000 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/protocol/NightTrainProtocol.java +++ /dev/null @@ -1,66 +0,0 @@ -package ch.unibas.dmi.dbis.cs108.multiplayer.protocol; - -import java.util.HashMap; -import java.util.HashSet; - -/* -The NightTrainProtocol implements the Communication-Protocol of the -"Night Train to Budapest"" game. It acts as an Interface between Client and server. All Client Messages are -piped through this protocol, in order for the Server to execute the correct action. It is used by the ClientHandler -for this purpose. - */ - -public class NightTrainProtocol { - //TODO: initialite the fields - - private static HashMap stringNTtBCommandsHashMap = initializeMapping(); - private static ProtocolValidator protocolValidator; - private static HashSet legalStrings = new HashSet<>(stringNTtBCommandsHashMap.keySet()); - - public enum NTtBCommands { - //Client Commands - CRTGM, CHATA, CHATW, CHATG, LEAVG, JOING, VOTEG, QUITS, LISTP, CUSRN,CPING, - //Server Responses - MSGRS, SEROR, SPING, NOCMD - } - - private static HashMap initializeMapping(){ - HashMap map = new HashMap<>(); - for(NTtBCommands cmd: NTtBCommands.values()) { - map.put(cmd.toString(), cmd); - } - return map; - } - - //getters & setters - - public static HashMap getStringNTtBCommandsHashMap() { - return stringNTtBCommandsHashMap; - } - - public static HashSet getLegalStrings() { - return legalStrings; - } - - //Utility Methods: - /** - * Validates a given string is a valid representation - * of a protocol command - * @param cmd, the string command to be validated - * @return true if cmd is a valid command - */ - public static boolean isLegalCmdString(String cmd) { - return legalStrings.contains(cmd); - } - - public static NTtBCommands getCmdEnumObject(String cmd) throws NoLegalProtocolCommandStringFoundException { - if(isLegalCmdString(cmd)){ - return stringNTtBCommandsHashMap.get(cmd); - } else { - throw new NoLegalProtocolCommandStringFoundException(); - } - - } - - //TODO analyize what methods are needed -} diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/protocol/NoLegalProtocolCommandStringFoundException.java b/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/protocol/NoLegalProtocolCommandStringFoundException.java deleted file mode 100644 index 4d7f035..0000000 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/protocol/NoLegalProtocolCommandStringFoundException.java +++ /dev/null @@ -1,4 +0,0 @@ -package ch.unibas.dmi.dbis.cs108.multiplayer.protocol; - -public class NoLegalProtocolCommandStringFoundException extends Exception { -} diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/protocol/ProtocolDecoder.java b/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/protocol/ProtocolDecoder.java deleted file mode 100644 index 2a3d970..0000000 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/protocol/ProtocolDecoder.java +++ /dev/null @@ -1,6 +0,0 @@ -package ch.unibas.dmi.dbis.cs108.multiplayer.protocol; - -public interface ProtocolDecoder { - - public NTtBFormatMsg decodeMsg(String msg); -} diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/protocol/ProtocolValidator.java b/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/protocol/ProtocolValidator.java deleted file mode 100644 index d3617e9..0000000 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/protocol/ProtocolValidator.java +++ /dev/null @@ -1,23 +0,0 @@ -package ch.unibas.dmi.dbis.cs108.multiplayer.protocol; - -import java.util.EnumSet; -import java.util.HashSet; -//TODO Possibly redundant!! - -public class ProtocolValidator { - - //TODO String or NTtBCommands HashSet? - public static HashSet legalCommands = initializeLegalCommands(); - - //Initialize the legalCommands set with the protocol values. - private static HashSet initializeLegalCommands(){ - EnumSet enumVals = EnumSet.allOf(NightTrainProtocol.NTtBCommands.class); - return new HashSet<>(enumVals); - } - - public boolean validateCommand(String s) { - //TODO implement if needed - return false; - } - -} diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/server/ClientHandler.java b/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/server/ClientHandler.java index 62438a5..ab41618 100644 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/server/ClientHandler.java +++ b/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/server/ClientHandler.java @@ -1,7 +1,6 @@ package ch.unibas.dmi.dbis.cs108.multiplayer.server; import ch.unibas.dmi.dbis.cs108.multiplayer.helpers.ServerPinger; -import ch.unibas.dmi.dbis.cs108.multiplayer.protocol.NTtBFormatMsg; import java.io.*; import java.net.Socket; import java.util.HashSet; @@ -18,7 +17,6 @@ public class ClientHandler implements Runnable { public static HashSet connectedClients = new HashSet<>(); public static HashSet lobby = new HashSet<>(); public static HashSet ghostClients = new HashSet<>(); - private ClientMsgDecoder clientMsgDecoder = new ClientMsgDecoder(); /** * Implements the login logic in client-server architecture. @@ -67,10 +65,6 @@ public class ClientHandler implements Runnable { return ghostClients; } - public ClientMsgDecoder getClientMsgDecoder() { - return clientMsgDecoder; - } - //Setters diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/server/ClientMsgDecoder.java b/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/server/ClientMsgDecoder.java deleted file mode 100644 index 0dd8a67..0000000 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/server/ClientMsgDecoder.java +++ /dev/null @@ -1,96 +0,0 @@ -package ch.unibas.dmi.dbis.cs108.multiplayer.server; - -import ch.unibas.dmi.dbis.cs108.multiplayer.protocol.NTtBFormatMsg; -import ch.unibas.dmi.dbis.cs108.multiplayer.protocol.NightTrainProtocol; -import ch.unibas.dmi.dbis.cs108.multiplayer.protocol.NightTrainProtocol.NTtBCommands; -import ch.unibas.dmi.dbis.cs108.multiplayer.protocol.NoLegalProtocolCommandStringFoundException; -import ch.unibas.dmi.dbis.cs108.multiplayer.protocol.ProtocolDecoder; - - -/** - * Decodes the correctly formatted String containing command and parameters. For reasons of - * seperation of work this class only tokenizes the string and acknowledges to the client that smth - * was recieved. Actual method calls, change of state, method calles etc. are delegated to{@link - * ch.unibas.dmi.dbis.cs108.multiplayer.server.cmd.methods.CommandExecuter} from within {@link - * ClientHandler}. - */ - -public class ClientMsgDecoder implements ProtocolDecoder { - - /** - * The point of contact for the ClientHandler who calls this method to convert a String in to - * usable, tokanized format defined by {@link NTtBFormatMsg}. - * - * @param msg coming from the client handlers input reader. - * @return {@link NTtBFormatMsg} - */ - @Override - public NTtBFormatMsg decodeMsg(String msg) { - //Declare needed variables - String[] msgTokens; //List where we'll put the string tokens seperated by $. - String ackMsg; //The command token - String[] parameters; - NightTrainProtocol.NTtBCommands cmdObject; - //Initalize fields for return object - msgTokens = tokenizeMsg(msg); - ackMsg = serverResponseBuilder(msgTokens); - parameters = new String[msgTokens.length - 1]; - cmdObject = getCommandConstant(msgTokens[0]); - return new NTtBFormatMsg(ackMsg, cmdObject, parameters); - } - - /** - * Constructs the server acknowledgement response witch is instantly sent back to the client. The - * response is merely that a command was recieved and which one. - *

- * If garbage was recieved a SEROR will be appended. It is assumed that the msgTokens array is not - * empty. - * - * @param msgTokens an array containing the command String - * @return a String containing the immediate response of the server to the client. - */ - private String serverResponseBuilder(String[] msgTokens) { - StringBuilder sb = new StringBuilder(); - //assumes non-empty array! - sb.append("SERVER: "); - NightTrainProtocol.NTtBCommands cmd = getCommandConstant(msgTokens[0]); - - if (cmd.equals(NTtBCommands.SEROR)) { - return cmd + "invalid input"; - } - - sb.append("Command *").append(cmd).append("* recieved!"); - - return sb.toString(); - } - - - /** - * Turns the string into a command object. If no matching protocol command was found, it returns - * an SEROR type. - * - * @param stringToken String that should match the String representation of a NTtBCommands,java - * field. - * @return type {@link ch.unibas.dmi.dbis.cs108.multiplayer.protocol.NightTrainProtocol.NTtBCommands} - * object - */ - private NightTrainProtocol.NTtBCommands getCommandConstant(String stringToken) { - try { - return NightTrainProtocol.getCmdEnumObject(stringToken); - } catch (NoLegalProtocolCommandStringFoundException e) { - return NightTrainProtocol.NTtBCommands.SEROR; - } - } - - //TODO What happens if there is no delimeter? - - /** - * Splits the input string along the delimiter "$". - * - * @param msg Clients input - * @return an array of String objects containing the command and parameters of the message. - */ - private String[] tokenizeMsg(String msg) { - return msg.split("$"); - } -} diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/server/InSessionLogik.java b/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/server/InSessionLogik.java deleted file mode 100644 index a68a851..0000000 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/server/InSessionLogik.java +++ /dev/null @@ -1,8 +0,0 @@ -package ch.unibas.dmi.dbis.cs108.multiplayer.server; - -public class InSessionLogik { - Server server; - public InSessionLogik(Server server) { - this.server = server; - } -} diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/server/JServerProtocolParser.java b/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/server/JServerProtocolParser.java index 13921be..5abcbe1 100644 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/server/JServerProtocolParser.java +++ b/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/server/JServerProtocolParser.java @@ -1,14 +1,13 @@ package ch.unibas.dmi.dbis.cs108.multiplayer.server; -import ch.unibas.dmi.dbis.cs108.jonasStuff.ServerProtocol; - public class JServerProtocolParser { /** * Used by the server (i.e. ClientHandler) to parse an incoming protocol message. + * * @param msg the encoded message that needs to be parsed - * @param h this ClientHandler (required so this method can access the ClientHandler's methods) + * @param h this ClientHandler (required so this method can access the ClientHandler's methods) */ public static void parse(String msg, ClientHandler h) { String header = ""; //"header" is the first 5 characters, i.e. the protocol part diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/server/NoCommandTokenException.java b/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/server/NoCommandTokenException.java deleted file mode 100644 index f707144..0000000 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/server/NoCommandTokenException.java +++ /dev/null @@ -1,5 +0,0 @@ -package ch.unibas.dmi.dbis.cs108.multiplayer.server; - -public class NoCommandTokenException extends Exception { - -} diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/server/cmd/methods/CommandExecuter.java b/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/server/cmd/methods/CommandExecuter.java deleted file mode 100644 index b3c3e34..0000000 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/server/cmd/methods/CommandExecuter.java +++ /dev/null @@ -1,110 +0,0 @@ -package ch.unibas.dmi.dbis.cs108.multiplayer.server.cmd.methods; - -import ch.unibas.dmi.dbis.cs108.multiplayer.protocol.NTtBFormatMsg; -import ch.unibas.dmi.dbis.cs108.multiplayer.protocol.NightTrainProtocol.NTtBCommands; -import ch.unibas.dmi.dbis.cs108.multiplayer.server.ClientHandler; -import java.io.IOException; - -/** - * This Class implements actually acting on the clients messages. - */ -public class CommandExecuter { - - private ClientHandler caller; - private static String msgPrefix = "SERVER: "; - - public void execute(NTtBFormatMsg msg) { - switch (msg.getCommand()) { - case CRTGM: - break; - case CHATA: - broadcastClientMsg(msg.getParameters()); - break; - case CHATG: - //TODO - break; - case LEAVG: - //TODO - break; - case JOING: - //TODO - break; - case VOTEG: - //TODO - break; - case QUITS: - quitServer(); - break; - case CHATW: - wisper(msg.getParameters()); - break; - case LISTP: - //TODO - break; - case CUSRN: - changeNickname(msg.getParameters()); - break; - case CPING: - pongS(); - break; - case MSGRS: - //TODO - break; - case SEROR: - //TODO - break; - case SPING: - pongC(); - break; - default: - this.noCommand(); - break; - } - } - - private void wisper(String[] parameters) { - //TODO - } - - private void changeNickname(String[] parameters) { - //TODO - } - - private void quitServer() { - //TODO - } - - private void pongC() { - //TODO - } - - private void pongS() { - //TODO - } - - private void noCommand() { - try { - caller.getOut().write(msgPrefix + String.valueOf(NTtBCommands.NOCMD)); - } catch (IOException e) { - System.out.println("IOException in noCommand() in CommandExecuter.java"); - e.printStackTrace(); - } - } - - /** - * boradcast chat message to everyone - * - * @param parameters should only have one entry i.e. parameters.length == 1 should be true; - */ - private static void broadcastClientMsg(String[] parameters) { - try { - for (ClientHandler clients : ClientHandler.connectedClients) { - clients.getOut().write(parameters[0]); - } - } catch (IOException e) { - System.out.println("IOEXCEPTION in CommandExecuter.java at broadcastClientMsg"); - } - - } - -} diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/server/cmd/methods/msgToMethod.java b/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/server/cmd/methods/msgToMethod.java deleted file mode 100644 index 4e834da..0000000 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/server/cmd/methods/msgToMethod.java +++ /dev/null @@ -1,8 +0,0 @@ -package ch.unibas.dmi.dbis.cs108.multiplayer.server.cmd.methods; - -public interface msgToMethod { - - void quit(); - - -} diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/server/connectingLogik.java b/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/server/connectingLogik.java deleted file mode 100644 index 53b31d5..0000000 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/multiplayer/server/connectingLogik.java +++ /dev/null @@ -1,8 +0,0 @@ -package ch.unibas.dmi.dbis.cs108.multiplayer.server; - -/** - * Implements the communication protocol in the connecting phase. - * After this one can consider the server and client in session; - */ -public class connectingLogik { -}