@colyseus/core 0.18.0 → 0.18.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/build/MatchMaker.cjs +3 -7
- package/build/MatchMaker.cjs.map +2 -2
- package/build/MatchMaker.mjs +4 -8
- package/build/MatchMaker.mjs.map +2 -2
- package/build/Protocol.cjs +3 -3
- package/build/Protocol.cjs.map +1 -1
- package/build/Protocol.d.ts +3 -3
- package/build/Protocol.mjs +3 -3
- package/build/Protocol.mjs.map +1 -1
- package/build/Rewind.cjs +385 -0
- package/build/Rewind.cjs.map +7 -0
- package/build/Rewind.d.ts +291 -0
- package/build/Rewind.mjs +359 -0
- package/build/Rewind.mjs.map +7 -0
- package/build/Room.cjs +280 -281
- package/build/Room.cjs.map +3 -3
- package/build/Room.d.ts +185 -81
- package/build/Room.mjs +286 -286
- package/build/Room.mjs.map +2 -2
- package/build/RoomMessages.cjs +265 -0
- package/build/RoomMessages.cjs.map +7 -0
- package/build/RoomMessages.d.ts +49 -0
- package/build/RoomMessages.mjs +240 -0
- package/build/RoomMessages.mjs.map +7 -0
- package/build/Server.cjs +88 -31
- package/build/Server.cjs.map +2 -2
- package/build/Server.d.ts +36 -0
- package/build/Server.mjs +88 -31
- package/build/Server.mjs.map +2 -2
- package/build/Transport.cjs +26 -0
- package/build/Transport.cjs.map +2 -2
- package/build/Transport.d.ts +69 -2
- package/build/Transport.mjs +25 -0
- package/build/Transport.mjs.map +2 -2
- package/build/errors/RoomExceptions.cjs +7 -4
- package/build/errors/RoomExceptions.cjs.map +2 -2
- package/build/errors/RoomExceptions.d.ts +15 -3
- package/build/errors/RoomExceptions.mjs +5 -3
- package/build/errors/RoomExceptions.mjs.map +2 -2
- package/build/index.cjs +19 -2
- package/build/index.cjs.map +2 -2
- package/build/index.d.ts +7 -4
- package/build/index.mjs +17 -4
- package/build/index.mjs.map +2 -2
- package/build/input/InputBuffer.cjs +439 -16
- package/build/input/InputBuffer.cjs.map +2 -2
- package/build/input/InputBuffer.d.ts +186 -96
- package/build/input/InputBuffer.mjs +436 -15
- package/build/input/InputBuffer.mjs.map +2 -2
- package/build/input/RoomInput.cjs +306 -0
- package/build/input/RoomInput.cjs.map +7 -0
- package/build/input/RoomInput.d.ts +91 -0
- package/build/input/RoomInput.mjs +287 -0
- package/build/input/RoomInput.mjs.map +7 -0
- package/build/input/types.cjs +18 -0
- package/build/input/types.cjs.map +7 -0
- package/build/input/types.d.ts +476 -0
- package/build/input/types.mjs +0 -0
- package/build/input/types.mjs.map +7 -0
- package/build/rooms/QueueRoom.cjs +1 -1
- package/build/rooms/QueueRoom.cjs.map +2 -2
- package/build/rooms/QueueRoom.mjs +1 -1
- package/build/rooms/QueueRoom.mjs.map +2 -2
- package/build/router/default_routes.cjs +4 -1
- package/build/router/default_routes.cjs.map +2 -2
- package/build/router/default_routes.mjs +4 -1
- package/build/router/default_routes.mjs.map +2 -2
- package/build/router/index.cjs +6 -1
- package/build/router/index.cjs.map +2 -2
- package/build/router/index.mjs +6 -1
- package/build/router/index.mjs.map +2 -2
- package/build/router/node.cjs +37 -2
- package/build/router/node.cjs.map +2 -2
- package/build/router/node.d.ts +10 -0
- package/build/router/node.mjs +35 -1
- package/build/router/node.mjs.map +2 -2
- package/build/serializer/NoneSerializer.cjs +2 -2
- package/build/serializer/NoneSerializer.cjs.map +2 -2
- package/build/serializer/NoneSerializer.d.ts +3 -3
- package/build/serializer/NoneSerializer.mjs +2 -2
- package/build/serializer/NoneSerializer.mjs.map +2 -2
- package/build/serializer/SchemaSerializer.cjs +44 -14
- package/build/serializer/SchemaSerializer.cjs.map +2 -2
- package/build/serializer/SchemaSerializer.d.ts +3 -3
- package/build/serializer/SchemaSerializer.mjs +46 -16
- package/build/serializer/SchemaSerializer.mjs.map +2 -2
- package/build/serializer/Serializer.cjs.map +1 -1
- package/build/serializer/Serializer.d.ts +12 -2
- package/build/utils/DevMode.cjs +14 -14
- package/build/utils/DevMode.cjs.map +2 -2
- package/build/utils/DevMode.d.ts +0 -2
- package/build/utils/DevMode.mjs +14 -12
- package/build/utils/DevMode.mjs.map +2 -2
- package/build/utils/Env.cjs +8 -4
- package/build/utils/Env.cjs.map +3 -3
- package/build/utils/Env.mjs +8 -4
- package/build/utils/Env.mjs.map +2 -2
- package/build/utils/Utils.cjs +3 -0
- package/build/utils/Utils.cjs.map +2 -2
- package/build/utils/Utils.d.ts +8 -0
- package/build/utils/Utils.mjs +2 -0
- package/build/utils/Utils.mjs.map +2 -2
- package/package.json +11 -11
- package/src/MatchMaker.ts +7 -9
- package/src/Protocol.ts +3 -3
- package/src/Rewind.ts +572 -0
- package/src/Room.ts +409 -448
- package/src/RoomMessages.ts +342 -0
- package/src/Server.ts +112 -38
- package/src/Transport.ts +97 -2
- package/src/errors/RoomExceptions.ts +18 -4
- package/src/index.ts +13 -2
- package/src/input/InputBuffer.ts +464 -107
- package/src/input/RoomInput.ts +337 -0
- package/src/input/types.ts +503 -0
- package/src/rooms/QueueRoom.ts +1 -1
- package/src/router/default_routes.ts +6 -1
- package/src/router/index.ts +6 -1
- package/src/router/node.ts +44 -0
- package/src/serializer/NoneSerializer.ts +3 -3
- package/src/serializer/SchemaSerializer.ts +110 -19
- package/src/serializer/Serializer.ts +13 -2
- package/src/utils/DevMode.ts +18 -13
- package/src/utils/Env.ts +12 -4
- package/src/utils/Utils.ts +9 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/errors/RoomExceptions.ts"],
|
|
4
|
-
"sourcesContent": ["import type { ExtractMessageType } from '@colyseus/shared-types';\nimport type { Room } from '../Room.ts';\n\nexport type RoomMethodName = 'onCreate'\n | 'onAuth'\n | 'onJoin'\n | 'onLeave'\n | 'onDrop'\n | 'onReconnect'\n | 'onDispose'\n | 'onMessage'\n | '
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["import type { ExtractMessageType } from '@colyseus/shared-types';\nimport type { Room } from '../Room.ts';\n\nexport type RoomMethodName = 'onCreate'\n | 'onAuth'\n | 'onJoin'\n | 'onLeave'\n | 'onDrop'\n | 'onReconnect'\n | 'onDispose'\n | 'onMessage'\n | 'setTimestep'\n | 'setFixedTimestep'\n | 'setInterval'\n | 'setTimeout';\n\nexport type RoomException<R extends Room = Room> =\n OnCreateException<R> |\n OnAuthException<R> |\n OnJoinException<R> |\n OnLeaveException<R> |\n OnDropException<R> |\n OnReconnectException<R> |\n OnDisposeException |\n OnMessageException<R> |\n TimestepException |\n TimedEventException;\n\nexport class OnCreateException<R extends Room = Room> extends Error {\n options: Parameters<R['onCreate']>[0];\n constructor(\n cause: Error,\n message: string,\n options: Parameters<R['onCreate']>[0],\n ) {\n super(message, { cause });\n this.name = 'OnCreateException';\n this.options = options;\n }\n}\n\nexport class OnAuthException<R extends Room = Room> extends Error {\n client: Parameters<R['onAuth']>[0];\n options: Parameters<R['onAuth']>[1];\n constructor(\n cause: Error,\n message: string,\n client: Parameters<R['onAuth']>[0],\n options: Parameters<R['onAuth']>[1],\n ) {\n super(message, { cause });\n this.name = 'OnAuthException';\n this.client = client;\n this.options = options;\n }\n}\n\nexport class OnJoinException<R extends Room = Room> extends Error {\n client: Parameters<R['onJoin']>[0];\n options: Parameters<R['onJoin']>[1];\n auth: Parameters<R['onJoin']>[2];\n constructor(\n cause: Error,\n message: string,\n client: Parameters<R['onJoin']>[0],\n options: Parameters<R['onJoin']>[1],\n auth: Parameters<R['onJoin']>[2],\n ) {\n super(message, { cause });\n this.name = 'OnJoinException';\n this.client = client;\n this.options = options;\n this.auth = auth;\n }\n}\n\nexport class OnLeaveException<R extends Room = Room> extends Error {\n client: Parameters<R['onLeave']>[0];\n consented: Parameters<R['onLeave']>[1];\n constructor(\n cause: Error,\n message: string,\n client: Parameters<R['onLeave']>[0],\n consented: Parameters<R['onLeave']>[1],\n ) {\n super(message, { cause });\n this.name = 'OnLeaveException';\n this.client = client;\n this.consented = consented;\n }\n}\n\nexport class OnDropException<R extends Room = Room> extends Error {\n client: Parameters<R['onDrop']>[0];\n code: Parameters<R['onDrop']>[1];\n constructor(\n cause: Error,\n message: string,\n client: Parameters<R['onDrop']>[0],\n code: Parameters<R['onDrop']>[1],\n ) {\n super(message, { cause });\n this.name = 'OnDropException';\n this.client = client;\n this.code = code;\n }\n}\n\nexport class OnReconnectException<R extends Room = Room> extends Error {\n client: Parameters<R['onReconnect']>[0];\n constructor(\n cause: Error,\n message: string,\n client: Parameters<R['onReconnect']>[0],\n ) {\n super(message, { cause });\n this.name = 'OnReconnectException';\n this.client = client;\n }\n}\n\nexport class OnDisposeException extends Error {\n constructor(\n cause: Error,\n message: string,\n ) {\n super(message, { cause });\n this.name = 'OnDisposeException';\n }\n}\n\nexport class OnMessageException<R extends Room, MessageType extends keyof R['messages'] = keyof R['messages']> extends Error {\n client: R['~client'];\n payload: ExtractMessageType<R['messages'][MessageType]>;\n type: MessageType;\n constructor(\n cause: Error,\n message: string,\n client: R['~client'],\n payload: ExtractMessageType<R['messages'][MessageType]>,\n type: MessageType,\n ) {\n super(message, { cause });\n this.name = 'OnMessageException';\n this.client = client;\n this.payload = payload;\n this.type = type;\n }\n\n public isType<T extends keyof R['messages']>(type: T): this is OnMessageException<R, T> {\n return (this.type as string) === type;\n }\n}\n\n/** Thrown when a {@link Room.setTimestep} or {@link Room.setFixedTimestep} tick\n * callback throws (or rejects). Reported to `onUncaughtException` with the\n * originating method as `methodName` (`'setTimestep'` / `'setFixedTimestep'`). */\nexport class TimestepException extends Error {\n constructor(\n cause: Error,\n message: string,\n ) {\n super(message, { cause });\n this.name = 'TimestepException';\n }\n}\n\n/** \n * @deprecated Renamed to {@link TimestepException} (it now covers both\n * `setTimestep` and `setFixedTimestep`). Kept as an alias for backwards\n * compatibility \u2014 `instanceof` checks against either name still match. \n * \n * TODO: remove this on 1.0\n */\nexport const SimulationIntervalException = TimestepException;\nexport type SimulationIntervalException = TimestepException;\n\nexport class TimedEventException extends Error {\n public args: any[];\n constructor(\n cause: Error,\n message: string,\n ...args: any[]\n ) {\n super(message, { cause });\n this.name = 'TimedEventException';\n this.args = args;\n }\n}"],
|
|
5
|
+
"mappings": ";AA4BO,IAAM,oBAAN,cAAuD,MAAM;AAAA,EAElE,YACE,OACA,SACA,SACA;AACA,UAAM,SAAS,EAAE,MAAM,CAAC;AACxB,SAAK,OAAO;AACZ,SAAK,UAAU;AAAA,EACjB;AACF;AAEO,IAAM,kBAAN,cAAqD,MAAM;AAAA,EAGhE,YACE,OACA,SACA,QACA,SACA;AACA,UAAM,SAAS,EAAE,MAAM,CAAC;AACxB,SAAK,OAAO;AACZ,SAAK,SAAS;AACd,SAAK,UAAU;AAAA,EACjB;AACF;AAEO,IAAM,kBAAN,cAAqD,MAAM;AAAA,EAIhE,YACE,OACA,SACA,QACA,SACA,MACA;AACA,UAAM,SAAS,EAAE,MAAM,CAAC;AACxB,SAAK,OAAO;AACZ,SAAK,SAAS;AACd,SAAK,UAAU;AACf,SAAK,OAAO;AAAA,EACd;AACF;AAEO,IAAM,mBAAN,cAAsD,MAAM;AAAA,EAGjE,YACE,OACA,SACA,QACA,WACA;AACA,UAAM,SAAS,EAAE,MAAM,CAAC;AACxB,SAAK,OAAO;AACZ,SAAK,SAAS;AACd,SAAK,YAAY;AAAA,EACnB;AACF;AAEO,IAAM,kBAAN,cAAqD,MAAM;AAAA,EAGhE,YACE,OACA,SACA,QACA,MACA;AACA,UAAM,SAAS,EAAE,MAAM,CAAC;AACxB,SAAK,OAAO;AACZ,SAAK,SAAS;AACd,SAAK,OAAO;AAAA,EACd;AACF;AAEO,IAAM,uBAAN,cAA0D,MAAM;AAAA,EAErE,YACE,OACA,SACA,QACA;AACA,UAAM,SAAS,EAAE,MAAM,CAAC;AACxB,SAAK,OAAO;AACZ,SAAK,SAAS;AAAA,EAChB;AACF;AAEO,IAAM,qBAAN,cAAiC,MAAM;AAAA,EAC5C,YACE,OACA,SACA;AACA,UAAM,SAAS,EAAE,MAAM,CAAC;AACxB,SAAK,OAAO;AAAA,EACd;AACF;AAEO,IAAM,qBAAN,cAAgH,MAAM;AAAA,EAI3H,YACE,OACA,SACA,QACA,SACA,MACA;AACA,UAAM,SAAS,EAAE,MAAM,CAAC;AACxB,SAAK,OAAO;AACZ,SAAK,SAAS;AACd,SAAK,UAAU;AACf,SAAK,OAAO;AAAA,EACd;AAAA,EAEO,OAAsC,MAA2C;AACtF,WAAQ,KAAK,SAAoB;AAAA,EACnC;AACF;AAKO,IAAM,oBAAN,cAAgC,MAAM;AAAA,EAC3C,YACE,OACA,SACA;AACA,UAAM,SAAS,EAAE,MAAM,CAAC;AACxB,SAAK,OAAO;AAAA,EACd;AACF;AASO,IAAM,8BAA8B;AAGpC,IAAM,sBAAN,cAAkC,MAAM;AAAA,EAE7C,YACE,OACA,YACG,MACH;AACA,UAAM,SAAS,EAAE,MAAM,CAAC;AACxB,SAAK,OAAO;AACZ,SAAK,OAAO;AAAA,EACd;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/build/index.cjs
CHANGED
|
@@ -38,6 +38,7 @@ __export(index_exports, {
|
|
|
38
38
|
Deferred: () => import_Utils.Deferred,
|
|
39
39
|
Delayed: () => import_timer.Delayed,
|
|
40
40
|
ErrorCode: () => import_shared_types.ErrorCode,
|
|
41
|
+
InputBufferImpl: () => import_InputBuffer.InputBufferImpl,
|
|
41
42
|
LobbyRoom: () => import_LobbyRoom.LobbyRoom,
|
|
42
43
|
LocalPresence: () => import_LocalPresence.LocalPresence,
|
|
43
44
|
OnAuthException: () => import_RoomExceptions.OnAuthException,
|
|
@@ -47,9 +48,13 @@ __export(index_exports, {
|
|
|
47
48
|
OnLeaveException: () => import_RoomExceptions.OnLeaveException,
|
|
48
49
|
OnMessageException: () => import_RoomExceptions.OnMessageException,
|
|
49
50
|
Protocol: () => import_shared_types.Protocol,
|
|
51
|
+
ProtocolModifier: () => import_shared_types.ProtocolModifier,
|
|
50
52
|
QueueRoom: () => import_QueueRoom.QueueRoom,
|
|
51
53
|
RegisteredHandler: () => import_RegisteredHandler.RegisteredHandler,
|
|
52
54
|
RelayRoom: () => import_RelayRoom.RelayRoom,
|
|
55
|
+
ResponseStatus: () => import_shared_types.ResponseStatus,
|
|
56
|
+
Rewind: () => import_Rewind.Rewind,
|
|
57
|
+
RewindView: () => import_Rewind.RewindView,
|
|
53
58
|
Room: () => import_Room.Room,
|
|
54
59
|
RoomInternalState: () => import_Room.RoomInternalState,
|
|
55
60
|
RoomPlugin: () => import_RoomPlugin.RoomPlugin,
|
|
@@ -58,9 +63,11 @@ __export(index_exports, {
|
|
|
58
63
|
ServerError: () => import_ServerError.ServerError,
|
|
59
64
|
SimulationIntervalException: () => import_RoomExceptions.SimulationIntervalException,
|
|
60
65
|
TimedEventException: () => import_RoomExceptions.TimedEventException,
|
|
66
|
+
TimestepException: () => import_RoomExceptions.TimestepException,
|
|
61
67
|
Transport: () => import_Transport.Transport,
|
|
62
68
|
attachToTestRoom: () => import_RoomPlugin.attachToTestRoom,
|
|
63
69
|
basicAuth: () => import_router.basicAuth,
|
|
70
|
+
compileSanitizer: () => import_InputBuffer.compileSanitizer,
|
|
64
71
|
connectClientToRoom: () => import_Transport.connectClientToRoom,
|
|
65
72
|
createEndpoint: () => import_router.createEndpoint,
|
|
66
73
|
createInternalContext: () => import_router.createInternalContext,
|
|
@@ -80,6 +87,7 @@ __export(index_exports, {
|
|
|
80
87
|
defineServer: () => import_Server.defineServer,
|
|
81
88
|
dualModeEndpoints: () => import_router.dualModeEndpoints,
|
|
82
89
|
dynamicImport: () => import_Utils.dynamicImport,
|
|
90
|
+
enqueueClientRaw: () => import_Transport.enqueueClientRaw,
|
|
83
91
|
generateId: () => import_Utils.generateId,
|
|
84
92
|
getBearerToken: () => import_Utils.getBearerToken,
|
|
85
93
|
getMessageBytes: () => import_Protocol.getMessageBytes,
|
|
@@ -89,7 +97,6 @@ __export(index_exports, {
|
|
|
89
97
|
matchMaker: () => matchMaker,
|
|
90
98
|
registerRoomDefinitions: () => import_Server.registerRoomDefinitions,
|
|
91
99
|
requestFromIPC: () => import_IPC.requestFromIPC,
|
|
92
|
-
room: () => import_Room.room,
|
|
93
100
|
setDevMode: () => import_DevMode.setDevMode,
|
|
94
101
|
spliceOne: () => import_Utils.spliceOne,
|
|
95
102
|
subscribeIPC: () => import_IPC.subscribeIPC,
|
|
@@ -104,6 +111,9 @@ var import_timer = require("@colyseus/timer");
|
|
|
104
111
|
var import_shared_types = require("@colyseus/shared-types");
|
|
105
112
|
var import_Server = require("./Server.cjs");
|
|
106
113
|
var import_Room = require("./Room.cjs");
|
|
114
|
+
var import_InputBuffer = require("./input/InputBuffer.cjs");
|
|
115
|
+
var import_types = require("./input/types.cjs");
|
|
116
|
+
var import_Rewind = require("./Rewind.cjs");
|
|
107
117
|
var import_RoomPlugin = require("./RoomPlugin.cjs");
|
|
108
118
|
var import_Protocol = require("./Protocol.cjs");
|
|
109
119
|
var import_RegisteredHandler = require("./matchmaker/RegisteredHandler.cjs");
|
|
@@ -137,6 +147,7 @@ var import_Logger = require("./Logger.cjs");
|
|
|
137
147
|
Deferred,
|
|
138
148
|
Delayed,
|
|
139
149
|
ErrorCode,
|
|
150
|
+
InputBufferImpl,
|
|
140
151
|
LobbyRoom,
|
|
141
152
|
LocalPresence,
|
|
142
153
|
OnAuthException,
|
|
@@ -146,9 +157,13 @@ var import_Logger = require("./Logger.cjs");
|
|
|
146
157
|
OnLeaveException,
|
|
147
158
|
OnMessageException,
|
|
148
159
|
Protocol,
|
|
160
|
+
ProtocolModifier,
|
|
149
161
|
QueueRoom,
|
|
150
162
|
RegisteredHandler,
|
|
151
163
|
RelayRoom,
|
|
164
|
+
ResponseStatus,
|
|
165
|
+
Rewind,
|
|
166
|
+
RewindView,
|
|
152
167
|
Room,
|
|
153
168
|
RoomInternalState,
|
|
154
169
|
RoomPlugin,
|
|
@@ -157,9 +172,11 @@ var import_Logger = require("./Logger.cjs");
|
|
|
157
172
|
ServerError,
|
|
158
173
|
SimulationIntervalException,
|
|
159
174
|
TimedEventException,
|
|
175
|
+
TimestepException,
|
|
160
176
|
Transport,
|
|
161
177
|
attachToTestRoom,
|
|
162
178
|
basicAuth,
|
|
179
|
+
compileSanitizer,
|
|
163
180
|
connectClientToRoom,
|
|
164
181
|
createEndpoint,
|
|
165
182
|
createInternalContext,
|
|
@@ -179,6 +196,7 @@ var import_Logger = require("./Logger.cjs");
|
|
|
179
196
|
defineServer,
|
|
180
197
|
dualModeEndpoints,
|
|
181
198
|
dynamicImport,
|
|
199
|
+
enqueueClientRaw,
|
|
182
200
|
generateId,
|
|
183
201
|
getBearerToken,
|
|
184
202
|
getMessageBytes,
|
|
@@ -188,7 +206,6 @@ var import_Logger = require("./Logger.cjs");
|
|
|
188
206
|
matchMaker,
|
|
189
207
|
registerRoomDefinitions,
|
|
190
208
|
requestFromIPC,
|
|
191
|
-
room,
|
|
192
209
|
setDevMode,
|
|
193
210
|
spliceOne,
|
|
194
211
|
subscribeIPC,
|
package/build/index.cjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["import { ClockTimer as Clock, Delayed } from '@colyseus/timer';\n\n// Shared types - re-export from @colyseus/shared-types for convenience\nexport {\n Protocol,\n ErrorCode,\n CloseCode,\n type InferState,\n type ExtractRoomMessages,\n type ExtractRoomClientMessages,\n} from '@colyseus/shared-types';\n\n// Core classes\nexport { Server, defineRoom, defineServer, registerRoomDefinitions, unregisterRoomDefinitions, type RoomDefinitions, type ServerOptions, type SDKTypes } from './Server.ts';\nexport { Room,
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,4BAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA6C;AAG7C,
|
|
4
|
+
"sourcesContent": ["import { ClockTimer as Clock, Delayed } from '@colyseus/timer';\n\n// Shared types - re-export from @colyseus/shared-types for convenience\nexport {\n Protocol,\n ProtocolModifier,\n ErrorCode,\n CloseCode,\n ResponseStatus,\n type InferState,\n type ExtractRoomMessages,\n type ExtractRoomClientMessages,\n type MessageContext,\n type Rejection,\n type Resolution,\n type ExtractRejectReason,\n type ExtractResponseType,\n} from '@colyseus/shared-types';\n\n// Core classes\nexport { Server, defineRoom, defineServer, registerRoomDefinitions, unregisterRoomDefinitions, type RoomDefinitions, type ServerOptions, type SDKTypes } from './Server.ts';\nexport { Room, RoomInternalState, validate, type RoomOptions, type DefineInputOptions, type SimulationCallback, type FixedTimestepCallback, type StepContext, type MessageHandlerWithFormat, type Messages, type ExtractRoomState, type ExtractRoomMetadata, type ExtractRoomClient } from './Room.ts';\nexport { InputBufferImpl, compileSanitizer } from './input/InputBuffer.ts';\nexport { type InputAccessor, type InputAPI, type NormalizedInputOptions, type ConsumeOptions, type IdleInput, type IdleContext, type SanitizeInput, type NumericFieldsOf } from './input/types.ts';\nexport { Rewind, RewindView, type RewindOptions, type RewindMode } from './Rewind.ts';\nexport {\n RoomPlugin, definePlugins, attachToTestRoom,\n type RoomPluginOrder, type PluginDependencies, type RoomPluginClass,\n} from './RoomPlugin.ts';\nexport { getMessageBytes } from './Protocol.ts';\nexport { RegisteredHandler } from './matchmaker/RegisteredHandler.ts';\nexport { ServerError } from './errors/ServerError.ts';\n\nexport {\n type RoomException,\n type RoomMethodName,\n OnCreateException,\n OnAuthException,\n OnJoinException,\n OnLeaveException,\n OnDisposeException,\n OnMessageException,\n TimestepException,\n SimulationIntervalException,\n TimedEventException,\n} from './errors/RoomExceptions.ts';\n\n// MatchMaker\nimport * as matchMaker from './MatchMaker.ts';\nexport { matchMaker };\nexport { updateLobby, subscribeLobby } from './matchmaker/Lobby.ts';\nexport { createNodeMatchmakingMiddleware } from './router/node.ts';\n\n// Driver\nexport * from './matchmaker/LocalDriver/LocalDriver.ts';\nexport { initializeRoomCache } from './matchmaker/driver.ts';\n\n// Transport\nexport { type Client, type ClientPrivate, type AuthContext, ClientState, ClientArray, Transport, type ISendOptions, connectClientToRoom, enqueueClientRaw } from './Transport.ts';\n\n// Presence\nexport { type Presence } from './presence/Presence.ts';\nexport { LocalPresence } from './presence/LocalPresence.ts';\n\n// Serializers\nexport { type Serializer } from './serializer/Serializer.ts';\nexport { SchemaSerializer } from './serializer/SchemaSerializer.ts';\n\n// Utilities\nexport { Clock, Delayed };\nexport { generateId, Deferred, spliceOne, getBearerToken, dynamicImport } from './utils/Utils.ts';\nexport { isDevMode, setDevMode } from './utils/DevMode.ts';\n\n// IPC\nexport { subscribeIPC, requestFromIPC } from './IPC.ts';\n\n// Debug\nexport {\n debugMatchMaking,\n debugMessage,\n debugPatch,\n debugError,\n debugConnection,\n debugDriver,\n debugPresence,\n debugAndPrintError,\n} from './Debug.ts';\n\n// Default rooms\nexport { LobbyRoom } from './rooms/LobbyRoom.ts';\nexport { RelayRoom } from './rooms/RelayRoom.ts';\nexport { QueueRoom, type QueueOptions, type QueueMatchGroup, type QueueMatchTeam, type QueueClientData } from './rooms/QueueRoom.ts';\n\n// Router / Endpoints\nexport {\n createEndpoint,\n createInternalContext,\n createMiddleware,\n createRouter,\n basicAuth,\n type BasicAuthOptions,\n toNodeHandler,\n dualModeEndpoints,\n type Router,\n type RouterConfig,\n type Endpoint,\n type EndpointHandler,\n type EndpointOptions,\n type EndpointContext,\n type StrictEndpoint,\n type ExpressMiddleware,\n type NodeHandler,\n type DualModeHelpers,\n} from './router/index.ts';\n\n// Abstract logging support\nexport { logger } from './Logger.ts';\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,4BAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA6C;AAG7C,0BAcO;AAGP,oBAA8J;AAC9J,kBAA2R;AAC3R,yBAAkD;AAClD,mBAAgL;AAChL,oBAAwE;AACxE,wBAGO;AACP,sBAAgC;AAChC,+BAAkC;AAClC,yBAA4B;AAE5B,4BAYO;AAGP,iBAA4B;AAE5B,mBAA4C;AAC5C,kBAAgD;AAGhD,0BAAc,qDAtDd;AAuDA,oBAAoC;AAGpC,uBAAiK;AAGjK,sBAA8B;AAC9B,2BAA8B;AAG9B,wBAAgC;AAChC,8BAAiC;AAIjC,mBAA+E;AAC/E,qBAAsC;AAGtC,iBAA6C;AAG7C,mBASO;AAGP,uBAA0B;AAC1B,uBAA0B;AAC1B,uBAA8G;AAG9G,oBAmBO;AAGP,oBAAuB;",
|
|
6
6
|
"names": ["Clock"]
|
|
7
7
|
}
|
package/build/index.d.ts
CHANGED
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
import { ClockTimer as Clock, Delayed } from '@colyseus/timer';
|
|
2
|
-
export { Protocol, ErrorCode, CloseCode, type InferState, type ExtractRoomMessages, type ExtractRoomClientMessages, } from '@colyseus/shared-types';
|
|
2
|
+
export { Protocol, ProtocolModifier, ErrorCode, CloseCode, ResponseStatus, type InferState, type ExtractRoomMessages, type ExtractRoomClientMessages, type MessageContext, type Rejection, type Resolution, type ExtractRejectReason, type ExtractResponseType, } from '@colyseus/shared-types';
|
|
3
3
|
export { Server, defineRoom, defineServer, registerRoomDefinitions, unregisterRoomDefinitions, type RoomDefinitions, type ServerOptions, type SDKTypes } from './Server.ts';
|
|
4
|
-
export { Room,
|
|
4
|
+
export { Room, RoomInternalState, validate, type RoomOptions, type DefineInputOptions, type SimulationCallback, type FixedTimestepCallback, type StepContext, type MessageHandlerWithFormat, type Messages, type ExtractRoomState, type ExtractRoomMetadata, type ExtractRoomClient } from './Room.ts';
|
|
5
|
+
export { InputBufferImpl, compileSanitizer } from './input/InputBuffer.ts';
|
|
6
|
+
export { type InputAccessor, type InputAPI, type NormalizedInputOptions, type ConsumeOptions, type IdleInput, type IdleContext, type SanitizeInput, type NumericFieldsOf } from './input/types.ts';
|
|
7
|
+
export { Rewind, RewindView, type RewindOptions, type RewindMode } from './Rewind.ts';
|
|
5
8
|
export { RoomPlugin, definePlugins, attachToTestRoom, type RoomPluginOrder, type PluginDependencies, type RoomPluginClass, } from './RoomPlugin.ts';
|
|
6
9
|
export { getMessageBytes } from './Protocol.ts';
|
|
7
10
|
export { RegisteredHandler } from './matchmaker/RegisteredHandler.ts';
|
|
8
11
|
export { ServerError } from './errors/ServerError.ts';
|
|
9
|
-
export { type RoomException, type RoomMethodName, OnCreateException, OnAuthException, OnJoinException, OnLeaveException, OnDisposeException, OnMessageException, SimulationIntervalException, TimedEventException, } from './errors/RoomExceptions.ts';
|
|
12
|
+
export { type RoomException, type RoomMethodName, OnCreateException, OnAuthException, OnJoinException, OnLeaveException, OnDisposeException, OnMessageException, TimestepException, SimulationIntervalException, TimedEventException, } from './errors/RoomExceptions.ts';
|
|
10
13
|
import * as matchMaker from './MatchMaker.ts';
|
|
11
14
|
export { matchMaker };
|
|
12
15
|
export { updateLobby, subscribeLobby } from './matchmaker/Lobby.ts';
|
|
13
16
|
export { createNodeMatchmakingMiddleware } from './router/node.ts';
|
|
14
17
|
export * from './matchmaker/LocalDriver/LocalDriver.ts';
|
|
15
18
|
export { initializeRoomCache } from './matchmaker/driver.ts';
|
|
16
|
-
export { type Client, type ClientPrivate, type AuthContext, ClientState, ClientArray, Transport, type ISendOptions, connectClientToRoom } from './Transport.ts';
|
|
19
|
+
export { type Client, type ClientPrivate, type AuthContext, ClientState, ClientArray, Transport, type ISendOptions, connectClientToRoom, enqueueClientRaw } from './Transport.ts';
|
|
17
20
|
export { type Presence } from './presence/Presence.ts';
|
|
18
21
|
export { LocalPresence } from './presence/LocalPresence.ts';
|
|
19
22
|
export { type Serializer } from './serializer/Serializer.ts';
|
package/build/index.mjs
CHANGED
|
@@ -2,11 +2,16 @@
|
|
|
2
2
|
import { ClockTimer as Clock, Delayed } from "@colyseus/timer";
|
|
3
3
|
import {
|
|
4
4
|
Protocol,
|
|
5
|
+
ProtocolModifier,
|
|
5
6
|
ErrorCode,
|
|
6
|
-
CloseCode
|
|
7
|
+
CloseCode,
|
|
8
|
+
ResponseStatus
|
|
7
9
|
} from "@colyseus/shared-types";
|
|
8
10
|
import { Server, defineRoom, defineServer, registerRoomDefinitions, unregisterRoomDefinitions } from "./Server.mjs";
|
|
9
|
-
import { Room,
|
|
11
|
+
import { Room, RoomInternalState, validate } from "./Room.mjs";
|
|
12
|
+
import { InputBufferImpl, compileSanitizer } from "./input/InputBuffer.mjs";
|
|
13
|
+
import {} from "./input/types.mjs";
|
|
14
|
+
import { Rewind, RewindView } from "./Rewind.mjs";
|
|
10
15
|
import {
|
|
11
16
|
RoomPlugin,
|
|
12
17
|
definePlugins,
|
|
@@ -22,6 +27,7 @@ import {
|
|
|
22
27
|
OnLeaveException,
|
|
23
28
|
OnDisposeException,
|
|
24
29
|
OnMessageException,
|
|
30
|
+
TimestepException,
|
|
25
31
|
SimulationIntervalException,
|
|
26
32
|
TimedEventException
|
|
27
33
|
} from "./errors/RoomExceptions.mjs";
|
|
@@ -30,7 +36,7 @@ import { updateLobby, subscribeLobby } from "./matchmaker/Lobby.mjs";
|
|
|
30
36
|
import { createNodeMatchmakingMiddleware } from "./router/node.mjs";
|
|
31
37
|
export * from "./matchmaker/LocalDriver/LocalDriver.mjs";
|
|
32
38
|
import { initializeRoomCache } from "./matchmaker/driver.mjs";
|
|
33
|
-
import { ClientState, ClientArray, Transport, connectClientToRoom } from "./Transport.mjs";
|
|
39
|
+
import { ClientState, ClientArray, Transport, connectClientToRoom, enqueueClientRaw } from "./Transport.mjs";
|
|
34
40
|
import {} from "./presence/Presence.mjs";
|
|
35
41
|
import { LocalPresence } from "./presence/LocalPresence.mjs";
|
|
36
42
|
import {} from "./serializer/Serializer.mjs";
|
|
@@ -69,6 +75,7 @@ export {
|
|
|
69
75
|
Deferred,
|
|
70
76
|
Delayed,
|
|
71
77
|
ErrorCode,
|
|
78
|
+
InputBufferImpl,
|
|
72
79
|
LobbyRoom,
|
|
73
80
|
LocalPresence,
|
|
74
81
|
OnAuthException,
|
|
@@ -78,9 +85,13 @@ export {
|
|
|
78
85
|
OnLeaveException,
|
|
79
86
|
OnMessageException,
|
|
80
87
|
Protocol,
|
|
88
|
+
ProtocolModifier,
|
|
81
89
|
QueueRoom,
|
|
82
90
|
RegisteredHandler,
|
|
83
91
|
RelayRoom,
|
|
92
|
+
ResponseStatus,
|
|
93
|
+
Rewind,
|
|
94
|
+
RewindView,
|
|
84
95
|
Room,
|
|
85
96
|
RoomInternalState,
|
|
86
97
|
RoomPlugin,
|
|
@@ -89,9 +100,11 @@ export {
|
|
|
89
100
|
ServerError,
|
|
90
101
|
SimulationIntervalException,
|
|
91
102
|
TimedEventException,
|
|
103
|
+
TimestepException,
|
|
92
104
|
Transport,
|
|
93
105
|
attachToTestRoom,
|
|
94
106
|
basicAuth,
|
|
107
|
+
compileSanitizer,
|
|
95
108
|
connectClientToRoom,
|
|
96
109
|
createEndpoint,
|
|
97
110
|
createInternalContext,
|
|
@@ -111,6 +124,7 @@ export {
|
|
|
111
124
|
defineServer,
|
|
112
125
|
dualModeEndpoints,
|
|
113
126
|
dynamicImport,
|
|
127
|
+
enqueueClientRaw,
|
|
114
128
|
generateId,
|
|
115
129
|
getBearerToken,
|
|
116
130
|
getMessageBytes,
|
|
@@ -120,7 +134,6 @@ export {
|
|
|
120
134
|
matchMaker,
|
|
121
135
|
registerRoomDefinitions,
|
|
122
136
|
requestFromIPC,
|
|
123
|
-
room,
|
|
124
137
|
setDevMode,
|
|
125
138
|
spliceOne,
|
|
126
139
|
subscribeIPC,
|
package/build/index.mjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["import { ClockTimer as Clock, Delayed } from '@colyseus/timer';\n\n// Shared types - re-export from @colyseus/shared-types for convenience\nexport {\n Protocol,\n ErrorCode,\n CloseCode,\n type InferState,\n type ExtractRoomMessages,\n type ExtractRoomClientMessages,\n} from '@colyseus/shared-types';\n\n// Core classes\nexport { Server, defineRoom, defineServer, registerRoomDefinitions, unregisterRoomDefinitions, type RoomDefinitions, type ServerOptions, type SDKTypes } from './Server.ts';\nexport { Room,
|
|
5
|
-
"mappings": ";AAAA,SAAS,cAAc,OAAO,eAAe;AAG7C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,
|
|
4
|
+
"sourcesContent": ["import { ClockTimer as Clock, Delayed } from '@colyseus/timer';\n\n// Shared types - re-export from @colyseus/shared-types for convenience\nexport {\n Protocol,\n ProtocolModifier,\n ErrorCode,\n CloseCode,\n ResponseStatus,\n type InferState,\n type ExtractRoomMessages,\n type ExtractRoomClientMessages,\n type MessageContext,\n type Rejection,\n type Resolution,\n type ExtractRejectReason,\n type ExtractResponseType,\n} from '@colyseus/shared-types';\n\n// Core classes\nexport { Server, defineRoom, defineServer, registerRoomDefinitions, unregisterRoomDefinitions, type RoomDefinitions, type ServerOptions, type SDKTypes } from './Server.ts';\nexport { Room, RoomInternalState, validate, type RoomOptions, type DefineInputOptions, type SimulationCallback, type FixedTimestepCallback, type StepContext, type MessageHandlerWithFormat, type Messages, type ExtractRoomState, type ExtractRoomMetadata, type ExtractRoomClient } from './Room.ts';\nexport { InputBufferImpl, compileSanitizer } from './input/InputBuffer.ts';\nexport { type InputAccessor, type InputAPI, type NormalizedInputOptions, type ConsumeOptions, type IdleInput, type IdleContext, type SanitizeInput, type NumericFieldsOf } from './input/types.ts';\nexport { Rewind, RewindView, type RewindOptions, type RewindMode } from './Rewind.ts';\nexport {\n RoomPlugin, definePlugins, attachToTestRoom,\n type RoomPluginOrder, type PluginDependencies, type RoomPluginClass,\n} from './RoomPlugin.ts';\nexport { getMessageBytes } from './Protocol.ts';\nexport { RegisteredHandler } from './matchmaker/RegisteredHandler.ts';\nexport { ServerError } from './errors/ServerError.ts';\n\nexport {\n type RoomException,\n type RoomMethodName,\n OnCreateException,\n OnAuthException,\n OnJoinException,\n OnLeaveException,\n OnDisposeException,\n OnMessageException,\n TimestepException,\n SimulationIntervalException,\n TimedEventException,\n} from './errors/RoomExceptions.ts';\n\n// MatchMaker\nimport * as matchMaker from './MatchMaker.ts';\nexport { matchMaker };\nexport { updateLobby, subscribeLobby } from './matchmaker/Lobby.ts';\nexport { createNodeMatchmakingMiddleware } from './router/node.ts';\n\n// Driver\nexport * from './matchmaker/LocalDriver/LocalDriver.ts';\nexport { initializeRoomCache } from './matchmaker/driver.ts';\n\n// Transport\nexport { type Client, type ClientPrivate, type AuthContext, ClientState, ClientArray, Transport, type ISendOptions, connectClientToRoom, enqueueClientRaw } from './Transport.ts';\n\n// Presence\nexport { type Presence } from './presence/Presence.ts';\nexport { LocalPresence } from './presence/LocalPresence.ts';\n\n// Serializers\nexport { type Serializer } from './serializer/Serializer.ts';\nexport { SchemaSerializer } from './serializer/SchemaSerializer.ts';\n\n// Utilities\nexport { Clock, Delayed };\nexport { generateId, Deferred, spliceOne, getBearerToken, dynamicImport } from './utils/Utils.ts';\nexport { isDevMode, setDevMode } from './utils/DevMode.ts';\n\n// IPC\nexport { subscribeIPC, requestFromIPC } from './IPC.ts';\n\n// Debug\nexport {\n debugMatchMaking,\n debugMessage,\n debugPatch,\n debugError,\n debugConnection,\n debugDriver,\n debugPresence,\n debugAndPrintError,\n} from './Debug.ts';\n\n// Default rooms\nexport { LobbyRoom } from './rooms/LobbyRoom.ts';\nexport { RelayRoom } from './rooms/RelayRoom.ts';\nexport { QueueRoom, type QueueOptions, type QueueMatchGroup, type QueueMatchTeam, type QueueClientData } from './rooms/QueueRoom.ts';\n\n// Router / Endpoints\nexport {\n createEndpoint,\n createInternalContext,\n createMiddleware,\n createRouter,\n basicAuth,\n type BasicAuthOptions,\n toNodeHandler,\n dualModeEndpoints,\n type Router,\n type RouterConfig,\n type Endpoint,\n type EndpointHandler,\n type EndpointOptions,\n type EndpointContext,\n type StrictEndpoint,\n type ExpressMiddleware,\n type NodeHandler,\n type DualModeHelpers,\n} from './router/index.ts';\n\n// Abstract logging support\nexport { logger } from './Logger.ts';\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,cAAc,OAAO,eAAe;AAG7C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OASK;AAGP,SAAS,QAAQ,YAAY,cAAc,yBAAyB,iCAA0F;AAC9J,SAAS,MAAM,mBAAmB,gBAAyP;AAC3R,SAAS,iBAAiB,wBAAwB;AAClD,eAAgL;AAChL,SAAS,QAAQ,kBAAuD;AACxE;AAAA,EACE;AAAA,EAAY;AAAA,EAAe;AAAA,OAEtB;AACP,SAAS,uBAAuB;AAChC,SAAS,yBAAyB;AAClC,SAAS,mBAAmB;AAE5B;AAAA,EAGE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,YAAY,gBAAgB;AAE5B,SAAS,aAAa,sBAAsB;AAC5C,SAAS,uCAAuC;AAGhD,cAAc;AACd,SAAS,2BAA2B;AAGpC,SAA4D,aAAa,aAAa,WAA8B,qBAAqB,wBAAwB;AAGjK,eAA8B;AAC9B,SAAS,qBAAqB;AAG9B,eAAgC;AAChC,SAAS,wBAAwB;AAIjC,SAAS,YAAY,UAAU,WAAW,gBAAgB,qBAAqB;AAC/E,SAAS,WAAW,kBAAkB;AAGtC,SAAS,cAAc,sBAAsB;AAG7C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,SAAS,iBAAiB;AAC1B,SAAS,iBAAiB;AAC1B,SAAS,iBAAqG;AAG9G;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,OAWK;AAGP,SAAS,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|