diff --git a/src/main/java/inf112/fiasko/roborally/networking/RoboRallyClient.java b/src/main/java/inf112/fiasko/roborally/networking/RoboRallyClient.java
index 02fbd5e..1307ef1 100644
--- a/src/main/java/inf112/fiasko/roborally/networking/RoboRallyClient.java
+++ b/src/main/java/inf112/fiasko/roborally/networking/RoboRallyClient.java
@@ -28,6 +28,9 @@ class RoboRallyClientListener extends Listener {
         if (object instanceof SomeResponse) {
             SomeResponse response = (SomeResponse)object;
             System.out.println("Client received: " + response.text);
+        } else if (object instanceof ErrorResponse) {
+            ErrorResponse errorResponse = (ErrorResponse) object;
+            System.out.println(errorResponse.getErrorMessage());
         }
     }
 }
\ No newline at end of file
diff --git a/src/main/java/inf112/fiasko/roborally/networking/RoboRallyServer.java b/src/main/java/inf112/fiasko/roborally/networking/RoboRallyServer.java
index 4b3813b..ad6ccf6 100644
--- a/src/main/java/inf112/fiasko/roborally/networking/RoboRallyServer.java
+++ b/src/main/java/inf112/fiasko/roborally/networking/RoboRallyServer.java
@@ -3,19 +3,31 @@ package inf112.fiasko.roborally.networking;
 import com.esotericsoftware.kryonet.Connection;
 import com.esotericsoftware.kryonet.Listener;
 import com.esotericsoftware.kryonet.Server;
+import inf112.fiasko.roborally.element_properties.RobotID;
+import inf112.fiasko.roborally.objects.IDeck;
+import inf112.fiasko.roborally.objects.ProgrammingCard;
+import inf112.fiasko.roborally.objects.ProgrammingCardDeck;
+import inf112.fiasko.roborally.utility.DeckLoaderUtil;
 import inf112.fiasko.roborally.utility.NetworkUtil;
 
 import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
 
 public class RoboRallyServer {
     private Server server;
+    private IDeck<ProgrammingCard> programmingCardDeck;
+    private RoboRallyServerListener listener;
 
     public RoboRallyServer() throws IOException {
         server = new Server();
         server.start();
         NetworkUtil.registerClasses(server.getKryo());
         server.bind(54555, 54777);
-        server.addListener(new RoboRallyServerListener());
+        listener = new RoboRallyServerListener();
+        server.addListener(listener);
+        programmingCardDeck = DeckLoaderUtil.loadProgrammingCardsDeck();
     }
 
     /**
@@ -25,13 +37,27 @@ public class RoboRallyServer {
     public void sendToAllClients(Object object) {
         server.sendToAllTCP(object);
     }
+
+    /**
+     * Deals cards to all players
+     */
+    public void dealCards() {
+        programmingCardDeck.shuffle();
+        for (Connection connection : server.getConnections()) {
+            IDeck<ProgrammingCard> hand = new ProgrammingCardDeck(new ArrayList<>());
+            hand.draw(programmingCardDeck, 9);
+            connection.sendTCP(hand);
+        }
+    }
 }
 
 class RoboRallyServerListener extends Listener {
-    Connection host;
+    protected Connection host;
+    protected Map<Connection, RobotID> clients;
 
     public RoboRallyServerListener() {
         super();
+        clients = new HashMap<>();
     }
 
     @Override
@@ -52,6 +78,14 @@ class RoboRallyServerListener extends Listener {
         if (host == null) {
             host = connection;
         }
+        //Prevents more than 8 players from connecting at once
+        if (clients.size() >= 8) {
+            String errorMessage = "The server already has 8 players. You cannot join.";
+            connection.sendTCP(new ErrorResponse(errorMessage, new IOException(errorMessage)));
+            connection.close();
+            return;
+        }
+        clients.put(connection, RobotID.getRobotIDFromID(clients.size() + 1));
         System.out.println(connection.getRemoteAddressTCP() + " connected");
     }