cheatengine 5.8.22 → 5.8.24

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_bridge.lua CHANGED
@@ -7527,30 +7527,6 @@ function Pipe.workerLoop()
7527
7527
  Context.lastActivityTime = os_clock() -- Heartbeat: record connection time
7528
7528
  Utils.debugPrint("Client connected (#" .. Context.connectionCount .. ")")
7529
7529
 
7530
- -- Handshake: send ready signal
7531
- local handshakeOk = pcall(function()
7532
- Context.pipeServer.lock()
7533
- local ok = pcall(function()
7534
- local readyMsg = JSON.encode({ ready = true, timestamp = os.time() })
7535
- Context.pipeServer.writeDword(#readyMsg)
7536
- Context.pipeServer.writeString(readyMsg, false)
7537
- end)
7538
- Context.pipeServer.unlock()
7539
- return ok
7540
- end)
7541
-
7542
- if not handshakeOk then
7543
- Utils.debugPrint("Handshake failed, disconnecting client")
7544
- pcall(function()
7545
- if Context.pipeServer and Context.pipeServer.Valid then
7546
- Context.pipeServer.disconnect()
7547
- end
7548
- end)
7549
- sleep(50)
7550
- goto next_connection
7551
- end
7552
-
7553
- Utils.debugPrint("Handshake completed")
7554
7530
  local sessionErrors = 0
7555
7531
 
7556
7532
  while Context.serverRunning and Context.pipeServer and Context.pipeServer.Valid do
@@ -7648,8 +7624,6 @@ function Pipe.workerLoop()
7648
7624
  Utils.debugPrint("Client disconnected, waiting for new connection...")
7649
7625
  sleep(50)
7650
7626
  end
7651
-
7652
- ::next_connection::
7653
7627
  end
7654
7628
  Utils.debugPrint("Worker stopped")
7655
7629
  end
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cheatengine",
3
- "version": "5.8.22",
3
+ "version": "5.8.24",
4
4
  "description": "Cheat Engine MCP Server - AI-assisted reverse engineering bridge",
5
5
  "main": "ce_mcp_server.js",
6
6
  "bin": {
@@ -281,6 +281,16 @@ class PipeClient extends EventEmitter {
281
281
  }
282
282
  }
283
283
  }
284
+
285
+ // Set up a one-time close handler to reject if socket closes while waiting
286
+ const closeHandler = () => {
287
+ this.pendingResponse = null;
288
+ reject(new Error('Socket closed while waiting for response'));
289
+ };
290
+
291
+ if (this.socket) {
292
+ this.socket.once('close', closeHandler);
293
+ }
284
294
  });
285
295
  }
286
296