magicrealmsshared 0.6.15 → 0.6.18
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 +14 -19
- package/dist/communication/ws.js +11 -1
- package/package.json +1 -1
|
@@ -1,25 +1,21 @@
|
|
|
1
1
|
import { GameCharacter } from "../types/charcter";
|
|
2
2
|
import { Auth_Token, PlayerClientData, Well } from "../types/types";
|
|
3
3
|
import { z } from "zod";
|
|
4
|
-
export declare const
|
|
5
|
-
SUCCESS
|
|
6
|
-
AUTH_INVALID
|
|
7
|
-
PARSING_FAILED
|
|
8
|
-
NOT_ALLOWED
|
|
9
|
-
CREDENTIAL_MISMATCH
|
|
10
|
-
EXISTS
|
|
11
|
-
DOESNT_EXIST
|
|
12
|
-
SERVER_ERROR
|
|
13
|
-
}
|
|
14
|
-
type ResponseSuccess = {
|
|
15
|
-
code: ResponseCode.SUCCESS;
|
|
16
|
-
msg?: string;
|
|
4
|
+
export declare const ResponseCode: {
|
|
5
|
+
readonly SUCCESS: 0;
|
|
6
|
+
readonly AUTH_INVALID: 1;
|
|
7
|
+
readonly PARSING_FAILED: 2;
|
|
8
|
+
readonly NOT_ALLOWED: 3;
|
|
9
|
+
readonly CREDENTIAL_MISMATCH: 4;
|
|
10
|
+
readonly EXISTS: 10;
|
|
11
|
+
readonly DOESNT_EXIST: 11;
|
|
12
|
+
readonly SERVER_ERROR: 500;
|
|
17
13
|
};
|
|
18
|
-
type
|
|
14
|
+
export type ResponseCode = typeof ResponseCode[keyof typeof ResponseCode];
|
|
15
|
+
export type Response = {
|
|
19
16
|
code: ResponseCode;
|
|
20
17
|
msg?: string;
|
|
21
18
|
};
|
|
22
|
-
export type Response = ResponseSuccess | ResponseFailure;
|
|
23
19
|
export declare const GeoJSONPointSchema: z.ZodObject<{
|
|
24
20
|
type: z.ZodLiteral<"Point">;
|
|
25
21
|
coordinates: z.ZodEffects<z.ZodArray<z.ZodNumber, "many">, number[], number[]>;
|
|
@@ -47,10 +43,10 @@ export declare const LOGIN_DATA_SCHEME: z.ZodObject<{
|
|
|
47
43
|
}>;
|
|
48
44
|
export type LOGIN_DATA = z.infer<typeof LOGIN_DATA_SCHEME>;
|
|
49
45
|
export declare const LOGIN_RESPONSE_COMMAND = "NIGOL";
|
|
50
|
-
export type
|
|
46
|
+
export type LOGIN_RESPONSE = Response & {
|
|
51
47
|
characterData?: GameCharacter<string, number>;
|
|
52
48
|
playerData?: PlayerClientData;
|
|
53
|
-
authToken?: Auth_Token<number,
|
|
49
|
+
authToken?: Auth_Token<number, string>;
|
|
54
50
|
};
|
|
55
51
|
export declare const LOGOUT_COMMAND = "BYE";
|
|
56
52
|
export declare const REGISTER_COMMAND = "";
|
|
@@ -66,7 +62,7 @@ export declare const REGISTER_DATA_SCHEME: z.ZodObject<{
|
|
|
66
62
|
}>;
|
|
67
63
|
export type REGISTER_DATA = z.infer<typeof REGISTER_DATA_SCHEME>;
|
|
68
64
|
export declare const REGISTER_RESPONSE_COMMAND = "RETSIGER";
|
|
69
|
-
export type REGISTER_RESPONSE_DATA
|
|
65
|
+
export type REGISTER_RESPONSE_DATA = LOGIN_RESPONSE;
|
|
70
66
|
export declare const DATA_UPDATE_COMMAND = "DATA_UPDATE";
|
|
71
67
|
export type DATA_UPDATE<T> = {
|
|
72
68
|
drop?: string[];
|
|
@@ -152,4 +148,3 @@ export type CHARACTER_CREATE_DATA = z.infer<typeof CHARACTER_CREATE_SCHEME>;
|
|
|
152
148
|
export type CHARACTER_CREATE_RESPONSE = Response & {
|
|
153
149
|
character?: GameCharacter<string, number>;
|
|
154
150
|
};
|
|
155
|
-
export {};
|
package/dist/communication/ws.js
CHANGED
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CHARACTER_CREATE_SCHEME = exports.CHARACTER_CREATE_COMMAND = exports.DEBUG_SOCKET_INFO_RETRIEVE_SCHEME = exports.DEBUG_SOCKET_INFO_RETRIEVE_COMMAND = exports.ADMIN_WELL_DELETE_SCHEME = exports.ADMIN_WELL_DELETE_COMMAND = exports.ADMIN_WELL_CREATE_SCHEME = exports.ADMIN_WELL_CREATE_COMMAND = exports.POSUPDATE_SCHEME = exports.POSUPDATE_COMMAND = exports.DATA_UPDATE_COMMAND = exports.REGISTER_RESPONSE_COMMAND = exports.REGISTER_DATA_SCHEME = exports.REGISTER_COMMAND = exports.LOGOUT_COMMAND = 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;
|
|
3
|
+
exports.CHARACTER_CREATE_SCHEME = exports.CHARACTER_CREATE_COMMAND = exports.DEBUG_SOCKET_INFO_RETRIEVE_SCHEME = exports.DEBUG_SOCKET_INFO_RETRIEVE_COMMAND = exports.ADMIN_WELL_DELETE_SCHEME = exports.ADMIN_WELL_DELETE_COMMAND = exports.ADMIN_WELL_CREATE_SCHEME = exports.ADMIN_WELL_CREATE_COMMAND = exports.POSUPDATE_SCHEME = exports.POSUPDATE_COMMAND = exports.DATA_UPDATE_COMMAND = exports.REGISTER_RESPONSE_COMMAND = exports.REGISTER_DATA_SCHEME = exports.REGISTER_COMMAND = exports.LOGOUT_COMMAND = 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 = exports.ResponseCode = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
+
exports.ResponseCode = {
|
|
6
|
+
SUCCESS: 0,
|
|
7
|
+
AUTH_INVALID: 1,
|
|
8
|
+
PARSING_FAILED: 2,
|
|
9
|
+
NOT_ALLOWED: 3,
|
|
10
|
+
CREDENTIAL_MISMATCH: 4,
|
|
11
|
+
EXISTS: 10,
|
|
12
|
+
DOESNT_EXIST: 11,
|
|
13
|
+
SERVER_ERROR: 500,
|
|
14
|
+
};
|
|
5
15
|
exports.GeoJSONPointSchema = zod_1.z.strictObject({
|
|
6
16
|
type: zod_1.z.literal("Point"),
|
|
7
17
|
coordinates: zod_1.z.array(zod_1.z.number()).length(2).superRefine(([lon, lat], ctx) => {
|