初版预览版编译发布
This commit is contained in:
parent
2415730c0a
commit
2ba3c70991
24
config.ini
24
config.ini
@ -4,10 +4,10 @@ now_ip = 192.168.0.186
|
|||||||
new_ip = 192.168.0.186
|
new_ip = 192.168.0.186
|
||||||
file_encoding = utf-8
|
file_encoding = utf-8
|
||||||
dir = D:\LYserver\
|
dir = D:\LYserver\
|
||||||
server_path = ${GAME:dir}server\
|
server_path = ${dir}server\
|
||||||
web_path = ${GAME:dir}web\
|
web_path = ${dir}web\
|
||||||
client_path = ${GAME:dir}client\
|
client_path = ${dir}client\
|
||||||
tool_path = ${GAME:dir}tool\
|
tool_path = ${dir}tool\
|
||||||
|
|
||||||
[GAME_PATH]
|
[GAME_PATH]
|
||||||
path01 = ${GAME:server_path}Common\AMServer\x64\AMServer64_R.exe
|
path01 = ${GAME:server_path}Common\AMServer\x64\AMServer64_R.exe
|
||||||
@ -42,16 +42,17 @@ path12 = ${GAME:web_path}args_ios.php
|
|||||||
path13 = ${GAME:web_path}api\notice.php
|
path13 = ${GAME:web_path}api\notice.php
|
||||||
|
|
||||||
[GAME_DATA_SQL]
|
[GAME_DATA_SQL]
|
||||||
sql1 = sql
|
game_ip = UPDATE `gameback`.`bg_server` SET `server_ip` = '${GAME:now_ip}' WHERE `id` IN (1,2)
|
||||||
|
game_name = UPDATE `gameback`.`bg_server` SET `name` = REPLACE(`name`,'${GAME:game_name}','${GAME:game_name}_new') WHERE `name` LIKE '%${GAME:game_name}%';
|
||||||
|
|
||||||
[WEB]
|
[WEB]
|
||||||
domain_name = localhost
|
domain_name = localhost
|
||||||
web_port = 82
|
web_port = 82
|
||||||
gm_url = ${domain_name}:${web_port}/gm
|
gm_url = http://${domain_name}:${web_port}/gm
|
||||||
gm_code = 123456
|
gm_code = 123456
|
||||||
gm_user = test
|
gm_user = test
|
||||||
gm_pass = test
|
gm_pass = test
|
||||||
game_back = ${domain_name}:${web_port}/gameback
|
game_back = http://${domain_name}:${web_port}/gameback
|
||||||
game_code = 123456
|
game_code = 123456
|
||||||
game_user = test
|
game_user = test
|
||||||
game_pass = test
|
game_pass = test
|
||||||
@ -92,15 +93,6 @@ heidisql_path = ${GAME:tool_path}HeidiSQL\heidisql.exe
|
|||||||
notepad3_path = ${GAME:tool_path}Notepad3\Notepad3.exe
|
notepad3_path = ${GAME:tool_path}Notepad3\Notepad3.exe
|
||||||
composer_path = ${GAME:tool_path}Composer\
|
composer_path = ${GAME:tool_path}Composer\
|
||||||
|
|
||||||
[SERVER_PATH]
|
|
||||||
php_path = ${GAME:tool_path}php\php5.6.9nts\
|
|
||||||
php_spawner_path = ${GAME:tool_path}php-cgi-spawner\
|
|
||||||
php_cgi_port = 9001
|
|
||||||
nginx_path = ${GAME:tool_path}Nginx1.15.11\
|
|
||||||
mysql_path = ${GAME:tool_path}MySQL5.7.26\
|
|
||||||
game_path = ${GAME:server_path}Common\AMServer\x64\AMServer64_R.exe|${GAME:server_path}Common\LocalLogServer\x64\LocalLogServer64_R.exe|${GAME:server_path}Common\LoggerServer\x64\LoggerServer64_R.exe|${GAME:server_path}Common\SessionServer\x64\SessionServer64_R.exe|${GAME:server_path}Common\NameServer\x64\NameServer64_R.exe|${GAME:server_path}Common\BackStageServer\x64\BackStageServer64_R.exe,10|${GAME:server_path}Server\DBServer\x64\DBServer64_R.exe|${GAME:server_path}Server\GateServer\x64\GateServer64_R.exe|${GAME:server_path}Server\LogicServer\x64\LogicServerCQ64_R.exe|${GAME:server_path}Server2\DBServer\x64\DBServer64_R.exe|${GAME:server_path}Server2\GateServer\x64\GateServer64_R.exe|${GAME:server_path}Server2\LogicServer\x64\LogicServerCQ64_R.exe|${GAME:server_path}Server跨服\DBServer\x64\DBServer64_R.exe|${GAME:server_path}Server跨服\GateServer\x64\GateServer64_R.exe|${GAME:server_path}Server跨服\LogicServer\x64\LogicServerCQ64_R.exe
|
|
||||||
mod_file_path = ${GAME:dir}测试1.txt|${GAME:dir}测试2.txt|${CLIENT_PATH:android_path}assets\data\scripts\platform\platform_adapter.lua|${CLIENT_PATH:android_path}assets\data\scripts\platform\windows\platform_adapter.lua|${GAME:server_path}server\LogicServer\crossserver.txt|${GAME:server_path}server\DBServer\crossserver.txt|${GAME:server_path}server2\LogicServer\crossserver.txt|${GAME:server_path}server2\DBServer\crossserver.txt|${GAME:server_path}server跨服\LogicServer\crossserver.txt|${GAME:server_path}server跨服\DBServer\crossserver.txt|${GAME:web_path}args.php|${GAME:web_path}args_ios.php|${GAME:web_path}api\notice.php
|
|
||||||
|
|
||||||
[OTHER]
|
[OTHER]
|
||||||
about = shileiye
|
about = shileiye
|
||||||
email = shileiye@qq.com
|
email = shileiye@qq.com
|
||||||
|
99
dist/config.ini
vendored
Normal file
99
dist/config.ini
vendored
Normal file
@ -0,0 +1,99 @@
|
|||||||
|
[GAME]
|
||||||
|
game_name = 幽冥传奇
|
||||||
|
now_ip = 192.168.0.186
|
||||||
|
new_ip = 192.168.0.186
|
||||||
|
file_encoding = utf-8
|
||||||
|
dir = D:\LYserver\
|
||||||
|
server_path = ${dir}server\
|
||||||
|
web_path = ${dir}web\
|
||||||
|
client_path = ${dir}client\
|
||||||
|
tool_path = ${dir}tool\
|
||||||
|
|
||||||
|
[GAME_PATH]
|
||||||
|
path01 = ${GAME:server_path}Common\AMServer\x64\AMServer64_R.exe
|
||||||
|
path02 = ${GAME:server_path}Common\LocalLogServer\x64\LocalLogServer64_R.exe
|
||||||
|
path03 = ${GAME:server_path}Common\LoggerServer\x64\LoggerServer64_R.exe
|
||||||
|
path04 = ${GAME:server_path}Common\SessionServer\x64\SessionServer64_R.exe
|
||||||
|
path05 = ${GAME:server_path}Common\NameServer\x64\NameServer64_R.exe
|
||||||
|
path06 = ${GAME:server_path}Common\BackStageServer\x64\BackStageServer64_R.exe,10
|
||||||
|
path07 = ${GAME:server_path}Server\DBServer\x64\DBServer64_R.exe
|
||||||
|
path08 = ${GAME:server_path}Server\GateServer\x64\GateServer64_R.exe
|
||||||
|
path09 = ${GAME:server_path}Server\LogicServer\x64\LogicServerCQ64_R.exe
|
||||||
|
path10 = ${GAME:server_path}Server2\DBServer\x64\DBServer64_R.exe
|
||||||
|
path11 = ${GAME:server_path}Server2\GateServer\x64\GateServer64_R.exe
|
||||||
|
path12 = ${GAME:server_path}Server2\LogicServer\x64\LogicServerCQ64_R.exe
|
||||||
|
path13 = ${GAME:server_path}Server跨服\DBServer\x64\DBServer64_R.exe
|
||||||
|
path14 = ${GAME:server_path}Server跨服\GateServer\x64\GateServer64_R.exe
|
||||||
|
path15 = ${GAME:server_path}Server跨服\LogicServer\x64\LogicServerCQ64_R.exe
|
||||||
|
|
||||||
|
[GAME_FILE_PATH]
|
||||||
|
path01 = ${GAME:dir}测试1.txt
|
||||||
|
path02 = ${GAME:dir}测试2.txt
|
||||||
|
path03 = ${ANDROID:android_name_file}assets\data\scripts\platform\platform_adapter.lua
|
||||||
|
path04 = ${ANDROID:android_name_file}assets\data\scripts\platform\windows\platform_adapter.lua
|
||||||
|
path05 = ${GAME:server_path}server\LogicServer\crossserver.txt
|
||||||
|
path06 = ${GAME:server_path}server\DBServer\crossserver.txt
|
||||||
|
path07 = ${GAME:server_path}server2\LogicServer\crossserver.txt
|
||||||
|
path08 = ${GAME:server_path}server2\DBServer\crossserver.txt
|
||||||
|
path09 = ${GAME:server_path}server跨服\LogicServer\crossserver.txt
|
||||||
|
path10 = ${GAME:server_path}server跨服\DBServer\crossserver.txt
|
||||||
|
path11 = ${GAME:web_path}args.php
|
||||||
|
path12 = ${GAME:web_path}args_ios.php
|
||||||
|
path13 = ${GAME:web_path}api\notice.php
|
||||||
|
|
||||||
|
[GAME_DATA_SQL]
|
||||||
|
game_ip = UPDATE `gameback`.`bg_server` SET `server_ip` = '${GAME:now_ip}' WHERE `id` IN (1,2)
|
||||||
|
game_name = UPDATE `gameback`.`bg_server` SET `name` = REPLACE(`name`,'${GAME:game_name}','${GAME:game_name}_new') WHERE `name` LIKE '%${GAME:game_name}%';
|
||||||
|
|
||||||
|
[WEB]
|
||||||
|
domain_name = localhost
|
||||||
|
web_port = 82
|
||||||
|
gm_url = http://${domain_name}:${web_port}/gm
|
||||||
|
gm_code = 123456
|
||||||
|
gm_user = test
|
||||||
|
gm_pass = test
|
||||||
|
game_back = http://${domain_name}:${web_port}/gameback
|
||||||
|
game_code = 123456
|
||||||
|
game_user = test
|
||||||
|
game_pass = test
|
||||||
|
|
||||||
|
[NGINX]
|
||||||
|
nginx_path = ${GAME:tool_path}Nginx1.15.11\
|
||||||
|
|
||||||
|
[PHP]
|
||||||
|
php_path = ${GAME:tool_path}php\php5.6.9nts\
|
||||||
|
php_spawner_path = ${GAME:tool_path}php-cgi-spawner\
|
||||||
|
php_cgi_port = 9001
|
||||||
|
|
||||||
|
[MYSQL]
|
||||||
|
mysql_path = ${GAME:tool_path}MySQL5.7.26\
|
||||||
|
mysql_host = 127.0.0.1
|
||||||
|
mysql_port = 3306
|
||||||
|
mysql_user = cq_dba
|
||||||
|
mysql_pass = 123456abc
|
||||||
|
|
||||||
|
[ANDROID]
|
||||||
|
android_path = ${GAME:client_path}apk\
|
||||||
|
android_name = ${android_path}game.apk
|
||||||
|
android_name_file = ${android_path}game\
|
||||||
|
tmp_android_name = ${android_path}game_tmp.apk
|
||||||
|
new_android_name = ${android_path}game_signed.apk
|
||||||
|
|
||||||
|
[pc]
|
||||||
|
pc_path = ${GAME:client_path}pc\
|
||||||
|
pc_name = ${pc_path}pc\bin.exe
|
||||||
|
|
||||||
|
[ios]
|
||||||
|
ios_path = ${GAME:client_path}ios\
|
||||||
|
ios_name = ${android_path}game.ipa
|
||||||
|
|
||||||
|
[TOOL_PATH]
|
||||||
|
apktool_path = ${GAME:tool_path}apktool\
|
||||||
|
heidisql_path = ${GAME:tool_path}HeidiSQL\heidisql.exe
|
||||||
|
notepad3_path = ${GAME:tool_path}Notepad3\Notepad3.exe
|
||||||
|
composer_path = ${GAME:tool_path}Composer\
|
||||||
|
|
||||||
|
[OTHER]
|
||||||
|
about = shileiye
|
||||||
|
email = shileiye@qq.com
|
||||||
|
|
BIN
dist/main.exe
vendored
Normal file
BIN
dist/main.exe
vendored
Normal file
Binary file not shown.
134
main.py
134
main.py
@ -10,6 +10,7 @@ import time
|
|||||||
from subprocess import Popen
|
from subprocess import Popen
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
import pymysql
|
||||||
from PyQt5.QtCore import pyqtSignal, QThread
|
from PyQt5.QtCore import pyqtSignal, QThread
|
||||||
from PyQt5.QtGui import QTextCursor
|
from PyQt5.QtGui import QTextCursor
|
||||||
from PyQt5.QtWidgets import QApplication, QMainWindow, QMessageBox
|
from PyQt5.QtWidgets import QApplication, QMainWindow, QMessageBox
|
||||||
@ -43,6 +44,8 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
|||||||
self.newIpInput.setText(config['GAME']['new_ip'])
|
self.newIpInput.setText(config['GAME']['new_ip'])
|
||||||
self.nowGameLabel.setText(config['GAME']['game_name'])
|
self.nowGameLabel.setText(config['GAME']['game_name'])
|
||||||
self.newGameInput.setText(config['GAME']['game_name'])
|
self.newGameInput.setText(config['GAME']['game_name'])
|
||||||
|
|
||||||
|
# 设置按钮状态
|
||||||
if isinstance(checkprocess("nginx.exe"), int):
|
if isinstance(checkprocess("nginx.exe"), int):
|
||||||
self.nginxButton.setText("关闭Nginx")
|
self.nginxButton.setText("关闭Nginx")
|
||||||
else:
|
else:
|
||||||
@ -63,22 +66,47 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
|||||||
# print(key, values)
|
# print(key, values)
|
||||||
# print(config.items("GAME_FILE_PATH"))
|
# print(config.items("GAME_FILE_PATH"))
|
||||||
# return
|
# return
|
||||||
# for key, value in config.items('GAME_FILE_PATH'):
|
|
||||||
# print(key, value)
|
|
||||||
# return
|
|
||||||
message = QMessageBox.information(self, "提示信息", "确定要保存设置吗?", QMessageBox.Ok | QMessageBox.No, QMessageBox.No)
|
message = QMessageBox.information(self, "提示信息", "确定要保存设置吗?", QMessageBox.Ok | QMessageBox.No, QMessageBox.No)
|
||||||
if message == QMessageBox.No:
|
if message == QMessageBox.No:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# 取值
|
||||||
now_ip = config['GAME']['now_ip']
|
now_ip = config['GAME']['now_ip']
|
||||||
new_ip = self.newIpInput.text()
|
new_ip = self.newIpInput.text()
|
||||||
now_game = config['GAME']['game_name']
|
now_game = config['GAME']['game_name']
|
||||||
new_game = self.newGameInput.text()
|
new_game = self.newGameInput.text()
|
||||||
compile_ip = re.compile('^(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[1-9])\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)$')
|
compile_ip = re.compile('^(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[1-9])\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)$')
|
||||||
|
|
||||||
# 验证IP地址格式
|
# 验证IP地址格式
|
||||||
if (new_ip == "") or new_game == "" or not (compile_ip.match(new_ip)):
|
if (new_ip == "") or new_game == "" or not (compile_ip.match(new_ip)):
|
||||||
QMessageBox.information(self, "提示信息", "IP地址、游戏名称为空或有误,请正确填写IPv4地址或游戏名称!")
|
QMessageBox.information(self, "提示信息", "IP地址、游戏名称为空或有误,请正确填写IPv4地址或游戏名称!")
|
||||||
return
|
return
|
||||||
dirname = config['GAME_FILE_PATH'].items()
|
|
||||||
|
# 处理SQL语句
|
||||||
|
sql_game_ip = config['GAME_DATA_SQL']['game_ip'].replace(now_ip, new_ip)
|
||||||
|
sql_game_name = config['GAME_DATA_SQL']['game_name'].replace(now_game + '_new', new_game)
|
||||||
|
sqls = [sql_game_ip, sql_game_name]
|
||||||
|
|
||||||
|
# 判断MYSQL是否启动
|
||||||
|
if isinstance(checkprocess("mysqld.exe"), int):
|
||||||
|
mysql_run(sqls)
|
||||||
|
else:
|
||||||
|
message = QMessageBox.information(self, "提示信息", "MYSQL尚未启动,数据库相关脚本无法执行,是否现在启动MYSQL?", QMessageBox.Ok | QMessageBox.No, QMessageBox.Ok)
|
||||||
|
if message == QMessageBox.Ok:
|
||||||
|
self.mysql(self.mysqlButton) # 触发MYSQL启动按钮
|
||||||
|
sum = 0
|
||||||
|
# 以0.5秒的频次检测MYSQL是否启动,超过20次则超时
|
||||||
|
while not isinstance(checkprocess("mysqld.exe"), int):
|
||||||
|
if sum > 20:
|
||||||
|
QMessageBox.information(self, "提示信息", "MYSQL启动失败,请重新尝试!")
|
||||||
|
return
|
||||||
|
time.sleep(0.5)
|
||||||
|
sum = sum + 1
|
||||||
|
mysql_run(sqls)
|
||||||
|
else:
|
||||||
|
return
|
||||||
|
|
||||||
|
# 配置文件处理
|
||||||
sum = 0
|
sum = 0
|
||||||
for key, value in config.items('GAME_FILE_PATH'):
|
for key, value in config.items('GAME_FILE_PATH'):
|
||||||
print(key, value)
|
print(key, value)
|
||||||
@ -111,14 +139,14 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
|||||||
saveconfig = open(configFile, 'wt', encoding=config['GAME']['file_encoding'])
|
saveconfig = open(configFile, 'wt', encoding=config['GAME']['file_encoding'])
|
||||||
config.write(saveconfig) # 把要修改的节点的内容写到文件中
|
config.write(saveconfig) # 把要修改的节点的内容写到文件中
|
||||||
saveconfig.close()
|
saveconfig.close()
|
||||||
# 设置界面显示
|
|
||||||
|
# 设置按钮文字变化
|
||||||
self.nowGameLabel.setText(new_game)
|
self.nowGameLabel.setText(new_game)
|
||||||
self.nowIpLabel.setText(new_ip)
|
self.nowIpLabel.setText(new_ip)
|
||||||
|
|
||||||
# 成功提示
|
# 成功提示
|
||||||
QMessageBox.information(self, "提示信息", "配置保存成功!重启游戏后生效!<br>游戏名称:" + new_game + "----游戏IP:" + new_ip + "<br>共配置了" + str(sum) + "个文件")
|
QMessageBox.information(self, "提示信息", "配置保存成功!重启游戏后生效!<br>游戏名称:" + new_game + "----游戏IP:" + new_ip + "<br>共配置了" + str(sum) + "个文件")
|
||||||
print('修改完成:' + new_game + ':' + new_ip)
|
print('修改完成:' + new_game + ':' + new_ip)
|
||||||
return
|
|
||||||
# TODO 待完成数据库配置修改
|
|
||||||
|
|
||||||
def nginx(self, event):
|
def nginx(self, event):
|
||||||
if self.nginxButton.text() == '启动Nginx':
|
if self.nginxButton.text() == '启动Nginx':
|
||||||
@ -174,34 +202,47 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
|||||||
|
|
||||||
def game(self, event):
|
def game(self, event):
|
||||||
if self.gameButton.text() == '启动游戏':
|
if self.gameButton.text() == '启动游戏':
|
||||||
# TODO 更改配置文件格式
|
# 读取游戏启动路径
|
||||||
game_path = config['GAME_PATH']['game_path'].split("|")
|
for key, value in config.items('GAME_PATH'):
|
||||||
# 遍历字典列表
|
print(key, value)
|
||||||
for f in game_path:
|
# 处理启动时间
|
||||||
print(f)
|
if len(value.split(",")) < 2:
|
||||||
# 执行文本替换
|
|
||||||
if len(f.split(",")) < 2:
|
|
||||||
sleeptime = 0
|
sleeptime = 0
|
||||||
else:
|
else:
|
||||||
sleeptime = float(f.split(",")[1])
|
sleeptime = float(value.split(",")[1])
|
||||||
game_file = f.split(",")[0]
|
game_file = value.split(",")[0]
|
||||||
try:
|
try:
|
||||||
Popen('start ' + game_file,
|
Popen('start ' + game_file,
|
||||||
shell=True,
|
shell=True,
|
||||||
# cwd=values,
|
# cwd=values,
|
||||||
# encoding='utf-8'
|
# encoding='utf-8'
|
||||||
)
|
)
|
||||||
time.sleep(float(sleeptime)) # 延迟时间
|
time.sleep(float(sleeptime)) # 延迟启动时间
|
||||||
except:
|
except:
|
||||||
QMessageBox.information(self, "提示信息", "启动“" + game_file + "”出错,可能文件不存在或配置不对!")
|
QMessageBox.information(self, "提示信息", "启动“" + game_file + "”出错,可能文件不存在或配置不对!")
|
||||||
return
|
return
|
||||||
self.gameButton.setText("关闭游戏")
|
self.gameButton.setText("关闭游戏")
|
||||||
else:
|
else:
|
||||||
Popen(
|
# 读取游戏启动路径
|
||||||
'taskkill /f /t /im LocalLogServer64_R.exe & taskkill /f /t /im LoggerServer64_R.exe & taskkill /f /t /im SessionServer64_R.exe & taskkill /f /t /im NameServer64_R.exe & taskkill /f /t /im LogicServerCQ64_R.exe & taskkill /f /t /im GateServer64_R.exe & taskkill /f /t /im DBCenterServer64_R.exe & taskkill /f /t /im DBServer64_R.exe & taskkill /f /t /im BackStageServer64_R.exe & taskkill /f /t /im AMServer64_R.exe',
|
for key, value in config.items('GAME_PATH'):
|
||||||
shell=True,
|
print(key, value)
|
||||||
# encoding='utf-8'
|
# 获取进程名称并结束进程
|
||||||
)
|
game_file = value.split(",")[0].split("\\")
|
||||||
|
game_file = game_file[len(game_file) - 1]
|
||||||
|
try:
|
||||||
|
Popen(
|
||||||
|
'taskkill /f /t /im ' + game_file,
|
||||||
|
shell=True,
|
||||||
|
# encoding='utf-8'
|
||||||
|
)
|
||||||
|
except:
|
||||||
|
QMessageBox.information(self, "提示信息", "关闭游戏进程:“" + game_file + "”出错!")
|
||||||
|
return
|
||||||
|
# Popen(
|
||||||
|
# 'taskkill /f /t /im LocalLogServer64_R.exe & taskkill /f /t /im LoggerServer64_R.exe & taskkill /f /t /im SessionServer64_R.exe & taskkill /f /t /im NameServer64_R.exe & taskkill /f /t /im LogicServerCQ64_R.exe & taskkill /f /t /im GateServer64_R.exe & taskkill /f /t /im DBCenterServer64_R.exe & taskkill /f /t /im DBServer64_R.exe & taskkill /f /t /im BackStageServer64_R.exe & taskkill /f /t /im AMServer64_R.exe',
|
||||||
|
# shell=True,
|
||||||
|
# # encoding='utf-8'
|
||||||
|
# )
|
||||||
self.gameButton.setText("启动游戏")
|
self.gameButton.setText("启动游戏")
|
||||||
print('启动游戏,按钮被单击')
|
print('启动游戏,按钮被单击')
|
||||||
|
|
||||||
@ -238,6 +279,25 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
|||||||
self.add_cmd_msg(cmd, cwd, title, obj, path, code)
|
self.add_cmd_msg(cmd, cwd, title, obj, path, code)
|
||||||
print('APK签名,按钮被单击')
|
print('APK签名,按钮被单击')
|
||||||
|
|
||||||
|
def heidisql(self, event):
|
||||||
|
cmd = 'start "" ' + config['TOOL_PATH']['heidisql_path']
|
||||||
|
Popen(cmd,
|
||||||
|
shell=True,
|
||||||
|
# cwd=config['MYSQL']['mysql_path'] + 'bin',
|
||||||
|
# encoding='utf-8'
|
||||||
|
)
|
||||||
|
print('heidisql,按钮被单击')
|
||||||
|
|
||||||
|
def gmurl(self, event):
|
||||||
|
cmd = 'start ' + config['WEB']['gm_url']
|
||||||
|
Popen(cmd,
|
||||||
|
shell=True,
|
||||||
|
# cwd=config['MYSQL']['mysql_path'] + 'bin',
|
||||||
|
# encoding='utf-8'
|
||||||
|
)
|
||||||
|
print('gmurl,按钮被单击')
|
||||||
|
#TODO 增加自动登录GM后台功能
|
||||||
|
|
||||||
# 利用新线程进行脚本执行回显
|
# 利用新线程进行脚本执行回显
|
||||||
def add_cmd_msg(self, cmd, cwd="", title="", obj="", path="", code="utf8"):
|
def add_cmd_msg(self, cmd, cwd="", title="", obj="", path="", code="utf8"):
|
||||||
obj.setEnabled(False)
|
obj.setEnabled(False)
|
||||||
@ -291,6 +351,34 @@ class Thread(QThread):
|
|||||||
startfile(self.path)
|
startfile(self.path)
|
||||||
|
|
||||||
|
|
||||||
|
# MYSQL操作函数
|
||||||
|
def mysql_run(sqls, table=""):
|
||||||
|
print(sqls)
|
||||||
|
# 打开数据库连接
|
||||||
|
db = pymysql.connect(host=config['MYSQL']['mysql_host'],
|
||||||
|
user=config['MYSQL']['mysql_user'],
|
||||||
|
password=config['MYSQL']['mysql_pass'],
|
||||||
|
database=table,
|
||||||
|
port=int(config['MYSQL']['mysql_port'])
|
||||||
|
)
|
||||||
|
# 使用cursor()方法获取操作游标
|
||||||
|
cursor = db.cursor()
|
||||||
|
for sql in sqls:
|
||||||
|
try:
|
||||||
|
# 执行SQL语句
|
||||||
|
cursor.execute(sql)
|
||||||
|
# 提交到数据库执行
|
||||||
|
db.commit()
|
||||||
|
print('更新成功')
|
||||||
|
except:
|
||||||
|
print('出错了')
|
||||||
|
# 发生错误时回滚
|
||||||
|
db.rollback()
|
||||||
|
# 关闭数据库连接
|
||||||
|
db.close()
|
||||||
|
print('MySql执行完毕')
|
||||||
|
|
||||||
|
|
||||||
# 进程判断,返回进程ID
|
# 进程判断,返回进程ID
|
||||||
def checkprocess(processname):
|
def checkprocess(processname):
|
||||||
pl = psutil.pids()
|
pl = psutil.pids()
|
||||||
@ -299,7 +387,7 @@ def checkprocess(processname):
|
|||||||
return pid
|
return pid
|
||||||
|
|
||||||
|
|
||||||
# 打开文件或文件夹
|
# 打开文件或文件夹,并且选中文件
|
||||||
def startfile(filename):
|
def startfile(filename):
|
||||||
try:
|
try:
|
||||||
os.startfile(f'explorer /select, "{pathlib.Path(filename)}')
|
os.startfile(f'explorer /select, "{pathlib.Path(filename)}')
|
||||||
|
40
main.spec
Normal file
40
main.spec
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
# -*- mode: python ; coding: utf-8 -*-
|
||||||
|
|
||||||
|
|
||||||
|
block_cipher = None
|
||||||
|
|
||||||
|
|
||||||
|
a = Analysis(['main.py'],
|
||||||
|
pathex=['D:\\soft\\Python\\Python39\\Lib\\site-packages', 'D:\\soft\\Python\\Python39\\Lib', 'D:\\soft\\Python\\Python39\\Lib\\site-packages\\PyQt5\\Qt\\bin', 'D:\\Code\\python\\onekey\\venv\\Lib\\site-packages', ''],
|
||||||
|
binaries=[],
|
||||||
|
datas=[],
|
||||||
|
hiddenimports=[],
|
||||||
|
hookspath=[],
|
||||||
|
hooksconfig={},
|
||||||
|
runtime_hooks=[],
|
||||||
|
excludes=[],
|
||||||
|
win_no_prefer_redirects=False,
|
||||||
|
win_private_assemblies=False,
|
||||||
|
cipher=block_cipher,
|
||||||
|
noarchive=False)
|
||||||
|
pyz = PYZ(a.pure, a.zipped_data,
|
||||||
|
cipher=block_cipher)
|
||||||
|
|
||||||
|
exe = EXE(pyz,
|
||||||
|
a.scripts,
|
||||||
|
a.binaries,
|
||||||
|
a.zipfiles,
|
||||||
|
a.datas,
|
||||||
|
[],
|
||||||
|
name='main',
|
||||||
|
debug=False,
|
||||||
|
bootloader_ignore_signals=False,
|
||||||
|
strip=False,
|
||||||
|
upx=True,
|
||||||
|
upx_exclude=[],
|
||||||
|
runtime_tmpdir=None,
|
||||||
|
console=False,
|
||||||
|
disable_windowed_traceback=False,
|
||||||
|
target_arch=None,
|
||||||
|
codesign_identity=None,
|
||||||
|
entitlements_file=None )
|
19
mainui.py
19
mainui.py
@ -16,6 +16,9 @@ class Ui_MainWindow(object):
|
|||||||
MainWindow.setObjectName("MainWindow")
|
MainWindow.setObjectName("MainWindow")
|
||||||
MainWindow.resize(560, 530)
|
MainWindow.resize(560, 530)
|
||||||
MainWindow.setMouseTracking(False)
|
MainWindow.setMouseTracking(False)
|
||||||
|
icon = QtGui.QIcon()
|
||||||
|
icon.addPixmap(QtGui.QPixmap(":/icon/src/icon/dengdai.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||||
|
MainWindow.setWindowIcon(icon)
|
||||||
self.centralwidget = QtWidgets.QWidget(MainWindow)
|
self.centralwidget = QtWidgets.QWidget(MainWindow)
|
||||||
self.centralwidget.setObjectName("centralwidget")
|
self.centralwidget.setObjectName("centralwidget")
|
||||||
self.groupBox = QtWidgets.QGroupBox(self.centralwidget)
|
self.groupBox = QtWidgets.QGroupBox(self.centralwidget)
|
||||||
@ -81,6 +84,12 @@ class Ui_MainWindow(object):
|
|||||||
self.qianmingButton = QtWidgets.QPushButton(self.groupBox_3)
|
self.qianmingButton = QtWidgets.QPushButton(self.groupBox_3)
|
||||||
self.qianmingButton.setGeometry(QtCore.QRect(190, 20, 80, 45))
|
self.qianmingButton.setGeometry(QtCore.QRect(190, 20, 80, 45))
|
||||||
self.qianmingButton.setObjectName("qianmingButton")
|
self.qianmingButton.setObjectName("qianmingButton")
|
||||||
|
self.heidisqlButton = QtWidgets.QPushButton(self.groupBox_3)
|
||||||
|
self.heidisqlButton.setGeometry(QtCore.QRect(280, 20, 80, 45))
|
||||||
|
self.heidisqlButton.setObjectName("heidisqlButton")
|
||||||
|
self.gmurlButton = QtWidgets.QPushButton(self.groupBox_3)
|
||||||
|
self.gmurlButton.setGeometry(QtCore.QRect(370, 20, 80, 45))
|
||||||
|
self.gmurlButton.setObjectName("gmurlButton")
|
||||||
self.CMDtextEdit = QtWidgets.QTextEdit(self.centralwidget)
|
self.CMDtextEdit = QtWidgets.QTextEdit(self.centralwidget)
|
||||||
self.CMDtextEdit.setGeometry(QtCore.QRect(20, 320, 521, 180))
|
self.CMDtextEdit.setGeometry(QtCore.QRect(20, 320, 521, 180))
|
||||||
self.CMDtextEdit.setStyleSheet("background-color: rgb(0, 0, 0);\n"
|
self.CMDtextEdit.setStyleSheet("background-color: rgb(0, 0, 0);\n"
|
||||||
@ -99,13 +108,15 @@ class Ui_MainWindow(object):
|
|||||||
self.mysqlButton.clicked.connect(MainWindow.mysql)
|
self.mysqlButton.clicked.connect(MainWindow.mysql)
|
||||||
self.gameButton.clicked.connect(MainWindow.game)
|
self.gameButton.clicked.connect(MainWindow.game)
|
||||||
self.fanbianyiButton.clicked.connect(MainWindow.fanbianyi)
|
self.fanbianyiButton.clicked.connect(MainWindow.fanbianyi)
|
||||||
|
self.heidisqlButton.clicked.connect(MainWindow.heidisql)
|
||||||
|
self.newIpInput.returnPressed.connect(self.saveSetButton.click)
|
||||||
|
self.newGameInput.returnPressed.connect(self.saveSetButton.click)
|
||||||
|
self.gmurlButton.clicked.connect(MainWindow.gmurl)
|
||||||
QtCore.QMetaObject.connectSlotsByName(MainWindow)
|
QtCore.QMetaObject.connectSlotsByName(MainWindow)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def retranslateUi(self, MainWindow):
|
def retranslateUi(self, MainWindow):
|
||||||
_translate = QtCore.QCoreApplication.translate
|
_translate = QtCore.QCoreApplication.translate
|
||||||
MainWindow.setWindowTitle(_translate("MainWindow", "通用游戏部署工具 v1.0 By:shileiye"))
|
MainWindow.setWindowTitle(_translate("MainWindow", "牛叉游戏部署工具 v1.0 By:shileiye"))
|
||||||
self.groupBox.setTitle(_translate("MainWindow", "基本设置"))
|
self.groupBox.setTitle(_translate("MainWindow", "基本设置"))
|
||||||
self.saveSetButton.setText(_translate("MainWindow", "保存"))
|
self.saveSetButton.setText(_translate("MainWindow", "保存"))
|
||||||
self.newGameInput.setPlaceholderText(_translate("MainWindow", "输入新名称"))
|
self.newGameInput.setPlaceholderText(_translate("MainWindow", "输入新名称"))
|
||||||
@ -124,6 +135,8 @@ class Ui_MainWindow(object):
|
|||||||
self.fanbianyiButton.setText(_translate("MainWindow", "反编译APK"))
|
self.fanbianyiButton.setText(_translate("MainWindow", "反编译APK"))
|
||||||
self.shengchengButton.setText(_translate("MainWindow", "生成APK"))
|
self.shengchengButton.setText(_translate("MainWindow", "生成APK"))
|
||||||
self.qianmingButton.setText(_translate("MainWindow", "APK签名"))
|
self.qianmingButton.setText(_translate("MainWindow", "APK签名"))
|
||||||
|
self.heidisqlButton.setText(_translate("MainWindow", "HeidiSQL"))
|
||||||
|
self.gmurlButton.setText(_translate("MainWindow", "GM后台"))
|
||||||
self.CMDtextEdit.setHtml(_translate("MainWindow", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
|
self.CMDtextEdit.setHtml(_translate("MainWindow", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
|
||||||
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
|
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
|
||||||
"p, li { white-space: pre-wrap; }\n"
|
"p, li { white-space: pre-wrap; }\n"
|
||||||
|
96
mainui.ui
96
mainui.ui
@ -14,7 +14,11 @@
|
|||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>通用游戏部署工具 v1.0 By:shileiye</string>
|
<string>牛叉游戏部署工具 v1.0 By:shileiye</string>
|
||||||
|
</property>
|
||||||
|
<property name="windowIcon">
|
||||||
|
<iconset resource="icon.qrc">
|
||||||
|
<normaloff>:/icon/src/icon/dengdai.svg</normaloff>:/icon/src/icon/dengdai.svg</iconset>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="centralwidget">
|
<widget class="QWidget" name="centralwidget">
|
||||||
<widget class="QGroupBox" name="groupBox">
|
<widget class="QGroupBox" name="groupBox">
|
||||||
@ -277,6 +281,32 @@
|
|||||||
<string>APK签名</string>
|
<string>APK签名</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QPushButton" name="heidisqlButton">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>280</x>
|
||||||
|
<y>20</y>
|
||||||
|
<width>80</width>
|
||||||
|
<height>45</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>HeidiSQL</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QPushButton" name="gmurlButton">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>370</x>
|
||||||
|
<y>20</y>
|
||||||
|
<width>80</width>
|
||||||
|
<height>45</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>GM后台</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QTextEdit" name="CMDtextEdit">
|
<widget class="QTextEdit" name="CMDtextEdit">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
@ -418,5 +448,69 @@ p, li { white-space: pre-wrap; }
|
|||||||
</hint>
|
</hint>
|
||||||
</hints>
|
</hints>
|
||||||
</connection>
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>heidisqlButton</sender>
|
||||||
|
<signal>clicked()</signal>
|
||||||
|
<receiver>MainWindow</receiver>
|
||||||
|
<slot>lower()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>339</x>
|
||||||
|
<y>262</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>279</x>
|
||||||
|
<y>264</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>newIpInput</sender>
|
||||||
|
<signal>returnPressed()</signal>
|
||||||
|
<receiver>saveSetButton</receiver>
|
||||||
|
<slot>click()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>349</x>
|
||||||
|
<y>89</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>477</x>
|
||||||
|
<y>75</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>newGameInput</sender>
|
||||||
|
<signal>returnPressed()</signal>
|
||||||
|
<receiver>saveSetButton</receiver>
|
||||||
|
<slot>click()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>149</x>
|
||||||
|
<y>89</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>477</x>
|
||||||
|
<y>75</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>gmurlButton</sender>
|
||||||
|
<signal>clicked()</signal>
|
||||||
|
<receiver>MainWindow</receiver>
|
||||||
|
<slot>lower()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>429</x>
|
||||||
|
<y>262</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>279</x>
|
||||||
|
<y>264</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
</connections>
|
</connections>
|
||||||
</ui>
|
</ui>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user