Compare commits
2 Commits
1641cef13b
...
1ab22651ae
Author | SHA1 | Date | |
---|---|---|---|
1ab22651ae | |||
b6439bf7d5 |
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
/* Destructor - closes any open sockets */
|
/* Destructor - closes any open sockets */
|
||||||
Client::~Client() {
|
Client::~Client() {
|
||||||
|
free(dest);
|
||||||
close(this->other_socket);
|
close(this->other_socket);
|
||||||
close(this->sock_fd);
|
close(this->sock_fd);
|
||||||
}
|
}
|
||||||
|
@@ -133,6 +133,7 @@ SOCKET create_remote (int network,char transport, const char* address,int port,s
|
|||||||
}
|
}
|
||||||
remote_addr_struct = (struct sockaddr_storage *)results->ai_addr;
|
remote_addr_struct = (struct sockaddr_storage *)results->ai_addr;
|
||||||
network = inet_to_int(results->ai_family);
|
network = inet_to_int(results->ai_family);
|
||||||
|
free(port_str);
|
||||||
} else {
|
} else {
|
||||||
create_addr(network,address,port,remote_addr_struct);
|
create_addr(network,address,port,remote_addr_struct);
|
||||||
}
|
}
|
||||||
|
1
main.cpp
1
main.cpp
@@ -392,6 +392,7 @@ int main(int argc, char** argv) {
|
|||||||
/* If the response is NULL, that means it timed-out. In this case, there's no value to print */
|
/* If the response is NULL, that means it timed-out. In this case, there's no value to print */
|
||||||
std::cout << "NOTHING RECEIVED" << std::endl;
|
std::cout << "NOTHING RECEIVED" << std::endl;
|
||||||
}
|
}
|
||||||
|
free(response_array);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check to see if peer has quit the game */
|
/* Check to see if peer has quit the game */
|
||||||
|
@@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
/* Destructor - closes any open sockets */
|
/* Destructor - closes any open sockets */
|
||||||
Server::~Server() {
|
Server::~Server() {
|
||||||
|
free(dest);
|
||||||
close(this->other_socket);
|
close(this->other_socket);
|
||||||
close(this->sock_fd);
|
close(this->sock_fd);
|
||||||
}
|
}
|
||||||
|
20
todo.txt
20
todo.txt
@@ -1,10 +1,10 @@
|
|||||||
1. Sign Windows executable, to remove 'Unknown Publisher' warnings.
|
1. Add 'install' target to Meson, to allow the user to install the game. This should also copy the .so files to the right locations.
|
||||||
2. Add 'install' target to Meson, to allow the user to install the game. This should also copy the .so files to the right locations.
|
2. Use free() to free allocated memory.
|
||||||
3. Use free() to free allocated memory.
|
3. Use the struct to establish a connection, and to start each round (instead of sending strings).
|
||||||
4. Use the struct to establish a connection, and to start each round (instead of sending strings).
|
4. Figure out how to build statically-linked Mac binary, and create a build script for packaging it.
|
||||||
5. Figure out how to build statically-linked Mac binary, and create a build script for packaging it.
|
5. Communicate the paddle reset position to the peer, after a round.
|
||||||
6. Communicate the paddle reset position to the peer, after a round.
|
6. Clean up / refactor the raygui code in main.cpp, that asks user for game mode. Instead of just having a giant blob of code in main.cpp, maybe split it into a function, or move it to another file. It should be easy to split it into a different function, since none of the functions take any specific parameters. The text box function, for example, only takes in the rectangle coordinates, and the text to display. I can move the code to a function, and then pass in any parameters that I need to pass in (I don't think I need to pass many parameters, though).
|
||||||
7. Clean up / refactor the raygui code in main.cpp, that asks user for game mode. Instead of just having a giant blob of code in main.cpp, maybe split it into a function, or move it to another file. It should be easy to split it into a different function, since none of the functions take any specific parameters. The text box function, for example, only takes in the rectangle coordinates, and the text to display. I can move the code to a function, and then pass in any parameters that I need to pass in (I don't think I need to pass many parameters, though).
|
7. Allow the user to specify which paddle they want to control, in multi-player mode.
|
||||||
8. Allow the user to specify which paddle they want to control, in multi-player mode.
|
8. Try to make the ball go between screens.
|
||||||
9. Try to make the ball go between screens.
|
9. Change the networking code, so that a single server can connect two clients with each other. The server should provide player 1 with a code, and player 2 can connect with player 1 using that code (essentially like a room).
|
||||||
10. Change the networking code, so that a single server can connect two clients with each other. The server should provide player 1 with a code, and player 2 can connect with player 1 using that code (essentially like a room).
|
10. [This can't really be fixed, since I'd need to purchase a developer certificate] Sign Windows executable, to remove 'Unknown Publisher' warnings.
|
||||||
|
Reference in New Issue
Block a user