/** * Uninstall a game * @param $game_id * @param $gamename */ public final function Uninstall($game_id, $gamename) { global $cache, $db; $this->game_id = $game_id; $this->gamename = $gamename; $db->sql_transaction('begin'); $factions = new \bbdkp\controller\games\Faction(); $factions->game_id = $this->game_id; $factions->Delete_all_factions(); $races = new \bbdkp\controller\games\Races(); $races->game_id = $this->game_id; $races->Delete_all_races(); $classes = new \bbdkp\controller\games\Classes(); $classes->game_id = $this->game_id; $classes->Delete_all_classes(); $roles = new \bbdkp\controller\games\Roles(); $roles->game_id = $this->game_id; $roles->Delete_all_roles(); $sql = 'DELETE FROM ' . BBGAMES_TABLE . " WHERE game_id = '" . $this->game_id . "'"; $db->sql_query($sql); $db->sql_transaction('commit'); $cache->destroy('sql', BBGAMES_TABLE); $cache->destroy('sql', CLASS_TABLE); $cache->destroy('sql', BB_LANGUAGE); $cache->destroy('sql', RACE_TABLE); $cache->destroy('sql', DKPSYS_TABLE); $cache->destroy('sql', EVENTS_TABLE); $cache->destroy('sql', MEMBER_LIST_TABLE); }