cheatengine 5.8.23 → 5.8.25
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/ce_mcp_server.js +13 -0
- package/package.json +1 -1
- package/src/pipe-client.js +22 -3
package/ce_mcp_server.js
CHANGED
|
@@ -370,6 +370,19 @@ class CEMCPServer {
|
|
|
370
370
|
// ============ Entry Point ============
|
|
371
371
|
function main() {
|
|
372
372
|
const server = new CEMCPServer();
|
|
373
|
+
|
|
374
|
+
// Handle uncaught exceptions to prevent crash
|
|
375
|
+
process.on('uncaughtException', (err) => {
|
|
376
|
+
log.error(`Uncaught Exception: ${err.message}`);
|
|
377
|
+
log.error(err.stack);
|
|
378
|
+
// Don't exit, try to continue
|
|
379
|
+
});
|
|
380
|
+
|
|
381
|
+
process.on('unhandledRejection', (reason, promise) => {
|
|
382
|
+
log.error(`Unhandled Rejection at: ${promise}, reason: ${reason}`);
|
|
383
|
+
// Don't exit, try to continue
|
|
384
|
+
});
|
|
385
|
+
|
|
373
386
|
server.run();
|
|
374
387
|
}
|
|
375
388
|
|
package/package.json
CHANGED
package/src/pipe-client.js
CHANGED
|
@@ -200,11 +200,20 @@ class PipeClient extends EventEmitter {
|
|
|
200
200
|
const messages = {
|
|
201
201
|
[ERROR_FILE_NOT_FOUND]: (
|
|
202
202
|
"Cheat Engine MCP Bridge not running. " +
|
|
203
|
-
"
|
|
203
|
+
"Steps to fix:\n" +
|
|
204
|
+
"1. Open Cheat Engine\n" +
|
|
205
|
+
"2. Table -> Show Cheat Table Lua Script\n" +
|
|
206
|
+
"3. Load or paste ce_mcp_bridge.lua\n" +
|
|
207
|
+
"4. Click Execute\n" +
|
|
208
|
+
"5. Wait for 'MCP' label to appear in CE toolbar"
|
|
204
209
|
),
|
|
205
|
-
[ERROR_PIPE_BUSY]: "Pipe busy - another client may be connected",
|
|
210
|
+
[ERROR_PIPE_BUSY]: "Pipe busy - another client may be connected. Wait a moment and try again.",
|
|
206
211
|
[ERROR_ACCESS_DENIED]: "Access denied - try running as administrator",
|
|
207
|
-
[ERROR_BROKEN_PIPE]:
|
|
212
|
+
[ERROR_BROKEN_PIPE]: (
|
|
213
|
+
"Connection lost to Cheat Engine. " +
|
|
214
|
+
"This happens when CE is closed. " +
|
|
215
|
+
"Please restart CE and reload ce_mcp_bridge.lua"
|
|
216
|
+
),
|
|
208
217
|
};
|
|
209
218
|
|
|
210
219
|
const baseMsg = messages[winerrorCode] || `Connection failed (error ${winerrorCode})`;
|
|
@@ -281,6 +290,16 @@ class PipeClient extends EventEmitter {
|
|
|
281
290
|
}
|
|
282
291
|
}
|
|
283
292
|
}
|
|
293
|
+
|
|
294
|
+
// Set up a one-time close handler to reject if socket closes while waiting
|
|
295
|
+
const closeHandler = () => {
|
|
296
|
+
this.pendingResponse = null;
|
|
297
|
+
reject(new Error('Socket closed while waiting for response'));
|
|
298
|
+
};
|
|
299
|
+
|
|
300
|
+
if (this.socket) {
|
|
301
|
+
this.socket.once('close', closeHandler);
|
|
302
|
+
}
|
|
284
303
|
});
|
|
285
304
|
}
|
|
286
305
|
|