@hytopia.com/examples 1.0.23 → 1.0.24
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/frontiers-rpg-game/dev/persistence/player-421.json +42 -0
- package/frontiers-rpg-game/dev/persistence/player-player-2.json +31 -0
- package/frontiers-rpg-game/dev/persistence/player-player-4.json +31 -0
- package/frontiers-rpg-game/src/GamePlayer.ts +0 -11
- package/frontiers-rpg-game/src/GameRegion.ts +6 -3
- package/package.json +1 -1
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"health": 100,
|
|
3
|
+
"currentRegionId": "stalkhaven",
|
|
4
|
+
"currentRegionSpawnFacingAngle": 0,
|
|
5
|
+
"currentRegionSpawnPoint": {
|
|
6
|
+
"x": 1,
|
|
7
|
+
"y": 2,
|
|
8
|
+
"z": 40
|
|
9
|
+
},
|
|
10
|
+
"skillExperience": [],
|
|
11
|
+
"backpack": {
|
|
12
|
+
"items": []
|
|
13
|
+
},
|
|
14
|
+
"hotbar": {
|
|
15
|
+
"items": [
|
|
16
|
+
{
|
|
17
|
+
"position": 0,
|
|
18
|
+
"itemId": "toy_sword"
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
"questLog": {
|
|
23
|
+
"quests": [
|
|
24
|
+
{
|
|
25
|
+
"questId": "exploring-stalkhaven",
|
|
26
|
+
"state": "active",
|
|
27
|
+
"objectiveProgress": {
|
|
28
|
+
"talk-to-mycelis": 0,
|
|
29
|
+
"talk-to-finn": 0,
|
|
30
|
+
"talk-to-sporn": 0,
|
|
31
|
+
"talk-to-mark": 0
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
"storage": {
|
|
37
|
+
"items": []
|
|
38
|
+
},
|
|
39
|
+
"wearables": {
|
|
40
|
+
"items": []
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"health": 100,
|
|
3
|
+
"currentRegionId": "stalkhaven",
|
|
4
|
+
"currentRegionSpawnFacingAngle": 90,
|
|
5
|
+
"currentRegionSpawnPoint": {
|
|
6
|
+
"x": 32,
|
|
7
|
+
"y": 2,
|
|
8
|
+
"z": 1
|
|
9
|
+
},
|
|
10
|
+
"skillExperience": [],
|
|
11
|
+
"backpack": {
|
|
12
|
+
"items": []
|
|
13
|
+
},
|
|
14
|
+
"hotbar": {
|
|
15
|
+
"items": [
|
|
16
|
+
{
|
|
17
|
+
"position": 0,
|
|
18
|
+
"itemId": "toy_sword"
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
"questLog": {
|
|
23
|
+
"quests": []
|
|
24
|
+
},
|
|
25
|
+
"storage": {
|
|
26
|
+
"items": []
|
|
27
|
+
},
|
|
28
|
+
"wearables": {
|
|
29
|
+
"items": []
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"health": 100,
|
|
3
|
+
"currentRegionId": "stalkhaven",
|
|
4
|
+
"currentRegionSpawnFacingAngle": 0,
|
|
5
|
+
"currentRegionSpawnPoint": {
|
|
6
|
+
"x": 1,
|
|
7
|
+
"y": 2,
|
|
8
|
+
"z": 40
|
|
9
|
+
},
|
|
10
|
+
"skillExperience": [],
|
|
11
|
+
"backpack": {
|
|
12
|
+
"items": []
|
|
13
|
+
},
|
|
14
|
+
"hotbar": {
|
|
15
|
+
"items": [
|
|
16
|
+
{
|
|
17
|
+
"position": 0,
|
|
18
|
+
"itemId": "toy_sword"
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
"questLog": {
|
|
23
|
+
"quests": []
|
|
24
|
+
},
|
|
25
|
+
"storage": {
|
|
26
|
+
"items": []
|
|
27
|
+
},
|
|
28
|
+
"wearables": {
|
|
29
|
+
"items": []
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -116,17 +116,6 @@ export default class GamePlayer {
|
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
public static cleanup(): void {
|
|
120
|
-
// Helper method to clean up all instances (useful for server shutdown)
|
|
121
|
-
for (const [playerId, gamePlayer] of this._instances) {
|
|
122
|
-
if (gamePlayer._currentEntity) {
|
|
123
|
-
gamePlayer._currentEntity.despawn();
|
|
124
|
-
}
|
|
125
|
-
gamePlayer.player.ui.off(PlayerUIEvent.DATA, gamePlayer._onPlayerUIData);
|
|
126
|
-
}
|
|
127
|
-
this._instances.clear();
|
|
128
|
-
}
|
|
129
|
-
|
|
130
119
|
// Getters
|
|
131
120
|
public get currentCraftingEntity(): BaseCraftingEntity | undefined {
|
|
132
121
|
return this._currentCraftingEntity;
|
|
@@ -174,9 +174,12 @@ export default class GameRegion {
|
|
|
174
174
|
}
|
|
175
175
|
|
|
176
176
|
protected onPlayerLeave(player: Player) {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
177
|
+
// We assume the player left the game on region leave, we do all cleanup here.
|
|
178
|
+
// If they didn't, there's no downside and their player object will be reinitialized
|
|
179
|
+
// when they rejoin this or another rejoin before their connection times out.
|
|
180
|
+
// If this causes issues in the future, we should move .remove to the actualy
|
|
181
|
+
// Player closed connection event.
|
|
182
|
+
GamePlayer.remove(player);
|
|
180
183
|
|
|
181
184
|
this._playerCount--;
|
|
182
185
|
|