TODO in CLient: automate/hide connecting sequence in Client Constructor.
Added Comment to ClientHandler that the constructor atm implements connecting logic.
This commit is contained in:
parent
47703e481e
commit
03d4942552
@ -18,6 +18,7 @@ public class Client {
|
|||||||
this.in = new BufferedReader((new InputStreamReader((socket.getInputStream()))));
|
this.in = new BufferedReader((new InputStreamReader((socket.getInputStream()))));
|
||||||
|
|
||||||
//TODO add the system based generated username here.
|
//TODO add the system based generated username here.
|
||||||
|
//TODO hide connecting logik(next 4 lines)
|
||||||
this.userName = userName;
|
this.userName = userName;
|
||||||
this.out.write(getUsername());
|
this.out.write(getUsername());
|
||||||
this.out.newLine();
|
this.out.newLine();
|
||||||
|
|||||||
@ -15,6 +15,11 @@ public class ClientHandler implements Runnable {
|
|||||||
public static HashSet<ClientHandler> inGameClients = new HashSet<>();
|
public static HashSet<ClientHandler> inGameClients = new HashSet<>();
|
||||||
public static HashSet<ClientHandler> ghostClients = new HashSet<>();
|
public static HashSet<ClientHandler> ghostClients = new HashSet<>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implements the connecting logik in client-server
|
||||||
|
* architecture.
|
||||||
|
* @param socket
|
||||||
|
*/
|
||||||
public ClientHandler(Socket socket) {
|
public ClientHandler(Socket socket) {
|
||||||
try {
|
try {
|
||||||
this.socket = socket;
|
this.socket = socket;
|
||||||
|
|||||||
Reference in New Issue
Block a user