I set up a try-catch to catch the exception thrown by the Server/Client when
it can't create a socket. I also used display_and_exit() to
automatically close the window after the text has been displayed.
I removed this because I realized I could just check the IP version inside
the constructor. The Sock constructor now checks the address passed to it.
Like before, if the address is neither v4 nor v6, an exception is thrown.
Since the Server and Client constructors call the Sock constructor, no change
was required in these files, except passing the right number of parameters.
I haven't completely implemented it yet, but I did come up with a basic algorithm
to convert the IPv6 address into a 'code' form. I still have to write the code to
actually create the socket, though.
I removed a print statement that printed out every position of the ball, because it was no longer necessary.
I also added code to clear the background before drawing to the screen at the start of the game, to remove
any lingering un-erased objects. Finally, and most substantially, I finished the initial implementation of
the client-side GUI. The client should now be able to specify a connect code through the GUI, and connect
to the appropriate server.
I moved the GameType struct (and the Mode enum) to a separate file, as I will need
to use it in the check_server and check_client functions as well. I also added the
signum function (which was previously in sign.hpp) to this file, since it was the only
function in sign.hpp. Finally, I added a check, that will only display the GUI, if the
user didn't provide any command-line arguments.
I added code to display a help text after the user selects a mode. Currently,
this text is only displayed in single player mode. Additionally, I added a rudimentary
'form' to input IP address and port, if the user selects server mode.