
Research
Malicious fezbox npm Package Steals Browser Passwords from Cookies via Innovative QR Code Steganographic Technique
A malicious package uses a QR code as steganography in an innovative technique.
rlbot-flatbuffers
Advanced tools
A Python module implemented in Rust for serializing and deserializing RLBot's flatbuffers
A Python module implemented in Rust for fast and safe serialization and deserialization of RLBot's flatbuffers
A majority of the code is auto-generated by codegen/
upon first compile
using the RLBot's schema as defined by the flatbuffers-schema
submodule.
This includes the code generated by Planus (src/planus_flat.rs
),
the Python wrapper binds to the generated Rust code (src/python/
),
and the Python type hints (rlbot_flatbuffers.pyi
).
Usage of this API should not significantly differ from RLBot v4 to reduce developer confusion, while not holding back changes that would make the API easier to work with.
The crate used to generate Python binds (PyO3) supports all the way back to Python 3.7, however the minimum supported Python version is 3.10 for a few reasons:
match
/case
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.match_info.match_phase not in {
flat.MatchPhase.Active,
flat.MatchPhase.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.
Unions aren't custom types, rather a normal Python variable that can be 1 of a few types.
BallInfo.shape
had the separate type CollisionShape
which contained the union's data but the type is now just BoxShape | CylinderShape | SphereShape
Classes implement __match_args__
for easy destructuring via the match
/case
pattern.
Classes and enums properly implement __repr__
, with __str__
being an alias.
Enums implement __hash__
, __int__
and __eq__
.
Lists no longer have num_x
fields accompanying them,
they are just Python lists of the appropriate length.
Classes implement pack
and unpack
,
which are used to serialize and deserialize data.
flat.GamePacket
to a file.Auto-generated python type stub (.pyi
) generation that includes doc comments from the Flatbuffers schema
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.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.
Application Security
/Research
/Security News
Socket detected multiple compromised CrowdStrike npm packages, continuing the "Shai-Hulud" supply chain attack that has now impacted nearly 500 packages.