MCPcopy Create free account
hub / github.com/Segs/Segs / sendState

Method sendState

Projects/CoX/Servers/MapServer/MapInstance.cpp:1011–1041  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1009}
1010
1011void MapInstance::sendState()
1012{
1013 if(m_session_store.num_sessions()==0)
1014 return;
1015
1016 auto iter=m_session_store.begin();
1017 auto end=m_session_store.end();
1018
1019 for(;iter!=end; ++iter)
1020 {
1021 MapClientSession *cl = *iter;
1022 if(!cl->m_in_map)
1023 continue;
1024
1025 EntitiesResponse *res = new EntitiesResponse();
1026 res->m_map_time_of_day = m_world->time_of_day();
1027 //while cl->m_in_map==false we send full updates until client `resumes`
1028 res->ent_major_update = true;
1029 res->abs_time = 30 * 100 * (m_world->accumulated_time);
1030 buildEntityResponse(res, *cl, cl->m_in_map ? EntityUpdateMode::INCREMENTAL : EntityUpdateMode::FULL, false);
1031 cl->link()->putq(res);
1032 }
1033
1034 // This is handling instance-wide timers
1035
1036 //TODO: Move timer processing to per-client EventHandler ?
1037 //1. Find the client that this timer corresponds to.
1038 //2. Call appropriate method ( keep-alive, Entities update etc .. )
1039 //3. Maybe use one timer for all links ?
1040
1041}
1042
1043void MapInstance::on_combine_enhancements(CombineEnhancementsReq *ev)
1044{

Callers

nothing calls this directly

Calls 7

buildEntityResponseFunction · 0.85
num_sessionsMethod · 0.80
time_of_dayMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
putqMethod · 0.45
linkMethod · 0.45

Tested by

no test coverage detected