Use case: I am making a vehicle simulator, and I want support for steering wheels to be good. Instead of even using Roblox – the idea was to write my own drivers for specific devices that users request,
For the first device, I have chosen my own steering wheel. The driver works perfectly in C++, and you can have a look at the source right now:
#include <iostream>
#include <libusb-1.0/libusb.h>
#include <unistd.h>
#include <algorithm>
#include <cmath>
#define VENDOR_ID 0x2f24
#define PRODUCT_ID 0x010d
int main() {
libusb_context* ctx = nullptr;
libusb_device_handle* device_handle = nullptr;
int r;
r = libusb_init(&ctx);
if (r < 0) {
std::cerr << "Failed to initialize session" << std::endl;
return 1;
}
device_handle = libusb_open_device_with_vid_pid(ctx, VENDOR_ID, PRODUCT_ID);
if (!device_handle) {
std::cerr << "Device not found" << std::endl;
return 1;
}
if (libusb_kernel_driver_active(device_handle, 0)) {
libusb_detach_kernel_driver(device_handle, 0);
}
r = libusb_claim_interface(device_handle, 0);
if (r < 0) {
std::cerr << "Failed to claim interface" << std::endl;
libusb_close(device_handle);
libusb_exit(ctx);
return 1;
}
unsigned char data[64];
int actual_length;
while (true) {
r = libusb_interrupt_transfer(device_handle, 0x81, data, sizeof(data), &actual_length, 1000);
if (r == 0 && actual_length) {
int center = 32768;
int steer_value = data[4] + (data[5] << 8);
int angle = ((steer_value - center) * 135) / center; // Steer angle
int clutch_value = ((data[8] - 128) / 127.0f) * 100.0f;
int brake_value = (data[7] / 255.0f) * 100.0f;
int acceleration_value = (data[6] / 255.0f) * 100.f;
int gxvalue = ((data[9] - 50) / 162.0f) * 100.0f;
int gear_move_x = std::clamp(gxvalue, 0, 100);
int gyvalue = ((data[10] - 50) / 162.0f) * 100.0f;
int gear_move_y = std::clamp(gyvalue, 0, 100);
int gear = data[3];
std::string acg;
if (gear == 0) {
acg = "N"; // Neutral
} else if (gear == 64) {
acg = "R";
} else {
int actualgearnum = std::log2(gear) + 1;
acg = std::to_string(actualgearnum);
}
std::cout << "Steer: " << angle << "; Clutch: " << clutch_value << "; Brake: " << brake_value <<
"; Acceleration: " << acceleration_value << "; GearMoveX: " << gear_move_x <<
"; GearMoveY: " << gear_move_y << "; CurrentGear: " << acg << ";" << std::endl;
//for (int i = 0; i < actual_length; i++) {
// printf("%02X ", data[i]);
//}
} else if (r == LIBUSB_ERROR_TIMEOUT) {
continue;
} else {
std::cerr << "Error reading data: " << libusb_error_name(r) << std::endl;
}
std::cout << std::endl;
}
libusb_release_interface(device_handle, 0);
libusb_close(device_handle);
libusb_exit(ctx);
return 0;
}
Now, I really need to send the variables (angle, clutch_value, brake_value, acceleration_value, gear_move_x, gear_move_y and acg) on an HTTPS localhost server with POST.
This isn’t the problem, I can easiliy do that.
Now I will have to GET from the HTTP localhost server in Roblox Studio. That is supported, But HTTPService is limited to 500 requests / minute. If I say do 10 requests/second, that doesn’t even satisfy the minute requests per player.
If I had access to a basic file system in AppData/Roblox/place_id, it would be game changing.
Are there any way to get faster HTTP Requests?