@dcl/sdk-commands 7.22.6-25007982108.commit-83012ab → 7.22.6-25321038582.commit-63ddb3f
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/dist/commands/code-to-composite/scene-executor.js +0 -1
- package/dist/commands/code-to-composite/scene-executor.js.map +1 -1
- package/dist/commands/deploy/index.d.ts +1 -0
- package/dist/commands/deploy/index.js +93 -8
- package/dist/commands/deploy/index.js.map +1 -1
- package/dist/commands/deploy/utils.d.ts +51 -2
- package/dist/commands/deploy/utils.js +212 -16
- package/dist/commands/deploy/utils.js.map +1 -1
- package/dist/commands/sdk-server-logs/index.d.ts +24 -0
- package/dist/commands/sdk-server-logs/index.js +313 -0
- package/dist/commands/sdk-server-logs/index.js.map +1 -0
- package/dist/commands/start/explorer-alpha.js +4 -0
- package/dist/commands/start/explorer-alpha.js.map +1 -1
- package/dist/commands/start/hammurabi-server.d.ts +19 -0
- package/dist/commands/start/hammurabi-server.js +78 -0
- package/dist/commands/start/hammurabi-server.js.map +1 -0
- package/dist/commands/start/index.d.ts +2 -1
- package/dist/commands/start/index.js +39 -32
- package/dist/commands/start/index.js.map +1 -1
- package/dist/commands/start/server/routes.js +5 -1
- package/dist/commands/start/server/routes.js.map +1 -1
- package/dist/commands/start/server/runtime-env.d.ts +71 -0
- package/dist/commands/start/server/runtime-env.js +226 -0
- package/dist/commands/start/server/runtime-env.js.map +1 -0
- package/dist/commands/start/server/storage-service.d.ts +8 -0
- package/dist/commands/start/server/storage-service.js +156 -0
- package/dist/commands/start/server/storage-service.js.map +1 -0
- package/dist/commands/start/types.d.ts +3 -0
- package/dist/commands/start/utils.d.ts +34 -0
- package/dist/commands/start/utils.js +104 -0
- package/dist/commands/start/utils.js.map +1 -1
- package/dist/commands/storage/env.d.ts +5 -0
- package/dist/commands/storage/env.js +86 -0
- package/dist/commands/storage/env.js.map +1 -0
- package/dist/commands/storage/index.d.ts +26 -0
- package/dist/commands/storage/index.js +142 -0
- package/dist/commands/storage/index.js.map +1 -0
- package/dist/commands/storage/player.d.ts +5 -0
- package/dist/commands/storage/player.js +143 -0
- package/dist/commands/storage/player.js.map +1 -0
- package/dist/commands/storage/scene.d.ts +5 -0
- package/dist/commands/storage/scene.js +105 -0
- package/dist/commands/storage/scene.js.map +1 -0
- package/dist/commands/storage/shared.d.ts +62 -0
- package/dist/commands/storage/shared.js +249 -0
- package/dist/commands/storage/shared.js.map +1 -0
- package/dist/commands/storage/types.d.ts +56 -0
- package/dist/commands/storage/types.js +23 -0
- package/dist/commands/storage/types.js.map +1 -0
- package/dist/components/analytics.d.ts +71 -1
- package/dist/components/analytics.js +3 -2
- package/dist/components/analytics.js.map +1 -1
- package/dist/linker-dapp/routes.d.ts +1 -0
- package/dist/logic/auth-chain-headers.d.ts +11 -0
- package/dist/logic/auth-chain-headers.js +25 -0
- package/dist/logic/auth-chain-headers.js.map +1 -0
- package/dist/logic/bundle.js +59 -19
- package/dist/logic/bundle.js.map +1 -1
- package/dist/logic/composite.d.ts +1 -0
- package/dist/logic/composite.js +13 -1
- package/dist/logic/composite.js.map +1 -1
- package/dist/logic/config.d.ts +1 -0
- package/dist/logic/config.js +7 -0
- package/dist/logic/config.js.map +1 -1
- package/dist/logic/dcl-ignore.js +2 -1
- package/dist/logic/dcl-ignore.js.map +1 -1
- package/dist/logic/error.d.ts +1 -1
- package/dist/logic/error.js.map +1 -1
- package/dist/logic/exec.d.ts +1 -0
- package/dist/logic/exec.js +2 -2
- package/dist/logic/exec.js.map +1 -1
- package/dist/logic/lang.js +1 -0
- package/dist/logic/lang.js.map +1 -1
- package/dist/logic/project-validations.d.ts +13 -0
- package/dist/logic/project-validations.js +29 -2
- package/dist/logic/project-validations.js.map +1 -1
- package/dist/logic/scene-validations.d.ts +8 -1
- package/dist/logic/scene-validations.js.map +1 -1
- package/package.json +7 -7
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.args = void 0;
|
|
7
|
+
exports.help = help;
|
|
8
|
+
exports.main = main;
|
|
9
|
+
const path_1 = require("path");
|
|
10
|
+
const fp_future_1 = __importDefault(require("fp-future"));
|
|
11
|
+
const crypto_1 = require("@dcl/crypto");
|
|
12
|
+
const crypto_2 = require("@dcl/crypto/dist/crypto");
|
|
13
|
+
const eth_connect_1 = require("eth-connect");
|
|
14
|
+
const args_1 = require("../../logic/args");
|
|
15
|
+
const error_1 = require("../../logic/error");
|
|
16
|
+
const beautiful_logs_1 = require("../../logic/beautiful-logs");
|
|
17
|
+
const account_1 = require("../../logic/account");
|
|
18
|
+
const auth_chain_headers_1 = require("../../logic/auth-chain-headers");
|
|
19
|
+
const routes_1 = require("../../linker-dapp/routes");
|
|
20
|
+
const run_dapp_1 = require("../../run-dapp");
|
|
21
|
+
const workspace_validations_1 = require("../../logic/workspace-validations");
|
|
22
|
+
const scene_validations_1 = require("../../logic/scene-validations");
|
|
23
|
+
exports.args = (0, args_1.declareArgs)({
|
|
24
|
+
'--help': Boolean,
|
|
25
|
+
'-h': '--help',
|
|
26
|
+
'--dir': String,
|
|
27
|
+
'--world': String,
|
|
28
|
+
'-w': '--world',
|
|
29
|
+
'--position': String,
|
|
30
|
+
'--target': String,
|
|
31
|
+
'-t': '--target',
|
|
32
|
+
'--port': Number,
|
|
33
|
+
'-p': '--port',
|
|
34
|
+
'--https': Boolean,
|
|
35
|
+
'--no-browser': Boolean,
|
|
36
|
+
'-b': '--no-browser'
|
|
37
|
+
});
|
|
38
|
+
const DEFAULT_SERVER = 'https://multiplayer-server.decentraland.org';
|
|
39
|
+
function help(options) {
|
|
40
|
+
options.components.logger.log(`
|
|
41
|
+
Usage: 'sdk-commands sdk-server-logs [options]'
|
|
42
|
+
Streams real-time logs from the multiplayer server.
|
|
43
|
+
Runs from any directory when --world and/or --position are provided.
|
|
44
|
+
Falls back to scene.json (worldConfiguration.name) when neither is passed.
|
|
45
|
+
|
|
46
|
+
Options:
|
|
47
|
+
-h, --help Displays complete help
|
|
48
|
+
-w, --world [name] World name. When omitted, --position targets Genesis City.
|
|
49
|
+
--position [x,y] Parcel coordinates. Optional for worlds (selects a scene
|
|
50
|
+
in a multi-scene world). Required for Genesis City.
|
|
51
|
+
-t, --target [URL] Target multiplayer server URL (default: ${DEFAULT_SERVER})
|
|
52
|
+
--dir [path] Path to the project directory (used with scene.json fallback)
|
|
53
|
+
-p, --port [port] Select a custom port for the linker dApp
|
|
54
|
+
-b, --no-browser Do not open a new browser window
|
|
55
|
+
--https Use HTTPS for the linker dApp
|
|
56
|
+
|
|
57
|
+
Examples:
|
|
58
|
+
- View logs using the world in the current scene.json:
|
|
59
|
+
$ sdk-commands sdk-server-logs
|
|
60
|
+
|
|
61
|
+
- View logs for a world from any directory:
|
|
62
|
+
$ sdk-commands sdk-server-logs --world myworld.dcl.eth
|
|
63
|
+
|
|
64
|
+
- View logs for a specific scene in a multi-scene world:
|
|
65
|
+
$ sdk-commands sdk-server-logs --world myworld.dcl.eth --position 10,10
|
|
66
|
+
|
|
67
|
+
- View logs for a Genesis City scene (use =value form for negative coords):
|
|
68
|
+
$ sdk-commands sdk-server-logs --position=-125,-96
|
|
69
|
+
|
|
70
|
+
- Connect to a custom server:
|
|
71
|
+
$ sdk-commands sdk-server-logs --world myworld --target https://multiplayer-server.decentraland.zone
|
|
72
|
+
|
|
73
|
+
- Use private key for authentication (no browser):
|
|
74
|
+
$ DCL_PRIVATE_KEY=0x... sdk-commands sdk-server-logs --world myworld
|
|
75
|
+
`);
|
|
76
|
+
}
|
|
77
|
+
function setServerLogsRoutes(router, components, awaitResponse, signCallback) {
|
|
78
|
+
const { logger } = components;
|
|
79
|
+
const resolveLinkerPromise = () => setTimeout(() => awaitResponse.resolve(), 100);
|
|
80
|
+
const rejectLinkerPromise = (e) => setTimeout(() => awaitResponse.reject(e), 100);
|
|
81
|
+
router.post('/api/logs', async (ctx) => {
|
|
82
|
+
const value = (await ctx.request.json());
|
|
83
|
+
if (!value.address || !value.authChain) {
|
|
84
|
+
const errorMessage = `Invalid payload: ${Object.keys(value).join(' - ')}`;
|
|
85
|
+
logger.error(errorMessage);
|
|
86
|
+
resolveLinkerPromise();
|
|
87
|
+
return { status: 400, body: { success: false, error: errorMessage } };
|
|
88
|
+
}
|
|
89
|
+
try {
|
|
90
|
+
await signCallback(value);
|
|
91
|
+
resolveLinkerPromise();
|
|
92
|
+
return { body: { success: true } };
|
|
93
|
+
}
|
|
94
|
+
catch (e) {
|
|
95
|
+
rejectLinkerPromise(e);
|
|
96
|
+
return { status: 400, body: { success: false, error: e.message } };
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
return router;
|
|
100
|
+
}
|
|
101
|
+
async function getAddressAndSignature(components, awaitResponse, payload, displayLabel, targetUrl, linkOptions, signCallback) {
|
|
102
|
+
// If DCL_PRIVATE_KEY is set, sign directly without the linker dapp
|
|
103
|
+
if (process.env.DCL_PRIVATE_KEY) {
|
|
104
|
+
const wallet = (0, account_1.createWallet)(process.env.DCL_PRIVATE_KEY);
|
|
105
|
+
const authChain = crypto_1.Authenticator.createSimpleAuthChain(payload, wallet.address, (0, crypto_2.ethSign)((0, eth_connect_1.hexToBytes)(wallet.privateKey), payload));
|
|
106
|
+
const linkerResponse = { authChain, address: wallet.address };
|
|
107
|
+
await signCallback(linkerResponse);
|
|
108
|
+
awaitResponse.resolve();
|
|
109
|
+
return {};
|
|
110
|
+
}
|
|
111
|
+
// Use linker dapp for signing - pass the payload as the rootCID
|
|
112
|
+
const { router: commonRouter } = (0, routes_1.setRoutes)(components, {
|
|
113
|
+
rootCID: payload,
|
|
114
|
+
baseParcel: '0,0',
|
|
115
|
+
parcels: ['0,0'],
|
|
116
|
+
skipValidations: true,
|
|
117
|
+
debug: !!process.env.DEBUG,
|
|
118
|
+
isWorld: true,
|
|
119
|
+
world: displayLabel,
|
|
120
|
+
targetUrl,
|
|
121
|
+
action: 'view-logs'
|
|
122
|
+
});
|
|
123
|
+
const router = setServerLogsRoutes(commonRouter, components, awaitResponse, signCallback);
|
|
124
|
+
components.logger.info('You need to sign to access server logs');
|
|
125
|
+
const { program } = await (0, run_dapp_1.runDapp)(components, router, { ...linkOptions, uri: `/` });
|
|
126
|
+
return { program };
|
|
127
|
+
}
|
|
128
|
+
async function streamLogs(components, logsUrl, authHeaders) {
|
|
129
|
+
const { logger, fetch: fetchComponent } = components;
|
|
130
|
+
logger.info('\nConnecting to server logs...');
|
|
131
|
+
try {
|
|
132
|
+
const response = await fetchComponent.fetch(logsUrl, {
|
|
133
|
+
method: 'GET',
|
|
134
|
+
headers: {
|
|
135
|
+
...authHeaders,
|
|
136
|
+
Accept: 'text/event-stream'
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
if (!response.ok) {
|
|
140
|
+
const errorText = await response.text();
|
|
141
|
+
throw new Error(`Server returned ${response.status}: ${errorText}`);
|
|
142
|
+
}
|
|
143
|
+
const contentType = response.headers.get('content-type') || '';
|
|
144
|
+
if (!contentType.includes('text/event-stream') && !contentType.includes('application/stream')) {
|
|
145
|
+
throw new Error('Server does not support SSE streaming');
|
|
146
|
+
}
|
|
147
|
+
logger.info('Streaming logs in real-time (press CTRL+C to stop)');
|
|
148
|
+
if (response.body) {
|
|
149
|
+
const decoder = new TextDecoder();
|
|
150
|
+
let buffer = '';
|
|
151
|
+
for await (const chunk of response.body) {
|
|
152
|
+
buffer += decoder.decode(chunk, { stream: true });
|
|
153
|
+
const lines = buffer.split('\n');
|
|
154
|
+
buffer = lines.pop() || '';
|
|
155
|
+
for (const line of lines) {
|
|
156
|
+
if (line.trim()) {
|
|
157
|
+
formatAndPrintLog(logger, line);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
logger.info('\n======================= End Scene Logs =======================');
|
|
163
|
+
}
|
|
164
|
+
catch (e) {
|
|
165
|
+
(0, beautiful_logs_1.printError)(logger, 'Failed to stream logs:', e);
|
|
166
|
+
process.exit(1);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
function formatAndPrintLog(logger, log) {
|
|
170
|
+
// If log is a string, try to parse as JSON
|
|
171
|
+
let logObj = log;
|
|
172
|
+
if (typeof log === 'string') {
|
|
173
|
+
try {
|
|
174
|
+
logObj = JSON.parse(log);
|
|
175
|
+
}
|
|
176
|
+
catch {
|
|
177
|
+
// If not JSON, just print the string
|
|
178
|
+
logger.log(log);
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
// Extract common log fields
|
|
183
|
+
const timestamp = logObj.timestamp || logObj.time || new Date().toISOString();
|
|
184
|
+
const level = (logObj.level || logObj.severity || 'INFO').toUpperCase();
|
|
185
|
+
const message = logObj.message || logObj.msg || JSON.stringify(logObj);
|
|
186
|
+
// Format timestamp
|
|
187
|
+
const date = new Date(timestamp);
|
|
188
|
+
const formattedTime = date.toISOString().replace('T', ' ').substring(0, 19);
|
|
189
|
+
// Format the log message with timestamp
|
|
190
|
+
const formattedMessage = `[${formattedTime}] [${level}] ${message}`;
|
|
191
|
+
// Map log levels to logger methods
|
|
192
|
+
const normalizedLevel = level.toLowerCase();
|
|
193
|
+
switch (normalizedLevel) {
|
|
194
|
+
case 'error':
|
|
195
|
+
logger.error(formattedMessage);
|
|
196
|
+
break;
|
|
197
|
+
case 'warn':
|
|
198
|
+
case 'warning':
|
|
199
|
+
logger.warn(formattedMessage);
|
|
200
|
+
break;
|
|
201
|
+
case 'debug':
|
|
202
|
+
logger.debug(formattedMessage);
|
|
203
|
+
break;
|
|
204
|
+
case 'info':
|
|
205
|
+
case 'trace':
|
|
206
|
+
default:
|
|
207
|
+
logger.info(formattedMessage);
|
|
208
|
+
break;
|
|
209
|
+
}
|
|
210
|
+
// If there are additional fields, print them
|
|
211
|
+
const additionalFields = Object.keys(logObj).filter((key) => !['timestamp', 'time', 'level', 'severity', 'message', 'msg'].includes(key));
|
|
212
|
+
if (additionalFields.length > 0) {
|
|
213
|
+
const additional = {};
|
|
214
|
+
additionalFields.forEach((key) => {
|
|
215
|
+
additional[key] = logObj[key];
|
|
216
|
+
});
|
|
217
|
+
logger.log(` ${JSON.stringify(additional)}`);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
function normalizePosition(raw) {
|
|
221
|
+
const match = raw.trim().match(/^(-?\d+)\s*,\s*(-?\d+)$/);
|
|
222
|
+
if (!match) {
|
|
223
|
+
throw new error_1.CliError('SERVER_LOGS_INVALID_POSITION', `Invalid --position "${raw}"; expected "x,y" with integer coordinates`);
|
|
224
|
+
}
|
|
225
|
+
return `${parseInt(match[1], 10)},${parseInt(match[2], 10)}`;
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Build the HTTP request shape for the multiplayer-server `/logs` endpoint.
|
|
229
|
+
*
|
|
230
|
+
* Every call targets the same `/logs` route; the server picks the scene from
|
|
231
|
+
* the signed metadata:
|
|
232
|
+
* - worlds → `sceneId: "<world>.dcl.eth"` (+ `parcel` for multi-scene worlds)
|
|
233
|
+
* - Genesis → `parcel: "x,y"` only
|
|
234
|
+
*
|
|
235
|
+
* `parcel` and `realmName` are always set. `realmName` defaults to `"main"` for
|
|
236
|
+
* Genesis, matching the convention used by other signed-fetch emitters
|
|
237
|
+
* (hammurabi worker, unity explorer, kernel).
|
|
238
|
+
*/
|
|
239
|
+
function buildLogsRequest(baseURL, world, position) {
|
|
240
|
+
const metadata = JSON.stringify({
|
|
241
|
+
parcel: position ?? '0,0',
|
|
242
|
+
realmName: world ? `${world}.dcl.eth` : 'main',
|
|
243
|
+
...(world && { sceneId: `${world}.dcl.eth` })
|
|
244
|
+
});
|
|
245
|
+
return {
|
|
246
|
+
logsUrl: `${baseURL}/logs`,
|
|
247
|
+
pathname: '/logs',
|
|
248
|
+
metadata
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
async function main(options) {
|
|
252
|
+
const { logger } = options.components;
|
|
253
|
+
const projectRoot = (0, path_1.resolve)(process.cwd(), options.args['--dir'] || '.');
|
|
254
|
+
const positionArg = options.args['--position'];
|
|
255
|
+
const worldArg = options.args['--world'];
|
|
256
|
+
const position = positionArg ? normalizePosition(positionArg) : undefined;
|
|
257
|
+
let world;
|
|
258
|
+
if (worldArg) {
|
|
259
|
+
world = worldArg.replace(/\.dcl\.eth$/i, '');
|
|
260
|
+
}
|
|
261
|
+
else if (!position) {
|
|
262
|
+
// no --world nor --position: fall back to scene.json in the current directory
|
|
263
|
+
await (0, workspace_validations_1.getValidWorkspace)(options.components, projectRoot);
|
|
264
|
+
const sceneJson = await (0, scene_validations_1.getValidSceneJson)(options.components, projectRoot);
|
|
265
|
+
const worldName = sceneJson.worldConfiguration?.name;
|
|
266
|
+
if (!worldName) {
|
|
267
|
+
throw new error_1.CliError('SERVER_LOGS_MISSING_WORLD', 'Provide --world (with optional --position) for worlds, or --position alone for Genesis City scenes. ' +
|
|
268
|
+
'Alternatively, run from a project whose scene.json defines worldConfiguration.name.');
|
|
269
|
+
}
|
|
270
|
+
world = worldName.replace(/\.dcl\.eth$/i, '');
|
|
271
|
+
}
|
|
272
|
+
const displayLabel = world
|
|
273
|
+
? position
|
|
274
|
+
? `${world}.dcl.eth ${position}`
|
|
275
|
+
: `${world}.dcl.eth`
|
|
276
|
+
: `Genesis City ${position}`;
|
|
277
|
+
logger.info(`Viewing logs for ${displayLabel}`);
|
|
278
|
+
const baseURL = options.args['--target'] || DEFAULT_SERVER;
|
|
279
|
+
const { logsUrl, pathname, metadata } = buildLogsRequest(baseURL, world, position);
|
|
280
|
+
// Linker dApp options
|
|
281
|
+
const linkerPort = options.args['--port'];
|
|
282
|
+
const openBrowser = !options.args['--no-browser'];
|
|
283
|
+
const isHttps = !!options.args['--https'];
|
|
284
|
+
const linkOptions = { linkerPort, openBrowser, isHttps };
|
|
285
|
+
const awaitResponse = (0, fp_future_1.default)();
|
|
286
|
+
const timestamp = String(Date.now());
|
|
287
|
+
// Build the payload to sign: method:path:timestamp:metadata
|
|
288
|
+
const payload = ['get', pathname, timestamp, metadata].join(':').toLowerCase();
|
|
289
|
+
let authHeaders = {};
|
|
290
|
+
const { program } = await getAddressAndSignature(options.components, awaitResponse, payload, displayLabel, baseURL, linkOptions, async (linkerResponse) => {
|
|
291
|
+
authHeaders = (0, auth_chain_headers_1.createAuthChainHeaders)(linkerResponse.authChain, timestamp, metadata);
|
|
292
|
+
});
|
|
293
|
+
try {
|
|
294
|
+
await awaitResponse;
|
|
295
|
+
logger.info('Authentication successful!');
|
|
296
|
+
// Close the browser window
|
|
297
|
+
if (program) {
|
|
298
|
+
await program.stop();
|
|
299
|
+
}
|
|
300
|
+
// Start streaming logs
|
|
301
|
+
await streamLogs(options.components, logsUrl, authHeaders);
|
|
302
|
+
}
|
|
303
|
+
catch (e) {
|
|
304
|
+
(0, beautiful_logs_1.printError)(logger, 'Failed to authenticate:', e);
|
|
305
|
+
throw e;
|
|
306
|
+
}
|
|
307
|
+
finally {
|
|
308
|
+
if (program) {
|
|
309
|
+
void program.stop();
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/sdk-server-logs/index.ts"],"names":[],"mappings":";;;;;;AA2CA,oBAqCC;AA2OD,oBAmFC;AA9YD,+BAA8B;AAE9B,0DAA2C;AAC3C,wCAA2C;AAC3C,oDAAiD;AACjD,6CAAwC;AAIxC,2CAA8C;AAE9C,6CAA4C;AAC5C,+DAAuD;AACvD,iDAAkD;AAClD,uEAAuE;AACvE,qDAAoE;AACpE,6CAAqD;AACrD,6EAAqE;AACrE,qEAAiE;AAOpD,QAAA,IAAI,GAAG,IAAA,kBAAW,EAAC;IAC9B,QAAQ,EAAE,OAAO;IACjB,IAAI,EAAE,Q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
17
17
|
const skipAuthScreen = !!args['--skip-auth-screen'];
|
|
18
18
|
const landscapeTerrainEnabled = !!args['--landscape-terrain-enabled'];
|
|
19
19
|
const openDeeplinkInNewInstance = !!args['-n'];
|
|
20
|
+
const multiInstance = !!args['--multi-instance'];
|
|
20
21
|
try {
|
|
21
22
|
if (isWindows) {
|
|
22
23
|
// On Windows, pre-check if the protocol handler is registered as `start` will silently fail otherwise.
|
|
@@ -40,6 +41,9 @@ async function runApp(components, { cwd, realm: realmValue, baseCoords, isHub, a
|
|
|
40
41
|
if (openDeeplinkInNewInstance) {
|
|
41
42
|
params.set('open-deeplink-in-new-instance', 'true');
|
|
42
43
|
}
|
|
44
|
+
if (multiInstance) {
|
|
45
|
+
params.set('multi-instance', 'true');
|
|
46
|
+
}
|
|
43
47
|
const queryParams = params.toString();
|
|
44
48
|
const app = `decentraland://"${queryParams}"`;
|
|
45
49
|
await components.spawner.exec(cwd, cmd, [app], { silent: true });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"explorer-alpha.js","sourceRoot":"","sources":["../../../src/commands/start/explorer-alpha.ts"],"names":[],"mappings":";;AAMA,4CAiBC;AAnBD,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;AAExC,KAAK,UAAU,gBAAgB,CACpC,UAAyB,EACzB,IAMC;IAED,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,IAAI,CAAA;IAE9C,IAAI,MAAM,MAAM,CAAC,UAAU,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC;QACjF,OAAM;IACR,CAAC;IAED,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,wFAAwF,CAAC,CAAA;AACjH,CAAC;AAED,KAAK,UAAU,MAAM,CACnB,UAAyB,EACzB,EACE,G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,KAAK,EAAE,CAAC;YACV,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;QAC3B,CAAC;QACD,IAAI,cAAc,EAAE,CAAC;YACnB,MAAM,CAAC,GAAG,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAA;QACxC,CAAC;QACD,IAAI,uBAAuB,EAAE,CAAC;YAC5B,MAAM,CAAC,GAAG,CAAC,2BAA2B,EAAE,MAAM,CAAC,CAAA;QACjD,CAAC;QACD,IAAI,yBAAyB,EAAE,CAAC;YAC9B,MAAM,CAAC,GAAG,CAAC,+BAA+B,EAAE,MAAM,CAAC,CAAA;QACrD,CAAC;QACD,IAAI,aAAa,EAAE,CAAC;YAClB,MAAM,CAAC,GAAG,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAA;QACtC,CAAC;QAED,MAAM,WAAW,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAA;QAErC,MAAM,GAAG,GAAG,mBAAmB,WAAW,GAAG,CAAA;QAC7C,MAAM,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAA;QAChE,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,kCAAkC,WAAW,IAAI,CAAC,CAAA;QACzE,OAAO,IAAI,CAAA;IACb,CAAC;IAAC,OAAO,CAAM,EAAE,CAAC;QAChB,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,2CAA2C,EAAE,CAAC,CAAC,OAAO,CAAC,CAAA;QAC/E,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ChildProcess } from 'child_process';
|
|
2
|
+
import { CliComponents } from '../../components';
|
|
3
|
+
import { PreviewComponents } from './types';
|
|
4
|
+
import { ProjectUnion } from '../../logic/project-validations';
|
|
5
|
+
/**
|
|
6
|
+
* Starts the Multiplayer Server process using npx to install and run in one step
|
|
7
|
+
*/
|
|
8
|
+
export declare function startHammurabiServer(components: Pick<CliComponents, 'logger'>, workingDir: string, realm: string): ChildProcess;
|
|
9
|
+
/**
|
|
10
|
+
* Spawns the multiplayer server for the project.
|
|
11
|
+
* In the auth-server SDK, all scenes are authoritative multiplayer.
|
|
12
|
+
* Uses npx to handle installation and execution in a single step (works in Electron).
|
|
13
|
+
*
|
|
14
|
+
* @param components - Preview components including logger
|
|
15
|
+
* @param project - The project to start the multiplayer server for
|
|
16
|
+
* @param realm - The realm URL to pass to the hammurabi server
|
|
17
|
+
* @returns The ChildProcess if started, undefined otherwise
|
|
18
|
+
*/
|
|
19
|
+
export declare function spawnAuthServer(components: PreviewComponents, project: ProjectUnion, realm: string): ChildProcess | undefined;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.startHammurabiServer = startHammurabiServer;
|
|
4
|
+
exports.spawnAuthServer = spawnAuthServer;
|
|
5
|
+
const child_process_1 = require("child_process");
|
|
6
|
+
const beautiful_logs_1 = require("../../logic/beautiful-logs");
|
|
7
|
+
const log_1 = require("../../components/log");
|
|
8
|
+
const utils_1 = require("./utils");
|
|
9
|
+
const HAMMURABI_PACKAGE = '@dcl/hammurabi-server';
|
|
10
|
+
const HAMMURABI_VERSION = 'next';
|
|
11
|
+
/**
|
|
12
|
+
* Registers cleanup handlers on the global process object
|
|
13
|
+
* Returns a function to remove the handlers
|
|
14
|
+
*/
|
|
15
|
+
function registerProcessCleanup(cleanup) {
|
|
16
|
+
process.on('SIGTERM', cleanup);
|
|
17
|
+
process.on('SIGINT', cleanup);
|
|
18
|
+
process.on('exit', cleanup);
|
|
19
|
+
return () => {
|
|
20
|
+
process.off('SIGTERM', cleanup);
|
|
21
|
+
process.off('SIGINT', cleanup);
|
|
22
|
+
process.off('exit', cleanup);
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Starts the Multiplayer Server process using npx to install and run in one step
|
|
27
|
+
*/
|
|
28
|
+
function startHammurabiServer(components, workingDir, realm) {
|
|
29
|
+
(0, beautiful_logs_1.printProgressInfo)(components.logger, `Starting ${log_1.colors.bold('Multiplayer Server')} with realm: ${log_1.colors.bold(realm)}`);
|
|
30
|
+
const npxArgs = ['--yes', `${HAMMURABI_PACKAGE}@${HAMMURABI_VERSION}`, `--realm=${realm}`];
|
|
31
|
+
const npxCliJs = (0, utils_1.findNpxCliJs)();
|
|
32
|
+
// In Electron, override npm_config_prefix because npm derives its prefix from process.execPath,
|
|
33
|
+
// which points to the Electron Helper binary. This causes npm to look for a `lib/` directory
|
|
34
|
+
// inside the Helper bundle, which doesn't exist (ENOENT).
|
|
35
|
+
const env = (0, utils_1.isElectronEnvironment)() ? { ...(0, utils_1.getSpawnEnv)(), npm_config_prefix: workingDir } : (0, utils_1.getSpawnEnv)();
|
|
36
|
+
// If npx-cli.js was found, run it directly via process.execPath (node in regular env,
|
|
37
|
+
// Electron Helper with ELECTRON_RUN_AS_NODE=1 in Electron). Otherwise fall back to npx binary.
|
|
38
|
+
const hammurabiProcess = npxCliJs
|
|
39
|
+
? (0, child_process_1.spawn)(process.execPath, [npxCliJs, ...npxArgs], { cwd: workingDir, shell: false, stdio: 'inherit', env })
|
|
40
|
+
: (0, child_process_1.spawn)((0, utils_1.getNpxBin)(), npxArgs, { cwd: workingDir, shell: false, stdio: 'inherit', env });
|
|
41
|
+
hammurabiProcess.on('error', (error) => {
|
|
42
|
+
(0, beautiful_logs_1.printWarning)(components.logger, `Multiplayer Server process error: ${error.message}`);
|
|
43
|
+
});
|
|
44
|
+
// Register cleanup handlers
|
|
45
|
+
const cleanup = () => {
|
|
46
|
+
if (!hammurabiProcess.killed) {
|
|
47
|
+
hammurabiProcess.kill('SIGTERM');
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
const removeCleanup = registerProcessCleanup(cleanup);
|
|
51
|
+
hammurabiProcess.on('close', (code) => {
|
|
52
|
+
removeCleanup();
|
|
53
|
+
if (code !== 0 && code !== null) {
|
|
54
|
+
(0, beautiful_logs_1.printWarning)(components.logger, `Multiplayer Server exited with code ${code}`);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
return hammurabiProcess;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Spawns the multiplayer server for the project.
|
|
61
|
+
* In the auth-server SDK, all scenes are authoritative multiplayer.
|
|
62
|
+
* Uses npx to handle installation and execution in a single step (works in Electron).
|
|
63
|
+
*
|
|
64
|
+
* @param components - Preview components including logger
|
|
65
|
+
* @param project - The project to start the multiplayer server for
|
|
66
|
+
* @param realm - The realm URL to pass to the hammurabi server
|
|
67
|
+
* @returns The ChildProcess if started, undefined otherwise
|
|
68
|
+
*/
|
|
69
|
+
function spawnAuthServer(components, project, realm) {
|
|
70
|
+
try {
|
|
71
|
+
return startHammurabiServer(components, project.workingDirectory, realm);
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
(0, beautiful_logs_1.printWarning)(components.logger, `Failed to start Multiplayer Server: ${error.message}`);
|
|
75
|
+
return undefined;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=hammurabi-server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hammurabi-server.js","sourceRoot":"","sources":["../../../src/commands/start/hammurabi-server.ts"],"names":[],"mappings":";;AA8BA,oDA6CC;AAYD,0CAWC;AAlGD,iDAAmD;AAEnD,+DAA4E;AAC5E,8CAA6C;AAG7C,mCAAqF;AAErF,MAAM,iBAAiB,GAAG,uBAAuB,CAAA;AACjD,MAAM,iBAAiB,GAAG,MAAM,CAAA;AAEhC;;;GAGG;AACH,SAAS,sBAAsB,CAAC,OAAmB;IACjD,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA;IAC9B,OAAO,CAAC,EAAE,CAAC,QAAQ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CAAC;AACH,CAAC"}
|
|
@@ -21,7 +21,6 @@ export declare const args: {
|
|
|
21
21
|
'-w': string;
|
|
22
22
|
'--skip-build': BooleanConstructor;
|
|
23
23
|
'--data-layer': BooleanConstructor;
|
|
24
|
-
'--customEntryPoint': BooleanConstructor;
|
|
25
24
|
'--explorer-alpha': BooleanConstructor;
|
|
26
25
|
'--web-explorer': BooleanConstructor;
|
|
27
26
|
'--hub': BooleanConstructor;
|
|
@@ -36,6 +35,8 @@ export declare const args: {
|
|
|
36
35
|
'--landscape-terrain-enabled': BooleanConstructor;
|
|
37
36
|
'-n': BooleanConstructor;
|
|
38
37
|
'--bevy-web': BooleanConstructor;
|
|
38
|
+
'--multi-instance': BooleanConstructor;
|
|
39
|
+
'--no-client': BooleanConstructor;
|
|
39
40
|
};
|
|
40
41
|
export declare function help(options: Options): Promise<void>;
|
|
41
42
|
export declare function main(options: Options): Promise<void>;
|
|
@@ -66,6 +66,7 @@ const beautiful_logs_1 = require("../../logic/beautiful-logs");
|
|
|
66
66
|
const project_validations_1 = require("../../logic/project-validations");
|
|
67
67
|
const explorer_alpha_1 = require("./explorer-alpha");
|
|
68
68
|
const utils_1 = require("./utils");
|
|
69
|
+
const hammurabi_server_1 = require("./hammurabi-server");
|
|
69
70
|
exports.args = (0, args_1.declareArgs)({
|
|
70
71
|
'--dir': String,
|
|
71
72
|
'--help': Boolean,
|
|
@@ -83,7 +84,6 @@ exports.args = (0, args_1.declareArgs)({
|
|
|
83
84
|
'-w': '--no-watch',
|
|
84
85
|
'--skip-build': Boolean,
|
|
85
86
|
'--data-layer': Boolean,
|
|
86
|
-
'--customEntryPoint': Boolean,
|
|
87
87
|
'--explorer-alpha': Boolean,
|
|
88
88
|
'--web-explorer': Boolean,
|
|
89
89
|
'--hub': Boolean,
|
|
@@ -98,7 +98,9 @@ exports.args = (0, args_1.declareArgs)({
|
|
|
98
98
|
'--skip-auth-screen': Boolean,
|
|
99
99
|
'--landscape-terrain-enabled': Boolean,
|
|
100
100
|
'-n': Boolean,
|
|
101
|
-
'--bevy-web': Boolean
|
|
101
|
+
'--bevy-web': Boolean,
|
|
102
|
+
'--multi-instance': Boolean,
|
|
103
|
+
'--no-client': Boolean
|
|
102
104
|
});
|
|
103
105
|
async function help(options) {
|
|
104
106
|
options.components.logger.log(`
|
|
@@ -123,8 +125,9 @@ async function help(options) {
|
|
|
123
125
|
--skip-auth-screen Skip the auth screen (accepts 'true' or 'false').
|
|
124
126
|
--landscape-terrain-enabled Enable landscape terrain.
|
|
125
127
|
-n Open a new instance of the Client even if one is already running.
|
|
126
|
-
--bevy-web Opens preview using the Bevy Web browser window
|
|
127
|
-
--mobile
|
|
128
|
+
--bevy-web Opens preview using the Bevy Web browser window.
|
|
129
|
+
--mobile Show QR code for mobile preview on the same network.
|
|
130
|
+
--multi-instance Allow running multiple Explorer instances simultaneously.
|
|
128
131
|
|
|
129
132
|
|
|
130
133
|
Examples:
|
|
@@ -149,10 +152,10 @@ async function main(options) {
|
|
|
149
152
|
const withDataLayer = options.args['--data-layer'];
|
|
150
153
|
const enableWeb3 = options.args['--web3'];
|
|
151
154
|
const isHub = !!options.args['--hub'];
|
|
152
|
-
|
|
153
|
-
const bevyWeb =
|
|
154
|
-
const isMobile =
|
|
155
|
-
const explorerAlpha = !options.args['--web-explorer'] && !bevyWeb;
|
|
155
|
+
const skipClient = !!options.args['--no-client'];
|
|
156
|
+
const bevyWeb = !!options.args['--bevy-web'] && !skipClient;
|
|
157
|
+
const isMobile = options.args['--mobile'] && !skipClient;
|
|
158
|
+
const explorerAlpha = !options.args['--web-explorer'] && !bevyWeb && !skipClient;
|
|
156
159
|
let hasSmartWearable = false;
|
|
157
160
|
const workspace = await (0, workspace_validations_1.getValidWorkspace)(options.components, workingDirectory);
|
|
158
161
|
/* istanbul ignore if */
|
|
@@ -166,15 +169,7 @@ async function main(options) {
|
|
|
166
169
|
// first run `npm run build`, this can be disabled with --skip-build
|
|
167
170
|
// then start the embedded compiler, this can be disabled with --no-watch
|
|
168
171
|
if (watch || build) {
|
|
169
|
-
await (0, build_1.buildScene)({
|
|
170
|
-
...options,
|
|
171
|
-
args: {
|
|
172
|
-
'--dir': project.workingDirectory,
|
|
173
|
-
'--watch': watch,
|
|
174
|
-
_: [],
|
|
175
|
-
'--customEntryPoint': !!options.args['--customEntryPoint']
|
|
176
|
-
}
|
|
177
|
-
}, project);
|
|
172
|
+
await (0, build_1.buildScene)({ ...options, args: { '--dir': project.workingDirectory, '--watch': watch, _: [] } }, project);
|
|
178
173
|
await (0, project_validations_1.startValidations)(options.components, project.workingDirectory);
|
|
179
174
|
}
|
|
180
175
|
// track the event
|
|
@@ -237,6 +232,22 @@ async function main(options) {
|
|
|
237
232
|
}
|
|
238
233
|
}
|
|
239
234
|
await startComponents();
|
|
235
|
+
// Start Hammurabi server if needed (stored outside components to avoid lifecycle management)
|
|
236
|
+
let hammurabiServer;
|
|
237
|
+
const project = workspace.projects[0];
|
|
238
|
+
if (project) {
|
|
239
|
+
const realm = `http://localhost:${port}`;
|
|
240
|
+
hammurabiServer = (0, hammurabi_server_1.spawnAuthServer)(components, project, realm);
|
|
241
|
+
// Register cleanup handler for hammurabi server
|
|
242
|
+
if (hammurabiServer) {
|
|
243
|
+
const cleanup = () => {
|
|
244
|
+
if (hammurabiServer && !hammurabiServer.killed) {
|
|
245
|
+
hammurabiServer.kill('SIGTERM');
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
components.signaler.programClosed.then(cleanup).catch(() => { });
|
|
249
|
+
}
|
|
250
|
+
}
|
|
240
251
|
const networkInterfaces = os.networkInterfaces();
|
|
241
252
|
const availableURLs = [];
|
|
242
253
|
(0, beautiful_logs_1.printProgressInfo)(options.components.logger, 'Preview server is now running!');
|
|
@@ -248,15 +259,14 @@ async function main(options) {
|
|
|
248
259
|
(networkInterfaces[dev] || []).forEach((details) => {
|
|
249
260
|
if (details.family === 'IPv4') {
|
|
250
261
|
const oldBackpack = 'DISABLE_backpack_editor_v2=&ENABLE_backpack_editor_v1';
|
|
251
|
-
|
|
252
|
-
let url = `${baseUrl}?position=${baseCoords.x}%2C${baseCoords.y}&${oldBackpack}`;
|
|
262
|
+
let addr = `http://${details.address}:${port}?position=${baseCoords.x}%2C${baseCoords.y}&${oldBackpack}`;
|
|
253
263
|
if (debug) {
|
|
254
|
-
|
|
264
|
+
addr = `${addr}&SCENE_DEBUG_PANEL`;
|
|
255
265
|
}
|
|
256
266
|
if (enableWeb3 || hasSmartWearable) {
|
|
257
|
-
|
|
267
|
+
addr = `${addr}&ENABLE_WEB3`;
|
|
258
268
|
}
|
|
259
|
-
availableURLs.push(
|
|
269
|
+
availableURLs.push(addr);
|
|
260
270
|
}
|
|
261
271
|
});
|
|
262
272
|
});
|
|
@@ -264,29 +274,26 @@ async function main(options) {
|
|
|
264
274
|
const lanUrl = (0, utils_1.getLanUrl)(port);
|
|
265
275
|
// Push localhost and 127.0.0.1 at top
|
|
266
276
|
const sortedURLs = availableURLs.sort((a, _b) => {
|
|
267
|
-
return a.
|
|
268
|
-
? -1
|
|
269
|
-
: 1;
|
|
277
|
+
return a.toLowerCase().includes('localhost') || a.includes('127.0.0.1') || a.includes('0.0.0.0') ? -1 : 1;
|
|
270
278
|
});
|
|
271
|
-
const bevyUrl = `https://decentraland.zone/bevy-web/?preview=true&realm=${sortedURLs[0].
|
|
279
|
+
const bevyUrl = `https://decentraland.zone/bevy-web/?preview=true&realm=${new URL(sortedURLs[0]).origin}&position=${baseCoords.x},${baseCoords.y}`;
|
|
272
280
|
if (!explorerAlpha) {
|
|
273
281
|
if (bevyWeb) {
|
|
274
282
|
components.logger.log(` ${bevyUrl}`);
|
|
275
283
|
}
|
|
276
284
|
else {
|
|
277
285
|
for (const addr of sortedURLs) {
|
|
278
|
-
components.logger.log(` ${addr
|
|
286
|
+
components.logger.log(` ${addr}`);
|
|
279
287
|
}
|
|
280
288
|
}
|
|
281
289
|
}
|
|
282
290
|
components.logger.log('\nPress CTRL+C to exit\n');
|
|
283
|
-
// Open preferably localhost/127.0.0.1
|
|
284
291
|
if (explorerAlpha && !isMobile) {
|
|
285
|
-
const realm = new URL(sortedURLs[0]
|
|
292
|
+
const realm = new URL(sortedURLs[0]).origin;
|
|
286
293
|
await (0, explorer_alpha_1.runExplorerAlpha)(components, { cwd: workingDirectory, realm, baseCoords, isHub, args: options.args });
|
|
287
294
|
}
|
|
288
|
-
if (
|
|
289
|
-
const deepLink = `decentraland://open?preview=${lanUrl}&position=${baseCoords.x}
|
|
295
|
+
if (options.args['--mobile'] && lanUrl) {
|
|
296
|
+
const deepLink = `decentraland://open?preview=${lanUrl}&position=${baseCoords.x},${baseCoords.y}`;
|
|
290
297
|
qrcode_1.default.toString(deepLink, { type: 'terminal', small: true }, (err, qr) => {
|
|
291
298
|
if (!err) {
|
|
292
299
|
components.logger.log(log_1.colors.bold('\nScan to preview on mobile: \n'));
|
|
@@ -298,7 +305,7 @@ async function main(options) {
|
|
|
298
305
|
// Open preferably localhost/127.0.0.1
|
|
299
306
|
if ((!explorerAlpha || bevyWeb) && openBrowser && sortedURLs.length) {
|
|
300
307
|
try {
|
|
301
|
-
const url = bevyWeb ? bevyUrl : sortedURLs[0]
|
|
308
|
+
const url = bevyWeb ? bevyUrl : sortedURLs[0];
|
|
302
309
|
await (0, open_1.default)(url);
|
|
303
310
|
}
|
|
304
311
|
catch (_) {
|