MCPcopy Create free account
hub / github.com/OpenArkStudio/ARK / OnConnect

Method OnConnect

src/plugin/net/src/AFCNetClientService.cpp:228–245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

226}
227
228int 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
247int AFCNetClientService::OnDisconnect(const AFNetEvent* event)
248{

Callers

nothing calls this directly

Calls 5

AFBusAddrFunction · 0.85
GetBusIdMethod · 0.80
GetIdMethod · 0.80
AddNetConnectionBusMethod · 0.80
ToStringMethod · 0.45

Tested by

no test coverage detected