Aadhavan Srinivasan
c6bbe82d25
Made the 'recvAll' function return a char pointer instead of a std::string, this is better for portability. Also created a non-blocking version of the function.
10 months ago
Aadhavan Srinivasan
6d1565a020
Updated TODO; removed finished items
10 months ago
Aadhavan Srinivasan
93d3f2e13f
Added serialization C file as a dependency
10 months ago
Aadhavan Srinivasan
6eb02ab2ee
Started working on implementing serialization code into the main game loop.
...
Currently, I'm trying to serialize data and send it to the peer socket, and deserialize it at the receiving end.
10 months ago
Aadhavan Srinivasan
ded7c68ae7
Fixed misaligned bracket
10 months ago
Aadhavan Srinivasan
edfd70c3cc
Created a simple data serialization library, to serialize and deserialize the data to be sent
10 months ago
Aadhavan Srinivasan
87b436aede
Updated TODO
10 months ago
Aadhavan Srinivasan
6ad56fb9ef
Started working on client-server communication; so far, I can send the position of client to server, and vice-versa
10 months ago
Aadhavan Srinivasan
6155cb0463
Wrote code to null-terminate the string sent in sendAll, and the string received in recvAll
10 months ago
Aadhavan Srinivasan
89e1e8d45e
Worked on further implementation of the network side of things.
...
Specifically, I added code to send a message from the client, after the client is launched. This message is used to try to connect to the server. Once the server receives this message, it responds back. After the client receives this response, the connection has been established, and the game can begin.
I also added code to wait (on the client side) for the server to press the spacebar.
10 months ago
Aadhavan Srinivasan
b47b0eab28
Added new exception constants
10 months ago
Aadhavan Srinivasan
0c726be147
Updated header file to reflect recent change in implementation file
10 months ago
Aadhavan Srinivasan
7e362f0ed9
Moved the private functions out of the anonymous namespace, because I need to use them in other places
10 months ago
Aadhavan Srinivasan
f3ad4fbf99
Defined constants for TCP and UDP, instead of using the characters themselves
10 months ago
Aadhavan Srinivasan
f0e30f28e9
Updated header files to reflect recent change in implementation files
10 months ago
Aadhavan Srinivasan
4fce513211
Updated TODO
10 months ago
Aadhavan Srinivasan
9954a18171
Made the sendAll and recvAll functions in sock.cpp use variables set by the children, rather than having the functions pass parameters
10 months ago
Aadhavan Srinivasan
350b51e28b
Added additional code to easysock library
10 months ago
Aadhavan Srinivasan
ec51bcdb34
Added to TODO file
10 months ago
Aadhavan Srinivasan
b07b3fc584
Renamed 'connect-helpers' to 'connect_code'
10 months ago
Aadhavan Srinivasan
41f44797a1
Split connect_code file into header and implementation
10 months ago
Aadhavan Srinivasan
e9c0fe563c
Added additional dependencies
10 months ago
Aadhavan Srinivasan
5a8a42a828
Added comments to explain functions, and added UDP handling
10 months ago
Aadhavan Srinivasan
11d0a1a5ab
Completely rewrote Client class, and split the class into header and implementation
10 months ago
Aadhavan Srinivasan
98abf50da5
Completely rewrote Server class, and split the class into header and implementation
10 months ago
Aadhavan Srinivasan
98160f0071
Renamed 'math-helpers.hpp' to 'sign.hpp'
10 months ago
Aadhavan Srinivasan
cacc4f9d33
Included string header instead of iostream header, as this file doesn't need iostream
10 months ago
Aadhavan Srinivasan
acf8271126
Renamed 'math-helpers.hpp' to 'sign.hpp' and updated main.cpp to reflect the change
10 months ago
Aadhavan Srinivasan
3a7793bde8
Renamed header file include
10 months ago
Aadhavan Srinivasan
3d944f2ed1
Added additional header file
10 months ago
Aadhavan Srinivasan
f8b1994bde
Added additional flags for GCC
10 months ago
Aadhavan Srinivasan
13da015683
Renamed base-helpers to numeric_base, and separated numeric_base into header and implementation files
10 months ago
Aadhavan Srinivasan
a47e598b5c
Removed unnecessary comments
10 months ago
Aadhavan Srinivasan
6593384d2d
Added Paddle.cpp and Ball.cpp as dependencies
10 months ago
Aadhavan Srinivasan
17b391c1c3
Split 'paddle' class into header and implementation files
10 months ago
Aadhavan Srinivasan
86411ae907
Split 'Ball' class into header and implementation files
10 months ago
Aadhavan Srinivasan
1b1dc4a3a2
Changed include paths to relative paths, and added an agnostic struct.
...
The agnostic struct consists of a 'Mode' enum, and a 'Sock' type. The
'Sock' can be either a Server or Client, depending on the type of game.
This allows polymorphism, as I don't have to worry about whether the game
is being run in Server or Client mode, and I can call the same methods regardless.
10 months ago
Aadhavan Srinivasan
26427fa257
Added include guards to header files
10 months ago
Aadhavan Srinivasan
195d6c4b4b
Separated 'Sock' file into header and implementation file, and added include guards to header file
10 months ago
Aadhavan Srinivasan
4eaca05b68
Added 'sock.cpp' and removed include directory
10 months ago
Aadhavan Srinivasan
b7e1066b68
Changed include path to be more explicit
10 months ago
Aadhavan Srinivasan
fc041539c5
Changed Sock to Sock* in GameType struct to allow it to be set to null
10 months ago
Aadhavan Srinivasan
cb0fe1af6b
Defined a 'GameType' struct that can hold both the mode, and the relevant socket, to enable polymorphism when calling socket methods
10 months ago
Aadhavan Srinivasan
ee0c106236
Made 'Client' and 'Server' children of 'Sock' class
10 months ago
Aadhavan Srinivasan
2e6b01a9bb
Defined a parent 'socket' class that both 'Client' and 'Server' can inherit from
10 months ago
Aadhavan Srinivasan
f9bfefe3ad
Included additional header
10 months ago
Aadhavan Srinivasan
4378aa3c6a
Added code to deal with improperly formatted codes
11 months ago
Aadhavan Srinivasan
c8bc17fbce
Added additional functions for windows-specific actions
11 months ago
Aadhavan Srinivasan
4c256d8800
Added call to SockQuit at the end
11 months ago
Aadhavan Srinivasan
1f99c0929f
Updated TODO
11 months ago