@rpgjs/server 5.0.0-alpha.33 → 5.0.0-alpha.35
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.
- package/dist/decorators/map.d.ts +22 -0
- package/dist/index.js +387 -324
- package/dist/index.js.map +1 -1
- package/dist/logs/log.d.ts +2 -3
- package/dist/rooms/map.d.ts +38 -3
- package/package.json +5 -5
- package/src/Player/ParameterManager.ts +36 -2
- package/src/Player/Player.ts +30 -8
- package/src/decorators/map.ts +26 -1
- package/src/logs/log.ts +10 -3
- package/src/module.ts +1 -0
- package/src/rooms/map.ts +296 -50
- package/tests/prediction-reconciliation.spec.ts +182 -0
- package/tests/world-maps.spec.ts +83 -1
package/dist/decorators/map.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { WeatherState } from '../../../common/src';
|
|
1
2
|
export interface MapOptions {
|
|
2
3
|
/**
|
|
3
4
|
* Map identifier. Allows to go to the map (for example with player.changeMap())
|
|
@@ -96,6 +97,27 @@ export interface MapOptions {
|
|
|
96
97
|
* @memberof MapData
|
|
97
98
|
* */
|
|
98
99
|
sounds?: string[];
|
|
100
|
+
/**
|
|
101
|
+
* Initial weather state for this map.
|
|
102
|
+
*
|
|
103
|
+
* This value is applied when the map is loaded and can later be updated
|
|
104
|
+
* at runtime with `map.setWeather()` from server logic.
|
|
105
|
+
*
|
|
106
|
+
* ```ts
|
|
107
|
+
* @MapData({
|
|
108
|
+
* id: 'forest',
|
|
109
|
+
* file: require('./tmx/forest.tmx'),
|
|
110
|
+
* weather: {
|
|
111
|
+
* effect: 'fog',
|
|
112
|
+
* preset: 'rpgForestFog',
|
|
113
|
+
* params: { density: 1.2, height: 0.75 },
|
|
114
|
+
* transitionMs: 1200
|
|
115
|
+
* }
|
|
116
|
+
* })
|
|
117
|
+
* class ForestMap extends RpgMap {}
|
|
118
|
+
* ```
|
|
119
|
+
*/
|
|
120
|
+
weather?: WeatherState | null;
|
|
99
121
|
/**
|
|
100
122
|
* Whether to stop all sounds before playing the map sounds when a player joins.
|
|
101
123
|
*
|