@rpgjs/server 5.0.0-alpha.13 → 5.0.0-alpha.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -88,7 +88,7 @@ export declare const Move: MoveList;
88
88
  * - **Strategy Management**: Add, remove, and query movement strategies
89
89
  * - **Predefined Movements**: Quick access to common movement patterns
90
90
  * - **Composite Movements**: Combine multiple strategies
91
- * - **Physics Integration**: Seamless integration with Matter.js physics
91
+ * - **Physics Integration**: Seamless integration with the deterministic @rpgjs/physic engine
92
92
  *
93
93
  * ## Available Movement Strategies
94
94
  * - `LinearMove`: Constant velocity movement
@@ -156,7 +156,7 @@ export declare const Move: MoveList;
156
156
  * player.dash({ x: 1, y: 0 }, 8, 200);
157
157
  * ```
158
158
  */
159
- export declare function WithMoveManager<TBase extends PlayerCtor>(Base: TBase): TBase;
159
+ export declare function WithMoveManager<TBase extends PlayerCtor>(Base: TBase): PlayerCtor;
160
160
  /**
161
161
  * Type helper to extract the interface from the WithMoveManager mixin
162
162
  * This provides the type without duplicating method signatures
@@ -1,4 +1,4 @@
1
- import { Hooks } from '@rpgjs/common';
1
+ import { Hooks, RpgCommonPlayer, Direction } from '@rpgjs/common';
2
2
  import { IComponentManager } from './ComponentManager';
3
3
  import { RpgMap } from '../rooms/map';
4
4
  import { Context } from '@signe/di';
@@ -24,7 +24,7 @@ interface ZoneOptions {
24
24
  linkedTo?: string;
25
25
  limitedByWalls?: boolean;
26
26
  }
27
- declare const RpgPlayer_base: import('@rpgjs/common').PlayerCtor;
27
+ declare const RpgPlayer_base: typeof RpgCommonPlayer;
28
28
  /**
29
29
  * RPG Player class with component management capabilities
30
30
  *
@@ -49,10 +49,28 @@ export declare class RpgPlayer extends RpgPlayer_base {
49
49
  context?: Context;
50
50
  conn: MockConnection | null;
51
51
  touchSide: boolean;
52
+ /** Last processed client input timestamp for reconciliation */
53
+ lastProcessedInputTs: number;
54
+ /** Last processed client input frame for reconciliation with server tick */
55
+ _lastFramePositions: {
56
+ frame: number;
57
+ position: {
58
+ x: number;
59
+ y: number;
60
+ direction: Direction;
61
+ };
62
+ serverTick?: number;
63
+ } | null;
64
+ frames: {
65
+ x: number;
66
+ y: number;
67
+ ts: number;
68
+ }[];
52
69
  events: import('@signe/reactive').WritableArraySignal<RpgEvent[]>;
53
70
  constructor();
54
71
  _onInit(): void;
55
72
  get hooks(): Hooks;
73
+ applyFrames(): void;
56
74
  execMethod(method: string, methodData?: any[], target?: any): Promise<any>;
57
75
  /**
58
76
  * Change the map for this player
@@ -715,5 +715,8 @@ export interface RpgServer {
715
715
  doChangeServer(store: IStoreState, matchMaker: RpgMatchMaker, player: RpgPlayer): Promise<boolean> | boolean;
716
716
  };
717
717
  };
718
+ throttleSync?: number;
719
+ throttleStorage?: number;
720
+ sessionExpiryTime?: number;
718
721
  }
719
722
  export {};