| 1009 | } |
| 1010 | |
| 1011 | void 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 | |
| 1043 | void MapInstance::on_combine_enhancements(CombineEnhancementsReq *ev) |
| 1044 | { |
nothing calls this directly
no test coverage detected