Spaces:
Paused
Paused
Update bot.js
Browse files
bot.js
CHANGED
|
@@ -11,6 +11,7 @@ const proxyChain = require("proxy-chain");
|
|
| 11 |
const { SocksClient } = require('socks');
|
| 12 |
const { Client } = require('ssh2');
|
| 13 |
|
|
|
|
| 14 |
const config = require("./settings.json");
|
| 15 |
const loggers = require("./logging.js");
|
| 16 |
const logger = loggers.logger;
|
|
@@ -391,7 +392,7 @@ const checkAndStartViewer = (req, res, next) => {
|
|
| 391 |
}
|
| 392 |
|
| 393 |
// Güvenlik Kontrolü: Bot tanımlı mı ve soketi aktif mi?
|
| 394 |
-
const isBotReady = bot && bot.player
|
| 395 |
|
| 396 |
if (!viewerInstance && isBotReady) {
|
| 397 |
try {
|
|
@@ -452,4 +453,15 @@ app.use('/3dview', checkAndStartViewer, createProxyMiddleware({
|
|
| 452 |
}
|
| 453 |
}));
|
| 454 |
|
| 455 |
-
app.listen(process.env.PORT || 7860);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
const { SocksClient } = require('socks');
|
| 12 |
const { Client } = require('ssh2');
|
| 13 |
|
| 14 |
+
|
| 15 |
const config = require("./settings.json");
|
| 16 |
const loggers = require("./logging.js");
|
| 17 |
const logger = loggers.logger;
|
|
|
|
| 392 |
}
|
| 393 |
|
| 394 |
// Güvenlik Kontrolü: Bot tanımlı mı ve soketi aktif mi?
|
| 395 |
+
const isBotReady = bot && bot.player;
|
| 396 |
|
| 397 |
if (!viewerInstance && isBotReady) {
|
| 398 |
try {
|
|
|
|
| 453 |
}
|
| 454 |
}));
|
| 455 |
|
| 456 |
+
app.listen(process.env.PORT || 7860);
|
| 457 |
+
|
| 458 |
+
const originalStderrWrite = process.stderr.write;
|
| 459 |
+
process.stderr.write = function (chunk, encoding, callback) {
|
| 460 |
+
const message = chunk.toString();
|
| 461 |
+
if (message.includes("Ignoring block entities as chunk failed to load")) {
|
| 462 |
+
// Bu uyarıyı yut ve konsola basma
|
| 463 |
+
if (typeof callback === 'function') callback();
|
| 464 |
+
return true;
|
| 465 |
+
}
|
| 466 |
+
return originalStderrWrite.apply(process.stderr, arguments);
|
| 467 |
+
};
|