mirror of
https://github.com/nestriness/nestri.git
synced 2025-12-12 00:35:38 +02:00
145 lines
3.0 KiB
Protocol Buffer
145 lines
3.0 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
option go_package = "relay/internal/proto";
|
|
|
|
package proto;
|
|
|
|
/* Mouse messages */
|
|
|
|
// MouseMove message
|
|
message ProtoMouseMove {
|
|
int32 x = 1;
|
|
int32 y = 2;
|
|
}
|
|
|
|
// MouseMoveAbs message
|
|
message ProtoMouseMoveAbs {
|
|
int32 x = 1;
|
|
int32 y = 2;
|
|
}
|
|
|
|
// MouseWheel message
|
|
message ProtoMouseWheel {
|
|
int32 x = 1;
|
|
int32 y = 2;
|
|
}
|
|
|
|
// MouseKeyDown message
|
|
message ProtoMouseKeyDown {
|
|
int32 key = 1;
|
|
}
|
|
|
|
// MouseKeyUp message
|
|
message ProtoMouseKeyUp {
|
|
int32 key = 1;
|
|
}
|
|
|
|
/* Keyboard messages */
|
|
|
|
// KeyDown message
|
|
message ProtoKeyDown {
|
|
int32 key = 1;
|
|
}
|
|
|
|
// KeyUp message
|
|
message ProtoKeyUp {
|
|
int32 key = 1;
|
|
}
|
|
|
|
/* Controller messages */
|
|
|
|
// ControllerAttach message
|
|
message ProtoControllerAttach {
|
|
string id = 1; // One of the following enums: "ps", "xbox" or "switch"
|
|
int32 slot = 2; // Slot number (0-3)
|
|
string session_id = 3; // Session ID of the client attaching the controller
|
|
}
|
|
|
|
// ControllerDetach message
|
|
message ProtoControllerDetach {
|
|
int32 slot = 1; // Slot number (0-3)
|
|
}
|
|
|
|
// ControllerButton message
|
|
message ProtoControllerButton {
|
|
int32 slot = 1; // Slot number (0-3)
|
|
int32 button = 2; // Button code (linux input event code)
|
|
bool pressed = 3; // true if pressed, false if released
|
|
}
|
|
|
|
// ControllerTriggers message
|
|
message ProtoControllerTrigger {
|
|
int32 slot = 1; // Slot number (0-3)
|
|
int32 trigger = 2; // Trigger number (0 for left, 1 for right)
|
|
int32 value = 3; // trigger value (-32768 to 32767)
|
|
}
|
|
|
|
// ControllerSticks message
|
|
message ProtoControllerStick {
|
|
int32 slot = 1; // Slot number (0-3)
|
|
int32 stick = 2; // Stick number (0 for left, 1 for right)
|
|
int32 x = 3; // X axis value (-32768 to 32767)
|
|
int32 y = 4; // Y axis value (-32768 to 32767)
|
|
}
|
|
|
|
// ControllerAxis message
|
|
message ProtoControllerAxis {
|
|
int32 slot = 1; // Slot number (0-3)
|
|
int32 axis = 2; // Axis number (0 for d-pad horizontal, 1 for d-pad vertical)
|
|
int32 value = 3; // axis value (-1 to 1)
|
|
}
|
|
|
|
// ControllerRumble message
|
|
message ProtoControllerRumble {
|
|
int32 slot = 1; // Slot number (0-3)
|
|
int32 low_frequency = 2; // Low frequency rumble (0-65535)
|
|
int32 high_frequency = 3; // High frequency rumble (0-65535)
|
|
int32 duration = 4; // Duration in milliseconds
|
|
}
|
|
|
|
/* WebRTC + signaling */
|
|
|
|
message RTCIceCandidateInit {
|
|
string candidate = 1;
|
|
optional uint32 sdpMLineIndex = 2;
|
|
optional string sdpMid = 3;
|
|
optional string usernameFragment = 4;
|
|
}
|
|
|
|
message RTCSessionDescriptionInit {
|
|
string sdp = 1;
|
|
string type = 2;
|
|
}
|
|
|
|
// ProtoICE message
|
|
message ProtoICE {
|
|
RTCIceCandidateInit candidate = 1;
|
|
}
|
|
|
|
// ProtoSDP message
|
|
message ProtoSDP {
|
|
RTCSessionDescriptionInit sdp = 1;
|
|
}
|
|
|
|
// ProtoRaw message
|
|
message ProtoRaw {
|
|
string data = 1;
|
|
}
|
|
|
|
// ProtoClientRequestRoomStream message
|
|
message ProtoClientRequestRoomStream {
|
|
string room_name = 1;
|
|
string session_id = 2;
|
|
}
|
|
|
|
// ProtoClientDisconnected message
|
|
message ProtoClientDisconnected {
|
|
string session_id = 1;
|
|
repeated int32 controller_slots = 2;
|
|
}
|
|
|
|
// ProtoServerPushStream message
|
|
message ProtoServerPushStream {
|
|
string room_name = 1;
|
|
}
|