This commit is contained in:
Natsumi
2023-01-31 05:29:05 +13:00
parent da87bbe7ed
commit 5484172df8
5 changed files with 56 additions and 24 deletions

View File

@@ -12,7 +12,7 @@ using System.Windows.Forms;
namespace VRCX
{
class StartupArgs
internal class StartupArgs
{
public static string LaunchCommand;
public static Process[] processList;
@@ -22,6 +22,9 @@ namespace VRCX
string[] args = Environment.GetCommandLineArgs();
processList = Process.GetProcessesByName("VRCX");
bool isDebug = false;
Debug.Assert(isDebug = true);
foreach (string arg in args)
{
if (arg.Contains("--gpufix"))
@@ -33,7 +36,7 @@ namespace VRCX
if (arg.Length > 8 && arg.Substring(0, 8) == "--config")
Program.ConfigLocation = arg.Substring(9);
if (arg.Length >= 7 && arg.Substring(0, 7) == "--debug")
if ((arg.Length >= 7 && arg.Substring(0, 7) == "--debug") || isDebug)
Program.LaunchDebug = true;
}

View File

@@ -55,6 +55,7 @@ namespace VRCX
public void ClearCookies()
{
_cookieContainer = new CookieContainer();
SaveCookies();
}
internal void LoadCookies()

View File

@@ -412,6 +412,12 @@ speechSynthesis.getVoices();
if (response.status === 200) {
this.$throw(0, 'Invalid JSON response');
}
if (response.status === 504 || response.status === 502) {
// ignore expected API errors
throw new Error(
`${response.status}: ${response.data} ${endpoint}`
);
}
this.$throw(response.status, endpoint);
return {};
})
@@ -461,16 +467,17 @@ speechSynthesis.getVoices();
}
if (
init.method === 'GET' &&
(status === 404 || status === 403)
(status === 404 || status === 403) &&
!endpoint.startsWith('auth/user')
) {
this.failedGetRequests.set(endpoint, Date.now());
}
if (status === 404 && endpoint.substring(0, 6) === 'users/') {
if (status === 404 && endpoint.startsWith('users/')) {
throw new Error(`404: ${data.error.message} ${endpoint}`);
}
if (
status === 404 &&
endpoint.substring(0, 7) === 'invite/' &&
endpoint.startsWith('invite/') &&
init.inviteId
) {
this.expireNotification(init.inviteId);
@@ -4304,6 +4311,19 @@ speechSynthesis.getVoices();
});
break;
case 'response-notification':
this.$emit('NOTIFICATION:HIDE', {
params: {
notificationId: content.notificationId
}
});
this.$emit('NOTIFICATION:SEE', {
params: {
notificationId: content.notificationId
}
});
break;
case 'friend-add':
this.$emit('USER', {
json: content.user,
@@ -9685,9 +9705,14 @@ speechSynthesis.getVoices();
if (input.photonId === this.photonLobbyMaster) {
isMaster = true;
}
var userId = this.getUserIdFromPhotonId(input.photonId);
var isFavorite = API.cachedFavoritesByObjectId.has(userId);
var isFriend = this.friends.has(userId);
var feed = {
displayName: this.getDisplayNameFromPhotonId(input.photonId),
userId: this.getUserIdFromPhotonId(input.photonId),
userId,
isFavorite,
isFriend,
isMaster,
...input
};
@@ -9705,10 +9730,9 @@ speechSynthesis.getVoices();
) {
if (
feed.userId &&
((this.photonEventOverlayFilter === 'VIP' &&
API.cachedFavoritesByObjectId.has(feed.userId)) ||
((this.photonEventOverlayFilter === 'VIP' && isFavorite) ||
(this.photonEventOverlayFilter === 'Friends' &&
this.friends.has(feed.userId)))
isFriend))
) {
AppApi.ExecuteVrOverlayFunction(
'addEntryHudFeed',
@@ -11530,7 +11554,7 @@ speechSynthesis.getVoices();
this.searchUserParams = {
n: 10,
offset: 0,
search: this.searchText
search: this.replaceBioSymbols(this.searchText)
};
await this.moreSearchUser();
};
@@ -11608,7 +11632,7 @@ speechSynthesis.getVoices();
break;
default:
params.sort = 'relevance';
params.search = this.searchText;
params.search = this.replaceBioSymbols(this.searchText);
break;
}
params.order = ref.sortOrder || 'descending';

View File

@@ -20,7 +20,7 @@ html
span.extra
span.time {{ feed.created_at | formatDate }}
i.el-icon-loading(v-if="feed.isTraveling" style="margin-right:5px")
| #[span.name(v-text="feed.displayName")] #[location(:location="feed.location" :hint="feed.worldName")]
| #[span.name(v-text="feed.displayName")] #[location(:location="feed.location" :hint="feed.worldName" :grouphint="feed.groupName")]
div(v-else-if="feed.type === 'Offline'" class="x-friend-item" :class="{ friend: feed.isFriend, favorite: feed.isFavorite }")
.detail
span.extra
@@ -32,7 +32,7 @@ html
span.time {{ feed.created_at | formatDate }}
| #[span.name(v-text="feed.displayName")] ✔
template(v-if="feed.worldName")
| #[location(:location="feed.location" :hint="feed.worldName" style="margin-left:5px")]
| #[location(:location="feed.location" :hint="feed.worldName" :grouphint="feed.groupName" style="margin-left:5px")]
div(v-else-if="feed.type === 'Status'" class="x-friend-item" :class="{ friend: feed.isFriend, favorite: feed.isFavorite }")
.detail
span.extra
@@ -64,7 +64,7 @@ html
.detail
span.extra
span.time {{ feed.created_at | formatDate }}
location(:location="feed.location" :hint="feed.worldName")
location(:location="feed.location" :hint="feed.worldName" :grouphint="feed.groupName")
div(v-else-if="feed.type === 'VideoPlay'" class="x-friend-item" :class="{ friend: feed.isFriend, favorite: feed.isFavorite }")
.detail
span.extra
@@ -145,7 +145,7 @@ html
span.time {{ feed.created_at | formatDate }}
template(v-if="feed.displayName")
| ✨ #[span.name(v-text="feed.displayName" style="margin-right:5px")]
| #[location(:location="feed.instanceId" :hint="feed.worldName")]
| #[location(:location="feed.instanceId" :hint="feed.worldName" :grouphint="feed.groupName")]
template(v-else)
| ✨ User has spawned a portal
div(v-else-if="feed.type === 'AvatarChange'" class="x-friend-item" :class="{ friend: feed.isFriend, favorite: feed.isFavorite }")
@@ -217,9 +217,9 @@ html
span.extra
span.time {{ feed.created_at | formatDate }}
template(v-if="feed.isTraveling")
| #[span.name(v-text="feed.displayName")] is traveling to #[location(:location="feed.location" :hint="feed.worldName")]
| #[span.name(v-text="feed.displayName")] is traveling to #[location(:location="feed.location" :hint="feed.worldName" :grouphint="feed.groupName")]
template(v-else)
| #[span.name(v-text="feed.displayName")] is in #[location(:location="feed.location" :hint="feed.worldName")]
| #[span.name(v-text="feed.displayName")] is in #[location(:location="feed.location" :hint="feed.worldName" :grouphint="feed.groupName")]
div(v-else-if="feed.type === 'Offline'" class="x-friend-item" :class="{ friend: feed.isFriend, favorite: feed.isFavorite }")
.detail
span.extra
@@ -232,7 +232,7 @@ html
| #[span.name(v-text="feed.displayName")]
span(style="margin-left:5px;margin-right:5px") has logged in
template(v-if="feed.worldName")
| to #[location(:location="feed.location" :hint="feed.worldName")]
| to #[location(:location="feed.location" :hint="feed.worldName" :grouphint="feed.groupName")]
div(v-else-if="feed.type === 'Status'" class="x-friend-item" :class="{ friend: feed.isFriend, favorite: feed.isFavorite }")
.detail
span.extra
@@ -263,7 +263,7 @@ html
.detail
span.extra
span.time {{ feed.created_at | formatDate }}
location(:location="feed.location" :hint="feed.worldName")
location(:location="feed.location" :hint="feed.worldName" :grouphint="feed.groupName")
div(v-else-if="feed.type === 'VideoPlay'" class="x-friend-item" :class="{ friend: feed.isFriend, favorite: feed.isFavorite }")
.detail
span.extra
@@ -345,7 +345,7 @@ html
span.time {{ feed.created_at | formatDate }}
template(v-if="feed.displayName")
| #[span.name(v-text="feed.displayName")] has spawned a portal to
| #[location(:location="feed.instanceId" :hint="feed.worldName" style="margin-left:5px")]
| #[location(:location="feed.instanceId" :hint="feed.worldName" :grouphint="feed.groupName" style="margin-left:5px")]
template(v-else)
| User has spawned a portal
div(v-else-if="feed.type === 'AvatarChange'" class="x-friend-item" :class="{ friend: feed.isFriend, favorite: feed.isFavorite }")
@@ -479,7 +479,7 @@ html
circle(class="np-progress-circle-stroke" cx="60" cy="60" stroke="white" r="30" fill="transparent" stroke-width="60")
.hud-feed
div(v-for="feed in hudFeed")
.item #[span(v-if="feed.isMaster") 👑]<strong>{{ feed.displayName }}</strong>
.item(:class="{ friend: feed.isFriend, favorite: feed.isFavorite }") #[span(v-if="feed.isMaster") 👑]#[strong.name(v-text="feed.displayName")]
template(v-if="feed.type === 'ChangeAvatar'")
span(style="margin-left:10px;color:#a3a3a3") ChangeAvatar
span(v-if="!feed.inCache" style="color:#aaa;margin-left:10px") #[i.el-icon-download]
@@ -502,7 +502,7 @@ html
span(v-text="feed.text" style="margin-left:10px;white-space:normal")
template(v-else-if="feed.type === 'PortalSpawn'")
span(style="margin-left:10px;color:#a3a3a3") PortalSpawn
location(:location="feed.location" :hint="feed.worldName" :link="false" style="margin-left:10px")
location(:location="feed.location" :hint="feed.worldName" :grouphint="feed.groupName" :link="false" style="margin-left:10px")
template(v-else-if="feed.type === 'OnPlayerJoined'")
span(style="margin-left:10px;color:#a3a3a3") has joined
span(v-if="feed.platform === 'Desktop'" style="color:#409eff;margin-left:10px") PC

View File

@@ -255,11 +255,15 @@ button {
font-weight: bold;
}
.x-friend-item.friend .name {
.item .name {
color: #c5c5c5;
}
.friend .name {
color: #fff;
}
.x-friend-item.favorite .name {
.favorite .name {
color: #ff0;
}