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

Method SendMsgByAppType

src/plugin/bus/src/AFCMsgModule.cpp:113–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111//}
112
113bool AFCMsgModule::SendMsgByAppType(const ARK_APP_TYPE app_type, const int msg_id, const google::protobuf::Message& msg,
114 const AFGUID& guid /* = NULL_GUID*/)
115{
116 auto pClientService = m_pNetServiceManagerModule->GetClientService(app_type);
117 if (pClientService == nullptr)
118 {
119 ARK_LOG_ERROR("net client service not be found, src_bus={} app_type={} msg_id={} actor_id={}",
120 m_pBusModule->GetSelfBusID(), (uint8_t)app_type, msg_id, guid);
121 return false;
122 }
123
124 auto busid = m_pBusModule->GetSelfBusID();
125 auto pConnetionInfo = pClientService->GetSuitableConnect(AFMisc::ToString(busid));
126 if (pConnetionInfo == nullptr)
127 {
128 ARK_LOG_ERROR("connection info not be found, src_bus={} app_type={} msg_id={} actor_id={}",
129 m_pBusModule->GetSelfBusID(), (uint8_t)app_type, msg_id, guid);
130 return false;
131 }
132
133 return SendMsg(pConnetionInfo->net_client_, busid, pConnetionInfo->server_bus_id_, msg_id, msg, guid);
134}
135
136bool AFCMsgModule::SendMsgByBusID(
137 const int bus_id, const int msg_id, const google::protobuf::Message& msg, const AFGUID& guid /* = NULL_GUID*/)

Callers

nothing calls this directly

Calls 4

ToStringFunction · 0.85
GetClientServiceMethod · 0.80
GetSelfBusIDMethod · 0.80
GetSuitableConnectMethod · 0.80

Tested by

no test coverage detected