//------------------------------------------------------------------------ void CServerSynchedStorage::AddToEntityQueue(EntityId entityId, TSynchedKey key) { for(TChannelMap::iterator it=m_channels.begin(); it!=m_channels.end(); ++it) { if(!it->second.local) AddToEntityQueueFor(it->first, entityId, key); } }
//------------------------------------------------------------------------ bool CServerSynchedStorage::OnSetEntityMsgComplete(CClientSynchedStorage::CSetEntityMsg *pMsg, int channelId, uint32 fromSeq, bool ack) { CryAutoCriticalSection lock(m_mutex); if(ack) return true; else { // got a nack, so reque AddToEntityQueueFor(channelId, pMsg->entityId, pMsg->key); return true; } }
//------------------------------------------------------------------------ void CServerSynchedStorage::FullSynch(int channelId, bool reset) { if (reset) ResetChannel(channelId); for (TStorage::iterator it=m_channelStorage.begin(); it!=m_channelStorage.end();++it) AddToChannelQueue(channelId, it->first); for (TStorage::iterator it=m_globalStorage.begin(); it!=m_globalStorage.end();++it) AddToGlobalQueueFor(channelId, it->first); for (TEntityStorageMap::const_iterator eit=m_entityStorage.begin(); eit!=m_entityStorage.end();++eit) { const TStorage &storage=eit->second; for (TStorage::const_iterator it=storage.begin();it!=storage.end();++it) AddToEntityQueueFor(channelId, eit->first, it->first); } }