|
@@ -107,13 +107,12 @@ export default class XverseAvatarManager extends EventEmitter {
|
|
|
}
|
|
|
if (t.event && [SyncEventType.Appear, SyncEventType.Reset].includes(t.event.type) || !t.event) {
|
|
|
let d = this.avatars.get(t.userId);
|
|
|
- if (t.playerState.avatarId && (d == null ? void 0 : d.avatarId) !== t.playerState.avatarId && (d = void 0,
|
|
|
- this.removeAvatar(t.userId)),
|
|
|
- d) {
|
|
|
- if (d.disconnected && d.setConnectionStatus(!1),
|
|
|
- (u = t.event) != null && u.id && this._room.actionsHandler.confirmEvent(t.event.id),
|
|
|
- t.playerState.nickName && (d == null || d._setNickname(t.playerState.nickName)),
|
|
|
- t.playerState.avatarComponents && !d.isSelf && d.xAvatar) {
|
|
|
+ t.playerState.avatarId && (d == null ? void 0 : d.avatarId) !== t.playerState.avatarId && (d = void 0,this.removeAvatar(t.userId));
|
|
|
+ if (d) {
|
|
|
+ d.disconnected && d.setConnectionStatus(!1);
|
|
|
+ (u = t.event) != null && u.id && this._room.actionsHandler.confirmEvent(t.event.id);
|
|
|
+ t.playerState.nickName && (d == null || d._setNickname(t.playerState.nickName));
|
|
|
+ if (t.playerState.avatarComponents && !d.isSelf && d.xAvatar) {
|
|
|
const _ = safeParseComponents(t.playerState.avatarComponents);
|
|
|
d._changeComponents({
|
|
|
avatarComponents: _,
|
|
@@ -130,6 +129,7 @@ export default class XverseAvatarManager extends EventEmitter {
|
|
|
const b = safeParseComponents(t.playerState.avatarComponents)
|
|
|
, T = safeDecodeURIComponent(t.playerState.nickName)
|
|
|
, C = this.calculatePriority(t.userId, y);
|
|
|
+
|
|
|
this.addAvatar({
|
|
|
userId: t.userId,
|
|
|
isHost: t.playerState.isHost,
|
|
@@ -180,7 +180,19 @@ export default class XverseAvatarManager extends EventEmitter {
|
|
|
}
|
|
|
calculatePriority(e, t) {
|
|
|
var n;
|
|
|
- return e === this._room.userId ? EAvatarRelationRank.Self : (n = this._room.options.firends) != null && n.includes(e) ? EAvatarRelationRank.Friend : EAvatarRelationRank.Stranger
|
|
|
+ if(e === this._room.userId){
|
|
|
+ return EAvatarRelationRank.Self
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ n = this._room.options.firends
|
|
|
+ if(n != null && n.includes(e) ){
|
|
|
+ return EAvatarRelationRank.Friend
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ return EAvatarRelationRank.Stranger
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //return e === this._room.userId ? EAvatarRelationRank.Self : (n = this._room.options.firends) != null && n.includes(e) ? EAvatarRelationRank.Friend : EAvatarRelationRank.Stranger
|
|
|
}
|
|
|
updateAvatarPositionAndRotation(e) {
|
|
|
var t, r;
|