nonebot-plugin-l4d2-server 1.0.3__tar.gz → 1.0.5__tar.gz

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.
Files changed (102) hide show
  1. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/PKG-INFO +19 -16
  2. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/README.md +15 -12
  3. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/__main__.py +67 -34
  4. nonebot_plugin_l4d2_server-1.0.5/nonebot_plugin_l4d2_server/config.py +94 -0
  5. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_help/Help.json +2 -39
  6. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_help/__init__.py +5 -7
  7. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_image/html_img.py +1 -1
  8. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_local/__init__.py +0 -1
  9. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_request/__init__.py +36 -104
  10. nonebot_plugin_l4d2_server-1.0.5/nonebot_plugin_l4d2_server/l4_request/draw_msg.py +231 -0
  11. nonebot_plugin_l4d2_server-1.0.5/nonebot_plugin_l4d2_server/l4_request/utils.py +176 -0
  12. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/utils/api/models.py +1 -1
  13. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/utils/api/request.py +71 -37
  14. nonebot_plugin_l4d2_server-1.0.5/nonebot_plugin_l4d2_server/utils/api/utils.py +30 -0
  15. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/utils/utils.py +11 -2
  16. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/pyproject.toml +4 -4
  17. nonebot_plugin_l4d2_server-1.0.3/nonebot_plugin_l4d2_server/config.py +0 -45
  18. nonebot_plugin_l4d2_server-1.0.3/nonebot_plugin_l4d2_server/l4_anne/__init__.py +0 -125
  19. nonebot_plugin_l4d2_server-1.0.3/nonebot_plugin_l4d2_server/l4_anne/ranne.py +0 -18
  20. nonebot_plugin_l4d2_server-1.0.3/nonebot_plugin_l4d2_server/l4_request/draw_msg.py +0 -94
  21. nonebot_plugin_l4d2_server-1.0.3/nonebot_plugin_l4d2_server/l4_request/utils.py +0 -0
  22. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/LICENSE +0 -0
  23. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/__init__.py +0 -0
  24. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/data/font/loli.ttf +0 -0
  25. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_help/draw.py +0 -0
  26. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_help/icon//344/273/213/347/273/215.png" +0 -0
  27. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_help/icon//344/273/273/345/212/241.png" +0 -0
  28. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_help/icon//344/277/241/346/201/257.png" +0 -0
  29. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_help/icon//345/205/254/345/221/212.png" +0 -0
  30. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_help/icon//345/210/200/345/211/221.png" +0 -0
  31. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_help/icon//345/210/207/346/215/242.png" +0 -0
  32. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_help/icon//345/210/240/351/231/244.png" +0 -0
  33. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_help/icon//345/210/267/346/226/260.png" +0 -0
  34. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_help/icon//345/215/241/347/273/204.png" +0 -0
  35. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_help/icon//345/223/252/351/207/214.png" +0 -0
  36. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_help/icon//345/234/260/345/233/276.png" +0 -0
  37. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_help/icon//345/257/274/345/205/245.png" +0 -0
  38. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_help/icon//345/257/274/345/207/272.png" +0 -0
  39. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_help/icon//345/275/261.png" +0 -0
  40. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_help/icon//346/213/274/345/233/276.png" +0 -0
  41. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_help/icon//346/216/242/347/264/242.png" +0 -0
  42. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_help/icon//346/216/250/351/200/201.png" +0 -0
  43. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_help/icon//346/224/266/351/233/206.png" +0 -0
  44. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_help/icon//346/224/273/347/225/245.png" +0 -0
  45. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_help/icon//346/233/264/346/226/260.png" +0 -0
  46. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_help/icon//346/235/220/346/226/231.png" +0 -0
  47. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_help/icon//346/237/245/350/257/242.png" +0 -0
  48. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_help/icon//346/240/241/351/252/214.png" +0 -0
  49. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_help/icon//346/257/217/346/234/210.png" +0 -0
  50. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_help/icon//346/267/261/346/270/212.png" +0 -0
  51. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_help/icon//346/267/273/345/212/240.png" +0 -0
  52. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_help/icon//346/270/205/351/231/244.png" +0 -0
  53. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_help/icon//347/212/266/346/200/201.png" +0 -0
  54. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_help/icon//347/255/276/345/210/260.png" +0 -0
  55. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_help/icon//347/273/221/345/256/232.png" +0 -0
  56. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_help/icon//350/241/250.png" +0 -0
  57. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_help/icon//350/241/250/346/203/205.png" +0 -0
  58. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_help/icon//350/247/222/350/211/262.png" +0 -0
  59. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_help/icon//350/256/260/345/275/225.png" +0 -0
  60. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_help/icon//351/205/215/347/275/256.png" +0 -0
  61. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_help/icon//351/207/215/345/220/257.png" +0 -0
  62. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_help/texture2d/badge.png +0 -0
  63. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_help/texture2d/banner.png +0 -0
  64. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_help/texture2d/bg.jpg +0 -0
  65. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_help/texture2d/button.png +0 -0
  66. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_help/texture2d/icon.png +0 -0
  67. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_image/__init__.py +0 -0
  68. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_image/anne_pil.py +0 -0
  69. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_image/convert.py +0 -0
  70. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_image/download.py +0 -0
  71. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_image/image_tools.py +0 -0
  72. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_image/img/anne/anne.html +0 -0
  73. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_image/img/anne/back.png +0 -0
  74. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_image/img/anne/back1.jpg +0 -0
  75. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_image/img/anne/group_ip.html +0 -0
  76. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_image/img/anne/ip.html +0 -0
  77. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_image/img/head/head.png +0 -0
  78. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_image/img/header/logo.png +0 -0
  79. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_image/img/header/player1.jpg +0 -0
  80. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_image/img/template/Bocchi_The_Rock.html +0 -0
  81. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_image/img/template/Bocchi_The_Rock.png +0 -0
  82. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_image/img/template/HYPixel11pxU-2.ttf +0 -0
  83. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_image/img/template/Pixel.html +0 -0
  84. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_image/img/template/Pixel.png +0 -0
  85. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_image/img/template/Rainbow.html +0 -0
  86. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_image/img/template/Rainbow.png +0 -0
  87. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_image/img/template/Tutumianhuatang-Bold-2.ttf +0 -0
  88. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_image/img/template/bilibili.svg +0 -0
  89. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_image/img/template/fingerprint.svg +0 -0
  90. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_image/img/template/github.svg +0 -0
  91. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_image/img/template/l.svg +0 -0
  92. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_image/img/template/m.svg +0 -0
  93. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_image/img/template/normal.html +0 -0
  94. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_image/img/template/vac.png +0 -0
  95. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_image/img/template/vac_white.png +0 -0
  96. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_image/img/template/vue.css +0 -0
  97. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_image/img/template/w.svg +0 -0
  98. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_image/model.py +0 -0
  99. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_image/vtfs.py +0 -0
  100. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/l4_local/file.py +0 -0
  101. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/utils/api/api.py +0 -0
  102. {nonebot_plugin_l4d2_server-1.0.3 → nonebot_plugin_l4d2_server-1.0.5}/nonebot_plugin_l4d2_server/utils/database/models.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nonebot-plugin-l4d2-server
3
- Version: 1.0.3
3
+ Version: 1.0.5
4
4
  Summary: L4D2 server related operations plugin for NoneBot2
5
5
  Keywords: steam,game,l4d2,nonebot2,plugin
6
6
  Author-Email: Agnes_Digital <Z735803792@163.com>
@@ -25,14 +25,14 @@ Requires-Dist: nonebot-plugin-tortoise-orm>=0.1.4
25
25
  Requires-Dist: aiohttp>=3.8.4
26
26
  Requires-Dist: jinja2>=3.0.0
27
27
  Requires-Dist: srctools>=2.3.9
28
- Requires-Dist: httpx<0.24.1,>=0.22.0
28
+ Requires-Dist: httpx>=0.22.0
29
29
  Requires-Dist: msgspec>=0.18.0
30
30
  Requires-Dist: python-a2s>=1.4.1
31
31
  Requires-Dist: ujson>=5.10.0
32
32
  Requires-Dist: lxml>=5.2.2
33
33
  Requires-Dist: rcon>=2.1.0
34
- Requires-Dist: pillow>10
35
- Requires-Dist: beautifulsoup4>=4.12.3
34
+ Requires-Dist: pillow>10.0.0
35
+ Requires-Dist: bs4>=0.0.2
36
36
  Requires-Dist: rarfile>=4.2
37
37
  Requires-Dist: pyunpack>=0.3
38
38
  Requires-Dist: aiofiles>=24.1.0
@@ -47,7 +47,7 @@ Description-Content-Type: text/markdown
47
47
 
48
48
  <div align="center">
49
49
 
50
- # nonebot_plugin_l4d2_server 1.0.0a1
50
+ # nonebot_plugin_l4d2_server 1.0.4
51
51
 
52
52
  _✨Nonebot & Left 4 Dead 2 server操作✨_
53
53
  <div align = "center">
@@ -77,15 +77,12 @@ _✨Nonebot & Left 4 Dead 2 server操作✨_
77
77
 
78
78
  ## 顶置公告(如果以前用0.x.x版本暂时别更新)
79
79
 
80
- - **版本** 1.x.x进行了破坏式更新,目前处于测试阶段,使用旧插件的不要更新
80
+ - **版本** 1.x.x进行了破坏式更新,使用旧插件的不要更新
81
81
 
82
- ## 更改部分
82
+ ## 指令
83
83
 
84
- - 取消了网页控制台(没有卵用)
85
- - 取消了自动重启(与其他插件功能重复)
86
- - 取消了git拉取更新(nb规范用pypi)
87
- - 增加pil和浏览器渲染做选择(可以选择pil以节省性能性能)
88
- - 删除无用部分(依赖太多难以维护)
84
+ - 在json文件设置的前缀指令,例如设置"云",则指令 云 输出组服务器,云1 输出1号服务器
85
+ - l4图片开启/关闭 超管指令 可以修改输出单图是否为图片输出
89
86
 
90
87
  ## 安装
91
88
 
@@ -142,8 +139,7 @@ conda install nonebot-plugin-l4d2-server
142
139
  ## 主要功能
143
140
 
144
141
  - [ ] 求生服务器-本地多路径操作(传地图等)
145
- - [ ] 批量查询指定ip服务器状态和玩家
146
- - [ ] [求生电信服anne](https://github.com/fantasylidong/CompetitiveWithAnne)[查询~](https://sb.trygek.com/l4d_stats/ranking/index.php)
142
+ - [x] 批量查询指定ip服务器状态和玩家
147
143
 
148
144
  ## [数据结构](./docs/standand.md)
149
145
 
@@ -152,8 +148,6 @@ conda install nonebot-plugin-l4d2-server
152
148
  ## env设置
153
149
 
154
150
  """bash
155
- l4_anne = False
156
- """是否启用anne电信服相关功能"""
157
151
  l4_enable = True
158
152
  """是否全局启用求生功能"""
159
153
  l4_image = False
@@ -172,6 +166,15 @@ conda install nonebot-plugin-l4d2-server
172
166
  - 缤纷彩虹
173
167
  """
174
168
 
169
+ ## 和0.x.x更改部分
170
+
171
+ - 取消了网页控制台(没有卵用)
172
+ - 取消了自动重启(与其他插件功能重复)
173
+ - 取消了git拉取更新(nb规范用pypi)
174
+ - 增加pil和浏览器渲染做选择(可以选择pil以节省性能性能)
175
+ - 删除无用部分(依赖太多难以维护)
176
+ - 删除了anne部分,已移植到[这里](https://github.com/Agnes4m/L4D2UID),通过core插件调用
177
+
175
178
  ## 其他
176
179
 
177
180
  - 本人技术很差,如果您有发现BUG或者更好的建议,欢迎提Issue & Pr
@@ -7,7 +7,7 @@
7
7
 
8
8
  <div align="center">
9
9
 
10
- # nonebot_plugin_l4d2_server 1.0.0a1
10
+ # nonebot_plugin_l4d2_server 1.0.4
11
11
 
12
12
  _✨Nonebot & Left 4 Dead 2 server操作✨_
13
13
  <div align = "center">
@@ -37,15 +37,12 @@ _✨Nonebot & Left 4 Dead 2 server操作✨_
37
37
 
38
38
  ## 顶置公告(如果以前用0.x.x版本暂时别更新)
39
39
 
40
- - **版本** 1.x.x进行了破坏式更新,目前处于测试阶段,使用旧插件的不要更新
40
+ - **版本** 1.x.x进行了破坏式更新,使用旧插件的不要更新
41
41
 
42
- ## 更改部分
42
+ ## 指令
43
43
 
44
- - 取消了网页控制台(没有卵用)
45
- - 取消了自动重启(与其他插件功能重复)
46
- - 取消了git拉取更新(nb规范用pypi)
47
- - 增加pil和浏览器渲染做选择(可以选择pil以节省性能性能)
48
- - 删除无用部分(依赖太多难以维护)
44
+ - 在json文件设置的前缀指令,例如设置"云",则指令 云 输出组服务器,云1 输出1号服务器
45
+ - l4图片开启/关闭 超管指令 可以修改输出单图是否为图片输出
49
46
 
50
47
  ## 安装
51
48
 
@@ -102,8 +99,7 @@ conda install nonebot-plugin-l4d2-server
102
99
  ## 主要功能
103
100
 
104
101
  - [ ] 求生服务器-本地多路径操作(传地图等)
105
- - [ ] 批量查询指定ip服务器状态和玩家
106
- - [ ] [求生电信服anne](https://github.com/fantasylidong/CompetitiveWithAnne)[查询~](https://sb.trygek.com/l4d_stats/ranking/index.php)
102
+ - [x] 批量查询指定ip服务器状态和玩家
107
103
 
108
104
  ## [数据结构](./docs/standand.md)
109
105
 
@@ -112,8 +108,6 @@ conda install nonebot-plugin-l4d2-server
112
108
  ## env设置
113
109
 
114
110
  """bash
115
- l4_anne = False
116
- """是否启用anne电信服相关功能"""
117
111
  l4_enable = True
118
112
  """是否全局启用求生功能"""
119
113
  l4_image = False
@@ -132,6 +126,15 @@ conda install nonebot-plugin-l4d2-server
132
126
  - 缤纷彩虹
133
127
  """
134
128
 
129
+ ## 和0.x.x更改部分
130
+
131
+ - 取消了网页控制台(没有卵用)
132
+ - 取消了自动重启(与其他插件功能重复)
133
+ - 取消了git拉取更新(nb规范用pypi)
134
+ - 增加pil和浏览器渲染做选择(可以选择pil以节省性能性能)
135
+ - 删除无用部分(依赖太多难以维护)
136
+ - 删除了anne部分,已移植到[这里](https://github.com/Agnes4m/L4D2UID),通过core插件调用
137
+
135
138
  ## 其他
136
139
 
137
140
  - 本人技术很差,如果您有发现BUG或者更好的建议,欢迎提Issue & Pr
@@ -24,10 +24,11 @@ from nonebot.adapters import Message
24
24
  from nonebot.log import logger
25
25
  from nonebot.matcher import Matcher
26
26
  from nonebot.params import CommandArg, CommandStart, RawCommand
27
+ from nonebot.permission import SUPERUSER
27
28
  from nonebot.plugin import on_command
28
29
  from nonebot_plugin_alconna import UniMessage
29
30
 
30
- from .config import config
31
+ from .config import config, config_manager
31
32
  from .l4_help import get_l4d2_core_help
32
33
  from .l4_local import * # noqa: F403
33
34
  from .l4_request import (
@@ -39,13 +40,14 @@ from .l4_request import (
39
40
  tj_request,
40
41
  )
41
42
  from .utils.api.request import L4API
43
+ from .utils.api.utils import out_msg_out
42
44
 
43
45
  if TYPE_CHECKING:
44
46
  from .utils.api.models import OutServer
45
47
 
46
48
  reload_ip()
47
49
 
48
- l4_help = on_command("l4help", aliases={"l4帮助", "l4d2帮助"})
50
+ l4_help = on_command("l4help", aliases={"l4d2帮助"})
49
51
  l4_request = on_command("anne", aliases=COMMAND, priority=10)
50
52
  l4_reload = on_command("l4reload", aliases={"l4刷新,l4重载"})
51
53
  l4_all = on_command("l4all", aliases={"l4全服"})
@@ -59,13 +61,11 @@ config_path = Path(config.l4_path) / "config.json"
59
61
 
60
62
 
61
63
  @l4_help.handle()
62
- async def _(matcher: Matcher):
64
+ async def _():
63
65
  """帮助"""
64
66
  logger.info("开始执行[l4d2帮助]")
65
67
  im = await get_l4d2_core_help()
66
- if isinstance(im, str):
67
- await matcher.finish(im)
68
- await UniMessage.image(raw=im).send()
68
+ await out_msg_out(im)
69
69
 
70
70
 
71
71
  @l4_request.handle()
@@ -74,11 +74,31 @@ async def _(
74
74
  command: str = RawCommand(),
75
75
  args: Message = CommandArg(),
76
76
  ):
77
- """例:
78
- 指令: /橘5
79
- start: /(command开头指令)
80
- command: /橘(响应的全部指令)
81
- args: 5(响应的指令后的数字)
77
+ """
78
+ 异步函数,用于处理特定的指令。
79
+
80
+ Args:
81
+ start (str, optional): 指令的开头部分,默认为 CommandStart() 返回的值。
82
+ command (str, optional): 完整的指令字符串,默认为 RawCommand() 返回的值。
83
+ args (Message, optional): 指令后的参数,默认为 CommandArg() 返回的值。
84
+
85
+ Returns:
86
+ None
87
+
88
+ Examples:
89
+ 示例指令:"/橘5"
90
+ - start: "/" (指令的开头部分)
91
+ - command: "/橘" (完整的指令字符串)
92
+ - args: "5" (指令后的参数)
93
+
94
+ Notes:
95
+ 1. 如果 start 存在,会将 command 中的 start 部分替换为空字符串。
96
+ 2. 如果 command 等于 "anne",则将其替换为 "云"。
97
+ 3. 提取 args 中的纯文本内容,如果内容非空且不是数字,则返回。
98
+ 4. 如果 args 为空,则将其设置为 None。
99
+ 5. 使用 logger 记录处理过程中的信息。
100
+ 6. 调用 get_server_detail 函数获取服务器详情,并根据返回结果发送相应的消息。
101
+ 7. 如果 get_server_detail 返回 None,则发送 "服务器无响应" 的文本消息。
82
102
  """
83
103
 
84
104
  if start:
@@ -92,13 +112,15 @@ async def _(
92
112
  _id = None
93
113
  logger.info(f"组:{command} ;数字:{_id}")
94
114
  msg = await get_server_detail(command, _id)
95
- if msg is not None:
96
- if isinstance(msg, str):
97
- await UniMessage.text(msg).finish()
98
- if isinstance(msg, bytes):
99
- await UniMessage.image(raw=msg).finish()
100
- else:
101
- await UniMessage.text("服务器无响应").finish()
115
+ if msg is None:
116
+ await out_msg_out("服务器无响应")
117
+ return
118
+ if _id is None:
119
+ logger.info(f"正在输出组:{command}")
120
+ await out_msg_out(msg)
121
+ if _id:
122
+ logger.info(f"正在输出单服务器:{command} {_id}", is_connect=config.l4_image)
123
+ await out_msg_out(msg)
102
124
 
103
125
 
104
126
  @l4_find_player.handle()
@@ -120,48 +142,41 @@ async def _(
120
142
  if len(tag_list) == 2:
121
143
  group, name = tag_list
122
144
  await UniMessage.text(f"正在查询{group}组").send()
123
- out: List[OutServer] = await get_server_detail(group, is_img=False) # type: ignore
145
+ out: List[OutServer] = await get_server_detail(group=group, is_img=False) # type: ignore
124
146
  out_msg = "未找到玩家"
125
147
  for one in out:
126
148
  for player in one["player"]:
127
149
  if name in player.name:
128
150
  out_msg = await get_ip_server(f"{one['host']}:{one['port']}")
129
151
 
130
- return await UniMessage.text(out_msg).finish()
152
+ return await out_msg_out(out_msg)
131
153
 
132
154
 
133
155
  @l4_all.handle()
134
156
  async def _():
135
- await UniMessage.text(await get_all_server_detail()).finish()
157
+ await out_msg_out(await get_all_server_detail())
136
158
 
137
159
 
138
160
  @l4_connect.handle()
139
161
  async def _(args: Message = CommandArg()):
140
162
  ip: Optional[str] = args.extract_plain_text()
141
163
  if ip is not None:
142
- await UniMessage.text(await get_ip_server(ip)).finish()
143
-
144
-
145
- # anne部分
146
- if config.l4_anne:
147
- logger.info("加载anne功能")
148
- from .l4_anne import * # noqa: F403
164
+ await out_msg_out(await get_ip_server(ip), is_connect=config.l4_image)
149
165
 
150
166
 
151
167
  @l4_reload.handle()
152
168
  async def _(args: Message = CommandArg()):
153
169
  arg = args.extract_plain_text().strip()
154
- print(arg)
155
170
  if not arg:
156
171
  reload_ip()
157
172
  logger.success("重载ip完成")
158
- with (Path(config.l4_path) / "config.json").open("r", encoding="utf-8") as f:
173
+ with (Path(config.l4_path) / "l4d2.json").open("r", encoding="utf-8") as f:
159
174
  content = f.read().strip()
160
175
  ip_json = json.loads(content)
161
176
  for tag, url in ip_json.items():
162
177
  logger.info(f"重载{tag}的ip")
163
178
  await L4API.get_sourceban(tag, url)
164
- await UniMessage.text("重载ip完成").finish()
179
+ await out_msg_out("重载ip完成")
165
180
 
166
181
 
167
182
  l4_add_ban = on_command("l4addban", aliases={"l4添加ban"})
@@ -192,7 +207,7 @@ async def _(args: Message = CommandArg()):
192
207
  await UniMessage.text(f"文件写入失败: {e}").finish()
193
208
 
194
209
  await L4API.get_sourceban(arg[0], arg[1])
195
- await UniMessage.text(f"添加成功\n组名: {arg[0]}\n网址: {arg[1]}").finish()
210
+ await out_msg_out(f"添加成功\n组名: {arg[0]}\n网址: {arg[1]}")
196
211
 
197
212
 
198
213
  l4_del_ban = on_command("l4delban", aliases={"l4删除ban", "l4移除ban"})
@@ -219,7 +234,7 @@ async def _(args: Message = CommandArg()):
219
234
  del config_data[arg[0]]
220
235
  async with aiofiles.open(config_path, "w", encoding="utf-8") as f:
221
236
  json.dump(config_data, f, ensure_ascii=False, indent=4)
222
- await UniMessage.text(f"删除成功,组名:{arg[0]}").finish()
237
+ await out_msg_out(f"删除成功,组名:{arg[0]}")
223
238
  elif len(arg) == 2:
224
239
  if not Path(Path(config.l4_path) / "config.json").is_file():
225
240
  await UniMessage.text("没有添加过组名").finish()
@@ -236,7 +251,7 @@ async def _(args: Message = CommandArg()):
236
251
  config_datas[arg[0]] = arg[1]
237
252
  async with aiofiles.open(config_path, "w", encoding="utf-8") as f:
238
253
  json.dump(config_datas, f, ensure_ascii=False, indent=4)
239
- await UniMessage.text(f"修改成功,组名:{arg[0]},网址:{arg[1]}").finish()
254
+ await out_msg_out(f"修改成功,组名:{arg[0]},网址:{arg[1]}")
240
255
 
241
256
 
242
257
  @ld_tj.handle()
@@ -249,3 +264,21 @@ async def _(matcher: Matcher):
249
264
  async def _(matcher: Matcher):
250
265
  await matcher.send("正在寻找牢房信息")
251
266
  await matcher.finish(await tj_request("云", "zl"))
267
+
268
+
269
+ ## 以下为配置修改
270
+
271
+ img_trung = on_command("l4img", aliases={"l4图片"}, permission=SUPERUSER)
272
+
273
+
274
+ @img_trung.handle()
275
+ async def _(args: Message = CommandArg()):
276
+ arg = args.extract_plain_text().strip().lower()
277
+ if arg == "开启":
278
+ config_manager.update_image_config(enabled=True)
279
+ await out_msg_out("[l4]已开启图片模式")
280
+ elif arg == "关闭":
281
+ config_manager.update_image_config(enabled=False)
282
+ await out_msg_out("[l4]已关闭图片模式")
283
+ else:
284
+ await UniMessage.text("请在参数后加上开启或关闭").finish()
@@ -0,0 +1,94 @@
1
+ from pathlib import Path
2
+
3
+ from nonebot import get_plugin_config
4
+ from nonebot.log import logger
5
+ from pydantic import BaseModel
6
+
7
+ DATAPATH = Path(__file__).parent.joinpath("data")
8
+ DATAOUT = Path("data/L4D2")
9
+ DATAOUT.mkdir(parents=True, exist_ok=True)
10
+ if not Path(DATAOUT / "l4d2.json").exists():
11
+ logger.info("文件 l4d2.json 不存在,已创建并初始化为 {}")
12
+ Path(DATAOUT / "l4d2.json").write_text("{}", encoding="utf-8")
13
+ server_all_path = DATAOUT / "l4d2"
14
+ server_all_path.mkdir(parents=True, exist_ok=True)
15
+
16
+ ICONPATH = DATAPATH / "icon"
17
+
18
+ global map_index
19
+ map_index = 0
20
+
21
+
22
+ class ConfigModel(BaseModel):
23
+ l4_enable: bool = True
24
+ """是否全局启用求生功能"""
25
+ l4_image: bool = True
26
+ """是否启用图片"""
27
+ l4_connect: bool = True
28
+ """是否在查服命令后加入connect ip"""
29
+ l4_path: str = "data/L4D2"
30
+ """插件数据路径"""
31
+ l4_players: int = 4
32
+ """查询总图的时候展示的用户数量"""
33
+ l4_style: str = "default"
34
+ """图片风格"""
35
+ l4_font: str = str(Path(__file__).parent.joinpath("data/font/loli.ttf"))
36
+ """字体"""
37
+ l4_show_ip: bool = True
38
+ """单服务器查询时候是否展示ip直连地址"""
39
+ l4_local: list[str] = []
40
+ """本地服务器路径,填写路径下有`steam_appid.txt`文件"""
41
+
42
+
43
+ config = get_plugin_config(ConfigModel)
44
+
45
+
46
+ class ConfigManager:
47
+ """配置项管理类,提供类型安全的配置更新方法"""
48
+
49
+ def __init__(self):
50
+ self._config = config
51
+
52
+ def update_image_config(self, enabled: bool) -> None:
53
+ """更新图片配置
54
+
55
+ Args:
56
+ enabled: 是否启用图片功能
57
+ """
58
+ self._config.l4_image = enabled
59
+
60
+ def update_style_config(self, style: str) -> None:
61
+ """更新图片风格配置
62
+
63
+ Args:
64
+ style: 图片风格名称
65
+ """
66
+ if not isinstance(style, str):
67
+ raise TypeError("style必须是字符串")
68
+ self._config.l4_style = style
69
+
70
+ def update_connect_config(self, enabled: bool) -> None:
71
+ """更新connect ip配置
72
+
73
+ Args:
74
+ enabled: 是否在查服命令后加入connect ip
75
+ """
76
+ self._config.l4_connect = enabled
77
+
78
+ def update(self, **kwargs) -> None:
79
+ """通用配置更新方法
80
+
81
+ Args:
82
+ **kwargs: 要更新的配置项键值对
83
+
84
+ Raises:
85
+ ValueError: 当传入无效的配置项时
86
+ """
87
+ for key, value in kwargs.items():
88
+ if hasattr(self._config, key):
89
+ setattr(self._config, key, value)
90
+ else:
91
+ raise ValueError(f"无效的配置项: {key}")
92
+
93
+
94
+ config_manager = ConfigManager()
@@ -28,7 +28,7 @@
28
28
  },
29
29
  {
30
30
  "name": "l4全服",
31
- "desc": "返回可以查询的所有服务器组(未完成)",
31
+ "desc": "返回可以查询的所有服务器组",
32
32
  "eg": "/l4全服",
33
33
  "need_ck": false,
34
34
  "need_sk": false,
@@ -36,43 +36,6 @@
36
36
  }
37
37
  ]
38
38
  },
39
- "电信服anne服务": {
40
- "desc": "电信anne服相关服务",
41
- "data": [
42
- {
43
- "name": "Banne xx",
44
- "desc": "绑定昵称/steamid",
45
- "eg": "/Banne 爱丽数码",
46
- "need_ck": false,
47
- "need_sk": false,
48
- "need_admin": false
49
- },
50
- {
51
- "name": "Ranne(玩家)",
52
- "desc": "查询anne个人信息,没有参数查自己",
53
- "eg": "/Ranne 爱丽数码",
54
- "need_ck": false,
55
- "need_sk": false,
56
- "need_admin": false
57
- },
58
- {
59
- "name": "Sanne(玩家)",
60
- "desc": "按昵称查询anne玩家信息",
61
- "eg": "/Sanne 爱丽数码",
62
- "need_ck": false,
63
- "need_sk": false,
64
- "need_admin": false
65
- },
66
- {
67
- "name": "Danne(玩家)",
68
- "desc": "删除anne玩家信息",
69
- "eg": "/Danne 爱丽数码",
70
- "need_ck": false,
71
- "need_sk": false,
72
- "need_admin": false
73
- }
74
- ]
75
- },
76
39
  "管理员服务": {
77
40
  "desc": "管理可以使用的指令",
78
41
  "data": [
@@ -83,7 +46,7 @@
83
46
  "need_ck": false,
84
47
  "need_sk": false,
85
48
  "need_admin": true
86
- },
49
+ },
87
50
  {
88
51
  "name": "l4地图上传",
89
52
  "desc": "进入交互上传地图文件",
@@ -1,8 +1,8 @@
1
+ import json
1
2
  from pathlib import Path
2
3
  from typing import Dict, Union
3
4
 
4
5
  import aiofiles
5
- from msgspec import json as msgjson
6
6
  from PIL import Image
7
7
 
8
8
  from ..config import ICONPATH
@@ -10,18 +10,16 @@ from ..l4_image.convert import core_font
10
10
  from ..l4_image.model import PluginHelp
11
11
  from .draw import get_help
12
12
 
13
- __version__ = "1.0.3"
13
+ __version__ = "1.0.5"
14
14
  TEXT_PATH = Path(__file__).parent / "texture2d"
15
15
  HELP_DATA = Path(__file__).parent / "Help.json"
16
16
 
17
17
 
18
18
  async def get_help_data() -> Union[Dict[str, PluginHelp], None]:
19
19
  if HELP_DATA.exists():
20
- async with aiofiles.open(HELP_DATA, "rb") as file:
21
- return msgjson.decode(
22
- await file.read(),
23
- type=Dict[str, PluginHelp],
24
- )
20
+ async with aiofiles.open(HELP_DATA, "r", encoding="utf-8") as file:
21
+ content = await file.read()
22
+ return json.loads(content)
25
23
  return None
26
24
 
27
25
 
@@ -45,7 +45,7 @@ async def server_ip_pic(server_dict: List[OutServer]):
45
45
  key=lambda x: x.score,
46
46
  reverse=True,
47
47
  )[:max_number]
48
- print(sorted_players)
48
+ logger.debug(sorted_players)
49
49
  server_info["player"] = sorted_players
50
50
  else:
51
51
  server_info["player"] = []
@@ -47,7 +47,6 @@ else:
47
47
  async def _():
48
48
  supath = local_path[map_index] / "addons"
49
49
  vpk_list: list[str] = []
50
- print(supath)
51
50
  if supath.is_dir():
52
51
  for sudir in supath.iterdir():
53
52
  logger.info(f"找到文件:{sudir}")