magicrealmsshared 0.4.8 → 0.5.1
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/communication/ws.d.ts +2 -2
- package/dist/communication/ws.js +24 -27
- package/dist/game/colors.js +1 -4
- package/dist/geo/chunks.js +10 -17
- package/dist/index.js +2 -5
- package/dist/types/charcter.d.ts +2 -2
- package/dist/types/charcter.js +1 -2
- package/dist/types/items.d.ts +1 -1
- package/dist/types/items.js +2 -5
- package/dist/types/types.js +1 -2
- package/package.json +2 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { GameCharacter } from "../types/charcter";
|
|
2
|
-
import { Auth_Token, PlayerClientData, Well } from "../types/types";
|
|
1
|
+
import { GameCharacter } from "../types/charcter.js";
|
|
2
|
+
import { Auth_Token, PlayerClientData, Well } from "../types/types.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
export declare const GeoJSONPointSchema: z.ZodObject<{
|
|
5
5
|
type: z.ZodLiteral<"Point">;
|
package/dist/communication/ws.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
exports.GeoJSONPointSchema = zod_1.z.strictObject({
|
|
6
|
-
type: zod_1.z.literal("Point"),
|
|
7
|
-
coordinates: zod_1.z.array(zod_1.z.number()).length(2).superRefine(([lon, lat], ctx) => {
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const GeoJSONPointSchema = z.strictObject({
|
|
3
|
+
type: z.literal("Point"),
|
|
4
|
+
coordinates: z.array(z.number()).length(2).superRefine(([lon, lat], ctx) => {
|
|
8
5
|
if (lon < -180 || lon > 180) {
|
|
9
6
|
ctx.addIssue({
|
|
10
7
|
code: "invalid_value",
|
|
@@ -21,25 +18,25 @@ exports.GeoJSONPointSchema = zod_1.z.strictObject({
|
|
|
21
18
|
}
|
|
22
19
|
}),
|
|
23
20
|
});
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
email:
|
|
31
|
-
password:
|
|
21
|
+
export const AUTH_TOKEN_SCHEME = z.string().length(64);
|
|
22
|
+
export const AUTH = "AUTH";
|
|
23
|
+
export const AUTH_ACK = "AUTH_ACK";
|
|
24
|
+
export const AUTH_INVALID = "AI";
|
|
25
|
+
export const LOGIN_COMMAND = "LOGIN";
|
|
26
|
+
export const LOGIN_DATA_SCHEME = z.strictObject({
|
|
27
|
+
email: z.email(),
|
|
28
|
+
password: z.string().max(128),
|
|
32
29
|
});
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
pos:
|
|
42
|
-
pre:
|
|
30
|
+
export const LOGIN_RESPONSE_COMMAND = "NIGOL";
|
|
31
|
+
export const LOGIN_RESPONSE_CODE_SUCCESS = 0;
|
|
32
|
+
export const LOGIN_RESPONSE_CODE_EMAIL_INVALID = 10;
|
|
33
|
+
export const LOGIN_RESPONSE_CODE_PASSWORD_INVALID = 20;
|
|
34
|
+
export const LOGIN_RESPONSE_CODE_SERVER_ERROR = 1000;
|
|
35
|
+
export const DATA_UPDATE_COMMAND = "DATA_UPDATE";
|
|
36
|
+
export const POSUPDATE_COMMAND = "POSUPDATE";
|
|
37
|
+
export const POSUPDATE_SCHEME = z.strictObject({
|
|
38
|
+
pos: GeoJSONPointSchema,
|
|
39
|
+
pre: z.number(),
|
|
43
40
|
});
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
export const ADMIN_WELL_CREATE_COMMAND = "ADMIN_WELL_CREATE";
|
|
42
|
+
export const ADMIN_WELL_DELETE_COMMAND = "ADMIN_WELL_DELETE";
|
package/dist/game/colors.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GameColors = void 0;
|
|
4
1
|
/*
|
|
5
2
|
1
|
|
6
3
|
🔴
|
|
@@ -18,7 +15,7 @@ exports.GameColors = void 0;
|
|
|
18
15
|
🔵
|
|
19
16
|
(Zeit & Erkenntnis)
|
|
20
17
|
*/
|
|
21
|
-
|
|
18
|
+
export const GameColors = new Map([
|
|
22
19
|
[
|
|
23
20
|
1, {
|
|
24
21
|
name: "Pyra",
|
package/dist/geo/chunks.js
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
exports.ChunkCoordinatesAreEqual = ChunkCoordinatesAreEqual;
|
|
5
|
-
exports.ChunkCoordinatesOfGEOJSONPoint = ChunkCoordinatesOfGEOJSONPoint;
|
|
6
|
-
exports.ChunkBoundaries = ChunkBoundaries;
|
|
7
|
-
exports.GEOJSONPointIsInChunks = GEOJSONPointIsInChunks;
|
|
8
|
-
exports.ChunkSizeLong = 0.025;
|
|
9
|
-
exports.ChunkSizeLat = 0.025;
|
|
10
|
-
function ChunkCoordinatesAreEqual(...chunkCoordinates) {
|
|
1
|
+
export const ChunkSizeLong = 0.025;
|
|
2
|
+
export const ChunkSizeLat = 0.025;
|
|
3
|
+
export function ChunkCoordinatesAreEqual(...chunkCoordinates) {
|
|
11
4
|
if (chunkCoordinates.length < 1)
|
|
12
5
|
return false;
|
|
13
6
|
for (const cc of chunkCoordinates) {
|
|
@@ -18,20 +11,20 @@ function ChunkCoordinatesAreEqual(...chunkCoordinates) {
|
|
|
18
11
|
}
|
|
19
12
|
return true;
|
|
20
13
|
}
|
|
21
|
-
function ChunkCoordinatesOfGEOJSONPoint(point) {
|
|
14
|
+
export function ChunkCoordinatesOfGEOJSONPoint(point) {
|
|
22
15
|
return [
|
|
23
|
-
Math.floor(point.coordinates[0] /
|
|
24
|
-
Math.floor(point.coordinates[1] /
|
|
16
|
+
Math.floor(point.coordinates[0] / ChunkSizeLong),
|
|
17
|
+
Math.floor(point.coordinates[1] / ChunkSizeLat),
|
|
25
18
|
];
|
|
26
19
|
}
|
|
27
20
|
//Long-Min, Long-Max, Lat-Min, Lat-Max
|
|
28
|
-
function ChunkBoundaries(chunkCoordinates) {
|
|
21
|
+
export function ChunkBoundaries(chunkCoordinates) {
|
|
29
22
|
return [
|
|
30
|
-
[chunkCoordinates[0] *
|
|
31
|
-
[(chunkCoordinates[0] + 1) *
|
|
23
|
+
[chunkCoordinates[0] * ChunkSizeLong, chunkCoordinates[1] * ChunkSizeLat],
|
|
24
|
+
[(chunkCoordinates[0] + 1) * ChunkSizeLong, (chunkCoordinates[1] + 1) * ChunkSizeLat]
|
|
32
25
|
];
|
|
33
26
|
}
|
|
34
|
-
function GEOJSONPointIsInChunks(point, ...chunkCoordinates) {
|
|
27
|
+
export function GEOJSONPointIsInChunks(point, ...chunkCoordinates) {
|
|
35
28
|
const chunkCoordinatesOfPoint = ChunkCoordinatesOfGEOJSONPoint(point);
|
|
36
29
|
for (const cc of chunkCoordinates) {
|
|
37
30
|
if (ChunkCoordinatesAreEqual(cc, chunkCoordinatesOfPoint))
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
exports.INTERACTION_DISTANCE = exports.PROJECT_NAME = void 0;
|
|
4
|
-
exports.PROJECT_NAME = "Magic Realms";
|
|
5
|
-
exports.INTERACTION_DISTANCE = 45;
|
|
1
|
+
export const PROJECT_NAME = "Magic Realms";
|
|
2
|
+
export const INTERACTION_DISTANCE = 45;
|
package/dist/types/charcter.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { GameItem, HeadGear, ManaCrytal } from "./items";
|
|
2
|
-
import { ObjectWithId } from "./types";
|
|
1
|
+
import { GameItem, HeadGear, ManaCrytal } from "./items.js";
|
|
2
|
+
import { ObjectWithId } from "./types.js";
|
|
3
3
|
export type Equipment<IDFormat, DateFormat> = {
|
|
4
4
|
head: HeadGear<IDFormat, DateFormat> | null;
|
|
5
5
|
manaCrystals: ManaCrytal<IDFormat, DateFormat>[];
|
package/dist/types/charcter.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/dist/types/items.d.ts
CHANGED
package/dist/types/items.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EGameItemType = void 0;
|
|
4
|
-
var EGameItemType;
|
|
1
|
+
export var EGameItemType;
|
|
5
2
|
(function (EGameItemType) {
|
|
6
3
|
EGameItemType[EGameItemType["ManaCrytal"] = 1] = "ManaCrytal";
|
|
7
4
|
EGameItemType[EGameItemType["HeadGear"] = 10] = "HeadGear";
|
|
8
|
-
})(EGameItemType || (
|
|
5
|
+
})(EGameItemType || (EGameItemType = {}));
|
package/dist/types/types.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|