Skip to content

Commit

Permalink
fix: docker build + add joypad capabilities when forcing a type
Browse files Browse the repository at this point in the history
  • Loading branch information
ABeltramo committed Jun 25, 2024
1 parent b9be85f commit 8c5ac3c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docker/wolf.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ RUN <<_GST_WAYLAND_DISPLAY
cd gst-wayland-display
git checkout 6c7d8cb
cargo install cargo-c
cargo cinstall -p c-bindings --prefix=/usr/local
cargo cinstall -p c-bindings --prefix=/usr/local --libdir=/usr/local/lib/x86_64-linux-gnu
_GST_WAYLAND_DISPLAY

COPY . /wolf/
Expand Down
6 changes: 4 additions & 2 deletions src/moonlight-server/control/input_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,9 @@ std::shared_ptr<state::JoypadTypes> create_new_joypad(const state::StreamSession
break;
}

if (capabilities & ACCELEROMETER && type == PS) {
if (capabilities & ACCELEROMETER && final_type == PS) {
// Request acceleromenter events from the client at 100 Hz
logs::log(logs::info, "Requesting accelerometer events for controller {}", controller_number);
auto accelerometer_pkt = ControlMotionEventPacket{
.header{.type = MOTION_EVENT, .length = sizeof(ControlMotionEventPacket) - sizeof(ControlPacket)},
.controller_number = static_cast<uint16_t>(controller_number),
Expand All @@ -125,8 +126,9 @@ std::shared_ptr<state::JoypadTypes> create_new_joypad(const state::StreamSession
encrypt_and_send(plaintext, session.aes_key, connected_clients, session.session_id);
}

if (capabilities & GYRO && type == PS) {
if (capabilities & GYRO && final_type == PS) {
// Request gyroscope events from the client at 100 Hz
logs::log(logs::info, "Requesting gyroscope events for controller {}", controller_number);
auto gyro_pkt = ControlMotionEventPacket{
.header{.type = MOTION_EVENT, .length = sizeof(ControlMotionEventPacket) - sizeof(ControlPacket)},
.controller_number = static_cast<uint16_t>(controller_number),
Expand Down

0 comments on commit 8c5ac3c

Please sign in to comment.