albibong 1.0.3__py3-none-any.whl → 1.0.4__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.
- albibong/__init__.py +10 -4
- albibong/assets/boom_small.mp3 +0 -0
- albibong/classes/character.py +5 -7
- albibong/classes/logger.py +1 -1
- albibong/classes/world_data.py +52 -12
- albibong/gui_dist/Albibong.png +0 -0
- albibong/gui_dist/index.html +3 -3
- albibong/requirements.txt +2 -1
- albibong/resources/EventCode.py +578 -577
- albibong/resources/event_code.json +578 -577
- albibong/resources/items.json +16421 -16051
- albibong/threads/http_server.py +2 -2
- albibong/threads/sniffer_thread.py +1 -0
- {albibong-1.0.3.dist-info → albibong-1.0.4.dist-info}/METADATA +2 -1
- {albibong-1.0.3.dist-info → albibong-1.0.4.dist-info}/RECORD +18 -16
- {albibong-1.0.3.dist-info → albibong-1.0.4.dist-info}/WHEEL +0 -0
- {albibong-1.0.3.dist-info → albibong-1.0.4.dist-info}/entry_points.txt +0 -0
- {albibong-1.0.3.dist-info → albibong-1.0.4.dist-info}/licenses/LICENSE +0 -0
albibong/__init__.py
CHANGED
|
@@ -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
|
-
|
|
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:{
|
|
58
|
+
url=f"http://localhost:{port}/",
|
|
53
59
|
width=1280,
|
|
54
60
|
height=720,
|
|
55
61
|
zoomable=True,
|
|
Binary file
|
albibong/classes/character.py
CHANGED
|
@@ -34,13 +34,11 @@ class Character:
|
|
|
34
34
|
self.loot: list[str] = []
|
|
35
35
|
self.equipment = equipment
|
|
36
36
|
|
|
37
|
-
def
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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:
|
albibong/classes/logger.py
CHANGED
|
@@ -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)
|
albibong/classes/world_data.py
CHANGED
|
@@ -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.
|
|
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
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
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:
|
|
Binary file
|
albibong/gui_dist/index.html
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
<!
|
|
1
|
+
<!DOCTYPE html>
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
|
-
<link rel="icon" type="image/
|
|
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>
|
|
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>
|
albibong/requirements.txt
CHANGED