Permalink
Browse files

Various changes

  • Loading branch information...
1 parent ed020da commit b929a495257e274b5547a2f1fe09b7d88220883c @JarnoVgr committed Jan 22, 2016
View
@@ -7,3 +7,4 @@
.lock
Homestead.yaml
Homestead.json
+OpenRCTorg.sublime-workspace
@@ -0,0 +1,8 @@
+{
+ "folders":
+ [
+ {
+ "path": "."
+ }
+ ]
+}
@@ -27,6 +27,10 @@ public function index()
->orderBy('downloadId', 'desc')
->take(25)
->get();
+ //Generate gitHashShort
+ foreach ($downloads as $key => $download) {
+ $download->gitHashShort = substr($download->gitHash, 0, 8);
+ }
$latest['stable'] = DB::table('downloads')
->where('gitBranch', 'master')
@@ -46,21 +50,24 @@ public function index()
/**
* Displays the download page of a specific downloadId.
*
- * @param int $downloadId
+ * @param String $gitBranch
+ * @param String $gitHash
* @return \Illuminate\Http\Response
*/
- public function show(int $downloadId)
+ public function show(String $gitBranch, String $gitHash)
{
$download = DB::table('downloads')
->join('downloadsBuilds', function ($join) {
$join->on('downloadsBuilds.parentDownloadId', '=', 'downloads.downloadId')
->where('downloadsBuilds.flavourId', '=', 1);
})
->select('downloads.*', "downloadsBuilds.status")
- ->where('downloadId', $downloadId)
+ ->where('gitBranch', $gitBranch)
+ ->where('gitHash', 'like', $gitHash .'%')
->orderBy('downloadId', 'desc')
->first();
+ $download->gitHashShort = substr($download->gitHash, 0, 8);
/* $downloadsBuilds = DB::table('downloadsBuilds')
->where('downloadsBuilds.parentDownloadId', $downloadId)
@@ -72,7 +79,7 @@ public function show(int $downloadId)
$downloadsBuilds = DB::select('SELECT filePath, fileName, fileSize, fileHash, title as flavourName
FROM downloadsBuilds b
JOIN downloadFlavours f ON (f.flavourId = b.flavourId)
- WHERE parentDownloadId = :id', ['id' => $downloadId]);
+ WHERE parentDownloadId = :id', ['id' => $download->downloadId]);
return view('download.download', ['download' => $download,
'downloadsBuilds' => $downloadsBuilds,
@@ -83,31 +90,34 @@ public function show(int $downloadId)
/**
* Displays the download page, or returns json of a specific downloadId.
*
- * @param String? $version
+ * @param String $identifier
* @return \Illuminate\Http\Response
*/
- public function showLatest(String $version = null)
+ public function showLatest(String $identifier = null)
{
- if($version == null || $version == "develop"){
+ if ($identifier == null || $identifier == "develop") {
$download = DB::table('downloads')
->orderBy('downloadId', 'desc')
->first();
- if($download == null) return redirect()->action('DownloadController@index');
- return redirect()->action('DownloadController@show', [$download->downloadId]);
- } elseif($version == "master" || $version == "stable"){
+ if ($download == null)
+ return redirect()->action('DownloadController@index');
+ return redirect()->action('DownloadController@show', [$download->gitBranch, substr($download->gitHash, 0, 8)]);
+ } elseif ($identifier == "master" || $identifier == "stable") {
$download = DB::table('downloads')
->where('gitBranch', 'master')
->orderBy('downloadId', 'desc')
->first();
- if($download == null) return redirect()->action('DownloadController@index');
- return redirect()->action('DownloadController@show', [$download->downloadId]);
+ if ($download == null)
+ return redirect()->action('DownloadController@index');
+ return redirect()->action('DownloadController@show', [$download->gitBranch, substr($download->gitHash, 0, 8)]);
} else {
$download = DB::table('downloads')
- ->where('version', $version)
+ ->where('version', $identifier)
->orderBy('downloadId', 'desc')
->first();
- if($download == null) return redirect()->action('DownloadController@index');
- return redirect()->action('DownloadController@show', [$download->downloadId]);
+ if ($download == null) return
+ redirect()->action('DownloadController@index');
+ return redirect()->action('DownloadController@show', [$download->gitBranch, substr($download->gitHash, 0, 8)]);
}
}
}
View
@@ -20,5 +20,5 @@
});
Route::get('download', 'DownloadController@index');
-Route::get('download/latest/{version?}', 'DownloadController@showLatest');
-Route::get('download/{id}', 'DownloadController@show');
+Route::get('download/latest/{identifier}', 'DownloadController@showLatest');
+Route::get('download/{gitBranch}/{gitHashShort}', 'DownloadController@show');
View
@@ -58,7 +58,7 @@
'database' => env('DB_DATABASE', ''),
'username' => env('DB_USERNAME', ''),
'password' => env('DB_PASSWORD', ''),
- 'charset' => 'utf8',
+ 'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'strict' => false,
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -2,16 +2,11 @@
@section('title','Download OpenRCT2')
@section('page')
-<h2 class="blue">{{ $download->version }} build {{ $download->downloadId }}</h2>
+<h2 class="blue">{{ $download->version }} build {{ $download->gitHashShort }}</h2>
-Status &amp; Branch: <span class="buildStatus {{ $download->status }}">{{ $download->gitBranch }}</span><br />
-Based on commit hash: {{ $download->gitHash }}<br />
-Available since: {{ $download->addedTime }} ({{ Carbon::createFromTimeStamp(strtotime($download->addedTime))->diffForHumans() }})<br />
-Multiplayer support: @if($download->version != "0.0.2" AND $download->version != "0.0.1")
- Yes. <a href="https://github.com/OpenRCT2/OpenRCT2/wiki/Multiplayer">More information</a>
-@else
- No.
-@endif
+Status &amp; Branch: <span class="buildStatus {{ $download->status }}">{{ $download->gitBranch }}</span><br>
+Based on commit hash: {{ $download->gitHash }}<br>
+Available since: {{ $download->addedTime }} ({{ Carbon::createFromTimeStamp(strtotime($download->addedTime))->diffForHumans() }})<br>
<h2>Download OpenRCT2 {{ $download->version }} build {{ $download->downloadId }}</h2>
<table class="downloadsTable">
@@ -22,7 +22,7 @@
</center>
</div>
<div class="col span_5_of_12">
- <img src="http://i.imgur.com/AvBw3N1.png" style="max-width: 100%;" />
+ <img src="/media/launcher_screenshot.png" style="max-width: 100%;" />
</div>
</div>
@@ -50,7 +50,7 @@
@foreach ($downloads as $download)
<tr class="download">
<td class="buildStatus {{ $download->status }}">{{ $download->gitBranch }}</td>
- <td class="name"><a href="/download/{{ $download->downloadId }}">{{ $download->version }} build {{ $download->downloadId }}</a></td>
+ <td class="name"><a href="/download/{{ $download->gitBranch }}/{{ $download->gitHashShort }}">{{ $download->version }} build {{ $download->downloadId }}</a></td>
<td class="age">{{ Carbon::createFromTimeStamp(strtotime($download->addedTime))->diffForHumans() }}</td>
</tr>
@endforeach
@@ -71,14 +71,14 @@
</p>
<p>An installation of RollerCoaster Tycoon 2 is required in order to play
OpenRCT2. RCT2, with expansions, is cheap nowadays and can be bought from
- <a href="https://www.g2a.com/r/rct2" target="_blank">G2A</a>,
+ <a href="https://www.g2a.com/r/openrct2" target="_blank">G2A</a>,
<a href="http://www.gog.com/game/rollercoaster_tycoon_2" target="_blank">GOG</a>
and <a href="http://store.steampowered.com/app/285330/" target="_blank">Steam</a>.
</p>
<h2 class="blue">About OpenRCT2</h2>
<p>
- OpenRCT2 is the free open source remake of Rollercoaster Tycoon 2. The
+ OpenRCT2 is the free open source remake of RollerCoaster Tycoon 2. The
developers have taken the original game, decompiled it and rewrote
everything into a newer language while making this code open source.
This means other developers can now create plugins to extend the
@@ -23,14 +23,14 @@
<p>
An installation of RollerCoaster Tycoon 2 is required in order to play.
RCT2, with expansions, is cheap nowadays and can be bought from
- <a href="https://www.g2a.com/r/rct2" target="_blank">G2A</a>,
+ <a href="https://www.g2a.com/r/openrct2" target="_blank">G2A</a>,
<a href="http://www.gog.com/game/rollercoaster_tycoon_2" target="_blank">GOG</a>
and <a href="http://store.steampowered.com/app/285330/" target="_blank">Steam</a>.
</p>
<h2 class="blue">Download</h2>
<p>
OpenRCT2.com provides automated builds that makes it easy to get started.
- <a href="/download/latest">Get the latest download</a>.
+ <a href="/download/latest">Get the latest download.</a>
</p>
@@ -39,11 +39,11 @@
@section('sidebar')
<h2 class="blue">Related Links</h2>
<ul class="normaltext">
- <li><a href="//github.com/OpenRCT2/OpenRCT2" target="_blank">Project on GitHub</a></li>
- <li><a href="//github.com/OpenRCT2/OpenRCT2/issues" target="_blank">Official issue tracker</a></li>
+ <li><a href="//github.com/OpenRCT2/OpenRCT2" target="_blank">View project on GitHub</a></li>
+ <li><a href="//github.com/OpenRCT2/OpenRCT2/issues" target="_blank">Issue tracker</a></li>
<li><a href="/forums/" target="_blank" style="font-weight: 600;">Sign up on the Forums</a></li>
<li><a href="//www.reddit.com/r/OpenRCT2" target="_blank">Subreddit</a></li>
- <li><a href="//gitter.im/OpenRCT2/OpenRCT2" target="_blank">Gitter Chat</a></li>
- <li><a href="//gitter.im/OpenRCT2/OpenRCT2/non-dev" target="_blank">Gitter Non-Dev Chat</a></li>
+ <li><a href="//gitter.im/OpenRCT2/OpenRCT2" target="_blank">Gitter Development Chat</a></li>
+ <li><a href="//gitter.im/OpenRCT2/OpenRCT2/non-dev" target="_blank">Gitter Offtopic Chat</a></li>
</ul>
@stop

0 comments on commit b929a49

Please sign in to comment.