mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-26 12:15:34 +08:00
[fix] fix client id generation
This commit is contained in:
@@ -58,10 +58,11 @@ class Render {
|
|||||||
|
|
||||||
static void OnSignalStatusCb(SignalStatus status, void *user_data);
|
static void OnSignalStatusCb(SignalStatus status, void *user_data);
|
||||||
|
|
||||||
static void OnConnectionStatusCb(ConnectionStatus status, void *user_data);
|
static void OnConnectionStatusCb(ConnectionStatus status, const char *user_id,
|
||||||
|
size_t user_id_size, void *user_data);
|
||||||
|
|
||||||
static void NetStatusReport(int client_id, TraversalMode mode,
|
static void NetStatusReport(const char *client_id, size_t client_id_size,
|
||||||
const unsigned short send,
|
TraversalMode mode, const unsigned short send,
|
||||||
const unsigned short receive, void *user_data);
|
const unsigned short receive, void *user_data);
|
||||||
|
|
||||||
static SDL_HitTestResult HitTestCallback(SDL_Window *window,
|
static SDL_HitTestResult HitTestCallback(SDL_Window *window,
|
||||||
|
|||||||
@@ -240,7 +240,8 @@ void Render::OnSignalStatusCb(SignalStatus status, void *user_data) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Render::OnConnectionStatusCb(ConnectionStatus status, void *user_data) {
|
void Render::OnConnectionStatusCb(ConnectionStatus status, const char *user_id,
|
||||||
|
const size_t user_id_size, void *user_data) {
|
||||||
Render *render = (Render *)user_data;
|
Render *render = (Render *)user_data;
|
||||||
if (!render) {
|
if (!render) {
|
||||||
return;
|
return;
|
||||||
@@ -309,20 +310,18 @@ void Render::OnConnectionStatusCb(ConnectionStatus status, void *user_data) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Render::NetStatusReport(int client_id, TraversalMode mode,
|
void Render::NetStatusReport(const char *client_id, size_t client_id_size,
|
||||||
const unsigned short send,
|
TraversalMode mode, const unsigned short send,
|
||||||
const unsigned short receive, void *user_data) {
|
const unsigned short receive, void *user_data) {
|
||||||
Render *render = (Render *)user_data;
|
Render *render = (Render *)user_data;
|
||||||
if (!render) {
|
if (!render) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (client_id != 0 && 0 == strcmp(render->client_id_, "")) {
|
if (0 == strcmp(render->client_id_, "")) {
|
||||||
std::string client_id_s = std::to_string(client_id);
|
|
||||||
memset(&render->client_id_, 0, sizeof(render->client_id_));
|
memset(&render->client_id_, 0, sizeof(render->client_id_));
|
||||||
strncpy(render->client_id_, client_id_s.c_str(),
|
strncpy(render->client_id_, client_id, client_id_size);
|
||||||
sizeof(render->client_id_));
|
LOG_INFO("Use client id [{}] and save id into cache file", client_id);
|
||||||
LOG_INFO("Use client id [{}] and save id into cache file", client_id_s);
|
|
||||||
render->SaveSettingsIntoCacheFile();
|
render->SaveSettingsIntoCacheFile();
|
||||||
}
|
}
|
||||||
if (mode != TraversalMode::UnknownMode) {
|
if (mode != TraversalMode::UnknownMode) {
|
||||||
|
|||||||
2
thirdparty/projectx
vendored
2
thirdparty/projectx
vendored
Submodule thirdparty/projectx updated: 35d4f522c5...9d2e6f0c2a
Reference in New Issue
Block a user