日常更新

This commit is contained in:
LanShui 2024-05-21 23:33:06 +08:00
parent 4735cf0081
commit e7d1b45de1
7 changed files with 95 additions and 56 deletions

Binary file not shown.

Binary file not shown.

32
apps.py
View File

@ -16,6 +16,7 @@ reload_password_page = "https://login.mc-user.com:233/account/login"
register_web_page = "https://login.mc-user.com:233/f0649fc2aeb411eda71f00163e095b49/register" register_web_page = "https://login.mc-user.com:233/f0649fc2aeb411eda71f00163e095b49/register"
login_json_file = "config_app/login_user.json" login_json_file = "config_app/login_user.json"
favorite_file_sqlite = "config_app/favorite.db"
window_size_int = (950, 560) window_size_int = (950, 560)
@ -102,6 +103,7 @@ class Thread_appcode_login_user(QThread):
super(Thread_appcode_login_user, self).__init__() super(Thread_appcode_login_user, self).__init__()
def run(self): def run(self):
try:
data = dict() data = dict()
code = int(0) code = int(0)
@ -115,6 +117,26 @@ class Thread_appcode_login_user(QThread):
} }
return self.data_th.emit(data_config) return self.data_th.emit(data_config)
if os.path.isfile(favorite_file_sqlite) is False:
sqlite_list_code = [
'''
CREATE TABLE Favorite_table (
ID INTEGER PRIMARY KEY AUTOINCREMENT,
SERVERNAME TEXT,
SERVER_TEST TEXT,
IMAGE TEXT,
SERVER_FILE_NAME TEXT
);
'''
]
sql = sqlite3.connect(favorite_file_sqlite)
csr = sql.cursor()
for sqlite_play_i in sqlite_list_code:
csr.execute(sqlite_play_i)
csr.close()
sql.commit()
sql.close()
with open(file=login_json_file, mode='r', encoding="UTF-8", newline='') as f_read: with open(file=login_json_file, mode='r', encoding="UTF-8", newline='') as f_read:
login_json_user = json.load(f_read) login_json_user = json.load(f_read)
@ -171,6 +193,16 @@ class Thread_appcode_login_user(QThread):
"code": code "code": code
} }
return self.data_th.emit(data_config) return self.data_th.emit(data_config)
except Exception as error:
data = {
"error": str(error)
}
code = int(9)
data_configs = {
"data_config": data,
"code": code
}
return self.data_th.emit(data_configs)
class customQListWidgetItem(QListWidgetItem): class customQListWidgetItem(QListWidgetItem):
def __init__(self, image, names: str, tests: str): def __init__(self, image, names: str, tests: str):

BIN
config_app/favorite.db Normal file

Binary file not shown.

View File

@ -1 +1 @@
{"accessToken": "eb00b22d167411ef92c5e252f2c508d4", "clientToken": "ea55c2cc-1674-11ef-92c5-e252f2c508d4", "id": "a6143eb7a7883daab9a05dbe052879a1", "name": "GameDaBai"} {"accessToken": "7e56f116178611ef92c5e252f2c508d4", "clientToken": "7da4f2dd-1786-11ef-92c5-e252f2c508d4", "id": "a6143eb7a7883daab9a05dbe052879a1", "name": "GameDaBai"}

View File

@ -26,6 +26,12 @@ class Login_Window_app(QWidget):
def run_th_app(self, data_config: dict): def run_th_app(self, data_config: dict):
self.destroy() self.destroy()
if data_config.get("code") == 9:
error_str = data_config.get("data_config")
message_error = apps.Message_yes_no(message="在启动客户端时发生严重错误,请复制以下错误信息发送给开发者或管理员,单击确定即可复制\n\n" + error_str.get("error"))
if message_error.value() is True:
pyperclip.copy(error_str.get("error"))
return sys.exit(0)
if data_config.get("code") == 2: if data_config.get("code") == 2:
apps.Message_ok(message="网络出问题了,请检查完网络连接再来哦主人") apps.Message_ok(message="网络出问题了,请检查完网络连接再来哦主人")
return sys.exit(0) return sys.exit(0)
@ -254,7 +260,6 @@ class My_APP_Window(QTabWidget):
self.server_ip_list = QListWidget() self.server_ip_list = QListWidget()
self.server_ip_list.setFixedSize(500, 55) self.server_ip_list.setFixedSize(500, 55)
self.server_ip_list.setFlow(QListView.LeftToRight) self.server_ip_list.setFlow(QListView.LeftToRight)
self.server_ip_list.addItems(["name1", "name2", "name33"])
index_home_grid_box.addWidget(self.server_ip_list, 2, 0, alignment=Qt.AlignLeft | Qt.AlignBottom) index_home_grid_box.addWidget(self.server_ip_list, 2, 0, alignment=Qt.AlignLeft | Qt.AlignBottom)
self.start_game_button = QPushButton(text="启动游戏") self.start_game_button = QPushButton(text="启动游戏")

View File

@ -12,6 +12,8 @@ import requests
import json import json
import datetime import datetime
import sqlite3 import sqlite3
import pyperclip
import traceback
from time import sleep from time import sleep
import zipfile import zipfile
from shutil import rmtree from shutil import rmtree