albibong 1.0.2__tar.gz → 1.0.3__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 (48) hide show
  1. {albibong-1.0.2 → albibong-1.0.3}/PKG-INFO +1 -1
  2. {albibong-1.0.2 → albibong-1.0.3}/pyproject.toml +1 -1
  3. {albibong-1.0.2 → albibong-1.0.3}/src/albibong/classes/world_data.py +57 -31
  4. {albibong-1.0.2 → albibong-1.0.3}/.gitignore +0 -0
  5. {albibong-1.0.2 → albibong-1.0.3}/LICENSE +0 -0
  6. {albibong-1.0.2 → albibong-1.0.3}/src/albibong/__init__.py +0 -0
  7. {albibong-1.0.2 → albibong-1.0.3}/src/albibong/__main__.py +0 -0
  8. {albibong-1.0.2 → albibong-1.0.3}/src/albibong/classes/__init__.py +0 -0
  9. {albibong-1.0.2 → albibong-1.0.3}/src/albibong/classes/character.py +0 -0
  10. {albibong-1.0.2 → albibong-1.0.3}/src/albibong/classes/coords.py +0 -0
  11. {albibong-1.0.2 → albibong-1.0.3}/src/albibong/classes/dungeon.py +0 -0
  12. {albibong-1.0.2 → albibong-1.0.3}/src/albibong/classes/item.py +0 -0
  13. {albibong-1.0.2 → albibong-1.0.3}/src/albibong/classes/location.py +0 -0
  14. {albibong-1.0.2 → albibong-1.0.3}/src/albibong/classes/logger.py +0 -0
  15. {albibong-1.0.2 → albibong-1.0.3}/src/albibong/classes/packet_handler.py +0 -0
  16. {albibong-1.0.2 → albibong-1.0.3}/src/albibong/classes/utils.py +0 -0
  17. {albibong-1.0.2 → albibong-1.0.3}/src/albibong/gui_dist/No Equipment.png +0 -0
  18. {albibong-1.0.2 → albibong-1.0.3}/src/albibong/gui_dist/assets/index-BFSx0nua.css +0 -0
  19. {albibong-1.0.2 → albibong-1.0.3}/src/albibong/gui_dist/assets/index-DAndaN_4.js +0 -0
  20. {albibong-1.0.2 → albibong-1.0.3}/src/albibong/gui_dist/fame.png +0 -0
  21. {albibong-1.0.2 → albibong-1.0.3}/src/albibong/gui_dist/index.html +0 -0
  22. {albibong-1.0.2 → albibong-1.0.3}/src/albibong/gui_dist/re_spec.png +0 -0
  23. {albibong-1.0.2 → albibong-1.0.3}/src/albibong/gui_dist/silver.png +0 -0
  24. {albibong-1.0.2 → albibong-1.0.3}/src/albibong/gui_dist/vite.svg +0 -0
  25. {albibong-1.0.2 → albibong-1.0.3}/src/albibong/photon_packet_parser/__init__.py +0 -0
  26. {albibong-1.0.2 → albibong-1.0.3}/src/albibong/photon_packet_parser/command_type.py +0 -0
  27. {albibong-1.0.2 → albibong-1.0.3}/src/albibong/photon_packet_parser/crc_calculator.py +0 -0
  28. {albibong-1.0.2 → albibong-1.0.3}/src/albibong/photon_packet_parser/event_data.py +0 -0
  29. {albibong-1.0.2 → albibong-1.0.3}/src/albibong/photon_packet_parser/message_type.py +0 -0
  30. {albibong-1.0.2 → albibong-1.0.3}/src/albibong/photon_packet_parser/number_serializer.py +0 -0
  31. {albibong-1.0.2 → albibong-1.0.3}/src/albibong/photon_packet_parser/operation_request.py +0 -0
  32. {albibong-1.0.2 → albibong-1.0.3}/src/albibong/photon_packet_parser/operation_response.py +0 -0
  33. {albibong-1.0.2 → albibong-1.0.3}/src/albibong/photon_packet_parser/photon_packet_parser.py +0 -0
  34. {albibong-1.0.2 → albibong-1.0.3}/src/albibong/photon_packet_parser/protocol16_deserializer.py +0 -0
  35. {albibong-1.0.2 → albibong-1.0.3}/src/albibong/photon_packet_parser/protocol16_type.py +0 -0
  36. {albibong-1.0.2 → albibong-1.0.3}/src/albibong/photon_packet_parser/segmented_packet.py +0 -0
  37. {albibong-1.0.2 → albibong-1.0.3}/src/albibong/requirements.txt +0 -0
  38. {albibong-1.0.2 → albibong-1.0.3}/src/albibong/resources/EventCode.py +0 -0
  39. {albibong-1.0.2 → albibong-1.0.3}/src/albibong/resources/OperationCode.py +0 -0
  40. {albibong-1.0.2 → albibong-1.0.3}/src/albibong/resources/event_code.json +0 -0
  41. {albibong-1.0.2 → albibong-1.0.3}/src/albibong/resources/items.json +0 -0
  42. {albibong-1.0.2 → albibong-1.0.3}/src/albibong/resources/maps.json +0 -0
  43. {albibong-1.0.2 → albibong-1.0.3}/src/albibong/resources/operation_code.json +0 -0
  44. {albibong-1.0.2 → albibong-1.0.3}/src/albibong/threads/__init__.py +0 -0
  45. {albibong-1.0.2 → albibong-1.0.3}/src/albibong/threads/http_server.py +0 -0
  46. {albibong-1.0.2 → albibong-1.0.3}/src/albibong/threads/packet_handler_thread.py +0 -0
  47. {albibong-1.0.2 → albibong-1.0.3}/src/albibong/threads/sniffer_thread.py +0 -0
  48. {albibong-1.0.2 → albibong-1.0.3}/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.2
3
+ Version: 1.0.3
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
@@ -19,7 +19,7 @@ albibong = "albibong:main"
19
19
 
20
20
  [project]
21
21
  name = "albibong"
22
- version = "1.0.2"
22
+ version = "1.0.3"
23
23
  authors = [
24
24
  { name="imjangkar", email="imjangkar@gmail.com" },
25
25
  ]
@@ -43,8 +43,6 @@ class WorldData:
43
43
  self.handle_join_response(parameters)
44
44
  elif parameters[253] == OperationCode.CHANGE_CLUSTER.value:
45
45
  self.set_location(parameters)
46
- # elif parameters[253] == OperationCode.PARTY_LEAVE.value:
47
- # self.party_members = set(self.me.username)
48
46
 
49
47
  def handle_event(self, parameters):
50
48
  if 252 in parameters:
@@ -169,7 +167,7 @@ class WorldData:
169
167
  if parameters[252] == EventCode.PARTY_JOINED.value:
170
168
  self.party_members = set(parameters[5])
171
169
  elif parameters[252] == EventCode.PARTY_DISBANDED.value:
172
- self.party_members = set()
170
+ self.party_members = {self.me.username}
173
171
  elif parameters[252] == EventCode.PARTY_PLAYER_JOINED.value:
174
172
  self.party_members.add(parameters[2])
175
173
  elif parameters[252] == EventCode.PARTY_PLAYER_LEFT.value:
@@ -177,9 +175,7 @@ class WorldData:
177
175
  if uuid in self.char_uuid_to_username:
178
176
  name = self.char_uuid_to_username[uuid]
179
177
  if name == self.me.username:
180
- self.party_members = set()
181
- if self.me.id != None:
182
- self.party_members.add(self.me.username)
178
+ self.party_members = {self.me.username}
183
179
  event = {
184
180
  "type": "update_dps",
185
181
  "payload": {"party_members": self.serialize_party_members()},
@@ -217,18 +213,21 @@ class WorldData:
217
213
 
218
214
  def handle_join_response(self, parameters):
219
215
  # set my character
220
-
221
216
  self.convert_id_to_name(old_id=self.me.id, new_id=parameters[0], char=self.me)
222
-
223
217
  self.me.uuid = Utils.convert_int_arr_to_uuid(parameters[1])
224
218
  self.me.username = parameters[2]
225
219
  self.me.guild = parameters[57] if 57 in parameters else ""
226
220
  self.me.alliance = parameters[77] if 77 in parameters else ""
227
- self.characters[self.me.username] = self.me
228
- self.char_uuid_to_username[self.me.uuid] = self.me.username
229
221
  if self.me.id in self.change_equipment_log:
230
222
  self.me.update_equipment(self.change_equipment_log[self.me.id])
231
223
 
224
+ # put self in characters list
225
+ self.characters[self.me.username] = self.me
226
+ self.char_uuid_to_username[self.me.uuid] = self.me.username
227
+
228
+ # put self in party
229
+ self.party_members.add(self.me.username)
230
+
232
231
  # set map my character is currently in
233
232
  if parameters[8][0] == "@":
234
233
  area = parameters[8].split("@")
@@ -257,8 +256,13 @@ class WorldData:
257
256
  ),
258
257
  },
259
258
  }
259
+ event_party = {
260
+ "type": "update_dps",
261
+ "payload": {"party_members": self.serialize_party_members()},
262
+ }
260
263
  send_event(event_map)
261
264
  send_event(event_char)
265
+ send_event(event_party)
262
266
 
263
267
  def convert_id_to_name(self, old_id, new_id, char: Character):
264
268
  if old_id in self.char_id_to_username:
@@ -304,32 +308,54 @@ class WorldData:
304
308
 
305
309
  total_damage = 0
306
310
  total_heal = 0
311
+
312
+ # get total damage and heal for percentage
307
313
  for key, value in self.characters.items():
308
314
  if key in self.party_members:
309
315
  total_damage += value.damage_dealt
310
316
  total_heal += value.healing_dealt
311
317
 
312
- for key, value in self.characters.items():
313
- if key in self.party_members:
314
- if value.equipment != []:
315
- weapon = Item.serialize(value.equipment[0])["image"]
316
- data = {
317
- "username": value.username,
318
- "damage_dealt": value.damage_dealt,
319
- "damage_percent": (
320
- round(value.damage_dealt / total_damage * 100, 2)
321
- if total_damage > 0
322
- else 0
323
- ),
324
- "healing_dealt": value.healing_dealt,
325
- "heal_percent": (
326
- round(value.healing_dealt / total_heal * 100, 2)
327
- if total_heal > 0
328
- else 0
329
- ),
330
- "weapon": weapon,
331
- }
332
- serialized.append(data)
318
+ for member in self.party_members:
319
+ # member character initialized
320
+ if member in self.characters:
321
+ char = self.characters[member]
322
+ username = char.username
323
+ damage_dealt = char.damage_dealt
324
+ damage_percent = (
325
+ round(char.damage_dealt / total_damage * 100, 2)
326
+ if total_damage > 0
327
+ else 0
328
+ )
329
+ healing_dealt = char.healing_dealt
330
+ heal_percent = (
331
+ round(char.healing_dealt / total_heal * 100, 2)
332
+ if total_heal > 0
333
+ else 0
334
+ )
335
+ weapon = (
336
+ Item.serialize(char.equipment[0])["image"]
337
+ if char.equipment != []
338
+ else "../public/No Equipment.png"
339
+ )
340
+
341
+ # member character not initialized
342
+ else:
343
+ username = member
344
+ damage_dealt = 0
345
+ damage_percent = 0
346
+ healing_dealt = 0
347
+ heal_percent = 0
348
+ weapon = "../public/No Equipment.png"
349
+
350
+ data = {
351
+ "username": username,
352
+ "damage_dealt": damage_dealt,
353
+ "damage_percent": damage_percent,
354
+ "healing_dealt": healing_dealt,
355
+ "heal_percent": heal_percent,
356
+ "weapon": weapon,
357
+ }
358
+ serialized.append(data)
333
359
  serialized.sort(key=lambda x: x["damage_dealt"], reverse=True)
334
360
  return serialized
335
361
 
File without changes
File without changes