@colyseus/core 0.17.1 → 0.17.3
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/rooms/RankedQueueRoom.js.map +2 -2
- package/build/rooms/RankedQueueRoom.mjs.map +2 -2
- package/package.json +6 -4
- package/src/rooms/RankedQueueRoom.ts +1 -1
- package/build/matchmaker/driver/api.js +0 -48
- package/build/matchmaker/driver/api.js.map +0 -7
- package/build/matchmaker/driver/api.mjs +0 -24
- package/build/matchmaker/driver/api.mjs.map +0 -7
- package/build/matchmaker/driver/local/LocalDriver.js +0 -94
- package/build/matchmaker/driver/local/LocalDriver.js.map +0 -7
- package/build/matchmaker/driver/local/LocalDriver.mjs +0 -71
- package/build/matchmaker/driver/local/LocalDriver.mjs.map +0 -7
- package/build/matchmaker/driver/local/Query.js +0 -111
- package/build/matchmaker/driver/local/Query.js.map +0 -7
- package/build/matchmaker/driver/local/Query.mjs +0 -88
- package/build/matchmaker/driver/local/Query.mjs.map +0 -7
- package/build/matchmaker/routes.js +0 -79
- package/build/matchmaker/routes.js.map +0 -7
- package/build/matchmaker/routes.mjs +0 -45
- package/build/matchmaker/routes.mjs.map +0 -7
- package/build/rooms/createRoom.js +0 -51
- package/build/rooms/createRoom.js.map +0 -7
- package/build/rooms/createRoom.mjs +0 -28
- package/build/rooms/createRoom.mjs.map +0 -7
- package/build/src/matchmaker/driver/api.d.ts +0 -145
- package/build/src/matchmaker/driver/local/LocalDriver.d.ts +0 -17
- package/build/src/matchmaker/driver/local/Query.d.ts +0 -12
- package/build/src/matchmaker/routes.d.ts +0 -92
- package/build/src/rooms/createRoom.d.ts +0 -65
- /package/build/{src/Debug.d.ts → Debug.d.ts} +0 -0
- /package/build/{src/IPC.d.ts → IPC.d.ts} +0 -0
- /package/build/{src/Logger.d.ts → Logger.d.ts} +0 -0
- /package/build/{src/MatchMaker.d.ts → MatchMaker.d.ts} +0 -0
- /package/build/{src/Protocol.d.ts → Protocol.d.ts} +0 -0
- /package/build/{src/Room.d.ts → Room.d.ts} +0 -0
- /package/build/{src/Server.d.ts → Server.d.ts} +0 -0
- /package/build/{src/Stats.d.ts → Stats.d.ts} +0 -0
- /package/build/{src/Transport.d.ts → Transport.d.ts} +0 -0
- /package/build/{src/errors → errors}/RoomExceptions.d.ts +0 -0
- /package/build/{src/errors → errors}/SeatReservationError.d.ts +0 -0
- /package/build/{src/errors → errors}/ServerError.d.ts +0 -0
- /package/build/{src/index.d.ts → index.d.ts} +0 -0
- /package/build/{src/matchmaker → matchmaker}/Lobby.d.ts +0 -0
- /package/build/{src/matchmaker → matchmaker}/LocalDriver/LocalDriver.d.ts +0 -0
- /package/build/{src/matchmaker → matchmaker}/LocalDriver/Query.d.ts +0 -0
- /package/build/{src/matchmaker → matchmaker}/RegisteredHandler.d.ts +0 -0
- /package/build/{src/matchmaker → matchmaker}/controller.d.ts +0 -0
- /package/build/{src/matchmaker → matchmaker}/driver.d.ts +0 -0
- /package/build/{src/presence → presence}/LocalPresence.d.ts +0 -0
- /package/build/{src/presence → presence}/Presence.d.ts +0 -0
- /package/build/{src/rooms → rooms}/LobbyRoom.d.ts +0 -0
- /package/build/{src/rooms → rooms}/RankedQueueRoom.d.ts +0 -0
- /package/build/{src/rooms → rooms}/RelayRoom.d.ts +0 -0
- /package/build/{src/router → router}/default_routes.d.ts +0 -0
- /package/build/{src/router → router}/index.d.ts +0 -0
- /package/build/{src/serializer → serializer}/NoneSerializer.d.ts +0 -0
- /package/build/{src/serializer → serializer}/SchemaSerializer.d.ts +0 -0
- /package/build/{src/serializer → serializer}/SchemaSerializerDebug.d.ts +0 -0
- /package/build/{src/serializer → serializer}/Serializer.d.ts +0 -0
- /package/build/{src/utils → utils}/DevMode.d.ts +0 -0
- /package/build/{src/utils → utils}/StandardSchema.d.ts +0 -0
- /package/build/{src/utils → utils}/Utils.d.ts +0 -0
- /package/build/{src/utils → utils}/nanoevents.d.ts +0 -0
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { IRoomCache, SortOptions } from '../api.ts';
|
|
2
|
-
export declare class Query<T extends IRoomCache> {
|
|
3
|
-
private $rooms;
|
|
4
|
-
private conditions;
|
|
5
|
-
private sortOptions?;
|
|
6
|
-
constructor(rooms: any[], conditions: any);
|
|
7
|
-
sort(options: SortOptions): this;
|
|
8
|
-
private applySort;
|
|
9
|
-
private applyFilter;
|
|
10
|
-
filter(conditions: any): T[];
|
|
11
|
-
then(resolve: any, reject: any): any;
|
|
12
|
-
}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
export declare const postMatchmakeMethod: import("@colyseus/better-call").StrictEndpoint<"/matchmake/:method/:roomName", {
|
|
2
|
-
method: "POST";
|
|
3
|
-
}, any>;
|
|
4
|
-
export declare function getDefaultRouter(): {
|
|
5
|
-
handler: (request: Request) => Promise<Response>;
|
|
6
|
-
endpoints: {
|
|
7
|
-
postMatchmakeMethod: import("@colyseus/better-call").StrictEndpoint<"/matchmake/:method/:roomName", {
|
|
8
|
-
method: "POST";
|
|
9
|
-
}, any>;
|
|
10
|
-
};
|
|
11
|
-
extend: <NE extends Record<string, import("@colyseus/better-call").Endpoint>>(newEndpoints: NE) => {
|
|
12
|
-
handler: (request: Request) => Promise<Response>;
|
|
13
|
-
endpoints: {
|
|
14
|
-
postMatchmakeMethod: import("@colyseus/better-call").StrictEndpoint<"/matchmake/:method/:roomName", {
|
|
15
|
-
method: "POST";
|
|
16
|
-
}, any>;
|
|
17
|
-
} & NE;
|
|
18
|
-
extend: <NE_1 extends Record<string, import("@colyseus/better-call").Endpoint>>(newEndpoints: NE_1) => {
|
|
19
|
-
handler: (request: Request) => Promise<Response>;
|
|
20
|
-
endpoints: {
|
|
21
|
-
postMatchmakeMethod: import("@colyseus/better-call").StrictEndpoint<"/matchmake/:method/:roomName", {
|
|
22
|
-
method: "POST";
|
|
23
|
-
}, any>;
|
|
24
|
-
} & NE & NE_1;
|
|
25
|
-
extend: <NE_2 extends Record<string, import("@colyseus/better-call").Endpoint>>(newEndpoints: NE_2) => {
|
|
26
|
-
handler: (request: Request) => Promise<Response>;
|
|
27
|
-
endpoints: {
|
|
28
|
-
postMatchmakeMethod: import("@colyseus/better-call").StrictEndpoint<"/matchmake/:method/:roomName", {
|
|
29
|
-
method: "POST";
|
|
30
|
-
}, any>;
|
|
31
|
-
} & NE & NE_1 & NE_2;
|
|
32
|
-
extend: <NE_3 extends Record<string, import("@colyseus/better-call").Endpoint>>(newEndpoints: NE_3) => {
|
|
33
|
-
handler: (request: Request) => Promise<Response>;
|
|
34
|
-
endpoints: {
|
|
35
|
-
postMatchmakeMethod: import("@colyseus/better-call").StrictEndpoint<"/matchmake/:method/:roomName", {
|
|
36
|
-
method: "POST";
|
|
37
|
-
}, any>;
|
|
38
|
-
} & NE & NE_1 & NE_2 & NE_3;
|
|
39
|
-
extend: <NE_4 extends Record<string, import("@colyseus/better-call").Endpoint>>(newEndpoints: NE_4) => {
|
|
40
|
-
handler: (request: Request) => Promise<Response>;
|
|
41
|
-
endpoints: {
|
|
42
|
-
postMatchmakeMethod: import("@colyseus/better-call").StrictEndpoint<"/matchmake/:method/:roomName", {
|
|
43
|
-
method: "POST";
|
|
44
|
-
}, any>;
|
|
45
|
-
} & NE & NE_1 & NE_2 & NE_3 & NE_4;
|
|
46
|
-
extend: <NE_5 extends Record<string, import("@colyseus/better-call").Endpoint>>(newEndpoints: NE_5) => {
|
|
47
|
-
handler: (request: Request) => Promise<Response>;
|
|
48
|
-
endpoints: {
|
|
49
|
-
postMatchmakeMethod: import("@colyseus/better-call").StrictEndpoint<"/matchmake/:method/:roomName", {
|
|
50
|
-
method: "POST";
|
|
51
|
-
}, any>;
|
|
52
|
-
} & NE & NE_1 & NE_2 & NE_3 & NE_4 & NE_5;
|
|
53
|
-
extend: <NE_6 extends Record<string, import("@colyseus/better-call").Endpoint>>(newEndpoints: NE_6) => {
|
|
54
|
-
handler: (request: Request) => Promise<Response>;
|
|
55
|
-
endpoints: {
|
|
56
|
-
postMatchmakeMethod: import("@colyseus/better-call").StrictEndpoint<"/matchmake/:method/:roomName", {
|
|
57
|
-
method: "POST";
|
|
58
|
-
}, any>;
|
|
59
|
-
} & NE & NE_1 & NE_2 & NE_3 & NE_4 & NE_5 & NE_6;
|
|
60
|
-
extend: <NE_7 extends Record<string, import("@colyseus/better-call").Endpoint>>(newEndpoints: NE_7) => {
|
|
61
|
-
handler: (request: Request) => Promise<Response>;
|
|
62
|
-
endpoints: {
|
|
63
|
-
postMatchmakeMethod: import("@colyseus/better-call").StrictEndpoint<"/matchmake/:method/:roomName", {
|
|
64
|
-
method: "POST";
|
|
65
|
-
}, any>;
|
|
66
|
-
} & NE & NE_1 & NE_2 & NE_3 & NE_4 & NE_5 & NE_6 & NE_7;
|
|
67
|
-
extend: <NE_8 extends Record<string, import("@colyseus/better-call").Endpoint>>(newEndpoints: NE_8) => {
|
|
68
|
-
handler: (request: Request) => Promise<Response>;
|
|
69
|
-
endpoints: {
|
|
70
|
-
postMatchmakeMethod: import("@colyseus/better-call").StrictEndpoint<"/matchmake/:method/:roomName", {
|
|
71
|
-
method: "POST";
|
|
72
|
-
}, any>;
|
|
73
|
-
} & NE & NE_1 & NE_2 & NE_3 & NE_4 & NE_5 & NE_6 & NE_7 & NE_8;
|
|
74
|
-
extend: <NE_9 extends Record<string, import("@colyseus/better-call").Endpoint>>(newEndpoints: NE_9) => {
|
|
75
|
-
handler: (request: Request) => Promise<Response>;
|
|
76
|
-
endpoints: {
|
|
77
|
-
postMatchmakeMethod: import("@colyseus/better-call").StrictEndpoint<"/matchmake/:method/:roomName", {
|
|
78
|
-
method: "POST";
|
|
79
|
-
}, any>;
|
|
80
|
-
} & NE & NE_1 & NE_2 & NE_3 & NE_4 & NE_5 & NE_6 & NE_7 & NE_8 & NE_9;
|
|
81
|
-
extend: <NE_10 extends Record<string, import("@colyseus/better-call").Endpoint>>(newEndpoints: NE_10) => any;
|
|
82
|
-
};
|
|
83
|
-
};
|
|
84
|
-
};
|
|
85
|
-
};
|
|
86
|
-
};
|
|
87
|
-
};
|
|
88
|
-
};
|
|
89
|
-
};
|
|
90
|
-
};
|
|
91
|
-
};
|
|
92
|
-
};
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Exploration: defineRoom() factory function
|
|
3
|
-
*
|
|
4
|
-
* Goal: Allow users to define rooms without explicit generic parameters,
|
|
5
|
-
* while still getting full type inference for broadcast() and client.send()
|
|
6
|
-
*/
|
|
7
|
-
import { Room, type Client } from "@colyseus/core";
|
|
8
|
-
/**
|
|
9
|
-
* Helper type for cleaner Client typing with messages.
|
|
10
|
-
* Reduces boilerplate from `Client<{ messages: M }>` to `MessageClient<M>`.
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```typescript
|
|
14
|
-
* type MyClient = MessageClient<{
|
|
15
|
-
* chat: { text: string };
|
|
16
|
-
* move: { x: number; y: number };
|
|
17
|
-
* }>;
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
export type MessageClient<Messages extends Record<string, any>> = Client<{
|
|
21
|
-
messages: Messages;
|
|
22
|
-
}>;
|
|
23
|
-
/**
|
|
24
|
-
* Options for createRoom factory function.
|
|
25
|
-
*/
|
|
26
|
-
interface DefineRoomOptions<TClient extends Client = Client, State extends object = any, JoinOptions = any> {
|
|
27
|
-
state?: State | (() => State);
|
|
28
|
-
onCreate?(this: Room<State, any, TClient>, options: any): void | Promise<void>;
|
|
29
|
-
onJoin?(this: Room<State, any, TClient>, client: TClient, options: JoinOptions): void | Promise<void>;
|
|
30
|
-
onLeave?(this: Room<State, any, TClient>, client: TClient, code?: number): void | Promise<void>;
|
|
31
|
-
onDispose?(this: Room<State, any, TClient>): void | Promise<void>;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Create a Room class from an options object.
|
|
35
|
-
* Provides Vue-style object configuration with full type inference.
|
|
36
|
-
*
|
|
37
|
-
* @example
|
|
38
|
-
* ```typescript
|
|
39
|
-
* type MyClient = Client<{
|
|
40
|
-
* userData: { rank: number };
|
|
41
|
-
* auth: { odToken: string };
|
|
42
|
-
* messages: {
|
|
43
|
-
* chat: { text: string };
|
|
44
|
-
* move: { x: number; y: number };
|
|
45
|
-
* };
|
|
46
|
-
* }>;
|
|
47
|
-
*
|
|
48
|
-
* const MyRoom = createRoom<MyClient, MyState>({
|
|
49
|
-
* state: () => new MyState(),
|
|
50
|
-
*
|
|
51
|
-
* onCreate() {
|
|
52
|
-
* console.log("Room created");
|
|
53
|
-
* },
|
|
54
|
-
*
|
|
55
|
-
* onJoin(client, options) {
|
|
56
|
-
* client.send("chat", { text: "Welcome!" }); // ✅ typed!
|
|
57
|
-
* this.broadcast("move", { x: 0, y: 0 }); // ✅ typed!
|
|
58
|
-
* client.userData.rank; // ✅ typed!
|
|
59
|
-
* client.auth.odToken; // ✅ typed!
|
|
60
|
-
* }
|
|
61
|
-
* });
|
|
62
|
-
* ```
|
|
63
|
-
*/
|
|
64
|
-
export declare function createRoom<TClient extends Client = Client, State extends object = any, JoinOptions = any>(options: DefineRoomOptions<TClient, State, JoinOptions>): typeof Room<State, any, TClient>;
|
|
65
|
-
export {};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|