//
// Asura_Demonware_CustomMatchMakingInfo.h
//
// Created by Mark Dieterman - 19/10/07
//
// Copyright (C) 2007 Rebellion (Liverpool), All Rights Reserved.
//
// Wrapper class to allow integration of DemonWare's Matchmaking+ SDK
//
// Current DW version 1.80
//

#if defined(ASURA_USE_PRAGMA_ONCE)
#pragma once
#endif

#if !defined(__ASURA_DEMONWARE_CUSTOMMATCHMAKING_H__)
#define __ASURA_DEMONWARE_CUSTOMMATCHMAKING_H__

#if defined(ASURA_SUPPORT_EXTERNAL_NETWORK) && defined (ASURA_SUPPORT_DEMONWARE)

#include <bdLobby/bdMatchMaking/bdMatchMakingInfo.h>

#define BD_MAX_SESSIONNAME_LENGTH (32u + 1u)

/// This class derives from bdMatchMakingInfo to add custom data attributes.
/// It also overrides the base class serialize/deserialize functions so that the
/// custom attributes are transmitted and received correctly
/// See the Advanced MatchMaking tutorial for more info.
class Asura_Demonware_CustomMatchMakingInfo : public bdMatchMakingInfo
{
public:

	BD_DECLARE_NEW_AND_DELETE_OPERATORS

	Asura_Demonware_CustomMatchMakingInfo();	

	virtual ~Asura_Demonware_CustomMatchMakingInfo();

	bdUWord SetSessionName(const bdNChar8 *const pszSessionName);

	bdUWord GetSessionName(bdNChar8 *const pszBuf,
		const bdUInt uBufSize) const;		

	void SetLevelNum(const bdInt iLevelNum);

	bdInt GetLevelNum() const;		

	void SetGameType(const bdInt iGameType);

	bdInt GetGameType() const;

	virtual void Serialize(bdBitBuffer &xBuffer);

	virtual bdBool Deserialize(bdBitBufferRef xBuffer);

protected:

	bdNChar8 m_szSessionName[BD_MAX_SESSIONNAME_LENGTH];
	bdInt m_iLevelNum;
	bdInt m_iGameType;
};

void BD_CALL printInfo(const Asura_Demonware_CustomMatchMakingInfo& xSessionData,
					   bdNChar8* pszBuf,
					   const bdUInt uLength);
#endif
#endif // __ASURA_DEMONWARE_CUSTOMMATCHMAKING_H__
