From f91c4a870762b7685634265cae22b2c57dae15c6 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Mon, 4 Apr 2011 17:37:53 +0000 Subject: [PATCH] - added a new disabled field for mod data (and now disabled munchy until it is fixed) --- source/masterserver/createDB.sql | 4 ++++ source/masterserver/showMapsForGlest.php | 2 +- source/masterserver/showScenariosForGlest.php | 2 +- source/masterserver/showTechsForGlest.php | 2 +- source/masterserver/showTilesetsForGlest.php | 2 +- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/source/masterserver/createDB.sql b/source/masterserver/createDB.sql index 84bd6bb3b..4160a79ba 100755 --- a/source/masterserver/createDB.sql +++ b/source/masterserver/createDB.sql @@ -37,6 +37,7 @@ CREATE TABLE IF NOT EXISTS `glestmaps` ( `crc` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, `description` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `url` varchar(1024) COLLATE utf8_unicode_ci NOT NULL, + `disabled` int(11) NOT NULL DEFAULT 0, PRIMARY KEY (`mapname`), KEY `mapname` (`mapname`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci @@ -48,6 +49,7 @@ CREATE TABLE IF NOT EXISTS `glesttilesets` ( `crc` varchar(100) collate utf8_unicode_ci, `description` varchar(255) collate utf8_unicode_ci, `url` varchar(1024) collate utf8_unicode_ci NOT NULL, + `disabled` int(11) NOT NULL DEFAULT 0, PRIMARY KEY (`tilesetname`), KEY `tilesetname` (`tilesetname`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; @@ -60,6 +62,7 @@ CREATE TABLE IF NOT EXISTS `glesttechs` ( `crc` varchar(100) collate utf8_unicode_ci, `description` varchar(255) collate utf8_unicode_ci, `url` varchar(1024) collate utf8_unicode_ci NOT NULL, + `disabled` int(11) NOT NULL DEFAULT 0, PRIMARY KEY (`techname`), KEY `techname` (`techname`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; @@ -72,6 +75,7 @@ CREATE TABLE IF NOT EXISTS `glestscenarios` ( `crc` varchar(100) collate utf8_unicode_ci, `description` varchar(255) collate utf8_unicode_ci, `url` varchar(1024) collate utf8_unicode_ci NOT NULL, + `disabled` int(11) NOT NULL DEFAULT 0, PRIMARY KEY (`scenarioname`), KEY `scenarioname` (`scenarioname`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; diff --git a/source/masterserver/showMapsForGlest.php b/source/masterserver/showMapsForGlest.php index 3dc636371..7e4ca69cd 100644 --- a/source/masterserver/showMapsForGlest.php +++ b/source/masterserver/showMapsForGlest.php @@ -6,7 +6,7 @@ define( 'DB_LINK', db_connect() ); - $maps_in_db = mysql_db_query( MYSQL_DATABASE, 'SELECT * FROM glestmaps ORDER BY mapname;' ); + $maps_in_db = mysql_db_query( MYSQL_DATABASE, 'SELECT * FROM glestmaps WHERE disabled=0 ORDER BY mapname;' ); $all_maps = array(); while ( $map = mysql_fetch_array( $maps_in_db ) ) { diff --git a/source/masterserver/showScenariosForGlest.php b/source/masterserver/showScenariosForGlest.php index 6db282c73..b60564636 100644 --- a/source/masterserver/showScenariosForGlest.php +++ b/source/masterserver/showScenariosForGlest.php @@ -6,7 +6,7 @@ define( 'DB_LINK', db_connect() ); - $scenarios_in_db = mysql_db_query( MYSQL_DATABASE, 'SELECT * FROM glestscenarios ORDER BY scenarioname;' ); + $scenarios_in_db = mysql_db_query( MYSQL_DATABASE, 'SELECT * FROM glestscenarios WHERE disabled=0 ORDER BY scenarioname;' ); $all_scenarios = array(); while ( $scenario = mysql_fetch_array( $scenarios_in_db ) ) { diff --git a/source/masterserver/showTechsForGlest.php b/source/masterserver/showTechsForGlest.php index eaa375caf..cd40af16d 100644 --- a/source/masterserver/showTechsForGlest.php +++ b/source/masterserver/showTechsForGlest.php @@ -6,7 +6,7 @@ define( 'DB_LINK', db_connect() ); - $techs_in_db = mysql_db_query( MYSQL_DATABASE, 'SELECT * FROM glesttechs ORDER BY techname;' ); + $techs_in_db = mysql_db_query( MYSQL_DATABASE, 'SELECT * FROM glesttechs WHERE disabled=0 ORDER BY techname;' ); $all_techs = array(); while ( $tech = mysql_fetch_array( $techs_in_db ) ) { diff --git a/source/masterserver/showTilesetsForGlest.php b/source/masterserver/showTilesetsForGlest.php index 98d5e88ea..0eb8ef70b 100644 --- a/source/masterserver/showTilesetsForGlest.php +++ b/source/masterserver/showTilesetsForGlest.php @@ -6,7 +6,7 @@ define( 'DB_LINK', db_connect() ); - $tilesets_in_db = mysql_db_query( MYSQL_DATABASE, 'SELECT * FROM glesttilesets ORDER BY tilesetname;' ); + $tilesets_in_db = mysql_db_query( MYSQL_DATABASE, 'SELECT * FROM glesttilesets WHERE disabled=0 ORDER BY tilesetname;' ); $all_tilesets = array(); while ( $tileset = mysql_fetch_array( $tilesets_in_db ) ) {