From: Cameron Ball Date: Sun, 21 Dec 2014 18:46:12 +0000 (+0800) Subject: Bits and bobs to help more packs pass validation. X-Git-Url: http://git.cameron1729.xyz/?p=rock.divinelegy.git;a=commitdiff_plain;h=d09aacaecd3e3dab1b937997ba0db43ec81bfd00 Bits and bobs to help more packs pass validation. --- diff --git a/Controllers/SimfileController.php b/Controllers/SimfileController.php index 9ab78ad..582cfc0 100644 --- a/Controllers/SimfileController.php +++ b/Controllers/SimfileController.php @@ -132,11 +132,13 @@ class SimfileController implements IDivineController ->setDestination('StepMania/') ->process(); + //TODO: This should be in a try-catch and if it fails the file should + //be deleted from the filesystem and database. foreach($files as $file) { $zipParser = $this->_zipParser; $zipParser->parse($file); - + if(!$zipParser->simfiles()) $this->_statusReporter->error('That zip doesn\'t seem to have any simfiles in it.'); //save the actual zip in the db diff --git a/Domain/VOs/StepMania/DanceMode.php b/Domain/VOs/StepMania/DanceMode.php index c54efe1..34e0309 100644 --- a/Domain/VOs/StepMania/DanceMode.php +++ b/Domain/VOs/StepMania/DanceMode.php @@ -9,11 +9,71 @@ class DanceMode implements IDanceMode protected $stepManiaName; protected $prettyName; + //XXX: Known step types, taken from https://github.com/stepmania/stepmania/blob/master/src/GameManager.cpp private $_nameMap = array( 'dance-single' => 'Single', - 'dance-double' => 'Double' + 'dance-double' => 'Double', + 'dance-couple' => 'Couple', + 'dance-solo' => 'Solo', + 'dance-threepanel' => 'Three Panel', + 'dance-routine' => 'Routine', + 'pump-single' => 'Single', + 'pump-double' => 'Double', + 'pump-couple' => 'Couple', + 'pump-halfdouble' => 'Half Double', + 'pump-routine' => 'Routine', + 'kb7-single' => 'Single', + 'ez2-single' => 'Single', + 'ez2-double' => 'Double', + 'ez2-real' => 'Real', + 'para-single' => 'Single', + 'para-versus' => 'Versus', //Not in the list but I have seen it in files + 'ds3ddx-single' => 'Single', + 'bm-single' => 'Single', //Not in the list but I have seen it in files + 'bm-single5' => 'Single 5 Key', + 'bm-single7' => 'Single 7 Key', + 'bm-double' => 'Double', //Not in the list, and I haven't seen it, but I feel like it must exist lol + 'bm-double5' => 'Double 5 Key', + 'bm-double7' => 'Double 7 Key', + 'bm-versus5' => 'Versus 5 Key', + 'bm-versus7' => 'Versus 7 Key', + //Seems like bm may have been called iidx or was changed to iidx at some point so... + 'iidx-single' => 'Single', //Not in the list but I have seen it in files + 'iidx-single5' => 'Single 5 Key', + 'iidx-single7' => 'Single 7 Key', + 'iidx-double' => 'Double', //Not in the list, and I haven't seen it, but I feel like it must exist lol + 'iidx-double5' => 'Double 5 Key', + 'iidx-double7' => 'Double 7 Key', + 'iidx-versus5' => 'Versus 5 Key', + 'iidx-versus7' => 'Versus 7 Key', + 'maniax-single' => 'Single', + 'maniax-double' => 'Double', + 'techno-single4' => 'Single 4 Panel', + 'techno-single5' => 'Single 5 Panel', + 'techno-single8' => 'Single 8 Panel', + 'techno-double4' => 'Double 4 Panel', + 'techno-double5' => 'Double 5 Panel', + 'techno-double8' => 'Double 8 Panel', + 'pnm-five' => 'Five Key', + 'pnm-nine' => 'Nine Key', + 'lights-cabinet' => 'Cabinet Lights' ); + private $_smGameNameToNiceName = array( + 'dance' => 'In The Groove', + 'pump' => 'Pump It Up', + 'ez2' => 'EZ2Dancer', + 'para' => 'ParaParaParadise', + 'bm' => 'Beatmania', + 'iidx' => 'Beatmania', + 'maniax' => 'Dance Maniax', + 'techno' => 'TechnoMotion', + 'pnm' => 'Pop\'n Music', + 'ds3ddx' => 'Dance Station 3DDX', + 'kb7' => 'Keybeat', + 'lights' => false + ); + public function __construct($stepManiaName) { if(array_key_exists($stepManiaName, $this->_nameMap)) { @@ -24,11 +84,19 @@ class DanceMode implements IDanceMode } } - public function getStepManiaName() { + public function getStepManiaName() + { return $this->stepManiaName; } - public function getPrettyName() { + public function getPrettyName() + { return $this->prettyName; } + + public function getGame() + { + $game = explode('-', $this->stepManiaName)[0]; + return $this->_smGameNameToNiceName[$game]; + } } diff --git a/Domain/VOs/StepMania/Difficulty.php b/Domain/VOs/StepMania/Difficulty.php index 500b0db..e59578d 100644 --- a/Domain/VOs/StepMania/Difficulty.php +++ b/Domain/VOs/StepMania/Difficulty.php @@ -8,9 +8,31 @@ class Difficulty implements IDifficulty { protected $stepManiaName; protected $itgName; + + //XXX: Common names used in simfiles. We'll map them to standard names. + //Taken from https://github.com/openitg/openitg/blob/master/src/Difficulty.cpp + private $_namesToSmNames = array( + "Beginner" => 'Beginner', + "Easy" => 'Easy', + "Basic" => 'Easy', + "Light" => 'Easy', + "Medium" => 'Medium', + "Another" => 'Medium', + "Trick" => 'Medium', + "Standard" => 'Medium', + "Difficult" => 'Medium', + "Hard" => 'Hard', + "Ssr" => 'Hard', + "Maniac" => 'Hard', + "Heavy" => 'Hard', + "Smaniac" => 'Challenge', + "Challenge" => 'Challenge', + "Expert" => 'Challenge', + "Oni" => 'Challenge', + "Edit" => 'Edit' + ); - private $_nameMap = array( - 'Light' => 'Novice', + private $_smNamesToItgNames = array( 'Beginner' => 'Novice', 'Easy' => 'Easy', 'Medium' => 'Medium', @@ -18,13 +40,14 @@ class Difficulty implements IDifficulty 'Challenge' => 'Expert', 'Edit' => 'Edit' ); - - public function __construct($stepManiaName) { - if(array_key_exists($stepManiaName, $this->_nameMap)) { - $this->stepManiaName = $stepManiaName; - $this->itgName = $this->_nameMap[$stepManiaName]; + + public function __construct($name) { + $ucName = ucfirst($name); + if(array_key_exists($ucName, $this->_namesToSmNames)) { + $this->stepManiaName = $this->_namesToSmNames[$ucName]; + $this->itgName = $this->_smNamesToItgNames[$this->stepManiaName]; } else { - throw new InvalidDifficultyException(sprintf('Invalid difficulty: %s', $stepManiaName)); + throw new InvalidDifficultyException(sprintf('Invalid difficulty: %s', $name)); } } diff --git a/Domain/VOs/StepMania/IDanceMode.php b/Domain/VOs/StepMania/IDanceMode.php index a8c908c..f412699 100644 --- a/Domain/VOs/StepMania/IDanceMode.php +++ b/Domain/VOs/StepMania/IDanceMode.php @@ -6,4 +6,5 @@ interface IDanceMode { public function getStepManiaName(); public function getPrettyName(); + public function getGame(); } diff --git a/Services/BannerExtracter.php b/Services/BannerExtracter.php index 63fce25..3b2928e 100644 --- a/Services/BannerExtracter.php +++ b/Services/BannerExtracter.php @@ -31,7 +31,7 @@ class BannerExtracter implements IBannerExtracter $stat = $za->statIndex($i); if(basename($stat['name']) == $bannerName) { - $this->_hash = $this->randomFilename($bannerName); + $this->_hash = md5_file('zip://' . $zipfile . '#' . $stat['name']); $this->_destinationFileName = $this->_hash . '.' . pathinfo($bannerName, PATHINFO_EXTENSION); $result = copy('zip://' . $zipfile . '#' . $stat['name'], '../files/banners/' . $this->_destinationFileName); break; @@ -74,7 +74,7 @@ class BannerExtracter implements IBannerExtracter //replace 3spooty with packname variable if(count($pathComponents) == 2 && $pathComponents[0] == $packname) { - $this->_hash = $this->randomFilename($stat['name']); + $this->_hash = md5_file('zip://' . realpath($zipfile) . '#' . $stat['name']); $this->_destinationFileName = $this->_hash . '.' . pathinfo($stat['name'], PATHINFO_EXTENSION); $bannerName = $pathComponents[1]; $result = copy('zip://' . realpath($zipfile) . '#' . $stat['name'], '../files/banners/' . $this->_destinationFileName); diff --git a/Services/SimfileParser.php b/Services/SimfileParser.php index 1413acc..52608b1 100644 --- a/Services/SimfileParser.php +++ b/Services/SimfileParser.php @@ -8,14 +8,6 @@ use Exception; class SimfileParser implements ISimfileParser { -// 'light' => 'Novice', -// 'beginner' => 'Novice', -// 'easy' => 'Easy', -// 'medium' => 'Medium', -// 'hard' => 'Hard', -// 'challenge' => 'Expert', -// 'edit' => 'Edit' - private $_smFileLines; public function parse($simfileData) @@ -33,7 +25,8 @@ class SimfileParser implements ISimfileParser $title = $this->extractKey('TITLE'); if(!$title) throw new Exception ('Invalid SM file. TITLE missing'); - return $title; + //XXX: UTF8 encode to deal with unusual character that crop up in weeaboo shit. + return utf8_encode($title); } public function artist() @@ -41,13 +34,16 @@ class SimfileParser implements ISimfileParser $artist = $this->extractKey('ARTIST'); if(!$artist) throw new Exception ('Invalid SM file. ARTIST missing'); - return new \Domain\VOs\StepMania\Artist($artist); + //XXX: UTF8 encode to deal with unusual character that crop up in weeaboo shit. + return new \Domain\VOs\StepMania\Artist(utf8_encode($artist)); } public function stops() { $stops = $this->extractKey('STOPS'); - if($stops === false) throw new Exception ('Invalid SM file. STOPS missing'); + + //XXX: SM files can be missing stops. + //if($stops === false) throw new Exception ('Invalid SM file. STOPS missing'); return (bool)$stops; } @@ -69,19 +65,26 @@ class SimfileParser implements ISimfileParser { $bpmRange = explode(":",$displayBpm); $bpmRange[1] = @$bpmRange[1] ?: $bpmRange[0]; - } else { + } + + //XXX: Originally I had an else statement for this. But turns out some SM's have * as the display bpm + //so I just check if we don't have a displayBPM OR the displayBPM is not numeric. + if(!$displayBpm || !is_numeric($bpmRange[0])) + { $bpms = $this->extractKey('BPMS'); $bpmRange = $this->parseBpms($bpms); } - //I have nfi why I made the BPM VO high-low instead of low-high in the constructor but yolo + //XXX: I have nfi why I made the BPM VO high-low instead of low-high in the constructor but yolo return new \Domain\VOs\StepMania\BPM($bpmRange[1], $bpmRange[0]); } public function bgChanges() { $bgChanges = $this->extractKey('BGCHANGES'); - if($bgChanges === false) throw new Exception ('Invalid SM file. BGCHANGES missing'); + + //XXX: BGChanges can be missing + //if($bgChanges === false) throw new Exception ('Invalid SM file. BGCHANGES missing'); return (bool)$bgChanges; } @@ -89,7 +92,9 @@ class SimfileParser implements ISimfileParser public function bpmChanges() { $bpms = $this->extractKey('BPMS'); - if(!$bpms) throw new Exception ('Invalid SM file. BPMS missing'); + + //XXX: BPMS can be missing. + //if(!$bpms) throw new Exception ('Invalid SM file. BPMS missing'); $bpmRange = $this->parseBpms($bpms); //XXX: We have bpm changes when the high and low bpms are different. @@ -115,7 +120,11 @@ class SimfileParser implements ISimfileParser if ($pos !== false) { $noteData = trim(substr($line, $pos + 9)); - $allSteps[] = $this->stepchartFromNoteData($noteData); + $steps = $this->stepchartFromNoteData($noteData); + + //XXX: Sometimes we get a cabinet lights chart, those return false for getGame. + //We don't want to store cabinet lights, so just ignore it. + if($steps->getMode()->getGame()) $allSteps[] = $steps; } } diff --git a/Services/Uploads/UploadManager.php b/Services/Uploads/UploadManager.php index 81c12c7..c1356ae 100644 --- a/Services/Uploads/UploadManager.php +++ b/Services/Uploads/UploadManager.php @@ -65,7 +65,7 @@ class UploadManager implements IUploadManager{ { if($this->_destination) { - $randomName = $this->randomFilename(); + $randomName = md5_file($file->getTempName()); $result = move_uploaded_file($file->getTempName(), $this->_basePath . '/' . $this->_destination . '/' . $randomName . '.' . $file->getExtension()); } diff --git a/Services/ZipParser.php b/Services/ZipParser.php index a8d5631..a669ffc 100644 --- a/Services/ZipParser.php +++ b/Services/ZipParser.php @@ -99,8 +99,7 @@ class ZipParser implements IZipParser //or single, but to do that we simply check the number of found sm files. To overcome this //first populate the smFiles array with the raw sm data, then apply SmDataToSmClass on each //array element. This way the check is accurate and the array gets populated as expected. - //@ing it because when exceptions are thrown this still produces a warning and I dont want that. - $this->_smFiles = @array_map(array($this, 'SmDataToSmClass'), $this->_smFiles); + $this->_smFiles = array_map(array($this, 'SmDataToSmClass'), $this->_smFiles); } private function packNameFromFiles() diff --git a/divinelegy.sql b/divinelegy.sql index 8df01c6..02024a7 100644 --- a/divinelegy.sql +++ b/divinelegy.sql @@ -1,202 +1,201 @@ --- MySQL dump 10.13 Distrib 5.5.38, for debian-linux-gnu (i686) --- --- Host: localhost Database: divinelegy --- ------------------------------------------------------ --- Server version 5.5.38-0ubuntu0.12.04.1 - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; -/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; -/*!40103 SET TIME_ZONE='+00:00' */; -/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; - --- --- Table structure for table `artists` --- - -DROP TABLE IF EXISTS `artists`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `artists` ( - `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(255) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=360 DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Table structure for table `downloads` --- - -DROP TABLE IF EXISTS `downloads`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `downloads` ( - `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, - `file_id` mediumint(8) unsigned NOT NULL, - `user_id` mediumint(8) unsigned NOT NULL, - `timestamp` int(10) unsigned NOT NULL, - `ip` varchar(15) DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=39 DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Table structure for table `files` --- - -DROP TABLE IF EXISTS `files`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `files` ( - `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, - `filename` varchar(255) NOT NULL, - `hash` varchar(255) NOT NULL, - `path` varchar(255) NOT NULL, - `mimetype` varchar(255) NOT NULL, - `size` int(10) unsigned NOT NULL, - `uploaded` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=291 DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Table structure for table `mirrors` --- - -DROP TABLE IF EXISTS `mirrors`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `mirrors` ( - `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, - `uri` varchar(255) DEFAULT NULL, - `file_id` mediumint(8) unsigned NOT NULL, - `source` varchar(255) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Table structure for table `packs` --- - -DROP TABLE IF EXISTS `packs`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `packs` ( - `title` varchar(255) NOT NULL, - `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, - `file_id` mediumint(8) unsigned DEFAULT NULL, - `user_id` mediumint(8) unsigned NOT NULL, - `banner_file_id` mediumint(8) unsigned DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Table structure for table `simfiles` --- - -DROP TABLE IF EXISTS `simfiles`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `simfiles` ( - `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, - `title` varchar(255) NOT NULL, - `artist_id` mediumint(8) unsigned NOT NULL, - `user_id` mediumint(8) unsigned NOT NULL, - `bpm_high` int(11) NOT NULL, - `bpm_low` int(11) NOT NULL, - `bpm_changes` int(1) DEFAULT NULL, - `stops` int(1) DEFAULT NULL, - `fg_changes` int(1) DEFAULT NULL, - `bg_changes` int(1) DEFAULT NULL, - `banner_file_id` mediumint(8) unsigned DEFAULT NULL, - `simfile_file_id` mediumint(8) unsigned DEFAULT NULL, - `pack_id` mediumint(8) unsigned DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=427 DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Table structure for table `step_artists` --- - -DROP TABLE IF EXISTS `step_artists`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `step_artists` ( - `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, - `tag` varchar(255) NOT NULL, - `user_id` mediumint(8) unsigned DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=162 DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Table structure for table `steps` --- - -DROP TABLE IF EXISTS `steps`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `steps` ( - `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, - `simfile_id` mediumint(8) unsigned NOT NULL, - `mode` enum('dance-single','dance-double') NOT NULL, - `rating` int(10) unsigned NOT NULL, - `difficulty` enum('Beginner','Easy','Medium','Hard','Challenge','Edit') NOT NULL, - `step_artist_id` mediumint(8) unsigned DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=481 DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Table structure for table `users` --- - -DROP TABLE IF EXISTS `users`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `users` ( - `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, - `email` varchar(255) NOT NULL, - `display_name` varchar(255) NOT NULL, - `facebook_id` varchar(255) DEFAULT NULL, - `quota` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Table structure for table `users_meta` --- - -DROP TABLE IF EXISTS `users_meta`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `users_meta` ( - `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, - `user_id` mediumint(8) unsigned NOT NULL, - `firstname` varchar(255) DEFAULT NULL, - `lastname` varchar(255) DEFAULT NULL, - `country` varchar(255) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; -/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; - -/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; -/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; -/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; -/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; -/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; -/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; - --- Dump completed on 2014-12-05 14:59:50 +-- MySQL dump 10.13 Distrib 5.6.12, for Win64 (x86_64) +-- +-- Host: localhost Database: divinelegy +-- ------------------------------------------------------ +-- Server version 5.6.12 + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `artists` +-- + +DROP TABLE IF EXISTS `artists`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `artists` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=24930 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `downloads` +-- + +DROP TABLE IF EXISTS `downloads`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `downloads` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `file_id` mediumint(8) unsigned NOT NULL, + `user_id` mediumint(8) unsigned NOT NULL, + `timestamp` int(10) unsigned NOT NULL, + `ip` varchar(15) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `files` +-- + +DROP TABLE IF EXISTS `files`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `files` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `filename` varchar(255) NOT NULL, + `hash` varchar(255) NOT NULL, + `path` varchar(255) NOT NULL, + `mimetype` varchar(255) NOT NULL, + `size` int(10) unsigned NOT NULL, + `uploaded` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=31153 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `mirrors` +-- + +DROP TABLE IF EXISTS `mirrors`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `mirrors` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `uri` varchar(255) DEFAULT NULL, + `file_id` mediumint(8) unsigned NOT NULL, + `source` varchar(255) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2637 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `packs` +-- + +DROP TABLE IF EXISTS `packs`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `packs` ( + `title` varchar(255) NOT NULL, + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `file_id` mediumint(8) unsigned DEFAULT NULL, + `user_id` mediumint(8) unsigned NOT NULL, + `banner_file_id` mediumint(8) unsigned DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2638 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `simfiles` +-- + +DROP TABLE IF EXISTS `simfiles`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `simfiles` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `title` varchar(255) NOT NULL, + `artist_id` mediumint(8) unsigned NOT NULL, + `user_id` mediumint(8) unsigned NOT NULL, + `bpm_high` int(11) NOT NULL, + `bpm_low` int(11) NOT NULL, + `bpm_changes` int(1) DEFAULT NULL, + `stops` int(1) DEFAULT NULL, + `fg_changes` int(1) DEFAULT NULL, + `bg_changes` int(1) DEFAULT NULL, + `banner_file_id` mediumint(8) unsigned DEFAULT NULL, + `simfile_file_id` mediumint(8) unsigned DEFAULT NULL, + `pack_id` mediumint(8) unsigned DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=56572 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `step_artists` +-- + +DROP TABLE IF EXISTS `step_artists`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `step_artists` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `tag` varchar(255) NOT NULL, + `user_id` mediumint(8) unsigned DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=5697 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `steps` +-- + +DROP TABLE IF EXISTS `steps`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `steps` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `simfile_id` mediumint(8) unsigned NOT NULL, + `mode` enum('dance-single','dance-double','dance-couple','dance-solo','dance-threepanel','dance-routine','pump-single','pump-double','pump-couple','pump-halfdouble','pump-routine','kb7-single','ez2-single','ez2-double','ez2-real','para-single','para-versus','ds3ddx-single','bm-single','bm-single5','bm-single7','bm-double','bm-double5','bm-double7','bm-versus5','bm-versus7','iidx-single','iidx-single5','iidx-single7','iidx-double','iidx-double5','iidx-double7','iidx-versus5','iidx-versus7','maniax-single','maniax-double','techno-single4','techno-single5','techno-single8','techno-double4','techno-double5','techno-double8','pnm-five','pnm-nine') DEFAULT NULL, + `rating` int(10) unsigned NOT NULL, + `difficulty` enum('Beginner','Easy','Medium','Hard','Challenge','Edit') DEFAULT NULL, + `step_artist_id` mediumint(8) unsigned DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=159447 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `users` +-- + +DROP TABLE IF EXISTS `users`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `users` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `display_name` varchar(255) NOT NULL, + `facebook_id` varchar(255) DEFAULT NULL, + `quota` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `users_meta` +-- + +DROP TABLE IF EXISTS `users_meta`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `users_meta` ( + `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `user_id` mediumint(8) unsigned NOT NULL, + `firstname` varchar(255) DEFAULT NULL, + `lastname` varchar(255) DEFAULT NULL, + `country` varchar(255) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2014-12-22 2:44:50 diff --git a/public_html/index.php b/public_html/index.php index f6afb25..511beaa 100644 --- a/public_html/index.php +++ b/public_html/index.php @@ -12,6 +12,9 @@ if($config['mode'] == 'production') { ini_set('display_errors', 0); set_exception_handler(array('\Services\StatusReporter', 'exception')); +} else { + ini_set('display_errors', 1); + error_reporting(E_ALL); } // Everything time related should be UTC+0 based