Commit Graph

215 Commits (ec2f3320e3cac21cbf36c1abb70aeeced1dad798)
 

Author SHA1 Message Date
Aadhavan Srinivasan ec2f3320e3 Replaced display_text_centered() with the environment-agnostic display_text() function; Changed function to include parameter to indicate environment type
Aadhavan Srinivasan 43ba4aba0c Created a file that contains functions for agnostic text output
Aadhavan Srinivasan c2bedb0601 Wrote the check_num_args() function; still need to integrate it into the program. Also wrote a help text that is printed with -h flag.
Aadhavan Srinivasan 77a147e08f Updated TODO
Aadhavan Srinivasan 26999a1145 Started working on function to check the number of command-line arguments
Aadhavan Srinivasan f41c3d22e2 Updated TODO
Aadhavan Srinivasan 9f1f313091 Cast sockaddr to sockaddr_storage
Aadhavan Srinivasan 8401f74922 Define WIN32_LEAN_AND_MEAN to avoid including windows.h, when including winsock2.h
Aadhavan Srinivasan d2dd95b7cc Replaced global_args with project_args to prevent build error on MinGW
Aadhavan Srinivasan 5cf11ac014 Added stdint header file
Aadhavan Srinivasan 0dbf8936fd Added a #define for math constants on MinGW
Aadhavan Srinivasan 3ab97b3853 Compile the application if it isn't already compiled
Aadhavan Srinivasan aea8f3dfd2 Updated TODO
Aadhavan Srinivasan 94e08f3863 Used blocking recv here, to ensure that we wait for the server to respond
Aadhavan Srinivasan a847da5339 Added support for printing out the peer's IPv6 address; replaced struct sockaddr with struct sockaddr_storage
Aadhavan Srinivasan 550643281e Replace all instances of sockaddr with sockaddr_storage
Aadhavan Srinivasan ef869710e5 Replaced recvAll call with recvAllNB
Aadhavan Srinivasan 00d20ebc88 Used the non-blocking recv function, to ensure that the game doesn't hang if the server doesn't respond.
Aadhavan Srinivasan 839efc3c44 Replaced all instances of struct sockaddr with struct sockaddr_storage, since it can fit v6 addresses as well. Cast values accordingly.
Aadhavan Srinivasan 0a1934fdf9 Updated TODO
Aadhavan Srinivasan 24b2a83044 Used a sockaddr_storage struct instead of a sockaddr struct, since the latter is not big enough for IPv6
Aadhavan Srinivasan 7d4fd929c7 Updated TODO
Aadhavan Srinivasan 54f7dbe7ee Modified recvAllNB() to return an empty string (instead of NULL) if there is nothing to read
Aadhavan Srinivasan 06f44d385d Allow user to quit in menu screen; better error handling.
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.
Aadhavan Srinivasan 6f292699f8 Updated header file to reflect new function
Aadhavan Srinivasan 6a40a596c1 Added new function to display text then exit
Aadhavan Srinivasan fc59a7221b Removed unnecessary #include
Aadhavan Srinivasan 7f0898c81e Updated TODO
Aadhavan Srinivasan 4001135451 Integrated upstream changes, since I forgot to pull before making local changes.
Aadhavan Srinivasan 66d7585297 Removed IP version checking code (since this is handled in the Sock constructor), and allowed server (but not client, yet) to quit game before round start
Aadhavan Srinivasan 727aeafdb9 Updated Server and Client constructor calls
Aadhavan Srinivasan 3bdfdb114c Updated TODO
Aadhavan Srinivasan f840ff9c00 Updated comment explaining function
Aadhavan Srinivasan 986e386098 Updated Server and Client constructor calls, so that they don't pass in the IP version
Aadhavan Srinivasan 53282727ec Removed testing code
Aadhavan Srinivasan d43dc41f25 Updated TODO
Aadhavan Srinivasan 0058e7e411 Removed ip_ver parameter
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.
Aadhavan Srinivasan 764f343f5d Updated TODO
Aadhavan Srinivasan cdd1db6808 Implemented IPv6 address decoding algorithm
Aadhavan Srinivasan ae044c1905 Convert character to upper-case before converting to decimal
Aadhavan Srinivasan 8011c5e8b9 Finished script to create and package statically linked binary on Linux
Aadhavan Srinivasan 24eda2d16a Updated TODO
Aadhavan Srinivasan 418579a627 Added C++ standard as a compiler flag, which is apparently needed by compilers on macOS
Aadhavan Srinivasan 6acbf90d80 Updated UNIX macro checks, to account for MacOS
Aadhavan Srinivasan 2c7d1d0b43 Started working on client-side decoding of IPv6 code
Aadhavan Srinivasan 00b83e6de2 Added bash flag to fail if any command in the script fails
Aadhavan Srinivasan 9881567009 Created a script to build statically-linked binaries on Linux
Aadhavan Srinivasan f23f307e17 Updated TODO
Aadhavan Srinivasan dd658c9c1d WROTE IN AIRPLANE: Checked edge case where the number is zero
Aadhavan Srinivasan 52f8034f4e Rudimentary support for IPv6 in server socket creation
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.