Beispiel #1
0
uint cGameWorld::ProcMsg( const sMsg& msg )
{
    switch( msg.m_type )
    {

    case msgFindContainingCell:
        return FindContainingCell( msg.m_pt );

    case msgAddPlayer:
        AddPlayer( msg.m_i[0] );
        return 0;

    case msgRemovePlayer:
        RemovePlayer( msg.m_i[0] );
        return 0;

    case msgAddEnt:
        NotifyAdd(
            (cGameEnt*)MsgDaemon()->Get( msg.m_i[0] ));
        return 0;

    case msgRemoveEnt:
        NotifyRemove(
            (cGameEnt*)MsgDaemon()->Get( msg.m_i[0] ));
        return 0;

    default:
        DP0("Bad Message got to cGameWorld\n");
        return -1;
    }
}
Beispiel #2
0
void SSDPCache::Remove( const QString &sURI, const QString &sUSN )
{    
    Lock();

    // --------------------------------------------------------------
    // Get a Pointer to a Entries QDict... (Create if not found)
    // --------------------------------------------------------------

    SSDPCacheEntriesMap::Iterator it = m_cache.find( sURI );

    if (it != m_cache.end())
    {
        SSDPCacheEntries *pEntries = *it;

        if (pEntries != NULL)
        {
            pEntries->AddRef();

            pEntries->Remove( sUSN );

            if (pEntries->Count() == 0)
            {
                pEntries->Release();
                m_cache.erase(it);
            }

            pEntries->Release();
        }
    }

    Unlock();

    // -=>TODO:
    // Should this only by notified if we actually had any entry removed?

    NotifyRemove( sURI, sUSN );
}