forked from SwagSoftware/Kisak-Strike
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmm_framework.h
155 lines (113 loc) · 3.64 KB
/
mm_framework.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
//===== Copyright © 1996-2009, Valve Corporation, All rights reserved. ======//
//
// Purpose:
//
//===========================================================================//
#ifndef MM_FRAMEWORK_H
#define MM_FRAMEWORK_H
#ifdef _WIN32
#pragma once
#endif
#include "tier0/dbg.h"
#include "tier0/icommandline.h"
#include "tier1/strtools.h"
#include "tier1/checksum_crc.h"
#include "tier1/keyvalues.h"
#include "tier1/utlbuffer.h"
#include "tier1/fmtstr.h"
#include "mathlib/mathlib.h"
#include "const.h"
#include "inetmsghandler.h"
#include "appframework/IAppSystemGroup.h"
#include "matchmaking/imatchframework.h"
#include "igameevents.h"
#include "tier2/tier2.h"
#include "vstdlib/jobthread.h"
#include "extkeyvalues.h"
#include "steam_apihook.h"
class CMatchFramework;
#include "mm_extensions.h"
#include "mm_events.h"
#include "mm_voice.h"
#include "mm_session.h"
#include "mm_netmgr.h"
#include "matchsystem.h"
#include "playermanager.h"
#include "servermanager.h"
#include "searchmanager.h"
#include "datacenter.h"
#include "mm_dlc.h"
enum MatchFrameworkInviteFlags_t
{
// Indicates that invite was received using console mechanisms (XMB/boot/etc.)
MM_INVITE_FLAG_CONSOLE = ( 1 << 0 ),
// Indicates that the game was booted through a Steam invite
MM_INVITE_FLAG_PCBOOT = ( 1 << 1 ),
};
class CMatchFramework :
public CTier2AppSystem< IMatchFramework >,
public IMatchEventsSink
{
// Methods of IAppSystem
public:
virtual bool Connect( CreateInterfaceFn factory );
virtual void Disconnect();
virtual void *QueryInterface( const char *pInterfaceName );
virtual InitReturnVal_t Init();
virtual void Shutdown();
// Methods of IMatchFramework
public:
// Run frame of the matchmaking framework
virtual void RunFrame();
// Get matchmaking extensions
virtual IMatchExtensions * GetMatchExtensions();
// Get events container
virtual IMatchEventsSubscription * GetEventsSubscription();
// Get the matchmaking title interface
virtual IMatchTitle * GetMatchTitle();
// Get the match session interface of the current match framework type
virtual IMatchSession * GetMatchSession();
// Get the network msg encode/decode factory
virtual IMatchNetworkMsgController * GetMatchNetworkMsgController();
// Get the match system
virtual IMatchSystem * GetMatchSystem();
// Send the key values back to the server
virtual void ApplySettings( KeyValues* keyValues );
// Entry point to create session
virtual void CreateSession( KeyValues *pSettings );
// Entry point to match into a session
virtual void MatchSession( KeyValues *pSettings );
// Accept invite
virtual void AcceptInvite( int iController );
// Close the session
virtual void CloseSession();
// Checks to see if the current game is being played online ( as opposed to locally against bots )
virtual bool IsOnlineGame( void );
// Called by the client to notify matchmaking that it should update matchmaking properties based
// on player distribution among the teams.
virtual void UpdateTeamProperties( KeyValues *pTeamProperties );
//
// IMatchEventsSink
//
public:
virtual void OnEvent( KeyValues *pEvent );
// Additional matchmaking title-defined interface
public:
virtual IMatchTitleGameSettingsMgr * GetMatchTitleGameSettingsMgr();
public:
void SetCurrentMatchSession( IMatchSessionInternal *pNewMatchSession );
uint64 GetLastInviteFlags();
protected:
void RunFrame_Invite();
public:
CMatchFramework();
~CMatchFramework();
protected:
IMatchSessionInternal *m_pMatchSession;
bool m_bJoinTeamSession;
KeyValues *m_pTeamSessionSettings;
};
extern CMatchFramework *g_pMMF;
extern const char *COM_GetModDirectory();
extern bool IsLocalClientConnectedToServer();
#endif // MM_FRAMEWORK_H