| 185 | } |
| 186 | |
| 187 | std::string GrContext::MakeDesktopLinkMessage(const std::vector<EthernetInfo>& info) { |
| 188 | json obj; |
| 189 | // device |
| 190 | // device_id |
| 191 | obj["did"] = settings_->GetDeviceId(); |
| 192 | obj["dn"] = settings_->GetDeviceName(); |
| 193 | // random passwor |
| 194 | obj["rpwd"] = settings_->GetDeviceRandomPwd(); |
| 195 | obj["iidx"] = this->GetIndexByUniqueId(); |
| 196 | // ips |
| 197 | auto ip_array = json::array(); |
| 198 | std::vector<EthernetInfo> ips = info; |
| 199 | if (info.empty()) { |
| 200 | ips = this->GetIps(); |
| 201 | } |
| 202 | |
| 203 | for (auto& item : ips) { |
| 204 | json ip_obj; |
| 205 | ip_obj["ip"] = item.ip_addr_; |
| 206 | //ip_obj["type"] = "";//item.nt_type_ == IPNetworkType::kWired ? "WIRED" : "WIRELESS"; |
| 207 | ip_array.push_back(ip_obj); |
| 208 | } |
| 209 | obj["ips"] = ip_array; |
| 210 | |
| 211 | // panel_srv_port |
| 212 | obj["ppt"] = settings_->GetPanelServerPort(); |
| 213 | // render_srv_port |
| 214 | obj["rdpt"] = settings_->GetRenderServerPort(); |
| 215 | // relay_host |
| 216 | obj["rlst"] = settings_->GetRelayServerHost(); |
| 217 | // relay_port |
| 218 | obj["rlpt"] = settings_->GetRelayServerPort(); |
| 219 | // relay_appkey |
| 220 | obj["rlak"] = grApp->GetAppkey(); |
| 221 | return obj.dump(); |
| 222 | } |
| 223 | |
| 224 | std::shared_ptr<DBGameOperator> GrContext::GetDBGameManager() { |
| 225 | return db_game_manager_; |
no test coverage detected