void CServerSynchedStorage::Reset()
{
	CryAutoCriticalSection lock(m_mutex);

	CSynchedStorage::Reset();

	for(TChannelMap::const_iterator it=m_channels.begin(); it!=m_channels.end(); ++it)
		ResetChannel(it->first);
}
Beispiel #2
0
//------------------------------------------------------------------------
void CServerGameTokenSynch::FullSynch(int channelId, bool reset)
{
    if(reset)
        ResetChannel(channelId);

    IGameTokenItPtr pIt(m_pGTS->GetGameTokenIterator());

    while(IGameToken *pGameToken=pIt->Next())
    {
        if((pGameToken->GetFlags()&EGAME_TOKEN_MODIFIED) && ((pGameToken->GetFlags()&EGAME_TOKEN_LOCALONLY)==0))
            AddToQueueFor(channelId, pGameToken->GetName());
    }
}
Beispiel #3
0
//------------------------------------------------------------------------
void CServerGameTokenSynch::OnClientDisconnect(int channelId, bool onhold)
{
    SChannel *pChannel=GetChannel(channelId);

    if(pChannel)
        pChannel->pNetChannel=0;

    if(!onhold)
        m_channels.erase(channelId);
    else if(pChannel)
        pChannel->onhold=onhold;

    ResetChannel(channelId);
}
//------------------------------------------------------------------------
void CServerSynchedStorage::OnClientDisconnect(int channelId, bool onhold)
{
	SChannel *pChannel=GetChannel(channelId);
	if (pChannel)
		pChannel->pNetChannel=0;

	if (!onhold)
		m_channels.erase(channelId);
	else
		pChannel->onhold=onhold;
//	m_globalQueue.erase(channelId);
//	m_entityQueue.erase(channelId);

	ResetChannel(channelId);
}
Beispiel #5
0
void CChannelHandler::InitChannel(CAPU *pAPU, int *pVibTable, CFamiTrackerDoc *pDoc)
{
	// Called from main thread

	m_pAPU = pAPU;
	m_pVibratoTable = pVibTable;
	m_pDocument = pDoc;

	m_bDelayEnabled = false;

	m_iEffect = 0;

	m_iVibratoStyle = VIBRATO_NEW;

	ResetChannel();
}
//------------------------------------------------------------------------
void CServerSynchedStorage::OnClientConnect(int channelId)
{
	INetChannel *pNetChannel=g_pGame->GetIGameFramework()->GetNetChannel(channelId);

	SChannel *pChannel=GetChannel(channelId);
	if (pChannel && pChannel->onhold)
		pChannel->pNetChannel=pNetChannel;
	else
	{
		if (pChannel)
		{
			m_channels.erase(m_channels.find(channelId));
			ResetChannel(channelId);	// clear up anything in the queues.
																// the reset message won't be sent since we've deleted the channel from the map
		}
		m_channels.insert(TChannelMap::value_type(channelId, SChannel(pNetChannel, pNetChannel->IsLocal())));
	}
}
//------------------------------------------------------------------------
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);
	}
}
Beispiel #8
0
void CServerGameTokenSynch::Reset()
{
    for(TChannelMap::const_iterator it=m_channels.begin(); it!=m_channels.end(); ++it)
        ResetChannel(it->first);
}