mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-07 06:56:04 +02:00
IPC Fixes (#1415)
* fix chatbox issues * fix ipc issues * add Ipc debug
This commit is contained in:
@@ -12,6 +12,7 @@ const AppDebug = reactive({
|
|||||||
debugGameLog: false,
|
debugGameLog: false,
|
||||||
debugWebRequests: false,
|
debugWebRequests: false,
|
||||||
debugFriendState: false,
|
debugFriendState: false,
|
||||||
|
debugIPC: false,
|
||||||
errorNoty: null,
|
errorNoty: null,
|
||||||
dontLogMeOut: false,
|
dontLogMeOut: false,
|
||||||
endpointDomain: 'https://api.vrchat.cloud/api/1',
|
endpointDomain: 'https://api.vrchat.cloud/api/1',
|
||||||
|
|||||||
+240
-162
@@ -16,7 +16,7 @@ import {
|
|||||||
import { instanceRequest, userRequest } from '../api';
|
import { instanceRequest, userRequest } from '../api';
|
||||||
import { AppDebug } from '../service/appConfig';
|
import { AppDebug } from '../service/appConfig';
|
||||||
import { database } from '../service/database';
|
import { database } from '../service/database';
|
||||||
import { photonEventType } from '../shared/constants/photon';
|
import { photonEmojis, photonEventType } from '../shared/constants/photon';
|
||||||
import { useAvatarStore } from './avatar';
|
import { useAvatarStore } from './avatar';
|
||||||
import { useFavoriteStore } from './favorite';
|
import { useFavoriteStore } from './favorite';
|
||||||
import { useFriendStore } from './friend';
|
import { useFriendStore } from './friend';
|
||||||
@@ -136,6 +136,17 @@ export const usePhotonStore = defineStore('Photon', () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
const chatboxUserBlacklist = ref(new Map());
|
const chatboxUserBlacklist = ref(new Map());
|
||||||
|
// Keyword-based chatbox blacklist (array of strings)
|
||||||
|
const chatboxBlacklist = ref([
|
||||||
|
'NP: ',
|
||||||
|
'Now Playing',
|
||||||
|
'Now playing',
|
||||||
|
"▶️ '",
|
||||||
|
'( ▶️ ',
|
||||||
|
"' - '",
|
||||||
|
"' by '",
|
||||||
|
'[Spotify] '
|
||||||
|
]);
|
||||||
const photonEventTableFilter = ref('');
|
const photonEventTableFilter = ref('');
|
||||||
const moderationAgainstTable = ref([]);
|
const moderationAgainstTable = ref([]);
|
||||||
const photonEventTableTypeFilter = ref([]);
|
const photonEventTableTypeFilter = ref([]);
|
||||||
@@ -150,7 +161,8 @@ export const usePhotonStore = defineStore('Photon', () => {
|
|||||||
photonLobbyTimeoutThresholdConfig,
|
photonLobbyTimeoutThresholdConfig,
|
||||||
photonOverlayMessageTimeoutConfig,
|
photonOverlayMessageTimeoutConfig,
|
||||||
photonEventTableTypeFilterConfig,
|
photonEventTableTypeFilterConfig,
|
||||||
chatboxUserBlacklistConfig
|
chatboxUserBlacklistConfig,
|
||||||
|
chatboxKeywordBlacklistConfig
|
||||||
] = await Promise.all([
|
] = await Promise.all([
|
||||||
configRepository.getBool('VRCX_PhotonEventOverlay', false),
|
configRepository.getBool('VRCX_PhotonEventOverlay', false),
|
||||||
configRepository.getString(
|
configRepository.getString(
|
||||||
@@ -172,7 +184,8 @@ export const usePhotonStore = defineStore('Photon', () => {
|
|||||||
(6000).toString()
|
(6000).toString()
|
||||||
),
|
),
|
||||||
configRepository.getString('VRCX_photonEventTypeFilter', '[]'),
|
configRepository.getString('VRCX_photonEventTypeFilter', '[]'),
|
||||||
configRepository.getString('VRCX_chatboxUserBlacklist')
|
configRepository.getString('VRCX_chatboxUserBlacklist'),
|
||||||
|
configRepository.getString('VRCX_chatboxBlacklist')
|
||||||
]);
|
]);
|
||||||
|
|
||||||
photonEventOverlay.value = photonEventOverlayConfig;
|
photonEventOverlay.value = photonEventOverlayConfig;
|
||||||
@@ -198,6 +211,17 @@ export const usePhotonStore = defineStore('Photon', () => {
|
|||||||
chatboxUserBlacklist.value = new Map(
|
chatboxUserBlacklist.value = new Map(
|
||||||
Object.entries(JSON.parse(chatboxUserBlacklistConfig || '{}'))
|
Object.entries(JSON.parse(chatboxUserBlacklistConfig || '{}'))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (chatboxKeywordBlacklistConfig) {
|
||||||
|
const arr = JSON.parse(chatboxKeywordBlacklistConfig);
|
||||||
|
if (Array.isArray(arr)) {
|
||||||
|
chatboxBlacklist.value = arr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Failed to parse chatbox keyword blacklist config', err);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
initPhotonStates();
|
initPhotonStates();
|
||||||
@@ -303,29 +327,37 @@ export const usePhotonStore = defineStore('Photon', () => {
|
|||||||
}
|
}
|
||||||
if (typeof data.Parameters[249] !== 'undefined') {
|
if (typeof data.Parameters[249] !== 'undefined') {
|
||||||
for (const i in data.Parameters[249]) {
|
for (const i in data.Parameters[249]) {
|
||||||
const id = parseInt(i, 10);
|
const idNum = safeParseInt(i);
|
||||||
|
if (idNum === null) continue;
|
||||||
const user = data.Parameters[249][i];
|
const user = data.Parameters[249][i];
|
||||||
parsePhotonUser(id, user.user, dateTime);
|
if (!user || !user.user) continue;
|
||||||
parsePhotonAvatarChange(
|
parsePhotonUser(idNum, user.user, dateTime);
|
||||||
id,
|
if (user.avatarDict) {
|
||||||
user.user,
|
parsePhotonAvatarChange(
|
||||||
user.avatarDict,
|
idNum,
|
||||||
dateTime
|
user.user,
|
||||||
);
|
user.avatarDict,
|
||||||
parsePhotonGroupChange(
|
dateTime
|
||||||
id,
|
);
|
||||||
user.user,
|
parsePhotonAvatar(user.avatarDict);
|
||||||
user.groupOnNameplate,
|
}
|
||||||
dateTime
|
if (user.favatarDict) {
|
||||||
);
|
parsePhotonAvatar(user.favatarDict);
|
||||||
parsePhotonAvatar(user.avatarDict);
|
}
|
||||||
parsePhotonAvatar(user.favatarDict);
|
if (typeof user.groupOnNameplate !== 'undefined') {
|
||||||
|
parsePhotonGroupChange(
|
||||||
|
idNum,
|
||||||
|
user.user,
|
||||||
|
user.groupOnNameplate,
|
||||||
|
dateTime
|
||||||
|
);
|
||||||
|
}
|
||||||
let hasInstantiated = false;
|
let hasInstantiated = false;
|
||||||
const lobbyJointime = photonLobbyJointime.value.get(id);
|
const lobbyJointime = photonLobbyJointime.value.get(idNum);
|
||||||
if (typeof lobbyJointime !== 'undefined') {
|
if (typeof lobbyJointime !== 'undefined') {
|
||||||
hasInstantiated = lobbyJointime.hasInstantiated;
|
hasInstantiated = lobbyJointime.hasInstantiated;
|
||||||
}
|
}
|
||||||
photonLobbyJointime.value.set(id, {
|
photonLobbyJointime.value.set(idNum, {
|
||||||
joinTime: Date.parse(dateTime),
|
joinTime: Date.parse(dateTime),
|
||||||
hasInstantiated,
|
hasInstantiated,
|
||||||
inVRMode: user.inVRMode,
|
inVRMode: user.inVRMode,
|
||||||
@@ -348,10 +380,12 @@ export const usePhotonStore = defineStore('Photon', () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function checkChatboxBlacklist(msg) {
|
function checkChatboxBlacklist(msg) {
|
||||||
for (let i = 0; i < this.chatboxBlacklist.length; ++i) {
|
if (typeof msg !== 'string') return false;
|
||||||
if (msg.includes(this.chatboxBlacklist[i])) {
|
const list = chatboxBlacklist.value || [];
|
||||||
return true;
|
for (let i = 0; i < list.length; ++i) {
|
||||||
}
|
const kw = list[i];
|
||||||
|
if (!kw) continue;
|
||||||
|
if (msg.includes(kw)) return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -363,6 +397,13 @@ export const usePhotonStore = defineStore('Photon', () => {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function saveChatboxBlacklist() {
|
||||||
|
await configRepository.setString(
|
||||||
|
'VRCX_chatboxBlacklist',
|
||||||
|
JSON.stringify(chatboxBlacklist.value)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
async function photonEventTableFilterChange() {
|
async function photonEventTableFilterChange() {
|
||||||
photonEventTable.value.filters[0].value = photonEventTableFilter.value;
|
photonEventTable.value.filters[0].value = photonEventTableFilter.value;
|
||||||
photonEventTable.value.filters[1].value =
|
photonEventTable.value.filters[1].value =
|
||||||
@@ -689,29 +730,37 @@ export const usePhotonStore = defineStore('Photon', () => {
|
|||||||
// SetUserProperties
|
// SetUserProperties
|
||||||
if (data.Parameters[253] === -1) {
|
if (data.Parameters[253] === -1) {
|
||||||
for (let i in data.Parameters[251]) {
|
for (let i in data.Parameters[251]) {
|
||||||
var id = parseInt(i, 10);
|
const idNum = safeParseInt(i);
|
||||||
var user = data.Parameters[251][i];
|
if (idNum === null) continue;
|
||||||
parsePhotonUser(id, user.user, gameLogDate);
|
const user = data.Parameters[251][i];
|
||||||
parsePhotonAvatarChange(
|
if (!user || !user.user) continue;
|
||||||
id,
|
parsePhotonUser(idNum, user.user, gameLogDate);
|
||||||
user.user,
|
if (user.avatarDict) {
|
||||||
user.avatarDict,
|
parsePhotonAvatarChange(
|
||||||
gameLogDate
|
idNum,
|
||||||
);
|
user.user,
|
||||||
parsePhotonGroupChange(
|
user.avatarDict,
|
||||||
id,
|
gameLogDate
|
||||||
user.user,
|
);
|
||||||
user.groupOnNameplate,
|
parsePhotonAvatar(user.avatarDict);
|
||||||
gameLogDate
|
}
|
||||||
);
|
if (user.favatarDict) {
|
||||||
parsePhotonAvatar(user.avatarDict);
|
parsePhotonAvatar(user.favatarDict);
|
||||||
parsePhotonAvatar(user.favatarDict);
|
}
|
||||||
|
if (typeof user.groupOnNameplate !== 'undefined') {
|
||||||
|
parsePhotonGroupChange(
|
||||||
|
idNum,
|
||||||
|
user.user,
|
||||||
|
user.groupOnNameplate,
|
||||||
|
gameLogDate
|
||||||
|
);
|
||||||
|
}
|
||||||
var hasInstantiated = false;
|
var hasInstantiated = false;
|
||||||
var lobbyJointime = photonLobbyJointime.value.get(id);
|
var lobbyJointime = photonLobbyJointime.value.get(idNum);
|
||||||
if (typeof lobbyJointime !== 'undefined') {
|
if (typeof lobbyJointime !== 'undefined') {
|
||||||
hasInstantiated = lobbyJointime.hasInstantiated;
|
hasInstantiated = lobbyJointime.hasInstantiated;
|
||||||
}
|
}
|
||||||
photonLobbyJointime.value.set(id, {
|
photonLobbyJointime.value.set(idNum, {
|
||||||
joinTime: Date.parse(gameLogDate),
|
joinTime: Date.parse(gameLogDate),
|
||||||
hasInstantiated,
|
hasInstantiated,
|
||||||
inVRMode: user.inVRMode,
|
inVRMode: user.inVRMode,
|
||||||
@@ -723,33 +772,41 @@ export const usePhotonStore = defineStore('Photon', () => {
|
|||||||
useImpostorAsFallback: user.useImpostorAsFallback,
|
useImpostorAsFallback: user.useImpostorAsFallback,
|
||||||
platform: user.platform
|
platform: user.platform
|
||||||
});
|
});
|
||||||
photonUserJoin(id, user, gameLogDate);
|
photonUserJoin(idNum, user, gameLogDate);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log('oldSetUserProps', data);
|
console.log('oldSetUserProps', data);
|
||||||
var id = parseInt(data.Parameters[253], 10);
|
const idNum = safeParseInt(data.Parameters[253]);
|
||||||
var user = data.Parameters[251];
|
if (idNum === null) break;
|
||||||
parsePhotonUser(id, user.user, gameLogDate);
|
const user = data.Parameters[251];
|
||||||
parsePhotonAvatarChange(
|
if (!user || !user.user) break;
|
||||||
id,
|
parsePhotonUser(idNum, user.user, gameLogDate);
|
||||||
user.user,
|
if (user.avatarDict) {
|
||||||
user.avatarDict,
|
parsePhotonAvatarChange(
|
||||||
gameLogDate
|
idNum,
|
||||||
);
|
user.user,
|
||||||
parsePhotonGroupChange(
|
user.avatarDict,
|
||||||
id,
|
gameLogDate
|
||||||
user.user,
|
);
|
||||||
user.groupOnNameplate,
|
parsePhotonAvatar(user.avatarDict);
|
||||||
gameLogDate
|
}
|
||||||
);
|
if (user.favatarDict) {
|
||||||
parsePhotonAvatar(user.avatarDict);
|
parsePhotonAvatar(user.favatarDict);
|
||||||
parsePhotonAvatar(user.favatarDict);
|
}
|
||||||
|
if (typeof user.groupOnNameplate !== 'undefined') {
|
||||||
|
parsePhotonGroupChange(
|
||||||
|
idNum,
|
||||||
|
user.user,
|
||||||
|
user.groupOnNameplate,
|
||||||
|
gameLogDate
|
||||||
|
);
|
||||||
|
}
|
||||||
var hasInstantiated = false;
|
var hasInstantiated = false;
|
||||||
var lobbyJointime = photonLobbyJointime.value.get(id);
|
var lobbyJointime = photonLobbyJointime.value.get(idNum);
|
||||||
if (typeof lobbyJointime !== 'undefined') {
|
if (typeof lobbyJointime !== 'undefined') {
|
||||||
hasInstantiated = lobbyJointime.hasInstantiated;
|
hasInstantiated = lobbyJointime.hasInstantiated;
|
||||||
}
|
}
|
||||||
photonLobbyJointime.value.set(id, {
|
photonLobbyJointime.value.set(idNum, {
|
||||||
joinTime: Date.parse(gameLogDate),
|
joinTime: Date.parse(gameLogDate),
|
||||||
hasInstantiated,
|
hasInstantiated,
|
||||||
inVRMode: user.inVRMode,
|
inVRMode: user.inVRMode,
|
||||||
@@ -761,97 +818,109 @@ export const usePhotonStore = defineStore('Photon', () => {
|
|||||||
useImpostorAsFallback: user.useImpostorAsFallback,
|
useImpostorAsFallback: user.useImpostorAsFallback,
|
||||||
platform: user.platform
|
platform: user.platform
|
||||||
});
|
});
|
||||||
photonUserJoin(id, user, gameLogDate);
|
photonUserJoin(idNum, user, gameLogDate);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 42:
|
case 42:
|
||||||
// SetUserProperties
|
// SetUserProperties
|
||||||
var id = parseInt(data.Parameters[254], 10);
|
var id42 = safeParseInt(data.Parameters[254]);
|
||||||
var user = data.Parameters[245];
|
var user42 = data.Parameters[245];
|
||||||
parsePhotonUser(id, user.user, gameLogDate);
|
if (id42 === null || !user42 || !user42.user) break;
|
||||||
parsePhotonAvatarChange(
|
parsePhotonUser(id42, user42.user, gameLogDate);
|
||||||
id,
|
if (user42.avatarDict) {
|
||||||
user.user,
|
parsePhotonAvatarChange(
|
||||||
user.avatarDict,
|
id42,
|
||||||
gameLogDate
|
user42.user,
|
||||||
);
|
user42.avatarDict,
|
||||||
parsePhotonGroupChange(
|
gameLogDate
|
||||||
id,
|
);
|
||||||
user.user,
|
parsePhotonAvatar(user42.avatarDict);
|
||||||
user.groupOnNameplate,
|
}
|
||||||
gameLogDate
|
if (user42.favatarDict) {
|
||||||
);
|
parsePhotonAvatar(user42.favatarDict);
|
||||||
parsePhotonAvatar(user.avatarDict);
|
}
|
||||||
parsePhotonAvatar(user.favatarDict);
|
if (typeof user42.groupOnNameplate !== 'undefined') {
|
||||||
var lobbyJointime = photonLobbyJointime.value.get(id);
|
parsePhotonGroupChange(
|
||||||
photonLobbyJointime.value.set(id, {
|
id42,
|
||||||
|
user42.user,
|
||||||
|
user42.groupOnNameplate,
|
||||||
|
gameLogDate
|
||||||
|
);
|
||||||
|
}
|
||||||
|
var lobbyJointime = photonLobbyJointime.value.get(id42);
|
||||||
|
photonLobbyJointime.value.set(id42, {
|
||||||
hasInstantiated: true,
|
hasInstantiated: true,
|
||||||
...lobbyJointime,
|
...lobbyJointime,
|
||||||
inVRMode: user.inVRMode,
|
inVRMode: user42.inVRMode,
|
||||||
avatarEyeHeight: user.avatarEyeHeight,
|
avatarEyeHeight: user42.avatarEyeHeight,
|
||||||
canModerateInstance: user.canModerateInstance,
|
canModerateInstance: user42.canModerateInstance,
|
||||||
groupOnNameplate: user.groupOnNameplate,
|
groupOnNameplate: user42.groupOnNameplate,
|
||||||
showGroupBadgeToOthers: user.showGroupBadgeToOthers,
|
showGroupBadgeToOthers: user42.showGroupBadgeToOthers,
|
||||||
showSocialRank: user.showSocialRank,
|
showSocialRank: user42.showSocialRank,
|
||||||
useImpostorAsFallback: user.useImpostorAsFallback,
|
useImpostorAsFallback: user42.useImpostorAsFallback,
|
||||||
platform: user.platform
|
platform: user42.platform
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case 255:
|
case 255:
|
||||||
// Join
|
// Join
|
||||||
|
const id255 = safeParseInt(data.Parameters[254]);
|
||||||
|
if (id255 === null) break;
|
||||||
if (typeof data.Parameters[249] !== 'undefined') {
|
if (typeof data.Parameters[249] !== 'undefined') {
|
||||||
parsePhotonUser(
|
const u255 = data.Parameters[249];
|
||||||
data.Parameters[254],
|
if (u255 && u255.user) {
|
||||||
data.Parameters[249].user,
|
parsePhotonUser(id255, u255.user, gameLogDate);
|
||||||
gameLogDate
|
if (u255.avatarDict) {
|
||||||
);
|
parsePhotonAvatarChange(
|
||||||
parsePhotonAvatarChange(
|
id255,
|
||||||
data.Parameters[254],
|
u255.user,
|
||||||
data.Parameters[249].user,
|
u255.avatarDict,
|
||||||
data.Parameters[249].avatarDict,
|
gameLogDate
|
||||||
gameLogDate
|
);
|
||||||
);
|
parsePhotonAvatar(u255.avatarDict);
|
||||||
parsePhotonGroupChange(
|
}
|
||||||
data.Parameters[254],
|
if (u255.favatarDict) {
|
||||||
data.Parameters[249].user,
|
parsePhotonAvatar(u255.favatarDict);
|
||||||
data.Parameters[249].groupOnNameplate,
|
}
|
||||||
gameLogDate
|
if (typeof u255.groupOnNameplate !== 'undefined') {
|
||||||
);
|
parsePhotonGroupChange(
|
||||||
parsePhotonAvatar(data.Parameters[249].avatarDict);
|
id255,
|
||||||
parsePhotonAvatar(data.Parameters[249].favatarDict);
|
u255.user,
|
||||||
|
u255.groupOnNameplate,
|
||||||
|
gameLogDate
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
parsePhotonLobbyIds(data.Parameters[252]);
|
parsePhotonLobbyIds(data.Parameters[252]);
|
||||||
var hasInstantiated = false;
|
var hasInstantiated = false;
|
||||||
if (photonLobbyCurrentUser.value === data.Parameters[254]) {
|
if (photonLobbyCurrentUser.value === id255) {
|
||||||
// fix current user
|
// fix current user
|
||||||
hasInstantiated = true;
|
hasInstantiated = true;
|
||||||
}
|
}
|
||||||
var ref = photonLobbyCurrent.value.get(data.Parameters[254]);
|
var ref = photonLobbyCurrent.value.get(id255);
|
||||||
if (typeof ref !== 'undefined') {
|
if (typeof ref !== 'undefined') {
|
||||||
// fix for join event firing twice
|
// fix for join event firing twice
|
||||||
// fix instantiation happening out of order before join event
|
// fix instantiation happening out of order before join event
|
||||||
hasInstantiated = ref.hasInstantiated;
|
hasInstantiated = ref.hasInstantiated;
|
||||||
}
|
}
|
||||||
photonLobbyJointime.value.set(data.Parameters[254], {
|
if (data.Parameters[249]) {
|
||||||
joinTime: Date.parse(gameLogDate),
|
photonLobbyJointime.value.set(id255, {
|
||||||
hasInstantiated,
|
joinTime: Date.parse(gameLogDate),
|
||||||
inVRMode: data.Parameters[249].inVRMode,
|
hasInstantiated,
|
||||||
avatarEyeHeight: data.Parameters[249].avatarEyeHeight,
|
inVRMode: data.Parameters[249].inVRMode,
|
||||||
canModerateInstance:
|
avatarEyeHeight: data.Parameters[249].avatarEyeHeight,
|
||||||
data.Parameters[249].canModerateInstance,
|
canModerateInstance:
|
||||||
groupOnNameplate: data.Parameters[249].groupOnNameplate,
|
data.Parameters[249].canModerateInstance,
|
||||||
showGroupBadgeToOthers:
|
groupOnNameplate: data.Parameters[249].groupOnNameplate,
|
||||||
data.Parameters[249].showGroupBadgeToOthers,
|
showGroupBadgeToOthers:
|
||||||
showSocialRank: data.Parameters[249].showSocialRank,
|
data.Parameters[249].showGroupBadgeToOthers,
|
||||||
useImpostorAsFallback:
|
showSocialRank: data.Parameters[249].showSocialRank,
|
||||||
data.Parameters[249].useImpostorAsFallback,
|
useImpostorAsFallback:
|
||||||
platform: data.Parameters[249].platform
|
data.Parameters[249].useImpostorAsFallback,
|
||||||
});
|
platform: data.Parameters[249].platform
|
||||||
photonUserJoin(
|
});
|
||||||
data.Parameters[254],
|
photonUserJoin(id255, data.Parameters[249], gameLogDate);
|
||||||
data.Parameters[249],
|
}
|
||||||
gameLogDate
|
|
||||||
);
|
|
||||||
startLobbyWatcherLoop();
|
startLobbyWatcherLoop();
|
||||||
break;
|
break;
|
||||||
case 254:
|
case 254:
|
||||||
@@ -1028,66 +1097,65 @@ export const usePhotonStore = defineStore('Photon', () => {
|
|||||||
case 70:
|
case 70:
|
||||||
// Portal Spawn
|
// Portal Spawn
|
||||||
if (data.Parameters[245][0] === 20) {
|
if (data.Parameters[245][0] === 20) {
|
||||||
var portalId = data.Parameters[245][1];
|
const portalId = data.Parameters[245][1];
|
||||||
var userId = data.Parameters[245][2];
|
const portalUserId = data.Parameters[245][2];
|
||||||
var shortName = data.Parameters[245][5];
|
const shortName = data.Parameters[245][5];
|
||||||
var worldName = data.Parameters[245][8].name;
|
const portalWorldName = data.Parameters[245][8].name;
|
||||||
addPhotonPortalSpawn(
|
addPhotonPortalSpawn(
|
||||||
gameLogDate,
|
gameLogDate,
|
||||||
userId,
|
portalUserId,
|
||||||
shortName,
|
shortName,
|
||||||
worldName
|
portalWorldName
|
||||||
);
|
);
|
||||||
photonLobbyActivePortals.value.set(portalId, {
|
photonLobbyActivePortals.value.set(portalId, {
|
||||||
userId,
|
userId: portalUserId,
|
||||||
shortName,
|
shortName,
|
||||||
worldName,
|
worldName: portalWorldName,
|
||||||
created_at: Date.parse(gameLogDate),
|
created_at: Date.parse(gameLogDate),
|
||||||
playerCount: 0,
|
|
||||||
pendingLeave: 0
|
pendingLeave: 0
|
||||||
});
|
});
|
||||||
} else if (data.Parameters[245][0] === 21) {
|
} else if (data.Parameters[245][0] === 21) {
|
||||||
var portalId = data.Parameters[245][1];
|
const portalId = data.Parameters[245][1];
|
||||||
var userId = data.Parameters[245][2];
|
const portalUserId = data.Parameters[245][2];
|
||||||
var playerCount = data.Parameters[245][3];
|
const playerCount = data.Parameters[245][3];
|
||||||
var shortName = data.Parameters[245][5];
|
const shortName = data.Parameters[245][5];
|
||||||
var worldName = '';
|
const portalWorldName = '';
|
||||||
addPhotonPortalSpawn(
|
addPhotonPortalSpawn(
|
||||||
gameLogDate,
|
gameLogDate,
|
||||||
userId,
|
portalUserId,
|
||||||
shortName,
|
shortName,
|
||||||
worldName
|
portalWorldName
|
||||||
);
|
);
|
||||||
photonLobbyActivePortals.value.set(portalId, {
|
photonLobbyActivePortals.value.set(portalId, {
|
||||||
userId,
|
userId: portalUserId,
|
||||||
shortName,
|
shortName,
|
||||||
worldName,
|
worldName: portalWorldName,
|
||||||
created_at: Date.parse(gameLogDate),
|
created_at: Date.parse(gameLogDate),
|
||||||
playerCount: 0,
|
playerCount: 0,
|
||||||
pendingLeave: 0
|
pendingLeave: 0
|
||||||
});
|
});
|
||||||
} else if (data.Parameters[245][0] === 22) {
|
} else if (data.Parameters[245][0] === 22) {
|
||||||
var portalId = data.Parameters[245][1];
|
const portalId = data.Parameters[245][1];
|
||||||
var text = 'DeletedPortal';
|
let portalText = 'DeletedPortal';
|
||||||
var ref = photonLobbyActivePortals.value.get(portalId);
|
const ref = photonLobbyActivePortals.value.get(portalId);
|
||||||
if (typeof ref !== 'undefined') {
|
if (typeof ref !== 'undefined') {
|
||||||
var worldName = ref.worldName;
|
const portalWorldName = ref.worldName;
|
||||||
var playerCount = ref.playerCount;
|
const playerCount = ref.playerCount;
|
||||||
const time = timeToText(
|
const time = timeToText(
|
||||||
Date.parse(gameLogDate) - ref.created_at
|
Date.parse(gameLogDate) - ref.created_at
|
||||||
);
|
);
|
||||||
text = `DeletedPortal after ${time} with ${playerCount} players to "${worldName}"`;
|
portalText = `DeletedPortal after ${time} with ${playerCount} players to "${portalWorldName}"`;
|
||||||
}
|
}
|
||||||
addEntryPhotonEvent({
|
addEntryPhotonEvent({
|
||||||
text,
|
text: portalText,
|
||||||
type: 'DeletedPortal',
|
type: 'DeletedPortal',
|
||||||
created_at: gameLogDate
|
created_at: gameLogDate
|
||||||
});
|
});
|
||||||
photonLobbyActivePortals.value.delete(portalId);
|
photonLobbyActivePortals.value.delete(portalId);
|
||||||
} else if (data.Parameters[245][0] === 23) {
|
} else if (data.Parameters[245][0] === 23) {
|
||||||
var portalId = data.Parameters[245][1];
|
const portalId = data.Parameters[245][1];
|
||||||
var playerCount = data.Parameters[245][3];
|
const playerCount = data.Parameters[245][3];
|
||||||
var ref = photonLobbyActivePortals.value.get(portalId);
|
const ref = photonLobbyActivePortals.value.get(portalId);
|
||||||
if (typeof ref !== 'undefined') {
|
if (typeof ref !== 'undefined') {
|
||||||
ref.pendingLeave++;
|
ref.pendingLeave++;
|
||||||
ref.playerCount = playerCount;
|
ref.playerCount = playerCount;
|
||||||
@@ -1299,6 +1367,9 @@ export const usePhotonStore = defineStore('Photon', () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function parsePhotonLobbyIds(lobbyIds) {
|
function parsePhotonLobbyIds(lobbyIds) {
|
||||||
|
if (!Array.isArray(lobbyIds)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
lobbyIds.forEach((id) => {
|
lobbyIds.forEach((id) => {
|
||||||
if (!photonLobby.value.has(id)) {
|
if (!photonLobby.value.has(id)) {
|
||||||
photonLobby.value.set(id);
|
photonLobby.value.set(id);
|
||||||
@@ -1692,7 +1763,7 @@ export const usePhotonStore = defineStore('Photon', () => {
|
|||||||
|
|
||||||
function parsePhotonAvatar(avatar) {
|
function parsePhotonAvatar(avatar) {
|
||||||
if (typeof avatar === 'undefined' || typeof avatar.id === 'undefined') {
|
if (typeof avatar === 'undefined' || typeof avatar.id === 'undefined') {
|
||||||
console.error('PhotonAvatar: avatar is undefined');
|
console.warn('PhotonAvatar: avatar is undefined');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let tags = [];
|
let tags = [];
|
||||||
@@ -1733,6 +1804,11 @@ export const usePhotonStore = defineStore('Photon', () => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function safeParseInt(val) {
|
||||||
|
const n = parseInt(val, 10);
|
||||||
|
return Number.isFinite(n) ? n : null;
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
state,
|
state,
|
||||||
|
|
||||||
@@ -1749,6 +1825,7 @@ export const usePhotonStore = defineStore('Photon', () => {
|
|||||||
photonEventTable,
|
photonEventTable,
|
||||||
photonEventTablePrevious,
|
photonEventTablePrevious,
|
||||||
chatboxUserBlacklist,
|
chatboxUserBlacklist,
|
||||||
|
chatboxBlacklist,
|
||||||
photonEventTableFilter,
|
photonEventTableFilter,
|
||||||
photonLobby,
|
photonLobby,
|
||||||
photonLobbyMaster,
|
photonLobbyMaster,
|
||||||
@@ -1777,6 +1854,7 @@ export const usePhotonStore = defineStore('Photon', () => {
|
|||||||
saveEventOverlay,
|
saveEventOverlay,
|
||||||
checkChatboxBlacklist,
|
checkChatboxBlacklist,
|
||||||
saveChatboxUserBlacklist,
|
saveChatboxUserBlacklist,
|
||||||
|
saveChatboxBlacklist,
|
||||||
photonEventTableFilterChange,
|
photonEventTableFilterChange,
|
||||||
showUserFromPhotonId,
|
showUserFromPhotonId,
|
||||||
promptPhotonOverlayMessageTimeout,
|
promptPhotonOverlayMessageTimeout,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
import { watch } from 'vue';
|
import { watch, computed } from 'vue';
|
||||||
|
|
||||||
import { database } from '../service/database';
|
import { database } from '../service/database';
|
||||||
import { groupRequest } from '../api';
|
import { groupRequest } from '../api';
|
||||||
@@ -60,7 +60,12 @@ export const useUpdateLoopStore = defineStore('UpdateLoop', () => {
|
|||||||
|
|
||||||
const nextDiscordUpdate = state.nextDiscordUpdate;
|
const nextDiscordUpdate = state.nextDiscordUpdate;
|
||||||
|
|
||||||
const ipcTimeout = state.ipcTimeout;
|
const ipcTimeout = computed({
|
||||||
|
get: () => state.ipcTimeout,
|
||||||
|
set: (seconds) => {
|
||||||
|
state.ipcTimeout = Number(seconds) || 0;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
async function updateLoop() {
|
async function updateLoop() {
|
||||||
try {
|
try {
|
||||||
|
|||||||
+22
-5
@@ -422,16 +422,19 @@ export const useVrcxStore = defineStore('Vrcx', () => {
|
|||||||
console.log(`IPC invalid JSON, ${json}`);
|
console.log(`IPC invalid JSON, ${json}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (data.type) {
|
switch (data.type) {
|
||||||
case 'OnEvent':
|
case 'OnEvent':
|
||||||
if (!gameStore.isGameRunning) {
|
if (!gameStore.isGameRunning) {
|
||||||
console.log('Game closed, skipped event', data);
|
console.log('Game closed, skipped event', data);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (AppDebug.debugPhotonLogging) {
|
if (AppDebug.debugPhotonLogging || AppDebug.debugIPC) {
|
||||||
console.log(
|
console.log(
|
||||||
'OnEvent',
|
'OnEvent',
|
||||||
data.OnEventData.Code,
|
data.OnEventData.Code,
|
||||||
|
'Param[254]:',
|
||||||
|
data.OnEventData.Parameters?.[254],
|
||||||
data.OnEventData
|
data.OnEventData
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -443,10 +446,12 @@ export const useVrcxStore = defineStore('Vrcx', () => {
|
|||||||
console.log('Game closed, skipped event', data);
|
console.log('Game closed, skipped event', data);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (AppDebug.debugPhotonLogging) {
|
if (AppDebug.debugPhotonLogging || AppDebug.debugIPC) {
|
||||||
console.log(
|
console.log(
|
||||||
'OnOperationResponse',
|
'OnOperationResponse',
|
||||||
data.OnOperationResponseData.OperationCode,
|
data.OnOperationResponseData.OperationCode,
|
||||||
|
'Param[254]:',
|
||||||
|
data.OnOperationResponseData.Parameters?.[254],
|
||||||
data.OnOperationResponseData
|
data.OnOperationResponseData
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -461,7 +466,7 @@ export const useVrcxStore = defineStore('Vrcx', () => {
|
|||||||
console.log('Game closed, skipped event', data);
|
console.log('Game closed, skipped event', data);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (AppDebug.debugPhotonLogging) {
|
if (AppDebug.debugPhotonLogging || AppDebug.debugIPC) {
|
||||||
console.log(
|
console.log(
|
||||||
'OnOperationRequest',
|
'OnOperationRequest',
|
||||||
data.OnOperationRequestData.OperationCode,
|
data.OnOperationRequestData.OperationCode,
|
||||||
@@ -474,10 +479,16 @@ export const useVrcxStore = defineStore('Vrcx', () => {
|
|||||||
console.log('Game closed, skipped event', data);
|
console.log('Game closed, skipped event', data);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (AppDebug.debugIPC) {
|
||||||
|
console.log('VRCEvent:', data);
|
||||||
|
}
|
||||||
photonStore.parseVRCEvent(data);
|
photonStore.parseVRCEvent(data);
|
||||||
photonStore.photonEventPulse();
|
photonStore.photonEventPulse();
|
||||||
break;
|
break;
|
||||||
case 'Event7List':
|
case 'Event7List':
|
||||||
|
if (AppDebug.debugIPC) {
|
||||||
|
console.log('Event7List:', data);
|
||||||
|
}
|
||||||
photonStore.photonEvent7List.clear();
|
photonStore.photonEvent7List.clear();
|
||||||
for (const [id, dt] of Object.entries(data.Event7List)) {
|
for (const [id, dt] of Object.entries(data.Event7List)) {
|
||||||
photonStore.photonEvent7List.set(parseInt(id, 10), dt);
|
photonStore.photonEvent7List.set(parseInt(id, 10), dt);
|
||||||
@@ -485,19 +496,25 @@ export const useVrcxStore = defineStore('Vrcx', () => {
|
|||||||
photonStore.photonLastEvent7List = Date.parse(data.dt);
|
photonStore.photonLastEvent7List = Date.parse(data.dt);
|
||||||
break;
|
break;
|
||||||
case 'VrcxMessage':
|
case 'VrcxMessage':
|
||||||
if (AppDebug.debugPhotonLogging) {
|
if (AppDebug.debugPhotonLogging || AppDebug.debugIPC) {
|
||||||
console.log('VrcxMessage:', data);
|
console.log('VrcxMessage:', data);
|
||||||
}
|
}
|
||||||
eventVrcxMessage(data);
|
eventVrcxMessage(data);
|
||||||
break;
|
break;
|
||||||
case 'Ping':
|
case 'Ping':
|
||||||
|
if (AppDebug.debugIPC) {
|
||||||
|
console.log('IPC Ping');
|
||||||
|
}
|
||||||
if (!photonStore.photonLoggingEnabled) {
|
if (!photonStore.photonLoggingEnabled) {
|
||||||
photonStore.setPhotonLoggingEnabled();
|
photonStore.setPhotonLoggingEnabled();
|
||||||
}
|
}
|
||||||
ipcEnabled.value = true;
|
ipcEnabled.value = true;
|
||||||
updateLoopStore.ipcTimeout = 60; // 30secs
|
updateLoopStore.ipcTimeout = 60; // 30 seconds
|
||||||
break;
|
break;
|
||||||
case 'MsgPing':
|
case 'MsgPing':
|
||||||
|
if (AppDebug.debugIPC) {
|
||||||
|
console.log('MsgPing:', data);
|
||||||
|
}
|
||||||
state.externalNotifierVersion = data.version;
|
state.externalNotifierVersion = data.version;
|
||||||
break;
|
break;
|
||||||
case 'LaunchCommand':
|
case 'LaunchCommand':
|
||||||
|
|||||||
@@ -187,6 +187,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div v-if="photonLoggingEnabled" style="margin-bottom: 10px">
|
||||||
|
<PhotonEventTable @show-chatbox-blacklist="showChatboxBlacklistDialog" />
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="current-instance-table">
|
<div class="current-instance-table">
|
||||||
<DataTable
|
<DataTable
|
||||||
v-bind="currentInstanceUsersTable"
|
v-bind="currentInstanceUsersTable"
|
||||||
@@ -396,7 +400,6 @@
|
|||||||
<ChatboxBlacklistDialog
|
<ChatboxBlacklistDialog
|
||||||
:chatbox-blacklist-dialog="chatboxBlacklistDialog"
|
:chatbox-blacklist-dialog="chatboxBlacklistDialog"
|
||||||
@delete-chatbox-user-blacklist="deleteChatboxUserBlacklist" />
|
@delete-chatbox-user-blacklist="deleteChatboxUserBlacklist" />
|
||||||
<PhotonEventTable v-if="photonLoggingEnabled" @show-chatbox-blacklist="showChatboxBlacklistDialog" />
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="photon-event-table">
|
<div class="photon-event-table">
|
||||||
<div style="position: absolute; width: 600px; margin-left: 215px; z-index: 1">
|
<div style="display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="photonEventTableTypeFilter"
|
v-model="photonEventTableTypeFilter"
|
||||||
multiple
|
multiple
|
||||||
clearable
|
clearable
|
||||||
collapse-tags
|
collapse-tags
|
||||||
style="flex: 1; width: 220px"
|
style="width: 220px"
|
||||||
:placeholder="t('view.player_list.photon.filter_placeholder')"
|
:placeholder="t('view.player_list.photon.filter_placeholder')"
|
||||||
@change="photonEventTableFilterChange">
|
@change="photonEventTableFilterChange">
|
||||||
<el-option
|
<el-option
|
||||||
@@ -19,19 +19,17 @@
|
|||||||
v-model="photonEventTableFilter"
|
v-model="photonEventTableFilter"
|
||||||
:placeholder="t('view.player_list.photon.search_placeholder')"
|
:placeholder="t('view.player_list.photon.search_placeholder')"
|
||||||
clearable
|
clearable
|
||||||
style="width: 150px; margin-left: 10px"
|
style="width: 150px"
|
||||||
@input="photonEventTableFilterChange"></el-input>
|
@input="photonEventTableFilterChange"></el-input>
|
||||||
<el-button style="margin-left: 10px" @click="emitShowChatboxBlacklist">{{
|
<el-button @click="emitShowChatboxBlacklist">{{
|
||||||
t('view.player_list.photon.chatbox_blacklist')
|
t('view.player_list.photon.chatbox_blacklist')
|
||||||
}}</el-button>
|
}}</el-button>
|
||||||
<el-tooltip placement="bottom" :content="t('view.player_list.photon.status_tooltip')">
|
<el-tooltip placement="bottom" :content="t('view.player_list.photon.status_tooltip')">
|
||||||
<div
|
<div
|
||||||
style="
|
style="
|
||||||
display: inline-block;
|
display: inline-flex;
|
||||||
margin-left: 15px;
|
align-items: center;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
vertical-align: text-top;
|
|
||||||
margin-top: 1px;
|
|
||||||
">
|
">
|
||||||
<span v-if="ipcEnabled && !photonEventIcon">🟢</span>
|
<span v-if="ipcEnabled && !photonEventIcon">🟢</span>
|
||||||
<span v-else-if="ipcEnabled">⚪</span>
|
<span v-else-if="ipcEnabled">⚪</span>
|
||||||
|
|||||||
@@ -44,17 +44,16 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { Delete } from '@element-plus/icons-vue';
|
import { Delete } from '@element-plus/icons-vue';
|
||||||
import { ref } from 'vue';
|
|
||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
import { usePhotonStore } from '../../../stores';
|
import { usePhotonStore } from '../../../stores';
|
||||||
|
|
||||||
import configRepository from '../../../service/config';
|
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
const { chatboxUserBlacklist } = storeToRefs(usePhotonStore());
|
const photonStore = usePhotonStore();
|
||||||
|
const { chatboxUserBlacklist, chatboxBlacklist } = storeToRefs(photonStore);
|
||||||
|
const { saveChatboxBlacklist } = photonStore;
|
||||||
|
|
||||||
defineProps({
|
defineProps({
|
||||||
chatboxBlacklistDialog: {
|
chatboxBlacklistDialog: {
|
||||||
@@ -63,30 +62,8 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const chatboxBlacklist = ref([
|
|
||||||
'NP: ',
|
|
||||||
'Now Playing',
|
|
||||||
'Now playing',
|
|
||||||
"▶️ '",
|
|
||||||
'( ▶️ ',
|
|
||||||
"' - '",
|
|
||||||
"' by '",
|
|
||||||
'[Spotify] '
|
|
||||||
]);
|
|
||||||
|
|
||||||
const emit = defineEmits(['deleteChatboxUserBlacklist']);
|
const emit = defineEmits(['deleteChatboxUserBlacklist']);
|
||||||
|
|
||||||
initChatboxBlacklist();
|
|
||||||
|
|
||||||
async function initChatboxBlacklist() {
|
|
||||||
if (await configRepository.getString('VRCX_chatboxBlacklist')) {
|
|
||||||
chatboxBlacklist.value = JSON.parse(await configRepository.getString('VRCX_chatboxBlacklist'));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function saveChatboxBlacklist() {
|
|
||||||
await configRepository.setString('VRCX_chatboxBlacklist', JSON.stringify(chatboxBlacklist.value));
|
|
||||||
}
|
|
||||||
|
|
||||||
function deleteChatboxUserBlacklist(userId) {
|
function deleteChatboxUserBlacklist(userId) {
|
||||||
emit('deleteChatboxUserBlacklist', userId);
|
emit('deleteChatboxUserBlacklist', userId);
|
||||||
|
|||||||
Reference in New Issue
Block a user