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

Method OnNetMsg

src/plugin/net/src/AFCNetServerService.cpp:107–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105}
106
107void AFCNetServerService::OnNetMsg(const AFNetMsg* msg)
108{
109 auto it = net_msg_callbacks_.find(msg->GetMsgId());
110 if (it != net_msg_callbacks_.end())
111 {
112 (it->second)(msg);
113 }
114 else
115 {
116 // TODO:forward to other server process
117
118 ARK_LOG_ERROR("Invalid message, id = {}", msg->GetMsgId());
119
120 // for (const auto& iter : mxCallBackList)
121 //{
122 // (iter)(head, msg_id, msg, msg_len, session_id);
123 //}
124 }
125}
126
127void AFCNetServerService::OnNetEvent(const AFNetEvent* event)
128{

Callers

nothing calls this directly

Calls 3

GetMsgIdMethod · 0.80
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected