forked from clusterio/gridworld
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.ts
More file actions
150 lines (142 loc) · 4.78 KB
/
index.ts
File metadata and controls
150 lines (142 loc) · 4.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
import * as lib from "@clusterio/lib";
import * as messages from "./messages";
lib.definePermission({
name: "gridworld.view",
title: "View gridworld",
description: "View gridworld tiles and status",
grantByDefault: true,
});
lib.definePermission({
name: "gridworld.manage",
title: "Manage gridworld",
description: "Create or delete gridworld tiles",
});
declare module "@clusterio/lib" {
export interface ControllerConfigFields {
"gridworld.map_exchange_string": string;
"gridworld.tile_size": number;
"gridworld.surface_name": string;
"gridworld.initial_tile_x": number;
"gridworld.initial_tile_y": number;
"gridworld.auto_start_instances": boolean;
"gridworld.save_name_prefix": string;
"gridworld.ticks_per_day": number;
}
export interface InstanceConfigFields {
"gridworld.tile_x": number;
"gridworld.tile_y": number;
"gridworld.tile_size": number;
"gridworld.surface_name": string;
}
}
export const plugin: lib.PluginDeclaration = {
name: "gridworld",
title: "Gridworld",
description: "Creates an infinite tiled world backed by Universal Edges.",
controllerEntrypoint: "./dist/node/controller",
controllerConfigFields: {
"gridworld.map_exchange_string": {
title: "Map Exchange String",
description: "Map exchange string used to generate tiles.",
type: "string",
initialValue: ">>>eNpjYmBg8AFiBh6W5PzEHAaGBnsY5krOLyhILdLNL0pFFuZMLipNSdXNz0RVnJqXmlupm5RYjKKYI7MoPw/dBJ68xNKyzOL45JzMtDRkCdai/OTsYmQRseKSxKKSzLz0+MSi1MT43PzM4pJSVNNYi0vy81BFSopSU1GM4S4tSszLLM1FdwlreWJJahGyCANj2XeTFw0tcgwg/L+eQeH/fxAGsh4AQwmEGRgbIKoZgYIwwAr1DIOCIxA7IYxjZKwWWef+sGqKPSNEpZ4DlPEBKnIgCSbiCWP4OeCUUoExTJDMMQaDz0gMiKUlQCugqjgcEAyIZAtIkpGx9+3WBd+PXbBj/LPy4yXfpAR7RkNXkXcfjNbZASXZQd5lghOzZoLATphXGGBmPrCHSt20Zzx7BgTe2DOygnSIgAgHCyBxwJuZgVGAD8ha0AMkFGQYYE6zgxkj4sCYBgbfYD55DGNctkf3BzAgbECGy4GIEyACbCHcZYwQpkO/A6ODPExWEqEEqN+IAdkNKQgfnoRZexjJfjSHYEYEsj/QRFQcsEQDF8jCFDjxghnuGmB4XmCH8RzmOzAygxggVV+AYhAeSAZmFIQWcAAHNzM8UX6wR01pIAbIkCB3zfkAC3S/Eg==<<<",
},
"gridworld.tile_size": {
title: "Tile Size",
description: "Tile size in map units (tiles).",
type: "number",
initialValue: 1024,
},
"gridworld.surface_name": {
title: "Surface Name",
description: "Surface name to use for edge endpoints.",
type: "string",
initialValue: "nauvis",
},
"gridworld.initial_tile_x": {
title: "Initial Tile X",
description: "X coordinate of the initial tile.",
type: "number",
initialValue: 0,
},
"gridworld.initial_tile_y": {
title: "Initial Tile Y",
description: "Y coordinate of the initial tile.",
type: "number",
initialValue: 0,
},
"gridworld.auto_start_instances": {
title: "Auto Start Instances",
description: "Legacy setting (ignored). Instances now start as players explore.",
type: "boolean",
initialValue: false,
},
"gridworld.save_name_prefix": {
title: "Save Name Prefix",
description: "Prefix to use for tile save names.",
type: "string",
initialValue: "gridworld",
},
"gridworld.ticks_per_day": {
title: "Ticks Per Day",
description: "Length of a full day/night cycle in game ticks. Factorio default is 25000 (~7 min at 60 UPS). Use higher values for longer days.",
type: "number",
initialValue: 25000,
},
},
instanceEntrypoint: "./dist/node/instance",
instanceConfigFields: {
"gridworld.tile_x": {
title: "Tile X",
description: "Tile X coordinate (managed by gridworld).",
type: "number",
initialValue: 0,
},
"gridworld.tile_y": {
title: "Tile Y",
description: "Tile Y coordinate (managed by gridworld).",
type: "number",
initialValue: 0,
},
"gridworld.tile_size": {
title: "Tile Size",
description: "Tile size in map units (managed by gridworld).",
type: "number",
initialValue: 1024,
},
"gridworld.surface_name": {
title: "Surface Name",
description: "Surface name to use for gridworld boundaries (managed by gridworld).",
type: "string",
initialValue: "nauvis",
},
},
messages: [
messages.GridworldStateUpdate,
messages.GridworldStateRequest,
messages.GridworldCreateRequest,
messages.GridworldDeleteRequest,
messages.GridworldSyncTileAreas,
messages.GridworldSyncRailEntities,
messages.GridworldApplyRailEntities,
messages.GridworldRequestTrainPath,
messages.GridworldForwardTrainPath,
messages.GridworldReturnTrainPathResult,
messages.GridworldReturnTrainPath,
messages.GridworldSyncUeStops,
messages.GridworldApplyUeStops,
messages.GridworldSyncDaytime,
messages.GridworldCreateTrainProxy,
messages.GridworldClearTrainPath,
messages.GridworldForwardClearTrainPath,
messages.GridworldRemoveTrainProxy,
messages.GridworldForwardRemoveTrainProxy,
messages.GridworldCornerNeighbors,
messages.GridworldCornerTeleportPlayer,
messages.GridworldDiagonalEntityTransfer,
],
webEntrypoint: "./web",
routes: [
"/gridworld",
],
};