@minecraft/server-net 1.0.0-beta.1.26.20-preview.28 → 1.0.0-beta.1.26.30-preview.21

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.
Files changed (2) hide show
  1. package/index.d.ts +96 -2
  2. package/package.json +2 -2
package/index.d.ts CHANGED
@@ -77,6 +77,73 @@ export enum HttpRequestMethod {
77
77
  Put = 'Put',
78
78
  }
79
79
 
80
+ export enum HttpStatusCode {
81
+ Continue = 100,
82
+ SwitchingProtocols = 101,
83
+ Processing = 102,
84
+ OK = 200,
85
+ Created = 201,
86
+ Accepted = 202,
87
+ NonAuthoritativeInformation = 203,
88
+ NoContent = 204,
89
+ ResetContent = 205,
90
+ PartialContent = 206,
91
+ MultiStatus = 207,
92
+ AlreadyReported = 208,
93
+ IMUsed = 226,
94
+ MultipleChoices = 300,
95
+ MovedPermanently = 301,
96
+ Found = 302,
97
+ SeeOther = 303,
98
+ NotModified = 304,
99
+ UseProxy = 305,
100
+ TemporaryRedirect = 307,
101
+ PermanentRedirect = 308,
102
+ BadRequest = 400,
103
+ Unauthorized = 401,
104
+ PaymentRequired = 402,
105
+ Forbidden = 403,
106
+ NotFound = 404,
107
+ MethodNotAllowed = 405,
108
+ NotAcceptable = 406,
109
+ ProxyAuthenticationRequired = 407,
110
+ RequestTimeout = 408,
111
+ Conflict = 409,
112
+ Gone = 410,
113
+ LengthRequired = 411,
114
+ PreconditionFailed = 412,
115
+ PayloadTooLarge = 413,
116
+ RequestURITooLong = 414,
117
+ UnsupportedMediaType = 415,
118
+ RequestedRangeNotSatisfiable = 416,
119
+ ExpectationFailed = 417,
120
+ MisdirectedRequest = 421,
121
+ UnprocessableEntity = 422,
122
+ Locked = 423,
123
+ FailedDependency = 424,
124
+ TooEarly = 425,
125
+ UpgradeRequired = 426,
126
+ PreconditionRequired = 428,
127
+ TooManyRequests = 429,
128
+ RequestHeaderFieldsTooLarge = 431,
129
+ ConnectionClosedWithoutResponse = 444,
130
+ UnavailableForLegalReasons = 451,
131
+ ClientRequestTimeout = 498,
132
+ ClientClosedRequest = 499,
133
+ InternalServerError = 500,
134
+ NotImplemented = 501,
135
+ BadGateway = 502,
136
+ ServiceUnavailable = 503,
137
+ GatewayTimeout = 504,
138
+ HttpVersionNotSupported = 505,
139
+ VariantAlsoNegotiates = 506,
140
+ InsufficientStorage = 507,
141
+ LoopDetected = 508,
142
+ NotExtended = 510,
143
+ NetworkAuthenticationRequired = 511,
144
+ NetworkConnectionTimeoutError = 599,
145
+ }
146
+
80
147
  /**
81
148
  * Represents the unique type of network packet.
82
149
  */
@@ -125,6 +192,7 @@ export enum PacketId {
125
192
  ClientboundDebugRendererPacket = 'ClientboundDebugRendererPacket',
126
193
  ClientboundMapItemDataPacket = 'ClientboundMapItemDataPacket',
127
194
  ClientboundTextureShiftPacket = 'ClientboundTextureShiftPacket',
195
+ ClientboundUpdateSoundDataPacket = 'ClientboundUpdateSoundDataPacket',
128
196
  ClientCacheBlobStatusPacket = 'ClientCacheBlobStatusPacket',
129
197
  ClientCacheMissResponsePacket = 'ClientCacheMissResponsePacket',
130
198
  ClientCacheStatusPacket = 'ClientCacheStatusPacket',
@@ -202,6 +270,7 @@ export enum PacketId {
202
270
  OpenSignPacket = 'OpenSignPacket',
203
271
  PacketViolationWarningPacket = 'PacketViolationWarningPacket',
204
272
  PartyChangedPacket = 'PartyChangedPacket',
273
+ PartyDestinationCookieResponsePacket = 'PartyDestinationCookieResponsePacket',
205
274
  PhotoTransferPacket = 'PhotoTransferPacket',
206
275
  PlayerActionPacket = 'PlayerActionPacket',
207
276
  PlayerArmorDamagePacket = 'PlayerArmorDamagePacket',
@@ -238,6 +307,7 @@ export enum PacketId {
238
307
  ResourcePackStackPacket = 'ResourcePackStackPacket',
239
308
  RespawnPacket = 'RespawnPacket',
240
309
  ScriptMessagePacket = 'ScriptMessagePacket',
310
+ SendPartyDestinationCookiePacket = 'SendPartyDestinationCookiePacket',
241
311
  ServerboundDataDrivenScreenClosedPacket = 'ServerboundDataDrivenScreenClosedPacket',
242
312
  ServerboundDataStorePacket = 'ServerboundDataStorePacket',
243
313
  ServerboundDiagnosticsPacket = 'ServerboundDiagnosticsPacket',
@@ -308,6 +378,29 @@ export enum PacketId {
308
378
  VoxelShapesPacket = 'VoxelShapesPacket',
309
379
  }
310
380
 
381
+ export enum WebSocketClientCloseReasons {
382
+ /**
383
+ * @remarks
384
+ * The server has closed the socket.
385
+ *
386
+ */
387
+ ClosedByServer = 0,
388
+ /**
389
+ * @remarks
390
+ * The client has closed the socket.
391
+ *
392
+ */
393
+ ClosedByClient = 1,
394
+ /**
395
+ * @remarks
396
+ * The client has received payloads whose body exceeds the
397
+ * configured maximum size allowed per tick so the client has
398
+ * closed the socket.
399
+ *
400
+ */
401
+ IncomingPayloadsTooLarge = 2,
402
+ }
403
+
311
404
  export class CloseAfterEventSignal {
312
405
  private constructor();
313
406
  /**
@@ -751,7 +844,7 @@ export class WebSocket {
751
844
  * An awaitable promise that contains the WebSocket client that
752
845
  * was connected.
753
846
  */
754
- connect(uri: string): Promise<WebSocketClient>;
847
+ connect(uri: string, headers?: HttpHeader[]): Promise<WebSocketClient>;
755
848
  }
756
849
 
757
850
  /**
@@ -818,6 +911,7 @@ export class WebSocketClientAfterEvents {
818
911
 
819
912
  export class WebSocketClientCloseAfterEvent {
820
913
  private constructor();
914
+ readonly reason: WebSocketClientCloseReasons;
821
915
  }
822
916
 
823
917
  export class WebSocketClientReceiveAfterEvent {
@@ -998,7 +1092,7 @@ export class WebSocketConnectionFailedError extends Error {
998
1092
  * This property can be read in early-execution mode.
999
1093
  *
1000
1094
  */
1001
- readonly errorCode: number;
1095
+ readonly errorCode: HttpStatusCode;
1002
1096
  /**
1003
1097
  * @remarks
1004
1098
  * The URI provided to make this connection attempt that
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server-net",
3
- "version": "1.0.0-beta.1.26.20-preview.28",
3
+ "version": "1.0.0-beta.1.26.30-preview.21",
4
4
  "description": "",
5
5
  "contributors": [
6
6
  {
@@ -15,7 +15,7 @@
15
15
  "peerDependencies": {
16
16
  "@minecraft/common": "^1.0.0",
17
17
  "@minecraft/server": "^1.17.0 || ^2.0.0",
18
- "@minecraft/server-admin": "^1.0.0-beta.1.26.20-preview.28"
18
+ "@minecraft/server-admin": "^1.0.0-beta.1.26.30-preview.21"
19
19
  },
20
20
  "license": "MIT"
21
21
  }