rustplus 6.0.3__tar.gz → 6.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 (113) hide show
  1. {rustplus-6.0.3/rustplus.egg-info → rustplus-6.0.4}/PKG-INFO +11 -2
  2. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/__init__.py +2 -2
  3. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/rust_api.py +10 -10
  4. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/structs/rust_error.py +14 -0
  5. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/utils/__init__.py +1 -0
  6. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/utils/utils.py +9 -0
  7. {rustplus-6.0.3 → rustplus-6.0.4/rustplus.egg-info}/PKG-INFO +11 -2
  8. {rustplus-6.0.3 → rustplus-6.0.4}/LICENSE +0 -0
  9. {rustplus-6.0.3 → rustplus-6.0.4}/MANIFEST.in +0 -0
  10. {rustplus-6.0.3 → rustplus-6.0.4}/README.md +0 -0
  11. {rustplus-6.0.3 → rustplus-6.0.4}/requirements.txt +0 -0
  12. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/annotations/__init__.py +0 -0
  13. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/annotations/chat_event.py +0 -0
  14. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/annotations/command.py +0 -0
  15. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/annotations/entity_event.py +0 -0
  16. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/annotations/protobuf_event.py +0 -0
  17. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/annotations/team_event.py +0 -0
  18. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/commands/__init__.py +0 -0
  19. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/commands/chat_command.py +0 -0
  20. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/commands/chat_command_data.py +0 -0
  21. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/commands/command_options.py +0 -0
  22. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/events/__init__.py +0 -0
  23. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/events/chat_event.py +0 -0
  24. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/events/entity_event.py +0 -0
  25. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/events/protobuf_event.py +0 -0
  26. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/events/team_event.py +0 -0
  27. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/exceptions/__init__.py +0 -0
  28. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/exceptions/exceptions.py +0 -0
  29. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/icons/__init__.py +0 -0
  30. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/icons/airfield.png +0 -0
  31. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/icons/arctic_base.png +0 -0
  32. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/icons/bandit.png +0 -0
  33. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/icons/barn.png +0 -0
  34. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/icons/cargo.png +0 -0
  35. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/icons/chinook.png +0 -0
  36. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/icons/chinook_blades.png +0 -0
  37. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/icons/crate.png +0 -0
  38. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/icons/desert_base.png +0 -0
  39. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/icons/dome.png +0 -0
  40. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/icons/excavator.png +0 -0
  41. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/icons/explosion.png +0 -0
  42. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/icons/ferryterminal.png +0 -0
  43. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/icons/fishing.png +0 -0
  44. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/icons/harbour.png +0 -0
  45. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/icons/icon.png +0 -0
  46. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/icons/junkyard.png +0 -0
  47. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/icons/large_oil_rig.png +0 -0
  48. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/icons/launchsite.png +0 -0
  49. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/icons/lighthouse.png +0 -0
  50. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/icons/military_tunnels.png +0 -0
  51. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/icons/mining_outpost.png +0 -0
  52. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/icons/mining_quarry_hqm.png +0 -0
  53. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/icons/mining_quarry_stone.png +0 -0
  54. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/icons/mining_quarry_sulfur.png +0 -0
  55. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/icons/missile_silo.png +0 -0
  56. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/icons/outpost.png +0 -0
  57. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/icons/oxums.png +0 -0
  58. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/icons/patrol.png +0 -0
  59. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/icons/power_plant.png +0 -0
  60. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/icons/satellite.png +0 -0
  61. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/icons/sewer.png +0 -0
  62. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/icons/small_oil_rig.png +0 -0
  63. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/icons/stables.png +0 -0
  64. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/icons/supermarket.png +0 -0
  65. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/icons/swamp.png +0 -0
  66. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/icons/train.png +0 -0
  67. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/icons/train_yard.png +0 -0
  68. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/icons/underwater_lab.png +0 -0
  69. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/icons/vending_machine.png +0 -0
  70. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/icons/water_treatment.png +0 -0
  71. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/identification/__init__.py +0 -0
  72. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/identification/handler_list.py +0 -0
  73. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/identification/registered_listener.py +0 -0
  74. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/identification/server_details.py +0 -0
  75. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/remote/__init__.py +0 -0
  76. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/remote/camera/__init__.py +0 -0
  77. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/remote/camera/camera_constants.py +0 -0
  78. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/remote/camera/camera_manager.py +0 -0
  79. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/remote/camera/camera_parser.py +0 -0
  80. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/remote/camera/structures.py +0 -0
  81. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/remote/fcm/__init__.py +0 -0
  82. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/remote/fcm/fcm_listener.py +0 -0
  83. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/remote/proxy/__init__.py +0 -0
  84. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/remote/proxy/proxy_value_grabber.py +0 -0
  85. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/remote/ratelimiter/__init__.py +0 -0
  86. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/remote/rustplus_proto/__init__.py +0 -0
  87. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/remote/rustplus_proto/rustplus.py +0 -0
  88. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/remote/websocket/__init__.py +0 -0
  89. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/remote/websocket/ws.py +0 -0
  90. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/structs/__init__.py +0 -0
  91. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/structs/rust_chat_message.py +0 -0
  92. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/structs/rust_contents.py +0 -0
  93. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/structs/rust_entity_info.py +0 -0
  94. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/structs/rust_info.py +0 -0
  95. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/structs/rust_item.py +0 -0
  96. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/structs/rust_map.py +0 -0
  97. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/structs/rust_marker.py +0 -0
  98. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/structs/rust_team_info.py +0 -0
  99. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/structs/rust_time.py +0 -0
  100. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/structs/serialization.py +0 -0
  101. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/structs/util.py +0 -0
  102. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/utils/deprecated.py +0 -0
  103. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/utils/emojis.py +0 -0
  104. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/utils/fonts/PermanentMarker.ttf +0 -0
  105. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/utils/fonts/__init__.py +0 -0
  106. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/utils/grab_items.py +0 -0
  107. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus/utils/yielding_event.py +0 -0
  108. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus.egg-info/SOURCES.txt +0 -0
  109. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus.egg-info/dependency_links.txt +0 -0
  110. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus.egg-info/requires.txt +0 -0
  111. {rustplus-6.0.3 → rustplus-6.0.4}/rustplus.egg-info/top_level.txt +0 -0
  112. {rustplus-6.0.3 → rustplus-6.0.4}/setup.cfg +0 -0
  113. {rustplus-6.0.3 → rustplus-6.0.4}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: rustplus
3
- Version: 6.0.3
3
+ Version: 6.0.4
4
4
  Summary: A python wrapper for the Rust Plus API
5
5
  Home-page: https://github.com/olijeffers0n/rustplus
6
6
  Author: olijeffers0n
@@ -18,6 +18,15 @@ Requires-Dist: requests
18
18
  Requires-Dist: numpy
19
19
  Requires-Dist: scipy
20
20
  Requires-Dist: betterproto==2.0.0b6
21
+ Dynamic: author
22
+ Dynamic: description
23
+ Dynamic: description-content-type
24
+ Dynamic: home-page
25
+ Dynamic: license
26
+ Dynamic: project-url
27
+ Dynamic: requires-dist
28
+ Dynamic: requires-python
29
+ Dynamic: summary
21
30
 
22
31
  ![Rust+.py](https://raw.githubusercontent.com/olijeffers0n/rustplus/master/icon.png)
23
32
  <div align = "center">
@@ -8,10 +8,10 @@ from .annotations import Command, ChatEvent, ProtobufEvent, TeamEvent, EntityEve
8
8
  from .remote.fcm import FCMListener
9
9
  from .commands import CommandOptions, ChatCommand
10
10
  from .events import ChatEventPayload, TeamEventPayload, EntityEventPayload
11
- from .utils import convert_event_type_to_name, Emoji
11
+ from .utils import convert_event_type_to_name, Emoji, convert_coordinates
12
12
  from .structs import RustError, RustMarker
13
13
 
14
14
  __name__ = "rustplus"
15
15
  __author__ = "olijeffers0n"
16
- __version__ = "6.0.3"
16
+ __version__ = "6.0.4"
17
17
  __support__ = "Discord: https://discord.gg/nQqJe8qvP8"
@@ -147,7 +147,7 @@ class RustSocket:
147
147
  response = await self.ws.send_and_get(packet)
148
148
 
149
149
  if response is None:
150
- return RustError("get_time", "misc")
150
+ return RustError("get_time", "No response received")
151
151
 
152
152
  if error_present(response):
153
153
  return RustError("get_time", response.response.error.error)
@@ -185,7 +185,7 @@ class RustSocket:
185
185
  response = await self.ws.send_and_get(packet)
186
186
 
187
187
  if response is None:
188
- return RustError("get_info", "misc")
188
+ return RustError("get_info", "No response received")
189
189
 
190
190
  if error_present(response):
191
191
  return RustError("get_info", response.response.error.error)
@@ -203,7 +203,7 @@ class RustSocket:
203
203
  response = await self.ws.send_and_get(packet)
204
204
 
205
205
  if response is None:
206
- return RustError("get_team_chat", "misc")
206
+ return RustError("get_team_chat", "No response received")
207
207
 
208
208
  if error_present(response):
209
209
  return RustError("get_team_chat", response.response.error.error)
@@ -223,7 +223,7 @@ class RustSocket:
223
223
  response = await self.ws.send_and_get(packet)
224
224
 
225
225
  if response is None:
226
- return RustError("get_team_info", "misc")
226
+ return RustError("get_team_info", "No response received")
227
227
 
228
228
  if error_present(response):
229
229
  return RustError("get_team_info", response.response.error.error)
@@ -241,7 +241,7 @@ class RustSocket:
241
241
  response = await self.ws.send_and_get(packet)
242
242
 
243
243
  if response is None:
244
- return RustError("get_markers", "misc")
244
+ return RustError("get_markers", "No response received")
245
245
 
246
246
  if error_present(response):
247
247
  return RustError("get_markers", response.response.error.error)
@@ -283,7 +283,7 @@ class RustSocket:
283
283
  response = await self.ws.send_and_get(packet)
284
284
 
285
285
  if response is None:
286
- return RustError("get_map", "misc")
286
+ return RustError("get_map", "No response received")
287
287
 
288
288
  if error_present(response):
289
289
  return RustError("get_map", response.response.error.error)
@@ -381,7 +381,7 @@ class RustSocket:
381
381
  response = await self.ws.send_and_get(packet)
382
382
 
383
383
  if response is None:
384
- return RustError("get_map_info", "misc")
384
+ return RustError("get_map_info", "No response received")
385
385
 
386
386
  if error_present(response):
387
387
  return RustError("get_map_info", response.response.error.error)
@@ -403,7 +403,7 @@ class RustSocket:
403
403
  response = await self.ws.send_and_get(packet)
404
404
 
405
405
  if response is None:
406
- return RustError("get_entity_info", "misc")
406
+ return RustError("get_entity_info", "No response received")
407
407
 
408
408
  if error_present(response):
409
409
  return RustError("get_entity_info", response.response.error.error)
@@ -455,7 +455,7 @@ class RustSocket:
455
455
  response = await self.ws.send_and_get(packet)
456
456
 
457
457
  if response is None:
458
- return RustError("check_subscription_to_entity", "misc")
458
+ return RustError("check_subscription_to_entity", "No response received")
459
459
 
460
460
  if error_present(response):
461
461
  return RustError(
@@ -552,7 +552,7 @@ class RustSocket:
552
552
  response = await self.ws.send_and_get(packet)
553
553
 
554
554
  if response is None:
555
- return RustError("get_camera_manager", "misc")
555
+ return RustError("get_camera_manager", "No response received")
556
556
 
557
557
  if error_present(response):
558
558
  return RustError("get_camera_manager", response.response.error.error)
@@ -1,8 +1,13 @@
1
+ import logging
2
+ from typing import Any
3
+
1
4
  from .serialization import Serializable
2
5
 
3
6
 
4
7
  class RustError(Serializable):
5
8
 
9
+ LOGGER = logging.getLogger("rustplus.py")
10
+
6
11
  def __init__(self, method: str, reason: str) -> None:
7
12
  self._method = method
8
13
  self._reason = reason
@@ -17,3 +22,12 @@ class RustError(Serializable):
17
22
 
18
23
  def __str__(self) -> str:
19
24
  return f"Error Propagating from {self._method}: {self._reason}"
25
+
26
+ def __getattr__(self, attr_name: str) -> Any:
27
+ if attr_name in self.__dict__:
28
+ return self.__dict__[attr_name]
29
+
30
+ # This means we are gonna chuck the error in the user's face
31
+ self.LOGGER.error(
32
+ f"An Unhandled Error has occurred over the {self._method} method, reason: {self.reason}"
33
+ )
@@ -7,6 +7,7 @@ from .utils import (
7
7
  convert_marker,
8
8
  convert_monument,
9
9
  convert_event_type_to_name,
10
+ convert_coordinates
10
11
  )
11
12
  from .grab_items import translate_stack_to_id, translate_id_to_stack
12
13
  from .yielding_event import YieldingEvent
@@ -81,6 +81,15 @@ def generate_grid(
81
81
  return img
82
82
 
83
83
 
84
+ def convert_coordinates(coords: Tuple[int, int], map_size: int) -> Tuple[str, int]:
85
+ grids = list(string.ascii_uppercase)
86
+ grids.extend(
87
+ a + b for a in string.ascii_uppercase for b in string.ascii_uppercase
88
+ )
89
+
90
+ return grids[int(coords[0] // GRID_DIAMETER)], int((map_size - coords[1]) // GRID_DIAMETER)
91
+
92
+
84
93
  def format_coord(x: int, y: int, map_size: int) -> Tuple[int, int]:
85
94
  # Adjust y and x coordinates with offsets
86
95
  y = max(0, min(map_size - y - 75, map_size - 150))
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: rustplus
3
- Version: 6.0.3
3
+ Version: 6.0.4
4
4
  Summary: A python wrapper for the Rust Plus API
5
5
  Home-page: https://github.com/olijeffers0n/rustplus
6
6
  Author: olijeffers0n
@@ -18,6 +18,15 @@ Requires-Dist: requests
18
18
  Requires-Dist: numpy
19
19
  Requires-Dist: scipy
20
20
  Requires-Dist: betterproto==2.0.0b6
21
+ Dynamic: author
22
+ Dynamic: description
23
+ Dynamic: description-content-type
24
+ Dynamic: home-page
25
+ Dynamic: license
26
+ Dynamic: project-url
27
+ Dynamic: requires-dist
28
+ Dynamic: requires-python
29
+ Dynamic: summary
21
30
 
22
31
  ![Rust+.py](https://raw.githubusercontent.com/olijeffers0n/rustplus/master/icon.png)
23
32
  <div align = "center">
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes