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

Method ProcessLeaveGroup

src/server/game/src/AFCGameNetModule.cpp:234–278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

232}
233
234bool AFCGameNetModule::ProcessLeaveGroup(const AFGUID& self, int map_id, int old_inst_id)
235{
236 if (old_inst_id <= 0)
237 {
238 return false;
239 }
240
241 AFCDataList valueAllOldObjectList;
242 AFCDataList valueAllOldPlayerList;
243 m_pMapModule->GetInstEntityList(map_id, old_inst_id, valueAllOldObjectList);
244
245 if (valueAllOldObjectList.GetCount() > 0)
246 {
247 //broadcast self to others around
248 for (size_t i = 0; i < valueAllOldObjectList.GetCount(); i++)
249 {
250 AFGUID identBC = valueAllOldObjectList.Int64(i);
251 auto pEntity = m_pKernelModule->GetEntity(identBC);
252 if (pEntity == nullptr)
253 {
254 continue;
255 }
256
257 if (valueAllOldObjectList.Int64(i) == self)
258 {
259 valueAllOldObjectList.SetInt64(i, 0);
260 }
261
262 const std::string& class_name = pEntity->GetClassName();
263 if (AFEntityMetaPlayer::self_name() == class_name)
264 {
265 valueAllOldPlayerList << identBC;
266 }
267 }
268
269 OnEntityListLeave(valueAllOldPlayerList, AFCDataList() << self);
270
271 //broadcast self that leave the map
272 OnEntityListLeave(AFCDataList() << self, valueAllOldObjectList);
273 }
274
275 m_pKernelModule->DoEvent(self, AFED_ON_CLIENT_LEAVE_SCENE, AFCDataList() << old_inst_id);
276
277 return true;
278}
279
280bool AFCGameNetModule::ProcessEnterGroup(const AFGUID& self, int nSceneID, int nNewGroupID)
281{

Callers

nothing calls this directly

Calls 6

GetInstEntityListMethod · 0.80
Int64Method · 0.80
GetEntityMethod · 0.80
GetCountMethod · 0.45
SetInt64Method · 0.45
DoEventMethod · 0.45

Tested by

no test coverage detected