MCPcopy Create free account
hub / github.com/RGAA-Software/GoDesk / ProcessNetworkMessage

Method ProcessNetworkMessage

src/client/ct_base_workspace.cpp:1221–1248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1219 }
1220
1221 void BaseWorkspace::ProcessNetworkMessage(const std::shared_ptr<tc::Message>& msg) {
1222 if (msg->type() == MessageType::kDisconnectConnection) {
1223 const auto& sub = msg->disconnect_connection();
1224 LOGI("DISCONNECT, device id: {}, stream id: {}", sub.device_id(), sub.stream_id());
1225 remote_force_closed_ = true;
1226 context_->PostUITask([=, this]() {
1227 TcDialog dialog(tcTr("id_warning"), tcTr("id_remote_disconnected"), this);
1228 dialog.exec();
1229 Exit();
1230 });
1231 context_->SendAppMessage(MsgStopTheWorld{});
1232 ExitSdk();
1233 }
1234 else if (msg->type() == MessageType::kHardwareInfo) {
1235 context_->PostTask([=, this]() {
1236 const auto& hw_info = msg->hw_info().hw_info();
1237 const auto freq = msg->hw_info().current_cpu_freq();
1238 auto sys_info = HWInfoParser::ParseHWInfo(msg->hw_info().hw_info(), freq);
1239 if (!sys_info) {
1240 return;
1241 }
1242 context_->SendAppMessage(MsgHWInfo {
1243 .info_ = sys_info,
1244 });
1245 //LOGI("SysInfo: {}", to_string(*sys_info.get()));
1246 });
1247 }
1248 }
1249
1250 bool BaseWorkspace::nativeEvent(const QByteArray& eventType, void* message, qintptr* result) {
1251#ifdef WIN32

Callers 1

Calls 3

PostUITaskMethod · 0.45
SendAppMessageMethod · 0.45
PostTaskMethod · 0.45

Tested by

no test coverage detected