promt: "chat write me a readme about my code" - good not perfect :P
This repository contains two key components for running the Giggletech VRChat OSCQuery Helper service. This service manages communication between the Giggletech system and VRChat through OSC (Open Sound Control) via an OSCQuery server.
I've aimed to make this service modular, so others can easily integrate it into their projects without much fuss. The architecture is designed to be flexible, allowing developers to plug in the OSCQuery service with minimal configuration and setup effort. This should simplify the process of managing OSC communication, especially for VRChat users.
- Rust Module: Manages the process lifecycle of the Giggletech OSCQuery server (
giggletech_oscq.exe
), ensuring it is always running and accessible. - C# OSCQuery Server: The core OSCQuery service, handling commands via HTTP and providing information about the TCP and UDP ports used for communication.
The Rust module is responsible for starting, monitoring, and managing the Giggletech OSCQuery server. It ensures the service is always up and communicates with VRChat avatars and environments in real-time through OSC.
- Initialize and Start: Manages the
giggletech_oscq.exe
process lifecycle. - Check UDP Port: Polls the OSCQuery server to retrieve the UDP port using an HTTP request.
- Restart Process: Automatically restarts the server if a failure is detected or if the UDP port is not returned.
- Remote Commands: Interacts with the OSCQuery server over HTTP to start, stop, or manage the service.
fn main() {
// Initialize and get the UDP port from the OSCQuery server
let udp_port = oscq_giggletech::initialize_and_get_udp_port();
println!("UDP Port: {}", udp_port);
}
http://localhost:6969/info
: Get information about TCP, UDP, and HTTP ports.http://localhost:6969/start
: Start the OSCQuery service.http://localhost:6969/port_udp
: Retrieve the current UDP port.http://localhost:6969/port_tcp
: Retrieve the current TCP port.http://localhost:6969/stop
: Shut down the OSCQuery server.
The C# server handles the core OSCQuery functionality, including starting and stopping the service and providing port information for communication with VRChat. It listens for HTTP commands and returns the active TCP and UDP ports in use.
- Start/Stop OSCQuery Service: Start or stop the OSCQuery service via HTTP.
- Port Management: Retrieve the TCP and UDP ports for OSC communication.
- Configuration: Reads from a YAML configuration file (
config_oscq.yml
) for setup, including HTTP port and service name.
httpPort: 6969
serviceName: "Giggletech VRChat Service"
The configuration file should be located in the same directory as the executable or in %APPDATA%\Giggletech
.
git clone https://github.com/your-repo/giggletech-vrchat-oscq-helper.git
cd giggletech-vrchat-oscq-helper
Ensure that you have Rust installed. Navigate to the Rust project directory (oscq_giggletech
) and build the project:
cargo build --release
Ensure that you have .NET installed. Navigate to the C# project directory and build the project:
dotnet build
Create the config_oscq.yml
file in the same directory as the executable or in %APPDATA%\Giggletech
. Set up the HTTP port and service name as needed.
Run the C# server directly to start the OSCQuery service:
./giggletech_oscq.exe
The service will begin listening on the HTTP port defined in config_oscq.yml
(default: 6969).
The Rust module will monitor the giggletech_oscq.exe
process and manage the server.
./target/release/oscq_giggletech
This will:
- Start the
giggletech_oscq.exe
process if it’s not running. - Continuously check for the UDP port via
/port_udp
endpoint. - Restart the
giggletech_oscq.exe
process if it fails.
Once both components are running, you can interact with the OSCQuery service using HTTP clients like curl
or a web browser:
curl http://localhost:6969/info
The Rust module (oscq_giggletech
) is designed to be modular, enabling easy integration of OSCQuery functionality into any Rust project. It handles the process lifecycle of the C# OSCQuery server, ensuring that the server is always available and automatically restarts if necessary.
- Easy Integration: Add OSCQuery functionality to your VRChat or other OSC-enabled applications.
- Automatic Restart: The module ensures that the OSCQuery server is always running and automatically restarts if it crashes or fails.
- Remote Control: Built-in HTTP commands to manage the server remotely.
- Permission Issues: If you encounter permission errors, ensure the application has the necessary rights to write to directories like
%APPDATA%
or%LOCALAPPDATA%
. Run the executable with administrator privileges if needed. - Process Not Starting: Ensure that the
config_oscq.yml
file is correctly set up and the executable has write permissions. - Log Files: Check
service_log_oscq.txt
for detailed logs regarding the OSCQuery service. This can help troubleshoot start/stop issues.
- Auto-Start on Boot: Consider setting up the service to start automatically with the system.
- Admin Privileges: Add a manifest file to request admin privileges where necessary, especially for installations requiring system-wide access.