You've already forked Nitro_Render_V3
mirror of
https://github.com/duckietm/Nitro_Render_V3.git
synced 2026-06-19 15:06:20 +00:00
chore: checkpoint current work
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -277,6 +277,7 @@ export class OutgoingHeader
|
||||
public static WIRED_USER_VARIABLES_REQUEST = 10024;
|
||||
public static WIRED_USER_VARIABLE_UPDATE = 10025;
|
||||
public static WIRED_USER_VARIABLE_MANAGE = 10026;
|
||||
public static WIRED_USER_INSPECT_MOVE = 10027;
|
||||
public static WIRED_OPEN = 768;
|
||||
public static WIRED_TRIGGER_SAVE = 1520;
|
||||
public static GET_ITEM_DATA = 3964;
|
||||
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
import { IMessageComposer } from '@nitrots/api';
|
||||
|
||||
export class WiredUserInspectMoveComposer implements IMessageComposer<ConstructorParameters<typeof WiredUserInspectMoveComposer>>
|
||||
{
|
||||
private _data: ConstructorParameters<typeof WiredUserInspectMoveComposer>;
|
||||
|
||||
constructor(roomUnitId: number, x: number, y: number, direction: number)
|
||||
{
|
||||
this._data = [ roomUnitId, x, y, direction ];
|
||||
}
|
||||
|
||||
public getMessageArray()
|
||||
{
|
||||
return this._data;
|
||||
}
|
||||
|
||||
public dispose(): void
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ export * from './UpdateTriggerMessageComposer';
|
||||
export * from './WiredMonitorRequestComposer';
|
||||
export * from './WiredRoomSettingsRequestComposer';
|
||||
export * from './WiredRoomSettingsSaveComposer';
|
||||
export * from './WiredUserInspectMoveComposer';
|
||||
export * from './WiredUserVariableManageComposer';
|
||||
export * from './WiredUserVariablesRequestComposer';
|
||||
export * from './WiredUserVariableUpdateComposer';
|
||||
|
||||
@@ -607,6 +607,19 @@ export class RoomMessageHandler
|
||||
return true;
|
||||
}
|
||||
|
||||
private getReleasedWiredStatusLocation(status: RoomUnitStatusMessage): IVector3D
|
||||
{
|
||||
const activeMovement = this._activeWiredUserMovements.get(status.id);
|
||||
|
||||
if(!activeMovement) return null;
|
||||
|
||||
if(activeMovement.expiresAt <= Date.now()) return null;
|
||||
|
||||
if(!this.shouldReleaseWiredStatusLocation(status, activeMovement)) return null;
|
||||
|
||||
return new Vector3d(activeMovement.targetX, activeMovement.targetY, activeMovement.targetZ);
|
||||
}
|
||||
|
||||
private shouldReleaseWiredStatusLocation(status: RoomUnitStatusMessage, activeMovement: { expiresAt: number, targetX: number, targetY: number, targetZ: number }): boolean
|
||||
{
|
||||
if(!status.didMove)
|
||||
@@ -967,7 +980,8 @@ export class RoomMessageHandler
|
||||
|
||||
if(height) height = (height / zScale);
|
||||
|
||||
const location = new Vector3d(status.x, status.y, (status.z + height));
|
||||
const releasedWiredLocation = this.getReleasedWiredStatusLocation(status);
|
||||
const location = (releasedWiredLocation || new Vector3d(status.x, status.y, (status.z + height)));
|
||||
const direction = new Vector3d(status.direction);
|
||||
|
||||
let goal: IVector3D = null;
|
||||
|
||||
Reference in New Issue
Block a user