local edits
This commit is contained in:
parent
3ab7aeb19e
commit
ea75fef77b
10 changed files with 136 additions and 44 deletions
|
|
@ -69,13 +69,40 @@ Make sure if you install a MOD, you list the name here or else it wont get loade
|
|||
|
||||
mkdir -p ./cfg
|
||||
touch ./cfg/dayz_arma2co_win32.xml.txt
|
||||
wget http://files.iaregamer.com/addons/dayz-mod-1.9.tar.gz .
|
||||
tar -xzvf dayz-mod-1.9.tar.gz
|
||||
chmod +x setup_db.sh
|
||||
./setup_db.sh
|
||||
rm *.sh
|
||||
rm *.sql
|
||||
rm *.gz
|
||||
|
||||
wget http://files.iaregamer.com/gamefiles/arma2Addons.tar
|
||||
tar -xzvf arma2Addons.tar
|
||||
rm -f arma2Addons.tar
|
||||
|
||||
wget http://files.iaregamer.com/gamefiles/dayzmod1.9.0.tar
|
||||
tar -xzvf dayzmod1.9.0.tar
|
||||
rm -f dayzmod1.9.0.tar
|
||||
|
||||
|
||||
#Create Database ---------------------------------------
|
||||
|
||||
dbPass=$(</dev/urandom tr -dc _A-Z-a-z-0-9 | head -c8)
|
||||
srvID=${PWD##*/}
|
||||
dbID=server_${srvID}
|
||||
|
||||
# sed -i "s/dayz_dayzmod/${dbID}/g" 1.9.0_fresh.sql
|
||||
|
||||
sed -i "s/Host = .*/Host = mysql.iaregamer.com/g" cfg/hiveext.ini
|
||||
sed -i "s/Database = .*/Database = ${dbID}/g" cfg/hiveext.ini
|
||||
sed -i "s/Username = .*/Username = ${dbID}/g" cfg/hiveext.ini
|
||||
sed -i "s/Password = .*/Password = ${dbPass}/g" cfg/hiveext.ini
|
||||
|
||||
mysql -uremoteuser -pPkloyn7yvpht! -hmysql.iaregamer.com -e "CREATE DATABASE IF NOT EXISTS ${dbID}"
|
||||
mysql -uremoteuser -pPkloyn7yvpht! -hmysql.iaregamer.com -e "GRANT ALL ON ${dbID}.* TO '${dbID}'@'localhost' IDENTIFIED BY '${dbPass}'"
|
||||
mysql -uremoteuser -pPkloyn7yvpht! -hmysql.iaregamer.com -e "GRANT ALL ON ${dbID}.* TO 'dayzhivemind'@'%' IDENTIFIED BY 'Pkloyn7yvpht!'"
|
||||
mysql -uremoteuser -pPkloyn7yvpht! -hmysql.iaregamer.com -e "GRANT ALL ON ${dbID}.* TO '${dbID}'@'%' IDENTIFIED BY '${dbPass}'"
|
||||
mysql -uremoteuser -pPkloyn7yvpht! -hmysql.iaregamer.com -e "FLUSH PRIVILEGES;"
|
||||
mysql -uremoteuser -pPkloyn7yvpht! -hmysql.iaregamer.com -D ${dbID} < 1.9.0_fresh.sql
|
||||
|
||||
mysql -uremoteuser -pPkloyn7yvpht! -hmysql.iaregamer.com -e "DELETE FROM panel.ogp_mysql_databases WHERE db_user = '${dbID}'"
|
||||
mysql -uremoteuser -pPkloyn7yvpht! -hmysql.iaregamer.com -e "INSERT INTO panel.ogp_mysql_databases(mysql_server_id, home_id, db_user, db_passwd, db_name, enabled) VALUES (1,${srvID},'${dbID}','${dbPass}','${dbID}',1)"
|
||||
|
||||
# Create alsoRun.bat -----------------------------------
|
||||
|
||||
printf '%s\r\n' \
|
||||
'@echo off' \
|
||||
|
|
|
|||
|
|
@ -55,12 +55,12 @@ function mods($dbname) {
|
|||
}
|
||||
|
||||
function dbConnect($dbname){
|
||||
$servername = "localhost";
|
||||
$username = "localuser";
|
||||
$password = "Pkloyn7yvpht!";
|
||||
// Create connection
|
||||
$conn = new mysqli($servername, $username, $password, $dbname);
|
||||
if (!$conn) {die("Connection failed: " . mysqli_connect_error());}
|
||||
$config = __DIR__ . '/../../includes/config.inc.php';
|
||||
if (!file_exists($config)) { die("Database configuration not found."); }
|
||||
require_once $config; // sets $db_host, $db_user, $db_pass
|
||||
// Create connection — $dbname parameter overrides the DB name from config
|
||||
$conn = new mysqli($db_host, $db_user, $db_pass, $dbname);
|
||||
if (!$conn) { die("Connection failed: " . mysqli_connect_error()); }
|
||||
return $conn;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -72,7 +72,11 @@ function exec_ogp_module()
|
|||
"use_authorized_hosts" => $_REQUEST['use_authorized_hosts'],
|
||||
"allow_setting_cpu_affinity" => $_REQUEST['allow_setting_cpu_affinity'],
|
||||
"regex_invalid_file_name_chars" => addslashes($_REQUEST['regex_invalid_file_name_chars']),
|
||||
"login_ban_time" => $_REQUEST['login_ban_time']
|
||||
"login_ban_time" => $_REQUEST['login_ban_time'],
|
||||
// Discord Integration
|
||||
"discord_invite_url" => $_REQUEST['discord_invite_url'],
|
||||
"discord_webhook_main" => $_REQUEST['discord_webhook_main'],
|
||||
"discord_webhook_admin" => $_REQUEST['discord_webhook_admin']
|
||||
);
|
||||
|
||||
$db->setSettings($settings);
|
||||
|
|
@ -192,6 +196,11 @@ function exec_ogp_module()
|
|||
// Add regex setting for file manager
|
||||
$ft->add_field('string','regex_invalid_file_name_chars',(@empty($row['regex_invalid_file_name_chars']) ? htmlentities('/[\^\$\*\+\?\(\)\[\{\\\\\\|\]!@#%&=~`,\\\'<>"}\s]/i', ENT_COMPAT | ENT_HTML401 | ENT_QUOTES) : htmlentities(@$row['regex_invalid_file_name_chars'], ENT_COMPAT | ENT_HTML401 | ENT_QUOTES)));
|
||||
|
||||
// Discord Integration
|
||||
$ft->add_field('string','discord_invite_url',@$row['discord_invite_url']);
|
||||
$ft->add_field('string','discord_webhook_main',@$row['discord_webhook_main']);
|
||||
$ft->add_field('string','discord_webhook_admin',@$row['discord_webhook_admin']);
|
||||
|
||||
// Add option to reset game server order to default
|
||||
$ft->add_field('checkbox','reset_game_server_order','0');
|
||||
|
||||
|
|
|
|||
|
|
@ -47,17 +47,16 @@ function exec_ogp_module() {
|
|||
$db->logger( "TICKET SUBMITTED by " . $_SESSION['user_id']);
|
||||
|
||||
|
||||
// URL FROM DISCORD WEBHOOK SETUP
|
||||
$webhook = "https://discordapp.com/api/webhooks/710275918274363412/g5Tr-EUdEnLfFryOlscxJ6FuPiSJuE6EMKRYmh9UGMiqTUxU5-y9CQrBlDJW7znr0Tol";
|
||||
$msg = json_decode('
|
||||
{
|
||||
"username":"I Are Gamer",
|
||||
"content":"SUPPORT TICKET CREATED: Login with the userid and password http://privateemail.com"
|
||||
|
||||
// Post to Discord support webhook (configured in Admin > Settings)
|
||||
$webhook = !empty($settings['discord_webhook_main']) ? $settings['discord_webhook_main'] : '';
|
||||
if (!empty($webhook)) {
|
||||
$panel_name = !empty($settings['panel_name']) ? $settings['panel_name'] : 'GSP';
|
||||
$msg = array(
|
||||
'username' => $panel_name,
|
||||
'content' => 'SUPPORT TICKET: [' . htmlspecialchars($subject, ENT_QUOTES) . '] from ' . htmlspecialchars($_SESSION['users_login'] ?? '', ENT_QUOTES),
|
||||
);
|
||||
discordmsg($msg, $webhook);
|
||||
}
|
||||
', true);
|
||||
|
||||
discordmsg($msg, $webhook);
|
||||
//end discord
|
||||
|
||||
$content = get_lang_f('support_email_content', $user['users_login'], $email, $gameserver, $message);
|
||||
|
|
@ -72,7 +71,20 @@ discordmsg($msg, $webhook);
|
|||
<?php
|
||||
}
|
||||
} // End else
|
||||
echo '<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" integrity="sha512-DTOQO9RWCH3ppGqcWaEA1BIZOC6xxalwEsw9c2QQeAIftl+Vegovlnee1c9QX4TctnWMn13TZye+giMm8e2LwA==" crossorigin="anonymous" referrerpolicy="no-referrer" />';
|
||||
echo "<h2>".get_lang('support')."</h2>";
|
||||
echo '
|
||||
<div style="background:#5865F2;border-radius:8px;padding:14px 20px;margin:0 auto 20px auto;max-width:600px;display:flex;align-items:center;gap:16px;box-shadow:0 2px 8px rgba(0,0,0,0.18);">
|
||||
<i class="fa-brands fa-discord" style="font-size:2.4em;color:#fff;flex-shrink:0;"></i>
|
||||
<div style="flex:1;">
|
||||
<div style="color:#fff;font-size:1.1em;font-weight:bold;margin-bottom:4px;">Need help faster?</div>
|
||||
<div style="color:#dde0ff;font-size:0.95em;">Join our Discord server and post in the support channel for quick assistance from our team and community.</div>
|
||||
</div>
|
||||
<a href="' . (!empty($settings['discord_invite_url']) ? htmlspecialchars($settings['discord_invite_url'], ENT_QUOTES) : 'https://discord.com') . '" target="_blank"
|
||||
style="background:#fff;color:#5865F2;font-weight:bold;padding:8px 18px;border-radius:6px;text-decoration:none;white-space:nowrap;font-size:0.97em;flex-shrink:0;">
|
||||
<i class="fa-brands fa-discord"></i> Join Discord
|
||||
</a>
|
||||
</div>';
|
||||
echo '<center><form class="contactForm" name="contactForm" action="" method="post"><p style="font-size:12px;text-align:center;">'.get_lang('please_describe_your_issue_below').'</p>';
|
||||
echo get_lang('select_server').":<br /><select name='gameserver' id='gameserver'>";
|
||||
foreach ((array)$server_homes as $server_home)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue