[fix] use serialize and deserialize function to process RemoteAction::HostInfo

This commit is contained in:
dijunkun
2025-05-15 17:52:40 +08:00
parent a6beb48b1f
commit 0a1014dded
4 changed files with 106 additions and 17 deletions

View File

@@ -192,6 +192,13 @@ class Render {
static SDL_HitTestResult HitTestCallback(SDL_Window *window,
const SDL_Point *area, void *data);
static std::vector<char> SerializeRemoteAction(const RemoteAction &action);
static bool DeserializeRemoteAction(const char *data, size_t size,
RemoteAction &out);
static void FreeRemoteAction(RemoteAction &action);
private:
int SendKeyCommand(int key_code, bool is_down);
int ProcessMouseEvent(SDL_Event &event);
@@ -320,7 +327,7 @@ class Render {
bool need_to_rejoin_ = false;
bool just_created_ = false;
std::string controlled_remote_id_ = "";
bool host_info_sent_ = false;
bool need_to_send_host_info_ = false;
SDL_Event last_mouse_event;
// stream window render