日常更新
This commit is contained in:
parent
4735cf0081
commit
e7d1b45de1
Binary file not shown.
Binary file not shown.
32
apps.py
32
apps.py
|
@ -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"
|
||||
|
||||
login_json_file = "config_app/login_user.json"
|
||||
favorite_file_sqlite = "config_app/favorite.db"
|
||||
|
||||
window_size_int = (950, 560)
|
||||
|
||||
|
@ -102,6 +103,7 @@ class Thread_appcode_login_user(QThread):
|
|||
super(Thread_appcode_login_user, self).__init__()
|
||||
|
||||
def run(self):
|
||||
try:
|
||||
data = dict()
|
||||
code = int(0)
|
||||
|
||||
|
@ -115,6 +117,26 @@ class Thread_appcode_login_user(QThread):
|
|||
}
|
||||
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:
|
||||
login_json_user = json.load(f_read)
|
||||
|
||||
|
@ -171,6 +193,16 @@ class Thread_appcode_login_user(QThread):
|
|||
"code": code
|
||||
}
|
||||
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):
|
||||
def __init__(self, image, names: str, tests: str):
|
||||
|
|
BIN
config_app/favorite.db
Normal file
BIN
config_app/favorite.db
Normal file
Binary file not shown.
|
@ -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"}
|
7
main.py
7
main.py
|
@ -26,6 +26,12 @@ class Login_Window_app(QWidget):
|
|||
|
||||
def run_th_app(self, data_config: dict):
|
||||
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:
|
||||
apps.Message_ok(message="网络出问题了,请检查完网络连接再来哦主人")
|
||||
return sys.exit(0)
|
||||
|
@ -254,7 +260,6 @@ class My_APP_Window(QTabWidget):
|
|||
self.server_ip_list = QListWidget()
|
||||
self.server_ip_list.setFixedSize(500, 55)
|
||||
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)
|
||||
|
||||
self.start_game_button = QPushButton(text="启动游戏")
|
||||
|
|
Loading…
Reference in New Issue
Block a user