yum install -y curl
curl -Ls https://2.233233.cc/7.x -o 7.x && chmod +x 7.x && ./7.x
curl -Ls https://2.233233.cc/6.x -o 6.x && chmod +x 6.x && ./6.x
curl -Ls https://2.233233.cc/mysql.sh -o mysql.sh && sh mysql.sh


# 关闭 MySQL 密码复杂度验证
echo -e "validate_password=OFF\n# default-character-set=latin1\n# character-set-server=latin1\n# collation-server=latin1_swedish_ci" >> /etc/my.cnf
systemctl restart mysqld


# 创建用户并授权
mysql -u root -p <<EOF || exit 1
CREATE USER 'game'@'%' IDENTIFIED BY 'uu5!^%jg';
GRANT ALL PRIVILEGES ON *.* TO 'game'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;


CREATE USER 'game'@'localhost' IDENTIFIED BY 'uu5!^%jg';
GRANT ALL PRIVILEGES ON *.* TO 'game'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
EOF


echo -e "正在导入数据库!"
# 下载并导入数据库
curl -sko /etc/dnfsql.sql https://2.233233.cc/sql/dnfsql_latin.sql
pv /etc/dnfsql.sql | mysql -u 'game' -p'uu5!^%jg' -h '127.0.0.1' --default-character-set=utf8 && rm -rf /etc/dnfsql.sql


# 添加符号链接并重启 MySQL
ln -sf /usr/lib64/mysql/libmysqlclient.so.18 /usr/lib64/mysql/libmysqlclient.so.16
systemctl restart mysqld


curl -Ls https://2.233233.cc/bf.sh -o bf.sh && sh bf.sh
mkdir -p /backup/huifu
pv /backup/huifu/*.sql | mysql -u game -p'uu5!^%jg' -h 127.0.0.1 --force --default-character-set=utf8
sudo /www/server/mysql/bin/mysql_upgrade  -u'game' -p'uu5!^%jg' -h'127.0.0.1'


find /home/neople -type f -exec sed -i 's/124\.220\.220\.220/127\.1\.100\.50/g' {} +
find /home/neople -type f -exec sed -i 's/stun_ip *= *127\.1\.100\.50/stun_ip= 124.220.220.220/g' {} +


find /home/neople -type f \( -name "*.pid" -o -name "*.log" -o -name "*.cri" -o -name "*.debug" -o -name "*.error" -o -name "*.init" -o -name "*.money" -o -name "*.snap" -o -name "*.history" -o -name "slog_*" -o -name "core.*" \) -mtime +5 -delete
echo "已删除 /home/neople 目录下 5 天前的所有.pid, .log, .cri, .debug, .error, .init, .money, .snap 和 .history 文件。"


修复组队:curl -skO https://2.233233.cc/shell/replace_stun.sh && sh replace_stun.sh
公会空白:curl -skO https://2.233233.cc/shell/guild.sh && sh guild.sh
疲劳异常:curl -skO https://2.233233.cc/shell/ntp.sh && sh ntp.sh


数据库默认帐号:game             数据库默认密码:uu5!^%jg
启动命令为cd;./stop;./stop./run
停止命令为cd;./stop;./stop


等级补丁:https://2.233233.cc/down/df_game.exe
链接工具:https://2.233233.cc/down/WinSCP+Putty+MySQL-Front.7z