Compare commits
5 Commits
v0.2
...
ab7b40f778
Author | SHA1 | Date | |
---|---|---|---|
ab7b40f778 | |||
50ed0b89e9 | |||
1ab22651ae | |||
b6439bf7d5 | |||
1641cef13b |
@@ -5,6 +5,7 @@
|
||||
|
||||
/* Destructor - closes any open sockets */
|
||||
Client::~Client() {
|
||||
free(dest);
|
||||
close(this->other_socket);
|
||||
close(this->sock_fd);
|
||||
}
|
||||
|
@@ -4,10 +4,10 @@
|
||||
|
||||
set -o errexit # Stop executing when a command fails
|
||||
BASE_DIR=$(dirname $0)
|
||||
REL_DIR="$BASE_DIR/release/dist"
|
||||
REL_DIR="$BASE_DIR/release/dist/pong"
|
||||
RAYLIB_DLL="$BASE_DIR/build/subprojects/raylib/libraylib.dll"
|
||||
|
||||
mkdir -p "$REL_DIR"
|
||||
rm -r "$REL_DIR"; mkdir -p "$REL_DIR"
|
||||
|
||||
# Set up the build directory
|
||||
meson setup build/
|
||||
@@ -30,6 +30,9 @@ cp "$BASE_DIR/build/pong" "$REL_DIR"
|
||||
# Remove the temporary file.
|
||||
rm "$BASE_DIR/tmp_file.txt"
|
||||
|
||||
#Zip the $REL_DIR folder
|
||||
zip -r "$BASE_DIR/release/netpong-win.zip" "$REL_DIR"
|
||||
# Go to the parent directory of $REL_DIR, and zip the $REL_DIR directory. This ensures
|
||||
# that the parent directories aren't included in the zip file.
|
||||
# The command is enclosed in parantheses, to ensure that the main shell's directory
|
||||
# isn't changed.
|
||||
(cd "$REL_DIR/.." && zip -r "./netpong-win.zip" "./pong")
|
||||
|
||||
|
@@ -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;
|
||||
network = inet_to_int(results->ai_family);
|
||||
free(port_str);
|
||||
} else {
|
||||
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 */
|
||||
std::cout << "NOTHING RECEIVED" << std::endl;
|
||||
}
|
||||
free(response_array);
|
||||
}
|
||||
|
||||
/* Check to see if peer has quit the game */
|
||||
|
@@ -12,6 +12,7 @@
|
||||
|
||||
/* Destructor - closes any open sockets */
|
||||
Server::~Server() {
|
||||
free(dest);
|
||||
close(this->other_socket);
|
||||
close(this->sock_fd);
|
||||
}
|
||||
|
20
todo.txt
20
todo.txt
@@ -1,10 +1,10 @@
|
||||
1. Sign Windows executable, to remove 'Unknown Publisher' warnings.
|
||||
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.
|
||||
3. Use free() to free allocated memory.
|
||||
4. Use the struct to establish a connection, and to start each round (instead of sending strings).
|
||||
5. Figure out how to build statically-linked Mac binary, and create a build script for packaging it.
|
||||
6. Communicate the paddle reset position to the peer, after a round.
|
||||
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).
|
||||
8. Allow the user to specify which paddle they want to control, in multi-player mode.
|
||||
9. Try to make the ball go between screens.
|
||||
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).
|
||||
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. Use the struct to establish a connection, and to start each round (instead of sending strings).
|
||||
3. Figure out how to build statically-linked Mac binary, and create a build script for packaging it.
|
||||
4. Communicate the paddle reset position to the peer, after a round.
|
||||
5. 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).
|
||||
6. Allow the user to specify which paddle they want to control, in multi-player mode.
|
||||
7. Try to make the ball go between screens.
|
||||
8. 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).
|
||||
9. Create (or find) an icon for the application.
|
||||
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