优化SQL执行语句,增加语句常量带入
增加REDIS配置(未启用)
This commit is contained in:
parent
350b7194de
commit
af16062ec8
11
config.ini
11
config.ini
@ -42,8 +42,8 @@ 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]
|
||||||
game_ip = UPDATE `gameback`.`bg_server` SET `server_ip` = '${GAME:now_ip}' WHERE `id` IN (1,2)
|
game_ip = UPDATE `gameback`.`bg_server` SET `server_ip` = '~【game_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}%';
|
game_name = UPDATE `gameback`.`bg_server` SET `name` = REPLACE(`name`,'${GAME:game_name}','~【game_name】~') WHERE `name` LIKE '%${GAME:game_name}%';
|
||||||
|
|
||||||
[WEB]
|
[WEB]
|
||||||
domain_name = localhost
|
domain_name = localhost
|
||||||
@ -72,6 +72,13 @@ mysql_port = 3306
|
|||||||
mysql_user = cq_dba
|
mysql_user = cq_dba
|
||||||
mysql_pass = 123456abc
|
mysql_pass = 123456abc
|
||||||
|
|
||||||
|
[REDIS]
|
||||||
|
redis_path = ${GAME:tool_path}Redis\
|
||||||
|
redis_host = 127.0.0.1
|
||||||
|
redis_port = 6379
|
||||||
|
redis_dbfile = dump.rdb
|
||||||
|
redis_pass = 123456abc
|
||||||
|
|
||||||
[ANDROID]
|
[ANDROID]
|
||||||
android_path = ${GAME:client_path}apk\
|
android_path = ${GAME:client_path}apk\
|
||||||
android_name = ${android_path}game.apk
|
android_name = ${android_path}game.apk
|
||||||
|
BIN
dist/main.exe
vendored
BIN
dist/main.exe
vendored
Binary file not shown.
49
main.py
49
main.py
@ -84,14 +84,6 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
|||||||
|
|
||||||
def saveSet(self, event):
|
def saveSet(self, event):
|
||||||
print('保存设置,按钮被单击')
|
print('保存设置,按钮被单击')
|
||||||
# print(config['GAME_FILE_PATH']['game'])
|
|
||||||
# tinydict = ast.literal_eval(config['GAME_PATH']['game'])
|
|
||||||
# print("字典值 : %s" %tinydict.items())
|
|
||||||
# # 遍历字典列表
|
|
||||||
# for key, values in tinydict.items():
|
|
||||||
# print(key, values)
|
|
||||||
# print(config.items("GAME_FILE_PATH"))
|
|
||||||
# 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
|
||||||
@ -110,28 +102,33 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
|||||||
|
|
||||||
# 处理SQL语句
|
# 处理SQL语句
|
||||||
if config.has_section('GAME_DATA_SQL'):
|
if config.has_section('GAME_DATA_SQL'):
|
||||||
sql_game_ip = config['GAME_DATA_SQL']['game_ip'].replace(now_ip, new_ip)
|
sqls = []
|
||||||
sql_game_name = config['GAME_DATA_SQL']['game_name'].replace(now_game + '_new', new_game)
|
for key, value in config.items('GAME_DATA_SQL'):
|
||||||
sqls = [sql_game_ip, sql_game_name]
|
print(key, value)
|
||||||
|
sql = value.replace('~【game_ip】~', new_ip)
|
||||||
|
sql = sql.replace('~【game_name】~', new_game)
|
||||||
|
sqls.append(sql)
|
||||||
|
print(key, sql)
|
||||||
|
|
||||||
# 判断MYSQL是否启动
|
# 判断MYSQL是否启动
|
||||||
if isinstance(checkprocess("mysqld.exe"), int):
|
if sqls:
|
||||||
mysql_run(sqls)
|
if isinstance(checkprocess("mysqld.exe"), int):
|
||||||
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)
|
mysql_run(sqls)
|
||||||
else:
|
else:
|
||||||
return
|
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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user