@wayward/types 2.15.5-beta.dev.20260601.1 → 2.15.5-beta.dev.20260602.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/definitions/game/game/item/ItemManager.d.ts +3 -0
- package/definitions/game/multiplayer/Multiplayer.d.ts +24 -0
- package/definitions/game/multiplayer/SyncRegion.d.ts +16 -10
- package/definitions/game/multiplayer/packets/IPacket.d.ts +1 -0
- package/definitions/lint/use-using-disposable.d.mts +28 -0
- package/definitions/test/suite/unitTests/game/multiplayer/SyncRegion.spec.d.ts +13 -0
- package/definitions/utilities/log/ErrorReportAttachments.d.ts +1 -2
- package/package.json +1 -1
|
@@ -113,6 +113,9 @@ export default class ItemManager extends EntityManager<Item, IItemRemoveOptions>
|
|
|
113
113
|
private static readonly cachedItemsThatCanBeRelic;
|
|
114
114
|
private static readonly cachedRuneChanceRanges;
|
|
115
115
|
static readonly cachedItemSpawns: Map<BiomeType, Map<WorldZ, Map<TerrainType, ItemType[]>>>;
|
|
116
|
+
private getSyncCheckContainerDebug;
|
|
117
|
+
private getSyncCheckItemDebug;
|
|
118
|
+
private getSyncCheckItemIdentity;
|
|
116
119
|
static getItemTypes(): readonly ItemType[];
|
|
117
120
|
static getRuneChanceRange(deity: DeityReal): IRange;
|
|
118
121
|
static getItemsWithRecipes(): readonly ItemType[];
|
|
@@ -19,6 +19,9 @@ import type { IPacket } from "@wayward/game/multiplayer/packets/IPacket";
|
|
|
19
19
|
import DesyncPacket from "@wayward/game/multiplayer/packets/server/DesyncPacket";
|
|
20
20
|
import type { IServerMod } from "@wayward/hosts/shared/interfaces";
|
|
21
21
|
import EventEmitter from "@wayward/utilities/event/EventEmitter";
|
|
22
|
+
export interface ISyncRegionHandle extends Disposable {
|
|
23
|
+
dispose(): void;
|
|
24
|
+
}
|
|
22
25
|
export default class Multiplayer extends EventEmitter.Host<IMultiplayerEvents> {
|
|
23
26
|
/**
|
|
24
27
|
* Static steam account id when steam support is on
|
|
@@ -172,8 +175,29 @@ export default class Multiplayer extends EventEmitter.Host<IMultiplayerEvents> {
|
|
|
172
175
|
* Active means there's a current sync check being recorded
|
|
173
176
|
*/
|
|
174
177
|
isSyncCheckEnabled(syncCheck: MultiplayerSyncCheck): boolean;
|
|
178
|
+
/**
|
|
179
|
+
* Opens a sync check region and returns a disposable handle that closes it.
|
|
180
|
+
*
|
|
181
|
+
* Erasable sync regions that don't contain a fork are removed from desync reports.
|
|
182
|
+
*/
|
|
183
|
+
addSyncRegion(syncCheck: MultiplayerSyncCheck, value: any): ISyncRegionHandle;
|
|
184
|
+
/**
|
|
185
|
+
* Opens a sync check region and returns a disposable handle that closes it.
|
|
186
|
+
*/
|
|
187
|
+
addSyncRegion(id: string): ISyncRegionHandle;
|
|
188
|
+
/**
|
|
189
|
+
* Opens an erasable sync check region and returns a disposable handle that closes it.
|
|
190
|
+
*
|
|
191
|
+
* Erasable regions are removed from collapsed desync reports when they match on both sides.
|
|
192
|
+
*/
|
|
193
|
+
addErasableSyncRegion(syncCheck: MultiplayerSyncCheck, value: any): ISyncRegionHandle;
|
|
194
|
+
addErasableSyncRegion(id: string): ISyncRegionHandle;
|
|
195
|
+
private createSyncRegion;
|
|
175
196
|
addSyncCheck(syncCheck: MultiplayerSyncCheck, value: any, addStackTrace?: boolean): void;
|
|
197
|
+
addErasableSyncCheck(syncCheck: MultiplayerSyncCheck, value: any, addStackTrace?: boolean): void;
|
|
198
|
+
private addSyncCheckInternal;
|
|
176
199
|
addSyncCheckWithSeed(island: Island, syncCheck: MultiplayerSyncCheck, ...messages: any[]): void;
|
|
200
|
+
addErasableSyncCheckWithSeed(island: Island, syncCheck: MultiplayerSyncCheck, ...messages: any[]): void;
|
|
177
201
|
addBeforeSyncChecks(packet: IPacket): void;
|
|
178
202
|
addAfterSyncChecks(packet: IPacket): void;
|
|
179
203
|
sendChatMessage(sender: Player, message: string): Promise<void>;
|
|
@@ -8,15 +8,21 @@
|
|
|
8
8
|
* Wayward is a copyrighted and licensed work. Modification and/or distribution of any source files is prohibited. If you wish to modify the game in any way, please refer to the modding guide:
|
|
9
9
|
* https://github.com/WaywardGame/types/wiki
|
|
10
10
|
*/
|
|
11
|
-
type
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
type SyncRegionDecorator<TARGET, ARGS extends any[]> = <RETURN>(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor<(this: TARGET, ...args: ARGS) => RETURN>) => TypedPropertyDescriptor<(this: TARGET, ...args: ARGS) => RETURN> | void;
|
|
12
|
+
export declare const erasableSyncRegionPrefix = "!";
|
|
13
|
+
export declare const erasableSyncCheckPrefix = "!";
|
|
14
|
+
export interface ISyncRegionOptions<T = any, ARGS extends any[] = any[]> {
|
|
15
|
+
erasable?: boolean;
|
|
16
|
+
render?: (target: T, ...args: ARGS) => string;
|
|
17
|
+
}
|
|
18
|
+
export declare function collapseSyncCheckRegions(syncChecks: readonly string[]): string[];
|
|
19
|
+
export declare function collapseSharedSyncCheckRegions(serverSyncChecks: readonly string[], clientSyncChecks: readonly string[]): [string[], string[]];
|
|
20
|
+
export declare function formatSyncCheckRegion(syncCheck: string): string;
|
|
15
21
|
export default function SyncRegion(target: any, propertyKey: string, descriptor: PropertyDescriptor): PropertyDescriptor;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
export default function SyncRegion<T>(
|
|
22
|
+
export default function SyncRegion<T, const F extends (target: T, arg: any, ...args: any[]) => string>(detailProvider: F): SyncRegionDecorator<T, F extends (target: T, ...args: infer ARGS) => string ? ARGS : []>;
|
|
23
|
+
export default function SyncRegion<T>(detailProvider: (target: T) => string): SyncRegionDecorator<T, any[]>;
|
|
24
|
+
export default function SyncRegion<T, ARGS extends [any, ...any[]]>(options: ISyncRegionOptions<T, ARGS> & {
|
|
25
|
+
render: (target: T, ...args: ARGS) => string;
|
|
26
|
+
}): SyncRegionDecorator<T, ARGS>;
|
|
27
|
+
export default function SyncRegion<T>(options: ISyncRegionOptions<T>): SyncRegionDecorator<T, any[] | []>;
|
|
22
28
|
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export namespace meta {
|
|
3
|
+
export let type: string;
|
|
4
|
+
export namespace docs {
|
|
5
|
+
let description: string;
|
|
6
|
+
let category: string;
|
|
7
|
+
let recommended: boolean;
|
|
8
|
+
}
|
|
9
|
+
export { messages };
|
|
10
|
+
export let schema: never[];
|
|
11
|
+
}
|
|
12
|
+
export { createRuleListener as create };
|
|
13
|
+
}
|
|
14
|
+
export default _default;
|
|
15
|
+
export type Context = TSESLint.RuleContext<keyof typeof messages, []>;
|
|
16
|
+
declare namespace messages {
|
|
17
|
+
let useUsing: string;
|
|
18
|
+
let useAwaitUsing: string;
|
|
19
|
+
let holdWithUsing: string;
|
|
20
|
+
let holdWithAwaitUsing: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* @param {Context} context
|
|
24
|
+
* @returns {TSESLint.RuleListener}
|
|
25
|
+
*/
|
|
26
|
+
declare function createRuleListener(context: Context): ESLintUtils.RuleListener;
|
|
27
|
+
import type { TSESLint } from '@typescript-eslint/utils';
|
|
28
|
+
import { ESLintUtils } from "@typescript-eslint/utils";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2011-2025 Unlok
|
|
3
|
+
* https://www.unlok.ca
|
|
4
|
+
*
|
|
5
|
+
* Credits & Thanks:
|
|
6
|
+
* https://www.unlok.ca/credits-thanks/
|
|
7
|
+
*
|
|
8
|
+
* Wayward is a copyrighted and licensed work. Modification and/or distribution of any source files is prohibited. If you wish to modify the game in any way, please refer to the modding guide:
|
|
9
|
+
* https://github.com/WaywardGame/types/wiki
|
|
10
|
+
*/
|
|
11
|
+
import type { TestConfig } from "@wayward/test";
|
|
12
|
+
import type { IPaths } from "@wayward/test/interfaces";
|
|
13
|
+
export default function (paths: IPaths, config: TestConfig): void;
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
declare namespace ErrorReportAttachments {
|
|
12
12
|
const MAX_ATTACHMENTS = 4;
|
|
13
13
|
const MAX_ATTACHMENT_BYTES: number;
|
|
14
|
-
const MAX_TOTAL_ATTACHMENT_BYTES: number;
|
|
15
14
|
interface IAttachment {
|
|
16
15
|
filename: string;
|
|
17
16
|
contentType: string;
|
|
@@ -19,7 +18,7 @@ declare namespace ErrorReportAttachments {
|
|
|
19
18
|
}
|
|
20
19
|
interface IValidationResult {
|
|
21
20
|
attachments: IAttachment[];
|
|
22
|
-
|
|
21
|
+
notices: string[];
|
|
23
22
|
totalBytes: number;
|
|
24
23
|
}
|
|
25
24
|
function validate(attachments: readonly IAttachment[] | undefined): IValidationResult;
|
package/package.json
CHANGED