public/matchmaking/igametypes.h
author Nicholas Hastings <skamonkey@gmail.com>
Sat May 24 16:20:37 2014 -0400 (2014-05-24)
changeset 107 280d491246d5
parent 77 c9acdfb0cc23
permissions -rw-r--r--
Update IServerGameDLL GameServerSteamAPIActivated params.
     1 //===== Copyright c 1996-2009, Valve Corporation, All rights reserved. ======//
     2 //
     3 // Purpose: 
     4 //
     5 // $NoKeywords: $
     6 //===========================================================================//
     7 
     8 #ifndef IGAMETYPES_H
     9 #define IGAMETYPES_H
    10 #ifdef _WIN32
    11 #pragma once
    12 #endif
    13 
    14 namespace ELOGameType
    15 {
    16 enum GameType
    17 {
    18 	INVALID = -1,
    19 	CLASSIC_CASUAL,
    20 	CLASSIC_COMPETITIVE,
    21 	GUNGAME_PROGRESSIVE,
    22 	GUNGAME_BOMB,
    23 	COUNT
    24 };
    25 }
    26 typedef ELOGameType::GameType ELOGameType_t;
    27 
    28 namespace ELOCalcMode
    29 {
    30 enum CalcMode
    31 {
    32 	INVALID = -1,
    33 	TEAM_VS_TEAM,
    34 	FREE_FOR_ALL,
    35 	COUNT
    36 };
    37 }
    38 typedef ELOCalcMode::CalcMode ELOCalcMode_t;
    39 
    40 #define VENGINE_GAMETYPES_VERSION "VENGINE_GAMETYPES_VERSION002"
    41 
    42 abstract_class IGameTypes
    43 {
    44 public:
    45 	class WeaponProgression
    46 	{
    47 	public:
    48 		CUtlString m_Name;
    49 		int m_Kills;
    50 	};
    51 	
    52 public:
    53 	virtual ~IGameTypes() {}
    54 	
    55 	virtual bool Initialize( bool force ) = 0;
    56 	virtual bool IsInitialized() const = 0;
    57 	
    58 	virtual bool SetGameTypeAndMode( const char *gameType, const char *gameMode ) = 0;
    59 	
    60 	// Gets the game type and mode mapped to an alias.
    61 	// Currently available aliases at time of doc: competitive, comp, casual, armsrace, arms, gungame, gg,
    62 	//   demolition, demo, deathmatch, dm, training, custom, default, auto.
    63 	virtual bool GetGameTypeAndModeFromAlias( const char *alias, int &gameType, int &gameMode ) = 0;
    64 	
    65 	virtual bool SetGameTypeAndMode( int gameType, int gameMode ) = 0;
    66 	
    67 	virtual void SetAndParseExtendedServerInfo( KeyValues *pExtendedServerInfo ) = 0;
    68 	
    69 	virtual bool CheckShouldSetDefaultGameModeAndType( const char *mapName ) = 0;
    70 	
    71 	virtual int GetCurrentGameType() const = 0;
    72 	virtual int GetCurrentGameMode() const = 0;
    73 	
    74 	virtual const char *GetCurrentMapName() = 0;
    75 	
    76 	virtual const char *GetCurrentGameTypeNameID() = 0;
    77 	virtual const char *GetCurrentGameModeNameID() = 0;
    78 	
    79 	virtual bool ApplyConvarsForCurrentMode( bool isMultiplayer ) = 0;
    80 	virtual void DisplayConvarsForCurrentMode() = 0;
    81 	
    82 	virtual const CUtlVector< WeaponProgression > *GetWeaponProgressionForCurrentModeCT() = 0;
    83 	virtual const CUtlVector< WeaponProgression > *GetWeaponProgressionForCurrentModeT() = 0;
    84 	
    85 	virtual int GetNoResetVoteThresholdForCurrentModeCT() = 0;
    86 	virtual int GetNoResetVoteThresholdForCurrentModeT() = 0;
    87 	
    88 	virtual const char *GetGameTypeFromInt( int gameType ) = 0;
    89 	virtual const char *GetGameModeFromInt( int gameType, int gameMode ) = 0;
    90 	
    91 	virtual bool GetGameModeAndTypeIntsFromStrings( const char *szGameType, const char *szGameMode, int &iOutGameType, int &iOutGameMode ) = 0;
    92 	virtual bool GetGameModeAndTypeNameIdsFromStrings( const char *szGameType, const char *szGameMode, const char * &szOutGameTypeNameId, const char * &szOutGameModeNameId ) = 0;
    93 	
    94 	// mapGroup here is also the Workshop Collection ID (as a string)
    95 	virtual void CreateOrUpdateWorkshopMapGroup( const char *mapGroup, const CUtlStringList &mapList) = 0;
    96 	virtual bool IsWorkshopMapGroup( const char *mapGroup ) = 0;
    97 	
    98 	virtual const char *GetRandomMapGroup( const char *gameType, const char *gameMode ) = 0;
    99 	
   100 	virtual const char *GetFirstMap( const char *mapGroup ) = 0;
   101 	virtual const char *GetRandomMap( const char *mapGroup ) = 0;
   102 	virtual const char *GetNextMap( const char *mapGroup, const char *mapName ) = 0;
   103 	
   104 	virtual int GetMaxPlayersForTypeAndMode( int iType, int iMode ) = 0;
   105 	
   106 	virtual bool IsValidMapGroupName( const char *mapGroup ) = 0;
   107 	virtual bool IsValidMapInMapGroup( const char *mapGroup, const char *mapName ) = 0;
   108 	virtual bool IsValidMapGroupForTypeAndMode( const char *mapGroup, const char *gameType, const char *gameMode ) = 0;
   109 	
   110 	virtual bool ApplyConvarsForMap( const char *mapName, bool isMultiplayer ) = 0;
   111 	
   112 	virtual bool GetMapInfo( const char *mapName, unsigned int &richPresence ) = 0;
   113 	
   114 	virtual const CUtlStringList *GetTModelsForMap( const char *mapName ) = 0;
   115 	virtual const CUtlStringList *GetCTModelsForMap( const char *mapName ) = 0;
   116 	virtual const CUtlStringList *GetHostageModelsForMap( const char *mapName ) = 0;
   117 	
   118 	virtual int GetDefaultGameTypeForMap( const char *mapName ) = 0;
   119 	virtual int GetDefaultGameModeForMap( const char *mapName ) = 0;
   120 	
   121 	virtual const char *GetTViewModelArmsForMap( const char *mapName ) = 0;
   122 	virtual const char *GetCTViewModelArmsForMap( const char *mapName ) = 0;
   123 	
   124 	virtual const char *GetRequiredAttrForMap( const char *mapName ) = 0;
   125 	virtual int GetRequiredAttrValueForMap( const char *mapName ) = 0;
   126 	virtual const char *GetRequiredAttrRewardForMap( const char *mapName ) = 0;
   127 	virtual int GetRewardDropListForMap( const char *mapName ) = 0;
   128 	
   129 	virtual const CUtlStringList *GetMapGroupMapList( const char *mapGroup ) = 0;
   130 	
   131 	virtual bool GetRunMapWithDefaultGametype() = 0;
   132 	virtual void SetRunMapWithDefaultGameType( bool bUseDefault ) = 0;
   133 	
   134 	virtual bool GetLoadingScreenDataIsCorrect() = 0;
   135 	virtual void SetLoadingScreenDataIsCorrect( bool bIsCorrect ) = 0;
   136 	
   137 	virtual bool SetCustomBotDifficulty( int botDiff ) = 0;
   138 	virtual int GetCustomBotDifficulty() = 0;
   139 	
   140 	virtual int GetCurrentServerNumSlots() = 0;
   141 	virtual int GetCurrentServerSettingInt(const char *settingName, int defaultValue) = 0;
   142 };
   143 
   144 #endif // IGAMETYPES_H