magicrealmsshared 0.1.5 → 0.2.0
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/communication/ws.ts +22 -0
- package/communication/wsClient.ts +3 -0
- package/communication/wsServer.ts +3 -0
- package/package.json +1 -1
- package/types/types.ts +0 -4
- package/types/typesClient.ts +4 -0
- package/types/typesServer.ts +4 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Well } from "../types/types";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
export const AUTH = "AUTH";
|
|
5
|
+
export const AUTH_ACK = "AUTH_ACK";
|
|
6
|
+
|
|
7
|
+
export const DATA_UPDATE_COMMAND = "DATA_UPDATE";
|
|
8
|
+
export type DATA_UPDATE<T> = {
|
|
9
|
+
wells: Well<T>[],
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const POSUPDATE_COMMAND = "POSUPDATE";
|
|
13
|
+
export type POSUPDATE = {
|
|
14
|
+
pos: GeoJSON.Point,
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The precision of the pos.
|
|
18
|
+
*
|
|
19
|
+
* @type {number}
|
|
20
|
+
*/
|
|
21
|
+
pre: number,
|
|
22
|
+
}
|
package/package.json
CHANGED
package/types/types.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { ObjectId } from "mongodb"
|
|
2
|
-
|
|
3
1
|
|
|
4
2
|
//#region Base Types
|
|
5
3
|
export type ObjectWithId<T> = {
|
|
@@ -11,8 +9,6 @@ import { ObjectId } from "mongodb"
|
|
|
11
9
|
}
|
|
12
10
|
//#endregion
|
|
13
11
|
|
|
14
|
-
export type Well_Client = Well<string>;
|
|
15
|
-
export type Well_Server = Well<ObjectId>;
|
|
16
12
|
export type Well<T> = WorldObject<T> & {
|
|
17
13
|
name: string,
|
|
18
14
|
color: number,
|