mirror of
https://github.com/WorldEditAxe/eaglerproxy.git
synced 2024-11-09 07:16:05 -08:00
Compare commits
4 Commits
0e9628f505
...
a543a8d62b
Author | SHA1 | Date | |
---|---|---|---|
|
a543a8d62b | ||
|
8c151fbd8b | ||
|
71f43f4597 | ||
|
8bd1ed9e8d |
|
@ -9,6 +9,9 @@ export const config: Config = {
|
||||||
bindHost: "0.0.0.0",
|
bindHost: "0.0.0.0",
|
||||||
bindPort: 8080,
|
bindPort: 8080,
|
||||||
maxConcurrentClients: 20,
|
maxConcurrentClients: 20,
|
||||||
|
// set this to false if you are unable to install sharp due to either the use of a platform that does not support native modules
|
||||||
|
// or if you are unable to install the required dependencies. this will cause the proxy to use jimp instead of sharp, which may
|
||||||
|
// degrade your proxy's performance.
|
||||||
useNatives: true,
|
useNatives: true,
|
||||||
skinServer: {
|
skinServer: {
|
||||||
skinUrlWhitelist: undefined,
|
skinUrlWhitelist: undefined,
|
||||||
|
@ -20,12 +23,12 @@ export const config: Config = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
motd: true
|
motd: true
|
||||||
? "FORWARD"
|
? "FORWARD" // "FORWARD" regularly polls the server for the MOTD
|
||||||
: {
|
: {
|
||||||
iconURL: "motd.png",
|
iconURL: "motd.png", // must be a valid file path
|
||||||
l1: "yes",
|
l1: "yes",
|
||||||
l2: "no",
|
l2: "no",
|
||||||
},
|
}, // providing an object as such will allow you to supply your own MOTD
|
||||||
ratelimits: {
|
ratelimits: {
|
||||||
lockout: 10,
|
lockout: 10,
|
||||||
limits: {
|
limits: {
|
||||||
|
|
|
@ -25,7 +25,7 @@ hushConsole();
|
||||||
|
|
||||||
const logger = new Logger("EaglerProxyAAS");
|
const logger = new Logger("EaglerProxyAAS");
|
||||||
logger.info(`Starting ${metadata.name} v${metadata.version}...`);
|
logger.info(`Starting ${metadata.name} v${metadata.version}...`);
|
||||||
logger.info(`(internal server port: ${config.bindInternalServerPort}, internal server IP: ${config.bindInternalServerPort})`);
|
logger.info(`(internal server port: ${config.bindInternalServerPort}, internal server IP: ${config.bindInternalServerIp})`);
|
||||||
|
|
||||||
logger.info("Starting internal server...");
|
logger.info("Starting internal server...");
|
||||||
let server = createServer({
|
let server = createServer({
|
||||||
|
|
|
@ -26,7 +26,6 @@ import { CSChannelMessagePacket } from "./packets/channel/CSChannelMessage.js";
|
||||||
import { Constants, UPGRADE_REQUIRED_RESPONSE } from "./Constants.js";
|
import { Constants, UPGRADE_REQUIRED_RESPONSE } from "./Constants.js";
|
||||||
import { PluginManager } from "./pluginLoader/PluginManager.js";
|
import { PluginManager } from "./pluginLoader/PluginManager.js";
|
||||||
import ProxyRatelimitManager from "./ratelimit/ProxyRatelimitManager.js";
|
import ProxyRatelimitManager from "./ratelimit/ProxyRatelimitManager.js";
|
||||||
import { ChatColor } from "../plugins/EagProxyAAS/types.js";
|
|
||||||
import { SkinServer } from "./skins/SkinServer.js";
|
import { SkinServer } from "./skins/SkinServer.js";
|
||||||
|
|
||||||
let instanceCount = 0;
|
let instanceCount = 0;
|
||||||
|
@ -149,7 +148,7 @@ export class Proxy extends EventEmitter {
|
||||||
});
|
});
|
||||||
process.on("beforeExit", () => {
|
process.on("beforeExit", () => {
|
||||||
this._logger.info("Cleaning up before exiting...");
|
this._logger.info("Cleaning up before exiting...");
|
||||||
this.players.forEach((plr) => plr.disconnect(ChatColor.YELLOW + "Proxy is shutting down."));
|
this.players.forEach((plr) => plr.disconnect(Enums.ChatColor.YELLOW + "Proxy is shutting down."));
|
||||||
});
|
});
|
||||||
this.ratelimit = new ProxyRatelimitManager(this.config.ratelimits);
|
this.ratelimit = new ProxyRatelimitManager(this.config.ratelimits);
|
||||||
this.pluginManager.emit("proxyFinishLoading", this, this.pluginManager);
|
this.pluginManager.emit("proxyFinishLoading", this, this.pluginManager);
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { Logger } from "../../logger.js";
|
||||||
import { Constants } from "../Constants.js";
|
import { Constants } from "../Constants.js";
|
||||||
import { Enums } from "../Enums.js";
|
import { Enums } from "../Enums.js";
|
||||||
import { MineProtocol } from "../Protocol.js";
|
import { MineProtocol } from "../Protocol.js";
|
||||||
|
@ -17,7 +18,16 @@ export namespace ImageEditor {
|
||||||
if (loadedLibraries) return;
|
if (loadedLibraries) return;
|
||||||
if (native) sharp = (await import("sharp")).default;
|
if (native) sharp = (await import("sharp")).default;
|
||||||
else {
|
else {
|
||||||
// Jimp = (await import("jimp")).default;
|
try {
|
||||||
|
Jimp = (await import("jimp")).default;
|
||||||
|
} catch (err) {
|
||||||
|
const logger = new Logger("ImageEditor.js");
|
||||||
|
logger.fatal("**** ERROR: UNABLE TO LOAD JIMP!");
|
||||||
|
logger.fatal("Please ensure that Jimp is installed by running 'npm install jimp' in the terminal.");
|
||||||
|
logger.fatal("If you'd like to use the faster native image editor, please set the 'useNatives' option in the config to true.");
|
||||||
|
logger.fatal(`Error: ${err.stack}`);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
Jimp.appendConstructorOption(
|
Jimp.appendConstructorOption(
|
||||||
"Custom Bitmap Constructor",
|
"Custom Bitmap Constructor",
|
||||||
(args) => args[0] && args[0].width != null && args[0].height != null && args[0].data != null,
|
(args) => args[0] && args[0].width != null && args[0].height != null && args[0].data != null,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user