What am I doing...
This commit is contained in:
parent
371efdf89c
commit
4fcd68fef5
@ -0,0 +1,4 @@
|
||||
package ch.unibas.dmi.dbis.cs108.Multiplayer.Server;
|
||||
|
||||
public class ClientHandler {
|
||||
}
|
||||
@ -3,18 +3,22 @@ package ch.unibas.dmi.dbis.cs108.Multiplayer.Server;
|
||||
import java.io.IOException;
|
||||
import java.net.ServerSocket;
|
||||
import java.net.Socket;
|
||||
import java.util.HashMap;
|
||||
|
||||
public class Server {
|
||||
|
||||
int port = 42069;
|
||||
private static final int gamePort = 42069;
|
||||
private static int clientIndex = 0;
|
||||
private HashMap<String, Integer> nameToIndex = new HashMap<>();
|
||||
private HashMap<Integer, ClientHandler> indexToHandler = new HashMap<>();
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
try {
|
||||
ServerSocket gameServer = new ServerSocket(42069);
|
||||
ServerSocket gameServer = new ServerSocket(gamePort);
|
||||
System.out.println("Waiting for a connection on Port 42069");
|
||||
while(true) {
|
||||
Socket connector = gameServer.accept();
|
||||
Socket client = gameServer.accept();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
Reference in New Issue
Block a user