tools/installer/GamesList.h
author David Anderson <dvander@alliedmods.net>
Wed Feb 25 20:07:12 2009 -0500 (2009-02-25)
changeset 2607 f3b8bbe17f85
parent 2289 44045ead61cd
permissions -rw-r--r--
Backed out changeset fa286305bd3f
     1 #ifndef _INCLUDE_INSTALLER_GAMES_LIST_H_
     2 #define _INCLUDE_INSTALLER_GAMES_LIST_H_
     3 
     4 #include "platform_headers.h"
     5 
     6 #define GAMEINFO_IS_USABLE			0
     7 #define GAMEINFO_DOES_NOT_EXIST		1
     8 #define GAMEINFO_IS_READ_ONLY		2
     9 
    10 #define GAME_LIST_HALFLIFE1			-2
    11 #define GAME_LIST_CANT_READ			-1
    12 #define GAME_LIST_NO_GAMES			0
    13 
    14 #define GAMES_DEDICATED				1
    15 #define GAMES_LISTEN				2
    16 #define GAMES_STANDALONE			3
    17 
    18 #define SOURCE_ENGINE_UNKNOWN		0
    19 #define SOURCE_ENGINE_2004			1
    20 #define SOURCE_ENGINE_2007			2
    21 
    22 struct valve_game_t
    23 {
    24 	const TCHAR *folder;
    25 	const TCHAR *subfolder;
    26 	int eng_type;
    27 };
    28 
    29 /* One game */
    30 struct game_info_t
    31 {
    32 	TCHAR name[128];
    33 	TCHAR game_path[MAX_PATH];
    34 	int source_engine;
    35 };
    36 
    37 /* A list of games under one "account" */
    38 struct game_list_t
    39 {
    40 	TCHAR root_name[128];
    41 	unsigned int *games;
    42 	unsigned int game_count;
    43 };
    44 
    45 /* A list of accounts */
    46 struct game_group_t
    47 {
    48 	game_list_t **lists;
    49 	unsigned int list_count;
    50 	int error_code;
    51 };
    52 
    53 /* All games on the system */
    54 struct game_database_t
    55 {
    56 	game_info_t *game_list;
    57 	unsigned int game_count;
    58 	game_group_t dedicated;
    59 	game_group_t listen;
    60 	game_group_t standalone;
    61 };
    62 
    63 int IsValidFolder(const TCHAR *path);
    64 void DisplayBadFolderDialog(HWND hWnd, int reason);
    65 
    66 void BuildGameDB();
    67 void ReleaseGameDB();
    68 void DisplayBadGamesDialog(HWND hWnd, int reason);
    69 
    70 extern game_database_t g_games;
    71 
    72 #endif //_INCLUDE_INSTALLER_GAMES_LIST_H_