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

Method SendToView

src/plugin/kernel/src/AFCKernelModule.cpp:1169–1199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1167}
1168
1169int AFCKernelModule::SendToView(const AFGUID& self, const google::protobuf::Message& msg)
1170{
1171 auto pEntity = GetEntity(self);
1172 if (nullptr == pEntity)
1173 {
1174 return -1;
1175 }
1176
1177 auto map_id = pEntity->GetMapID();
1178 auto inst_id = pEntity->GetMapEntityID();
1179
1180 AFCDataList map_inst_entity_list;
1181 m_pMapModule->GetInstEntityList(map_id, inst_id, map_inst_entity_list);
1182
1183 for (size_t i = 0; i < map_inst_entity_list.GetCount(); i++)
1184 {
1185 auto pViewEntity = GetEntity(map_inst_entity_list.Int64(i));
1186 if (pViewEntity == nullptr)
1187 {
1188 continue;
1189 }
1190
1191 const std::string& strObjClassName = pViewEntity->GetClassName();
1192 if (AFEntityMetaPlayer::self_name() == strObjClassName)
1193 {
1194 SendToSelf(pViewEntity->GetID(), msg);
1195 }
1196 }
1197
1198 return 0;
1199}
1200
1201int AFCKernelModule::SendToSelf(const AFGUID& self, const google::protobuf::Message& msg)
1202{

Callers

nothing calls this directly

Calls 5

GetMapIDMethod · 0.80
GetMapEntityIDMethod · 0.80
GetInstEntityListMethod · 0.80
Int64Method · 0.80
GetCountMethod · 0.45

Tested by

no test coverage detected