summaryrefslogtreecommitdiff
path: root/game/shared/lobby.h
blob: 5b30202fd5aed04f848d8f96ea6b6b3ccc21b861 (plain) (blame)
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
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:  GC based lobby.  Matchmaking assigns players to a lobby
//			
//=============================================================================

#ifndef LOBBY_H
#define LOBBY_H
#ifdef _WIN32
#pragma once
#endif

#include "playergroup.h"

namespace GCSDK
{
class CSharedObject;

class ILobby : public IPlayerGroup
{
public:
	virtual ~ILobby() { }

};

class CLobbyInvite : public GCSDK::CProtoBufSharedObject<CSOLobbyInvite, k_EProtoObjectLobbyInvite>, public GCSDK::IPlayerGroupInvite
{
	//This is disabled since people shouldn't create these objects directly and should instead instantiate game specific versions of them
	//DECLARE_CLASS_MEMPOOL( CLobbyInvite );

public:
	const static int k_nTypeID = k_EProtoObjectLobbyInvite;

	virtual const CSteamID GetSenderID() const { return Obj().sender_id(); }
	virtual PlayerGroupID_t GetGroupID() const { return Obj().group_id(); }
	virtual const char* GetSenderName() const { return Obj().sender_name().c_str(); }

	virtual GCSDK::CSharedObject* GetSharedObject() { return this; }

#ifdef GC
	// NOTE: These do not dirty fields
	virtual void SetSenderID( const CSteamID &steamID ) { Obj().set_sender_id( steamID.ConvertToUint64() ); }
	virtual void SetGroupID( PlayerGroupID_t nGroupID ) { Obj().set_group_id( nGroupID ); }
	virtual void SetSenderName( const char *szName ) { Obj().set_sender_name( szName ); }

	virtual void YldInitFromPlayerGroup( IPlayerGroup *pPlayerGroup );
#endif
};

}

#endif