From ef4a83dc883af8e5f2829c11e2e0ec38f3ce1c9c Mon Sep 17 00:00:00 2001 From: MysterD Date: Sun, 10 Apr 2022 10:11:13 -0700 Subject: [PATCH] Quick fixes for test --- autogen/lua_definitions/constants.lua | 2 +- autogen/lua_definitions/functions.lua | 5 +++++ developer/network.sh | 14 +++++++------- docs/lua/functions.md | 19 +++++++++++++++++++ src/pc/lua/smlua_constants_autogen.c | 2 +- src/pc/lua/smlua_functions_autogen.c | 10 ++++++++++ src/pc/network/network.h | 2 +- src/pc/network/packets/packet.h | 2 +- src/pc/network/packets/packet_mod_list.c | 2 +- 9 files changed, 46 insertions(+), 12 deletions(-) diff --git a/autogen/lua_definitions/constants.lua b/autogen/lua_definitions/constants.lua index e4e40d0c..f8df6758 100644 --- a/autogen/lua_definitions/constants.lua +++ b/autogen/lua_definitions/constants.lua @@ -4376,7 +4376,7 @@ MAX_SYNC_OBJECTS = 256 MAX_SYNC_OBJECT_FIELDS = 64 --- @type integer -PACKET_LENGTH = 2048 +PACKET_LENGTH = 3000 --- @type integer SYNC_DISTANCE_INFINITE = 0 diff --git a/autogen/lua_definitions/functions.lua b/autogen/lua_definitions/functions.lua index 5534b73e..fab661b0 100644 --- a/autogen/lua_definitions/functions.lua +++ b/autogen/lua_definitions/functions.lua @@ -7026,6 +7026,11 @@ function smlua_audio_utils_replace_sequence(sequenceId, bankId, defaultVolume, m -- ... end +--- @return nil +function smlua_audio_utils_reset_all() + -- ... +end + --- @param startX number --- @param startY number --- @param startZ number diff --git a/developer/network.sh b/developer/network.sh index 40b62a4e..f44dd6a0 100755 --- a/developer/network.sh +++ b/developer/network.sh @@ -16,10 +16,10 @@ if [ ! -f "$FILE" ]; then fi # no debug, direct -$FILE --server 27015 --configfile sm64config_server.txt & -sleep 2 -$FILE --client 127.0.0.1 27015 --configfile sm64config_client.txt & -exit +#$FILE --server 27015 --configfile sm64config_server.txt & +#sleep 2 +#$FILE --client 127.0.0.1 27015 --configfile sm64config_client.txt & +#exit # no debug, discord #$FILE --discord 2 --configfile sm64config_server.txt & @@ -27,9 +27,9 @@ exit #exit # debug on server -#$FILE --client 127.0.0.1 27015 --configfile sm64config_client.txt & > /dev/null -#$WINPTY cgdb $FILE -ex 'break debug_breakpoint_here' -ex 'run --server 27015 --configfile sm64config_server.txt' -ex 'quit' -#exit +$FILE --client 127.0.0.1 27015 --configfile sm64config_client.txt & > /dev/null +$WINPTY cgdb $FILE -ex 'break debug_breakpoint_here' -ex 'run --server 27015 --configfile sm64config_server.txt' -ex 'quit' +exit # debug on client $FILE --server 27015 --configfile sm64config_server.txt & > /dev/null diff --git a/docs/lua/functions.md b/docs/lua/functions.md index 84a95d83..3039c51f 100644 --- a/docs/lua/functions.md +++ b/docs/lua/functions.md @@ -1304,6 +1304,7 @@ - smlua_audio_utils.h - [smlua_audio_utils_replace_sequence](#smlua_audio_utils_replace_sequence) + - [smlua_audio_utils_reset_all](#smlua_audio_utils_reset_all)
@@ -24584,6 +24585,24 @@ The `reliable` field will ensure that the packet arrives, but should be used spa
+## [smlua_audio_utils_reset_all](#smlua_audio_utils_reset_all) + +### Lua Example +`smlua_audio_utils_reset_all()` + +### Parameters +- None + +### Returns +- None + +### C Prototype +`void smlua_audio_utils_reset_all(void);` + +[:arrow_up_small:](#) + +
+ --- # functions from smlua_collision_utils.h diff --git a/src/pc/lua/smlua_constants_autogen.c b/src/pc/lua/smlua_constants_autogen.c index 056f13a9..74f5b125 100644 --- a/src/pc/lua/smlua_constants_autogen.c +++ b/src/pc/lua/smlua_constants_autogen.c @@ -1645,7 +1645,7 @@ char gSmluaConstants[] = "" "SYNC_DISTANCE_INFINITE = 0\n" "MAX_SYNC_OBJECTS = 256\n" "MAX_SYNC_OBJECT_FIELDS = 64\n" -"PACKET_LENGTH = 2048\n" +"PACKET_LENGTH = 3000\n" "NS_SOCKET = 0\n" "NS_DISCORD = 1\n" "PLAYER_INTERACTIONS_NONE = 0\n" diff --git a/src/pc/lua/smlua_functions_autogen.c b/src/pc/lua/smlua_functions_autogen.c index 525f7c19..5233986b 100644 --- a/src/pc/lua/smlua_functions_autogen.c +++ b/src/pc/lua/smlua_functions_autogen.c @@ -14637,6 +14637,15 @@ int smlua_func_smlua_audio_utils_replace_sequence(lua_State* L) { return 1; } +int smlua_func_smlua_audio_utils_reset_all(UNUSED lua_State* L) { + if(!smlua_functions_valid_param_count(L, 0)) { return 0; } + + + smlua_audio_utils_reset_all(); + + return 1; +} + ///////////////////////////// // smlua_collision_utils.h // ///////////////////////////// @@ -16973,6 +16982,7 @@ void smlua_bind_functions_autogen(void) { // smlua_audio_utils.h smlua_bind_function(L, "smlua_audio_utils_replace_sequence", smlua_func_smlua_audio_utils_replace_sequence); + smlua_bind_function(L, "smlua_audio_utils_reset_all", smlua_func_smlua_audio_utils_reset_all); // smlua_collision_utils.h smlua_bind_function(L, "collision_find_surface_on_ray", smlua_func_collision_find_surface_on_ray); diff --git a/src/pc/network/network.h b/src/pc/network/network.h index ca1c7923..d57ef4d8 100644 --- a/src/pc/network/network.h +++ b/src/pc/network/network.h @@ -22,7 +22,7 @@ extern struct MarioState gMarioStates[]; #define SYNC_DISTANCE_INFINITE 0 #define MAX_SYNC_OBJECTS 256 // note: increasing this requires code to be rewritten #define MAX_SYNC_OBJECT_FIELDS 64 -#define PACKET_LENGTH 2048 +#define PACKET_LENGTH 3000 #define NETWORKTYPESTR (gNetworkType == NT_CLIENT \ ? "Client" \ : (gNetworkType == NT_SERVER ? "Server" : " None ")) \ diff --git a/src/pc/network/packets/packet.h b/src/pc/network/packets/packet.h index 7e8da0af..5b32c283 100644 --- a/src/pc/network/packets/packet.h +++ b/src/pc/network/packets/packet.h @@ -7,7 +7,7 @@ #include #include -#define PACKET_LENGTH 2048 +#define PACKET_LENGTH 3000 #define PACKET_DESTINATION_BROADCAST ((u8)-1) struct NetworkPlayer; diff --git a/src/pc/network/packets/packet_mod_list.c b/src/pc/network/packets/packet_mod_list.c index f2fd7149..b3f00b0e 100644 --- a/src/pc/network/packets/packet_mod_list.c +++ b/src/pc/network/packets/packet_mod_list.c @@ -170,7 +170,7 @@ void network_receive_mod_list(struct Packet* p) { packet_read(p, &relativePathLength, sizeof(u16)); packet_read(p, file->relativePath, relativePathLength * sizeof(u8)); packet_read(p, &file->size, sizeof(u64)); - if (mod->isDirectory && !strstr(file->relativePath, "actors") && !strstr(file->relativePath, "levels")) { + if (mod->isDirectory && !strstr(file->relativePath, "actors") && !strstr(file->relativePath, "levels") && !strstr(file->relativePath, "sound")) { char tmp[SYS_MAX_PATH]; if (snprintf(tmp, SYS_MAX_PATH, "%s-%s", mod->relativePath, file->relativePath) >= 0) { memcpy(file->relativePath, tmp, strlen(tmp) + 1);