1
This commit is contained in:
parent
7a2e5ffbf2
commit
ee268025da
@ -35,16 +35,17 @@ void BatchSync::AddGlobalObject(Creature* c)
|
||||
sync_obj.pos = c->GetPos().ToGlmVec3();
|
||||
sync_obj.dir = c->GetAttackDir();
|
||||
sync_obj.last_sync_frameno = 0;
|
||||
|
||||
#if 0
|
||||
global_object_hash_[c->GetUniId()] =
|
||||
std::make_tuple(timer_wp, sync_obj);
|
||||
#endif
|
||||
}
|
||||
|
||||
void BatchSync::RemoveGlobalObject(int obj_uniid)
|
||||
{
|
||||
auto itr = global_object_hash_.find(obj_uniid);
|
||||
if (itr != global_object_hash_.end()) {
|
||||
f8::Timer::Instance()->Delete(std::get<0>(itr->second));
|
||||
f8::Timer::Instance()->Delete(std::get<0>(*itr->second));
|
||||
global_object_hash_.erase(itr);
|
||||
}
|
||||
}
|
||||
@ -76,8 +77,10 @@ void BatchSync::AddTeam(Team* team)
|
||||
sync_objects.push_back(sync_obj);
|
||||
return true;
|
||||
});
|
||||
#if 0
|
||||
team_hash_[team] =
|
||||
std::make_tuple(timer_wp, sync_objects);
|
||||
#endif
|
||||
}
|
||||
|
||||
void BatchSync::UpdateTeam(Team* team)
|
||||
@ -90,7 +93,7 @@ void BatchSync::RemoveTeam(Team* team)
|
||||
{
|
||||
auto itr = team_hash_.find(team);
|
||||
if (itr != team_hash_.end()) {
|
||||
f8::Timer::Instance()->Delete(std::get<0>(itr->second));
|
||||
f8::Timer::Instance()->Delete(std::get<0>(*itr->second));
|
||||
team_hash_.erase(itr);
|
||||
}
|
||||
}
|
||||
|
@ -29,6 +29,6 @@ class BatchSync
|
||||
private:
|
||||
Room* room_ = nullptr;
|
||||
f8::Attacher timer_attacher_;
|
||||
std::map<int, std::tuple<f8::TimerWp, SyncObject>> global_object_hash_;
|
||||
std::map<Team*, std::tuple<f8::TimerWp, std::vector<SyncObject>>> team_hash_;
|
||||
std::map<int, std::shared_ptr<std::tuple<f8::TimerWp, SyncObject>>> global_object_hash_;
|
||||
std::map<Team*, std::shared_ptr<std::tuple<f8::TimerWp, std::vector<SyncObject>>>> team_hash_;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user