You've already forked Nitro_Render_V3
mirror of
https://github.com/duckietm/Nitro_Render_V3.git
synced 2026-06-20 07:26:18 +00:00
🆙 Stage 1 reconnect
This commit is contained in:
@@ -17,6 +17,7 @@ export class RoomMessageHandler
|
||||
|
||||
private _currentRoomId: number = 0;
|
||||
private _ownUserId: number = 0;
|
||||
private _ownRoomIndex: number = -1;
|
||||
private _initialConnection: boolean = true;
|
||||
private _guideId: number = -1;
|
||||
private _requesterId: number = -1;
|
||||
@@ -635,6 +636,7 @@ export class RoomMessageHandler
|
||||
|
||||
if(user.webID === this._ownUserId)
|
||||
{
|
||||
this._ownRoomIndex = user.roomIndex;
|
||||
this._roomEngine.setRoomSessionOwnUser(this._currentRoomId, user.roomIndex);
|
||||
this._roomEngine.updateRoomObjectUserOwn(this._currentRoomId, user.roomIndex);
|
||||
}
|
||||
@@ -735,6 +737,22 @@ export class RoomMessageHandler
|
||||
this._roomEngine.updateRoomObjectUserLocation(this._currentRoomId, status.id, location, goal, status.canStandUp, height, direction, status.headDirection);
|
||||
this._roomEngine.updateRoomObjectUserFlatControl(this._currentRoomId, status.id, null);
|
||||
|
||||
// Save own user's position for reconnection (only when not locked by reconnect flow)
|
||||
if(status.id === this._ownRoomIndex)
|
||||
{
|
||||
try
|
||||
{
|
||||
const locked = sessionStorage.getItem('nitro.session.posLocked');
|
||||
|
||||
if(!locked)
|
||||
{
|
||||
sessionStorage.setItem('nitro.session.lastPosX', status.x.toString());
|
||||
sessionStorage.setItem('nitro.session.lastPosY', status.y.toString());
|
||||
}
|
||||
}
|
||||
catch(e) { /* ignore */ }
|
||||
}
|
||||
|
||||
let isPosture = true;
|
||||
let postureUpdate = false;
|
||||
let postureType = RoomObjectVariable.STD;
|
||||
|
||||
Reference in New Issue
Block a user