Hey, at one time ruffle.rs is able to run the client of the game Hero Zero in one of the older versions that I happen to have on disk, it is of no use to me so I am uploading here the server files with added ruffle.rs
Download:
HTML Code:
https://hzprivate.vip/hz129_update3.zip
Demo:
HTML Code:
https://hzprivate.vip/
Manual installation:
HTML Code:
1. open the server/config.php file and change the following
a)
'hostname'=> 'localhost', (your base host)
'username'=> 'root', (your base user)
'password'=> '', (your database password)
'database'=> 'test', (your database name)
'charset'=> 'utf8', (DB character encoding, best leave as is)
b)
'server_id'=> 'S1', (here's the text in parentheses in the server name in the game menu if you like)
'server_name'=> 'ZeroGame', (for your name or leave as is)
'server_domain'=> 'localhost', (here for your host or leave as is localhost)
'title'=> 'ZeroGame', (on your name or leave as is)
'mail'=> 'none'
Auto-installer (Experimental - recommend to manual install):
HTML Code:
<?php
set_time_limit(300);
ini_set('memory_limit', '-1');
$error = '';
$success = '';
if(file_exists('lock')) {
die('you can use setup file one time');
}
if (isset($_POST['submit'])) {
if (!($pdo = checkMySQLConnection($_POST['hostname'], $_POST['username'], $_POST['password'], $_POST['database']))) {
$error = 'Failed to connect to the MySQL database. Please check your credentials.';
} else {
$downloadResult = downloadZIP();
if (!$downloadResult['status']) {
$error = $downloadResult['message'];
} else {
$extractResult = extractZIP();
if (!$extractResult['status']) {
$error = $extractResult['message'];
} else {
$x = importDatabase($pdo);
if(!$x) {
$error = 'Can\'t upload SQL file to DB';
} else {
editConfigFile($_POST['hostname'], $_POST['username'], $_POST['password'], $_POST['database'], $_POST['defaultLocale'], $_POST['serverName'], $_POST['domain']);
$success = 'Installation completed successfully! (do not remove lock file!)';
file_put_contents('lock', 'do not remove it!');
}
}
}
}
}
function checkMySQLConnection($hostname, $username, $password, $database) {
try {
$pdo = new PDO("mysql:host=$hostname;dbname=$database;charset=utf8", $username, $password);
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
return $pdo;
} catch (PDOException $e) {
return false;
}
}
function downloadZIP() {
$remoteFile = 'https://hzprivate.vip/hz129_update3.zip';
$localFile = 'hz129_update3.zip';
$bufferSize = 4096;
try {
$input = fopen($remoteFile, 'rb');
if ($input === false) {
throw new Exception('Failed to open remote file for reading.');
}
$output = fopen($localFile, 'wb');
if ($output === false) {
fclose($input);
throw new Exception('Failed to open local file for writing.');
}
while (!feof($input)) {
$chunk = fread($input, $bufferSize);
fwrite($output, $chunk);
}
fclose($input);
fclose($output);
return ['status' => true, 'message' => 'File downloaded successfully'];
} catch (Exception $e) {
return ['status' => false, 'message' => 'An error occurred: ' . $e->getMessage()];
}
}
function extractZIP() {
try {
$zip = new ZipArchive;
$res = $zip->open('hz129_update3.zip');
if ($res === TRUE) {
$zip->extractTo(dirname(__FILE__) . '/');
$zip->close();
return ['status' => true, 'message' => 'Files extracted successfully'];
} else {
throw new Exception('Failed to extract ZIP file');
}
} catch (Exception $e) {
return ['status' => false, 'message' => 'An error occurred: ' . $e->getMessage()];
}
}
function editConfigFile($hostname, $username, $password, $database, $defaultLocale, $serverName, $domain) {
define('IN_ENGINE', true);
$x = include_once('server/config.php');
$x['database']['hostname'] = $hostname;
$x['database']['username'] = $username;
$x['database']['password'] = $password;
$x['database']['database'] = $database;
$x['site']['default_locale'] = $defaultLocale;
$x['site']['server_domain'] = $domain;
$x['site']['title'] = $serverName;
$x['site']['server_name'] = $serverName;
$jsonString = json_encode($x, JSON_PRETTY_PRINT);
$jsonString = str_replace(['{', '}', '":', '\/'], ['[', ']', '"=>', '/'], $jsonString);
$config = "<?php".PHP_EOL;
$config .= "if(!defined('IN_ENGINE')) exit(http_response_code(404));".PHP_EOL;
$config .= "return ".$jsonString.PHP_EOL;
$config .= "?>";
file_put_contents('server/config.php', $config);
}
function importDatabase($pdo) {
$result = $pdo->query("SHOW TABLES");
$tables = $result->fetchAll(PDO::FETCH_COLUMN);
foreach ($tables as $table) {
$pdo->exec("DROP TABLE IF EXISTS `$table`");
}
$sql = file_get_contents('DATABASE.sql');
$pdo->exec($sql);
return true;
}
?>
<!DOCTYPE html>
<html>
<head>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
</head>
<style>
body {
font-family: Arial, sans-serif;
margin: 50px;
}
input[type="text"], input[type="password"], select {
padding: 10px;
width: 100%;
margin-bottom: 10px;
border: 1px solid #ddd;
}
input[type="submit"] {
padding: 10px 15px;
background-color: #007BFF;
border: none;
color: white;
cursor: pointer;
}
input[type="submit"]:hover {
background-color: #0056b3;
}
.message {
padding: 10px;
border: 1px solid #ddd;
margin-bottom: 20px;
}
.error {
background-color: #f8d7da;
border-color: #f5c6cb;
color: #721c24;
}
.success {
background-color: #d4edda;
border-color: #c3e6cb;
color: #155724;
}
</style>
<div class="container mt-5">
<?php
if (!empty($error)) {
echo '<div class="alert alert-danger">' . $error . '</div>';
}
if (!empty($success)) {
echo '<div class="alert alert-success">' . $success . '</div>';
}
?>
<form method="POST" action="">
<div class="form-group">
<label for="hostname">Hostname:</label>
<input type="text" class="form-control" id="hostname" name="hostname" required autocomplete="off">
</div>
<div class="form-group">
<label for="username">Username:</label>
<input type="text" class="form-control" id="username" name="username" required autocomplete="off">
</div>
<div class="form-group">
<label for="password">Password:</label>
<input type="password" class="form-control" id="password" name="password" autocomplete="off">
</div>
<div class="form-group">
<label for="database">Database:</label>
<input type="text" class="form-control" id="database" name="database" required autocomplete="off">
</div>
<div class="form-group">
<label for="serverName">Server Name:</label>
<input type="text" class="form-control" id="serverName" name="serverName" required autocomplete="off">
</div>
<div class="form-group">
<label for="domain">Domain:</label>
<input type="text" class="form-control" id="domain" name="domain" value="<?=$_SERVER['HTTP_HOST']?>" required autocomplete="off">
</div>
<div class="form-group">
<label for="defaultLocale">Default game language:</label>
<select class="form-control" id="defaultLocale" name="defaultLocale" required>
<option disabled selected>Choose one</option>
<option value="en_GB">English</option>
<option value="cs_CZ">Četina</option>
<option value="de_DE">Deutsch</option>
<option value="el_GR">Ελληνικά</option>
<option value="es_ES">Español</option>
<option value="fr_FR">Français</option>
<option value="it_IT">Italiano</option>
<option value="lt_LT">Lietuvių</option>
<option value="pl_PL">Polski</option>
<option value="pt_BR">Português (Brasil)</option>
<option value="ro_RO">Română</option>
<option value="ru_RU">Русский</option>
<option value="tr_TR">Türkçe</option>
</select>
</div>
<div class="form-group">
<input type="submit" class="btn btn-primary" name="submit" value="Install">
</div>
</form>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
[Updates 1.01]
HTML Code:
Hideouts working actions:
- Unlocking a hideout (unlockHideout)
- Building rooms (buildHideoutRoom, checkHideoutRoomActivityFinished)
- Upgrading rooms (upgradeHideoutRoom, checkHideoutRoomActivityFinished)
- Storage rooms (storeHideoutRoom, checkHideoutRoomActivityFinished)
- Placement rooms (placeHideoutRoom, checkHideoutRoomActivityFinished)
- Unlocking construction sites (unlockHideoutRoomSlot, instantFinishHideoutSlotUnlock, checkUnlockHideoutRoomSlotFinished)
- Calculating/collecting gold, zeronite and glue - without exceeding $player->hideout->max_resource_stone|glue limits, with harvest countdown at zeronite mine and super glue factory (checkHideoutRoomActivityFinished)
- Attack-o-bot, Defense-o-bot productions (startHideoutRoomProduction, checkHideoutRoomActivityFinished)
- Skipping actions for donuts (instantFinishHideoutRoomActivity)
- Upgrading defense post
Additional info:
- Special missions are unlocked with photos as on official servers
[Updates 1.02]
HTML Code:
Finished categories of heroic deeds: [202 / 221] 91.4%
Missing [22]: missles_fired, account_confirmed , first_guild_artifact_won<br>guild_artifacts_won, first_worldboss_attack_completed, worldboss_attacks_completed<br>first_worldboss_event_won, first_guild_dungeon_fought, guild_dungeons_fought<br>guild_dungeons_won, tournament_attended, tournament_top10_reached, tournament_top3_reached<br>first_surprise_box_opened, surprise_box_opened, herobook_first_objetive_finished<br>herobook_objectives_finished, first_quest_resource_request_accepted, quest_resource_request_accepted<br>hideout_hideout_points_reached, hideout_units_produced, hideout_build_generator
[Updates 1.03]
HTML Code:
Added Sewing machine and Collections