@rpg-engine/shared 0.3.62 → 0.3.63
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/libs/MapZipHelper.js +9 -6
- package/dist/libs/MapZipHelper.js.map +1 -1
- package/dist/types/maps.types.d.ts +3 -0
- package/dist/types/maps.types.d.ts.map +1 -1
- package/dist/types/maps.types.js +5 -1
- package/dist/types/maps.types.js.map +1 -1
- package/dist/types/npcMetadata.types.d.ts +7 -0
- package/dist/types/npcMetadata.types.d.ts.map +1 -0
- package/dist/types/npcMetadata.types.js +20 -0
- package/dist/types/npcMetadata.types.js.map +1 -0
- package/dist/types/player.types.d.ts +49 -0
- package/dist/types/player.types.d.ts.map +1 -0
- package/dist/types/player.types.js +14 -0
- package/dist/types/player.types.js.map +1 -0
- package/package.json +2 -2
|
@@ -8,17 +8,20 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
15
|
exports.createZipMap = void 0;
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
+
const compress_json_1 = require("compress-json");
|
|
17
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
18
|
+
const jszip_1 = __importDefault(require("jszip"));
|
|
16
19
|
const createZipMap = (mapName, mapObject, pathToSave) => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
|
-
const data = compress(mapObject);
|
|
18
|
-
const zip = new
|
|
20
|
+
const data = (0, compress_json_1.compress)(mapObject);
|
|
21
|
+
const zip = new jszip_1.default();
|
|
19
22
|
zip.file(`${mapName}.txt`, JSON.stringify(data));
|
|
20
23
|
const buffer = yield zip.generateAsync({ type: "uint8array" });
|
|
21
|
-
yield
|
|
24
|
+
yield fs_extra_1.default.createWriteStream(`${pathToSave}/${mapName}.zip`).write(buffer);
|
|
22
25
|
});
|
|
23
26
|
exports.createZipMap = createZipMap;
|
|
24
27
|
//# sourceMappingURL=MapZipHelper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapZipHelper.js","sourceRoot":"","sources":["../../src/libs/MapZipHelper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MapZipHelper.js","sourceRoot":"","sources":["../../src/libs/MapZipHelper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,iDAAyC;AACzC,wDAA0B;AAC1B,kDAA0B;AAEnB,MAAM,YAAY,GAAG,CAAO,OAAe,EAAE,SAAiB,EAAE,UAAkB,EAAiB,EAAE;IAC1G,MAAM,IAAI,GAAG,IAAA,wBAAQ,EAAC,SAAS,CAAC,CAAC;IACjC,MAAM,GAAG,GAAG,IAAI,eAAK,EAAE,CAAC;IACxB,GAAG,CAAC,IAAI,CAAC,GAAG,OAAO,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IACjD,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC;IAC/D,MAAM,kBAAE,CAAC,iBAAiB,CAAC,GAAG,UAAU,IAAI,OAAO,MAAM,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AAC3E,CAAC,CAAA,CAAC;AANW,QAAA,YAAY,gBAMvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"maps.types.d.ts","sourceRoot":"","sources":["../../src/types/maps.types.ts"],"names":[],"mappings":"AAAA,oBAAY,SAAS;IACnB,MAAM,IAAI;IACV,UAAU,IAAI;IACd,SAAS,IAAI;IACb,aAAa,IAAI;IACjB,IAAI,IAAI;CACT;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,mBAAmB,EAAE,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,UAAU,UAAmE,CAAC"}
|
|
1
|
+
{"version":3,"file":"maps.types.d.ts","sourceRoot":"","sources":["../../src/types/maps.types.ts"],"names":[],"mappings":"AAAA,oBAAY,SAAS;IACnB,MAAM,IAAI;IACV,UAAU,IAAI;IACd,SAAS,IAAI;IACb,aAAa,IAAI;IACjB,IAAI,IAAI;CACT;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,mBAAmB,EAAE,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,UAAU,UAAmE,CAAC;AAE3F,oBAAY,eAAe;IACzB,SAAS,cAAc;CACxB"}
|
package/dist/types/maps.types.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MAP_LAYERS = exports.MapLayers = void 0;
|
|
3
|
+
exports.MapSocketEvents = exports.MAP_LAYERS = exports.MapLayers = void 0;
|
|
4
4
|
var MapLayers;
|
|
5
5
|
(function (MapLayers) {
|
|
6
6
|
MapLayers[MapLayers["Ground"] = 0] = "Ground";
|
|
@@ -10,4 +10,8 @@ var MapLayers;
|
|
|
10
10
|
MapLayers[MapLayers["Roof"] = 4] = "Roof";
|
|
11
11
|
})(MapLayers = exports.MapLayers || (exports.MapLayers = {}));
|
|
12
12
|
exports.MAP_LAYERS = ["ground", "over-ground", "character", "over-character", "roof"];
|
|
13
|
+
var MapSocketEvents;
|
|
14
|
+
(function (MapSocketEvents) {
|
|
15
|
+
MapSocketEvents["ChangeMap"] = "ChangeMap";
|
|
16
|
+
})(MapSocketEvents = exports.MapSocketEvents || (exports.MapSocketEvents = {}));
|
|
13
17
|
//# sourceMappingURL=maps.types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"maps.types.js","sourceRoot":"","sources":["../../src/types/maps.types.ts"],"names":[],"mappings":";;;AAAA,IAAY,SAMX;AAND,WAAY,SAAS;IACnB,6CAAU,CAAA;IACV,qDAAc,CAAA;IACd,mDAAa,CAAA;IACb,2DAAiB,CAAA;IACjB,yCAAQ,CAAA;AACV,CAAC,EANW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAMpB;AAiBY,QAAA,UAAU,GAAG,CAAC,QAAQ,EAAE,aAAa,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"maps.types.js","sourceRoot":"","sources":["../../src/types/maps.types.ts"],"names":[],"mappings":";;;AAAA,IAAY,SAMX;AAND,WAAY,SAAS;IACnB,6CAAU,CAAA;IACV,qDAAc,CAAA;IACd,mDAAa,CAAA;IACb,2DAAiB,CAAA;IACjB,yCAAQ,CAAA;AACV,CAAC,EANW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAMpB;AAiBY,QAAA,UAAU,GAAG,CAAC,QAAQ,EAAE,aAAa,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,CAAC,CAAC;AAE3F,IAAY,eAEX;AAFD,WAAY,eAAe;IACzB,0CAAuB,CAAA;AACzB,CAAC,EAFW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAE1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"npcMetadata.types.d.ts","sourceRoot":"","sources":["../../src/types/npcMetadata.types.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnC,UAAU,YAAa,SAAQ,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC;IAC9C,GAAG,EAAE,MAAM,CAAC;CACb;AAED,eAAO,MAAM,WAAW,EAAE,YAAY,EAYrC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NPCMetaData = void 0;
|
|
4
|
+
const GridHelper_1 = require("../libs/GridHelper");
|
|
5
|
+
const character_types_1 = require("./character.types");
|
|
6
|
+
const maps_types_1 = require("./maps.types");
|
|
7
|
+
exports.NPCMetaData = [
|
|
8
|
+
{
|
|
9
|
+
key: "alice",
|
|
10
|
+
name: "Alice",
|
|
11
|
+
x: (0, GridHelper_1.FromGridX)(22),
|
|
12
|
+
y: (0, GridHelper_1.FromGridY)(12),
|
|
13
|
+
direction: "down",
|
|
14
|
+
scene: "MainScene",
|
|
15
|
+
class: character_types_1.CharacterClass.Cleric,
|
|
16
|
+
gender: character_types_1.CharacterGender.Female,
|
|
17
|
+
layer: maps_types_1.MapLayers.Player,
|
|
18
|
+
},
|
|
19
|
+
];
|
|
20
|
+
//# sourceMappingURL=npcMetadata.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"npcMetadata.types.js","sourceRoot":"","sources":["../../src/types/npcMetadata.types.ts"],"names":[],"mappings":";;;AAAA,mDAA0D;AAC1D,uDAAoE;AACpE,6CAAyC;AAO5B,QAAA,WAAW,GAAmB;IACzC;QACE,GAAG,EAAE,OAAO;QACZ,IAAI,EAAE,OAAO;QACb,CAAC,EAAE,IAAA,sBAAS,EAAC,EAAE,CAAC;QAChB,CAAC,EAAE,IAAA,sBAAS,EAAC,EAAE,CAAC;QAChB,SAAS,EAAE,MAAM;QACjB,KAAK,EAAE,WAAW;QAClB,KAAK,EAAE,gCAAc,CAAC,MAAM;QAC5B,MAAM,EAAE,iCAAe,CAAC,MAAM;QAC9B,KAAK,EAAE,sBAAS,CAAC,MAAM;KACxB;CACF,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { IEntityBasicInfo } from "./entity.types";
|
|
2
|
+
export declare enum PlayerSocketEvents {
|
|
3
|
+
PlayerCreate = "PlayerCreate",
|
|
4
|
+
PlayerPositionUpdate = "PlayerPositionUpdate",
|
|
5
|
+
PlayerPositionUpdateConfirm = "PlayerPositionUpdateConfirm",
|
|
6
|
+
PlayerLogout = "PlayerLogout",
|
|
7
|
+
PlayerPrivateMessage = "PlayerPrivateMessage",
|
|
8
|
+
PlayerPing = "PlayerPing",
|
|
9
|
+
PlayerForceDisconnect = "PlayerForceDisconnect"
|
|
10
|
+
}
|
|
11
|
+
export interface IPlayerPing {
|
|
12
|
+
id: string;
|
|
13
|
+
}
|
|
14
|
+
export interface IPlayerPositionUpdateConfirm {
|
|
15
|
+
id: string;
|
|
16
|
+
direction: string;
|
|
17
|
+
isValid: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare type Events = PlayerSocketEvents;
|
|
20
|
+
export interface IConnectedPlayer {
|
|
21
|
+
id: string;
|
|
22
|
+
name: string;
|
|
23
|
+
x: number;
|
|
24
|
+
y: number;
|
|
25
|
+
channelId: string;
|
|
26
|
+
direction?: string;
|
|
27
|
+
isMoving?: boolean;
|
|
28
|
+
cameraCoordinates: ICameraCoordinates;
|
|
29
|
+
otherEntitiesInView: IEntitiesInView;
|
|
30
|
+
}
|
|
31
|
+
export interface IEntitiesInView {
|
|
32
|
+
[id: string]: IEntityBasicInfo;
|
|
33
|
+
}
|
|
34
|
+
export interface IConnectedPlayers {
|
|
35
|
+
[id: string]: IConnectedPlayer;
|
|
36
|
+
}
|
|
37
|
+
export interface PlayerLogoutPayload {
|
|
38
|
+
id: string;
|
|
39
|
+
}
|
|
40
|
+
export interface ICameraCoordinates {
|
|
41
|
+
x: number;
|
|
42
|
+
y: number;
|
|
43
|
+
width: number;
|
|
44
|
+
height: number;
|
|
45
|
+
}
|
|
46
|
+
export interface IPlayerForceDisconnect {
|
|
47
|
+
reason: string;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=player.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"player.types.d.ts","sourceRoot":"","sources":["../../src/types/player.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGlD,oBAAY,kBAAkB;IAC5B,YAAY,iBAAiB;IAC7B,oBAAoB,yBAAyB;IAC7C,2BAA2B,gCAAgC;IAC3D,YAAY,iBAAiB;IAC7B,oBAAoB,yBAAyB;IAC7C,UAAU,eAAe;IACzB,qBAAqB,0BAA0B;CAChD;AAED,MAAM,WAAW,WAAW;IAE1B,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,4BAA4B;IAC3C,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,oBAAY,MAAM,GAAG,kBAAkB,CAAC;AAExC,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iBAAiB,EAAE,kBAAkB,CAAC;IACtC,mBAAmB,EAAE,eAAe,CAAC;CACtC;AAED,MAAM,WAAW,eAAe;IAC9B,CAAC,EAAE,EAAE,MAAM,GAAG,gBAAgB,CAAC;CAChC;AAED,MAAM,WAAW,iBAAiB;IAChC,CAAC,EAAE,EAAE,MAAM,GAAG,gBAAgB,CAAC;CAChC;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,kBAAkB;IACjC,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PlayerSocketEvents = void 0;
|
|
4
|
+
var PlayerSocketEvents;
|
|
5
|
+
(function (PlayerSocketEvents) {
|
|
6
|
+
PlayerSocketEvents["PlayerCreate"] = "PlayerCreate";
|
|
7
|
+
PlayerSocketEvents["PlayerPositionUpdate"] = "PlayerPositionUpdate";
|
|
8
|
+
PlayerSocketEvents["PlayerPositionUpdateConfirm"] = "PlayerPositionUpdateConfirm";
|
|
9
|
+
PlayerSocketEvents["PlayerLogout"] = "PlayerLogout";
|
|
10
|
+
PlayerSocketEvents["PlayerPrivateMessage"] = "PlayerPrivateMessage";
|
|
11
|
+
PlayerSocketEvents["PlayerPing"] = "PlayerPing";
|
|
12
|
+
PlayerSocketEvents["PlayerForceDisconnect"] = "PlayerForceDisconnect";
|
|
13
|
+
})(PlayerSocketEvents = exports.PlayerSocketEvents || (exports.PlayerSocketEvents = {}));
|
|
14
|
+
//# sourceMappingURL=player.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"player.types.js","sourceRoot":"","sources":["../../src/types/player.types.ts"],"names":[],"mappings":";;;AAGA,IAAY,kBAQX;AARD,WAAY,kBAAkB;IAC5B,mDAA6B,CAAA;IAC7B,mEAA6C,CAAA;IAC7C,iFAA2D,CAAA;IAC3D,mDAA6B,CAAA;IAC7B,mEAA6C,CAAA;IAC7C,+CAAyB,CAAA;IACzB,qEAA+C,CAAA;AACjD,CAAC,EARW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAQ7B"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rpg-engine/shared",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.3.63",
|
|
4
|
+
"description": "Types shared across our API and client",
|
|
5
5
|
"author": "Joao Paulo Furtado <joaopaulofurtado@live.com>",
|
|
6
6
|
"homepage": "",
|
|
7
7
|
"license": "ISC",
|