| 226 | } |
| 227 | |
| 228 | int AFCNetClientService::OnConnect(const AFNetEvent* event) |
| 229 | { |
| 230 | ARK_LOG_INFO("Connected [{}] successfully, ip={} session_id={}", AFBusAddr(event->GetBusId()).ToString(), |
| 231 | event->GetIP(), event->GetId()); |
| 232 | |
| 233 | auto connection_info = GetConnectionInfo(event->GetBusId()); |
| 234 | |
| 235 | if (connection_info != nullptr) |
| 236 | { |
| 237 | AddServerNode(connection_info); |
| 238 | connection_info->net_state_ = AFConnectionData::CONNECTED; |
| 239 | |
| 240 | // add server-bus-id -> client-bus-id |
| 241 | m_pNetServiceManagerModule->AddNetConnectionBus(event->GetBusId(), connection_info->net_client_); |
| 242 | } |
| 243 | |
| 244 | return 0; |
| 245 | } |
| 246 | |
| 247 | int AFCNetClientService::OnDisconnect(const AFNetEvent* event) |
| 248 | { |
nothing calls this directly
no test coverage detected