Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
A Python module implemented in Rust for serializing and deserializing RLBot's flatbuffers
A Python module implemented in Rust for serializing and deserializing RLBot's flatbuffers
To provide a fast, safe, and easy to use Python module for serializing and deserializing RLBot's flatbuffers.
A majority of the code is generated in the codegen/
upon first compile and thrown into src/python
.
This includes the code generated by flatc
(living in src/generated
), the Python wrapper binds to the generated Rust code, and the Python type hints (rlbot_flatbuffers.pyi
).
python3 -m venv venv
venv\Scripts\activate.bat
source venv/bin/activate
pip install maturin
maturin develop --release
To use in another Python environment, like if testing python-interface, you can build the wheel:
maturin build --release
pip install path/to/file.whl
The exact path of the wheel will be printed by maturin, just copy+paste it.
All classes and methods should have types hints readable by your IDE, removing the guesswork of common operations.
import rlbot_flatbuffers as flat
desired_ball = flat.DesiredBallState(
physics=flat.Physics(
location=flat.Vector3Partial(z=200),
velocity=flat.Vector3Partial(x=1500, y=1500),
angular_velocity=flat.Vector3Partial(),
),
)
desired_game_info = flat.DesiredGameInfoState(
world_gravity_z=-100,
game_speed=2,
)
desired_game_state = flat.DesiredGameState(
ball_state=desired_ball,
game_info_state=desired_game_info,
)
In the above code, we:
All values are optional when creating a class and have the proper defaults.
import rlbot_flatbuffers as flat
def handle_packet(packet: flat.GamePacket):
if packet.game_info.game_status not in {
flat.GameStatus.Active,
flat.GameStatus.Kickoff,
}:
# Return early if the game isn't active
return
# Print the ball's location
print(packet.ball.physics.location)
for car in packet.players:
# Print the every car's location
print(car.physics.location)
The goal of the above was to feel familiar to RLBot v4 while providing a more Pythonic interface.
__match_args__
for easy destructuring via the match
/case
pattern.
__str__
, __repr__
, and __hash__
methods.
__int__
and __eq__
.num_x
fields accompanying them,
they are just Python lists of the appropriate length.FAQs
A Python module implemented in Rust for serializing and deserializing RLBot's flatbuffers
We found that rlbot-flatbuffers demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.