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
+11 -11
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. // All rights reserved.
// //
// This work is licensed under the terms of the MIT license. // This work is licensed under the terms of the MIT license.
@@ -27,7 +27,7 @@ namespace VRCX
public partial class AppApiCef : AppApi public partial class AppApiCef : AppApi
{ {
private static readonly Logger logger = LogManager.GetCurrentClassLogger(); private static readonly Logger logger = LogManager.GetCurrentClassLogger();
/// <summary> /// <summary>
/// Shows the developer tools for the main browser window. /// Shows the developer tools for the main browser window.
/// </summary> /// </summary>
@@ -95,7 +95,7 @@ namespace VRCX
logger.Error(ex, "Unknown error when sending desktop notification"); logger.Error(ex, "Unknown error when sending desktop notification");
} }
} }
public override void RestartApplication(bool isUpgrade) public override void RestartApplication(bool isUpgrade)
{ {
var args = new List<string>(); var args = new List<string>();
@@ -125,12 +125,12 @@ namespace VRCX
vrcxProcess.Start(); vrcxProcess.Start();
Environment.Exit(0); Environment.Exit(0);
} }
public override bool CheckForUpdateExe() public override bool CheckForUpdateExe()
{ {
return File.Exists(Path.Join(Program.AppDataDirectory, "update.exe")); return File.Exists(Path.Join(Program.AppDataDirectory, "update.exe"));
} }
public override void ExecuteAppFunction(string function, string json) public override void ExecuteAppFunction(string function, string json)
{ {
if (MainForm.Instance?.Browser != null && !MainForm.Instance.Browser.IsLoading && MainForm.Instance.Browser.CanExecuteJavascriptInMainFrame) if (MainForm.Instance?.Browser != null && !MainForm.Instance.Browser.IsLoading && MainForm.Instance.Browser.CanExecuteJavascriptInMainFrame)
@@ -153,7 +153,7 @@ namespace VRCX
StartupArgs.LaunchArguments.LaunchCommand = string.Empty; StartupArgs.LaunchArguments.LaunchCommand = string.Empty;
return command; return command;
} }
public override void FocusWindow() public override void FocusWindow()
{ {
MainForm.Instance.Invoke(new Action(() => { MainForm.Instance.Focus_Window(); })); MainForm.Instance.Invoke(new Action(() => { MainForm.Instance.Focus_Window(); }));
@@ -168,7 +168,7 @@ namespace VRCX
{ {
WinformThemer.DoFunny(); WinformThemer.DoFunny();
} }
public override string GetClipboard() public override string GetClipboard()
{ {
var clipboard = string.Empty; var clipboard = string.Empty;
@@ -189,7 +189,7 @@ namespace VRCX
logger.Warn("Failed to open startup registry key"); logger.Warn("Failed to open startup registry key");
return; return;
} }
if (enabled) if (enabled)
{ {
var path = Application.ExecutablePath; var path = Application.ExecutablePath;
@@ -216,7 +216,7 @@ namespace VRCX
!path.EndsWith(".bmp") && !path.EndsWith(".bmp") &&
!path.EndsWith(".webp"))) !path.EndsWith(".webp")))
return; return;
MainForm.Instance.BeginInvoke(new MethodInvoker(() => MainForm.Instance.BeginInvoke(new MethodInvoker(() =>
{ {
var image = Image.FromFile(path); var image = Image.FromFile(path);
@@ -227,12 +227,12 @@ namespace VRCX
Clipboard.SetDataObject(data, true); Clipboard.SetDataObject(data, true);
})); }));
} }
public override void FlashWindow() public override void FlashWindow()
{ {
MainForm.Instance.BeginInvoke(new MethodInvoker(() => { WinformThemer.Flash(MainForm.Instance); })); MainForm.Instance.BeginInvoke(new MethodInvoker(() => { WinformThemer.Flash(MainForm.Instance); }));
} }
public override void SetUserAgent() public override void SetUserAgent()
{ {
using var client = MainForm.Instance.Browser.GetDevToolsClient(); using var client = MainForm.Instance.Browser.GetDevToolsClient();
+11 -10
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. // All rights reserved.
// //
// This work is licensed under the terms of the MIT license. // This work is licensed under the terms of the MIT license.
@@ -28,7 +28,7 @@ namespace VRCX
public string GetAssetId(string id, string variant = "") 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)); byte[] hash = sha256.ComputeHash(Encoding.UTF8.GetBytes(id + variant));
StringBuilder idHex = new StringBuilder(hash.Length * 2); StringBuilder idHex = new StringBuilder(hash.Length * 2);
@@ -53,16 +53,17 @@ namespace VRCX
{ {
versionHex += b.ToString("X2"); versionHex += b.ToString("X2");
} }
return versionHex.PadLeft(32, '0'); return versionHex.PadLeft(32, '0');
} }
public (int, int) ReverseHexToDecimal(string hexString) public (int, int) ReverseHexToDecimal(string hexString)
{ {
if (hexString.Length != 32) if (hexString.Length != 32)
return (0, 0); // it's cooked return (0, 0); // it's cooked
try { try
{
var variantVersionHexString = hexString.Substring(0, 8); // 0..8 var variantVersionHexString = hexString.Substring(0, 8); // 0..8
var versionHexString = hexString.Substring(24, 8); // 24..32 var versionHexString = hexString.Substring(24, 8); // 24..32
var versionBytes = new byte[4]; var versionBytes = new byte[4];
@@ -110,7 +111,7 @@ namespace VRCX
var dirs = Directory.GetDirectories(topDir, versionSearchPattern); var dirs = Directory.GetDirectories(topDir, versionSearchPattern);
if (dirs.Length > 0) if (dirs.Length > 0)
return dirs.OrderByDescending(dir => ReverseHexToDecimal(Path.GetFileName(dir)).Item2).First(); return dirs.OrderByDescending(dir => ReverseHexToDecimal(Path.GetFileName(dir)).Item2).First();
return Path.Join(topDir, versionLocation); return Path.Join(topDir, versionLocation);
} }
@@ -129,7 +130,7 @@ namespace VRCX
var fullLocation = GetVRChatCacheFullLocation(id, version); var fullLocation = GetVRChatCacheFullLocation(id, version);
if (!Directory.Exists(fullLocation)) if (!Directory.Exists(fullLocation))
fullLocation = GetVRChatCacheFullLocation(id, version, variant, variantVersion); fullLocation = GetVRChatCacheFullLocation(id, version, variant, variantVersion);
var fileLocation = Path.Join(fullLocation, "__data"); var fileLocation = Path.Join(fullLocation, "__data");
var cachePath = string.Empty; var cachePath = string.Empty;
if (File.Exists(fileLocation)) if (File.Exists(fileLocation))
@@ -157,7 +158,7 @@ namespace VRCX
var path = GetVRChatCacheFullLocation(id, version); var path = GetVRChatCacheFullLocation(id, version);
if (Directory.Exists(path)) if (Directory.Exists(path))
Directory.Delete(path, true); Directory.Delete(path, true);
path = GetVRChatCacheFullLocation(id, version, variant, variantVersion); path = GetVRChatCacheFullLocation(id, version, variant, variantVersion);
if (Directory.Exists(path)) if (Directory.Exists(path))
Directory.Delete(path, true); Directory.Delete(path, true);
@@ -206,7 +207,7 @@ namespace VRCX
if (File.Exists(Path.Join(versionDirectory.FullName, "__lock"))) if (File.Exists(Path.Join(versionDirectory.FullName, "__lock")))
continue; // skip locked version continue; // skip locked version
versionDirectory.Delete(true); versionDirectory.Delete(true);
output.Add($"{cacheDirectory.Name}\\{versionDirectory.Name}"); output.Add($"{cacheDirectory.Name}\\{versionDirectory.Name}");
} }
+1 -1
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. // All rights reserved.
// //
// This work is licensed under the terms of the MIT license. // This work is licensed under the terms of the MIT license.
+1 -1
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. // This work is licensed under the terms of the MIT license.
// For a copy, see <https://opensource.org/licenses/MIT>. // For a copy, see <https://opensource.org/licenses/MIT>.
+1 -1
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. // All rights reserved.
// //
// This work is licensed under the terms of the MIT license. // This work is licensed under the terms of the MIT license.
+1 -1
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. // This work is licensed under the terms of the MIT license.
// For a copy, see <https://opensource.org/licenses/MIT>. // For a copy, see <https://opensource.org/licenses/MIT>.
+1 -1
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. // All rights reserved.
// //
// This work is licensed under the terms of the MIT license. // This work is licensed under the terms of the MIT license.
+3 -3
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. // All rights reserved.
// //
// This work is licensed under the terms of the MIT license. // This work is licensed under the terms of the MIT license.
@@ -119,7 +119,7 @@ namespace VRCX
{ {
if (m_Client == null || m_Lock.IsReadLockHeld) if (m_Client == null || m_Lock.IsReadLockHeld)
return; return;
m_Lock.EnterWriteLock(); m_Lock.EnterWriteLock();
try try
{ {
@@ -179,7 +179,7 @@ namespace VRCX
m_Lock.ExitWriteLock(); m_Lock.ExitWriteLock();
} }
} }
public void SetTimestamps(double startUnixMilliseconds, double endUnixMilliseconds) public void SetTimestamps(double startUnixMilliseconds, double endUnixMilliseconds)
{ {
var _startUnixMilliseconds = (ulong)startUnixMilliseconds; var _startUnixMilliseconds = (ulong)startUnixMilliseconds;
+2 -2
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. // All rights reserved.
// //
// This work is licensed under the terms of the MIT license. // This work is licensed under the terms of the MIT license.
@@ -87,7 +87,7 @@ namespace VRCX
{ {
if (string.IsNullOrEmpty(packet)) if (string.IsNullOrEmpty(packet))
continue; continue;
#if !LINUX #if !LINUX
if (MainForm.Instance?.Browser != null && !MainForm.Instance.Browser.IsLoading && MainForm.Instance.Browser.CanExecuteJavascriptInMainFrame) if (MainForm.Instance?.Browser != null && !MainForm.Instance.Browser.IsLoading && MainForm.Instance.Browser.CanExecuteJavascriptInMainFrame)
MainForm.Instance.Browser.ExecuteScriptAsync("$app.ipcEvent", packet); MainForm.Instance.Browser.ExecuteScriptAsync("$app.ipcEvent", packet);
+2 -2
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. // All rights reserved.
// //
// This work is licensed under the terms of the MIT license. // This work is licensed under the terms of the MIT license.
@@ -33,7 +33,7 @@ namespace VRCX
client?.Send(ipcPacket); client?.Send(ipcPacket);
} }
} }
public static string GetIpcName() public static string GetIpcName()
{ {
var hash = 0; var hash = 0;
+1 -1
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. // All rights reserved.
// //
// This work is licensed under the terms of the MIT license. // This work is licensed under the terms of the MIT license.
+17 -17
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. // All rights reserved.
// //
// This work is licensed under the terms of the MIT license. // 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:37:45 Error - [Video Playback] ERROR: Video unavailable
// 2021.04.08 06:40:07 Error - [Video Playback] ERROR: Private video // 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 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. // 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; return true;
} }
if (line.Contains("[AVProVideo] Error: ")) if (line.Contains("[AVProVideo] Error: "))
{ {
var data = line.Substring(offset + 20); var data = line.Substring(offset + 20);
@@ -870,17 +870,17 @@ namespace VRCX
private bool ParseLogAvatarChange(FileInfo fileInfo, LogContext logContext, string line, int offset) private bool ParseLogAvatarChange(FileInfo fileInfo, LogContext logContext, string line, int offset)
{ {
// 2023.11.05 14:45:57 Log - [Behaviour] Switching KMOG to avatar MoeSera // 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) if (string.Compare(line, offset, "[Behaviour] Switching ", 0, 22, StringComparison.Ordinal) != 0)
return false; return false;
var pos = line.LastIndexOf(" to avatar ", StringComparison.Ordinal); var pos = line.LastIndexOf(" to avatar ", StringComparison.Ordinal);
if (pos < 0) if (pos < 0)
return false; return false;
var displayName = line.Substring(offset + 22, pos - (offset + 22)); var displayName = line.Substring(offset + 22, pos - (offset + 22));
var avatarName = line.Substring(pos + 11); var avatarName = line.Substring(pos + 11);
AppendLog(new[] AppendLog(new[]
{ {
fileInfo.Name, fileInfo.Name,
@@ -889,7 +889,7 @@ namespace VRCX
displayName, displayName,
avatarName avatarName
}); });
return true; 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. // 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. // 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]")) if (line.Contains("[PyPyDance]"))
{ {
AppendLog(new[] AppendLog(new[]
@@ -1058,7 +1058,7 @@ namespace VRCX
}); });
return true; return true;
} }
var lineOffset = line.IndexOf(" ---> VRC.Udon.VM.UdonVMException: ", StringComparison.Ordinal); var lineOffset = line.IndexOf(" ---> VRC.Udon.VM.UdonVMException: ", StringComparison.Ordinal);
if (lineOffset < 0) if (lineOffset < 0)
return false; return false;
@@ -1102,7 +1102,7 @@ namespace VRCX
// 2023.04.22 16:52:28 Log - Initializing VRSDK. // 2023.04.22 16:52:28 Log - Initializing VRSDK.
// 2023.04.22 16:52:29 Log - StartVRSDK: Open VR Loader // 2023.04.22 16:52:29 Log - StartVRSDK: Open VR Loader
// 2024.07.26 01:48:56 Log - STEAMVR HMD Model: Index // 2024.07.26 01:48:56 Log - STEAMVR HMD Model: Index
if (string.Compare(line, offset, "Initializing VRSDK.", 0, 19, StringComparison.Ordinal) != 0 && 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")) if (stringData.StartsWith("http://127.0.0.1:22500") || stringData.StartsWith("http://localhost:22500"))
return true; // ignore own requests return true; // ignore own requests
AppendLog(new[] AppendLog(new[]
{ {
fileInfo.Name, fileInfo.Name,
@@ -1176,10 +1176,10 @@ namespace VRCX
var imageData = line.Substring(lineOffset + check.Length); var imageData = line.Substring(lineOffset + check.Length);
imageData = imageData.Remove(imageData.Length - 1); imageData = imageData.Remove(imageData.Length - 1);
if (imageData.StartsWith("http://127.0.0.1:22500") || imageData.StartsWith("http://localhost:22500")) if (imageData.StartsWith("http://127.0.0.1:22500") || imageData.StartsWith("http://localhost:22500"))
return true; // ignore own requests return true; // ignore own requests
AppendLog(new[] AppendLog(new[]
{ {
fileInfo.Name, fileInfo.Name,
@@ -1189,7 +1189,7 @@ namespace VRCX
}); });
return true; return true;
} }
private bool ParseVoteKick(FileInfo fileInfo, LogContext logContext, string line, int offset) 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 // 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; return true;
} }
private bool ParseFailedToJoin(FileInfo fileInfo, LogContext logContext, string line, int offset) 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!' // 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) 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 // 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) if (string.Compare(line, offset, "Could not Start OSC: ", 0, 21, StringComparison.Ordinal) != 0)
return false; return false;
+7 -7
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. // All rights reserved.
// //
// This work is licensed under the terms of the MIT license. // This work is licensed under the terms of the MIT license.
@@ -25,7 +25,7 @@ namespace VRCX
private DeviceMultithread _deviceMultithread; private DeviceMultithread _deviceMultithread;
private Query _query; private Query _query;
private Texture2D _renderTarget; private Texture2D _renderTarget;
private static readonly Logger logger = LogManager.GetCurrentClassLogger(); private static readonly Logger logger = LogManager.GetCurrentClassLogger();
public OffScreenBrowser(string address, int width, int height) public OffScreenBrowser(string address, int width, int height)
@@ -37,18 +37,18 @@ namespace VRCX
windowInfo.SharedTextureEnabled = true; windowInfo.SharedTextureEnabled = true;
windowInfo.Width = width; windowInfo.Width = width;
windowInfo.Height = height; windowInfo.Height = height;
var browserSettings = new BrowserSettings() var browserSettings = new BrowserSettings()
{ {
DefaultEncoding = "UTF-8", DefaultEncoding = "UTF-8",
WindowlessFrameRate = 60 WindowlessFrameRate = 60
}; };
CreateBrowser(windowInfo, browserSettings); CreateBrowser(windowInfo, browserSettings);
Size = new System.Drawing.Size(width, height); Size = new System.Drawing.Size(width, height);
RenderHandler = this; RenderHandler = this;
JavascriptBindings.ApplyVrJavascriptBindings(JavascriptObjectRepository); JavascriptBindings.ApplyVrJavascriptBindings(JavascriptObjectRepository);
} }
@@ -56,13 +56,13 @@ namespace VRCX
{ {
_device = device; _device = device;
_device1 = _device.QueryInterface<Device1>(); _device1 = _device.QueryInterface<Device1>();
_deviceMultithread?.Dispose(); _deviceMultithread?.Dispose();
_deviceMultithread = _device.QueryInterfaceOrNull<DeviceMultithread>(); _deviceMultithread = _device.QueryInterfaceOrNull<DeviceMultithread>();
_deviceMultithread?.SetMultithreadProtected(true); _deviceMultithread?.SetMultithreadProtected(true);
_renderTarget = renderTarget; _renderTarget = renderTarget;
_query?.Dispose(); _query?.Dispose();
_query = new Query(_device, new QueryDescription _query = new Query(_device, new QueryDescription
{ {
+2 -2
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. // All rights reserved.
// //
// This work is licensed under the terms of the MIT license. // This work is licensed under the terms of the MIT license.
@@ -66,7 +66,7 @@ namespace VRCX
// Safeguard against uninitialized texture // Safeguard against uninitialized texture
if (texture == null) if (texture == null)
return; return;
_paintBufferLock.EnterReadLock(); _paintBufferLock.EnterReadLock();
try try
{ {
+8 -8
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. // All rights reserved.
// //
// This work is licensed under the terms of the MIT license. // This work is licensed under the terms of the MIT license.
@@ -31,7 +31,7 @@ namespace VRCX
{ {
if (enabled == _enabled) if (enabled == _enabled)
return; return;
_enabled = enabled; _enabled = enabled;
if (enabled) if (enabled)
StartThread(); StartThread();
@@ -61,11 +61,11 @@ namespace VRCX
_performanceCounterUpTime?.Dispose(); _performanceCounterUpTime?.Dispose();
_performanceCounterUpTime = null; _performanceCounterUpTime = null;
} }
private void StartThread() private void StartThread()
{ {
Exit(); Exit();
try try
{ {
_performanceCounterCpuUsage = new PerformanceCounter( _performanceCounterCpuUsage = new PerformanceCounter(
@@ -99,7 +99,7 @@ namespace VRCX
logger.Warn($"Failed to create \"Processor Time\" PerformanceCounter ${ex}"); logger.Warn($"Failed to create \"Processor Time\" PerformanceCounter ${ex}");
} }
} }
try try
{ {
_performanceCounterUpTime = new PerformanceCounter("System", "System Up Time"); _performanceCounterUpTime = new PerformanceCounter("System", "System Up Time");
@@ -117,14 +117,14 @@ namespace VRCX
return; return;
} }
logger.Info("SystemMonitor started"); logger.Info("SystemMonitor started");
_thread = new Thread(ThreadProc) _thread = new Thread(ThreadProc)
{ {
IsBackground = true IsBackground = true
}; };
_thread.Start(); _thread.Start();
} }
private void ThreadProc() private void ThreadProc()
{ {
try try
@@ -136,7 +136,7 @@ namespace VRCX
if (_performanceCounterUpTime != null) if (_performanceCounterUpTime != null)
UpTime = TimeSpan.FromSeconds(_performanceCounterUpTime.NextValue()).TotalMilliseconds; UpTime = TimeSpan.FromSeconds(_performanceCounterUpTime.NextValue()).TotalMilliseconds;
Thread.Sleep(1000); Thread.Sleep(1000);
} }
} }
+85 -85
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. // All rights reserved.
// //
// This work is licensed under the terms of the MIT license. // This work is licensed under the terms of the MIT license.
@@ -51,11 +51,11 @@ namespace VRCX
private ulong _hmdOverlayHandle; private ulong _hmdOverlayHandle;
private bool _hmdOverlayActive; private bool _hmdOverlayActive;
private bool _hmdOverlayWasActive; private bool _hmdOverlayWasActive;
private ulong _wristOverlayHandle; private ulong _wristOverlayHandle;
private bool _wristOverlayActive; private bool _wristOverlayActive;
private bool _wristOverlayWasActive; private bool _wristOverlayWasActive;
static VRCXVR() static VRCXVR()
{ {
@@ -98,7 +98,7 @@ namespace VRCX
private void SetupTextures() private void SetupTextures()
{ {
_factory ??= new Factory1(); _factory ??= new Factory1();
_device?.Dispose(); _device?.Dispose();
_device = new Device(_factory.GetAdapter(OpenVR.System.GetD3D9AdapterIndex()), _device = new Device(_factory.GetAdapter(OpenVR.System.GetD3D9AdapterIndex()),
DeviceCreationFlags.BgraSupport); DeviceCreationFlags.BgraSupport);
@@ -136,7 +136,7 @@ namespace VRCX
); );
_hmdOverlay?.UpdateRender(_device, _texture2); _hmdOverlay?.UpdateRender(_device, _texture2);
} }
private void UpgradeDevice() private void UpgradeDevice()
{ {
Device5 device5 = _device.QueryInterfaceOrNull<Device5>(); Device5 device5 = _device.QueryInterfaceOrNull<Device5>();
@@ -186,7 +186,7 @@ namespace VRCX
var overlayVisible1 = false; var overlayVisible1 = false;
var overlayVisible2 = false; var overlayVisible2 = false;
var dashboardHandle = 0UL; var dashboardHandle = 0UL;
_wristOverlay = new OffScreenBrowser( _wristOverlay = new OffScreenBrowser(
"file://vrcx/vr.html?1", "file://vrcx/vr.html?1",
512, 512,
@@ -340,15 +340,15 @@ namespace VRCX
OpenVR.Overlay.DestroyOverlay(_hmdOverlayHandle); OpenVR.Overlay.DestroyOverlay(_hmdOverlayHandle);
_hmdOverlayHandle = 0; _hmdOverlayHandle = 0;
} }
_hmdOverlayWasActive = _hmdOverlayActive; _hmdOverlayWasActive = _hmdOverlayActive;
if (_wristOverlayActive != _wristOverlayWasActive && _wristOverlayHandle != 0) if (_wristOverlayActive != _wristOverlayWasActive && _wristOverlayHandle != 0)
{ {
OpenVR.Overlay.DestroyOverlay(_wristOverlayHandle); OpenVR.Overlay.DestroyOverlay(_wristOverlayHandle);
_wristOverlayHandle = 0; _wristOverlayHandle = 0;
} }
_wristOverlayWasActive = _wristOverlayActive; _wristOverlayWasActive = _wristOverlayActive;
} }
@@ -396,7 +396,7 @@ namespace VRCX
var success = system.GetControllerState(i, ref state, (uint)Marshal.SizeOf(state)); var success = system.GetControllerState(i, ref state, (uint)Marshal.SizeOf(state));
if (!success) if (!success)
break; // this fails while SteamVR overlay is open break; // this fails while SteamVR overlay is open
var prox = state.ulButtonPressed & (1UL << ((int)EVRButtonId.k_EButton_ProximitySensor)); var prox = state.ulButtonPressed & (1UL << ((int)EVRButtonId.k_EButton_ProximitySensor));
var isHmdAfk = prox == 0; var isHmdAfk = prox == 0;
if (isHmdAfk != IsHmdAfk) if (isHmdAfk != IsHmdAfk)
@@ -438,82 +438,82 @@ namespace VRCX
case ETrackedDeviceClass.Controller: case ETrackedDeviceClass.Controller:
case ETrackedDeviceClass.GenericTracker: case ETrackedDeviceClass.GenericTracker:
case ETrackedDeviceClass.TrackingReference: 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; var err = ETrackedPropertyError.TrackedProp_Success;
} var batteryPercentage = system.GetFloatTrackedDeviceProperty(i, ETrackedDeviceProperty.Prop_DeviceBatteryPercentage_Float, ref err);
if (err != ETrackedPropertyError.TrackedProp_Success)
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)) && batteryPercentage = 1f;
(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; 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; var type = string.Empty;
if (devClass == ETrackedDeviceClass.Controller) if (devClass == ETrackedDeviceClass.Controller)
{
if (role == ETrackedControllerRole.LeftHand)
{ {
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, type,
system.IsTrackedDeviceConnected(i) system.IsTrackedDeviceConnected(i)
? "connected" ? "connected"
@@ -524,18 +524,18 @@ namespace VRCX
(batteryPercentage * 100).ToString(), (batteryPercentage * 100).ToString(),
poses[i].eTrackingResult.ToString() poses[i].eTrackingResult.ToString()
}; };
_deviceListLock.EnterWriteLock(); _deviceListLock.EnterWriteLock();
try try
{ {
_deviceList.Add(item); _deviceList.Add(item);
} }
finally finally
{ {
_deviceListLock.ExitWriteLock(); _deviceListLock.ExitWriteLock();
} }
break; break;
} }
} }
} }
} }
@@ -833,7 +833,7 @@ namespace VRCX
return err; return err;
} }
public override void ExecuteVrFeedFunction(string function, string json) public override void ExecuteVrFeedFunction(string function, string json)
{ {
if (_wristOverlay == null) return; if (_wristOverlay == null) return;
+79 -79
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. // All rights reserved.
// //
// This work is licensed under the terms of the MIT license. // This work is licensed under the terms of the MIT license.
@@ -105,7 +105,7 @@ namespace VRCX
CpuAccessFlags = CpuAccessFlags.Write CpuAccessFlags = CpuAccessFlags.Write
} }
); );
_texture2?.Dispose(); _texture2?.Dispose();
_texture2 = new Texture2D( _texture2 = new Texture2D(
_device, _device,
@@ -137,7 +137,7 @@ namespace VRCX
var dashboardHandle = 0UL; var dashboardHandle = 0UL;
var overlayHandle1 = 0UL; var overlayHandle1 = 0UL;
var overlayHandle2 = 0UL; var overlayHandle2 = 0UL;
_wristOverlay = new OffScreenBrowserLegacy( _wristOverlay = new OffScreenBrowserLegacy(
"file://vrcx/vr.html?1", "file://vrcx/vr.html?1",
512, 512,
@@ -324,7 +324,7 @@ namespace VRCX
var success = system.GetControllerState(i, ref state, (uint)Marshal.SizeOf(state)); var success = system.GetControllerState(i, ref state, (uint)Marshal.SizeOf(state));
if (!success) if (!success)
break; // this fails while SteamVR overlay is open break; // this fails while SteamVR overlay is open
var prox = state.ulButtonPressed & (1UL << ((int)EVRButtonId.k_EButton_ProximitySensor)); var prox = state.ulButtonPressed & (1UL << ((int)EVRButtonId.k_EButton_ProximitySensor));
var isHmdAfk = prox == 0; var isHmdAfk = prox == 0;
if (isHmdAfk != IsHmdAfk) if (isHmdAfk != IsHmdAfk)
@@ -366,82 +366,82 @@ namespace VRCX
case ETrackedDeviceClass.Controller: case ETrackedDeviceClass.Controller:
case ETrackedDeviceClass.GenericTracker: case ETrackedDeviceClass.GenericTracker:
case ETrackedDeviceClass.TrackingReference: 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; var err = ETrackedPropertyError.TrackedProp_Success;
} var batteryPercentage = system.GetFloatTrackedDeviceProperty(i, ETrackedDeviceProperty.Prop_DeviceBatteryPercentage_Float, ref err);
if (err != ETrackedPropertyError.TrackedProp_Success)
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)) && batteryPercentage = 1f;
(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; 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; var type = string.Empty;
if (devClass == ETrackedDeviceClass.Controller) if (devClass == ETrackedDeviceClass.Controller)
{
if (role == ETrackedControllerRole.LeftHand)
{ {
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, type,
system.IsTrackedDeviceConnected(i) system.IsTrackedDeviceConnected(i)
? "connected" ? "connected"
@@ -452,18 +452,18 @@ namespace VRCX
(batteryPercentage * 100).ToString(), (batteryPercentage * 100).ToString(),
poses[i].eTrackingResult.ToString() poses[i].eTrackingResult.ToString()
}; };
_deviceListLock.EnterWriteLock(); _deviceListLock.EnterWriteLock();
try try
{ {
_deviceList.Add(item); _deviceList.Add(item);
} }
finally finally
{ {
_deviceListLock.ExitWriteLock(); _deviceListLock.ExitWriteLock();
} }
break; break;
} }
} }
} }
} }
@@ -761,7 +761,7 @@ namespace VRCX
return err; return err;
} }
public override void ExecuteVrFeedFunction(string function, string json) public override void ExecuteVrFeedFunction(string function, string json)
{ {
if (_wristOverlay == null) return; if (_wristOverlay == null) return;
+1 -1
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. // All rights reserved.
// //
// This work is licensed under the terms of the MIT license. // This work is licensed under the terms of the MIT license.
+1 -1
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. // This work is licensed under the terms of the MIT license.
// For a copy, see <https://opensource.org/licenses/MIT>. // For a copy, see <https://opensource.org/licenses/MIT>.
+2 -2
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. // All rights reserved.
// //
// This work is licensed under the terms of the MIT license. // This work is licensed under the terms of the MIT license.
@@ -107,7 +107,7 @@ namespace VRCX
Encoding = System.Text.Encoding.UTF8 Encoding = System.Text.Encoding.UTF8
}; };
builder.ForLogger().FilterMinLevel(LogLevel.Debug).WriteTo(fileTarget); builder.ForLogger().FilterMinLevel(LogLevel.Debug).WriteTo(fileTarget);
var consoleTarget = new ConsoleTarget("consoleTarget") var consoleTarget = new ConsoleTarget("consoleTarget")
{ {
Layout = "${longdate} [${level:uppercase=true:padding=-5}] ${logger:padding=-20} - ${message} ${exception:format=tostring}", Layout = "${longdate} [${level:uppercase=true:padding=-5}] ${logger:padding=-20} - ${message} ${exception:format=tostring}",
+1 -1
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. // All rights reserved.
// //
// This work is licensed under the terms of the MIT license. // This work is licensed under the terms of the MIT license.
+4 -4
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. // All rights reserved.
// //
// This work is licensed under the terms of the MIT license. // This work is licensed under the terms of the MIT license.
@@ -28,7 +28,7 @@ namespace VRCX
public static void ArgsCheck() public static void ArgsCheck()
{ {
var args = Environment.GetCommandLineArgs(); var args = Environment.GetCommandLineArgs();
Debug.Assert(Program.LaunchDebug = true); Debug.Assert(Program.LaunchDebug = true);
var currentProcessArgs = ParseArgs(args); var currentProcessArgs = ParseArgs(args);
@@ -77,7 +77,7 @@ namespace VRCX
if (arg.StartsWith(VrcxLaunchArguments.IsDebugPrefix)) if (arg.StartsWith(VrcxLaunchArguments.IsDebugPrefix))
arguments.IsDebug = true; arguments.IsDebug = true;
if (arg.StartsWith(VrcxLaunchArguments.LaunchCommandPrefix) && arg.Length > VrcxLaunchArguments.LaunchCommandPrefix.Length) if (arg.StartsWith(VrcxLaunchArguments.LaunchCommandPrefix) && arg.Length > VrcxLaunchArguments.LaunchCommandPrefix.Length)
arguments.LaunchCommand = arg.Substring(VrcxLaunchArguments.LaunchCommandPrefix.Length); arguments.LaunchCommand = arg.Substring(VrcxLaunchArguments.LaunchCommandPrefix.Length);
@@ -115,7 +115,7 @@ namespace VRCX
{ {
if (process.Id == Environment.ProcessId) if (process.Id == Environment.ProcessId)
continue; continue;
var commandLine = string.Empty; var commandLine = string.Empty;
try try
{ {
+10 -10
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. // All rights reserved.
// //
// This work is licensed under the terms of the MIT license. // This work is licensed under the terms of the MIT license.
@@ -38,7 +38,7 @@ namespace VRCX
var httpClientHandler = new HttpClientHandler(); var httpClientHandler = new HttpClientHandler();
if (WebApi.ProxySet) if (WebApi.ProxySet)
httpClientHandler.Proxy = WebApi.Proxy; httpClientHandler.Proxy = WebApi.Proxy;
httpClient = new HttpClient(httpClientHandler); httpClient = new HttpClient(httpClientHandler);
httpClient.DefaultRequestHeaders.Add("User-Agent", Program.Version); httpClient.DefaultRequestHeaders.Add("User-Agent", Program.Version);
} }
@@ -47,7 +47,7 @@ namespace VRCX
{ {
if (string.IsNullOrEmpty(appImagePath)) if (string.IsNullOrEmpty(appImagePath))
return; return;
AppImagePath = appImagePath; AppImagePath = appImagePath;
AppImagePathOld = appImagePath + ".old"; AppImagePathOld = appImagePath + ".old";
logger.Info($"AppImagePath: {AppImagePath}"); logger.Info($"AppImagePath: {AppImagePath}");
@@ -57,14 +57,14 @@ namespace VRCX
{ {
if (Process.GetProcessesByName("VRCX_Setup").Length > 0) if (Process.GetProcessesByName("VRCX_Setup").Length > 0)
Environment.Exit(0); Environment.Exit(0);
if (File.Exists(HashLocation)) if (File.Exists(HashLocation))
File.Delete(HashLocation); File.Delete(HashLocation);
if (File.Exists(TempDownload)) if (File.Exists(TempDownload))
File.Delete(TempDownload); File.Delete(TempDownload);
if (File.Exists(VrcxSetupExecutable)) if (File.Exists(VrcxSetupExecutable))
File.Delete(VrcxSetupExecutable); File.Delete(VrcxSetupExecutable);
if (File.Exists(UpdateExecutable)) if (File.Exists(UpdateExecutable))
InstallUpdate(); InstallUpdate();
} }
@@ -76,7 +76,7 @@ namespace VRCX
if (Wine.GetIfWine()) if (Wine.GetIfWine())
setupArguments += "/SKIP_SHORTCUT=true"; setupArguments += "/SKIP_SHORTCUT=true";
#endif #endif
try try
{ {
if (File.Exists(VrcxSetupExecutable)) if (File.Exists(VrcxSetupExecutable))
@@ -104,7 +104,7 @@ namespace VRCX
#endif #endif
} }
} }
public static async Task DownloadInstallRedist() public static async Task DownloadInstallRedist()
{ {
try try
@@ -178,11 +178,11 @@ namespace VRCX
File.Delete(TempDownload); File.Delete(TempDownload);
if (File.Exists(HashLocation)) if (File.Exists(HashLocation))
File.Delete(HashLocation); File.Delete(HashLocation);
var hashesPath = await DownloadFile(hashUrl, _cancellationToken); var hashesPath = await DownloadFile(hashUrl, _cancellationToken);
if (!string.IsNullOrEmpty(hashesPath)) if (!string.IsNullOrEmpty(hashesPath))
File.Move(hashesPath, HashLocation); File.Move(hashesPath, HashLocation);
await using var destination = File.OpenWrite(TempDownload); await using var destination = File.OpenWrite(TempDownload);
using (var response = await httpClient.GetAsync(fileUrl, HttpCompletionOption.ResponseHeadersRead, _cancellationToken)) using (var response = await httpClient.GetAsync(fileUrl, HttpCompletionOption.ResponseHeadersRead, _cancellationToken))
await using (var download = await response.Content.ReadAsStreamAsync(_cancellationToken)) await using (var download = await response.Content.ReadAsStreamAsync(_cancellationToken))
@@ -216,7 +216,7 @@ namespace VRCX
} }
} }
destination.Close(); destination.Close();
var data = new FileInfo(TempDownload); var data = new FileInfo(TempDownload);
if (data.Length != downloadSize) if (data.Length != downloadSize)
{ {
+1 -1
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. // All rights reserved.
// //
// This work is licensed under the terms of the MIT license. // This work is licensed under the terms of the MIT license.
+5 -5
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. // All rights reserved.
// //
// This work is licensed under the terms of the MIT license. // This work is licensed under the terms of the MIT license.
@@ -14,7 +14,7 @@ namespace VRCX
{ {
public static class WinApi 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", "-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"), (["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. // 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; exited = exitCode != 259;
} }
finally finally
{ {
// Imagine closing process handles. // Imagine closing process handles.
WinApi.CloseHandle(hProcess); WinApi.CloseHandle(hProcess);
} }
return exited; return exited;
} }
+1 -1
View File
@@ -1,6 +1,6 @@
MIT License 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 Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
+1 -1
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. // All rights reserved.
// //
// This work is licensed under the terms of the MIT license. // This work is licensed under the terms of the MIT license.
+1 -1
View File
@@ -1,7 +1,7 @@
@charset "utf-8"; @charset "utf-8";
// //
// Copyright(c) 2019-2021 pypy and individual contributors. // Copyright(c) 2019-2025 pypy and individual contributors.
// All rights reserved. // All rights reserved.
// //
// This work is licensed under the terms of the MIT license. // This work is licensed under the terms of the MIT license.
+1 -1
View File
@@ -98,7 +98,7 @@ mixin loginPage
.x-legal-notice-container .x-legal-notice-container
div(style='text-align: center; font-size: 12px') div(style='text-align: center; font-size: 12px')
p #[a.x-link(@click='openExternalLink("https://vrchat.com/home/password")') {{ $t('view.login.forgotPassword') }}] 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.info') }}
p {{ $t('view.settings.general.legal_notice.disclaimer1') }} p {{ $t('view.settings.general.legal_notice.disclaimer1') }}
p {{ $t('view.settings.general.legal_notice.disclaimer2') }} p {{ $t('view.settings.general.legal_notice.disclaimer2') }}
+1 -1
View File
@@ -203,7 +203,7 @@ mixin settingsTab
.options-container(style='margin-top: 45px; border-top: 1px solid #eee; padding-top: 30px') .options-container(style='margin-top: 45px; border-top: 1px solid #eee; padding-top: 30px')
span.header {{ $t('view.settings.general.legal_notice.header') }} span.header {{ $t('view.settings.general.legal_notice.header') }}
.options-container-item .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.info') }}
p {{ $t('view.settings.general.legal_notice.disclaimer1') }} p {{ $t('view.settings.general.legal_notice.disclaimer1') }}
p {{ $t('view.settings.general.legal_notice.disclaimer2') }} p {{ $t('view.settings.general.legal_notice.disclaimer2') }}
+1 -1
View File
@@ -1,7 +1,7 @@
@charset "utf-8"; @charset "utf-8";
// //
// Copyright(c) 2019-2021 pypy and individual contributors. // Copyright(c) 2019-2025 pypy and individual contributors.
// All rights reserved. // All rights reserved.
// //
// This work is licensed under the terms of the MIT license. // This work is licensed under the terms of the MIT license.
+1 -1
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. // All rights reserved.
// //
// This work is licensed under the terms of the MIT license. // This work is licensed under the terms of the MIT license.
+1 -1
View File
@@ -1,7 +1,7 @@
@charset "utf-8"; @charset "utf-8";
// //
// Copyright(c) 2019-2021 pypy and individual contributors. // Copyright(c) 2019-2025 pypy and individual contributors.
// All rights reserved. // All rights reserved.
// //
// This work is licensed under the terms of the MIT license. // This work is licensed under the terms of the MIT license.