rustplus 5.6.10__tar.gz → 5.6.13__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.
- {rustplus-5.6.10 → rustplus-5.6.13}/PKG-INFO +16 -1
- rustplus-5.6.10/rustplus.egg-info/PKG-INFO → rustplus-5.6.13/README.md +6 -12
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/__init__.py +1 -1
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/base_rust_api.py +11 -4
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/remote/rust_remote_interface.py +11 -1
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/remote/rustplus_proto/rustplus.py +3 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/remote/rustws.py +24 -5
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/structures/rust_chat_message.py +2 -1
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/structures/rust_contents.py +2 -2
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/structures/rust_entity_info.py +3 -3
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/structures/rust_info.py +2 -1
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/structures/rust_item.py +2 -1
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/structures/rust_map.py +3 -3
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/structures/rust_marker.py +4 -4
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/structures/rust_team_info.py +22 -5
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/structures/rust_time.py +4 -1
- rustplus-5.6.13/rustplus/api/structures/serialization.py +17 -0
- rustplus-5.6.10/README.md → rustplus-5.6.13/rustplus.egg-info/PKG-INFO +27 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus.egg-info/SOURCES.txt +1 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/LICENSE +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/MANIFEST.in +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/__init__.py +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/icons/__init__.py +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/icons/airfield.png +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/icons/arctic_base.png +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/icons/bandit.png +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/icons/barn.png +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/icons/cargo.png +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/icons/chinook.png +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/icons/chinook_blades.png +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/icons/crate.png +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/icons/desert_base.png +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/icons/dome.png +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/icons/excavator.png +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/icons/explosion.png +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/icons/fishing.png +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/icons/harbour.png +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/icons/icon.png +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/icons/junkyard.png +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/icons/large_oil_rig.png +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/icons/launchsite.png +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/icons/lighthouse.png +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/icons/military_tunnels.png +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/icons/mining_outpost.png +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/icons/outpost.png +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/icons/oxums.png +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/icons/patrol.png +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/icons/power_plant.png +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/icons/quarry.png +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/icons/satellite.png +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/icons/sewer.png +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/icons/small_oil_rig.png +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/icons/stable.png +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/icons/supermarket.png +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/icons/swamp.png +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/icons/train.png +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/icons/train_yard.png +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/icons/underwater_lab.png +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/icons/vending_machine.png +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/icons/water_treatment.png +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/remote/__init__.py +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/remote/camera/__init__.py +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/remote/camera/camera_constants.py +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/remote/camera/camera_manager.py +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/remote/camera/camera_parser.py +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/remote/camera/structures.py +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/remote/events/__init__.py +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/remote/events/event_handler.py +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/remote/events/event_loop_manager.py +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/remote/events/events.py +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/remote/events/handler_list.py +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/remote/events/map_event_listener.py +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/remote/events/registered_listener.py +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/remote/fcm_listener.py +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/remote/heartbeat.py +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/remote/ratelimiter.py +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/remote/rplus_version_handler.py +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/remote/rustplus_proto/__init__.py +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/remote/server_checker.py +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/rust_api.py +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/structures/__init__.py +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/api/structures/util.py +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/commands/__init__.py +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/commands/command.py +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/commands/command_data.py +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/commands/command_handler.py +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/commands/command_options.py +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/conversation/__init__.py +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/conversation/conversation.py +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/conversation/conversation_factory.py +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/conversation/conversation_prompt.py +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/exceptions/__init__.py +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/exceptions/exceptions.py +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/utils/__init__.py +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/utils/deprecated.py +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/utils/emojis.py +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/utils/fonts/PermanentMarker.ttf +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/utils/fonts/__init__.py +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/utils/grab_items.py +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/utils/rust_utils.py +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/utils/server_id.py +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus/utils/yielding_event.py +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus.egg-info/dependency_links.txt +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus.egg-info/requires.txt +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/rustplus.egg-info/top_level.txt +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/setup.cfg +0 -0
- {rustplus-5.6.10 → rustplus-5.6.13}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: rustplus
|
|
3
|
-
Version: 5.6.
|
|
3
|
+
Version: 5.6.13
|
|
4
4
|
Summary: A python wrapper for the Rust Plus API
|
|
5
5
|
Home-page: https://github.com/olijeffers0n/rustplus
|
|
6
6
|
Author: olijeffers0n
|
|
@@ -9,6 +9,15 @@ Project-URL: Issue tracker, https://github.com/olijeffers0n/rustplus/issues
|
|
|
9
9
|
Requires-Python: >=3.8.0
|
|
10
10
|
Description-Content-Type: text/markdown
|
|
11
11
|
License-File: LICENSE
|
|
12
|
+
Requires-Dist: websockets
|
|
13
|
+
Requires-Dist: Pillow
|
|
14
|
+
Requires-Dist: asyncio
|
|
15
|
+
Requires-Dist: rustPlusPushReceiver==0.4.1
|
|
16
|
+
Requires-Dist: http-ece
|
|
17
|
+
Requires-Dist: requests
|
|
18
|
+
Requires-Dist: numpy
|
|
19
|
+
Requires-Dist: scipy
|
|
20
|
+
Requires-Dist: betterproto==2.0.0b6
|
|
12
21
|
|
|
13
22
|

|
|
14
23
|
<div align = "center">
|
|
@@ -59,3 +68,9 @@ You can also join me on my discord server:
|
|
|
59
68
|
GitHub ⭐'s are always welcome :)
|
|
60
69
|
|
|
61
70
|
Have Fun!
|
|
71
|
+
|
|
72
|
+
## Special Thanks:
|
|
73
|
+
Thanks to [JetBrains](https://www.jetbrains.com/?from=rustplus) for providing me with a free Open Source License for
|
|
74
|
+
PyCharm Professional, which is what I use to develop this project.
|
|
75
|
+
|
|
76
|
+
<a href="https://jb.gg/OpenSourceSupport"><img src="https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.svg" width="150"></a>
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: rustplus
|
|
3
|
-
Version: 5.6.10
|
|
4
|
-
Summary: A python wrapper for the Rust Plus API
|
|
5
|
-
Home-page: https://github.com/olijeffers0n/rustplus
|
|
6
|
-
Author: olijeffers0n
|
|
7
|
-
License: MIT
|
|
8
|
-
Project-URL: Issue tracker, https://github.com/olijeffers0n/rustplus/issues
|
|
9
|
-
Requires-Python: >=3.8.0
|
|
10
|
-
Description-Content-Type: text/markdown
|
|
11
|
-
License-File: LICENSE
|
|
12
|
-
|
|
13
1
|

|
|
14
2
|
<div align = "center">
|
|
15
3
|
<img src = "https://static.pepy.tech/personalized-badge/rustplus?period=total&units=international_system&left_color=black&right_color=orange&left_text=Downloads">
|
|
@@ -59,3 +47,9 @@ You can also join me on my discord server:
|
|
|
59
47
|
GitHub ⭐'s are always welcome :)
|
|
60
48
|
|
|
61
49
|
Have Fun!
|
|
50
|
+
|
|
51
|
+
## Special Thanks:
|
|
52
|
+
Thanks to [JetBrains](https://www.jetbrains.com/?from=rustplus) for providing me with a free Open Source License for
|
|
53
|
+
PyCharm Professional, which is what I use to develop this project.
|
|
54
|
+
|
|
55
|
+
<a href="https://jb.gg/OpenSourceSupport"><img src="https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.svg" width="150"></a>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import asyncio
|
|
2
|
-
from typing import List, Callable,
|
|
2
|
+
from typing import List, Union, Coroutine, Callable, Dict, Tuple
|
|
3
3
|
from PIL import Image
|
|
4
4
|
|
|
5
5
|
from .remote.events.event_loop_manager import EventLoopManager
|
|
@@ -113,8 +113,10 @@ class BaseRustSocket:
|
|
|
113
113
|
self,
|
|
114
114
|
retries: int = float("inf"),
|
|
115
115
|
delay: int = 20,
|
|
116
|
-
on_failure=None,
|
|
117
|
-
on_success=None,
|
|
116
|
+
on_failure: Union[Coroutine, Callable[[], None], None] = None,
|
|
117
|
+
on_success: Union[Coroutine, Callable[[], None], None] = None,
|
|
118
|
+
on_success_args_kwargs: Tuple[List, Dict] = ([], {}),
|
|
119
|
+
on_failure_args_kwargs: Tuple[List, Dict] = ([], {}),
|
|
118
120
|
) -> None:
|
|
119
121
|
"""
|
|
120
122
|
Attempts to open a connection to the rust game server specified in the constructor
|
|
@@ -123,7 +125,10 @@ class BaseRustSocket:
|
|
|
123
125
|
:param delay: The delay (in seconds) between reconnection attempts.
|
|
124
126
|
:param on_failure: Optional function to be called when connecting fails.
|
|
125
127
|
:param on_success: Optional function to be called when connecting succeeds.
|
|
126
|
-
|
|
128
|
+
:param on_success_args_kwargs: Optional tuple holding keyword and regular arguments
|
|
129
|
+
for on_success in this format (args, kwargs)
|
|
130
|
+
:param on_failure_args_kwargs: Optional tuple holding keyword and regular arguments
|
|
131
|
+
for on_failure in this format (args, kwargs)
|
|
127
132
|
|
|
128
133
|
:return: None
|
|
129
134
|
"""
|
|
@@ -151,6 +156,8 @@ class BaseRustSocket:
|
|
|
151
156
|
delay=delay,
|
|
152
157
|
on_failure=on_failure,
|
|
153
158
|
on_success=on_success,
|
|
159
|
+
on_success_args_kwargs=on_success_args_kwargs,
|
|
160
|
+
on_failure_args_kwargs=on_failure_args_kwargs,
|
|
154
161
|
)
|
|
155
162
|
await self.heartbeat.start_beat()
|
|
156
163
|
except ConnectionRefusedError:
|
|
@@ -66,7 +66,15 @@ class RustRemote:
|
|
|
66
66
|
self.pending_entity_subscriptions = []
|
|
67
67
|
self.camera_manager: Union[CameraManager, None] = None
|
|
68
68
|
|
|
69
|
-
async def connect(
|
|
69
|
+
async def connect(
|
|
70
|
+
self,
|
|
71
|
+
retries,
|
|
72
|
+
delay,
|
|
73
|
+
on_failure,
|
|
74
|
+
on_success,
|
|
75
|
+
on_success_args_kwargs,
|
|
76
|
+
on_failure_args_kwargs,
|
|
77
|
+
) -> None:
|
|
70
78
|
self.ws = RustWebsocket(
|
|
71
79
|
server_id=self.server_id,
|
|
72
80
|
remote=self,
|
|
@@ -76,6 +84,8 @@ class RustRemote:
|
|
|
76
84
|
on_failure=on_failure,
|
|
77
85
|
on_success=on_success,
|
|
78
86
|
delay=delay,
|
|
87
|
+
on_success_args_kwargs=on_success_args_kwargs,
|
|
88
|
+
on_failure_args_kwargs=on_failure_args_kwargs,
|
|
79
89
|
)
|
|
80
90
|
await self.ws.connect(retries=retries)
|
|
81
91
|
|
|
@@ -352,6 +352,9 @@ class AppTeamInfoNote(betterproto.Message):
|
|
|
352
352
|
type: int = betterproto.int32_field(2)
|
|
353
353
|
x: float = betterproto.float_field(3)
|
|
354
354
|
y: float = betterproto.float_field(4)
|
|
355
|
+
icon: int = betterproto.int32_field(5)
|
|
356
|
+
colour_index: int = betterproto.int32_field(6)
|
|
357
|
+
label: str = betterproto.string_field(7)
|
|
355
358
|
|
|
356
359
|
|
|
357
360
|
@dataclass
|
|
@@ -34,6 +34,8 @@ class RustWebsocket:
|
|
|
34
34
|
on_failure,
|
|
35
35
|
on_success,
|
|
36
36
|
delay,
|
|
37
|
+
on_success_args_kwargs,
|
|
38
|
+
on_failure_args_kwargs,
|
|
37
39
|
):
|
|
38
40
|
self.connection: Union[WebSocketClientProtocol, None] = None
|
|
39
41
|
self.task: Union[Task, None] = None
|
|
@@ -49,6 +51,8 @@ class RustWebsocket:
|
|
|
49
51
|
self.on_failure = on_failure
|
|
50
52
|
self.on_success = on_success
|
|
51
53
|
self.delay = delay
|
|
54
|
+
self.on_success_args_kwargs = on_success_args_kwargs
|
|
55
|
+
self.on_failure_args_kwargs = on_failure_args_kwargs
|
|
52
56
|
|
|
53
57
|
async def connect(
|
|
54
58
|
self, retries=float("inf"), ignore_open_value: bool = False
|
|
@@ -80,16 +84,25 @@ class RustWebsocket:
|
|
|
80
84
|
)
|
|
81
85
|
address += f"?v={str(self.magic_value)}"
|
|
82
86
|
self.connection = await connect(
|
|
83
|
-
address,
|
|
87
|
+
address,
|
|
88
|
+
close_timeout=0,
|
|
89
|
+
ping_interval=None,
|
|
90
|
+
max_size=1_000_000_000,
|
|
84
91
|
)
|
|
85
92
|
self.connected_time = time.time()
|
|
86
93
|
|
|
87
94
|
if self.on_success is not None:
|
|
88
95
|
try:
|
|
89
96
|
if asyncio.iscoroutinefunction(self.on_success):
|
|
90
|
-
await self.on_success(
|
|
97
|
+
await self.on_success(
|
|
98
|
+
*self.on_success_args_kwargs[0],
|
|
99
|
+
**self.on_success_args_kwargs[1],
|
|
100
|
+
)
|
|
91
101
|
else:
|
|
92
|
-
self.on_success(
|
|
102
|
+
self.on_success(
|
|
103
|
+
*self.on_success_args_kwargs[0],
|
|
104
|
+
**self.on_success_args_kwargs[1],
|
|
105
|
+
)
|
|
93
106
|
except Exception as e:
|
|
94
107
|
self.logger.warning(e)
|
|
95
108
|
break
|
|
@@ -102,9 +115,15 @@ class RustWebsocket:
|
|
|
102
115
|
if self.on_failure is not None:
|
|
103
116
|
try:
|
|
104
117
|
if asyncio.iscoroutinefunction(self.on_failure):
|
|
105
|
-
val = await self.on_failure(
|
|
118
|
+
val = await self.on_failure(
|
|
119
|
+
*self.on_failure_args_kwargs[0],
|
|
120
|
+
**self.on_failure_args_kwargs[1],
|
|
121
|
+
)
|
|
106
122
|
else:
|
|
107
|
-
val = self.on_failure(
|
|
123
|
+
val = self.on_failure(
|
|
124
|
+
*self.on_failure_args_kwargs[0],
|
|
125
|
+
**self.on_failure_args_kwargs[1],
|
|
126
|
+
)
|
|
108
127
|
|
|
109
128
|
if val is not None:
|
|
110
129
|
print_error = val
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
from ..remote.rustplus_proto import AppTeamMessage
|
|
2
|
+
from .serialization import Serializable
|
|
2
3
|
|
|
3
4
|
|
|
4
|
-
class RustChatMessage:
|
|
5
|
+
class RustChatMessage(Serializable):
|
|
5
6
|
def __init__(self, data: AppTeamMessage):
|
|
6
7
|
self._steam_id: int = data.steam_id
|
|
7
8
|
self._name: str = data.name
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
from datetime import timedelta
|
|
2
2
|
from typing import List
|
|
3
|
-
|
|
3
|
+
from .serialization import Serializable
|
|
4
4
|
from .rust_item import RustItem
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
class RustContents:
|
|
7
|
+
class RustContents(Serializable):
|
|
8
8
|
def __init__(self, protection_time, has_protection, contents) -> None:
|
|
9
9
|
self._protection_time: timedelta = protection_time
|
|
10
10
|
self._has_protection: bool = has_protection
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
from typing import List
|
|
2
|
-
|
|
2
|
+
from .serialization import Serializable
|
|
3
3
|
from ..remote import AppEntityInfo, AppEntityPayloadItem
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
class RustEntityInfoItem:
|
|
6
|
+
class RustEntityInfoItem(Serializable):
|
|
7
7
|
def __init__(self, data: AppEntityPayloadItem) -> None:
|
|
8
8
|
self._item_id: int = data.item_id
|
|
9
9
|
self._quantity: int = data.quantity
|
|
@@ -29,7 +29,7 @@ class RustEntityInfoItem:
|
|
|
29
29
|
)
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
class RustEntityInfo:
|
|
32
|
+
class RustEntityInfo(Serializable):
|
|
33
33
|
def __init__(self, data: AppEntityInfo) -> None:
|
|
34
34
|
self._type: int = data.type
|
|
35
35
|
self._value: bool = data.payload.value
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
from typing import List
|
|
2
|
-
|
|
2
|
+
from .serialization import Serializable
|
|
3
3
|
from ..remote.rustplus_proto import AppMap
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
class RustMonument:
|
|
6
|
+
class RustMonument(Serializable):
|
|
7
7
|
def __init__(self, token, x, y) -> None:
|
|
8
8
|
self._token: str = token
|
|
9
9
|
self._x: float = x
|
|
@@ -27,7 +27,7 @@ class RustMonument:
|
|
|
27
27
|
)
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
class RustMap:
|
|
30
|
+
class RustMap(Serializable):
|
|
31
31
|
def __init__(self, data: AppMap) -> None:
|
|
32
32
|
self._width: int = data.width
|
|
33
33
|
self._height: int = data.height
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
from typing import List
|
|
2
|
-
|
|
2
|
+
from .serialization import Serializable
|
|
3
3
|
from ..remote.rustplus_proto import Vector4, AppMarkerSellOrder, AppMarker
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
class RustColour:
|
|
6
|
+
class RustColour(Serializable):
|
|
7
7
|
def __init__(self, data: Vector4) -> None:
|
|
8
8
|
self._x: float = data.x
|
|
9
9
|
self._y: float = data.y
|
|
@@ -32,7 +32,7 @@ class RustColour:
|
|
|
32
32
|
)
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
class RustSellOrder:
|
|
35
|
+
class RustSellOrder(Serializable):
|
|
36
36
|
def __init__(self, data: AppMarkerSellOrder) -> None:
|
|
37
37
|
self._item_id: int = data.item_id
|
|
38
38
|
self._quantity: int = data.quantity
|
|
@@ -84,7 +84,7 @@ class RustSellOrder:
|
|
|
84
84
|
)
|
|
85
85
|
|
|
86
86
|
|
|
87
|
-
class RustMarker:
|
|
87
|
+
class RustMarker(Serializable):
|
|
88
88
|
PlayerMarker = 1
|
|
89
89
|
ExplosionMarker = 2
|
|
90
90
|
VendingMachineMarker = 3
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
from typing import List
|
|
2
|
-
|
|
2
|
+
from .serialization import Serializable
|
|
3
3
|
from ..remote.rustplus_proto import AppTeamInfoMember, AppTeamInfoNote, AppTeamInfo
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
class RustTeamMember:
|
|
6
|
+
class RustTeamMember(Serializable):
|
|
7
7
|
def __init__(self, data: AppTeamInfoMember) -> None:
|
|
8
8
|
self._steam_id: int = data.steam_id
|
|
9
9
|
self._name: str = data.name
|
|
@@ -59,11 +59,14 @@ class RustTeamMember:
|
|
|
59
59
|
)
|
|
60
60
|
|
|
61
61
|
|
|
62
|
-
class RustTeamNote:
|
|
62
|
+
class RustTeamNote(Serializable):
|
|
63
63
|
def __init__(self, data: AppTeamInfoNote) -> None:
|
|
64
64
|
self._type: int = data.type
|
|
65
65
|
self._x: float = data.x
|
|
66
66
|
self._y: float = data.y
|
|
67
|
+
self._icon: int = data.icon
|
|
68
|
+
self._colour_index: int = data.colour_index
|
|
69
|
+
self._label: str = data.label
|
|
67
70
|
|
|
68
71
|
@property
|
|
69
72
|
def type(self) -> int:
|
|
@@ -77,11 +80,25 @@ class RustTeamNote:
|
|
|
77
80
|
def y(self) -> float:
|
|
78
81
|
return self._y
|
|
79
82
|
|
|
83
|
+
@property
|
|
84
|
+
def icon(self) -> int:
|
|
85
|
+
return self._icon
|
|
86
|
+
|
|
87
|
+
@property
|
|
88
|
+
def colour_index(self) -> int:
|
|
89
|
+
return self._colour_index
|
|
90
|
+
|
|
91
|
+
@property
|
|
92
|
+
def label(self) -> str:
|
|
93
|
+
return self._label
|
|
94
|
+
|
|
80
95
|
def __str__(self) -> str:
|
|
81
|
-
return "RustTeamNote[type={}, x={}, y={}]".format(
|
|
96
|
+
return "RustTeamNote[type={}, x={}, y={}, icon={}, colour_index={}, label={}]".format(
|
|
97
|
+
self._type, self._x, self._y, self._icon, self._colour_index, self._label
|
|
98
|
+
)
|
|
82
99
|
|
|
83
100
|
|
|
84
|
-
class RustTeamInfo:
|
|
101
|
+
class RustTeamInfo(Serializable):
|
|
85
102
|
def __init__(self, data: AppTeamInfo) -> None:
|
|
86
103
|
self._leader_steam_id: int = data.leader_steam_id
|
|
87
104
|
self._members = [RustTeamMember(member) for member in data.members]
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
from collections.abc import Sequence
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class Serializable:
|
|
5
|
+
|
|
6
|
+
def serialize(self):
|
|
7
|
+
data = {}
|
|
8
|
+
for k, v in self.__dict__.items():
|
|
9
|
+
key = k if k[0] != "_" else k[1:]
|
|
10
|
+
if isinstance(v, Serializable):
|
|
11
|
+
data[key] = v.serialize()
|
|
12
|
+
elif isinstance(v, Sequence) and all(isinstance(element, Serializable) for element in v):
|
|
13
|
+
data[key] = [e.serialize() for e in v]
|
|
14
|
+
else:
|
|
15
|
+
data[key] = str(v)
|
|
16
|
+
|
|
17
|
+
return data
|
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: rustplus
|
|
3
|
+
Version: 5.6.13
|
|
4
|
+
Summary: A python wrapper for the Rust Plus API
|
|
5
|
+
Home-page: https://github.com/olijeffers0n/rustplus
|
|
6
|
+
Author: olijeffers0n
|
|
7
|
+
License: MIT
|
|
8
|
+
Project-URL: Issue tracker, https://github.com/olijeffers0n/rustplus/issues
|
|
9
|
+
Requires-Python: >=3.8.0
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Requires-Dist: websockets
|
|
13
|
+
Requires-Dist: Pillow
|
|
14
|
+
Requires-Dist: asyncio
|
|
15
|
+
Requires-Dist: rustPlusPushReceiver==0.4.1
|
|
16
|
+
Requires-Dist: http-ece
|
|
17
|
+
Requires-Dist: requests
|
|
18
|
+
Requires-Dist: numpy
|
|
19
|
+
Requires-Dist: scipy
|
|
20
|
+
Requires-Dist: betterproto==2.0.0b6
|
|
21
|
+
|
|
1
22
|

|
|
2
23
|
<div align = "center">
|
|
3
24
|
<img src = "https://static.pepy.tech/personalized-badge/rustplus?period=total&units=international_system&left_color=black&right_color=orange&left_text=Downloads">
|
|
@@ -47,3 +68,9 @@ You can also join me on my discord server:
|
|
|
47
68
|
GitHub ⭐'s are always welcome :)
|
|
48
69
|
|
|
49
70
|
Have Fun!
|
|
71
|
+
|
|
72
|
+
## Special Thanks:
|
|
73
|
+
Thanks to [JetBrains](https://www.jetbrains.com/?from=rustplus) for providing me with a free Open Source License for
|
|
74
|
+
PyCharm Professional, which is what I use to develop this project.
|
|
75
|
+
|
|
76
|
+
<a href="https://jb.gg/OpenSourceSupport"><img src="https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.svg" width="150"></a>
|
|
@@ -82,6 +82,7 @@ rustplus/api/structures/rust_map.py
|
|
|
82
82
|
rustplus/api/structures/rust_marker.py
|
|
83
83
|
rustplus/api/structures/rust_team_info.py
|
|
84
84
|
rustplus/api/structures/rust_time.py
|
|
85
|
+
rustplus/api/structures/serialization.py
|
|
85
86
|
rustplus/api/structures/util.py
|
|
86
87
|
rustplus/commands/__init__.py
|
|
87
88
|
rustplus/commands/command.py
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|