Skip to content

Commit

Permalink
Don't offer to upgrade when using bukkit
Browse files Browse the repository at this point in the history
  • Loading branch information
jcameron committed May 19, 2015
1 parent 5e5f6cd commit b36d0f9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
13 changes: 7 additions & 6 deletions minecraft/index.cgi
Expand Up @@ -45,9 +45,8 @@ elsif ($err) {

# Check if new version is out, if we haven't checked in the last 6 hours
&update_last_check();
if ($config{'last_size'}) {
my $jar = $config{'minecraft_jar'} ||
$config{'minecraft_dir'}."/"."minecraft_server.jar";
if ($config{'last_size'} && &minecraft_server_type() eq 'default') {
my $jar = &get_minecraft_jar();
my @st = stat($jar);
if (@st && $st[7] != $config{'last_size'}) {
print "<table width=100%><tr bgcolor=#ff8888>".
Expand Down Expand Up @@ -92,9 +91,11 @@ else {
$text{'index_startdesc'});
}

# Show download button
print &ui_buttons_row("download.cgi", $text{'index_download'},
$text{'index_downloaddesc'});
if (&minecraft_server_type() eq 'default') {
# Show download button
print &ui_buttons_row("download.cgi", $text{'index_download'},
$text{'index_downloaddesc'});
}

# Show start at boot button
&foreign_require("init");
Expand Down
8 changes: 8 additions & 0 deletions minecraft/minecraft-lib.pl
Expand Up @@ -1142,4 +1142,12 @@ sub get_player_stats
return $perl;
}

# minecraft_server_type()
# Returns 'default' or 'bukkit'
sub minecraft_server_type
{
my $jar = &get_minecraft_jar();
return $jar =~ /bukkit-[0-9]/ ? 'bukkit' : 'default';
}

1;

0 comments on commit b36d0f9

Please sign in to comment.