From f100f785dafa108bbf5b40ea8e425e08236f981a Mon Sep 17 00:00:00 2001 From: nmzik Date: Sat, 19 Sep 2026 05:02:27 +0400 Subject: [PATCH] libs: fill controller and broadcast status outputs --- src/libs/controller.cpp | 14 ++++++++++++++ src/libs/controller.h | 1 + src/libs/libNet.cpp | 41 +++++++++++++++++++++++++++++++++++++++++ src/libs/libPad.cpp | 1 + 4 files changed, 57 insertions(+) diff --git a/src/libs/controller.cpp b/src/libs/controller.cpp index 778ee5019..f55f97f8f 100644 --- a/src/libs/controller.cpp +++ b/src/libs/controller.cpp @@ -812,6 +812,20 @@ int KYTY_SYSV_ABI PadGetControllerInformation(int handle, PadControllerInformati return OK; } +int KYTY_SYSV_ABI PadIsRemoteController(int handle, bool* is_remote) { + PRINT_NAME(); + + if (handle != 1) { + return PAD_ERROR_INVALID_HANDLE; + } + if (is_remote == nullptr) { + return PAD_ERROR_INVALID_ARG; + } + + *is_remote = false; + return OK; +} + int KYTY_SYSV_ABI PadReadState(int handle, PadData* data) { PRINT_NAME(); diff --git a/src/libs/controller.h b/src/libs/controller.h index 851c9a9c8..bdbcb9755 100644 --- a/src/libs/controller.h +++ b/src/libs/controller.h @@ -81,6 +81,7 @@ int KYTY_SYSV_ABI PadSetMotionSensorState(int handle, bool enable); int KYTY_SYSV_ABI PadSetAngularVelocityDeadbandState(int handle, bool enable); int KYTY_SYSV_ABI PadResetOrientation(int handle); int KYTY_SYSV_ABI PadGetControllerInformation(int handle, PadControllerInformation* info); +int KYTY_SYSV_ABI PadIsRemoteController(int handle, bool* is_remote); int KYTY_SYSV_ABI PadReadState(int handle, PadData* data); int KYTY_SYSV_ABI PadRead(int handle, PadData* data, int num); int KYTY_SYSV_ABI PadSetVibration(int handle, const PadVibrationParam* param); diff --git a/src/libs/libNet.cpp b/src/libs/libNet.cpp index 68fcc397f..0e0b22793 100644 --- a/src/libs/libNet.cpp +++ b/src/libs/libNet.cpp @@ -8,6 +8,7 @@ #include "loader/symbolDatabase.h" #include +#include #include #include #include @@ -3721,6 +3722,21 @@ namespace LibGameLiveStreaming { LIB_VERSION("GameLiveStreaming", 1, "GameLiveStreaming", 1, 1); +constexpr int GAME_LIVE_STREAMING_ERROR_INVALID_PARAM = -2136997886; + +struct GameLiveStreamingStatus2 { + int32_t user_id; + bool is_on_air; + uint32_t spectator_count; + uint32_t text_message_count; + uint32_t command_message_count; + uint8_t reserved[52]; +}; + +static_assert(sizeof(GameLiveStreamingStatus2) == 72); +static_assert(offsetof(GameLiveStreamingStatus2, is_on_air) == 4); +static_assert(offsetof(GameLiveStreamingStatus2, spectator_count) == 8); + static int KYTY_SYSV_ABI GameLiveStreamingInitialize(size_t heap_size) { PRINT_NAME(); @@ -3735,9 +3751,34 @@ static int KYTY_SYSV_ABI GameLiveStreamingTerminate() { return 0; } +static int KYTY_SYSV_ABI GameLiveStreamingGetCurrentStatus2(GameLiveStreamingStatus2* status) { + PRINT_NAME(); + + if (status == nullptr) { + return GAME_LIVE_STREAMING_ERROR_INVALID_PARAM; + } + + std::memset(status, 0, sizeof(*status)); + status->user_id = -1; + return OK; +} + +static int KYTY_SYSV_ABI GameLiveStreamingGetSocialFeedbackMessagesCount(int type, uint32_t* count) { + PRINT_NAME(); + + if (type < 1 || type > 3 || count == nullptr) { + return GAME_LIVE_STREAMING_ERROR_INVALID_PARAM; + } + + *count = 0; + return OK; +} + LIB_DEFINE(InitPlatform_1_GameLiveStreaming) { LIB_FUNC("kvYEw2lBndk", LibGameLiveStreaming::GameLiveStreamingInitialize); LIB_FUNC("9yK6Fk8mKOQ", LibGameLiveStreaming::GameLiveStreamingTerminate); + LIB_FUNC("lK8dLBNp9OE", LibGameLiveStreaming::GameLiveStreamingGetCurrentStatus2); + LIB_FUNC("yeQKjHETi40", LibGameLiveStreaming::GameLiveStreamingGetSocialFeedbackMessagesCount); } } // namespace LibGameLiveStreaming diff --git a/src/libs/libPad.cpp b/src/libs/libPad.cpp index 9d8fa5c4e..38e9c1d6d 100644 --- a/src/libs/libPad.cpp +++ b/src/libs/libPad.cpp @@ -206,6 +206,7 @@ LIB_DEFINE(InitPad_1) { LIB_FUNC("rIZnR6eSpvk", Controller::PadResetOrientation); LIB_FUNC("vDLMoJLde8I", PadSetTiltCorrectionState); LIB_FUNC("gjP9-KQzoUk", Controller::PadGetControllerInformation); + LIB_FUNC("fCWdlnmB1Ks", Controller::PadIsRemoteController); LIB_FUNC("hGbf2QTBmqc", PadGetExtControllerInformationStub); LIB_FUNC("2JgFB2n9oUM", Controller::PadSetTriggerEffect); LIB_FUNC("YndgXqQVV7c", Controller::PadReadState);