nonebot-plugin-l4d2-server 1.0.0a1__py3-none-any.whl → 1.0.0b1__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 +65 -14
- nonebot_plugin_l4d2_server/config.py +11 -0
- nonebot_plugin_l4d2_server/l4_anne/__init__.py +125 -0
- nonebot_plugin_l4d2_server/l4_anne/ranne.py +18 -0
- nonebot_plugin_l4d2_server/l4_help/Help.json +67 -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 +18 -0
- nonebot_plugin_l4d2_server/l4_image/convert.py +9 -13
- nonebot_plugin_l4d2_server/l4_image/download.py +9 -7
- nonebot_plugin_l4d2_server/l4_image/html_img.py +47 -76
- nonebot_plugin_l4d2_server/l4_image/image_tools.py +19 -16
- 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_local/__init__.py +94 -0
- nonebot_plugin_l4d2_server/l4_local/file.py +105 -0
- 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 +22 -11
- {nonebot_plugin_l4d2_server-1.0.0a1.dist-info → nonebot_plugin_l4d2_server-1.0.0b1.dist-info}/METADATA +19 -11
- nonebot_plugin_l4d2_server-1.0.0b1.dist-info/RECORD +98 -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.0b1.dist-info}/WHEEL +0 -0
- {nonebot_plugin_l4d2_server-1.0.0a1.dist-info → nonebot_plugin_l4d2_server-1.0.0b1.dist-info}/licenses/LICENSE +0 -0
@@ -4,11 +4,8 @@
|
|
4
4
|
<style>
|
5
5
|
body {
|
6
6
|
background-image: url("Rainbow.png");
|
7
|
-
background-repeat:
|
7
|
+
background-repeat: repeat;
|
8
8
|
background-size: cover;
|
9
|
-
/* 调整背景图片大小适应屏幕 */
|
10
|
-
/*background-position: center center; /* 使背景图片始终居中 */
|
11
|
-
/*background-attachment: fixed; /* 背景图片不随内容滚动 */
|
12
9
|
margin: 0px;
|
13
10
|
zoom: 150%;
|
14
11
|
}
|
@@ -21,11 +18,12 @@
|
|
21
18
|
/* 设置第一个字体 */
|
22
19
|
}
|
23
20
|
|
24
|
-
|
25
|
-
.
|
26
|
-
|
27
|
-
|
28
|
-
|
21
|
+
/* Vac图标样式 */
|
22
|
+
.vac-icon {
|
23
|
+
width: 13px;
|
24
|
+
height: auto;
|
25
|
+
margin-left: 190px;
|
26
|
+
}
|
29
27
|
|
30
28
|
.image {
|
31
29
|
display: flex;
|
@@ -269,11 +267,39 @@
|
|
269
267
|
{% endfor %}
|
270
268
|
</div>
|
271
269
|
<div class="plugin_meta_line3">
|
272
|
-
|
273
|
-
|
270
|
+
{% if plugin.server.platform == 'l' %}
|
271
|
+
<svg t="1721445719912" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
|
272
|
+
p-id="2665" width="13" height="13">
|
273
|
+
<path
|
274
|
+
d="M433.700571 234.861714c-11.446857 1.133714-7.424 11.446857-13.714285 11.446857-5.705143 0.585143-4.571429-12.580571 13.714285-11.446857z m49.737143 8.009143c-5.705143 1.718857-6.290286-9.142857-16.566857-6.290286 16.566857-7.424 22.272 3.986286 16.566857 6.290286z m-200.594285 243.968c-5.156571-1.718857-3.986286 8.557714-9.142858 16.566857-3.986286 7.424-14.299429 13.129143-6.290285 14.299429 2.852571 0.585143 10.861714-6.290286 14.299428-14.299429 2.852571-9.728 5.705143-14.848 1.133715-16.566857z m488.594285 205.165714c0-10.276571-22.272-20.004571-31.414857-23.990857 15.433143-51.419429 8.557714-72.009143-1.718857-120.576-8.009143-36.571429-41.728-86.272-67.986286-101.705143 6.838857 5.705143 19.419429 22.272 32.585143 47.433143 22.857143 42.861714 45.714286 106.276571 30.866286 158.866286-5.705143 20.553143-19.419429 23.442286-28.562286 23.990857-40.009143 4.571429-16.566857-48.018286-33.133714-119.442286-18.870857-80.018286-38.290286-85.723429-42.861714-92.013714-23.442286-104.009143-49.152-93.696-56.576-132.571428-6.290286-34.852571 30.281143-63.414857-19.419429-73.142858-15.433143-2.852571-37.156571-18.285714-45.714286-19.419428s-13.129143-57.709714 18.870857-59.428572c31.414857-2.304 37.156571 35.437714 31.414858 50.285715-9.142857 14.848 0.585143 20.553143 16.018285 15.433143 12.580571-3.986286 4.571429-37.156571 7.424-41.728-8.009143-48.018286-28.013714-54.857143-48.566857-58.843429-78.848 6.290286-43.446857 93.147429-51.419428 85.138286-11.446857-11.995429-44.580571-1.133714-44.580572-8.557715 0.585143-44.580571-14.299429-70.290286-34.852571-70.838857-22.857143-0.585143-32 31.414857-33.133715 49.700572-1.718857 17.152 9.728 53.138286 18.285715 50.285714 5.705143-1.718857 15.433143-13.129143 5.156571-12.580571-5.156571 0-13.129143-12.580571-14.299428-27.428572-0.585143-14.848 5.156571-29.696 24.576-29.147428 22.272 0.585143 22.272 45.129143 20.004571 46.848a104.850286 104.850286 0 0 0-17.700571 16.566857c-7.424 11.995429-21.723429 15.433143-27.428572 20.553143-9.728 10.276571-11.995429 21.723429-4.571428 25.709714 26.294857 14.848 17.700571 32 54.272 33.133714 23.990857 1.133714 41.728-3.437714 58.294857-8.557714 12.580571-3.986286 53.138286-12.580571 61.696-27.428572 3.986286-6.290286 8.557714-6.290286 11.446857-4.571428 5.705143 2.852571 6.838857 13.714286-7.424 17.152-20.004571 5.705143-40.009143 16.566857-58.294857 23.442286-17.700571 7.424-23.442286 10.276571-40.009143 13.129142-37.705143 6.838857-65.718857-13.714286-40.557714 10.861715 8.557714 8.009143 16.566857 13.129143 38.290285 12.580571 48.018286-1.718857 101.156571-59.428571 106.276572-33.718857 1.133714 5.705143-14.848 12.580571-27.428572 18.870857-44.580571 21.723429-75.995429 65.133714-104.557714 50.285714-25.709714-13.714286-51.419429-77.129143-50.870857-48.566857 0.585143 43.995429-57.709714 82.870857-30.866286 133.156572-17.700571 4.571429-57.161143 88.576-62.866286 131.986285-3.437714 25.161143 2.304 55.990857-3.986285 73.142858-8.557714 25.161143-47.433143-23.990857-34.852572-84.004572 2.304-10.276571 0-12.580571-2.852571-7.424-15.433143 28.013714-6.838857 67.437714 5.705143 94.866286 5.156571 11.995429 18.285714 17.152 28.013714 27.428571 20.004571 22.857143 98.852571 81.152 112.566857 95.414857 17.700571 16.566857 12.580571 55.442286-23.990857 59.428572 18.870857 35.437714 37.156571 38.838857 36.571429 96.585143 21.723429-11.446857 13.129143-36.571429 3.986285-52.553143-6.290286-11.446857-14.299429-16.566857-12.580571-19.419429 1.133714-1.718857 12.580571-11.446857 18.870857-3.986285 19.419429 21.723429 55.990857 25.709714 94.866286 20.553142 39.424-4.571429 81.700571-18.285714 101.156571-49.700571 9.142857-14.848 15.433143-20.004571 19.419429-17.152 4.571429 2.304 6.290286 12.580571 5.705143 29.696-0.585143 18.285714-8.009143 37.156571-13.129143 52.553143-5.156571 17.700571-6.838857 29.696 10.276571 30.281143 4.571429-32 13.714286-63.414857 16.018286-95.414857 2.852571-36.571429-23.442286-104.009143 5.156571-137.728 7.424-9.142857 16.566857-10.276571 29.147429-10.276572 1.718857-45.714286 72.009143-42.276571 95.414857-23.442286zM412.562286 219.428571c2.304-14.299429-4.571429-24.576-8.009143-25.709714-6.838857-1.718857-5.705143 8.557714-2.304 7.424 2.304 0 5.156571 3.437714 3.986286 8.557714-1.133714 6.838857-0.585143 11.446857 4.571428 11.446858 0.585143 0 1.718857 0 1.718857-1.718858z m239.433143 112.566858c-2.304-10.861714-10.276571-6.838857-19.419429-12.580572-10.861714-6.838857-13.129143-18.285714-17.152-14.299428-11.995429 13.129143 14.848 40.557714 26.294857 42.861714 6.838857 1.133714 11.995429-8.009143 10.276572-16.018286zM550.290286 210.285714c0.585143-13.714286-11.446857-20.553143-14.299429-20.004571-7.424 0.585143-5.156571 3.986286-1.718857 5.156571 4.571429 1.133714 9.142857 9.142857 10.276571 17.700572 0 1.133714 5.705143-1.133714 5.705143-2.852572z m30.866285-133.156571c0.585143-2.852571-6.838857-6.290286-11.995428-10.276572-4.571429-4.571429-9.142857-8.557714-13.714286-8.557714-11.446857 1.133714-5.705143 13.129143-7.424 18.870857-2.304 6.290286-10.861714 11.446857-5.156571 16.018286 5.156571 3.986286 8.557714-6.290286 19.419428-10.276571 2.852571-1.133714 16.018286 0.585143 18.870857-5.705143z m322.852572 766.317714c70.290286 43.446857-26.294857 79.433143-67.986286 100.571429-32.585143 16.566857-75.995429 53.138286-92.013714 68.571428-11.995429 11.446857-61.696 17.152-89.709714 2.852572-32.585143-16.566857-15.433143-42.861714-65.718858-44.580572-25.161143-0.585143-49.700571-0.585143-74.276571-0.585143-21.723429 0.585143-43.446857 1.718857-65.718857 2.304-75.446857 1.718857-82.870857 50.285714-131.437714 48.566858-33.133714-1.133714-74.861714-27.428571-146.870858-42.276572-50.285714-10.276571-98.852571-13.129143-109.129142-35.437714s12.580571-47.433143 14.299428-69.156572c1.718857-29.147429-21.723429-68.571429-4.571428-83.419428 14.848-13.129143 46.299429-3.437714 66.852571-14.848 21.723429-12.580571 30.866286-22.272 30.866286-49.152 8.009143 27.428571-0.585143 49.700571-18.285715 60.562286-10.861714 6.838857-30.866286 10.276571-47.433142 8.557714-13.129143-1.133714-21.138286 0.585143-24.576 5.705143-5.156571 6.290286-3.437714 17.700571 2.852571 32.585143s13.714286 24.576 12.580571 42.861714c-0.585143 18.285714-21.138286 40.009143-17.700571 55.442286 1.133714 5.705143 6.838857 10.861714 21.138286 14.848 22.857143 6.290286 64.585143 12.580571 105.142857 22.272 45.129143 11.446857 92.013714 32 121.161143 28.013714 86.857143-11.995429 37.156571-105.142857 23.442285-127.414857-73.728-115.419429-122.294857-190.866286-161.133714-161.133715-9.728 8.009143-10.276571-19.419429-9.728-30.281142 1.718857-37.705143 20.553143-51.419429 32-80.566858 21.723429-55.442286 38.290286-118.857143 71.424-151.442285 24.576-32 63.414857-84.004571 70.838857-111.433143-6.290286-59.428571-8.009143-122.294857-9.142857-177.152-1.133714-58.843429 8.009143-110.299429 74.276572-146.285714C431.469714 3.437714 452.608 0 474.88 0c39.424-0.585143 83.419429 10.861714 111.433143 31.414857 44.580571 33.133714 72.557714 103.424 69.156571 153.709714-2.304 39.424 4.571429 80.018286 17.152 122.294858 14.848 49.700571 38.290286 84.553143 75.995429 124.562285 45.129143 48.018286 80.566857 142.299429 90.843428 202.276572 9.142857 55.990857-3.437714 90.843429-15.433142 92.562285-18.285714 2.852571-29.696 60.562286-86.857143 58.294858-36.571429-1.718857-40.009143-23.442286-50.285715-42.276572-16.566857-29.147429-33.133714-20.004571-39.424 10.861714-3.437714 15.433143-1.133714 38.290286 3.986286 55.442286 10.276571 35.986286 6.838857 69.705143 0.585143 111.433143-11.995429 78.848 55.442286 93.696 100.571429 55.990857 44.580571-37.156571 54.272-42.861714 110.299428-62.281143 85.138286-29.147429 56.576-54.857143 10.861714-70.290285-41.142857-13.714286-42.861714-82.870857-28.013714-96 3.437714 74.276571 42.276571 85.138286 58.294857 95.414857z"
|
275
|
+
fill="" p-id="2666"></path>
|
276
|
+
</svg>
|
277
|
+
{% elif plugin.server.platform == 'w' %}
|
278
|
+
<svg t="1721445856168" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
|
279
|
+
p-id="3630" width="13" height="13">
|
280
|
+
<path
|
281
|
+
d="M456 484V160.1l-335.9 72V484H456zM512 484h391.8V64.2l-391.8 84V484zM456 540H120.2v251.9l335.9 72V540zM512 540v335.9l391.8 84V540H512z"
|
282
|
+
fill="#00adef" p-id="3631"></path>
|
283
|
+
</svg>
|
284
|
+
{% else %}
|
285
|
+
<svg t="1721445911301" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
|
286
|
+
p-id="5446" width="13" height="13">
|
287
|
+
<path
|
288
|
+
d="M185.952 688l23.872-33.824c85.536 43.232 186.816 67.808 333.184 62.272 0.992-42.304 5.696-82.72 14.496-118.848H396.736c3.776-172.288 67.168-325.024 138.592-441.28H51.264l0.192 740.32h512.64a658.112 658.112 0 0 1-20.832-138.048c-132.8 5.664-269.856-18.304-357.312-70.592z m86.752-422.016h46.848V375.52h-46.848V265.984z"
|
289
|
+
fill="#4F8FCC" p-id="5447"></path>
|
290
|
+
<path
|
291
|
+
d="M959.04 156.352H584.8c-65.472 100.576-129.984 236-144.32 398.976h169.44c-13.792 50.304-24.448 102.176-24.96 157.952 95.072-11.68 145.408-23.872 215.904-59.456l23.84 33.824c-61.312 36.672-148.224 59.2-239.744 67.584 1.408 46.944 8.448 93.984 22.08 141.472h352V156.352zM707.808 375.456h-46.88V265.92h46.88v109.536z"
|
292
|
+
fill="#BABEE0" p-id="5448"></path>
|
293
|
+
<path
|
294
|
+
d="M319.584 375.52h-46.88V265.984h46.848V375.52zM209.792 654.176L185.952 688c87.456 52.288 224.544 76.256 357.312 70.624a618.4 618.4 0 0 1-0.256-42.144c-146.368 5.536-247.68-19.072-333.216-62.304zM707.808 265.92v109.536h-46.88V265.92h46.88zM584.96 755.232c91.52-8.416 178.432-30.944 239.744-67.584l-23.84-33.824C730.368 689.408 680.032 701.6 584.96 713.28c0.544-55.744 11.2-107.616 24.96-157.952H440.48c14.336-163.008 78.848-298.432 144.32-398.976a1182.144 1182.144 0 0 1 73.76-101.024l-31.616-26.4a1066.656 1066.656 0 0 0-91.68 127.424C463.84 272.576 400.48 425.344 396.672 597.632H557.44c-8.8 36.128-13.504 76.544-14.496 118.848-0.32 13.92-0.352 27.872 0.256 42.144 1.92 45.056 8.704 91.68 20.832 138.048a604.48 604.48 0 0 0 46.624 124.256l38.016-18.304a602.912 602.912 0 0 1-41.632-105.952 571.936 571.936 0 0 1-22.08-141.44z"
|
295
|
+
fill="#224477" p-id="5449"></path>
|
274
296
|
</svg>
|
275
|
-
|
276
|
-
<div class="package_name"> {{ plugin.
|
297
|
+
{% endif %}
|
298
|
+
<div class="package_name"> {{ plugin.server.player_count }}/{{ plugin.server.max_players }} </div>
|
299
|
+
{% if plugin.server.vac_enabled %}
|
300
|
+
<img class="vac-icon" src="vac_white.png" alt="VAC Enabled">
|
301
|
+
{% else %}
|
302
|
+
{% endif %}
|
277
303
|
</div>
|
278
304
|
</div>
|
279
305
|
</div>
|
@@ -287,10 +313,18 @@
|
|
287
313
|
</svg>
|
288
314
|
<b style="vertical-align: middle;">插件:Agnes4m</b>
|
289
315
|
</span>
|
290
|
-
<span class="loaded-text"><b
|
316
|
+
<span class="loaded-text"><b>———— ©爱丽数码 ————</b></span>
|
317
|
+
<span class="loaded-text">
|
318
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"
|
319
|
+
style="vertical-align: middle;">
|
320
|
+
<image xlink:href="bilibili.svg" width="20" height="20" fill="red" />
|
321
|
+
</svg>
|
322
|
+
<b style="vertical-align: middle;">插画:吃咖喱的poi</b>
|
323
|
+
</span>
|
291
324
|
</div>
|
292
325
|
</div>
|
293
326
|
|
327
|
+
|
294
328
|
<script>
|
295
329
|
// 创建一个函数,用于随机生成带透明度的颜色
|
296
330
|
function getRandomColorWithOpacity(opacity) {
|
Binary file
|
@@ -7,6 +7,13 @@
|
|
7
7
|
zoom: 150%;
|
8
8
|
}
|
9
9
|
|
10
|
+
/* Vac图标样式 */
|
11
|
+
.vac-icon {
|
12
|
+
width: 13px;
|
13
|
+
height: auto;
|
14
|
+
margin-left: 190px;
|
15
|
+
}
|
16
|
+
|
10
17
|
.image {
|
11
18
|
display: flex;
|
12
19
|
flex-direction: column;
|
@@ -207,35 +214,18 @@
|
|
207
214
|
</div>
|
208
215
|
<div class="plugin_meta_line3">
|
209
216
|
{% if plugin.server.platform == 'l' %}
|
210
|
-
<
|
211
|
-
p-id="2665" width="13" height="13">
|
212
|
-
<path
|
213
|
-
d="M433.700571 234.861714c-11.446857 1.133714-7.424 11.446857-13.714285 11.446857-5.705143 0.585143-4.571429-12.580571 13.714285-11.446857z m49.737143 8.009143c-5.705143 1.718857-6.290286-9.142857-16.566857-6.290286 16.566857-7.424 22.272 3.986286 16.566857 6.290286z m-200.594285 243.968c-5.156571-1.718857-3.986286 8.557714-9.142858 16.566857-3.986286 7.424-14.299429 13.129143-6.290285 14.299429 2.852571 0.585143 10.861714-6.290286 14.299428-14.299429 2.852571-9.728 5.705143-14.848 1.133715-16.566857z m488.594285 205.165714c0-10.276571-22.272-20.004571-31.414857-23.990857 15.433143-51.419429 8.557714-72.009143-1.718857-120.576-8.009143-36.571429-41.728-86.272-67.986286-101.705143 6.838857 5.705143 19.419429 22.272 32.585143 47.433143 22.857143 42.861714 45.714286 106.276571 30.866286 158.866286-5.705143 20.553143-19.419429 23.442286-28.562286 23.990857-40.009143 4.571429-16.566857-48.018286-33.133714-119.442286-18.870857-80.018286-38.290286-85.723429-42.861714-92.013714-23.442286-104.009143-49.152-93.696-56.576-132.571428-6.290286-34.852571 30.281143-63.414857-19.419429-73.142858-15.433143-2.852571-37.156571-18.285714-45.714286-19.419428s-13.129143-57.709714 18.870857-59.428572c31.414857-2.304 37.156571 35.437714 31.414858 50.285715-9.142857 14.848 0.585143 20.553143 16.018285 15.433143 12.580571-3.986286 4.571429-37.156571 7.424-41.728-8.009143-48.018286-28.013714-54.857143-48.566857-58.843429-78.848 6.290286-43.446857 93.147429-51.419428 85.138286-11.446857-11.995429-44.580571-1.133714-44.580572-8.557715 0.585143-44.580571-14.299429-70.290286-34.852571-70.838857-22.857143-0.585143-32 31.414857-33.133715 49.700572-1.718857 17.152 9.728 53.138286 18.285715 50.285714 5.705143-1.718857 15.433143-13.129143 5.156571-12.580571-5.156571 0-13.129143-12.580571-14.299428-27.428572-0.585143-14.848 5.156571-29.696 24.576-29.147428 22.272 0.585143 22.272 45.129143 20.004571 46.848a104.850286 104.850286 0 0 0-17.700571 16.566857c-7.424 11.995429-21.723429 15.433143-27.428572 20.553143-9.728 10.276571-11.995429 21.723429-4.571428 25.709714 26.294857 14.848 17.700571 32 54.272 33.133714 23.990857 1.133714 41.728-3.437714 58.294857-8.557714 12.580571-3.986286 53.138286-12.580571 61.696-27.428572 3.986286-6.290286 8.557714-6.290286 11.446857-4.571428 5.705143 2.852571 6.838857 13.714286-7.424 17.152-20.004571 5.705143-40.009143 16.566857-58.294857 23.442286-17.700571 7.424-23.442286 10.276571-40.009143 13.129142-37.705143 6.838857-65.718857-13.714286-40.557714 10.861715 8.557714 8.009143 16.566857 13.129143 38.290285 12.580571 48.018286-1.718857 101.156571-59.428571 106.276572-33.718857 1.133714 5.705143-14.848 12.580571-27.428572 18.870857-44.580571 21.723429-75.995429 65.133714-104.557714 50.285714-25.709714-13.714286-51.419429-77.129143-50.870857-48.566857 0.585143 43.995429-57.709714 82.870857-30.866286 133.156572-17.700571 4.571429-57.161143 88.576-62.866286 131.986285-3.437714 25.161143 2.304 55.990857-3.986285 73.142858-8.557714 25.161143-47.433143-23.990857-34.852572-84.004572 2.304-10.276571 0-12.580571-2.852571-7.424-15.433143 28.013714-6.838857 67.437714 5.705143 94.866286 5.156571 11.995429 18.285714 17.152 28.013714 27.428571 20.004571 22.857143 98.852571 81.152 112.566857 95.414857 17.700571 16.566857 12.580571 55.442286-23.990857 59.428572 18.870857 35.437714 37.156571 38.838857 36.571429 96.585143 21.723429-11.446857 13.129143-36.571429 3.986285-52.553143-6.290286-11.446857-14.299429-16.566857-12.580571-19.419429 1.133714-1.718857 12.580571-11.446857 18.870857-3.986285 19.419429 21.723429 55.990857 25.709714 94.866286 20.553142 39.424-4.571429 81.700571-18.285714 101.156571-49.700571 9.142857-14.848 15.433143-20.004571 19.419429-17.152 4.571429 2.304 6.290286 12.580571 5.705143 29.696-0.585143 18.285714-8.009143 37.156571-13.129143 52.553143-5.156571 17.700571-6.838857 29.696 10.276571 30.281143 4.571429-32 13.714286-63.414857 16.018286-95.414857 2.852571-36.571429-23.442286-104.009143 5.156571-137.728 7.424-9.142857 16.566857-10.276571 29.147429-10.276572 1.718857-45.714286 72.009143-42.276571 95.414857-23.442286zM412.562286 219.428571c2.304-14.299429-4.571429-24.576-8.009143-25.709714-6.838857-1.718857-5.705143 8.557714-2.304 7.424 2.304 0 5.156571 3.437714 3.986286 8.557714-1.133714 6.838857-0.585143 11.446857 4.571428 11.446858 0.585143 0 1.718857 0 1.718857-1.718858z m239.433143 112.566858c-2.304-10.861714-10.276571-6.838857-19.419429-12.580572-10.861714-6.838857-13.129143-18.285714-17.152-14.299428-11.995429 13.129143 14.848 40.557714 26.294857 42.861714 6.838857 1.133714 11.995429-8.009143 10.276572-16.018286zM550.290286 210.285714c0.585143-13.714286-11.446857-20.553143-14.299429-20.004571-7.424 0.585143-5.156571 3.986286-1.718857 5.156571 4.571429 1.133714 9.142857 9.142857 10.276571 17.700572 0 1.133714 5.705143-1.133714 5.705143-2.852572z m30.866285-133.156571c0.585143-2.852571-6.838857-6.290286-11.995428-10.276572-4.571429-4.571429-9.142857-8.557714-13.714286-8.557714-11.446857 1.133714-5.705143 13.129143-7.424 18.870857-2.304 6.290286-10.861714 11.446857-5.156571 16.018286 5.156571 3.986286 8.557714-6.290286 19.419428-10.276571 2.852571-1.133714 16.018286 0.585143 18.870857-5.705143z m322.852572 766.317714c70.290286 43.446857-26.294857 79.433143-67.986286 100.571429-32.585143 16.566857-75.995429 53.138286-92.013714 68.571428-11.995429 11.446857-61.696 17.152-89.709714 2.852572-32.585143-16.566857-15.433143-42.861714-65.718858-44.580572-25.161143-0.585143-49.700571-0.585143-74.276571-0.585143-21.723429 0.585143-43.446857 1.718857-65.718857 2.304-75.446857 1.718857-82.870857 50.285714-131.437714 48.566858-33.133714-1.133714-74.861714-27.428571-146.870858-42.276572-50.285714-10.276571-98.852571-13.129143-109.129142-35.437714s12.580571-47.433143 14.299428-69.156572c1.718857-29.147429-21.723429-68.571429-4.571428-83.419428 14.848-13.129143 46.299429-3.437714 66.852571-14.848 21.723429-12.580571 30.866286-22.272 30.866286-49.152 8.009143 27.428571-0.585143 49.700571-18.285715 60.562286-10.861714 6.838857-30.866286 10.276571-47.433142 8.557714-13.129143-1.133714-21.138286 0.585143-24.576 5.705143-5.156571 6.290286-3.437714 17.700571 2.852571 32.585143s13.714286 24.576 12.580571 42.861714c-0.585143 18.285714-21.138286 40.009143-17.700571 55.442286 1.133714 5.705143 6.838857 10.861714 21.138286 14.848 22.857143 6.290286 64.585143 12.580571 105.142857 22.272 45.129143 11.446857 92.013714 32 121.161143 28.013714 86.857143-11.995429 37.156571-105.142857 23.442285-127.414857-73.728-115.419429-122.294857-190.866286-161.133714-161.133715-9.728 8.009143-10.276571-19.419429-9.728-30.281142 1.718857-37.705143 20.553143-51.419429 32-80.566858 21.723429-55.442286 38.290286-118.857143 71.424-151.442285 24.576-32 63.414857-84.004571 70.838857-111.433143-6.290286-59.428571-8.009143-122.294857-9.142857-177.152-1.133714-58.843429 8.009143-110.299429 74.276572-146.285714C431.469714 3.437714 452.608 0 474.88 0c39.424-0.585143 83.419429 10.861714 111.433143 31.414857 44.580571 33.133714 72.557714 103.424 69.156571 153.709714-2.304 39.424 4.571429 80.018286 17.152 122.294858 14.848 49.700571 38.290286 84.553143 75.995429 124.562285 45.129143 48.018286 80.566857 142.299429 90.843428 202.276572 9.142857 55.990857-3.437714 90.843429-15.433142 92.562285-18.285714 2.852571-29.696 60.562286-86.857143 58.294858-36.571429-1.718857-40.009143-23.442286-50.285715-42.276572-16.566857-29.147429-33.133714-20.004571-39.424 10.861714-3.437714 15.433143-1.133714 38.290286 3.986286 55.442286 10.276571 35.986286 6.838857 69.705143 0.585143 111.433143-11.995429 78.848 55.442286 93.696 100.571429 55.990857 44.580571-37.156571 54.272-42.861714 110.299428-62.281143 85.138286-29.147429 56.576-54.857143 10.861714-70.290285-41.142857-13.714286-42.861714-82.870857-28.013714-96 3.437714 74.276571 42.276571 85.138286 58.294857 95.414857z"
|
214
|
-
fill="" p-id="2666"></path>
|
217
|
+
<image xlink:href="l.svg" width="13" height="13" />
|
215
218
|
</svg>
|
216
219
|
{% elif plugin.server.platform == 'w' %}
|
217
|
-
<
|
218
|
-
p-id="3630" width="13" height="13">
|
219
|
-
<path
|
220
|
-
d="M456 484V160.1l-335.9 72V484H456zM512 484h391.8V64.2l-391.8 84V484zM456 540H120.2v251.9l335.9 72V540zM512 540v335.9l391.8 84V540H512z"
|
221
|
-
fill="#00adef" p-id="3631"></path>
|
222
|
-
</svg>
|
220
|
+
<image xlink:href="w.svg" width="13" height="13" />
|
223
221
|
{% else %}
|
224
|
-
<
|
225
|
-
p-id="5446" width="13" height="13">
|
226
|
-
<path
|
227
|
-
d="M185.952 688l23.872-33.824c85.536 43.232 186.816 67.808 333.184 62.272 0.992-42.304 5.696-82.72 14.496-118.848H396.736c3.776-172.288 67.168-325.024 138.592-441.28H51.264l0.192 740.32h512.64a658.112 658.112 0 0 1-20.832-138.048c-132.8 5.664-269.856-18.304-357.312-70.592z m86.752-422.016h46.848V375.52h-46.848V265.984z"
|
228
|
-
fill="#4F8FCC" p-id="5447"></path>
|
229
|
-
<path
|
230
|
-
d="M959.04 156.352H584.8c-65.472 100.576-129.984 236-144.32 398.976h169.44c-13.792 50.304-24.448 102.176-24.96 157.952 95.072-11.68 145.408-23.872 215.904-59.456l23.84 33.824c-61.312 36.672-148.224 59.2-239.744 67.584 1.408 46.944 8.448 93.984 22.08 141.472h352V156.352zM707.808 375.456h-46.88V265.92h46.88v109.536z"
|
231
|
-
fill="#BABEE0" p-id="5448"></path>
|
232
|
-
<path
|
233
|
-
d="M319.584 375.52h-46.88V265.984h46.848V375.52zM209.792 654.176L185.952 688c87.456 52.288 224.544 76.256 357.312 70.624a618.4 618.4 0 0 1-0.256-42.144c-146.368 5.536-247.68-19.072-333.216-62.304zM707.808 265.92v109.536h-46.88V265.92h46.88zM584.96 755.232c91.52-8.416 178.432-30.944 239.744-67.584l-23.84-33.824C730.368 689.408 680.032 701.6 584.96 713.28c0.544-55.744 11.2-107.616 24.96-157.952H440.48c14.336-163.008 78.848-298.432 144.32-398.976a1182.144 1182.144 0 0 1 73.76-101.024l-31.616-26.4a1066.656 1066.656 0 0 0-91.68 127.424C463.84 272.576 400.48 425.344 396.672 597.632H557.44c-8.8 36.128-13.504 76.544-14.496 118.848-0.32 13.92-0.352 27.872 0.256 42.144 1.92 45.056 8.704 91.68 20.832 138.048a604.48 604.48 0 0 0 46.624 124.256l38.016-18.304a602.912 602.912 0 0 1-41.632-105.952 571.936 571.936 0 0 1-22.08-141.44z"
|
234
|
-
fill="#224477" p-id="5449"></path>
|
235
|
-
</svg>
|
222
|
+
<image xlink:href="m.svg" width="13" height="13" />
|
236
223
|
{% endif %}
|
237
224
|
<div class="package_name"> {{ plugin.server.player_count }}/{{ plugin.server.max_players }} </div>
|
238
|
-
|
225
|
+
{% if plugin.server.vac_enabled %}
|
226
|
+
<img class="vac-icon" src="vac.png">
|
227
|
+
{% else %}
|
228
|
+
{% endif %}
|
239
229
|
</div>
|
240
230
|
</div>
|
241
231
|
</div>
|
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 == "填充":
|
@@ -0,0 +1,94 @@
|
|
1
|
+
from pathlib import Path
|
2
|
+
|
3
|
+
from nonebot.adapters import Event
|
4
|
+
from nonebot.log import logger
|
5
|
+
from nonebot.matcher import Matcher
|
6
|
+
from nonebot_plugin_alconna import File, UniMessage, UniMsg, on_alconna
|
7
|
+
|
8
|
+
from ..config import config, map_index
|
9
|
+
from ..l4_image.convert import text2pic
|
10
|
+
from ..utils.utils import mes_list
|
11
|
+
from .file import updown_l4d2_vpk
|
12
|
+
|
13
|
+
vpk_path = config.l4_local[map_index]
|
14
|
+
|
15
|
+
local_path_list = config.l4_local
|
16
|
+
if not local_path_list:
|
17
|
+
logger.warning(
|
18
|
+
"未填写本地服务器路径,如果想要使用本地服务器功能,请填写本地服务器路径",
|
19
|
+
)
|
20
|
+
else:
|
21
|
+
local_path: list[Path] = []
|
22
|
+
for folder_path in local_path_list:
|
23
|
+
path = Path(folder_path)
|
24
|
+
|
25
|
+
if path.is_dir():
|
26
|
+
for nextdir in path.iterdir():
|
27
|
+
# 如果找到了名为left4dead2的目录,返回True
|
28
|
+
if nextdir.name == "left4dead2" and nextdir.is_dir():
|
29
|
+
local_path.append(nextdir)
|
30
|
+
continue
|
31
|
+
logger.debug(f"本地服务器路径列表:{local_path}")
|
32
|
+
|
33
|
+
search_map = on_alconna(
|
34
|
+
"l4map",
|
35
|
+
aliases={"l4地图查询", "l4地图"},
|
36
|
+
priority=20,
|
37
|
+
block=True,
|
38
|
+
)
|
39
|
+
|
40
|
+
@search_map.handle()
|
41
|
+
async def _():
|
42
|
+
supath = local_path[map_index] / "addons"
|
43
|
+
vpk_list: list[str] = []
|
44
|
+
print(supath)
|
45
|
+
if supath.is_dir():
|
46
|
+
for sudir in supath.iterdir():
|
47
|
+
logger.info(f"找到文件:{sudir}")
|
48
|
+
if sudir.is_file() and sudir.name.endswith(".vpk"):
|
49
|
+
vpk_list.append(sudir.name)
|
50
|
+
if not vpk_list:
|
51
|
+
await UniMessage.text("未找到可用的VPK文件").finish()
|
52
|
+
out_msg = "\n".join(
|
53
|
+
f"{index + 1}、{line}" for index, line in enumerate(vpk_list)
|
54
|
+
)
|
55
|
+
|
56
|
+
img = await text2pic(f"服务器地图:\n{out_msg}")
|
57
|
+
await UniMessage.image(raw=img).send()
|
58
|
+
|
59
|
+
up = on_alconna(
|
60
|
+
"l4upload",
|
61
|
+
aliases={"l4地图上传"},
|
62
|
+
priority=5,
|
63
|
+
block=True,
|
64
|
+
)
|
65
|
+
|
66
|
+
@up.handle()
|
67
|
+
async def _():
|
68
|
+
await UniMessage.text("请发送地图文件").finish()
|
69
|
+
|
70
|
+
@up.got("map_url", prompt="图来")
|
71
|
+
async def _(ev: Event, msg: UniMsg, matcher: Matcher):
|
72
|
+
if not msg.has(File):
|
73
|
+
await UniMessage.text("不是文件,退出交互").finish()
|
74
|
+
args = ev.dict()
|
75
|
+
if args["notice_type"] != "offline_file":
|
76
|
+
matcher.set_arg("txt", args) # type: ignore
|
77
|
+
return
|
78
|
+
l4_file_path = config.l4_local[map_index]
|
79
|
+
map_path = Path(l4_file_path, vpk_path) # type: ignore
|
80
|
+
# 检查下载路径是否存在
|
81
|
+
if not Path(l4_file_path).exists(): # type: ignore
|
82
|
+
await UniMessage.text("你填写的路径不存在辣").finish()
|
83
|
+
if not Path(map_path).exists():
|
84
|
+
await UniMessage.text("这个路径并不是求生服务器的路径,请再看看罢").finish()
|
85
|
+
url: str = args["file"]["url"]
|
86
|
+
name: str = args["file"]["name"]
|
87
|
+
# 如果不符合格式则忽略
|
88
|
+
await up.send("已收到文件,开始下载")
|
89
|
+
vpk_files = await updown_l4d2_vpk(map_path, name, url)
|
90
|
+
if vpk_files:
|
91
|
+
mes = "解压成功,新增以下几个vpk文件"
|
92
|
+
await UniMessage.text(mes_list(mes, vpk_files)).finish()
|
93
|
+
else:
|
94
|
+
await UniMessage.text("你可能上传了相同的文件,或者解压失败了捏").finish()
|
@@ -0,0 +1,105 @@
|
|
1
|
+
import io
|
2
|
+
import platform
|
3
|
+
import zipfile
|
4
|
+
from pathlib import Path
|
5
|
+
from typing import Callable, Dict, List
|
6
|
+
from zipfile import ZipFile
|
7
|
+
|
8
|
+
import rarfile
|
9
|
+
from nonebot.log import logger
|
10
|
+
from pyunpack import Archive
|
11
|
+
|
12
|
+
from ..utils.utils import get_file, get_vpk
|
13
|
+
|
14
|
+
systems = platform.system()
|
15
|
+
|
16
|
+
|
17
|
+
async def updown_l4d2_vpk(map_paths: Path, name: str, url: str):
|
18
|
+
"""从url下载压缩包并解压到位置"""
|
19
|
+
original_vpk_files = get_vpk(map_paths)
|
20
|
+
down_file = Path(map_paths, name)
|
21
|
+
if await get_file(url, down_file) is None:
|
22
|
+
return None
|
23
|
+
msg = open_packet(name, down_file)
|
24
|
+
logger.info(msg)
|
25
|
+
|
26
|
+
extracted_vpk_files = get_vpk(map_paths)
|
27
|
+
# 获取新增vpk文件的list
|
28
|
+
return list(set(extracted_vpk_files) - set(original_vpk_files))
|
29
|
+
|
30
|
+
|
31
|
+
SUPPORTED_EXTENSIONS = (".zip", ".7z", ".rar")
|
32
|
+
|
33
|
+
|
34
|
+
def unzip_zipfile(down_file: Path, down_path: Path):
|
35
|
+
"""解压zip文件"""
|
36
|
+
with support_gbk(zipfile.ZipFile(down_file, "r")) as z:
|
37
|
+
z.extractall(down_path)
|
38
|
+
down_file.unlink()
|
39
|
+
|
40
|
+
|
41
|
+
def unpack_7zfile(down_file: Path, down_path: Path):
|
42
|
+
"""解压7z文件"""
|
43
|
+
Archive(str(down_file)).extractall(str(down_path))
|
44
|
+
down_file.unlink()
|
45
|
+
|
46
|
+
|
47
|
+
def unpack_rarfile(down_file: Path, down_path: Path):
|
48
|
+
"""解压rar文件"""
|
49
|
+
with rarfile.RarFile(down_file, "r") as z:
|
50
|
+
z.extractall(down_path)
|
51
|
+
down_file.unlink()
|
52
|
+
|
53
|
+
|
54
|
+
def open_packet(name: str, down_file: Path) -> str:
|
55
|
+
"""解压压缩包"""
|
56
|
+
down_path = down_file.parent
|
57
|
+
logger.info("文件名为:" + name)
|
58
|
+
logger.info(f"系统为{systems}")
|
59
|
+
if name.endswith(".vpk"):
|
60
|
+
return "vpk文件已下载"
|
61
|
+
|
62
|
+
for ext in SUPPORTED_EXTENSIONS:
|
63
|
+
if name.endswith(ext):
|
64
|
+
mes = f"{ext[1:]}文件已下载,正在解压"
|
65
|
+
unpack_funcs: Dict[str, Callable] = {
|
66
|
+
".zip": unzip_zipfile,
|
67
|
+
".7z": unpack_7zfile,
|
68
|
+
".rar": unpack_rarfile,
|
69
|
+
}
|
70
|
+
unpack_func = unpack_funcs.get(ext)
|
71
|
+
if not unpack_func:
|
72
|
+
raise ValueError(f"不支持的拓展名: {ext}")
|
73
|
+
unpack_func(down_file, down_path)
|
74
|
+
return mes
|
75
|
+
|
76
|
+
raise ValueError(f"不支持的文件: {name}")
|
77
|
+
|
78
|
+
|
79
|
+
def support_gbk(zip_file: ZipFile):
|
80
|
+
"""
|
81
|
+
压缩包中文恢复
|
82
|
+
"""
|
83
|
+
if isinstance(zip_file, ZipFile):
|
84
|
+
name_to_info = zip_file.NameToInfo
|
85
|
+
# copy map first
|
86
|
+
for name, info in name_to_info.copy().items():
|
87
|
+
real_name = name.encode("cp437").decode("gbk")
|
88
|
+
if real_name != name:
|
89
|
+
info.filename = real_name
|
90
|
+
del name_to_info[name]
|
91
|
+
name_to_info[real_name] = info
|
92
|
+
return zip_file
|
93
|
+
|
94
|
+
|
95
|
+
async def all_zip_to_one(data_list: List[bytes]): # noqa: RUF029
|
96
|
+
"""多压缩包文件合并"""
|
97
|
+
file_list = [io.BytesIO(data).getbuffer() for data in data_list]
|
98
|
+
data_file = io.BytesIO()
|
99
|
+
|
100
|
+
with ZipFile(data_file, mode="w") as zf:
|
101
|
+
for i, file in enumerate(file_list):
|
102
|
+
filename = f"file{i}.zip"
|
103
|
+
zf.writestr(filename, file)
|
104
|
+
|
105
|
+
return data_file.getbuffer()
|
@@ -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"]))
|
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"
|