pw-js-api 0.2.2 → 0.2.3-dev.bf21f34
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/examples/index.mjs +118 -0
- package/examples/package.json +19 -0
- package/examples/util.mjs +24 -0
- package/input/world.proto +381 -0
- package/package.json +1 -1
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
// Up to date as of v0.0.5
|
|
2
|
+
// - 2025-01-01 21:37 UTC+0
|
|
3
|
+
|
|
4
|
+
import { PWApiClient } from "pw-js-api";
|
|
5
|
+
import { swapObject } from "./util.mjs";
|
|
6
|
+
|
|
7
|
+
import { setTimeout } from "node:timers/promises";
|
|
8
|
+
|
|
9
|
+
const cli = new PWApiClient("<YOUR EMAIL HERE>", "<YOUR PASSWORD HERE>");
|
|
10
|
+
|
|
11
|
+
const mappings = await cli.getMappings();
|
|
12
|
+
const blockIdToType = swapObject(mappings);
|
|
13
|
+
|
|
14
|
+
// To fetch the token, allowing it to join a world.
|
|
15
|
+
await cli.authenticate();
|
|
16
|
+
|
|
17
|
+
const con = await cli.joinWorld("rfdeeb8d9d94f76", {
|
|
18
|
+
gameSettings: {
|
|
19
|
+
handlePackets: ["PING"]
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Doesn't support filling
|
|
25
|
+
* @param {string} blockId
|
|
26
|
+
* @param {{ x: number, y: number }[]} positions
|
|
27
|
+
* @param {0|1} layer
|
|
28
|
+
* @returns
|
|
29
|
+
*/
|
|
30
|
+
const place = (blockId, positions, layer = 1) => {
|
|
31
|
+
return con.send("worldBlockPlacedPacket", {
|
|
32
|
+
blockId: mappings[blockId], layer,
|
|
33
|
+
positions, isFillOperation: false
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
let botId = 1; let isOwner = false;
|
|
38
|
+
|
|
39
|
+
// You can use setCallBack (which returns itself for chaining)
|
|
40
|
+
con.addCallback("playerInitPacket", (data) => {
|
|
41
|
+
console.log("Connected as " + data.playerProperties?.username);
|
|
42
|
+
|
|
43
|
+
if (data.playerProperties) {
|
|
44
|
+
botId = data.playerProperties.playerId;
|
|
45
|
+
isOwner = data.playerProperties.isWorldOwner;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
con.send("playerInitReceived");
|
|
49
|
+
}).addCallback("playerJoinedPacket", (data) => {
|
|
50
|
+
console.log(data.properties?.username + (data.properties.playerId < botId ? " is here." : " joined the world."));
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
con.addCallback("debug", console.log);
|
|
54
|
+
|
|
55
|
+
const snakeable = ["basic_", "brick_", "beveled_", "glass_", "minerals_"];
|
|
56
|
+
|
|
57
|
+
con.addCallback("worldBlockPlacedPacket", async function (data) {
|
|
58
|
+
if (data.playerId === botId) return;
|
|
59
|
+
|
|
60
|
+
if (isOwner) {
|
|
61
|
+
const blockId = blockIdToType[data.blockId];
|
|
62
|
+
|
|
63
|
+
if (data.isFillOperation) return; // fills have long cooldown.
|
|
64
|
+
|
|
65
|
+
if (snakeable.some(v => blockId === v + "green" || blockId === v + "red")) {
|
|
66
|
+
if (blockId.endsWith("green")) {
|
|
67
|
+
await setTimeout(150).then(() => place(blockId.split("_")[0] + "_red", data.positions, 1));
|
|
68
|
+
}
|
|
69
|
+
await setTimeout(300).then(() => place("empty", data.positions, 1));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
let helpTime = -1;
|
|
75
|
+
|
|
76
|
+
con.addCallback("systemMessagePacket", (data) => {
|
|
77
|
+
// From /help - continuation of .ping
|
|
78
|
+
if (data.message.startsWith("Available commands:")) {
|
|
79
|
+
con.send("playerChatPacket", {
|
|
80
|
+
message: "Pong! Response time: " + (Date.now() - helpTime) + "ms.",
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
// A con accepts multiple callbacks for the same type!
|
|
86
|
+
// If one of the callback returns a "STOP" (similar to your typical event's stop propagation). It can even return a promise resolving to STOP too.
|
|
87
|
+
|
|
88
|
+
// For example:
|
|
89
|
+
// All messages will get logged if and only if the person isn't the bot.
|
|
90
|
+
// This can be tested with the ".say .ping" command where you will notice that the bot's messages does not get logged nor will it be listened to.
|
|
91
|
+
con.addCallback("playerChatPacket", (data) => {
|
|
92
|
+
if (data.playerId === botId) return "STOP";
|
|
93
|
+
|
|
94
|
+
console.log(data.message);
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
con.addCallback("playerChatPacket", (data) => {
|
|
98
|
+
const args = data.message.split(" ");
|
|
99
|
+
|
|
100
|
+
switch (args[0].toLowerCase()) {
|
|
101
|
+
case ".ping":
|
|
102
|
+
helpTime = Date.now();
|
|
103
|
+
con.send("playerChatPacket", {
|
|
104
|
+
message: "/help"
|
|
105
|
+
});
|
|
106
|
+
break;
|
|
107
|
+
case ".disconnect":
|
|
108
|
+
if (args[1] === "-f") con.settings.reconnectable = false;
|
|
109
|
+
|
|
110
|
+
con.socket?.close();
|
|
111
|
+
break;
|
|
112
|
+
case ".say":
|
|
113
|
+
con.send("playerChatPacket", {
|
|
114
|
+
message: args.slice(1).join(" ")
|
|
115
|
+
});
|
|
116
|
+
break;
|
|
117
|
+
}
|
|
118
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pw-snake-js-bot",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "An example bot that does simple snake and ping command",
|
|
5
|
+
"main": "./index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"start": "node ./index.js"
|
|
8
|
+
},
|
|
9
|
+
"keywords": ["PixelWalker", "Example"],
|
|
10
|
+
"author": "Doomester",
|
|
11
|
+
"license": "Unlicense",
|
|
12
|
+
"type": "module",
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"pw-js-api": "^0.0.5"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@types/node": "^22.10.3"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converted from typescript.
|
|
3
|
+
* @template {string} K
|
|
4
|
+
* @template {string|number} [Y=string]
|
|
5
|
+
*
|
|
6
|
+
* @param {Record<K, Y>} obj
|
|
7
|
+
*/
|
|
8
|
+
export function swapObject(obj) {
|
|
9
|
+
/**
|
|
10
|
+
* @type {Record<Y, K>}
|
|
11
|
+
*/
|
|
12
|
+
const res = {};
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @type {[Y, string][]}
|
|
16
|
+
*/
|
|
17
|
+
const entries = Object.entries(obj);
|
|
18
|
+
|
|
19
|
+
for (let i = 0, len = entries.len; i < len; i++) {
|
|
20
|
+
res[entries[i][1]] = entries[i][0];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return res;
|
|
24
|
+
}
|
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
package WorldPackets;
|
|
3
|
+
|
|
4
|
+
option csharp_namespace = "PixelWalker.Networking.Protobuf.WorldPackets";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
message WorldPacket {
|
|
8
|
+
oneof packet {
|
|
9
|
+
/* Ping packet */
|
|
10
|
+
Ping ping = 1;
|
|
11
|
+
|
|
12
|
+
/* On join */
|
|
13
|
+
PlayerInitPacket player_init_packet = 2;
|
|
14
|
+
PlayerInitReceivedPacket player_init_received = 3;
|
|
15
|
+
|
|
16
|
+
/* Player packets - Send/received while playing */
|
|
17
|
+
PlayerJoinedPacket player_joined_packet = 4;
|
|
18
|
+
PlayerLeftPacket player_left_packet = 5;
|
|
19
|
+
PlayerChatPacket player_chat_packet = 6;
|
|
20
|
+
PlayerUpdateRightsPacket player_update_rights_packet = 7;
|
|
21
|
+
PlayerMovedPacket player_moved_packet = 8;
|
|
22
|
+
PlayerFacePacket player_face_packet = 9;
|
|
23
|
+
PlayerGodModePacket player_god_mode_packet = 10;
|
|
24
|
+
PlayerModModePacket player_mod_mode_packet = 11;
|
|
25
|
+
PlayerRespawnPacket player_respawn_packet = 12;
|
|
26
|
+
PlayerResetPacket player_reset_packet = 13;
|
|
27
|
+
PlayerTouchBlockPacket player_touch_block_packet = 14;
|
|
28
|
+
PlayerAddEffectPacket player_add_effect_packet = 15;
|
|
29
|
+
PlayerRemoveEffectPacket player_remove_effect_packet = 16;
|
|
30
|
+
PlayerResetEffectsPacket player_reset_effects_packet = 17;
|
|
31
|
+
PlayerTeamUpdatePacket player_team_update_packet = 18;
|
|
32
|
+
PlayerCountersUpdatePacket player_counters_update_packet = 19;
|
|
33
|
+
PlayerLocalSwitchChangedPacket player_local_switch_changed_packet = 20;
|
|
34
|
+
PlayerLocalSwitchResetPacket player_local_switch_reset_packet = 21;
|
|
35
|
+
PlayerDirectMessagePacket player_direct_message_packet = 22;
|
|
36
|
+
PlayerTouchPlayerPacket player_touch_player_packet = 23;
|
|
37
|
+
PlayerTeleportedPacket player_teleported_packet = 24;
|
|
38
|
+
|
|
39
|
+
/* World packets - Mostly send out by the server */
|
|
40
|
+
WorldReloadedPacket world_reloaded_packet = 25;
|
|
41
|
+
WorldClearedPacket world_cleared_packet = 26;
|
|
42
|
+
WorldMetaUpdatePacket world_meta_update_packet = 27;
|
|
43
|
+
WorldBlockPlacedPacket world_block_placed_packet = 28;
|
|
44
|
+
WorldBlockFilledPacket world_block_filled_packet = 29;
|
|
45
|
+
|
|
46
|
+
/* MISC */
|
|
47
|
+
OldChatMessagesPacket old_chat_messages_packet = 30;
|
|
48
|
+
SystemMessagePacket system_message_packet = 31;
|
|
49
|
+
|
|
50
|
+
GlobalSwitchChangedPacket global_switch_changed_packet = 32;
|
|
51
|
+
GlobalSwitchResetPacket global_switch_reset_packet = 33;
|
|
52
|
+
|
|
53
|
+
PerformWorldActionPacket perform_world_action_packet = 34;
|
|
54
|
+
|
|
55
|
+
PlayerSpectatePacket player_spectate_packet = 35;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
message Ping {
|
|
60
|
+
/* Empty */
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/*
|
|
64
|
+
* Misc PACKETS
|
|
65
|
+
*/
|
|
66
|
+
message GlobalSwitchChangedPacket {
|
|
67
|
+
int32 player_id = 1;
|
|
68
|
+
int32 switch_id = 2;
|
|
69
|
+
bool enabled = 3;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
message GlobalSwitchResetPacket {
|
|
73
|
+
int32 player_id = 1;
|
|
74
|
+
bool enabled = 2;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
message SystemMessagePacket {
|
|
78
|
+
string title = 1;
|
|
79
|
+
string message = 2;
|
|
80
|
+
bool is_dialog = 3;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
message OldChatMessagesPacket {
|
|
84
|
+
repeated OldChatMessage old_chat_messages = 1;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
message PerformWorldActionPacket {
|
|
88
|
+
enum Action {
|
|
89
|
+
SAVE_WORLD = 0;
|
|
90
|
+
RELOAD_WORLD = 1;
|
|
91
|
+
CLEAR_WORLD = 3;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
Action action = 1;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/*
|
|
98
|
+
* World PACKETS
|
|
99
|
+
*/
|
|
100
|
+
message WorldReloadedPacket {
|
|
101
|
+
bytes world_data = 1;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
message WorldClearedPacket {
|
|
105
|
+
/* Empty */
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
message WorldBlockPlacedPacket {
|
|
109
|
+
optional int32 player_id = 1;
|
|
110
|
+
|
|
111
|
+
bool is_fill_operation = 3;
|
|
112
|
+
|
|
113
|
+
// Repeated for use in fill operations
|
|
114
|
+
repeated PointInteger positions = 4;
|
|
115
|
+
int32 layer = 5;
|
|
116
|
+
int32 block_id = 6;
|
|
117
|
+
|
|
118
|
+
// Legacy? Holds a byte[] that can hold extra information
|
|
119
|
+
bytes extra_fields = 7;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
message WorldBlockFilledPacket {
|
|
123
|
+
PointInteger position = 1;
|
|
124
|
+
bool ignoreLayers = 2;
|
|
125
|
+
int32 layer = 3;
|
|
126
|
+
int32 block_id = 4;
|
|
127
|
+
|
|
128
|
+
// Legacy? Holds a byte[] that can hold extra information
|
|
129
|
+
bytes extra_fields = 5;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
message WorldMetaUpdatePacket {
|
|
133
|
+
WorldMeta meta = 1;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
/*
|
|
138
|
+
* PLAYER PACKETS
|
|
139
|
+
*/
|
|
140
|
+
message PlayerInitPacket {
|
|
141
|
+
/* player_id located in PlayerProperties */
|
|
142
|
+
PlayerProperties player_properties = 1;
|
|
143
|
+
WorldMeta world_meta = 2;
|
|
144
|
+
|
|
145
|
+
/* Static world information */
|
|
146
|
+
int32 world_width = 3;
|
|
147
|
+
int32 world_height = 4;
|
|
148
|
+
|
|
149
|
+
/* Very specific world state */
|
|
150
|
+
bytes global_switch_state = 6;
|
|
151
|
+
bytes world_data = 7;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
message PlayerInitReceivedPacket {
|
|
155
|
+
/* Pong back to the server that init has been done. */
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
message PlayerJoinedPacket {
|
|
159
|
+
PlayerProperties properties = 1;
|
|
160
|
+
PlayerWorldState world_state = 2;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
message PlayerLeftPacket {
|
|
164
|
+
/* No content required */
|
|
165
|
+
int32 player_id = 1;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
message PlayerChatPacket {
|
|
169
|
+
int32 player_id = 1;
|
|
170
|
+
string message = 2;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
message PlayerUpdateRightsPacket {
|
|
174
|
+
optional int32 player_id = 1;
|
|
175
|
+
PlayerRights rights = 2;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
message PlayerMovedPacket {
|
|
179
|
+
optional int32 player_id = 1;
|
|
180
|
+
|
|
181
|
+
PointDouble position = 2;
|
|
182
|
+
double velocity_x = 3;
|
|
183
|
+
double velocity_y = 4;
|
|
184
|
+
double modifier_x = 5;
|
|
185
|
+
double modifier_y = 6;
|
|
186
|
+
int32 horizontal = 7;
|
|
187
|
+
int32 vertical = 8;
|
|
188
|
+
|
|
189
|
+
bool space_down = 9;
|
|
190
|
+
bool space_just_down = 10;
|
|
191
|
+
bool just_teleported = 11;
|
|
192
|
+
|
|
193
|
+
int32 tick_id = 12;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
message PlayerTeleportedPacket {
|
|
197
|
+
optional int32 player_id = 1;
|
|
198
|
+
PointDouble position = 2;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
message PlayerFacePacket {
|
|
202
|
+
optional int32 player_id = 1;
|
|
203
|
+
int32 face_id = 2;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
message PlayerSpectatePacket {
|
|
207
|
+
optional int32 player_id = 1;
|
|
208
|
+
int32 spectate_player = 2;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
message PlayerGodModePacket {
|
|
212
|
+
optional int32 player_id = 1;
|
|
213
|
+
bool enabled = 2;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
message PlayerModModePacket {
|
|
217
|
+
optional int32 player_id = 1;
|
|
218
|
+
bool enabled = 3;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
message PlayerRespawnPacket {
|
|
222
|
+
optional int32 player_id = 1;
|
|
223
|
+
PointInteger position = 2;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
message PlayerResetPacket {
|
|
227
|
+
optional int32 player_id = 1;
|
|
228
|
+
optional PointInteger position = 2;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
message PlayerTouchBlockPacket {
|
|
232
|
+
optional int32 player_id = 1;
|
|
233
|
+
optional PointInteger position = 2;
|
|
234
|
+
int32 block_id = 3;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
message PlayerTouchPlayerPacket {
|
|
238
|
+
optional int32 player_id = 1;
|
|
239
|
+
int32 touched_player = 2;
|
|
240
|
+
TouchType touch_type = 3;
|
|
241
|
+
|
|
242
|
+
enum TouchType {
|
|
243
|
+
START = 0;
|
|
244
|
+
END = 1;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
message PlayerAddEffectPacket {
|
|
249
|
+
optional int32 player_id = 1;
|
|
250
|
+
bool from_server = 2;
|
|
251
|
+
|
|
252
|
+
/* Effect data */
|
|
253
|
+
int32 effect_id = 3; // Todo: Make this an enum.
|
|
254
|
+
|
|
255
|
+
optional int32 duration = 4;
|
|
256
|
+
optional int32 strength = 5;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
message PlayerRemoveEffectPacket {
|
|
260
|
+
optional int32 player_id = 1;
|
|
261
|
+
|
|
262
|
+
int32 effect_id = 4; // Todo: Make this an enum.
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
message PlayerResetEffectsPacket {
|
|
266
|
+
optional int32 player_id = 1;
|
|
267
|
+
bool from_server = 2;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
message PlayerTeamUpdatePacket {
|
|
271
|
+
optional int32 player_id = 1;
|
|
272
|
+
int32 team_id = 2;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
message PlayerCountersUpdatePacket {
|
|
276
|
+
optional int32 player_id = 1;
|
|
277
|
+
|
|
278
|
+
int32 coins = 2;
|
|
279
|
+
int32 blue_coins = 3;
|
|
280
|
+
int32 deaths = 4;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
message PlayerLocalSwitchChangedPacket {
|
|
284
|
+
optional int32 player_id = 1;
|
|
285
|
+
int32 switch_id = 2;
|
|
286
|
+
bool switch_enabled = 3;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
message PlayerLocalSwitchResetPacket {
|
|
290
|
+
optional int32 player_id = 1;
|
|
291
|
+
int32 switch_id = 2;
|
|
292
|
+
bool switch_enabled = 3;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
message PlayerDirectMessagePacket {
|
|
296
|
+
int32 from_player_id = 1;
|
|
297
|
+
int32 target_player_id = 2;
|
|
298
|
+
|
|
299
|
+
string message = 3;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/*
|
|
303
|
+
============================================
|
|
304
|
+
PARTS, not messages themselves.
|
|
305
|
+
============================================
|
|
306
|
+
*/
|
|
307
|
+
message PlayerWorldState {
|
|
308
|
+
int32 coins_gold = 1;
|
|
309
|
+
int32 coins_blue = 2;
|
|
310
|
+
int32 deaths = 3;
|
|
311
|
+
repeated PointInteger collected_items = 4;
|
|
312
|
+
bool has_gold_crown = 5;
|
|
313
|
+
bool has_silver_crown = 6;
|
|
314
|
+
bytes switches = 7;
|
|
315
|
+
bool godmode = 8;
|
|
316
|
+
bool modmode = 9;
|
|
317
|
+
int32 team_id = 10;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
message PlayerProperties {
|
|
321
|
+
int32 player_id = 1;
|
|
322
|
+
string account_id = 2;
|
|
323
|
+
string username = 3;
|
|
324
|
+
int32 face = 4;
|
|
325
|
+
string role = 5;
|
|
326
|
+
bool is_friend = 6;
|
|
327
|
+
PointDouble position = 7;
|
|
328
|
+
bool is_world_owner = 8;
|
|
329
|
+
PlayerRights rights = 9;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
message PlayerRights {
|
|
333
|
+
bool can_edit = 1;
|
|
334
|
+
bool can_god = 2;
|
|
335
|
+
bool can_toggle_minimap = 3;
|
|
336
|
+
bool can_change_world_settings = 4;
|
|
337
|
+
|
|
338
|
+
repeated string available_commands = 5;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
message WorldMeta {
|
|
342
|
+
string title = 1;
|
|
343
|
+
int32 plays = 2;
|
|
344
|
+
string owner = 3;
|
|
345
|
+
string description = 4;
|
|
346
|
+
string visibility = 5;
|
|
347
|
+
WorldType world_Type = 6;
|
|
348
|
+
bool has_unsaved_changes = 7;
|
|
349
|
+
int32 max_players = 8;
|
|
350
|
+
string owner_role = 9;
|
|
351
|
+
bool minimap_enabled = 10;
|
|
352
|
+
|
|
353
|
+
enum WorldType {
|
|
354
|
+
Saved = 0;
|
|
355
|
+
Unsaved = 1;
|
|
356
|
+
Legacy = 2;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
message OldChatMessage {
|
|
361
|
+
string player_name = 1;
|
|
362
|
+
string player_role = 2;
|
|
363
|
+
bool is_friend = 3;
|
|
364
|
+
string message = 4;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
/*
|
|
368
|
+
* Represents an integer position.
|
|
369
|
+
*/
|
|
370
|
+
message PointInteger {
|
|
371
|
+
int32 x = 1;
|
|
372
|
+
int32 y = 2;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
/*
|
|
376
|
+
* Represents a double position.
|
|
377
|
+
*/
|
|
378
|
+
message PointDouble {
|
|
379
|
+
double x = 1;
|
|
380
|
+
double y = 2;
|
|
381
|
+
}
|