Skip to content

Commit

Permalink
Update copyright year
Browse files Browse the repository at this point in the history
  • Loading branch information
Natsumi-sama committed Jan 31, 2025
1 parent a7c400f commit 481e543
Show file tree
Hide file tree
Showing 33 changed files with 258 additions and 257 deletions.
22 changes: 11 additions & 11 deletions Dotnet/AppApi/Cef/AppApiCef.cs
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -95,7 +95,7 @@ public override void DesktopNotification(string BoldText, string Text = "", stri
logger.Error(ex, "Unknown error when sending desktop notification");
}
}

public override void RestartApplication(bool isUpgrade)
{
var args = new List<string>();
Expand Down Expand Up @@ -125,12 +125,12 @@ public override void RestartApplication(bool isUpgrade)
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)
Expand All @@ -153,7 +153,7 @@ public override string GetLaunchCommand()
StartupArgs.LaunchArguments.LaunchCommand = string.Empty;
return command;
}

public override void FocusWindow()
{
MainForm.Instance.Invoke(new Action(() => { MainForm.Instance.Focus_Window(); }));
Expand All @@ -168,7 +168,7 @@ public override void DoFunny()
{
WinformThemer.DoFunny();
}

public override string GetClipboard()
{
var clipboard = string.Empty;
Expand All @@ -189,7 +189,7 @@ public override void SetStartup(bool enabled)
logger.Warn("Failed to open startup registry key");
return;
}

if (enabled)
{
var path = Application.ExecutablePath;
Expand All @@ -216,7 +216,7 @@ public override void CopyImageToClipboard(string path)
!path.EndsWith(".bmp") &&
!path.EndsWith(".webp")))
return;

MainForm.Instance.BeginInvoke(new MethodInvoker(() =>
{
var image = Image.FromFile(path);
Expand All @@ -227,12 +227,12 @@ public override void CopyImageToClipboard(string path)
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();
Expand Down
21 changes: 11 additions & 10 deletions Dotnet/AssetBundleManager.cs
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -28,7 +28,7 @@ static AssetBundleManager()

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);
Expand All @@ -53,16 +53,17 @@ public string GetAssetVersion(int version, int variantVersion = 0)
{
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];
Expand Down Expand Up @@ -110,7 +111,7 @@ public string GetVRChatCacheFullLocation(string id, int version, string variant
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);
}

Expand All @@ -129,7 +130,7 @@ public Tuple<long, bool, string> CheckVRChatCache(string id, int version, string
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))
Expand Down Expand Up @@ -157,7 +158,7 @@ public void DeleteCache(string id, int version, string variant, int variantVersi
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);
Expand Down Expand Up @@ -206,7 +207,7 @@ public List<string> SweepCache()

if (File.Exists(Path.Join(versionDirectory.FullName, "__lock")))
continue; // skip locked version

versionDirectory.Delete(true);
output.Add($"{cacheDirectory.Name}\\{versionDirectory.Name}");
}
Expand Down
2 changes: 1 addition & 1 deletion Dotnet/Cef/CefCustomDownloadHandler.cs
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion Dotnet/Cef/CefCustomMenuHandler.cs
Original file line number Diff line number Diff line change
@@ -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>.
Expand Down
2 changes: 1 addition & 1 deletion Dotnet/Cef/CefNoopDragHandler.cs
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion Dotnet/Cef/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Dotnet/Cef/MainForm.cs
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
6 changes: 3 additions & 3 deletions Dotnet/Discord.cs
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -119,7 +119,7 @@ public void SetText(string details, string state)
{
if (m_Client == null || m_Lock.IsReadLockHeld)
return;

m_Lock.EnterWriteLock();
try
{
Expand Down Expand Up @@ -179,7 +179,7 @@ public void SetAssets(string largeKey, string largeText, string smallKey, string
m_Lock.ExitWriteLock();
}
}

public void SetTimestamps(double startUnixMilliseconds, double endUnixMilliseconds)
{
var _startUnixMilliseconds = (ulong)startUnixMilliseconds;
Expand Down
4 changes: 2 additions & 2 deletions Dotnet/IPC/IPCClient.cs
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -87,7 +87,7 @@ private void OnRead(IAsyncResult asyncResult)
{
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);
Expand Down
4 changes: 2 additions & 2 deletions Dotnet/IPC/IPCServer.cs
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -33,7 +33,7 @@ public static void Send(IPCPacket ipcPacket)
client?.Send(ipcPacket);
}
}

public static string GetIpcName()
{
var hash = 0;
Expand Down
2 changes: 1 addition & 1 deletion Dotnet/JsonFileSerializer.cs
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
34 changes: 17 additions & 17 deletions Dotnet/LogWatcher.cs
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -618,7 +618,7 @@ private bool ParseLogVideoError(FileInfo fileInfo, LogContext logContext, string
{
// 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.

Expand All @@ -639,7 +639,7 @@ private bool ParseLogVideoError(FileInfo fileInfo, LogContext logContext, string

return true;
}

if (line.Contains("[AVProVideo] Error: "))
{
var data = line.Substring(offset + 20);
Expand Down Expand Up @@ -870,17 +870,17 @@ private bool ParseLogAPIRequest(FileInfo fileInfo, LogContext logContext, string
private bool ParseLogAvatarChange(FileInfo fileInfo, LogContext logContext, string line, int offset)
{
// 2023.11.05 14:45:57 Log - [Behaviour] Switching K․MOG 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,
Expand All @@ -889,7 +889,7 @@ private bool ParseLogAvatarChange(FileInfo fileInfo, LogContext logContext, stri
displayName,
avatarName
});

return true;
}

Expand Down Expand Up @@ -1046,7 +1046,7 @@ private bool ParseLogUdonException(FileInfo fileInfo, string line)
{
// 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[]
Expand All @@ -1058,7 +1058,7 @@ private bool ParseLogUdonException(FileInfo fileInfo, string line)
});
return true;
}

var lineOffset = line.IndexOf(" ---> VRC.Udon.VM.UdonVMException: ", StringComparison.Ordinal);
if (lineOffset < 0)
return false;
Expand Down Expand Up @@ -1102,7 +1102,7 @@ private bool ParseOpenVRInit(FileInfo fileInfo, LogContext logContext, string li

// 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 &&
Expand Down Expand Up @@ -1152,7 +1152,7 @@ private bool ParseLogStringDownload(FileInfo fileInfo, LogContext logContext, st

if (stringData.StartsWith("http://127.0.0.1:22500") || stringData.StartsWith("http://localhost:22500"))
return true; // ignore own requests

AppendLog(new[]
{
fileInfo.Name,
Expand All @@ -1176,10 +1176,10 @@ private bool ParseLogImageDownload(FileInfo fileInfo, LogContext logContext, str

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,
Expand All @@ -1189,7 +1189,7 @@ private bool ParseLogImageDownload(FileInfo fileInfo, LogContext logContext, str
});
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
Expand All @@ -1207,7 +1207,7 @@ private bool ParseVoteKick(FileInfo fileInfo, LogContext logContext, string line
});
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!'
Expand All @@ -1228,7 +1228,7 @@ private bool ParseFailedToJoin(FileInfo fileInfo, LogContext logContext, string
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;

Expand Down
Loading

0 comments on commit 481e543

Please sign in to comment.