Table of Contents

Class OscUtility

Namespace
BuildSoft.VRChat.Osc
Assembly
vrcosclib.dll

Provides basic functionality about OSC.

public static class OscUtility
Inheritance
OscUtility
Inherited Members

Fields

VRChatAppDataPath

The path to the VRChat AppData directory.

public static readonly string VRChatAppDataPath

Field Value

string

VRChatOscPath

The path to the VRChat OSC directory.

public static readonly string VRChatOscPath

Field Value

string

Properties

IsFailedAutoInitialization

Indicates whether the OSC utility failed to initialize automatically.

public static bool IsFailedAutoInitialization { get; }

Property Value

bool

true if the OSC utility failed to initialize automatically, otherwise false.

ReceivePort

Gets or sets the port number used to receive OSC messages.

[Obsolete("Use 'OscConnectionSettings.ReceivePort'")]
public static int ReceivePort { get; set; }

Property Value

int

Exceptions

ArgumentOutOfRangeException

Thrown when the value is less than 0 or greater than 65535.

SendPort

Gets or sets the port number used to send OSC messages.

[Obsolete("Use 'OscConnectionSettings.SendPort'")]
public static int SendPort { get; set; }

Property Value

int

Exceptions

ArgumentOutOfRangeException

Thrown when the value is less than 0 or greater than 65535.

VrcIPAddress

Gets or sets the IP address of the VRChat client to send OSC messages to.

[Obsolete("Use 'OscConnectionSettings.VrcIPAddress'")]
public static string VrcIPAddress { get; set; }

Property Value

string

Exceptions

FormatException

Thrown when the value cannot be parsed as an IP address.

Methods

GetCurrentOscAvatarConfigPath()

Gets the file path of the configuration file for the currently selected avatar.

public static string? GetCurrentOscAvatarConfigPath()

Returns

string

The file path of the configuration file for the currently selected avatar, or null if no avatar is selected.

GetOscAvatarConfigPath(string)

Gets the file path for the avatar configuration file with the specified avatar ID. If the avatar configuration file is not found, a FileNotFoundException is thrown.

public static string GetOscAvatarConfigPath(string avatarId)

Parameters

avatarId string

The avatar ID for the avatar configuration file to be retrieved.

Returns

string

The file path for the avatar configuration file with the specified avatar ID.

Exceptions

FileNotFoundException

Throws if the avatar configuration file is not found.

GetOscAvatarConfigPathes()

Gets the paths to all OSC avatar config files.

public static ImmutableArray<string> GetOscAvatarConfigPathes()

Returns

ImmutableArray<string>

An immutable array of strings representing the paths to the OSC avatar config files.

Initialize()

Initializes the OSC utility.

public static void Initialize()

RegisterMonitorCallback(MonitorCallback)

Registers a monitor callback with the OSC server and adds it to the list of monitor callbacks.

public static void RegisterMonitorCallback(MonitorCallback callback)

Parameters

callback MonitorCallback

The callback to register and add to the list of monitor callbacks.

UnregisterMonitorCallback(MonitorCallback)

Unregisters a monitor callback from the OSC server and removes it from the list of monitor callbacks.

public static void UnregisterMonitorCallback(MonitorCallback callback)

Parameters

callback MonitorCallback

The callback to unregister and remove from the list of monitor callbacks.

WaitAndGetCurrentOscAvatarConfigPathAsync(CancellationToken)

Asynchronously waits for an avatar to be selected and then gets the file path of the configuration file for the currently selected avatar.

public static ValueTask<string> WaitAndGetCurrentOscAvatarConfigPathAsync(CancellationToken token = default)

Parameters

token CancellationToken

A CancellationToken that can be used to cancel the operation.

Returns

ValueTask<string>

The file path of the configuration file for the currently selected avatar.

Exceptions

TaskCanceledException

The operation was cancelled.