@wayward/types 2.13.0-beta.dev.20230430.2 → 2.13.0-beta.dev.20230502.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/entity/action/ActionsRegistration.d.ts +1 -1
- package/definitions/game/game/entity/action/actions/Trade.d.ts +1 -1
- package/definitions/game/game/entity/npc/NPC.d.ts +3 -3
- package/definitions/game/game/entity/npc/npcs/Merchant.d.ts +3 -3
- package/definitions/game/game/entity/npc/npcs/Shipper.d.ts +4 -3
- package/definitions/game/game/inspection/InfoProvider.d.ts +1 -1
- package/definitions/game/game/inspection/infoProviders/item/ItemUses.d.ts +1 -2
- package/definitions/game/game/inspection/infoProviders/item/use/ItemConsumeInfo.d.ts +4 -5
- package/definitions/game/game/item/IItem.d.ts +14 -8
- package/definitions/game/language/Translation.d.ts +1 -1
- package/definitions/game/multiplayer/IMultiplayer.d.ts +14 -1
- package/definitions/game/multiplayer/Multiplayer.d.ts +7 -3
- package/definitions/game/multiplayer/packets/server/ConnectPacket.d.ts +1 -1
- package/definitions/game/steamworks/Steamworks.d.ts +2 -0
- package/definitions/game/ui/screen/screens/game/dialog/BookDialog.d.ts +1 -1
- package/definitions/hosts/electron/main/launchOptions.d.ts +1 -0
- package/definitions/test/core/application.d.ts +12 -12
- package/definitions/test/core/applicationDom.d.ts +2 -2
- package/definitions/test/core/applicationInteractions.d.ts +9 -9
- package/definitions/test/core/applicationLogger.d.ts +1 -1
- package/definitions/test/core/applicationManager.d.ts +8 -9
- package/definitions/test/core/chromeDriver.d.ts +2 -2
- package/definitions/test/index.d.ts +1 -1
- package/definitions/test/interfaces.d.ts +1 -1
- package/definitions/test/suite/functionalTests/multiplayer/Multiplayer.spec.d.ts +3 -3
- package/definitions/test/suite/functionalTests/singleplayer/SaveImport.spec.d.ts +3 -3
- package/definitions/test/suite/functionalTests/singleplayer/Singleplayer.spec.d.ts +3 -3
- package/definitions/test/suite/unitTests/game/Actions.spec.d.ts +3 -3
- package/definitions/test/suite/unitTests/game/Island.spec.d.ts +3 -3
- package/definitions/test/suite/unitTests/utilities/KdTree.spec.d.ts +3 -3
- package/definitions/test/suite/unitTests/utilities/MagicalPropertyManager.spec.d.ts +3 -3
- package/definitions/test/testRunner.d.ts +14 -2
- package/definitions/test/util/helpers.d.ts +1 -1
- package/definitions/test/util/ports.d.ts +11 -0
- package/definitions/test/util/random.d.ts +1 -1
- package/package.json +1 -1
- package/definitions/game/ui/old/functional/IFunctionalTooltip.d.ts +0 -37
|
@@ -151,7 +151,7 @@ export declare const actionDescriptionsSlow: {
|
|
|
151
151
|
101: import("./Action").Action<[], import("../Human").default<number>, void, import("game/entity/action/actions/ToggleHitch").IToggleHitchCanUse, []>;
|
|
152
152
|
112: import("./Action").Action<[[import("game/entity/action/IAction").ActionArgument.ItemInventory, import("game/entity/action/IAction").ActionArgument.Undefined]], import("../Human").default<number>, void, import("game/entity/action/actions/ToggleTilled").ITillCanUse, [(import("../../item/Item").default | undefined)?]>;
|
|
153
153
|
102: import("./Action").Action<[[import("game/entity/action/IAction").ActionArgument.ItemNearby, import("game/entity/action/IAction").ActionArgument.Doodad, import("game/entity/action/IAction").ActionArgument.Undefined]], import("../Human").default<number>, void, import("game/entity/action/actions/ToggleVehicle").ToggleVehicleCanUse, [(import("../../doodad/Doodad").default | import("../../item/Item").default | undefined)?]>;
|
|
154
|
-
73: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.NPCNearby], import("../Human").default<number>, void, import("game/entity/action/
|
|
154
|
+
73: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.NPCNearby], import("../Human").default<number>, void, import("game/entity/action/actions/NPCInteract").INPCInteractUsable, [import("../npc/NPC").default]>;
|
|
155
155
|
35: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.ItemInventory, [import("game/entity/action/IAction").ActionArgument.ItemInventory, import("game/entity/action/IAction").ActionArgument.Undefined]], import("../Human").default<number>, void, import("game/entity/action/actions/Transmogrify").ITransmogrifyCanUse, [import("../../item/Item").default, (import("../../item/Item").default | undefined)?]>;
|
|
156
156
|
124: import("./Action").Action<[import("game/entity/action/IAction").ActionArgument.ItemInventory], import("../Human").default<number>, void, import("game/entity/action/actions/Uncage").IUncageCanUse, [import("../../item/Item").default]>;
|
|
157
157
|
64: import("./Action").Action<[[import("game/entity/action/IAction").ActionArgument.ItemInventory, import("game/entity/action/IAction").ActionArgument.Undefined]], import("../Human").default<number>, void, import("game/entity/action/IAction").IActionUsable, [(import("../../item/Item").default | undefined)?]>;
|
|
@@ -10,5 +10,5 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { Action } from "game/entity/action/Action";
|
|
12
12
|
import { ActionArgument } from "game/entity/action/IAction";
|
|
13
|
-
declare const _default: Action<[ActionArgument.NPCNearby], import("../../Human").default<number>, void, import("game/entity/action/
|
|
13
|
+
declare const _default: Action<[ActionArgument.NPCNearby], import("../../Human").default<number>, void, import("game/entity/action/actions/NPCInteract").INPCInteractUsable, [import("../../npc/NPC").default]>;
|
|
14
14
|
export default _default;
|
|
@@ -26,7 +26,7 @@ import { TileUpdateType } from "game/IGame";
|
|
|
26
26
|
import type { IContainer, ItemType } from "game/item/IItem";
|
|
27
27
|
import type Item from "game/item/Item";
|
|
28
28
|
import type Tile from "game/tile/Tile";
|
|
29
|
-
import
|
|
29
|
+
import type TranslationImpl from "language/impl/TranslationImpl";
|
|
30
30
|
import Translation from "language/Translation";
|
|
31
31
|
export interface INPCEvents extends Events<Human> {
|
|
32
32
|
/**
|
|
@@ -116,7 +116,7 @@ export default abstract class NPC extends Human<NPCType> {
|
|
|
116
116
|
/**
|
|
117
117
|
* @param timeSinceLastChat The time it's been since the human last chatted with this NPC, or false if it's the first time.
|
|
118
118
|
*/
|
|
119
|
-
getGreeting(human: Human, timeSinceLastChat: number | false):
|
|
119
|
+
getGreeting(human: Human, timeSinceLastChat: number | false): TranslationImpl | undefined;
|
|
120
120
|
getDefaultInteraction(): number | undefined;
|
|
121
121
|
isAlreadyInteracting(human: Human, interactType?: number): boolean;
|
|
122
122
|
canInteract(human: Human, interactType?: number): IActionUsable | IActionNotUsable;
|
|
@@ -134,7 +134,7 @@ export default abstract class NPC extends Human<NPCType> {
|
|
|
134
134
|
* Sets the default weightCapacity of an NPC (based on their equipment and starting items).
|
|
135
135
|
*/
|
|
136
136
|
generateWeightCapacity(): void;
|
|
137
|
-
getName(asKnownBy?: Human):
|
|
137
|
+
getName(asKnownBy?: Human): TranslationImpl;
|
|
138
138
|
/**
|
|
139
139
|
* The name of the npc - called when created
|
|
140
140
|
*/
|
|
@@ -18,7 +18,7 @@ import NPC from "game/entity/npc/NPC";
|
|
|
18
18
|
import type { IContainer } from "game/item/IItem";
|
|
19
19
|
import { ItemType } from "game/item/IItem";
|
|
20
20
|
import type Item from "game/item/Item";
|
|
21
|
-
import
|
|
21
|
+
import type TranslationImpl from "language/impl/TranslationImpl";
|
|
22
22
|
export interface IMerchantBuyPrice {
|
|
23
23
|
base: number;
|
|
24
24
|
bonus: number;
|
|
@@ -40,7 +40,7 @@ export default class MerchantNPC extends NPC {
|
|
|
40
40
|
getPublicContainer(): IContainer | undefined;
|
|
41
41
|
getSellPrice(human: Human, item: Item): number | undefined;
|
|
42
42
|
getBuyPrice(human: Human, item: Item): IMerchantBuyPrice | undefined;
|
|
43
|
-
getGreeting(human: Human, timeSinceLastChat: number | false):
|
|
43
|
+
getGreeting(human: Human, timeSinceLastChat: number | false): TranslationImpl | undefined;
|
|
44
44
|
canInteract(human: Human): IActionUsable | IActionNotUsable;
|
|
45
45
|
interact(action: IActionHandlerApi<Human>, interactType?: number | undefined): void;
|
|
46
46
|
/**
|
|
@@ -48,7 +48,7 @@ export default class MerchantNPC extends NPC {
|
|
|
48
48
|
*/
|
|
49
49
|
closeContainerDialogs(): void;
|
|
50
50
|
protected getReputationChangeOnDeath(): number;
|
|
51
|
-
protected getDefaultName():
|
|
51
|
+
protected getDefaultName(): TranslationImpl;
|
|
52
52
|
protected initializeStats(): void;
|
|
53
53
|
protected getDefaultEquipment(equipType: EquipType): Item | ItemType | undefined;
|
|
54
54
|
protected getDefaultInventory(): Array<Item | ItemType>;
|
|
@@ -21,7 +21,7 @@ import type { IContainer } from "game/item/IItem";
|
|
|
21
21
|
import { ItemType } from "game/item/IItem";
|
|
22
22
|
import type Item from "game/item/Item";
|
|
23
23
|
import type Tile from "game/tile/Tile";
|
|
24
|
-
import
|
|
24
|
+
import type TranslationImpl from "language/impl/TranslationImpl";
|
|
25
25
|
import type { IVector2 } from "utilities/math/IVector";
|
|
26
26
|
interface IShipTarget {
|
|
27
27
|
islandId: IslandId;
|
|
@@ -33,7 +33,7 @@ export default class ShipperNPC extends NPC {
|
|
|
33
33
|
constructor(options?: INPCConstructorOptions);
|
|
34
34
|
spawn(): void;
|
|
35
35
|
getActions(): ActionType[] | undefined;
|
|
36
|
-
getGreeting(human: Human, timeSinceLastChat: number | false):
|
|
36
|
+
getGreeting(human: Human, timeSinceLastChat: number | false): TranslationImpl | undefined;
|
|
37
37
|
getDefaultInteraction(): number | undefined;
|
|
38
38
|
canInteract(human: Human, interactType: number): IActionUsable | IActionNotUsable;
|
|
39
39
|
interact(action: IActionHandlerApi<Human>, interactType: ShipperNPCInteractType): void;
|
|
@@ -44,7 +44,7 @@ export default class ShipperNPC extends NPC {
|
|
|
44
44
|
canSailTo(x: number, y: number): boolean;
|
|
45
45
|
getPublicContainer(): IContainer | undefined;
|
|
46
46
|
protected getReputationChangeOnDeath(): number;
|
|
47
|
-
protected getDefaultName():
|
|
47
|
+
protected getDefaultName(): TranslationImpl;
|
|
48
48
|
protected initializeStats(): void;
|
|
49
49
|
protected getDefaultEquipment(equipType: EquipType): Item | ItemType | undefined;
|
|
50
50
|
protected getDefaultInventory(): Array<Item | ItemType>;
|
|
@@ -61,5 +61,6 @@ export default class ShipperNPC extends NPC {
|
|
|
61
61
|
canMoveToTile(moveType: MoveType, tile: Tile, ignoreHuman?: Human): -1 | 0 | -2 | -3 | -4 | -5 | -6;
|
|
62
62
|
shipToPort(island: Island, port: IIslandPort, pathToEdge: IVector2[]): void;
|
|
63
63
|
private moveToPort;
|
|
64
|
+
private canSeePort;
|
|
64
65
|
}
|
|
65
66
|
export {};
|
|
@@ -163,7 +163,7 @@ export declare class SimpleInfoProvider extends InfoProvider {
|
|
|
163
163
|
private childComponentClass;
|
|
164
164
|
private validWhen?;
|
|
165
165
|
constructor(...translations: Array<TranslationGenerator | InfoProvider>);
|
|
166
|
-
get(): (import("../../language/
|
|
166
|
+
get(): (import("../../language/impl/TranslationImpl").default | import("../../language/ITranslation").ISerializedTranslation | import("../../language/dictionary/UiTranslation").default | (() => import("../../language/impl/TranslationImpl").default | import("../../language/ITranslation").ISerializedTranslation | import("../../utilities/string/Interpolator").IStringSection[] | import("../../language/dictionary/UiTranslation").default | undefined) | InfoProvider)[];
|
|
167
167
|
add(...translations: Array<TranslationGenerator | InfoProvider | Falsy>): this;
|
|
168
168
|
onlyIfHasContents(): this | undefined;
|
|
169
169
|
addInfoGetter(provider: () => InfoProvider | undefined): this;
|
|
@@ -47,13 +47,12 @@ export default class ItemUses extends Uses<Item> {
|
|
|
47
47
|
} & {
|
|
48
48
|
getDoodadSkill: () => import("../LabelledValue").default[];
|
|
49
49
|
}, Item> | import("../UseInfo").default<{
|
|
50
|
-
onConsume:
|
|
50
|
+
onConsume: [import("../../../entity/IStats").Stat, number][];
|
|
51
51
|
skill: import("../../../entity/IHuman").SkillType | undefined;
|
|
52
52
|
itemQuality: import("../../../IObject").Quality | undefined;
|
|
53
53
|
qualityBonus: number;
|
|
54
54
|
skillBonus: number;
|
|
55
55
|
magicalBonus: number;
|
|
56
|
-
stats: import("../../../entity/IStats").Stat[];
|
|
57
56
|
entityType: EntityType.Item;
|
|
58
57
|
value?: Item | undefined;
|
|
59
58
|
type: ItemType;
|
|
@@ -9,22 +9,21 @@
|
|
|
9
9
|
* https://github.com/WaywardGame/types/wiki
|
|
10
10
|
*/
|
|
11
11
|
import { ActionType } from "game/entity/action/IAction";
|
|
12
|
-
import { Stat } from "game/entity/IStats";
|
|
12
|
+
import type { Stat } from "game/entity/IStats";
|
|
13
13
|
import UseInfo from "game/inspection/infoProviders/UseInfo";
|
|
14
14
|
import type Item from "game/item/Item";
|
|
15
15
|
import type Tooltip from "ui/tooltip/Tooltip";
|
|
16
16
|
declare const _default: UseInfo<{
|
|
17
|
-
onConsume: number
|
|
17
|
+
onConsume: [Stat, number][];
|
|
18
18
|
skill: import("../../../../entity/IHuman").SkillType | undefined;
|
|
19
19
|
itemQuality: import("../../../../IObject").Quality | undefined;
|
|
20
20
|
qualityBonus: number;
|
|
21
21
|
skillBonus: number;
|
|
22
22
|
magicalBonus: number;
|
|
23
|
-
stats: Stat[];
|
|
24
23
|
entityType: import("../../../../entity/IEntity").EntityType.Item;
|
|
25
24
|
value?: Item | undefined;
|
|
26
|
-
type: import("
|
|
27
|
-
description: import("
|
|
25
|
+
type: import("game/item/IItem").ItemType;
|
|
26
|
+
description: import("game/item/IItem").IItemDescription;
|
|
28
27
|
quality: import("../../../../IObject").Quality;
|
|
29
28
|
action: ActionType.Eat | ActionType.DrinkItem | ActionType.Heal | ActionType.Cure | ActionType.HealOther;
|
|
30
29
|
union: import("game/inspection/infoProviders/UseInfo").IUseInfoBase<Item, ActionType.Eat | ActionType.DrinkItem | ActionType.Heal | ActionType.Cure | ActionType.HealOther>;
|
|
@@ -17,7 +17,7 @@ import type Creature from "game/entity/creature/Creature";
|
|
|
17
17
|
import type { CreatureType, TileGroup } from "game/entity/creature/ICreature";
|
|
18
18
|
import type { DamageType, Defense, MoveType, StatusType } from "game/entity/IEntity";
|
|
19
19
|
import type { Delay, EquipType, SkillType } from "game/entity/IHuman";
|
|
20
|
-
import
|
|
20
|
+
import { Stat } from "game/entity/IStats";
|
|
21
21
|
import type { IDecayTemperatureRange } from "game/IGame";
|
|
22
22
|
import type { IObjectDescription, Quality } from "game/IObject";
|
|
23
23
|
import type { IslandId } from "game/island/IIsland";
|
|
@@ -302,18 +302,24 @@ export interface IItemDescription extends IObjectDescription, IModdable, ITemper
|
|
|
302
302
|
onCreate?(item: Item): void;
|
|
303
303
|
onChangeInto?(item: Item, fromItemType: ItemType): void;
|
|
304
304
|
}
|
|
305
|
-
export
|
|
305
|
+
export interface IConsumeItemStat {
|
|
306
306
|
stat: Stat;
|
|
307
307
|
amount: number;
|
|
308
|
-
}
|
|
308
|
+
}
|
|
309
|
+
export type ConsumeItemStatsTuple = [health: number, stamina: number, hunger: number, thirst: number, otherStats?: IConsumeItemStat[]];
|
|
310
|
+
export type ConsumeItemStats = ConsumeItemStatsTuple | IConsumeItemStat[];
|
|
311
|
+
export declare namespace ConsumeItemStats {
|
|
312
|
+
const DEFAULT_STATS: Stat[];
|
|
313
|
+
function resolve(stats?: number | ConsumeItemStats): Map<Stat, number>;
|
|
314
|
+
}
|
|
309
315
|
export interface IItemOnUse {
|
|
310
|
-
[ActionType.Apply]?:
|
|
316
|
+
[ActionType.Apply]?: ConsumeItemStats;
|
|
311
317
|
[ActionType.Build]?: IItemBuild;
|
|
312
318
|
[ActionType.CageCreature]?: ItemType;
|
|
313
|
-
[ActionType.Cure]?:
|
|
314
|
-
[ActionType.DrinkItem]?:
|
|
315
|
-
[ActionType.Eat]?:
|
|
316
|
-
[ActionType.Heal]?:
|
|
319
|
+
[ActionType.Cure]?: ConsumeItemStats;
|
|
320
|
+
[ActionType.DrinkItem]?: ConsumeItemStats;
|
|
321
|
+
[ActionType.Eat]?: ConsumeItemStats;
|
|
322
|
+
[ActionType.Heal]?: ConsumeItemStats;
|
|
317
323
|
[ActionType.HealOther]?: number;
|
|
318
324
|
[ActionType.PlaceDown]?: IItemBuild;
|
|
319
325
|
[ActionType.Plant]?: DoodadType;
|
|
@@ -153,7 +153,7 @@ declare module Translation {
|
|
|
153
153
|
translation?(translation: TranslationImpl | ISerializedTranslation): any;
|
|
154
154
|
argument?(argument: TranslationArg): TranslationArg;
|
|
155
155
|
}
|
|
156
|
-
function upgrade(translation: ISerializedTranslation, id: `${keyof typeof Dictionary}:${string}`, dictionary: Dictionary, entry: number, upgrader?: ITranslationUpgrader):
|
|
156
|
+
function upgrade(translation: ISerializedTranslation, id: `${keyof typeof Dictionary}:${string}`, dictionary: Dictionary, entry: number, upgrader?: ITranslationUpgrader): TranslationImpl | ISerializedTranslation;
|
|
157
157
|
function upgradeTranslationArgument(argument: TranslationArg, id: string, dictionary: Dictionary, entry: number, upgrader?: ITranslationUpgrader): TranslationArg;
|
|
158
158
|
}
|
|
159
159
|
export default Translation;
|
|
@@ -12,8 +12,9 @@ import { LobbyType } from "@hosts/shared/interfaces";
|
|
|
12
12
|
import type { ICharacter } from "game/entity/IHuman";
|
|
13
13
|
import type { PlayerState } from "game/entity/player/IPlayer";
|
|
14
14
|
import type Player from "game/entity/player/Player";
|
|
15
|
-
import type { ISynchronizeState } from "game/IGame";
|
|
15
|
+
import type { ISynchronizeState, PauseSource } from "game/IGame";
|
|
16
16
|
import { TurnMode } from "game/IGame";
|
|
17
|
+
import type { Load } from "game/meta/Loading";
|
|
17
18
|
import type { Milestone } from "game/milestones/IMilestone";
|
|
18
19
|
import type { GameMode, IGameOptions } from "game/options/IGameOptions";
|
|
19
20
|
import type { IMatchmakingInfo } from "multiplayer/matchmaking/IMatchmaking";
|
|
@@ -213,3 +214,15 @@ export interface IJoinServerOptions {
|
|
|
213
214
|
automaticallyRetry: boolean;
|
|
214
215
|
enableSteamNetworkConnections: boolean;
|
|
215
216
|
}
|
|
217
|
+
export interface IMultiplayerRunSafelyOptions {
|
|
218
|
+
isSynced: boolean;
|
|
219
|
+
pauseGame?: PauseSource;
|
|
220
|
+
pauseIncomingPacketProcessing?: boolean;
|
|
221
|
+
showLoadingScreen?: {
|
|
222
|
+
load: Load;
|
|
223
|
+
args?: any[];
|
|
224
|
+
excludeTargets?: PacketTarget;
|
|
225
|
+
disableDelayAfter?: boolean;
|
|
226
|
+
hostInitiatesHide?: boolean;
|
|
227
|
+
};
|
|
228
|
+
}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
import EventEmitter from "event/EventEmitter";
|
|
12
12
|
import Player from "game/entity/player/Player";
|
|
13
13
|
import type Island from "game/island/Island";
|
|
14
|
-
import type { IJoinServerOptions, IMultiplayerEvents, IMultiplayerOptions, PacketTarget, ServerInfo } from "multiplayer/IMultiplayer";
|
|
14
|
+
import type { IJoinServerOptions, IMultiplayerEvents, IMultiplayerOptions, IMultiplayerRunSafelyOptions, PacketTarget, ServerInfo } from "multiplayer/IMultiplayer";
|
|
15
15
|
import { DisconnectReason, JoinServerRetryReason, MultiplayerSyncCheck, MultiplayerSyncCheckLevel, UnableToJoinReason } from "multiplayer/IMultiplayer";
|
|
16
16
|
import type { IMatchmakingInfo } from "multiplayer/matchmaking/IMatchmaking";
|
|
17
17
|
import type { IConnection } from "multiplayer/networking/IConnection";
|
|
@@ -146,10 +146,14 @@ export default class Multiplayer extends EventEmitter.Host<IMultiplayerEvents> {
|
|
|
146
146
|
markCurrentProcessingPacket(packetId: number, processing: boolean): void;
|
|
147
147
|
clearSyncPacketWaiting(packet: IPacket, wait: number): void;
|
|
148
148
|
clearSyncPacketsWaiting(waitId?: string): void;
|
|
149
|
-
pauseIncomingPacketProcessing
|
|
149
|
+
private pauseIncomingPacketProcessing;
|
|
150
|
+
/**
|
|
151
|
+
* Execute an async function while applying some temporary state changes
|
|
152
|
+
*/
|
|
153
|
+
runSafely<T = void>(executor: () => Promise<T>, options: IMultiplayerRunSafelyOptions): Promise<T>;
|
|
150
154
|
updatePlayerId(oldPid: number, newPid: number): void;
|
|
151
155
|
suppressSyncChecks(suppress: boolean): void;
|
|
152
|
-
syncGameState(): void
|
|
156
|
+
syncGameState(): Promise<void>;
|
|
153
157
|
isKeepAliveTimeoutPaused(): boolean;
|
|
154
158
|
pauseKeepAliveTimeouts(): void;
|
|
155
159
|
resumeKeepAliveTimeouts(): void;
|
|
@@ -45,6 +45,7 @@ export default class Steamworks extends EventEmitter.Host<ISteamworksEvents> {
|
|
|
45
45
|
private _serverToJoin;
|
|
46
46
|
private _automaticallyJoinServer;
|
|
47
47
|
private _dedicatedServerInfo;
|
|
48
|
+
private _defaultMatchmakingServerPort;
|
|
48
49
|
private _nextBackupTime;
|
|
49
50
|
private _currentLobbyId;
|
|
50
51
|
private _multiplayerLogs;
|
|
@@ -76,6 +77,7 @@ export default class Steamworks extends EventEmitter.Host<ISteamworksEvents> {
|
|
|
76
77
|
isDedicatedServer(): boolean;
|
|
77
78
|
getDedicatedServerInfo(): IDedicatedServerInfo | undefined;
|
|
78
79
|
getMatchmakingServer(): IMatchmakingServer | undefined;
|
|
80
|
+
getMatchmakingServerPort(): number;
|
|
79
81
|
getSteamNetworking(): ISteamworksNetworking | undefined;
|
|
80
82
|
initialize(): Promise<IWaywardPreload | undefined>;
|
|
81
83
|
enableSafePaths(): void;
|
|
@@ -16,7 +16,7 @@ export default class BookDialog extends Dialog {
|
|
|
16
16
|
private book?;
|
|
17
17
|
private readonly text;
|
|
18
18
|
constructor();
|
|
19
|
-
getName(): import("../../../../../language/
|
|
19
|
+
getName(): import("../../../../../language/impl/TranslationImpl").default | import("../../../../../language/ITranslation").ISerializedTranslation | import("../../../../../language/dictionary/UiTranslation").default | undefined;
|
|
20
20
|
openBook(item: Item): void;
|
|
21
21
|
private getText;
|
|
22
22
|
protected onInventoryItemRemove(_: any, itemOrItems: Item | Item[]): void;
|
|
@@ -8,20 +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
|
-
import type { Load } from "
|
|
12
|
-
import type { Prompt } from "
|
|
13
|
-
import type { ScreenId } from "
|
|
14
|
-
import type { MenuId } from "
|
|
15
|
-
import type { Random } from "
|
|
16
|
-
import type {
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import type {
|
|
11
|
+
import type { Load } from "@wayward/game/game/meta/Loading";
|
|
12
|
+
import type { Prompt } from "@wayward/game/game/meta/prompt/IPrompt";
|
|
13
|
+
import type { ScreenId } from "@wayward/game/ui/screen/IScreen";
|
|
14
|
+
import type { MenuId } from "@wayward/game/ui/screen/screens/menu/component/IMenu";
|
|
15
|
+
import type { Random } from "@wayward/game/utilities/random/Random";
|
|
16
|
+
import type { TestRunContext } from "@wayward/test/testRunner";
|
|
17
|
+
import ApplicationInteractions from "@wayward/test/core/applicationInteractions";
|
|
18
|
+
import type { Apps } from "@wayward/test/core/applicationManager";
|
|
19
|
+
import type { IAppPaths } from "@wayward/test/interfaces";
|
|
20
20
|
export interface IApplicationOptions {
|
|
21
21
|
additionalArgs?: string[];
|
|
22
22
|
mods?: string[];
|
|
23
23
|
nodeJsMode?: boolean;
|
|
24
24
|
random?: Random;
|
|
25
|
+
serverPort?: number;
|
|
25
26
|
}
|
|
26
27
|
export interface ITestState {
|
|
27
28
|
seed: number;
|
|
@@ -38,9 +39,9 @@ export interface IApplicationState {
|
|
|
38
39
|
/**
|
|
39
40
|
* WebDriver client api: http://webdriver.io/api.html
|
|
40
41
|
*/
|
|
41
|
-
export
|
|
42
|
+
export declare class Application extends ApplicationInteractions {
|
|
42
43
|
private readonly paths;
|
|
43
|
-
|
|
44
|
+
readonly options: IApplicationOptions;
|
|
44
45
|
private static readonly browsers;
|
|
45
46
|
static get browserCount(): number;
|
|
46
47
|
static stop(): Promise<void>;
|
|
@@ -64,5 +65,4 @@ export default class Application extends ApplicationInteractions {
|
|
|
64
65
|
requestVideo(videoPath: string): void;
|
|
65
66
|
private recordVideoFrame;
|
|
66
67
|
private configureDirectories;
|
|
67
|
-
private getFreePort;
|
|
68
68
|
}
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
*/
|
|
11
11
|
/// <reference types="webdriverio/async" />
|
|
12
12
|
import type * as webdriverio from "webdriverio";
|
|
13
|
-
import type ApplicationLogger from "
|
|
13
|
+
import type { ApplicationLogger } from "@wayward/test/core/applicationLogger";
|
|
14
14
|
export declare const defaultWaitTimeout: number;
|
|
15
|
-
export
|
|
15
|
+
export declare class ApplicationDom {
|
|
16
16
|
private readonly browser;
|
|
17
17
|
private readonly logger;
|
|
18
18
|
constructor(browser: WebdriverIO.Browser, logger: ApplicationLogger);
|
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
*/
|
|
11
11
|
/// <reference types="webdriverio/async" />
|
|
12
12
|
import type { TestRunContext } from "@wayward/test/testRunner";
|
|
13
|
-
import type { IInit } from "
|
|
14
|
-
import type { Stat } from "
|
|
15
|
-
import type { IslandId } from "
|
|
16
|
-
import { Direction } from "
|
|
17
|
-
import type {
|
|
18
|
-
import
|
|
19
|
-
import ApplicationDom from "
|
|
20
|
-
import
|
|
13
|
+
import type { IInit } from "@wayward/game/Init";
|
|
14
|
+
import type { Stat } from "@wayward/game/game/entity/IStats";
|
|
15
|
+
import type { IslandId } from "@wayward/game/game/island/IIsland";
|
|
16
|
+
import { Direction } from "@wayward/game/utilities/math/Direction";
|
|
17
|
+
import type { Random } from "@wayward/game/utilities/random/Random";
|
|
18
|
+
import { ApplicationLogger } from "@wayward/test/core/applicationLogger";
|
|
19
|
+
import { ApplicationDom } from "@wayward/test/core/applicationDom";
|
|
20
|
+
import type { IWaitUntilGameLoadedOptions, IDedicatedServerGameOptions, INewGameOptions, ITestJoinServerOptions } from "@wayward/test/interfaces";
|
|
21
21
|
export default class ApplicationInteractions {
|
|
22
22
|
protected readonly testContext: TestRunContext;
|
|
23
23
|
readonly appId: string;
|
|
@@ -75,7 +75,7 @@ export default class ApplicationInteractions {
|
|
|
75
75
|
waitForGameEndScreen(isWinner: boolean): Promise<void>;
|
|
76
76
|
returnToTitleScreen(): Promise<void>;
|
|
77
77
|
getServerGameCode(): Promise<string>;
|
|
78
|
-
joinMultiplayerServer(gameCode: string, options:
|
|
78
|
+
joinMultiplayerServer(gameCode: string, options: ITestJoinServerOptions, isDedicatedServer: boolean): Promise<void>;
|
|
79
79
|
pauseGame(): Promise<void>;
|
|
80
80
|
unpauseGame(): Promise<void>;
|
|
81
81
|
moveToIslandId(islandId: IslandId): Promise<void>;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
/// <reference types="node" />
|
|
12
12
|
import { EventEmitter } from "events";
|
|
13
|
-
export
|
|
13
|
+
export declare class ApplicationLogger extends EventEmitter {
|
|
14
14
|
private _logBlockIndentation;
|
|
15
15
|
private readonly _logs;
|
|
16
16
|
getLogs(): string[];
|
|
@@ -8,11 +8,11 @@
|
|
|
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
|
-
import type Player from "
|
|
12
|
-
import { Direction } from "
|
|
13
|
-
import type {
|
|
14
|
-
import type
|
|
15
|
-
import type {
|
|
11
|
+
import type Player from "@wayward/game/game/entity/player/Player";
|
|
12
|
+
import { Direction } from "@wayward/game/utilities/math/Direction";
|
|
13
|
+
import type { ITestState } from "@wayward/test/core/application";
|
|
14
|
+
import type { INewGameOptions, ITestJoinServerOptions } from "@wayward/test/interfaces";
|
|
15
|
+
import type { Application } from "@wayward/test/core/application";
|
|
16
16
|
export declare class Apps {
|
|
17
17
|
private readonly _logs;
|
|
18
18
|
private readonly _applications;
|
|
@@ -49,7 +49,7 @@ export declare class Apps {
|
|
|
49
49
|
get inactiveClients(): Application[];
|
|
50
50
|
reset(): void;
|
|
51
51
|
add(app: Application): Application;
|
|
52
|
-
addServer(app: Application): Application
|
|
52
|
+
addServer(app: Application): Promise<Application>;
|
|
53
53
|
addTARS(app: Application): Application;
|
|
54
54
|
addConnectedClient(app: Application): Application;
|
|
55
55
|
activateTARS(): () => void;
|
|
@@ -63,7 +63,7 @@ export declare class Apps {
|
|
|
63
63
|
createMultiplayerGame(options: Omit<INewGameOptions, "playMode">): Promise<void>;
|
|
64
64
|
setClientJoinIsland(x: number, y: number): Promise<void>;
|
|
65
65
|
getServerGameCode(): Promise<string>;
|
|
66
|
-
joinServer(options:
|
|
66
|
+
joinServer(options: ITestJoinServerOptions, ...apps: Application[]): Promise<void>;
|
|
67
67
|
leaveServer(...apps: Application[]): Promise<void>;
|
|
68
68
|
returnToTitleScreen(): Promise<void>;
|
|
69
69
|
waitUntilLoadingIsFinished(): Promise<void>;
|
|
@@ -80,5 +80,4 @@ export declare class Apps {
|
|
|
80
80
|
private bindApp;
|
|
81
81
|
private log;
|
|
82
82
|
}
|
|
83
|
-
declare const
|
|
84
|
-
export default _default;
|
|
83
|
+
export declare const appsContextKey = "APPS";
|
|
@@ -8,8 +8,8 @@
|
|
|
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
|
-
import type ApplicationLogger from "
|
|
12
|
-
export
|
|
11
|
+
import type { ApplicationLogger } from "@wayward/test/core/applicationLogger";
|
|
12
|
+
export declare class ChromeDriver {
|
|
13
13
|
private readonly safeTestTile;
|
|
14
14
|
private readonly appId;
|
|
15
15
|
private readonly logger;
|
|
@@ -26,7 +26,7 @@ export interface INewGameOptions extends ICommonGameOptions {
|
|
|
26
26
|
reuseCharacter?: boolean;
|
|
27
27
|
}
|
|
28
28
|
export type IDedicatedServerGameOptions = ICommonGameOptions;
|
|
29
|
-
export interface
|
|
29
|
+
export interface ITestJoinServerOptions {
|
|
30
30
|
joinProgrammatically: boolean;
|
|
31
31
|
enableAllMilestoneModifiers?: boolean;
|
|
32
32
|
multiplayerIdentifier?: string;
|
|
@@ -8,6 +8,6 @@
|
|
|
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
|
-
import type {
|
|
12
|
-
import type {
|
|
13
|
-
export default function (paths: IPaths, config:
|
|
11
|
+
import type { TestConfig } from "@wayward/test";
|
|
12
|
+
import type { IPaths } from "@wayward/test/interfaces";
|
|
13
|
+
export default function (paths: IPaths, config: TestConfig): void;
|
|
@@ -8,6 +8,6 @@
|
|
|
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
|
-
import type {
|
|
12
|
-
import type {
|
|
13
|
-
export default function (paths: IPaths, config:
|
|
11
|
+
import type { TestConfig } from "@wayward/test";
|
|
12
|
+
import type { IPaths } from "@wayward/test/interfaces";
|
|
13
|
+
export default function (paths: IPaths, config: TestConfig): void;
|
|
@@ -8,6 +8,6 @@
|
|
|
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
|
-
import type
|
|
12
|
-
import type {
|
|
13
|
-
export default function (paths: IPaths, config:
|
|
11
|
+
import { type IPaths } from "@wayward/test/interfaces";
|
|
12
|
+
import type { TestConfig } from "@wayward/test";
|
|
13
|
+
export default function (paths: IPaths, config: TestConfig): void;
|
|
@@ -8,6 +8,6 @@
|
|
|
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
|
-
import type { IPaths } from "
|
|
12
|
-
import type {
|
|
13
|
-
export default function (paths: IPaths, config:
|
|
11
|
+
import type { IPaths } from "@wayward/test/interfaces";
|
|
12
|
+
import type { TestConfig } from "@wayward/test";
|
|
13
|
+
export default function (paths: IPaths, config: TestConfig): void;
|
|
@@ -8,6 +8,6 @@
|
|
|
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
|
-
import type {
|
|
12
|
-
import type {
|
|
13
|
-
export default function (paths: IPaths, config:
|
|
11
|
+
import type { TestConfig } from "@wayward/test";
|
|
12
|
+
import type { IPaths } from "@wayward/test/interfaces";
|
|
13
|
+
export default function (paths: IPaths, config: TestConfig): void;
|
|
@@ -8,6 +8,6 @@
|
|
|
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
|
-
import type {
|
|
12
|
-
import type {
|
|
13
|
-
export default function (paths: IPaths, config:
|
|
11
|
+
import type { TestConfig } from "@wayward/test";
|
|
12
|
+
import type { IPaths } from "@wayward/test/interfaces";
|
|
13
|
+
export default function (paths: IPaths, config: TestConfig): void;
|
|
@@ -8,6 +8,6 @@
|
|
|
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
|
-
import type {
|
|
12
|
-
import type {
|
|
13
|
-
export default function (paths: IPaths, config:
|
|
11
|
+
import type { TestConfig } from "@wayward/test";
|
|
12
|
+
import type { IPaths } from "@wayward/test/interfaces";
|
|
13
|
+
export default function (paths: IPaths, config: TestConfig): void;
|
|
@@ -31,8 +31,14 @@ export interface ITest {
|
|
|
31
31
|
}
|
|
32
32
|
declare abstract class BaseContext {
|
|
33
33
|
private _timeoutMilliseconds?;
|
|
34
|
+
private _parallel?;
|
|
35
|
+
private _retries?;
|
|
34
36
|
get timeout(): number | undefined;
|
|
35
37
|
set timeout(value: number | undefined);
|
|
38
|
+
get parallel(): number | undefined;
|
|
39
|
+
set parallel(value: number | undefined);
|
|
40
|
+
get retries(): number | undefined;
|
|
41
|
+
set retries(value: number | undefined);
|
|
36
42
|
}
|
|
37
43
|
export declare class TestSetupContext extends BaseContext {
|
|
38
44
|
readonly title: string;
|
|
@@ -105,10 +111,11 @@ export declare class TestSetupContext extends BaseContext {
|
|
|
105
111
|
* Runs tests
|
|
106
112
|
*/
|
|
107
113
|
private runTests;
|
|
114
|
+
private runTest;
|
|
108
115
|
/**
|
|
109
116
|
* Runs a test
|
|
110
117
|
*/
|
|
111
|
-
private
|
|
118
|
+
private executeTest;
|
|
112
119
|
private logNoDepth;
|
|
113
120
|
}
|
|
114
121
|
export declare class TestRunContext extends BaseContext {
|
|
@@ -126,6 +133,7 @@ export declare class TestRunContext extends BaseContext {
|
|
|
126
133
|
private _output;
|
|
127
134
|
private readonly _errors;
|
|
128
135
|
private readonly _attachments;
|
|
136
|
+
private readonly _data;
|
|
129
137
|
private readonly startTime;
|
|
130
138
|
private endTime;
|
|
131
139
|
private duration;
|
|
@@ -187,10 +195,14 @@ export declare class TestRunContext extends BaseContext {
|
|
|
187
195
|
* Adds an attachment to the test result
|
|
188
196
|
*/
|
|
189
197
|
addAttachment(attachmentName: string, attachmentData: ITestAttachmentData): Promise<void>;
|
|
198
|
+
getData<T = unknown>(key: string): T;
|
|
199
|
+
tryGetData<T = unknown>(key: string): T | undefined;
|
|
200
|
+
setData<T = unknown>(key: string, value: T): T;
|
|
201
|
+
start(): void;
|
|
190
202
|
/**
|
|
191
203
|
* Mark the context as being completed (finished running)
|
|
192
204
|
*/
|
|
193
|
-
|
|
205
|
+
end(): void;
|
|
194
206
|
/**
|
|
195
207
|
* https://docs.nunit.org/articles/nunit/technical-notes/usage/Test-Result-XML-Format.html
|
|
196
208
|
*/
|
|
@@ -8,5 +8,5 @@
|
|
|
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
|
-
import type { IDifferences } from "
|
|
11
|
+
import type { IDifferences } from "@wayward/game/utilities/object/JsonHelper";
|
|
12
12
|
export declare function compileDifferences(client: string | number, differences: IDifferences): string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2011-2021 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
|
+
export declare function getFreePort(): Promise<number>;
|
|
@@ -8,6 +8,6 @@
|
|
|
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
|
-
import type { Random } from "
|
|
11
|
+
import type { Random } from "@wayward/game/utilities/random/Random";
|
|
12
12
|
export declare function createRandom(appId: string): Random;
|
|
13
13
|
export declare function getSeed(): number;
|
package/package.json
CHANGED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright 2011-2021 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
|
-
export interface ITooltipOptions {
|
|
12
|
-
selector: string;
|
|
13
|
-
disabled?: boolean;
|
|
14
|
-
trackMouse?: boolean;
|
|
15
|
-
position?: ITooltipPosition;
|
|
16
|
-
content(): string;
|
|
17
|
-
onOpen?(target: JQuery): void;
|
|
18
|
-
onClose?(target: JQuery): void;
|
|
19
|
-
}
|
|
20
|
-
export interface ITooltip extends ITooltipOptions {
|
|
21
|
-
visible?: HTMLElement;
|
|
22
|
-
lastEvent: string;
|
|
23
|
-
element: HTMLElement;
|
|
24
|
-
width: number;
|
|
25
|
-
height: number;
|
|
26
|
-
show(event: MouseEvent | undefined): void;
|
|
27
|
-
updateTooltipPosition(left: number, top: number, mouseX?: number, mouseY?: number): void;
|
|
28
|
-
}
|
|
29
|
-
export interface ITooltipPosition {
|
|
30
|
-
startAtRight?: boolean;
|
|
31
|
-
startAtBottom?: boolean;
|
|
32
|
-
centerX?: boolean;
|
|
33
|
-
centerY?: boolean;
|
|
34
|
-
leftOffset?: number;
|
|
35
|
-
topOffset?: number;
|
|
36
|
-
clampRight?: boolean;
|
|
37
|
-
}
|