-
Notifications
You must be signed in to change notification settings - Fork 0
/
packetDef.d.ts
249 lines (221 loc) · 4.66 KB
/
packetDef.d.ts
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
import BPermission from "./classes/BPermissions";
import { BProperties } from "./classes/BProperties";
import { MinimalBServer } from "./classes/BServer";
import Player from "./classes/Player";
import { userIdNum } from './Server';
// #region client to server
interface setPermission {
userId: userIdNum;
perm: number;
serverId: number;
}
interface serverLoad {
serverId: number;
}
interface getServers {}
interface login {
username: string;
password: string;
}
interface changeProperty {
properties: BProperties;
serverId: number;
description?: string;
}
interface consoleCommand {
command: string;
}
interface createWorld {
name: string;
seed: string;
serverId: number;
levelType: string;
}
interface setOpVal {
permissions: BPermission;
update?: boolean;
serverId: number;
}
interface createServer {
name: string;
description: string;
version: string;
type: 'bdsx' | 'elementzeror' | 'vanilla';
progressBarId: string;
}
// Use changeProperty
// interface selectWorld {
// name: string;
// serverId: number;
// }
// #endregion
// #region server to client
interface localPermUpdate {
serverId: number;
newPermissions: number;
}
interface globalPermUpdate {
newPermissions: number;
}
interface loginResult {
success: boolean;
}
interface loginResultSuccess extends loginResult {
id: userIdNum;
perm: string;
username: string;
globalPermissions: number;
}
interface serverList {
servers: MinimalBServer[];
}
interface changeStatus {
serverId: number;
status: 'Start' | 'Stop';
}
interface copyWorld {
fromServer: number;
fromWorld: string;
toServer: number;
toWorld: string;
}
interface deleteWorld {
serverId: number;
world: string;
}
// interface serverLoadResultBase {
// success: boolean;
// }
// interface serverLoadResultSuccess extends serverLoadResultBase {
// server: BServer;
// }
// interface serverLoadResultError extends serverLoadResultBase {
// reason: string;
// }
// type serverLoadResult = serverLoadResultSuccess | serverLoadResultError;
interface serverCopyResponse {
success: boolean;
reason?: string;
}
// interface scripts {
// uploadedTime?: number | boolean;
// uploadedAuthor?: string;
// repo?: string;
// }
interface uploadGitRepo {
serverId: number;
repo: string;
}
interface installPlugin {
serverId: number;
name: string;
}
interface updatePlugin {
serverId: number;
plugin: string;
}
interface removePlugin {
serverId: number;
plugin: string;
}
interface updateGit {
serverId: number;
plugin: string;
}
interface serverUpdate {
id?: number;
consoleAppend?: string;
properties?: BProperties;
status?: string;
worlds?: any;
currentWorld?: string;
description?: string;
allowedUsers?: userPermissionData[];
controls19132?: boolean;
output?: string;
permissions?: BPermission[];
extraData?: any;
}
interface changeScriptSetting {
serverId: number;
tab: string;
id: string;
value: any;
}
interface progressBar {
id: string;
text: string;
progress: number;
}
interface progressBarFinished {
id: string;
}
interface clobberAll {
server: MinimalBServer;
}
interface fullServerSend {
// Wrong, the user may not have permission for the full server
// server: BServer;
id: number;
// name: string; In properties now
description: string;
status: string;
version: string;
onlinePlayers: Array<Player>;
properties: BProperties;
worlds: any;
whitelist: null;
access: number;
controls19132: boolean;
autostart: boolean;
permissions?: BPermission[];
output?: string;
allowedUsers?: userPermissionData[];
currentWorld: string;
type: 'bdsx' | 'elementzeror' | 'vanilla';
extraData?: any;
}
interface serverDeleted {
serverId: number;
}
interface deleteServer {
serverId: number;
deleteData: boolean;
}
interface refreshDB {}
interface DBRefresh {
success: boolean;
reason?: string;
}
// interface permissionSet {
// id: number;
// perm: number;
// }
// interface permissionSetSuccess extends permissionSet {
// id: number;
// perm: number;
// serverId: number;
// }
// interface permissionSetError extends permissionSet {
// reason: string;
// }
interface debug {
msg: string;
}
// #endregion
interface userPermissionData {
id: userIdNum;
name: string;
perm: string;
access: number;
}
// Not implemented
interface infoWindow {
msg: string;
}
interface uploadScriptZip {
serverId: number;
data: string;
size: number;
}
interface scriptZipUploaded {}