nonebot-plugin-l4d2-server 1.0.0a1__py3-none-any.whl → 1.0.0a2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- nonebot_plugin_l4d2_server/__init__.py +4 -4
- nonebot_plugin_l4d2_server/__main__.py +64 -14
- nonebot_plugin_l4d2_server/config.py +6 -1
- nonebot_plugin_l4d2_server/l4_anne/__init__.py +124 -0
- nonebot_plugin_l4d2_server/l4_anne/ranne.py +18 -0
- nonebot_plugin_l4d2_server/l4_help/Help.json +59 -22
- nonebot_plugin_l4d2_server/l4_help/__init__.py +2 -2
- nonebot_plugin_l4d2_server/l4_help/icon//344/273/213/347/273/215.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//344/273/273/345/212/241.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//344/277/241/346/201/257.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//345/205/254/345/221/212.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//345/210/200/345/211/221.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//345/210/207/346/215/242.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//345/210/240/351/231/244.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//345/210/267/346/226/260.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//345/215/241/347/273/204.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//345/223/252/351/207/214.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//345/234/260/345/233/276.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//345/257/274/345/205/245.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//345/257/274/345/207/272.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//345/275/261.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//346/213/274/345/233/276.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//346/216/242/347/264/242.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//346/216/250/351/200/201.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//346/224/266/351/233/206.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//346/224/273/347/225/245.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//346/233/264/346/226/260.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//346/235/220/346/226/231.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//346/237/245/350/257/242.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//346/240/241/351/252/214.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//346/257/217/346/234/210.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//346/267/261/346/270/212.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//346/267/273/345/212/240.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//346/270/205/351/231/244.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//347/212/266/346/200/201.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//347/255/276/345/210/260.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//347/273/221/345/256/232.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//350/241/250.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//350/241/250/346/203/205.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//350/247/222/350/211/262.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//350/256/260/345/275/225.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//351/205/215/347/275/256.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/icon//351/207/215/345/220/257.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/texture2d/badge.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/texture2d/banner.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/texture2d/bg.jpg +0 -0
- nonebot_plugin_l4d2_server/l4_help/texture2d/button.png +0 -0
- nonebot_plugin_l4d2_server/l4_help/texture2d/icon.png +0 -0
- nonebot_plugin_l4d2_server/l4_image/__init__.py +4 -4
- nonebot_plugin_l4d2_server/l4_image/anne_pil.py +17 -0
- nonebot_plugin_l4d2_server/l4_image/convert.py +1 -1
- nonebot_plugin_l4d2_server/l4_image/download.py +5 -5
- nonebot_plugin_l4d2_server/l4_image/html_img.py +45 -74
- nonebot_plugin_l4d2_server/l4_image/image_tools.py +11 -11
- nonebot_plugin_l4d2_server/l4_image/img/anne/back.png +0 -0
- nonebot_plugin_l4d2_server/l4_image/img/anne/back1.jpg +0 -0
- nonebot_plugin_l4d2_server/l4_image/img/head/head.png +0 -0
- nonebot_plugin_l4d2_server/l4_image/img/header/logo.png +0 -0
- nonebot_plugin_l4d2_server/l4_image/img/header/player1.jpg +0 -0
- nonebot_plugin_l4d2_server/l4_image/img/template/Bocchi_The_Rock.html +17 -30
- nonebot_plugin_l4d2_server/l4_image/img/template/Bocchi_The_Rock.png +0 -0
- nonebot_plugin_l4d2_server/l4_image/img/template/Pixel.html +17 -26
- nonebot_plugin_l4d2_server/l4_image/img/template/Pixel.png +0 -0
- nonebot_plugin_l4d2_server/l4_image/img/template/Rainbow.html +48 -14
- nonebot_plugin_l4d2_server/l4_image/img/template/Rainbow.png +0 -0
- nonebot_plugin_l4d2_server/l4_image/img/template/normal.html +14 -24
- nonebot_plugin_l4d2_server/{data/img → l4_image/img/template}/vac.png +0 -0
- nonebot_plugin_l4d2_server/l4_image/img/template/vac_white.png +0 -0
- nonebot_plugin_l4d2_server/l4_image/vtfs.py +3 -3
- nonebot_plugin_l4d2_server/l4_request/__init__.py +68 -9
- nonebot_plugin_l4d2_server/l4_request/draw_msg.py +38 -43
- nonebot_plugin_l4d2_server/l4_request/utils.py +0 -0
- nonebot_plugin_l4d2_server/utils/api/api.py +8 -2
- nonebot_plugin_l4d2_server/utils/api/models.py +108 -0
- nonebot_plugin_l4d2_server/utils/api/request.py +257 -39
- nonebot_plugin_l4d2_server/utils/database/models.py +12 -23
- nonebot_plugin_l4d2_server/utils/utils.py +10 -10
- {nonebot_plugin_l4d2_server-1.0.0a1.dist-info → nonebot_plugin_l4d2_server-1.0.0a2.dist-info}/METADATA +19 -11
- nonebot_plugin_l4d2_server-1.0.0a2.dist-info/RECORD +96 -0
- nonebot_plugin_l4d2_server/data/L4D2/image/head/head.png +0 -0
- nonebot_plugin_l4d2_server/data/L4D2/image/header/logo.png +0 -0
- nonebot_plugin_l4d2_server/data/L4D2/image/header/player1.jpg +0 -0
- nonebot_plugin_l4d2_server/data/L4D2/image/template/anne.html +0 -68
- nonebot_plugin_l4d2_server/data/L4D2/image/template/back.png +0 -0
- nonebot_plugin_l4d2_server/data/L4D2/image/template/fingerprint.svg +0 -15
- nonebot_plugin_l4d2_server/data/L4D2/image/template/group_ip.html +0 -258
- nonebot_plugin_l4d2_server/data/L4D2/image/template/help.html +0 -262
- nonebot_plugin_l4d2_server/data/L4D2/image/template/help_dack.html +0 -269
- nonebot_plugin_l4d2_server/data/L4D2/image/template/ip.html +0 -54
- nonebot_plugin_l4d2_server/data/L4D2/image/template/l.svg +0 -10
- nonebot_plugin_l4d2_server/data/L4D2/image/template/m.svg +0 -1
- nonebot_plugin_l4d2_server/data/L4D2/image/template/vue.css +0 -531
- nonebot_plugin_l4d2_server/data/L4D2/image/template/w.svg +0 -1
- nonebot_plugin_l4d2_server/data/icon//344/273/213/347/273/215.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//344/273/273/345/212/241.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//344/277/241/346/201/257.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//345/205/254/345/221/212.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//345/210/200/345/211/221.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//345/210/207/346/215/242.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//345/210/240/351/231/244.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//345/210/267/346/226/260.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//345/215/241/347/273/204.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//345/223/252/351/207/214.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//345/234/260/345/233/276.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//345/257/274/345/205/245.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//345/257/274/345/207/272.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//345/275/261.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//346/213/274/345/233/276.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//346/216/242/347/264/242.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//346/216/250/351/200/201.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//346/224/266/351/233/206.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//346/224/273/347/225/245.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//346/233/264/346/226/260.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//346/235/220/346/226/231.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//346/237/245/350/257/242.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//346/240/241/351/252/214.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//346/257/217/346/234/210.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//346/267/261/346/270/212.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//346/267/273/345/212/240.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//346/270/205/351/231/244.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//347/212/266/346/200/201.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//347/255/276/345/210/260.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//347/273/221/345/256/232.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//350/241/250.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//350/241/250/346/203/205.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//350/247/222/350/211/262.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//350/256/260/345/275/225.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//351/205/215/347/275/256.png +0 -0
- nonebot_plugin_l4d2_server/data/icon//351/207/215/345/220/257.png +0 -0
- nonebot_plugin_l4d2_server/data/img/l4d2.png +0 -0
- nonebot_plugin_l4d2_server/data/img/linux.png +0 -0
- nonebot_plugin_l4d2_server/data/img/white.png +0 -0
- nonebot_plugin_l4d2_server/l4_image/img/template//345/276/256/350/275/257/351/233/205/351/273/221.ttf +0 -0
- nonebot_plugin_l4d2_server-1.0.0a1.dist-info/RECORD +0 -144
- {nonebot_plugin_l4d2_server-1.0.0a1.dist-info → nonebot_plugin_l4d2_server-1.0.0a2.dist-info}/WHEEL +0 -0
- {nonebot_plugin_l4d2_server-1.0.0a1.dist-info → nonebot_plugin_l4d2_server-1.0.0a2.dist-info}/licenses/LICENSE +0 -0
Binary file
|
Binary file
|
@@ -4,10 +4,10 @@ from nonebot.log import logger
|
|
4
4
|
from PIL import Image as Image
|
5
5
|
from srctools.vtf import VTF, ImageFormats
|
6
6
|
|
7
|
-
|
7
|
+
# 以下部分测试喷漆失败,todo
|
8
8
|
|
9
9
|
|
10
|
-
async def img_to_vtf(pic_byte: bytes, tag) -> BytesIO:
|
10
|
+
async def img_to_vtf(pic_byte: bytes, tag: str) -> BytesIO:
|
11
11
|
pic = BytesIO(pic_byte)
|
12
12
|
pic = Image.open(pic).convert("RGBA")
|
13
13
|
vtf_io = BytesIO()
|
@@ -21,7 +21,7 @@ async def img_to_vtf(pic_byte: bytes, tag) -> BytesIO:
|
|
21
21
|
if tag == "覆盖":
|
22
22
|
logger.info(tag)
|
23
23
|
img2 = Image.new("RGBA", (1024, 1024), (255, 255, 255, 0))
|
24
|
-
|
24
|
+
_, _, _, a = pic.split()
|
25
25
|
img2.paste(pic, mask=a)
|
26
26
|
pic = pic.resize((1024, 1024))
|
27
27
|
elif tag == "填充":
|
@@ -4,7 +4,7 @@ from nonebot.log import logger
|
|
4
4
|
|
5
5
|
from ..config import server_all_path
|
6
6
|
from ..l4_image import msg_to_image
|
7
|
-
from ..utils.api.models import NserverOut
|
7
|
+
from ..utils.api.models import AllServer, NserverOut, OutServer
|
8
8
|
from ..utils.utils import split_maohao
|
9
9
|
from .draw_msg import draw_one_ip, get_much_server
|
10
10
|
|
@@ -19,7 +19,43 @@ ALLHOST: Dict[str, List[NserverOut]] = {}
|
|
19
19
|
COMMAND = set()
|
20
20
|
|
21
21
|
|
22
|
-
async def
|
22
|
+
async def get_all_server_detail():
|
23
|
+
out_list: List[AllServer] = []
|
24
|
+
for group in ALLHOST:
|
25
|
+
msg_list = await get_group_detail(group)
|
26
|
+
if msg_list is None:
|
27
|
+
continue
|
28
|
+
active_server = 0
|
29
|
+
max_server = 0
|
30
|
+
active_player = 0
|
31
|
+
max_player = 0
|
32
|
+
for index, msg in enumerate(msg_list):
|
33
|
+
max_server = index + 1
|
34
|
+
if msg["server"].max_players != 0:
|
35
|
+
active_server += 1
|
36
|
+
active_player += msg["server"].player_count
|
37
|
+
max_player += msg["server"].max_players
|
38
|
+
data = {
|
39
|
+
"command": group,
|
40
|
+
"active_server": active_server,
|
41
|
+
"max_server": max_server,
|
42
|
+
"active_player": active_player,
|
43
|
+
"max_player": max_player,
|
44
|
+
}
|
45
|
+
out_list.append(cast(AllServer, data))
|
46
|
+
|
47
|
+
# to do作图,先用文字凑合
|
48
|
+
out_msg = ""
|
49
|
+
for one in out_list:
|
50
|
+
out_msg += f"{one['command']} | 服务器{one['active_server']}/{one['max_server']} | 玩家{one['active_player']}/{one['max_player']}\n"
|
51
|
+
return out_msg
|
52
|
+
|
53
|
+
|
54
|
+
async def get_server_detail(
|
55
|
+
command: str,
|
56
|
+
_id: Optional[str] = None,
|
57
|
+
is_img: bool = True,
|
58
|
+
):
|
23
59
|
server_json = ALLHOST.get(command)
|
24
60
|
logger.info(server_json)
|
25
61
|
if server_json is None:
|
@@ -28,18 +64,41 @@ async def get_server_detail(command: str, _id: Optional[str] = None):
|
|
28
64
|
|
29
65
|
if _id is None:
|
30
66
|
# 输出组信息
|
31
|
-
logger.info("正在请求组服务器信息")
|
67
|
+
logger.info(f"正在请求组服务器信息 {command}")
|
32
68
|
server_dict = await get_much_server(server_json, command)
|
33
|
-
|
69
|
+
if is_img:
|
70
|
+
out_msg = await msg_to_image(server_dict)
|
71
|
+
else:
|
72
|
+
out_msg = server_dict
|
73
|
+
return out_msg
|
34
74
|
|
35
75
|
# 返回单个
|
36
76
|
logger.info("正在请求单服务器信息")
|
77
|
+
out_msg = ""
|
37
78
|
for i in server_json:
|
38
|
-
if _id == i["id"]:
|
39
|
-
|
79
|
+
if str(_id) == str(i["id"]):
|
80
|
+
out_msg = await draw_one_ip(i["host"], i["port"])
|
81
|
+
if is_img:
|
82
|
+
return cast(bytes, out_msg)
|
83
|
+
if not is_img:
|
84
|
+
return cast(List[OutServer], out_msg)
|
85
|
+
# print(out_msg)
|
40
86
|
return None
|
41
87
|
|
42
88
|
|
89
|
+
async def get_group_detail(
|
90
|
+
command: str,
|
91
|
+
):
|
92
|
+
server_json = ALLHOST.get(command)
|
93
|
+
logger.info(server_json)
|
94
|
+
if server_json is None:
|
95
|
+
logger.warning("未找到这个组")
|
96
|
+
return None
|
97
|
+
|
98
|
+
logger.info("正在请求组服务器信息")
|
99
|
+
return await get_much_server(server_json, command)
|
100
|
+
|
101
|
+
|
43
102
|
async def get_ip_server(ip: str):
|
44
103
|
host, port = split_maohao(ip)
|
45
104
|
return await draw_one_ip(host, port)
|
@@ -47,6 +106,9 @@ async def get_ip_server(ip: str):
|
|
47
106
|
|
48
107
|
# 以下是重载ip
|
49
108
|
def reload_ip():
|
109
|
+
global COMMAND
|
110
|
+
# print("正在读取json文件")
|
111
|
+
group_ip = []
|
50
112
|
for item in server_all_path.iterdir():
|
51
113
|
if item.is_file():
|
52
114
|
if item.name.endswith("json"):
|
@@ -79,6 +141,3 @@ def reload_ip():
|
|
79
141
|
|
80
142
|
if item.name.endswith("txt"):
|
81
143
|
"""to do"""
|
82
|
-
|
83
|
-
|
84
|
-
reload_ip()
|
@@ -1,8 +1,9 @@
|
|
1
1
|
import asyncio
|
2
|
-
from typing import List
|
3
2
|
|
4
|
-
import
|
3
|
+
# from logging import log
|
4
|
+
from typing import List, Tuple
|
5
5
|
|
6
|
+
from ..config import config
|
6
7
|
from ..utils.api.models import NserverOut, OutServer
|
7
8
|
from ..utils.api.request import L4API
|
8
9
|
|
@@ -11,14 +12,18 @@ async def draw_one_ip(host: str, port: int):
|
|
11
12
|
"""输出单个ip"""
|
12
13
|
# 先用文字凑合
|
13
14
|
try:
|
14
|
-
|
15
|
-
one_player = await L4API.a2s_players(host, port)
|
15
|
+
ser_list = await L4API.a2s_info([(host, port)], is_player=True)
|
16
16
|
except asyncio.exceptions.TimeoutError:
|
17
17
|
return "服务器无响应"
|
18
18
|
player_msg = ""
|
19
|
+
one_server = ser_list[0][0]
|
20
|
+
one_player = ser_list[0][1]
|
21
|
+
|
19
22
|
if len(one_player):
|
20
|
-
max_duration_len = max(
|
21
|
-
|
23
|
+
max_duration_len = max(
|
24
|
+
[len(str(await convert_duration(i.duration))) for i in one_player],
|
25
|
+
)
|
26
|
+
max_score_len = max(len(str(i.score)) for i in one_player)
|
22
27
|
|
23
28
|
for player in one_player:
|
24
29
|
soc = "[{:>{}}]".format(player.score, max_score_len)
|
@@ -29,48 +34,40 @@ async def draw_one_ip(host: str, port: int):
|
|
29
34
|
else:
|
30
35
|
player_msg = "服务器感觉很安静啊"
|
31
36
|
|
32
|
-
|
37
|
+
msg = f"""*{one_server.server_name}*
|
33
38
|
游戏: {one_server.folder}
|
34
39
|
地图: {one_server.map_name}
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
40
|
+
人数: {one_server.player_count}/{one_server.max_players}"""
|
41
|
+
if one_server.ping is not None:
|
42
|
+
msg += f"""
|
43
|
+
ping: {one_server.ping * 1000:.0f}ms
|
44
|
+
{player_msg}"""
|
45
|
+
if config.l4_show_ip:
|
46
|
+
msg += f"""
|
47
|
+
connect {host}:{port}"""
|
48
|
+
return msg
|
39
49
|
|
40
50
|
|
41
|
-
async def get_much_server(server_json: List[NserverOut], command):
|
51
|
+
async def get_much_server(server_json: List[NserverOut], command: str):
|
42
52
|
out_server: List[OutServer] = []
|
53
|
+
search_list: List[Tuple[str, int]] = []
|
43
54
|
for i in server_json:
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
55
|
+
search_list.append((i["host"], i["port"])) # noqa: PERF401
|
56
|
+
|
57
|
+
all_server = await L4API.a2s_info(search_list, is_player=True)
|
58
|
+
|
59
|
+
for index, i in enumerate(all_server):
|
60
|
+
out_server.append(
|
61
|
+
{
|
62
|
+
"server": i[0],
|
63
|
+
"player": i[1],
|
64
|
+
"host": server_json[index]["host"],
|
65
|
+
"port": server_json[index]["port"],
|
66
|
+
"command": command,
|
67
|
+
"id_": server_json[index]["id"],
|
68
|
+
},
|
69
|
+
)
|
57
70
|
|
58
|
-
except (asyncio.exceptions.TimeoutError, ConnectionRefusedError):
|
59
|
-
emtry_server = a2s.SourceInfo()
|
60
|
-
emtry_server.server_name = "服务器无响应"
|
61
|
-
emtry_server.map_name = "无"
|
62
|
-
emtry_server.player_count = 0
|
63
|
-
emtry_server.max_players = 0
|
64
|
-
out_server.append(
|
65
|
-
{
|
66
|
-
"server": emtry_server,
|
67
|
-
"player": [],
|
68
|
-
"host": i["host"],
|
69
|
-
"port": i["port"],
|
70
|
-
"command": command,
|
71
|
-
"id_": i["id"],
|
72
|
-
},
|
73
|
-
) # type: ignore
|
74
71
|
return out_server
|
75
72
|
|
76
73
|
|
@@ -84,5 +81,3 @@ async def convert_duration(duration: float) -> str:
|
|
84
81
|
time_str += f"{int(minutes)}m "
|
85
82
|
time_str += f"{int(seconds)}s"
|
86
83
|
return time_str
|
87
|
-
time_str += f"{int(seconds)}s"
|
88
|
-
return time_str
|
File without changes
|
@@ -1,4 +1,10 @@
|
|
1
|
+
# coding=utf-8
|
2
|
+
|
3
|
+
|
1
4
|
anne_ban = "https://sb.trygek.com/"
|
2
5
|
"""anne电信服网址,sourceban++"""
|
3
|
-
|
4
|
-
AnneRankApi = f"{
|
6
|
+
anne_ser = f"{anne_ban}l4d_stats/"
|
7
|
+
AnneRankApi = f"{anne_ser}ranking/index.php?type=coop"
|
8
|
+
AnnePlayerApi = f"{anne_ser}ranking/player.php?steamid="
|
9
|
+
# post
|
10
|
+
AnneSearchApi = f"{anne_ser}/ranking/search.php"
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# coding=utf-8
|
1
2
|
from typing import List, Optional, TypedDict
|
2
3
|
|
3
4
|
import a2s
|
@@ -27,3 +28,110 @@ class OutServer(TypedDict):
|
|
27
28
|
port: int
|
28
29
|
command: str
|
29
30
|
id_: int
|
31
|
+
|
32
|
+
|
33
|
+
class AnnePlayer(TypedDict):
|
34
|
+
mode: str
|
35
|
+
name: str
|
36
|
+
source: str
|
37
|
+
playtime: str
|
38
|
+
|
39
|
+
|
40
|
+
class AllServer(TypedDict):
|
41
|
+
command: str
|
42
|
+
active_server: int
|
43
|
+
max_server: int
|
44
|
+
active_player: int
|
45
|
+
max_player: int
|
46
|
+
|
47
|
+
|
48
|
+
class AnneSearch(TypedDict):
|
49
|
+
steamid: str
|
50
|
+
rank: str
|
51
|
+
name: str
|
52
|
+
score: str
|
53
|
+
play_time: str
|
54
|
+
last_time: str
|
55
|
+
|
56
|
+
|
57
|
+
class AnnePlayerDetail(TypedDict):
|
58
|
+
rank: int
|
59
|
+
source: str
|
60
|
+
avg_source: float
|
61
|
+
kills: str
|
62
|
+
kills_people: str
|
63
|
+
headshots: str
|
64
|
+
avg_headshots: float
|
65
|
+
map_play: str
|
66
|
+
|
67
|
+
|
68
|
+
class AnnePlayerError(TypedDict):
|
69
|
+
mistake_shout: str
|
70
|
+
kill_friend: str
|
71
|
+
down_friend: str
|
72
|
+
abandon_friend: str
|
73
|
+
put_into: str
|
74
|
+
agitate_witch: str
|
75
|
+
|
76
|
+
|
77
|
+
class AnnePlayerInfAvg(TypedDict):
|
78
|
+
avg_smoker: float
|
79
|
+
avg_boomer: float
|
80
|
+
avg_hunter: float
|
81
|
+
avg_charger: float
|
82
|
+
avg_spitter: float
|
83
|
+
avg_jockey: float
|
84
|
+
avg_tank: float
|
85
|
+
|
86
|
+
|
87
|
+
class AnnePlayerSur(TypedDict):
|
88
|
+
map_clear: str
|
89
|
+
prefect_into: str
|
90
|
+
get_oil: str
|
91
|
+
ammo_arrange: str
|
92
|
+
adrenaline_give: str
|
93
|
+
pills_give: str
|
94
|
+
"""给药"""
|
95
|
+
first_aid_give: str
|
96
|
+
"""给包"""
|
97
|
+
friend_up: str
|
98
|
+
diss_friend: str
|
99
|
+
save_friend: str
|
100
|
+
protect_friend: str
|
101
|
+
pro_from_smoker: str
|
102
|
+
pro_from_hunter: str
|
103
|
+
pro_from_charger: str
|
104
|
+
pro_from_jockey: str
|
105
|
+
melee_charge: str
|
106
|
+
"""刀牛"""
|
107
|
+
tank_kill: str
|
108
|
+
witch_instantly_kill: str
|
109
|
+
"""秒妹"""
|
110
|
+
|
111
|
+
|
112
|
+
class AnnePlayerInf(TypedDict):
|
113
|
+
sur_ace: str
|
114
|
+
sur_down: str
|
115
|
+
boommer_hit: str
|
116
|
+
hunter_prefect: str
|
117
|
+
hunter_success: str
|
118
|
+
tank_damage: str
|
119
|
+
charger_multiple: str
|
120
|
+
|
121
|
+
|
122
|
+
class AnnePlayerInfo(TypedDict):
|
123
|
+
name: str
|
124
|
+
avatar: str
|
125
|
+
steamid: str
|
126
|
+
playtime: str
|
127
|
+
lasttime: str
|
128
|
+
|
129
|
+
|
130
|
+
class AnnePlayer2(TypedDict):
|
131
|
+
kill_msg: str
|
132
|
+
info: AnnePlayerInfo
|
133
|
+
detail: AnnePlayerDetail
|
134
|
+
error: AnnePlayerError
|
135
|
+
inf_avg: AnnePlayerInfAvg
|
136
|
+
sur: AnnePlayerSur
|
137
|
+
inf: AnnePlayerInf
|