csgo-2018-source/matchmaking/mm_events.h

52 lines
1.3 KiB
C
Raw Permalink Normal View History

2021-07-25 12:11:47 +08:00
//===== Copyright <20> 1996-2009, Valve Corporation, All rights reserved. ======//
//
// Purpose:
//
//===========================================================================//
#ifndef MM_EVENTS_H
#define MM_EVENTS_H
#ifdef _WIN32
#pragma once
#endif
#include "mm_framework.h"
#include "utlvector.h"
class CMatchEventsSubscription : public IMatchEventsSubscription
{
// Methods of IMatchEventsSubscription
public:
virtual void Subscribe( IMatchEventsSink *pSink );
virtual void Unsubscribe( IMatchEventsSink *pSink );
virtual void BroadcastEvent( KeyValues *pEvent );
virtual void RegisterEventData( KeyValues *pEventData );
virtual KeyValues * GetEventData( char const *szEventDataKey );
public:
bool IsBroacasting() const { return m_bBroadcasting; }
void Shutdown();
public:
CMatchEventsSubscription();
~CMatchEventsSubscription();
protected:
CUtlVector< IMatchEventsSink * > m_arrSinks;
CUtlVector< int > m_arrRefCount;
CUtlVector< int > m_arrIteratorsOutstanding;
bool m_bBroadcasting;
bool m_bAllowNestedBroadcasts;
CUtlVector< KeyValues * > m_arrQueuedEvents;
CUtlVector< KeyValues * > m_arrEventData;
CUtlVector< KeyValues * > m_arrSentEvents;
};
// Match events subscription singleton
extern CMatchEventsSubscription *g_pMatchEventsSubscription;
#endif // MM_EVENTS_H