mirror of
https://github.com/vrcx-team/VRCX.git
synced 2026-04-06 00:32:02 +02:00
Fix random bugs
This commit is contained in:
@@ -21,7 +21,7 @@ namespace VRCX
|
||||
public override void VrInit()
|
||||
{
|
||||
if (MainForm.Instance?.Browser != null && !MainForm.Instance.Browser.IsLoading && MainForm.Instance.Browser.CanExecuteJavascriptInMainFrame)
|
||||
MainForm.Instance.Browser.ExecuteScriptAsync("$pinia.vr.vrInit", "");
|
||||
MainForm.Instance.Browser.ExecuteScriptAsync("window?.$pinia.vr.vrInit");
|
||||
}
|
||||
|
||||
public override void ToggleSystemMonitor(bool enabled)
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace VRCX
|
||||
|
||||
// TODO: fix this throwing an exception for being called before the browser is ready. somehow it gets past the checks
|
||||
if (MainForm.Instance?.Browser != null && !MainForm.Instance.Browser.IsLoading && MainForm.Instance.Browser.CanExecuteJavascriptInMainFrame)
|
||||
MainForm.Instance.Browser.ExecuteScriptAsync("$pinia.game.updateIsGameRunning", isGameRunning, isSteamVRRunning, isHmdAfk);
|
||||
MainForm.Instance.Browser.ExecuteScriptAsync("window?.$pinia.game.updateIsGameRunning", isGameRunning, isSteamVRRunning, isHmdAfk);
|
||||
}
|
||||
|
||||
public override bool IsGameRunning()
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace VRCX
|
||||
}
|
||||
|
||||
if (MainForm.Instance?.Browser != null && !MainForm.Instance.Browser.IsLoading && MainForm.Instance.Browser.CanExecuteJavascriptInMainFrame)
|
||||
MainForm.Instance.Browser.ExecuteScriptAsync("$pinia.vrcx.dragEnterCef", file);
|
||||
MainForm.Instance.Browser.ExecuteScriptAsync("window?.$pinia.vrcx.dragEnterCef", file);
|
||||
|
||||
dragData.Dispose();
|
||||
return false;
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace VRCX
|
||||
Browser.GotFocus += (_, _) =>
|
||||
{
|
||||
if (Browser != null && !Browser.IsLoading && Browser.CanExecuteJavascriptInMainFrame)
|
||||
Browser.ExecuteScriptAsync("$pinia.vrcStatus.onBrowserFocus()");
|
||||
Browser.ExecuteScriptAsync("window?.$pinia.vrcStatus.onBrowserFocus");
|
||||
};
|
||||
|
||||
JavascriptBindings.ApplyAppJavascriptBindings(Browser.JavascriptObjectRepository);
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace VRCX
|
||||
}
|
||||
catch
|
||||
{
|
||||
IPCServer.Clients.Remove(this);
|
||||
IPCServer.Clients.TryRemove(this, out _);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace VRCX
|
||||
|
||||
if (bytesRead <= 0)
|
||||
{
|
||||
IPCServer.Clients.Remove(this);
|
||||
IPCServer.Clients.TryRemove(this, out _);
|
||||
_ipcServer.Close();
|
||||
return;
|
||||
}
|
||||
@@ -90,7 +90,7 @@ namespace VRCX
|
||||
|
||||
#if !LINUX
|
||||
if (MainForm.Instance?.Browser != null && !MainForm.Instance.Browser.IsLoading && MainForm.Instance.Browser.CanExecuteJavascriptInMainFrame)
|
||||
MainForm.Instance.Browser.ExecuteScriptAsync("$pinia.vrcx.ipcEvent", packet);
|
||||
MainForm.Instance.Browser.ExecuteScriptAsync("window?.$pinia.vrcx.ipcEvent", packet);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
// For a copy, see <https://opensource.org/licenses/MIT>.
|
||||
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.IO.Pipes;
|
||||
using System.Threading.Tasks;
|
||||
@@ -14,7 +15,7 @@ namespace VRCX
|
||||
public class IPCServer
|
||||
{
|
||||
public static readonly IPCServer Instance;
|
||||
public static readonly List<IPCClient> Clients = new List<IPCClient>();
|
||||
public static readonly ConcurrentDictionary<IPCClient, byte> Clients = new();
|
||||
|
||||
static IPCServer()
|
||||
{
|
||||
@@ -30,7 +31,7 @@ namespace VRCX
|
||||
{
|
||||
foreach (var client in Clients)
|
||||
{
|
||||
client?.Send(ipcPacket);
|
||||
client.Key?.Send(ipcPacket);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +65,7 @@ namespace VRCX
|
||||
}
|
||||
|
||||
var ipcClient = new IPCClient(ipcServer);
|
||||
Clients.Add(ipcClient);
|
||||
Clients.TryAdd(ipcClient, 0);
|
||||
ipcClient.BeginRead();
|
||||
CreateIPCServer();
|
||||
}
|
||||
|
||||
@@ -297,7 +297,7 @@ namespace VRCX
|
||||
m_LogQueue.Enqueue(logLine);
|
||||
#else
|
||||
if (MainForm.Instance != null && MainForm.Instance.Browser != null)
|
||||
MainForm.Instance.Browser.ExecuteScriptAsync("$pinia.gameLog.addGameLogEvent", logLine);
|
||||
MainForm.Instance.Browser.ExecuteScriptAsync("window?.$pinia.gameLog.addGameLogEvent", logLine);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -422,7 +422,7 @@ export const useVrcxStore = defineStore('Vrcx', () => {
|
||||
console.log(`IPC invalid JSON, ${json}`);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
switch (data.type) {
|
||||
case 'OnEvent':
|
||||
if (!gameStore.isGameRunning) {
|
||||
|
||||
@@ -367,6 +367,7 @@
|
||||
useAuthStore,
|
||||
useAvatarProviderStore,
|
||||
useAvatarStore,
|
||||
useGameLogStore,
|
||||
useGroupStore,
|
||||
useInstanceStore,
|
||||
useLaunchStore,
|
||||
@@ -395,6 +396,7 @@
|
||||
const { showLaunchOptions } = useLaunchStore();
|
||||
const { enablePrimaryPasswordChange } = useAuthStore();
|
||||
const { showConsole, clearVRCXCache, showRegistryBackupDialog } = useVrcxStore();
|
||||
const { disableGameLogDialog } = useGameLogStore();
|
||||
|
||||
const { cachedUsers } = useUserStore();
|
||||
const { cachedWorlds } = useWorldStore();
|
||||
|
||||
Reference in New Issue
Block a user