albibong 1.0.3__tar.gz → 1.0.4__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 (53) hide show
  1. {albibong-1.0.3 → albibong-1.0.4}/PKG-INFO +2 -1
  2. {albibong-1.0.3 → albibong-1.0.4}/pyproject.toml +3 -2
  3. {albibong-1.0.3 → albibong-1.0.4}/src/albibong/__init__.py +10 -4
  4. albibong-1.0.4/src/albibong/assets/boom_small.mp3 +0 -0
  5. {albibong-1.0.3 → albibong-1.0.4}/src/albibong/classes/character.py +5 -7
  6. {albibong-1.0.3 → albibong-1.0.4}/src/albibong/classes/logger.py +1 -1
  7. {albibong-1.0.3 → albibong-1.0.4}/src/albibong/classes/world_data.py +52 -12
  8. albibong-1.0.4/src/albibong/gui_dist/Albibong.png +0 -0
  9. {albibong-1.0.3 → albibong-1.0.4}/src/albibong/gui_dist/index.html +3 -3
  10. albibong-1.0.4/src/albibong/requirements.txt +4 -0
  11. albibong-1.0.4/src/albibong/resources/EventCode.py +588 -0
  12. albibong-1.0.4/src/albibong/resources/event_code.json +586 -0
  13. {albibong-1.0.3 → albibong-1.0.4}/src/albibong/resources/items.json +16421 -16051
  14. {albibong-1.0.3 → albibong-1.0.4}/src/albibong/threads/http_server.py +2 -2
  15. {albibong-1.0.3 → albibong-1.0.4}/src/albibong/threads/sniffer_thread.py +1 -0
  16. albibong-1.0.3/src/albibong/requirements.txt +0 -3
  17. albibong-1.0.3/src/albibong/resources/EventCode.py +0 -587
  18. albibong-1.0.3/src/albibong/resources/event_code.json +0 -585
  19. {albibong-1.0.3 → albibong-1.0.4}/.gitignore +0 -0
  20. {albibong-1.0.3 → albibong-1.0.4}/LICENSE +0 -0
  21. {albibong-1.0.3 → albibong-1.0.4}/src/albibong/__main__.py +0 -0
  22. {albibong-1.0.3 → albibong-1.0.4}/src/albibong/classes/__init__.py +0 -0
  23. {albibong-1.0.3 → albibong-1.0.4}/src/albibong/classes/coords.py +0 -0
  24. {albibong-1.0.3 → albibong-1.0.4}/src/albibong/classes/dungeon.py +0 -0
  25. {albibong-1.0.3 → albibong-1.0.4}/src/albibong/classes/item.py +0 -0
  26. {albibong-1.0.3 → albibong-1.0.4}/src/albibong/classes/location.py +0 -0
  27. {albibong-1.0.3 → albibong-1.0.4}/src/albibong/classes/packet_handler.py +0 -0
  28. {albibong-1.0.3 → albibong-1.0.4}/src/albibong/classes/utils.py +0 -0
  29. {albibong-1.0.3 → albibong-1.0.4}/src/albibong/gui_dist/No Equipment.png +0 -0
  30. {albibong-1.0.3 → albibong-1.0.4}/src/albibong/gui_dist/assets/index-BFSx0nua.css +0 -0
  31. {albibong-1.0.3 → albibong-1.0.4}/src/albibong/gui_dist/assets/index-DAndaN_4.js +0 -0
  32. {albibong-1.0.3 → albibong-1.0.4}/src/albibong/gui_dist/fame.png +0 -0
  33. {albibong-1.0.3 → albibong-1.0.4}/src/albibong/gui_dist/re_spec.png +0 -0
  34. {albibong-1.0.3 → albibong-1.0.4}/src/albibong/gui_dist/silver.png +0 -0
  35. {albibong-1.0.3 → albibong-1.0.4}/src/albibong/gui_dist/vite.svg +0 -0
  36. {albibong-1.0.3 → albibong-1.0.4}/src/albibong/photon_packet_parser/__init__.py +0 -0
  37. {albibong-1.0.3 → albibong-1.0.4}/src/albibong/photon_packet_parser/command_type.py +0 -0
  38. {albibong-1.0.3 → albibong-1.0.4}/src/albibong/photon_packet_parser/crc_calculator.py +0 -0
  39. {albibong-1.0.3 → albibong-1.0.4}/src/albibong/photon_packet_parser/event_data.py +0 -0
  40. {albibong-1.0.3 → albibong-1.0.4}/src/albibong/photon_packet_parser/message_type.py +0 -0
  41. {albibong-1.0.3 → albibong-1.0.4}/src/albibong/photon_packet_parser/number_serializer.py +0 -0
  42. {albibong-1.0.3 → albibong-1.0.4}/src/albibong/photon_packet_parser/operation_request.py +0 -0
  43. {albibong-1.0.3 → albibong-1.0.4}/src/albibong/photon_packet_parser/operation_response.py +0 -0
  44. {albibong-1.0.3 → albibong-1.0.4}/src/albibong/photon_packet_parser/photon_packet_parser.py +0 -0
  45. {albibong-1.0.3 → albibong-1.0.4}/src/albibong/photon_packet_parser/protocol16_deserializer.py +0 -0
  46. {albibong-1.0.3 → albibong-1.0.4}/src/albibong/photon_packet_parser/protocol16_type.py +0 -0
  47. {albibong-1.0.3 → albibong-1.0.4}/src/albibong/photon_packet_parser/segmented_packet.py +0 -0
  48. {albibong-1.0.3 → albibong-1.0.4}/src/albibong/resources/OperationCode.py +0 -0
  49. {albibong-1.0.3 → albibong-1.0.4}/src/albibong/resources/maps.json +0 -0
  50. {albibong-1.0.3 → albibong-1.0.4}/src/albibong/resources/operation_code.json +0 -0
  51. {albibong-1.0.3 → albibong-1.0.4}/src/albibong/threads/__init__.py +0 -0
  52. {albibong-1.0.3 → albibong-1.0.4}/src/albibong/threads/packet_handler_thread.py +0 -0
  53. {albibong-1.0.3 → albibong-1.0.4}/src/albibong/threads/websocket_server.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: albibong
3
- Version: 1.0.3
3
+ Version: 1.0.4
4
4
  Summary: A cross-platform Albion Online damage, fame, and dungeon tracker
5
5
  Project-URL: Homepage, https://github.com/imjangkar/albibong
6
6
  Project-URL: Issues, https://github.com/imjangkar/albibong/issues
@@ -10,6 +10,7 @@ Classifier: License :: OSI Approved :: MIT License
10
10
  Classifier: Operating System :: OS Independent
11
11
  Classifier: Programming Language :: Python :: 3
12
12
  Requires-Python: >=3.8
13
+ Requires-Dist: playsound==1.3.0
13
14
  Requires-Dist: pywebview==5.1
14
15
  Requires-Dist: scapy==2.5.0
15
16
  Requires-Dist: websockets==12.0
@@ -19,7 +19,7 @@ albibong = "albibong:main"
19
19
 
20
20
  [project]
21
21
  name = "albibong"
22
- version = "1.0.3"
22
+ version = "1.0.4"
23
23
  authors = [
24
24
  { name="imjangkar", email="imjangkar@gmail.com" },
25
25
  ]
@@ -33,7 +33,8 @@ classifiers = [
33
33
  dependencies = [
34
34
  "scapy==2.5.0",
35
35
  "websockets==12.0",
36
- "pywebview==5.1"
36
+ "pywebview==5.1",
37
+ "playsound==1.3.0"
37
38
  ]
38
39
 
39
40
  [project.urls]
@@ -1,5 +1,6 @@
1
1
  import queue
2
2
  import random
3
+ import socket
3
4
  import sys
4
5
  from time import sleep
5
6
 
@@ -14,7 +15,8 @@ from albibong.threads.sniffer_thread import SnifferThread
14
15
  from albibong.threads.websocket_server import get_ws_server
15
16
 
16
17
  logger = Logger(__name__, stdout=True, log_to_file=False)
17
- PORT = random.randrange(8500,8999)
18
+ PORT = random.randrange(8500, 8999)
19
+
18
20
 
19
21
  def read_pcap(path):
20
22
  packet_handler = PacketHandler()
@@ -42,14 +44,18 @@ def sniff(useWebview):
42
44
  ws_server.start()
43
45
 
44
46
  if useWebview:
45
- print("addr",PORT)
46
47
 
47
- http_server = HttpServerThread(name="http_server", port=PORT)
48
+ sock = socket.socket()
49
+ sock.bind(("", 0))
50
+ port = sock.getsockname()[1]
51
+ sock.close()
52
+
53
+ http_server = HttpServerThread(name="http_server", port=port)
48
54
  http_server.start()
49
55
 
50
56
  window = webview.create_window(
51
57
  "Albibong",
52
- url=f"http://localhost:{PORT}/",
58
+ url=f"http://localhost:{port}/",
53
59
  width=1280,
54
60
  height=720,
55
61
  zoomable=True,
@@ -34,13 +34,11 @@ class Character:
34
34
  self.loot: list[str] = []
35
35
  self.equipment = equipment
36
36
 
37
- def handle_health_update(self, parameters):
38
- if 2 in parameters:
39
- if parameters[2] < 0:
40
- if parameters[0] != self.id:
41
- self.damage_dealt += abs(parameters[2])
42
- else:
43
- self.healing_dealt += abs(parameters[2])
37
+ def update_damage_dealt(self, nominal):
38
+ self.damage_dealt += nominal
39
+
40
+ def update_heal_dealt(self, nominal):
41
+ self.healing_dealt += nominal
44
42
 
45
43
  def update_coords(self, parameters):
46
44
  if 3 in parameters:
@@ -40,7 +40,7 @@ class Logger(logging.Logger):
40
40
  log_formatter = logging.Formatter("%(message)s")
41
41
 
42
42
  if log_to_file:
43
- file_handler = logging.FileHandler(log_filepath)
43
+ file_handler = logging.FileHandler(log_filepath, encoding="utf-8")
44
44
  file_handler.setFormatter(log_formatter)
45
45
  file_handler.setLevel(logging.INFO)
46
46
  self.addHandler(file_handler)
@@ -1,7 +1,9 @@
1
1
  import json
2
2
  import os
3
3
  from collections import deque
4
+ import threading
4
5
  from uuid import UUID
6
+ from playsound import playsound
5
7
 
6
8
  from albibong.classes.character import Character
7
9
  from albibong.classes.coords import Coords
@@ -66,7 +68,12 @@ class WorldData:
66
68
  parameters[252] == EventCode.HEALTH_UPDATE.value
67
69
  and self.is_dps_meter_running
68
70
  ):
69
- self.update_dps_meter(parameters)
71
+ self.handle_health_update(parameters)
72
+ elif (
73
+ parameters[252] == EventCode.HEALTH_UPDATES.value
74
+ and self.is_dps_meter_running
75
+ ):
76
+ self.handle_health_updates(parameters)
70
77
  elif (
71
78
  parameters[252] == EventCode.PARTY_JOINED.value
72
79
  or parameters[252] == EventCode.PARTY_PLAYER_JOINED.value
@@ -182,17 +189,50 @@ class WorldData:
182
189
  }
183
190
  send_event(event)
184
191
 
185
- def update_dps_meter(self, parameters):
186
- if 6 in parameters and parameters[6] in self.char_id_to_username:
187
- username = self.char_id_to_username[parameters[6]]
188
- if username in self.party_members:
189
- char: Character = self.characters[username]
190
- char.handle_health_update(parameters)
191
- event = {
192
- "type": "update_dps",
193
- "payload": {"party_members": self.serialize_party_members()},
194
- }
195
- send_event(event)
192
+ def handle_health_update(self, parameters):
193
+
194
+ nominal = parameters[2] if 2 in parameters else 0
195
+ target = parameters[0]
196
+ inflictor = parameters[6]
197
+
198
+ self.update_damage_or_heal(target, inflictor, nominal)
199
+
200
+ def update_damage_or_heal(self, target, inflictor, nominal):
201
+
202
+ if inflictor not in self.char_id_to_username:
203
+ # character not initialized yet
204
+ return
205
+
206
+ username = self.char_id_to_username[inflictor]
207
+
208
+ if username == "not initialized":
209
+ # self not initialized
210
+ return
211
+
212
+ char: Character = self.characters[username]
213
+
214
+ if nominal < 0:
215
+ if target == inflictor:
216
+ # suicide
217
+ return
218
+ char.update_damage_dealt(abs(nominal))
219
+ else:
220
+ char.update_heal_dealt(nominal)
221
+
222
+ event = {
223
+ "type": "update_dps",
224
+ "payload": {"party_members": self.serialize_party_members()},
225
+ }
226
+ send_event(event)
227
+
228
+ def handle_health_updates(self, parameters):
229
+
230
+ for i in range(len(parameters[2])):
231
+ nominal = parameters[2][i]
232
+ target = parameters[0]
233
+ inflictor = parameters[6][i]
234
+
235
+ self.update_damage_or_heal(target, inflictor, nominal)
196
236
 
197
237
  def change_character_equipment(self, parameters):
198
238
  if 2 in parameters:
@@ -1,10 +1,10 @@
1
- <!doctype html>
1
+ <!DOCTYPE html>
2
2
  <html lang="en">
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
- <link rel="icon" type="image/svg+xml" href="/vite.svg" />
5
+ <link rel="icon" type="image/png" href="/Albibong.png" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
- <title>Vite + React + TS</title>
7
+ <title>Albibong - Albion Data Tracker</title>
8
8
  <script type="module" crossorigin src="/assets/index-DAndaN_4.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="/assets/index-BFSx0nua.css">
10
10
  </head>
@@ -0,0 +1,4 @@
1
+ scapy==2.5.0
2
+ websockets==12.0
3
+ pywebview==5.1
4
+ playsound==1.3.0