MazewarServerClient(Socket socket) throws IOException {
        this.socket = socket;
        this.id = createdClients;
        createdClients++;

        Random rand = new Random();
        boolean found = false;

        while(!found){
            boolean exists = false;
            int y = rand.nextInt(MazewarServer.mazeHeight);
            int x = rand.nextInt(MazewarServer.mazeWidth);

            for(int i = 0; i < startingPoints.size(); i++){
                if(startingPoints.get(i).getX() == x && startingPoints.get(i).getY() == y){
                    exists = true;
                }
            }
            if(!exists){
                this.startingPoint = new Point(x, y);
                startingPoints.add(this.startingPoint);
                found = true;
            }

            startingDirection = Direction.random();
        }

        this.outStream = new ObjectOutputStream(this.socket.getOutputStream());
        this.outStream.flush();
        this.inStream = new ObjectInputStream(this.socket.getInputStream());
    }