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.
@@ -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">;
@@ -1,10 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ADMIN_WELL_DELETE_COMMAND = exports.ADMIN_WELL_CREATE_COMMAND = exports.POSUPDATE_SCHEME = exports.POSUPDATE_COMMAND = exports.DATA_UPDATE_COMMAND = exports.LOGIN_RESPONSE_CODE_SERVER_ERROR = exports.LOGIN_RESPONSE_CODE_PASSWORD_INVALID = exports.LOGIN_RESPONSE_CODE_EMAIL_INVALID = exports.LOGIN_RESPONSE_CODE_SUCCESS = exports.LOGIN_RESPONSE_COMMAND = exports.LOGIN_DATA_SCHEME = exports.LOGIN_COMMAND = exports.AUTH_INVALID = exports.AUTH_ACK = exports.AUTH = exports.AUTH_TOKEN_SCHEME = exports.GeoJSONPointSchema = void 0;
4
- const zod_1 = require("zod");
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
- exports.AUTH_TOKEN_SCHEME = zod_1.z.string().length(64);
25
- exports.AUTH = "AUTH";
26
- exports.AUTH_ACK = "AUTH_ACK";
27
- exports.AUTH_INVALID = "AI";
28
- exports.LOGIN_COMMAND = "LOGIN";
29
- exports.LOGIN_DATA_SCHEME = zod_1.z.strictObject({
30
- email: zod_1.z.email(),
31
- password: zod_1.z.string().max(128),
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
- exports.LOGIN_RESPONSE_COMMAND = "NIGOL";
34
- exports.LOGIN_RESPONSE_CODE_SUCCESS = 0;
35
- exports.LOGIN_RESPONSE_CODE_EMAIL_INVALID = 10;
36
- exports.LOGIN_RESPONSE_CODE_PASSWORD_INVALID = 20;
37
- exports.LOGIN_RESPONSE_CODE_SERVER_ERROR = 1000;
38
- exports.DATA_UPDATE_COMMAND = "DATA_UPDATE";
39
- exports.POSUPDATE_COMMAND = "POSUPDATE";
40
- exports.POSUPDATE_SCHEME = zod_1.z.strictObject({
41
- pos: exports.GeoJSONPointSchema,
42
- pre: zod_1.z.number(),
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
- exports.ADMIN_WELL_CREATE_COMMAND = "ADMIN_WELL_CREATE";
45
- exports.ADMIN_WELL_DELETE_COMMAND = "ADMIN_WELL_DELETE";
41
+ export const ADMIN_WELL_CREATE_COMMAND = "ADMIN_WELL_CREATE";
42
+ export const ADMIN_WELL_DELETE_COMMAND = "ADMIN_WELL_DELETE";
@@ -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
- exports.GameColors = new Map([
18
+ export const GameColors = new Map([
22
19
  [
23
20
  1, {
24
21
  name: "Pyra",
@@ -1,13 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ChunkSizeLat = exports.ChunkSizeLong = void 0;
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] / exports.ChunkSizeLong),
24
- Math.floor(point.coordinates[1] / exports.ChunkSizeLat),
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] * exports.ChunkSizeLong, chunkCoordinates[1] * exports.ChunkSizeLat],
31
- [(chunkCoordinates[0] + 1) * exports.ChunkSizeLong, (chunkCoordinates[1] + 1) * exports.ChunkSizeLat]
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
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
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;
@@ -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>[];
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,4 +1,4 @@
1
- import { ObjectWithId } from "./types";
1
+ import { ObjectWithId } from "./types.js";
2
2
  export type ItemTrait = {};
3
3
  export declare enum EGameItemType {
4
4
  ManaCrytal = 1,
@@ -1,8 +1,5 @@
1
- "use strict";
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 || (exports.EGameItemType = EGameItemType = {}));
5
+ })(EGameItemType || (EGameItemType = {}));
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "magicrealmsshared",
3
- "version": "0.4.8",
3
+ "version": "0.5.1",
4
+ "type": "module",
4
5
  "description": "",
5
6
  "main": "dist/index.js",
6
7
  "scripts": {