Update copyright year

This commit is contained in:
Natsumi
2025-01-31 16:38:25 +13:00
parent a7c400f9b7
commit 481e5439c3
33 changed files with 266 additions and 265 deletions

View File

@@ -1,4 +1,4 @@
// Copyright(c) 2019-2022 pypy, Natsumi and individual contributors.
// Copyright(c) 2019-2025 pypy, Natsumi and individual contributors.
// All rights reserved.
//
// This work is licensed under the terms of the MIT license.
@@ -27,7 +27,7 @@ namespace VRCX
public partial class AppApiCef : AppApi
{
private static readonly Logger logger = LogManager.GetCurrentClassLogger();
/// <summary>
/// Shows the developer tools for the main browser window.
/// </summary>
@@ -95,7 +95,7 @@ namespace VRCX
logger.Error(ex, "Unknown error when sending desktop notification");
}
}
public override void RestartApplication(bool isUpgrade)
{
var args = new List<string>();
@@ -125,12 +125,12 @@ namespace VRCX
vrcxProcess.Start();
Environment.Exit(0);
}
public override bool CheckForUpdateExe()
{
return File.Exists(Path.Join(Program.AppDataDirectory, "update.exe"));
}
public override void ExecuteAppFunction(string function, string json)
{
if (MainForm.Instance?.Browser != null && !MainForm.Instance.Browser.IsLoading && MainForm.Instance.Browser.CanExecuteJavascriptInMainFrame)
@@ -153,7 +153,7 @@ namespace VRCX
StartupArgs.LaunchArguments.LaunchCommand = string.Empty;
return command;
}
public override void FocusWindow()
{
MainForm.Instance.Invoke(new Action(() => { MainForm.Instance.Focus_Window(); }));
@@ -168,7 +168,7 @@ namespace VRCX
{
WinformThemer.DoFunny();
}
public override string GetClipboard()
{
var clipboard = string.Empty;
@@ -189,7 +189,7 @@ namespace VRCX
logger.Warn("Failed to open startup registry key");
return;
}
if (enabled)
{
var path = Application.ExecutablePath;
@@ -216,7 +216,7 @@ namespace VRCX
!path.EndsWith(".bmp") &&
!path.EndsWith(".webp")))
return;
MainForm.Instance.BeginInvoke(new MethodInvoker(() =>
{
var image = Image.FromFile(path);
@@ -227,12 +227,12 @@ namespace VRCX
Clipboard.SetDataObject(data, true);
}));
}
public override void FlashWindow()
{
MainForm.Instance.BeginInvoke(new MethodInvoker(() => { WinformThemer.Flash(MainForm.Instance); }));
}
public override void SetUserAgent()
{
using var client = MainForm.Instance.Browser.GetDevToolsClient();

View File

@@ -1,4 +1,4 @@
// Copyright(c) 2019-2022 pypy, Natsumi and individual contributors.
// Copyright(c) 2019-2025 pypy, Natsumi and individual contributors.
// All rights reserved.
//
// This work is licensed under the terms of the MIT license.
@@ -28,7 +28,7 @@ namespace VRCX
public string GetAssetId(string id, string variant = "")
{
using(var sha256 = SHA256.Create())
using (var sha256 = SHA256.Create())
{
byte[] hash = sha256.ComputeHash(Encoding.UTF8.GetBytes(id + variant));
StringBuilder idHex = new StringBuilder(hash.Length * 2);
@@ -53,16 +53,17 @@ namespace VRCX
{
versionHex += b.ToString("X2");
}
return versionHex.PadLeft(32, '0');
}
public (int, int) ReverseHexToDecimal(string hexString)
{
if (hexString.Length != 32)
return (0, 0); // it's cooked
try {
try
{
var variantVersionHexString = hexString.Substring(0, 8); // 0..8
var versionHexString = hexString.Substring(24, 8); // 24..32
var versionBytes = new byte[4];
@@ -110,7 +111,7 @@ namespace VRCX
var dirs = Directory.GetDirectories(topDir, versionSearchPattern);
if (dirs.Length > 0)
return dirs.OrderByDescending(dir => ReverseHexToDecimal(Path.GetFileName(dir)).Item2).First();
return Path.Join(topDir, versionLocation);
}
@@ -129,7 +130,7 @@ namespace VRCX
var fullLocation = GetVRChatCacheFullLocation(id, version);
if (!Directory.Exists(fullLocation))
fullLocation = GetVRChatCacheFullLocation(id, version, variant, variantVersion);
var fileLocation = Path.Join(fullLocation, "__data");
var cachePath = string.Empty;
if (File.Exists(fileLocation))
@@ -157,7 +158,7 @@ namespace VRCX
var path = GetVRChatCacheFullLocation(id, version);
if (Directory.Exists(path))
Directory.Delete(path, true);
path = GetVRChatCacheFullLocation(id, version, variant, variantVersion);
if (Directory.Exists(path))
Directory.Delete(path, true);
@@ -206,7 +207,7 @@ namespace VRCX
if (File.Exists(Path.Join(versionDirectory.FullName, "__lock")))
continue; // skip locked version
versionDirectory.Delete(true);
output.Add($"{cacheDirectory.Name}\\{versionDirectory.Name}");
}

View File

@@ -1,4 +1,4 @@
// Copyright(c) 2019-2022 pypy, Natsumi and individual contributors.
// Copyright(c) 2019-2025 pypy, Natsumi and individual contributors.
// All rights reserved.
//
// This work is licensed under the terms of the MIT license.

View File

@@ -1,4 +1,4 @@
// Copyright(c) 2019 pypy. All rights reserved.
// Copyright(c) 2019-2025 pypy, Natsumi and individual contributors.
//
// This work is licensed under the terms of the MIT license.
// For a copy, see <https://opensource.org/licenses/MIT>.

View File

@@ -1,4 +1,4 @@
// Copyright(c) 2019-2022 pypy, Natsumi and individual contributors.
// Copyright(c) 2019-2025 pypy, Natsumi and individual contributors.
// All rights reserved.
//
// This work is licensed under the terms of the MIT license.

View File

@@ -1,4 +1,4 @@
// Copyright(c) 2019 pypy. All rights reserved.
// Copyright(c) 2019-2025 pypy, Natsumi and individual contributors.
//
// This work is licensed under the terms of the MIT license.
// For a copy, see <https://opensource.org/licenses/MIT>.

View File

@@ -1,4 +1,4 @@
// Copyright(c) 2019-2022 pypy, Natsumi and individual contributors.
// Copyright(c) 2019-2025 pypy, Natsumi and individual contributors.
// All rights reserved.
//
// This work is licensed under the terms of the MIT license.

View File

@@ -1,4 +1,4 @@
// Copyright(c) 2019-2022 pypy, Natsumi and individual contributors.
// Copyright(c) 2019-2025 pypy, Natsumi and individual contributors.
// All rights reserved.
//
// This work is licensed under the terms of the MIT license.
@@ -119,7 +119,7 @@ namespace VRCX
{
if (m_Client == null || m_Lock.IsReadLockHeld)
return;
m_Lock.EnterWriteLock();
try
{
@@ -179,7 +179,7 @@ namespace VRCX
m_Lock.ExitWriteLock();
}
}
public void SetTimestamps(double startUnixMilliseconds, double endUnixMilliseconds)
{
var _startUnixMilliseconds = (ulong)startUnixMilliseconds;

View File

@@ -1,4 +1,4 @@
// Copyright(c) 2019-2022 pypy, Natsumi and individual contributors.
// Copyright(c) 2019-2025 pypy, Natsumi and individual contributors.
// All rights reserved.
//
// This work is licensed under the terms of the MIT license.
@@ -87,7 +87,7 @@ namespace VRCX
{
if (string.IsNullOrEmpty(packet))
continue;
#if !LINUX
if (MainForm.Instance?.Browser != null && !MainForm.Instance.Browser.IsLoading && MainForm.Instance.Browser.CanExecuteJavascriptInMainFrame)
MainForm.Instance.Browser.ExecuteScriptAsync("$app.ipcEvent", packet);

View File

@@ -1,4 +1,4 @@
// Copyright(c) 2019-2022 pypy, Natsumi and individual contributors.
// Copyright(c) 2019-2025 pypy, Natsumi and individual contributors.
// All rights reserved.
//
// This work is licensed under the terms of the MIT license.
@@ -33,7 +33,7 @@ namespace VRCX
client?.Send(ipcPacket);
}
}
public static string GetIpcName()
{
var hash = 0;

View File

@@ -1,4 +1,4 @@
// Copyright(c) 2019-2022 pypy, Natsumi and individual contributors.
// Copyright(c) 2019-2025 pypy, Natsumi and individual contributors.
// All rights reserved.
//
// This work is licensed under the terms of the MIT license.

View File

@@ -1,4 +1,4 @@
// Copyright(c) 2019-2022 pypy, Natsumi and individual contributors.
// Copyright(c) 2019-2025 pypy, Natsumi and individual contributors.
// All rights reserved.
//
// This work is licensed under the terms of the MIT license.
@@ -618,7 +618,7 @@ namespace VRCX
{
// 2021.04.08 06:37:45 Error - [Video Playback] ERROR: Video unavailable
// 2021.04.08 06:40:07 Error - [Video Playback] ERROR: Private video
// 2024.07.31 22:28:47 Error - [AVProVideo] Error: Loading failed. File not found, codec not supported, video resolution too high or insufficient system resources.
// 2024.07.31 23:04:15 Error - [AVProVideo] Error: Loading failed. File not found, codec not supported, video resolution too high or insufficient system resources.
@@ -639,7 +639,7 @@ namespace VRCX
return true;
}
if (line.Contains("[AVProVideo] Error: "))
{
var data = line.Substring(offset + 20);
@@ -870,17 +870,17 @@ namespace VRCX
private bool ParseLogAvatarChange(FileInfo fileInfo, LogContext logContext, string line, int offset)
{
// 2023.11.05 14:45:57 Log - [Behaviour] Switching KMOG to avatar MoeSera
if (string.Compare(line, offset, "[Behaviour] Switching ", 0, 22, StringComparison.Ordinal) != 0)
return false;
var pos = line.LastIndexOf(" to avatar ", StringComparison.Ordinal);
if (pos < 0)
return false;
var displayName = line.Substring(offset + 22, pos - (offset + 22));
var avatarName = line.Substring(pos + 11);
AppendLog(new[]
{
fileInfo.Name,
@@ -889,7 +889,7 @@ namespace VRCX
displayName,
avatarName
});
return true;
}
@@ -1046,7 +1046,7 @@ namespace VRCX
{
// 2022.11.29 04:27:33 Error - [UdonBehaviour] An exception occurred during Udon execution, this UdonBehaviour will be halted.
// VRC.Udon.VM.UdonVMException: An exception occurred in an UdonVM, execution will be halted. --->VRC.Udon.VM.UdonVMException: An exception occurred during EXTERN to 'VRCSDKBaseVRCPlayerApi.__get_displayName__SystemString'. --->System.NullReferenceException: Object reference not set to an instance of an object.
if (line.Contains("[PyPyDance]"))
{
AppendLog(new[]
@@ -1058,7 +1058,7 @@ namespace VRCX
});
return true;
}
var lineOffset = line.IndexOf(" ---> VRC.Udon.VM.UdonVMException: ", StringComparison.Ordinal);
if (lineOffset < 0)
return false;
@@ -1102,7 +1102,7 @@ namespace VRCX
// 2023.04.22 16:52:28 Log - Initializing VRSDK.
// 2023.04.22 16:52:29 Log - StartVRSDK: Open VR Loader
// 2024.07.26 01:48:56 Log - STEAMVR HMD Model: Index
if (string.Compare(line, offset, "Initializing VRSDK.", 0, 19, StringComparison.Ordinal) != 0 &&
@@ -1152,7 +1152,7 @@ namespace VRCX
if (stringData.StartsWith("http://127.0.0.1:22500") || stringData.StartsWith("http://localhost:22500"))
return true; // ignore own requests
AppendLog(new[]
{
fileInfo.Name,
@@ -1176,10 +1176,10 @@ namespace VRCX
var imageData = line.Substring(lineOffset + check.Length);
imageData = imageData.Remove(imageData.Length - 1);
if (imageData.StartsWith("http://127.0.0.1:22500") || imageData.StartsWith("http://localhost:22500"))
return true; // ignore own requests
AppendLog(new[]
{
fileInfo.Name,
@@ -1189,7 +1189,7 @@ namespace VRCX
});
return true;
}
private bool ParseVoteKick(FileInfo fileInfo, LogContext logContext, string line, int offset)
{
// 2023.06.02 01:08:04 Log - [Behaviour] Received executive message: You have been kicked from the instance by majority vote
@@ -1207,7 +1207,7 @@ namespace VRCX
});
return true;
}
private bool ParseFailedToJoin(FileInfo fileInfo, LogContext logContext, string line, int offset)
{
// 2023.09.01 10:42:19 Warning - [Behaviour] Failed to join instance 'wrld_78eb6b52-fd5a-4954-ba28-972c92c8cc77:82384~hidden(usr_a9bf892d-b447-47ce-a572-20c83dbfffd8)~region(eu)' due to 'That instance is using an outdated version of VRChat. You won't be able to join them until they update!'
@@ -1228,7 +1228,7 @@ namespace VRCX
private bool ParseOscFailedToStart(FileInfo fileInfo, LogContext logContext, string line, int offset)
{
// 2023.09.26 04:12:57 Warning - Could not Start OSC: Address already in use
if (string.Compare(line, offset, "Could not Start OSC: ", 0, 21, StringComparison.Ordinal) != 0)
return false;

View File

@@ -1,4 +1,4 @@
// Copyright(c) 2019-2022 pypy, Natsumi and individual contributors.
// Copyright(c) 2019-2025 pypy, Natsumi and individual contributors.
// All rights reserved.
//
// This work is licensed under the terms of the MIT license.
@@ -25,7 +25,7 @@ namespace VRCX
private DeviceMultithread _deviceMultithread;
private Query _query;
private Texture2D _renderTarget;
private static readonly Logger logger = LogManager.GetCurrentClassLogger();
public OffScreenBrowser(string address, int width, int height)
@@ -37,18 +37,18 @@ namespace VRCX
windowInfo.SharedTextureEnabled = true;
windowInfo.Width = width;
windowInfo.Height = height;
var browserSettings = new BrowserSettings()
{
DefaultEncoding = "UTF-8",
WindowlessFrameRate = 60
};
CreateBrowser(windowInfo, browserSettings);
Size = new System.Drawing.Size(width, height);
RenderHandler = this;
JavascriptBindings.ApplyVrJavascriptBindings(JavascriptObjectRepository);
}
@@ -56,13 +56,13 @@ namespace VRCX
{
_device = device;
_device1 = _device.QueryInterface<Device1>();
_deviceMultithread?.Dispose();
_deviceMultithread = _device.QueryInterfaceOrNull<DeviceMultithread>();
_deviceMultithread?.SetMultithreadProtected(true);
_renderTarget = renderTarget;
_query?.Dispose();
_query = new Query(_device, new QueryDescription
{

View File

@@ -1,4 +1,4 @@
// Copyright(c) 2019-2022 pypy, Natsumi and individual contributors.
// Copyright(c) 2019-2025 pypy, Natsumi and individual contributors.
// All rights reserved.
//
// This work is licensed under the terms of the MIT license.
@@ -66,7 +66,7 @@ namespace VRCX
// Safeguard against uninitialized texture
if (texture == null)
return;
_paintBufferLock.EnterReadLock();
try
{

View File

@@ -1,4 +1,4 @@
// Copyright(c) 2019-2022 pypy, Natsumi and individual contributors.
// Copyright(c) 2019-2025 pypy, Natsumi and individual contributors.
// All rights reserved.
//
// This work is licensed under the terms of the MIT license.
@@ -31,7 +31,7 @@ namespace VRCX
{
if (enabled == _enabled)
return;
_enabled = enabled;
if (enabled)
StartThread();
@@ -61,11 +61,11 @@ namespace VRCX
_performanceCounterUpTime?.Dispose();
_performanceCounterUpTime = null;
}
private void StartThread()
{
Exit();
try
{
_performanceCounterCpuUsage = new PerformanceCounter(
@@ -99,7 +99,7 @@ namespace VRCX
logger.Warn($"Failed to create \"Processor Time\" PerformanceCounter ${ex}");
}
}
try
{
_performanceCounterUpTime = new PerformanceCounter("System", "System Up Time");
@@ -117,14 +117,14 @@ namespace VRCX
return;
}
logger.Info("SystemMonitor started");
_thread = new Thread(ThreadProc)
{
IsBackground = true
};
_thread.Start();
}
private void ThreadProc()
{
try
@@ -136,7 +136,7 @@ namespace VRCX
if (_performanceCounterUpTime != null)
UpTime = TimeSpan.FromSeconds(_performanceCounterUpTime.NextValue()).TotalMilliseconds;
Thread.Sleep(1000);
}
}

View File

@@ -1,4 +1,4 @@
// Copyright(c) 2019-2022 pypy, Natsumi and individual contributors.
// Copyright(c) 2019-2025 pypy, Natsumi and individual contributors.
// All rights reserved.
//
// This work is licensed under the terms of the MIT license.
@@ -51,11 +51,11 @@ namespace VRCX
private ulong _hmdOverlayHandle;
private bool _hmdOverlayActive;
private bool _hmdOverlayWasActive;
private ulong _wristOverlayHandle;
private bool _wristOverlayActive;
private bool _wristOverlayWasActive;
static VRCXVR()
{
@@ -98,7 +98,7 @@ namespace VRCX
private void SetupTextures()
{
_factory ??= new Factory1();
_device?.Dispose();
_device = new Device(_factory.GetAdapter(OpenVR.System.GetD3D9AdapterIndex()),
DeviceCreationFlags.BgraSupport);
@@ -136,7 +136,7 @@ namespace VRCX
);
_hmdOverlay?.UpdateRender(_device, _texture2);
}
private void UpgradeDevice()
{
Device5 device5 = _device.QueryInterfaceOrNull<Device5>();
@@ -186,7 +186,7 @@ namespace VRCX
var overlayVisible1 = false;
var overlayVisible2 = false;
var dashboardHandle = 0UL;
_wristOverlay = new OffScreenBrowser(
"file://vrcx/vr.html?1",
512,
@@ -340,15 +340,15 @@ namespace VRCX
OpenVR.Overlay.DestroyOverlay(_hmdOverlayHandle);
_hmdOverlayHandle = 0;
}
_hmdOverlayWasActive = _hmdOverlayActive;
if (_wristOverlayActive != _wristOverlayWasActive && _wristOverlayHandle != 0)
{
OpenVR.Overlay.DestroyOverlay(_wristOverlayHandle);
_wristOverlayHandle = 0;
}
_wristOverlayWasActive = _wristOverlayActive;
}
@@ -396,7 +396,7 @@ namespace VRCX
var success = system.GetControllerState(i, ref state, (uint)Marshal.SizeOf(state));
if (!success)
break; // this fails while SteamVR overlay is open
var prox = state.ulButtonPressed & (1UL << ((int)EVRButtonId.k_EButton_ProximitySensor));
var isHmdAfk = prox == 0;
if (isHmdAfk != IsHmdAfk)
@@ -438,82 +438,82 @@ namespace VRCX
case ETrackedDeviceClass.Controller:
case ETrackedDeviceClass.GenericTracker:
case ETrackedDeviceClass.TrackingReference:
{
var err = ETrackedPropertyError.TrackedProp_Success;
var batteryPercentage = system.GetFloatTrackedDeviceProperty(i, ETrackedDeviceProperty.Prop_DeviceBatteryPercentage_Float, ref err);
if (err != ETrackedPropertyError.TrackedProp_Success)
{
batteryPercentage = 1f;
}
err = ETrackedPropertyError.TrackedProp_Success;
var isCharging = system.GetBoolTrackedDeviceProperty(i, ETrackedDeviceProperty.Prop_DeviceIsCharging_Bool, ref err);
if (err != ETrackedPropertyError.TrackedProp_Success)
{
isCharging = false;
}
sb.Clear();
system.GetStringTrackedDeviceProperty(i, ETrackedDeviceProperty.Prop_TrackingSystemName_String, sb, (uint)sb.Capacity, ref err);
var isOculus = sb.ToString().IndexOf("oculus", StringComparison.OrdinalIgnoreCase) >= 0;
// Oculus : B/Y, Bit 1, Mask 2
// Oculus : A/X, Bit 7, Mask 128
// Vive : Menu, Bit 1, Mask 2,
// Vive : Grip, Bit 2, Mask 4
var role = system.GetControllerRoleForTrackedDeviceIndex(i);
if (role == ETrackedControllerRole.LeftHand || role == ETrackedControllerRole.RightHand)
{
if (_overlayHand == 0 ||
(_overlayHand == 1 && role == ETrackedControllerRole.LeftHand) ||
(_overlayHand == 2 && role == ETrackedControllerRole.RightHand))
var err = ETrackedPropertyError.TrackedProp_Success;
var batteryPercentage = system.GetFloatTrackedDeviceProperty(i, ETrackedDeviceProperty.Prop_DeviceBatteryPercentage_Float, ref err);
if (err != ETrackedPropertyError.TrackedProp_Success)
{
if (system.GetControllerState(i, ref state, (uint)Marshal.SizeOf(state)) &&
(state.ulButtonPressed & (_menuButton ? 2u : isOculus ? 128u : 4u)) != 0)
{
_nextOverlayUpdate = DateTime.MinValue;
if (role == ETrackedControllerRole.LeftHand)
{
Array.Copy(_translationLeft, _translation, 3);
Array.Copy(_rotationLeft, _rotation, 3);
}
else
{
Array.Copy(_translationRight, _translation, 3);
Array.Copy(_rotationRight, _rotation, 3);
}
batteryPercentage = 1f;
}
overlayIndex = i;
err = ETrackedPropertyError.TrackedProp_Success;
var isCharging = system.GetBoolTrackedDeviceProperty(i, ETrackedDeviceProperty.Prop_DeviceIsCharging_Bool, ref err);
if (err != ETrackedPropertyError.TrackedProp_Success)
{
isCharging = false;
}
sb.Clear();
system.GetStringTrackedDeviceProperty(i, ETrackedDeviceProperty.Prop_TrackingSystemName_String, sb, (uint)sb.Capacity, ref err);
var isOculus = sb.ToString().IndexOf("oculus", StringComparison.OrdinalIgnoreCase) >= 0;
// Oculus : B/Y, Bit 1, Mask 2
// Oculus : A/X, Bit 7, Mask 128
// Vive : Menu, Bit 1, Mask 2,
// Vive : Grip, Bit 2, Mask 4
var role = system.GetControllerRoleForTrackedDeviceIndex(i);
if (role == ETrackedControllerRole.LeftHand || role == ETrackedControllerRole.RightHand)
{
if (_overlayHand == 0 ||
(_overlayHand == 1 && role == ETrackedControllerRole.LeftHand) ||
(_overlayHand == 2 && role == ETrackedControllerRole.RightHand))
{
if (system.GetControllerState(i, ref state, (uint)Marshal.SizeOf(state)) &&
(state.ulButtonPressed & (_menuButton ? 2u : isOculus ? 128u : 4u)) != 0)
{
_nextOverlayUpdate = DateTime.MinValue;
if (role == ETrackedControllerRole.LeftHand)
{
Array.Copy(_translationLeft, _translation, 3);
Array.Copy(_rotationLeft, _rotation, 3);
}
else
{
Array.Copy(_translationRight, _translation, 3);
Array.Copy(_rotationRight, _rotation, 3);
}
overlayIndex = i;
}
}
}
}
var type = string.Empty;
if (devClass == ETrackedDeviceClass.Controller)
{
if (role == ETrackedControllerRole.LeftHand)
var type = string.Empty;
if (devClass == ETrackedDeviceClass.Controller)
{
type = "leftController";
if (role == ETrackedControllerRole.LeftHand)
{
type = "leftController";
}
else if (role == ETrackedControllerRole.RightHand)
{
type = "rightController";
}
else
{
type = "controller";
}
}
else if (role == ETrackedControllerRole.RightHand)
else if (devClass == ETrackedDeviceClass.GenericTracker)
{
type = "rightController";
type = "tracker";
}
else
else if (devClass == ETrackedDeviceClass.TrackingReference)
{
type = "controller";
type = "base";
}
}
else if (devClass == ETrackedDeviceClass.GenericTracker)
{
type = "tracker";
}
else if (devClass == ETrackedDeviceClass.TrackingReference)
{
type = "base";
}
var item = new[]
{
var item = new[]
{
type,
system.IsTrackedDeviceConnected(i)
? "connected"
@@ -524,18 +524,18 @@ namespace VRCX
(batteryPercentage * 100).ToString(),
poses[i].eTrackingResult.ToString()
};
_deviceListLock.EnterWriteLock();
try
{
_deviceList.Add(item);
}
finally
{
_deviceListLock.ExitWriteLock();
}
_deviceListLock.EnterWriteLock();
try
{
_deviceList.Add(item);
}
finally
{
_deviceListLock.ExitWriteLock();
}
break;
}
break;
}
}
}
}
@@ -833,7 +833,7 @@ namespace VRCX
return err;
}
public override void ExecuteVrFeedFunction(string function, string json)
{
if (_wristOverlay == null) return;

View File

@@ -1,4 +1,4 @@
// Copyright(c) 2019-2022 pypy, Natsumi and individual contributors.
// Copyright(c) 2019-2025 pypy, Natsumi and individual contributors.
// All rights reserved.
//
// This work is licensed under the terms of the MIT license.
@@ -105,7 +105,7 @@ namespace VRCX
CpuAccessFlags = CpuAccessFlags.Write
}
);
_texture2?.Dispose();
_texture2 = new Texture2D(
_device,
@@ -137,7 +137,7 @@ namespace VRCX
var dashboardHandle = 0UL;
var overlayHandle1 = 0UL;
var overlayHandle2 = 0UL;
_wristOverlay = new OffScreenBrowserLegacy(
"file://vrcx/vr.html?1",
512,
@@ -324,7 +324,7 @@ namespace VRCX
var success = system.GetControllerState(i, ref state, (uint)Marshal.SizeOf(state));
if (!success)
break; // this fails while SteamVR overlay is open
var prox = state.ulButtonPressed & (1UL << ((int)EVRButtonId.k_EButton_ProximitySensor));
var isHmdAfk = prox == 0;
if (isHmdAfk != IsHmdAfk)
@@ -366,82 +366,82 @@ namespace VRCX
case ETrackedDeviceClass.Controller:
case ETrackedDeviceClass.GenericTracker:
case ETrackedDeviceClass.TrackingReference:
{
var err = ETrackedPropertyError.TrackedProp_Success;
var batteryPercentage = system.GetFloatTrackedDeviceProperty(i, ETrackedDeviceProperty.Prop_DeviceBatteryPercentage_Float, ref err);
if (err != ETrackedPropertyError.TrackedProp_Success)
{
batteryPercentage = 1f;
}
err = ETrackedPropertyError.TrackedProp_Success;
var isCharging = system.GetBoolTrackedDeviceProperty(i, ETrackedDeviceProperty.Prop_DeviceIsCharging_Bool, ref err);
if (err != ETrackedPropertyError.TrackedProp_Success)
{
isCharging = false;
}
sb.Clear();
system.GetStringTrackedDeviceProperty(i, ETrackedDeviceProperty.Prop_TrackingSystemName_String, sb, (uint)sb.Capacity, ref err);
var isOculus = sb.ToString().IndexOf("oculus", StringComparison.OrdinalIgnoreCase) >= 0;
// Oculus : B/Y, Bit 1, Mask 2
// Oculus : A/X, Bit 7, Mask 128
// Vive : Menu, Bit 1, Mask 2,
// Vive : Grip, Bit 2, Mask 4
var role = system.GetControllerRoleForTrackedDeviceIndex(i);
if (role == ETrackedControllerRole.LeftHand || role == ETrackedControllerRole.RightHand)
{
if (_overlayHand == 0 ||
(_overlayHand == 1 && role == ETrackedControllerRole.LeftHand) ||
(_overlayHand == 2 && role == ETrackedControllerRole.RightHand))
var err = ETrackedPropertyError.TrackedProp_Success;
var batteryPercentage = system.GetFloatTrackedDeviceProperty(i, ETrackedDeviceProperty.Prop_DeviceBatteryPercentage_Float, ref err);
if (err != ETrackedPropertyError.TrackedProp_Success)
{
if (system.GetControllerState(i, ref state, (uint)Marshal.SizeOf(state)) &&
(state.ulButtonPressed & (_menuButton ? 2u : isOculus ? 128u : 4u)) != 0)
{
_nextOverlayUpdate = DateTime.MinValue;
if (role == ETrackedControllerRole.LeftHand)
{
Array.Copy(_translationLeft, _translation, 3);
Array.Copy(_rotationLeft, _rotation, 3);
}
else
{
Array.Copy(_translationRight, _translation, 3);
Array.Copy(_rotationRight, _rotation, 3);
}
batteryPercentage = 1f;
}
overlayIndex = i;
err = ETrackedPropertyError.TrackedProp_Success;
var isCharging = system.GetBoolTrackedDeviceProperty(i, ETrackedDeviceProperty.Prop_DeviceIsCharging_Bool, ref err);
if (err != ETrackedPropertyError.TrackedProp_Success)
{
isCharging = false;
}
sb.Clear();
system.GetStringTrackedDeviceProperty(i, ETrackedDeviceProperty.Prop_TrackingSystemName_String, sb, (uint)sb.Capacity, ref err);
var isOculus = sb.ToString().IndexOf("oculus", StringComparison.OrdinalIgnoreCase) >= 0;
// Oculus : B/Y, Bit 1, Mask 2
// Oculus : A/X, Bit 7, Mask 128
// Vive : Menu, Bit 1, Mask 2,
// Vive : Grip, Bit 2, Mask 4
var role = system.GetControllerRoleForTrackedDeviceIndex(i);
if (role == ETrackedControllerRole.LeftHand || role == ETrackedControllerRole.RightHand)
{
if (_overlayHand == 0 ||
(_overlayHand == 1 && role == ETrackedControllerRole.LeftHand) ||
(_overlayHand == 2 && role == ETrackedControllerRole.RightHand))
{
if (system.GetControllerState(i, ref state, (uint)Marshal.SizeOf(state)) &&
(state.ulButtonPressed & (_menuButton ? 2u : isOculus ? 128u : 4u)) != 0)
{
_nextOverlayUpdate = DateTime.MinValue;
if (role == ETrackedControllerRole.LeftHand)
{
Array.Copy(_translationLeft, _translation, 3);
Array.Copy(_rotationLeft, _rotation, 3);
}
else
{
Array.Copy(_translationRight, _translation, 3);
Array.Copy(_rotationRight, _rotation, 3);
}
overlayIndex = i;
}
}
}
}
var type = string.Empty;
if (devClass == ETrackedDeviceClass.Controller)
{
if (role == ETrackedControllerRole.LeftHand)
var type = string.Empty;
if (devClass == ETrackedDeviceClass.Controller)
{
type = "leftController";
if (role == ETrackedControllerRole.LeftHand)
{
type = "leftController";
}
else if (role == ETrackedControllerRole.RightHand)
{
type = "rightController";
}
else
{
type = "controller";
}
}
else if (role == ETrackedControllerRole.RightHand)
else if (devClass == ETrackedDeviceClass.GenericTracker)
{
type = "rightController";
type = "tracker";
}
else
else if (devClass == ETrackedDeviceClass.TrackingReference)
{
type = "controller";
type = "base";
}
}
else if (devClass == ETrackedDeviceClass.GenericTracker)
{
type = "tracker";
}
else if (devClass == ETrackedDeviceClass.TrackingReference)
{
type = "base";
}
var item = new[]
{
var item = new[]
{
type,
system.IsTrackedDeviceConnected(i)
? "connected"
@@ -452,18 +452,18 @@ namespace VRCX
(batteryPercentage * 100).ToString(),
poses[i].eTrackingResult.ToString()
};
_deviceListLock.EnterWriteLock();
try
{
_deviceList.Add(item);
}
finally
{
_deviceListLock.ExitWriteLock();
}
_deviceListLock.EnterWriteLock();
try
{
_deviceList.Add(item);
}
finally
{
_deviceListLock.ExitWriteLock();
}
break;
}
break;
}
}
}
}
@@ -761,7 +761,7 @@ namespace VRCX
return err;
}
public override void ExecuteVrFeedFunction(string function, string json)
{
if (_wristOverlay == null) return;

View File

@@ -1,4 +1,4 @@
// Copyright(c) 2019-2022 pypy, Natsumi and individual contributors.
// Copyright(c) 2019-2025 pypy, Natsumi and individual contributors.
// All rights reserved.
//
// This work is licensed under the terms of the MIT license.

View File

@@ -1,4 +1,4 @@
// Copyright(c) 2019 pypy. All rights reserved.
// Copyright(c) 2019-2025 pypy, Natsumi and individual contributors.
//
// This work is licensed under the terms of the MIT license.
// For a copy, see <https://opensource.org/licenses/MIT>.

View File

@@ -1,4 +1,4 @@
// Copyright(c) 2019-2022 pypy, Natsumi and individual contributors.
// Copyright(c) 2019-2025 pypy, Natsumi and individual contributors.
// All rights reserved.
//
// This work is licensed under the terms of the MIT license.
@@ -107,7 +107,7 @@ namespace VRCX
Encoding = System.Text.Encoding.UTF8
};
builder.ForLogger().FilterMinLevel(LogLevel.Debug).WriteTo(fileTarget);
var consoleTarget = new ConsoleTarget("consoleTarget")
{
Layout = "${longdate} [${level:uppercase=true:padding=-5}] ${logger:padding=-20} - ${message} ${exception:format=tostring}",

View File

@@ -1,4 +1,4 @@
// Copyright(c) 2019-2022 pypy, Natsumi and individual contributors.
// Copyright(c) 2019-2025 pypy, Natsumi and individual contributors.
// All rights reserved.
//
// This work is licensed under the terms of the MIT license.

View File

@@ -1,4 +1,4 @@
// Copyright(c) 2019-2022 pypy, Natsumi and individual contributors.
// Copyright(c) 2019-2025 pypy, Natsumi and individual contributors.
// All rights reserved.
//
// This work is licensed under the terms of the MIT license.
@@ -28,7 +28,7 @@ namespace VRCX
public static void ArgsCheck()
{
var args = Environment.GetCommandLineArgs();
Debug.Assert(Program.LaunchDebug = true);
var currentProcessArgs = ParseArgs(args);
@@ -77,7 +77,7 @@ namespace VRCX
if (arg.StartsWith(VrcxLaunchArguments.IsDebugPrefix))
arguments.IsDebug = true;
if (arg.StartsWith(VrcxLaunchArguments.LaunchCommandPrefix) && arg.Length > VrcxLaunchArguments.LaunchCommandPrefix.Length)
arguments.LaunchCommand = arg.Substring(VrcxLaunchArguments.LaunchCommandPrefix.Length);
@@ -115,7 +115,7 @@ namespace VRCX
{
if (process.Id == Environment.ProcessId)
continue;
var commandLine = string.Empty;
try
{

View File

@@ -1,4 +1,4 @@
// Copyright(c) 2019-2022 pypy, Natsumi and individual contributors.
// Copyright(c) 2019-2025 pypy, Natsumi and individual contributors.
// All rights reserved.
//
// This work is licensed under the terms of the MIT license.
@@ -38,7 +38,7 @@ namespace VRCX
var httpClientHandler = new HttpClientHandler();
if (WebApi.ProxySet)
httpClientHandler.Proxy = WebApi.Proxy;
httpClient = new HttpClient(httpClientHandler);
httpClient.DefaultRequestHeaders.Add("User-Agent", Program.Version);
}
@@ -47,7 +47,7 @@ namespace VRCX
{
if (string.IsNullOrEmpty(appImagePath))
return;
AppImagePath = appImagePath;
AppImagePathOld = appImagePath + ".old";
logger.Info($"AppImagePath: {AppImagePath}");
@@ -57,14 +57,14 @@ namespace VRCX
{
if (Process.GetProcessesByName("VRCX_Setup").Length > 0)
Environment.Exit(0);
if (File.Exists(HashLocation))
File.Delete(HashLocation);
if (File.Exists(TempDownload))
File.Delete(TempDownload);
if (File.Exists(VrcxSetupExecutable))
File.Delete(VrcxSetupExecutable);
if (File.Exists(UpdateExecutable))
InstallUpdate();
}
@@ -76,7 +76,7 @@ namespace VRCX
if (Wine.GetIfWine())
setupArguments += "/SKIP_SHORTCUT=true";
#endif
try
{
if (File.Exists(VrcxSetupExecutable))
@@ -104,7 +104,7 @@ namespace VRCX
#endif
}
}
public static async Task DownloadInstallRedist()
{
try
@@ -178,11 +178,11 @@ namespace VRCX
File.Delete(TempDownload);
if (File.Exists(HashLocation))
File.Delete(HashLocation);
var hashesPath = await DownloadFile(hashUrl, _cancellationToken);
if (!string.IsNullOrEmpty(hashesPath))
File.Move(hashesPath, HashLocation);
await using var destination = File.OpenWrite(TempDownload);
using (var response = await httpClient.GetAsync(fileUrl, HttpCompletionOption.ResponseHeadersRead, _cancellationToken))
await using (var download = await response.Content.ReadAsStreamAsync(_cancellationToken))
@@ -216,7 +216,7 @@ namespace VRCX
}
}
destination.Close();
var data = new FileInfo(TempDownload);
if (data.Length != downloadSize)
{

View File

@@ -1,4 +1,4 @@
// Copyright(c) 2019-2022 pypy, Natsumi and individual contributors.
// Copyright(c) 2019-2025 pypy, Natsumi and individual contributors.
// All rights reserved.
//
// This work is licensed under the terms of the MIT license.

View File

@@ -1,4 +1,4 @@
// Copyright(c) 2019-2022 pypy, Natsumi and individual contributors.
// Copyright(c) 2019-2025 pypy, Natsumi and individual contributors.
// All rights reserved.
//
// This work is licensed under the terms of the MIT license.
@@ -14,7 +14,7 @@ namespace VRCX
{
public static class WinApi
{
private static List<(List<string>, string, string)> CpuErrorMessages = new List<(List<string>, string, string)>()
private static List<(List<string>, string, string)> CpuErrorMessages = new List<(List<string>, string, string)>()
{
(["Intel", "Core", "-13"], "VRCX has detected that you're using a 13th or 14th generation Intel CPU.\nThese CPUs are known to have issues which can lead to crashes.\nThis crash was unlikely caused by VRCX itself, therefore limited support can be offered.\nWould you like to open a link with more information?", "https://alderongames.com/intel-crashes"),
(["Intel", "Core", "-14"], "VRCX has detected that you're using a 13th or 14th generation Intel CPU.\nThese CPUs are known to have issues which can lead to crashes.\nThis crash was unlikely caused by VRCX itself, therefore limited support can be offered.\nWould you like to open a link with more information?", "https://alderongames.com/intel-crashes"),
@@ -76,13 +76,13 @@ namespace VRCX
// Fun fact, If a program uses STILL_ACTIVE (259) as an exit code, GetExitCodeProcess will return 259, since it returns... the exit code. This would break this function.
exited = exitCode != 259;
}
finally
finally
{
// Imagine closing process handles.
WinApi.CloseHandle(hProcess);
}
return exited;
}

View File

@@ -1,6 +1,6 @@
MIT License
Copyright (c) 2019 pypy & Natsumi
Copyright (c) 2019-2025 pypy and individual contributors.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,4 +1,4 @@
// Copyright(c) 2019-2024 pypy, Natsumi and individual contributors.
// Copyright(c) 2019-2025 pypy, Natsumi and individual contributors.
// All rights reserved.
//
// This work is licensed under the terms of the MIT license.

View File

@@ -1,7 +1,7 @@
@charset "utf-8";
//
// Copyright(c) 2019-2021 pypy and individual contributors.
// Copyright(c) 2019-2025 pypy and individual contributors.
// All rights reserved.
//
// This work is licensed under the terms of the MIT license.

View File

@@ -98,7 +98,7 @@ mixin loginPage
.x-legal-notice-container
div(style='text-align: center; font-size: 12px')
p #[a.x-link(@click='openExternalLink("https://vrchat.com/home/password")') {{ $t('view.login.forgotPassword') }}]
p &copy; 2019-2024 #[a.x-link(@click='openExternalLink("https://github.com/pypy-vrc")') pypy] &amp; #[a.x-link(@click='openExternalLink("https://github.com/Natsumi-sama")') Natsumi]
p &copy; 2019-2025 #[a.x-link(@click='openExternalLink("https://github.com/pypy-vrc")') pypy] &amp; #[a.x-link(@click='openExternalLink("https://github.com/Natsumi-sama")') Natsumi]
p {{ $t('view.settings.general.legal_notice.info') }}
p {{ $t('view.settings.general.legal_notice.disclaimer1') }}
p {{ $t('view.settings.general.legal_notice.disclaimer2') }}

View File

@@ -203,7 +203,7 @@ mixin settingsTab
.options-container(style='margin-top: 45px; border-top: 1px solid #eee; padding-top: 30px')
span.header {{ $t('view.settings.general.legal_notice.header') }}
.options-container-item
p &copy; 2019-2024 #[a.x-link(@click='openExternalLink("https://github.com/pypy-vrc")') pypy] &amp; #[a.x-link(@click='openExternalLink("https://github.com/Natsumi-sama")') Natsumi]
p &copy; 2019-2025 #[a.x-link(@click='openExternalLink("https://github.com/pypy-vrc")') pypy] &amp; #[a.x-link(@click='openExternalLink("https://github.com/Natsumi-sama")') Natsumi]
p {{ $t('view.settings.general.legal_notice.info') }}
p {{ $t('view.settings.general.legal_notice.disclaimer1') }}
p {{ $t('view.settings.general.legal_notice.disclaimer2') }}

View File

@@ -1,7 +1,7 @@
@charset "utf-8";
//
// Copyright(c) 2019-2021 pypy and individual contributors.
// Copyright(c) 2019-2025 pypy and individual contributors.
// All rights reserved.
//
// This work is licensed under the terms of the MIT license.

View File

@@ -1,4 +1,4 @@
// Copyright(c) 2019-2024 pypy, Natsumi and individual contributors.
// Copyright(c) 2019-2025 pypy, Natsumi and individual contributors.
// All rights reserved.
//
// This work is licensed under the terms of the MIT license.

View File

@@ -1,7 +1,7 @@
@charset "utf-8";
//
// Copyright(c) 2019-2021 pypy and individual contributors.
// Copyright(c) 2019-2025 pypy and individual contributors.
// All rights reserved.
//
// This work is licensed under the terms of the MIT license.