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

Method OnViewDataNodeEnter

src/server/game/src/AFCGameNetModule.cpp:114–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112//}
113
114int AFCGameNetModule::OnViewDataNodeEnter(const AFIDataList& argVar, const AFGUID& self)
115{
116 if (argVar.GetCount() <= 0 || self == 0)
117 {
118 return 1;
119 }
120
121 std::shared_ptr<AFIEntity> pEntity = m_pKernelModule->GetEntity(self);
122 if (nullptr == pEntity)
123 {
124 return 0;
125 }
126
127 AFMsg::multi_entity_data_list msg;
128 AFMsg::pb_entity* entity = msg.add_data_list();
129 entity->set_id(self);
130
131 ArkMaskType mask;
132 mask[(size_t)ArkDataMask::PF_SYNC_VIEW] = 1;
133 m_pKernelModule->EntityNodeToPBData(pEntity, entity->mutable_data(), mask);
134
135 for (size_t i = 0; i < argVar.GetCount(); i++)
136 {
137 AFGUID identOther = argVar.Int64(i);
138
139 if (self != identOther)
140 {
141 SendMsgPBToGate(AFMsg::EGMI_ACK_ENTITY_DATA_NODE_ENTER, msg, identOther);
142 }
143 }
144
145 return 0;
146}
147
148int AFCGameNetModule::OnSelfDataNodeEnter(const AFGUID& self)
149{

Callers

nothing calls this directly

Calls 4

GetEntityMethod · 0.80
EntityNodeToPBDataMethod · 0.80
Int64Method · 0.80
GetCountMethod · 0.45

Tested by

no test coverage detected