mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-07 06:56:04 +02:00
Fix timeout overlay not updating
This commit is contained in:
@@ -329,17 +329,20 @@ namespace VRCX
|
|||||||
|
|
||||||
public void ExecuteAppFunction(string function, string json)
|
public void ExecuteAppFunction(string function, string json)
|
||||||
{
|
{
|
||||||
MainForm.Instance.Browser.ExecuteScriptAsync($"$app.{function}", json);
|
if (MainForm.Instance != null)
|
||||||
|
MainForm.Instance.Browser.ExecuteScriptAsync($"$app.{function}", json);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ExecuteVrFeedFunction(string function, string json)
|
public void ExecuteVrFeedFunction(string function, string json)
|
||||||
{
|
{
|
||||||
VRCXVR._browser1.ExecuteScriptAsync($"$app.{function}", json);
|
if (VRCXVR._browser1 != null)
|
||||||
|
VRCXVR._browser1.ExecuteScriptAsync($"$app.{function}", json);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ExecuteVrOverlayFunction(string function, string json)
|
public void ExecuteVrOverlayFunction(string function, string json)
|
||||||
{
|
{
|
||||||
VRCXVR._browser2.ExecuteScriptAsync($"$app.{function}", json);
|
if (VRCXVR._browser2 != null)
|
||||||
|
VRCXVR._browser2.ExecuteScriptAsync($"$app.{function}", json);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GetLaunchCommand()
|
public string GetLaunchCommand()
|
||||||
|
|||||||
+125
-47
@@ -8186,9 +8186,11 @@ speechSynthesis.getVoices();
|
|||||||
var id = parseInt(photonId, 10);
|
var id = parseInt(photonId, 10);
|
||||||
var timeSinceLastEvent = dtNow - Date.parse(dt);
|
var timeSinceLastEvent = dtNow - Date.parse(dt);
|
||||||
if (timeSinceLastEvent > this.photonLobbyTimeoutThreshold) {
|
if (timeSinceLastEvent > this.photonLobbyTimeoutThreshold) {
|
||||||
var joinTime = this.photonLobbyJointime.get(id);
|
if (this.photonLobbyJointime.has(id)) {
|
||||||
|
var {joinTime} = this.photonLobbyJointime.get(id);
|
||||||
|
}
|
||||||
if (!joinTime || joinTime + 120000 < dtNow) {
|
if (!joinTime || joinTime + 120000 < dtNow) {
|
||||||
// wait 1min for user to load in
|
// wait 2mins for user to load in
|
||||||
var displayName = '';
|
var displayName = '';
|
||||||
var userId = '';
|
var userId = '';
|
||||||
var ref = this.photonLobby.get(id);
|
var ref = this.photonLobby.get(id);
|
||||||
@@ -8211,9 +8213,10 @@ speechSynthesis.getVoices();
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
hudTimeout.sort(function (a, b) {
|
if (this.photonLobbyTimeout.length > 0 || hudTimeout.length > 0) {
|
||||||
if (a.time > b.time) {
|
hudTimeout.sort(function (a, b) {
|
||||||
return 1;
|
if (a.time > b.time) {
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
if (a.time < b.time) {
|
if (a.time < b.time) {
|
||||||
return -1;
|
return -1;
|
||||||
@@ -8244,22 +8247,18 @@ speechSynthesis.getVoices();
|
|||||||
}
|
}
|
||||||
AppApi.ExecuteVrOverlayFunction(
|
AppApi.ExecuteVrOverlayFunction(
|
||||||
'updateHudTimeout',
|
'updateHudTimeout',
|
||||||
JSON.stringify(filteredHudTimeout)
|
JSON.stringify(filteredHudTimeout)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (this.photonLobbyTimeout.length > 0 || hudTimeout.length > 0) {
|
|
||||||
this.photonLobbyTimeout = hudTimeout;
|
this.photonLobbyTimeout = hudTimeout;
|
||||||
this.getCurrentInstanceUserList();
|
this.getCurrentInstanceUserList();
|
||||||
} else {
|
|
||||||
this.photonLobbyTimeout = hudTimeout;
|
|
||||||
}
|
}
|
||||||
this.photonBotCheck(event7List);
|
this.photonBotCheck(event7List, dtNow);
|
||||||
});
|
});
|
||||||
setTimeout(() => this.photonLobbyWatcher(), 500);
|
workerTimers.setTimeout(() => this.photonLobbyWatcher(), 500);
|
||||||
};
|
};
|
||||||
|
|
||||||
$app.methods.photonBotCheck = function (event7List) {
|
$app.methods.photonBotCheck = function (event7List, dtNow) {
|
||||||
var dtNow = Date.now();
|
|
||||||
var event7PhotonIds = Object.keys(event7List);
|
var event7PhotonIds = Object.keys(event7List);
|
||||||
var photonBots = [];
|
var photonBots = [];
|
||||||
var currentUserPresent = false;
|
var currentUserPresent = false;
|
||||||
@@ -8267,7 +8266,10 @@ speechSynthesis.getVoices();
|
|||||||
if (typeof ref !== 'undefined' && ref.id === API.currentUser.id) {
|
if (typeof ref !== 'undefined' && ref.id === API.currentUser.id) {
|
||||||
currentUserPresent = true;
|
currentUserPresent = true;
|
||||||
}
|
}
|
||||||
var joinTime = this.photonLobbyJointime.get(id);
|
if (this.photonLobbyJointime.has(id)) {
|
||||||
|
var {joinTime, hasInstantiated, isInvisible, avatarEyeHeight} =
|
||||||
|
this.photonLobbyJointime.get(id);
|
||||||
|
}
|
||||||
if (
|
if (
|
||||||
(!joinTime || joinTime + 3000 < dtNow) &&
|
(!joinTime || joinTime + 3000 < dtNow) &&
|
||||||
typeof ref === 'undefined' &&
|
typeof ref === 'undefined' &&
|
||||||
@@ -8275,6 +8277,69 @@ speechSynthesis.getVoices();
|
|||||||
) {
|
) {
|
||||||
photonBots.unshift(id);
|
photonBots.unshift(id);
|
||||||
}
|
}
|
||||||
|
if (joinTime && joinTime + 10000 < dtNow && !hasInstantiated) {
|
||||||
|
if (!this.photonLobbyBots.includes(id)) {
|
||||||
|
this.addEntryPhotonEvent({
|
||||||
|
photonId: id,
|
||||||
|
displayName: ref.displayName,
|
||||||
|
userId: ref.id,
|
||||||
|
text: 'photon bot has joined',
|
||||||
|
created_at: new Date().toJSON()
|
||||||
|
});
|
||||||
|
}
|
||||||
|
photonBots.unshift(id);
|
||||||
|
}
|
||||||
|
if (isInvisible) {
|
||||||
|
if (!this.photonLobbyBots.includes(id)) {
|
||||||
|
this.addEntryPhotonEvent({
|
||||||
|
photonId: id,
|
||||||
|
displayName: ref.displayName,
|
||||||
|
userId: ref.id,
|
||||||
|
text: 'has joined invisible',
|
||||||
|
created_at: new Date().toJSON()
|
||||||
|
});
|
||||||
|
}
|
||||||
|
photonBots.unshift(id);
|
||||||
|
}
|
||||||
|
if (avatarEyeHeight < 0) {
|
||||||
|
if (!this.photonLobbyBots.includes(id)) {
|
||||||
|
this.addEntryPhotonEvent({
|
||||||
|
photonId: id,
|
||||||
|
displayName: ref.displayName,
|
||||||
|
userId: ref.id,
|
||||||
|
text: 'photon bot has joined',
|
||||||
|
created_at: new Date().toJSON()
|
||||||
|
});
|
||||||
|
}
|
||||||
|
photonBots.unshift(id);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.photonLobbyBots.forEach((id) => {
|
||||||
|
if (!photonBots.includes(id)) {
|
||||||
|
var ref = this.photonLobby.get(id);
|
||||||
|
var userId = '';
|
||||||
|
if (typeof ref.id !== 'undefined') {
|
||||||
|
userId = ref.id;
|
||||||
|
}
|
||||||
|
var displayName = `ID: ${id}`;
|
||||||
|
if (typeof ref.displayName !== 'undefined') {
|
||||||
|
displayName = ref.displayName;
|
||||||
|
}
|
||||||
|
var time = '';
|
||||||
|
if (this.photonLobbyJointime.has(id)) {
|
||||||
|
var {joinTime} = this.photonLobbyJointime.get(id);
|
||||||
|
if (typeof joinTime !== 'undefined') {
|
||||||
|
time = ` ${timeToText(Date.now() - joinTime)}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.addEntryPhotonEvent({
|
||||||
|
photonId: id,
|
||||||
|
displayName,
|
||||||
|
userId,
|
||||||
|
text: `photon bot has left${time}`,
|
||||||
|
created_at: new Date().toJSON()
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
if (this.photonLobbyBots.length !== photonBots.length) {
|
if (this.photonLobbyBots.length !== photonBots.length) {
|
||||||
// bad bug fix is bad
|
// bad bug fix is bad
|
||||||
@@ -8295,18 +8360,6 @@ speechSynthesis.getVoices();
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.updatePhotonLobbyBotSize(photonBots.length);
|
this.updatePhotonLobbyBotSize(photonBots.length);
|
||||||
if (photonBots.length > 0) {
|
|
||||||
var text = `photonBotIds: ${photonBots.toString()}`;
|
|
||||||
} else {
|
|
||||||
var text = 'photonBotIds: 0';
|
|
||||||
}
|
|
||||||
this.addEntryPhotonEvent({
|
|
||||||
photonId: '',
|
|
||||||
displayName: '',
|
|
||||||
userId: '',
|
|
||||||
text,
|
|
||||||
created_at: new Date().toJSON()
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
this.photonLobbyBots = photonBots;
|
this.photonLobbyBots = photonBots;
|
||||||
};
|
};
|
||||||
@@ -8430,6 +8483,15 @@ speechSynthesis.getVoices();
|
|||||||
);
|
);
|
||||||
this.parsePhotonAvatar(data.Parameters[251].avatarDict);
|
this.parsePhotonAvatar(data.Parameters[251].avatarDict);
|
||||||
this.parsePhotonAvatar(data.Parameters[251].favatarDict);
|
this.parsePhotonAvatar(data.Parameters[251].favatarDict);
|
||||||
|
var lobbyJointime = this.photonLobbyJointime.get(
|
||||||
|
data.Parameters[253]
|
||||||
|
);
|
||||||
|
if (typeof lobbyJointime !== 'undefined') {
|
||||||
|
this.photonLobbyJointime.set(data.Parameters[253], {
|
||||||
|
...lobbyJointime,
|
||||||
|
hasInstantiated: true
|
||||||
|
});
|
||||||
|
}
|
||||||
} else if (data.Code === 255) {
|
} else if (data.Code === 255) {
|
||||||
// Join
|
// Join
|
||||||
if (typeof data.Parameters[249] !== 'undefined') {
|
if (typeof data.Parameters[249] !== 'undefined') {
|
||||||
@@ -8448,10 +8510,13 @@ speechSynthesis.getVoices();
|
|||||||
this.parsePhotonAvatar(data.Parameters[249].favatarDict);
|
this.parsePhotonAvatar(data.Parameters[249].favatarDict);
|
||||||
}
|
}
|
||||||
this.parsePhotonLobbyIds(data.Parameters[252].$values);
|
this.parsePhotonLobbyIds(data.Parameters[252].$values);
|
||||||
this.photonLobbyJointime.set(
|
this.photonLobbyJointime.set(data.Parameters[254], {
|
||||||
data.Parameters[254],
|
joinTime: Date.parse(gameLogDate),
|
||||||
Date.parse(gameLogDate)
|
hasInstantiated: false,
|
||||||
);
|
isInvisible: data.Parameters[249].isInvisible,
|
||||||
|
inVRMode: data.Parameters[249].inVRMode,
|
||||||
|
avatarEyeHeight: data.Parameters[249].avatarEyeHeight
|
||||||
|
});
|
||||||
this.startLobbyWatcherLoop();
|
this.startLobbyWatcherLoop();
|
||||||
} else if (data.Code === 254) {
|
} else if (data.Code === 254) {
|
||||||
// Leave
|
// Leave
|
||||||
@@ -8756,6 +8821,7 @@ speechSynthesis.getVoices();
|
|||||||
) {
|
) {
|
||||||
tags = user.tags.$values;
|
tags = user.tags.$values;
|
||||||
}
|
}
|
||||||
|
var ref = API.cachedUsers.get(user.id);
|
||||||
var photonUser = {
|
var photonUser = {
|
||||||
id: user.id,
|
id: user.id,
|
||||||
username: user.username,
|
username: user.username,
|
||||||
@@ -8774,7 +8840,7 @@ speechSynthesis.getVoices();
|
|||||||
};
|
};
|
||||||
this.photonLobby.set(photonId, photonUser);
|
this.photonLobby.set(photonId, photonUser);
|
||||||
this.photonLobbyCurrent.set(photonId, photonUser);
|
this.photonLobbyCurrent.set(photonId, photonUser);
|
||||||
var ref = API.cachedUsers.get(user.id);
|
|
||||||
var bias = Date.parse(gameLogDate) + 60 * 1000; // 1min
|
var bias = Date.parse(gameLogDate) + 60 * 1000; // 1min
|
||||||
if (bias > Date.now()) {
|
if (bias > Date.now()) {
|
||||||
if (typeof ref === 'undefined' || typeof ref.id === 'undefined') {
|
if (typeof ref === 'undefined' || typeof ref.id === 'undefined') {
|
||||||
@@ -8795,15 +8861,16 @@ speechSynthesis.getVoices();
|
|||||||
ref.$location_at = joinTime;
|
ref.$location_at = joinTime;
|
||||||
ref.$online_for = joinTime;
|
ref.$online_for = joinTime;
|
||||||
}
|
}
|
||||||
if (ref.currentAvatarImageUrl !== user.currentAvatarImageUrl) {
|
if (
|
||||||
if (typeof ref.id !== 'undefined') {
|
typeof ref.id !== 'undefined' &&
|
||||||
API.applyUser({
|
ref.currentAvatarImageUrl !== user.currentAvatarImageUrl
|
||||||
...ref,
|
) {
|
||||||
currentAvatarImageUrl: user.currentAvatarImageUrl,
|
API.applyUser({
|
||||||
currentAvatarThumbnailImageUrl:
|
...ref,
|
||||||
user.currentAvatarThumbnailImageUrl
|
currentAvatarImageUrl: user.currentAvatarImageUrl,
|
||||||
});
|
currentAvatarThumbnailImageUrl:
|
||||||
}
|
user.currentAvatarThumbnailImageUrl
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (typeof ref !== 'undefined' && typeof ref.id !== 'undefined') {
|
if (typeof ref !== 'undefined' && typeof ref.id !== 'undefined') {
|
||||||
@@ -12310,11 +12377,22 @@ speechSynthesis.getVoices();
|
|||||||
var timeoutTime = 0;
|
var timeoutTime = 0;
|
||||||
if (typeof ref.id !== 'undefined') {
|
if (typeof ref.id !== 'undefined') {
|
||||||
isFriend = $app.friends.has(ref.id);
|
isFriend = $app.friends.has(ref.id);
|
||||||
$app.photonLobbyTimeout.forEach((ref1) => {
|
if (
|
||||||
if (ref1.userId === ref.id) {
|
$app.timeoutHudOverlayFilter === 'VIP' ||
|
||||||
timeoutTime = ref1.time;
|
$app.timeoutHudOverlayFilter === 'Friends'
|
||||||
}
|
) {
|
||||||
});
|
$app.photonLobbyTimeout.forEach((ref1) => {
|
||||||
|
if (ref1.userId === ref.id) {
|
||||||
|
timeoutTime = ref1.time;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
$app.photonLobbyTimeout.forEach((ref1) => {
|
||||||
|
if (ref1.displayName === ref.displayName) {
|
||||||
|
timeoutTime = ref1.time;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
users.push({
|
users.push({
|
||||||
ref,
|
ref,
|
||||||
|
|||||||
+1
-2
@@ -500,8 +500,7 @@ html
|
|||||||
|
|
|
|
||||||
span.x-link(v-text="scope.row.displayName || scope.row.userId" @click="showUserDialog(scope.row.userId)")
|
span.x-link(v-text="scope.row.displayName || scope.row.userId" @click="showUserDialog(scope.row.userId)")
|
||||||
template(v-if="scope.row.type === 'TrustLevel'")
|
template(v-if="scope.row.type === 'TrustLevel'")
|
||||||
br
|
span ({{ scope.row.previousTrustLevel }} #[i.el-icon-right] {{ scope.row.trustLevel }})
|
||||||
span ({{ scope.row.previousTrustLevel }} #[i.el-icon-right] {{ scope.row.trustLevel }})
|
|
||||||
el-table-column(label="Action" width="80" align="right")
|
el-table-column(label="Action" width="80" align="right")
|
||||||
template(v-once #default="scope")
|
template(v-once #default="scope")
|
||||||
el-button(type="text" icon="el-icon-close" size="mini" @click="deleteFriendLog(scope.row)")
|
el-button(type="text" icon="el-icon-close" size="mini" @click="deleteFriendLog(scope.row)")
|
||||||
|
|||||||
Reference in New Issue
Block a user