Small fixes

This commit is contained in:
Natsumi
2022-10-26 04:24:34 +13:00
parent a5401553ee
commit 0378ce53b6
+28 -8
View File
@@ -9290,9 +9290,14 @@ speechSynthesis.getVoices();
if (typeof user.inVRMode !== 'undefined') { if (typeof user.inVRMode !== 'undefined') {
this.photonLobbyInVrMode.set(id, user.inVRMode); this.photonLobbyInVrMode.set(id, user.inVRMode);
} }
var hasInstantiated = false;
var lobbyJointime = this.photonLobbyJointime.get(id);
if (typeof lobbyJointime !== 'undefined') {
hasInstantiated = lobbyJointime.hasInstantiated;
}
this.photonLobbyJointime.set(id, { this.photonLobbyJointime.set(id, {
joinTime: Date.parse(gameLogDate), joinTime: Date.parse(gameLogDate),
hasInstantiated: false, hasInstantiated,
inVRMode: user.inVRMode, inVRMode: user.inVRMode,
avatarEyeHeight: user.avatarEyeHeight avatarEyeHeight: user.avatarEyeHeight
}); });
@@ -9372,20 +9377,22 @@ speechSynthesis.getVoices();
} }
this.parsePhotonLobbyIds(data.Parameters[252]); this.parsePhotonLobbyIds(data.Parameters[252]);
var hasInstantiated = false; var hasInstantiated = false;
if ( if (this.photonLobbyCurrentUser === data.Parameters[254]) {
this.photonLobbyCurrentUser === data.Parameters[254] || // fix current user
this.photonLobbyJointime.has(data.Parameters[254])
) {
// fix current user and join event firing twice
hasInstantiated = true; hasInstantiated = true;
} }
var ref = this.photonLobbyCurrent.get(data.Parameters[254]);
if (typeof ref !== 'undefined') {
// fix for join event firing twice
// fix instantiation happening out of order before join event
hasInstantiated = ref.hasInstantiated;
}
this.photonLobbyJointime.set(data.Parameters[254], { this.photonLobbyJointime.set(data.Parameters[254], {
joinTime: Date.parse(gameLogDate), joinTime: Date.parse(gameLogDate),
hasInstantiated, hasInstantiated,
inVRMode: data.Parameters[249].inVRMode, inVRMode: data.Parameters[249].inVRMode,
avatarEyeHeight: data.Parameters[249].avatarEyeHeight avatarEyeHeight: data.Parameters[249].avatarEyeHeight
}); });
var ref = this.photonLobbyCurrent.get(data.Parameters[254]);
this.photonUserJoin( this.photonUserJoin(
data.Parameters[254], data.Parameters[254],
data.Parameters[249].avatarDict, data.Parameters[249].avatarDict,
@@ -9509,12 +9516,20 @@ speechSynthesis.getVoices();
...lobbyJointime, ...lobbyJointime,
hasInstantiated: true hasInstantiated: true
}); });
} else {
this.photonLobbyJointime.set(data.Parameters[254], {
joinTime: Date.parse(gameLogDate),
hasInstantiated: true
});
} }
break; break;
case 43: case 43:
// Chatbox Message // Chatbox Message
var photonId = data.Parameters[254]; var photonId = data.Parameters[254];
var text = data.Parameters[245]; var text = data.Parameters[245];
if (this.photonLobbyCurrentUser === photonId) {
return;
}
this.addEntryPhotonEvent({ this.addEntryPhotonEvent({
photonId, photonId,
text, text,
@@ -20116,9 +20131,14 @@ speechSynthesis.getVoices();
if (typeof user.inVRMode !== 'undefined') { if (typeof user.inVRMode !== 'undefined') {
this.photonLobbyInVrMode.set(id, user.inVRMode); this.photonLobbyInVrMode.set(id, user.inVRMode);
} }
var hasInstantiated = false;
var lobbyJointime = this.photonLobbyJointime.get(id);
if (typeof lobbyJointime !== 'undefined') {
hasInstantiated = lobbyJointime.hasInstantiated;
}
this.photonLobbyJointime.set(id, { this.photonLobbyJointime.set(id, {
joinTime: Date.parse(dateTime), joinTime: Date.parse(dateTime),
hasInstantiated: false, hasInstantiated,
inVRMode: user.inVRMode, inVRMode: user.inVRMode,
avatarEyeHeight: user.avatarEyeHeight avatarEyeHeight: user.avatarEyeHeight
}); });