From 4735cf0081f4cee4fde89b22ad7e30dbef6560ac Mon Sep 17 00:00:00 2001 From: LanShui <2031845258@qq.com> Date: Mon, 20 May 2024 16:23:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E5=B8=B8=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- __pycache__/apps.cpython-310.pyc | Bin 7211 -> 6634 bytes __pycache__/module.cpython-310.pyc | Bin 1056 -> 1076 bytes apps.py | 41 ++++++----------------------- config_app/login_user.json | 2 +- config_app/server_list_config.json | 1 - main.py | 19 ++++++++----- module.py | 2 +- 7 files changed, 22 insertions(+), 43 deletions(-) delete mode 100644 config_app/server_list_config.json diff --git a/__pycache__/apps.cpython-310.pyc b/__pycache__/apps.cpython-310.pyc index 147230b96cc5537350a9a9498a79dd8fb1a83daf..c116246ac8419077f49d9aeb3a0cf398af749932 100644 GIT binary patch delta 2731 zcmZ`*%WoUU8QL z7M2xU8OX^Enn5ms(Td5*=%GdnG?xMe`UmuoOMyKUD0*pnXwiER_xpylBpV7B^W*oP zZ@!tGZ-0B?-{($y>2yMaU)^|p^}?v8{S%p^KNFZsF#JFL>h#;Yl`PBA0?V)Jv`9<$ z%so;m&_0%@{U9^x03Ez%R*F|OIz)%>X>^#C_KZp&@FR2-_)*3813yN`fgfiBpdSSO z1f2kWf(-#bOiwOr>m za{viq5ggseBz#0ZijVyvANh=&L8CCS(h|aJ+IN`$kc4sDuDMm;x9!8o`~=v&Apa2! zmQMr4Czaa*TNU%ll~16+*zkOQ5~zndKZAk@+hR@84Re@fw&AsWw#b?9UqStO`6$+S zwTOOZH;~!zwpbWnbG?%KzZ-BW9H7je@`qV*+{3UdmKzP8ozITm~KaewI2^65GVSsMl}E3i0pZt3I}>EuSy6&b$pzWV z+E3H%e2|BP208?^g&?=z7Zf^B!Og!aeX(7{h(Qr-2BCgK_sM#Hy9E3I9S%wkQMP|q z^(}UuBSALE(UAv6n;g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y}r|B%Brq84+9rwUdIjIKsbwVggdzxC{A7g*cf#F7)&~`;MmMJkcSas7ZHvUMc)}X zc?n=+fQx=7IC^ppd6yC1ML0?nJzmAh_nbcj#|z)Y;kOXx5f%`5jBeoQV4&Dl?Q)=VhKk_INEdu!{^(5FsnktvzjB4 zAXvht&>|M0WRtW+OI(q*Wy`ZesJIG&wiL@lB`Q-7RUXPe47Vi9yRBM2TiOwca7&_-eJ`4$^{E(0Ui6Rt*abu1Bua3)Gbgm5QsF4@^t1x?U7S1~3Px0?2;(U|d%`huNRcRG0qgd6gvXlE yU%;<~c@ZEesBaM&?t=;~NMt?+nm+&pANfC`_xVWvw-||%xE%FIk41-*xBd$*{`%km diff --git a/__pycache__/module.cpython-310.pyc b/__pycache__/module.cpython-310.pyc index de4f081c93f6b4927330e9275aae44bc66454587..c290da0b5368b234d016778cdbab31b82853328a 100644 GIT binary patch delta 231 zcmZ3$v4w*-pO=@50SH#Sc2Ao=kyn<9fpMbF1h!oHD0xPPiN}mhS##8))KVBy*mBf! zHKH^a8Gvlo9L*?AAkChmm8%`44HeUg(gDlqM(IvgW8BWjH~Ajp0>xXLfj*hVC1IJV z<$jusw^)mFQd0|n47Q@&lA_d9O})uenD#Lh$xZfWwl$Rpy5tsnRc1k2W=`rYw&IM^ zlFXbU1&}CLacNRPQGRl2aq%sd#Daq2l?+AtK#3y#$p@KTr5qSJSU4CFkO#QU-Y zL5(O4pd@>aX0BG07F0|-N*k;}CrW3s7UOnC-pP*`7l`?3GTve>&Ph!z05aH$a!ZO* zQ#ExbFJ{^|IgQzhQEu`=W>I;0pzXJ~ic6CUit>|Fi;HiuBo-7DuVg6F14O}@(P L%4joLnne--4`(qG diff --git a/apps.py b/apps.py index 1992d23..2c8c299 100644 --- a/apps.py +++ b/apps.py @@ -7,34 +7,20 @@ client_version = "v1.0.0" login_headers = {"Content-Type": "application/json"} login_user_key = "f0649fc2aeb411eda71f00163e095b49" aotu_user_url = f"https://auth.mc-user.com:233/{login_user_key}/" -cra_mc_server_api = "" +cra_mc_server_api = "https://craapi.xfcloud.org/api/" +cra_mc_api_id = "IAts0Hp2MbUGw" + +server_ip_list_dict = "info/servers" reload_password_page = "https://login.mc-user.com:233/account/login" register_web_page = "https://login.mc-user.com:233/f0649fc2aeb411eda71f00163e095b49/register" -server_list_configfile = "config_app/server_list_config.json" - login_json_file = "config_app/login_user.json" window_size_int = (950, 560) style_qss_stylesheet_body_file_dir = "style/style.qss" -data_server_list_dict_jsonfile = [ - { - "name": "CRA-MC", - "server_test": "HELLO WORLD", - "server_file_name": "cra_mc", - "image": "https://s21.ax1x.com/2024/05/05/pkE9wUe.jpg" - }, - { - "name": "CRA-MC1", - "server_test": "HELLO WORLD", - "server_file_name": "cra_mc", - "image": "https://s21.ax1x.com/2024/05/05/pkE9wUe.jpg" - } -] - @staticmethod def readQSS(style: str): with open(file=style, mode='r', encoding="UTF-8") as f: @@ -119,17 +105,6 @@ class Thread_appcode_login_user(QThread): data = dict() code = int(0) - if os.path.isfile(server_list_configfile) is False: - with open(file=server_list_configfile, mode='w', encoding="UTF-8", newline='') as f_write_server_list: - json.dump(data_server_list_dict_jsonfile, f_write_server_list) - if os.path.isfile(server_list_configfile) is True: - with open(file=server_list_configfile, mode='r', encoding="UTF-8", newline='') as f_read_all: - json_server_list_all = json.load(f_read_all) - if all(json_server_list_all) is False: - data_server_list_dict_jsonfile_all = data_server_list_dict_jsonfile - with open(file=server_list_configfile, mode='w', encoding="UTF-8", newline='') as f_write_all: - json.dump(data_server_list_dict_jsonfile_all, f_write_all) - ping_server = os.system("ping www.baidu.com -n 3") if ping_server == 1: data = dict() @@ -169,20 +144,20 @@ class Thread_appcode_login_user(QThread): with open(file=login_json_file, mode='w', encoding="UTF-8", newline='') as dump_f: json.dump(data_login_file, dump_f) - with open(file=server_list_configfile, mode='r', encoding="UTF-8", newline='') as read_server_list_f: - server_list_json_dict = json.load(read_server_list_f) + req_server_list_api = requests.get(url=cra_mc_server_api + server_ip_list_dict, headers=login_headers) + server_list_json_dict: dict = [req_server_list_api.json()[cra_mc_api_id]] server_list_json_ = server_list_json_dict server_list0 = list() for i_server in server_list_json_: server_list1 = [ - i_server.get("name"), i_server.get("server_file_name"), i_server.get("server_ip") + i_server.get("servername") ] server_list0.append(server_list1) for i_image_content_for in server_list_json_: - req_image = requests.get(url=i_image_content_for.get("image")).content + req_image = requests.get(url=i_image_content_for.get("logourl")).content i_image_content_for.update({"image": req_image}) data = { diff --git a/config_app/login_user.json b/config_app/login_user.json index c0771ff..81b9864 100644 --- a/config_app/login_user.json +++ b/config_app/login_user.json @@ -1 +1 @@ -{"accessToken": "cf9e9027138e11ef92c5e252f2c508d4", "clientToken": "ceee8954-138e-11ef-92c5-e252f2c508d4", "id": "a6143eb7a7883daab9a05dbe052879a1", "name": "GameDaBai"} \ No newline at end of file +{"accessToken": "eb00b22d167411ef92c5e252f2c508d4", "clientToken": "ea55c2cc-1674-11ef-92c5-e252f2c508d4", "id": "a6143eb7a7883daab9a05dbe052879a1", "name": "GameDaBai"} \ No newline at end of file diff --git a/config_app/server_list_config.json b/config_app/server_list_config.json deleted file mode 100644 index bed49d7..0000000 --- a/config_app/server_list_config.json +++ /dev/null @@ -1 +0,0 @@ -[{"name": "CRA-MC", "server_test": "HELLO WORLD", "server_file_name": "cra_mc", "image": "https://s21.ax1x.com/2024/05/05/pkE9wUe.jpg"}, {"name": "CRA-MC1", "server_test": "HELLO WORLD", "server_file_name": "cra_mc", "image": "https://s21.ax1x.com/2024/05/05/pkE9wUe.jpg"}] \ No newline at end of file diff --git a/main.py b/main.py index f7ff247..fba304b 100644 --- a/main.py +++ b/main.py @@ -251,6 +251,12 @@ class My_APP_Window(QTabWidget): self.server_list = QListWidget() + 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="启动游戏") self.start_game_button.clicked.connect(self.start_games_apps) self.start_game_button.setFixedSize(200, 55) @@ -258,7 +264,7 @@ class My_APP_Window(QTabWidget): index_home_grid_box.addWidget(self.start_game_button, 2, 0, alignment=Qt.AlignRight | Qt.AlignBottom) for i_server_list_for in self.server_list_dict: - item = apps.customQListWidgetItem(image=i_server_list_for.get("image"), names=i_server_list_for.get("name"), tests=i_server_list_for.get("server_test")) + item = apps.customQListWidgetItem(image=i_server_list_for.get("image"), names=i_server_list_for.get("servername"), tests=i_server_list_for.get("summary")) self.server_list.addItem(item) self.server_list.setItemWidget(item, item.item_widget) @@ -267,13 +273,12 @@ class My_APP_Window(QTabWidget): def start_games_apps(self): if self.server_list.currentRow() == -1: return apps.Message_ok(message="请先选择需要加入的服务器") + if self.server_ip_list.currentRow() == -1: + return apps.Message_ok(message="请选择一条线路") start_game_name = self.server_id_dict_list[self.server_list.currentRow()] - self.start_window_game = QWidget() - self.start_window_game.setWindowModality(Qt.ApplicationModal) - self.start_window_game.setWindowFlags(Qt.FramelessWindowHint) - self.start_window_game.setWindowTitle(apps.window_title_apps_name) - self.start_window_game.setFixedSize(400, 230) - self.start_window_game.show() + return None + + def stop_rungame_apps(self): return None def zxh_apps(self): diff --git a/module.py b/module.py index 197f288..0767ab0 100644 --- a/module.py +++ b/module.py @@ -3,7 +3,7 @@ from PySide2.QtGui import QGuiApplication, QPixmap, QImage, QIcon from PySide2.QtCore import QCoreApplication, Qt, QThread, QSettings, Signal from PySide2.QtWidgets import ( QPushButton, QToolButton, QListWidget, QLineEdit, QLabel, QTableWidget, QCheckBox, QComboBox, QMessageBox, QSlider, QProgressBar, - QFileDialog, QListWidgetItem + QFileDialog, QListWidgetItem, QListView ) import sys import os