Pocketmine init #79

Merged
Sirherobrine23 merged 10 commits from pocketMine into main 2021-04-10 03:23:21 +00:00
34 changed files with 685 additions and 47 deletions
Showing only changes of commit 720ae39958 - Show all commits

View File

@ -1,4 +1,3 @@
node_modules/
Docker/
!Docker/base
!Docker/etc
!Docker/root_path

View File

@ -3,10 +3,6 @@ on:
pull_request:
branches:
- dependabot/**
check_suite:
types:
- completed
status: {}
jobs:
automerge:
runs-on: ubuntu-latest

10
Docker.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
docker_image_name='thebdsmaneger/maneger'
docker build -f Docker/Dockerfile --tag ${docker_image_name} . && {
echo "----------------------------------------------"
read -rp "Run Image? (Y/n) " -e -i "y" DockerRun
if [ "${DockerRun}" == "y" ];then docker run -ti --rm -P -v /tmp/bds:/home/bds ${1} ${docker_image_name};
elif [ "${DockerRun}" == "Y" ];then docker run -ti --rm -P -v /tmp/bds:/home/bds ${1} ${docker_image_name};
else echo "Run: \"docker run -ti --rm -P -v /tmp/bds:/home/bds ${1} ${docker_image_name}\"";
fi
}

View File

@ -6,12 +6,14 @@ RUN \
echo "Arch: $(uname -m)"; \
apt update && \
apt install -y git curl openjdk-14-jdk openjdk-14-jre wget jq sudo unzip zip screen nginx python make build-essential $(case $(uname -m) in "x86_64") echo "";; *) echo "qemu-user-static binfmt-support";; esac) && \
case $(uname -m) in "x86_64") echo "";; \
*) wget https://raw.githubusercontent.com/The-Bds-Maneger/Raw_files/main/linux_libries.zip -O /tmp/libries.zip && unzip /tmp/libries.zip -d / && rm -rfv /tmp/libries.zip ;; \
esac ;\
rm -rf /var/cache/apt/archives/* /var/lib/apt/lists/* /tmp/* && \
mkdir -p /home/bds/ && rm -rfv /etc/nginx/sites-available/default
# Copy Files
COPY ./Docker/base/ /base/
COPY ./Docker/etc/ /etc/
COPY ./Docker/root_path/ /
COPY ./ /opt/bdsCore/
RUN cd /opt/bdsCore/ && npm install --no-save
ENV TELEGRAM_TOKEN="null" DESCRIPTION="running Minecraft Bedrock Server on the docker by Bds Manager" \

View File

@ -1,11 +0,0 @@
server {
listen [::]:80 ipv6only=on;
listen 80;
server_name _;
location /log {
proxy_pass http://localhost:6565/;
}
location / {
proxy_pass http://localhost:1932;
}
}

View File

@ -24,6 +24,6 @@ else if (existsSync(join(bds.bds_dir_java, "server.jar"))) bds_software = true
if (bds_software){
// ------------------------------
/* Install version */if (process.env.BDS_REINSTALL === "true") bds.download(process.env.BDS_VERSION);/* Skipping */ else console.log("Skipping reinstallation")
/* Install version */if (process.env.BDS_REINSTALL === "true") bds.download("latest");/* Skipping */ else console.log("Skipping reinstallation")
// ------------------------------
} else bds.download(process.env.BDS_VERSION)

View File

@ -0,0 +1,21 @@
server {
listen [::]:80 ipv6only=on;
listen 80;
server_name _;
location /api/log {
proxy_pass http://localhost:6565/;
}
location /api {
proxy_pass http://localhost:1932;
}
#
location /api/log/ {
proxy_pass http://localhost:6565/;
}
location /api/ {
proxy_pass http://localhost:1932;
}
location / {
root /html/
}
}

View File

@ -0,0 +1,11 @@
Controlling your Minecraft server straight from the web.
### Attention
This requires that Bds_Maneger_Api is running in a Docker pool with Image ``sirherobrine23/bdsmaneger:latest``, or your own computer with the nodejs and the API running.
----
This page works with the Bds Maneger APIs. do not try with any other platform will not work.
Your data is also not saved, everything that is requested will be saved a ``sessionStorage`` after leaving the tab everything will be deleted.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,64 @@
/* The switch - the box around the slider */
.switch {
position: relative;
display: inline-block;
width: 33px;
height: 19px;
margin-right: 3.5px;
}
/* Hide default HTML checkbox */
.switch input {
opacity: 0;
width: 0;
height: 0;
}
/* The slider */
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
-webkit-transition: .4s;
transition: .4s;
}
.slider:before {
position: absolute;
content: "";
height: 12px;
width: 12px;
left: 4px;
bottom: 4px;
background-color: white;
-webkit-transition: .4s;
transition: .4s;
}
input:checked + .slider {
background-color: #2196F3;
}
input:focus + .slider {
box-shadow: 0 0 1px #2196F3;
}
input:checked + .slider:before {
-webkit-transform: translateX(10px);
-ms-transform: translateX(10px);
transform: translateX(10px);
}
/* Rounded sliders */
.slider.round {
border-radius: 34px;
margin-left: 4px;
}
.slider.round:before {
border-radius: 50%;
}

View File

@ -0,0 +1,11 @@
.svg_sucess {
--svg-color: #1fff1f;
}
.svg_erro {
--svg-color: red;
}
.svg_color {
fill: var(--svg-color);
display: none;
}

View File

@ -0,0 +1,253 @@
@font-face {
font-family: minecraft;
src: url(Minecraft.ttf);
}
@font-face {
font-family: minecraft-bold;
src: url(Mojang-Bold.ttf);
}
@font-face {
font-family: minecraft-regular;
src: url(Mojang-Regular.ttf);
}
*{
font-family: "minecraft", "minecraft-bold", "minecraft-regular";
color: var(--text-primary)
}
.Log_div_Title {
text-align: center;
font-size: 4vh;
margin-bottom: 1.5vh;
}
.bds_log{
color: var(--text-secondary);
background-color: var(--bg-secondary);
font-family: minecraft;
font-size: 2.4vh !important;
border-radius: 2px;
min-width: 100%;
min-height: 100%;
}
/* .bds_log{
line-height: 4.5vh;
} */
fieldset{
border-radius: 5px;
min-height: 100%;
min-width: 90%;
}
input{
color: var(--text-primary);
background-color: var(--bg-secondary);
font-size: 2.4vh;
}
input[type="text"], input[type="number"], input[type="file"]{
min-width: 90%;
max-width: 1%;
}
.bds_aiptoken{
border-radius: 12px;
margin-left: 6px;
height: 18px;
text-align: center;
width: 10rem;
}
select{
color: var(--text-primary);
background-color: var(--bg-secondary)
}
button{
color: var(--text-primary);
background-color: var(--bg-secondary)
}
label,div{
color: var(--text-primary);
}
div,html{
background-color: var(--bg-primary);
}
:root {
/* font-size: 16px; */
color: var(--text-primary);
--transition-speed: 600ms;
}
.command_area {
height: 100%;
width: 80%;
}
.command_send {
height: 100%;
font-size: 2.4vh;
margin-left: 1vh;
}
.root{
align-content: center;
display: flex;
justify-content: center;
margin-right: -1.3vh;
}
.buttons {
align-items: center;
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: center;
}
.bds_service {
margin-top: 12px;
width: 10rem;
height: 90%;
border-color: var(--bg-secondary);
background-color: var(--bg-secondary);
text-align: center;
border-radius: 12rem;
cursor: pointer;
}
.space {
width: 10px;
}
body {
color: var(--text-primary);
background-color: var(--bg-primary);
margin-right: 1rem;
/* margin-left: 0.5rem; */
padding: 0;
}
@media only screen and (min-height: 1000px) {
.bds_log {
height: 10rem;
}
}
*::-webkit-scrollbar {
width: 0.45rem;
}
*::-webkit-scrollbar-track {
background: var(--bg-secondary);
}
*::-webkit-scrollbar-thumb {
background: var(--text-primary);
}
.dark {
--text-primary: #b6b6b6;
--text-secondary: #ececec;
--bg-primary: #23232e;
--bg-secondary: #141418;
--box-primary: rgba(0,0,0,0.4);
--border-color: rgba(255, 255, 255, 0.5);
}
.light {
--text-primary: #1f1f1f;
--text-secondary: #000000;
--bg-primary: #ffffff;
--bg-secondary: #e4e4e4;
--box-primary: rgba(0,0,0,0.4);
--border-color: rgba(0,0,0,0.5);
}
.system{
--text-primary: #fff;
--text-secondary: #fff;
--bg-primary: #1d1d1d;
--bg-secondary: #3e3e3e;
--box-primary: rgba(0,0,0,0.4);
--border-color: rgba(0,0,0,0.5);
}
.loading {
z-index: 1;
font-size: 3rem !important;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
min-height: 100vh;
/* ------------------------------------------------------- */
position: fixed; /* Stay in place */
z-index: 1; /* Sit on top */
padding-top: 10px; /* Location of the box */
left: 0;
top: 0;
width: 100%; /* Full width */
height: 100%; /* Full height */
overflow: auto; /* Enable scroll if needed */
display: none;
cursor: progress;
}
@media only screen and (max-width: 970px) {
.config_space {
margin-top: 15px;
display: block !important;
}
}
.config_space {
display: none;
background-color: var(--bg-secondary);
}
.config {
z-index: 1;
left: 0;
top: 0;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
position: fixed;
padding-top: 10px;
width: 100%;
height: 100%;
overflow: auto;
background: rgba(124, 124, 124, 0.635);
display: none;
}
.config_conatainer {
border-radius: 0.5rem;
width: 90%;
height: 90%;
margin-left: 5%;
margin-right: 10;
margin-top: 1%;
background-color: var(--bg-secondary);
}
.config_root {
background: var(--bg-secondary);
background-color: var(--bg-secondary);
padding-left: 1vh;
padding-right: 4vh;
padding-top: 4vh;
}
.close {
float: right;
background-color: var(--bg-secondary);
color: var(--text-secondary);
margin-right: 12px;
margin-left: 12px;
margin-top: 12px;
border-radius: 1rem;
cursor: pointer;
}

View File

@ -0,0 +1,3 @@
<svg version="1.1" class="svg_color" fill="currentColor" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 241.171 241.171" width="7pt" height="7pt">
<path fill-rule="evenodd" d="M138.138,120.754l99.118-98.576c4.752-4.704,4.752-12.319,0-17.011c-4.74-4.704-12.439-4.704-17.179,0 l-99.033,98.492L21.095,3.699c-4.74-4.752-12.439-4.752-17.179,0c-4.74,4.764-4.74,12.475,0,17.227l99.876,99.888L3.555,220.497 c-4.74,4.704-4.74,12.319,0,17.011c4.74,4.704,12.439,4.704,17.179,0l100.152-99.599l99.551,99.563 c4.74,4.752,12.439,4.752,17.179,0c4.74-4.764,4.74-12.475,0-17.227L138.138,120.754z"/>
</svg>

After

Width:  |  Height:  |  Size: 650 B

View File

@ -0,0 +1,3 @@
<svg version="1.1" class="svg_color" fill="currentColor" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 492 492" width="7pt" height="7pt">
<path fill-rule="evenodd" d="M484.128,104.478l-16.116-16.116c-5.064-5.068-11.816-7.856-19.024-7.856c-7.208,0-13.964,2.788-19.028,7.856 L203.508,314.81L62.024,173.322c-5.064-5.06-11.82-7.852-19.028-7.852c-7.204,0-13.956,2.792-19.024,7.852l-16.12,16.112 C2.784,194.51,0,201.27,0,208.47c0,7.204,2.784,13.96,7.852,19.028l159.744,159.736c0.212,0.3,0.436,0.58,0.696,0.836 l16.12,15.852c5.064,5.048,11.82,7.572,19.084,7.572h0.084c7.212,0,13.968-2.524,19.024-7.572l16.124-15.992 c0.26-0.256,0.48-0.468,0.612-0.684l244.784-244.76C494.624,132.01,494.624,114.966,484.128,104.478z"/>
</svg>

After

Width:  |  Height:  |  Size: 793 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

View File

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 207.027 207.027" style="enable-background:new 0 0 207.027 207.027;" xml:space="preserve">
<path d="M69.866,15.557L0,138.919l28.732,52.552l143.288-0.029l35.008-59.588L136.39,15.735L69.866,15.557z M17.166,139.046
L74.268,38.205L91.21,67.783L33.24,168.447L17.166,139.046z M99.841,82.851l23.805,41.558l-47.732-0.006L99.841,82.851z
M163.434,176.443l-117.332,0.024l21.53-37.065l64.606,0.008l0.067,0.119l52.865-0.085L163.434,176.443z M140.932,124.411
L90.157,35.767l-2.966-5.178l40.751,0.121l57.003,93.706L140.932,124.411z"/>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24" viewBox="0 0 24 24" width="24"><g><path d="M0,0h24v24H0V0z" fill="none"/><path d="M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61 l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41 h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33c-0.22-0.08-0.47,0-0.59,0.22L2.74,8.87 C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58C4.84,11.36,4.8,11.69,4.8,12s0.02,0.64,0.07,0.94l-2.03,1.58 c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54 c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96 c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94z M12,15.6c-1.98,0-3.6-1.62-3.6-3.6 s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z"/></g></svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zM1 2v2h2l3.6 7.59-1.35 2.45c-.16.28-.25.61-.25.96 0 1.1.9 2 2 2h12v-2H7.42c-.14 0-.25-.11-.25-.25l.03-.12.9-1.63h7.45c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.08-.14.12-.31.12-.48 0-.55-.45-1-1-1H5.21l-.94-2H1zm16 16c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2z"/></svg>

After

Width:  |  Height:  |  Size: 459 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24" viewBox="0 0 24 24" width="24"><g><rect fill="none" height="24" width="24"/><path d="M20.41,8.41l-4.83-4.83C15.21,3.21,14.7,3,14.17,3H5C3.9,3,3,3.9,3,5v14c0,1.1,0.9,2,2,2h14c1.1,0,2-0.9,2-2V9.83 C21,9.3,20.79,8.79,20.41,8.41z M7,7h7v2H7V7z M17,17H7v-2h10V17z M17,13H7v-2h10V13z"/></g></svg>

After

Width:  |  Height:  |  Size: 376 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M0 0h24v24H0z" fill="none"/><path d="M2 12C2 6.48 6.48 2 12 2s10 4.48 10 10-4.48 10-10 10S2 17.52 2 12zm10 6c3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6 2.69 6 6 6z"/></svg>

After

Width:  |  Height:  |  Size: 299 B

View File

@ -0,0 +1,14 @@
// Info Box
document.getElementById("InfoB").onclick = function() {document.getElementById("Info").style.display = "block";}
document.getElementsByClassName("infoclose")[0].onclick = function() {document.getElementById("Info").style.display = "none";}
window.onclick = function(event) {if (event.target == document.getElementById("Info")) {document.getElementById("Info").style.display = "none";}}
// Config Modal
document.getElementById("configbuttom").onclick = function() {document.getElementById("configmodal").style.display = "block";}
document.getElementsByClassName("closeConfig")[0].onclick = function() {document.getElementById("configmodal").style.display = "none"}
window.onclick = function(event) {if (event.target == document.getElementById("configmodal")) {document.getElementById("configmodal").style.display = "none"}
}
// Give Item
// document.getElementById("giveMENU").onclick = function() {document.getElementById("GIVEM").style.display = "block"}
// document.getElementsByClassName("closeG")[0].onclick = function() {document.getElementById("GIVEM").style.display = "none"}
// window.onclick = function(event) {if (event.target == document.getElementById("GIVEM")) {document.getElementById("GIVEM").style.display = "none"}}

View File

@ -0,0 +1,16 @@
fetch(`http://${localStorage.getItem("bds_ip-remote")}:1932/configs`).then(response => response.json()).then(CONFIGS => {
document.getElementById('name') .value = CONFIGS.server_name;
document.getElementById('gameMode') .value = CONFIGS.gamemode;
document.getElementById('difficulty') .value = CONFIGS.difficulty;
document.getElementById('timeout_server').value = CONFIGS.player_idle_timeout;
document.getElementById('level_name') .value = CONFIGS.level_name;
document.getElementById('permissions') .value = CONFIGS.default_player_permission_level;
document.getElementById('max_pla') .value = CONFIGS.max_players
// cheats
if (CONFIGS.allow_cheats == 'true'){document.getElementById('cheats').checked = true} else {document.getElementById('cheats').checked = false};
// online mode
if (CONFIGS.online_mode == 'true'){document.getElementById('xbox').checked = true} else {document.getElementById('xbox').checked = false};
// cheats
if (CONFIGS.white_list == 'true'){document.getElementById('whitelist').checked = true} else {document.getElementById('whitelist').checked = false};
})

View File

@ -0,0 +1,128 @@
<!DOCTYPE html>
<html lang="en" translate="no">
<script>
if (location.protocol === "https:") location.replace("http://web.the-bds-maneger.org/?from=https")
const urlParams = new URLSearchParams(window.location.search);
if (urlParams.get("from") === "https") alert("Do not use \"https://web.the-bds-maneger.org\" as you will always have an error")
</script>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Bds Maneger Web</title>
<link rel="shortcut icon" href="./assents/image/favicon.ico" />
<link rel="stylesheet" type="text/css" media="screen" href="assents/css/main.css">
<link rel="stylesheet" type="text/css" media="screen" href="assents/css/check.css">
<link rel="stylesheet" type="text/css" media="screen" href="assents/css/complete.css">
<meta name="description" content="Control your Minecraft server remotely (Requires Bds Manager core or Electron)">
<meta name="google" content="notranslate">
</head>
<div id="test"></div>
<div class="svg_sucess">
<svg version="1.1" class="svg_color" fill="currentColor" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 492 492" width="7pt" height="7pt">
<path fill-rule="evenodd" d="M484.128,104.478l-16.116-16.116c-5.064-5.068-11.816-7.856-19.024-7.856c-7.208,0-13.964,2.788-19.028,7.856 L203.508,314.81L62.024,173.322c-5.064-5.06-11.82-7.852-19.028-7.852c-7.204,0-13.956,2.792-19.024,7.852l-16.12,16.112 C2.784,194.51,0,201.27,0,208.47c0,7.204,2.784,13.96,7.852,19.028l159.744,159.736c0.212,0.3,0.436,0.58,0.696,0.836 l16.12,15.852c5.064,5.048,11.82,7.572,19.084,7.572h0.084c7.212,0,13.968-2.524,19.024-7.572l16.124-15.992 c0.26-0.256,0.48-0.468,0.612-0.684l244.784-244.76C494.624,132.01,494.624,114.966,484.128,104.478z"/>
</svg>
<svg version="1.1" class="svg_color" fill="currentColor" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 241.171 241.171" width="7pt" height="7pt">
<path fill-rule="evenodd" d="M138.138,120.754l99.118-98.576c4.752-4.704,4.752-12.319,0-17.011c-4.74-4.704-12.439-4.704-17.179,0 l-99.033,98.492L21.095,3.699c-4.74-4.752-12.439-4.752-17.179,0c-4.74,4.764-4.74,12.475,0,17.227l99.876,99.888L3.555,220.497 c-4.74,4.704-4.74,12.319,0,17.011c4.74,4.704,12.439,4.704,17.179,0l100.152-99.599l99.551,99.563 c4.74,4.752,12.439,4.752,17.179,0c4.74-4.764,4.74-12.475,0-17.227L138.138,120.754z"/>
</svg>
</div>
<body class="system">
<div class="Log_div_Title">Bds Maneger Log</div>
<div class="root">
<div class="bds_log" id="bds_log"></div>
</div>
<div class="root">
<script>
function checkCommand(){
const currentCommand = document.getElementById("command").value;
if (currentCommand.charAt(0) === "/") document.getElementById("command").value = currentCommand.replace("/", "");
}
function clearCommand(){document.getElementById("command").value = ""}
</script>
<input class="command_area" placeholder="The command is here, there is no need to include the '/'" oninput="checkCommand();" type="text" id="command" onkeydown="if(event.keyCode === 13) document.getElementById('command_send').click()">
<input class="command_send" id="command_send" type="submit" onclick="bds_command(); clearCommand()">
</div>
<div class="buttons">
<div class="bds_service" onclick="bds_start()">Start</div> <div class="space"></div>
<div class="bds_service" onclick="bds_stop()">Stop</div> <div class="space"></div>
<div class="bds_service" onclick="bds_restart()">Restart</div> <div class="space"></div>
<div class="bds_service" onclick="settings_display()">Settings and information</div>
</div>
<div id="config" class="config">
<div class="config_conatainer">
<div class="close" onclick="settings_display()">Exit</div>
<div class="config_root">
<!-- -->
<script>
function saveAddress(){
var serverAddr = document.getElementById("bds_addr").value;
localStorage.setItem("the_addr", serverAddr);
console.log(`server Addr Save: ${serverAddr}`);
if (andress !== serverAddr) document.getElementById("ReloadPage").style.display = "block";
else document.getElementById("ReloadPage").style.display = "none";
}
function changeToken(){
var tokenSS = document.getElementById("bds_token").value;
localStorage.setItem("the_token", tokenSS);
console.log(`Token save: ${tokenSS}`);
if (tokenSS !== token) document.getElementById("ReloadPage").style.display = "block";
else document.getElementById("ReloadPage").style.display = "none";
}
</script>
<fieldset>
<span>Bds Maneger REST port:</span><input class="bds_aiptoken" value="1932" disabled id="rest_port" type="number">
<p><span>Bds Maneger Log port:</span><input class="bds_aiptoken" value="6565" disabled id="log_port" type="number"></p>
<div class="config_space"></div>
<p>
<span>Bds Maneger address:</span>
<input class="bds_aiptoken" type="text" placeholder="mcpe.sh23.org" id="bds_addr" oninput="saveAddress();" onchange="saveAddress();">
<div class="config_space"></div>
<span>Bds Maneger Token:</span><input class="bds_aiptoken" type="text" id="bds_token" oninput="changeToken();" onchange="changeToken();">
<p><a style="display: none;" id="ReloadPage" onclick="location.reload()">Reload Page</a></p>
</p>
<div class="config_space">
<input type="file" accept="image/*" disabled id="qrcodeinput">
<script>
</script>
</div>
</fieldset>
<!-- -->
</div>
</div>
</div>
</body>
</html>
<script src="./web_main.js"></script>
<div class="loading" id="loading">
<div id="wait1">Wait .</div>
<div id="wait2">Wait ..</div>
<div id="wait3">Wait ...</div>
<script>
function wait1 (){
document.getElementById("wait1").style.display = "block"
document.getElementById("wait2").style.display = "none"
document.getElementById("wait3").style.display = "none"
}
function wait2 (){
document.getElementById("wait1").style.display = "none"
document.getElementById("wait2").style.display = "block"
document.getElementById("wait3").style.display = "none"
}
function wait3 (){
document.getElementById("wait1").style.display = "none"
document.getElementById("wait2").style.display = "none"
document.getElementById("wait3").style.display = "block"
}
setInterval(() => {
wait1()
setTimeout(() => {
wait2()
setTimeout(() => {
wait3()
}, 100);
}, 100);
}, 1000);
</script>
</div>

View File

@ -0,0 +1,79 @@
console.info("Welcome to Bds Maneger Web 2.0")
const token = (localStorage.getItem("the_token") || undefined),
andress = (localStorage.getItem("the_addr") || undefined),
port_log = (localStorage.getItem("the_log_port") || 6565),
port_REST = (localStorage.getItem("the_log_port") || 1932)
if (andress){
document.getElementById("bds_token").value = token
document.getElementById("bds_addr").value = andress
function basic_service (service){
const post_men = {
"token": token,
"command": service
}
fetch(`http://${andress}:${port_REST}/service`,{
method: "POST",
mode: "cors",
body: JSON.stringify(post_men),
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
}
}).then(response => response.json()).then(lan => {
console.log(lan)
})
}
function bds_start(){
basic_service("start")
}
function bds_stop (){
basic_service("stop")
}
function bds_restart(){
let log = document.getElementById("bds_log").innerHTML
console.log("restart request")
if (!(log.includes("Quit correctly"))) bds_stop()
bds_start
}
function bds_command(){
var post_men = {
"token": token,
"command": document.getElementById("command").value
};
fetch(`http://${andress}:${port_REST}/bds_command`, {
method: "POST",
mode: "cors",
body: JSON.stringify(post_men),
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
}
}
).then(response => response.json()).then(lan => {
if (lan.status !== 200) {console.log(lan)}
else {
}
})
}
setInterval(() => {
fetch(`http://${andress}:${port_log}/?format=html`).then(response => response.text()).then(lan => {
document.getElementById("bds_log").innerHTML = lan
}).catch (function (err){null});
}, 2 * 1000);
} else {
/* alert("Please set the Bds Maneger's ip or address, and the authorization token for some advanced features")
document.getElementById("config").style.display = "block" */
}
function settings_display(){
const se_display = document.getElementById("config").style.display
if (se_display === "block"){
document.getElementById("config").style.display = "none"
} else {
document.getElementById("config").style.display = "block"
}
}

View File

@ -6,7 +6,13 @@ For now we are in a version qualified for general use and implementations in com
## CI/CD status
[![CodeQL](https://github.com/Bds-Maneger/bds_maneger_api/workflows/CodeQL/badge.svg)](https://github.com/The-Bds-Maneger/core/actions/workflows/codeql-analysis.yml) [![Total alerts](https://img.shields.io/lgtm/alerts/g/Bds-Maneger/bds_maneger_api.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/Bds-Maneger/bds_maneger_api/alerts/) [![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/Bds-Maneger/bds_maneger_api.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/Bds-Maneger/bds_maneger_api/context:javascript) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/4d19af8fe5b146608a8f4a5e2092f66d)](https://www.codacy.com/gh/Bds-Maneger/bds_maneger_api/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=Bds-Maneger/bds_maneger_api&amp;utm_campaign=Badge_Grade)
[![CodeQL](https://github.com/Bds-Maneger/bds_maneger_api/workflows/CodeQL/badge.svg)](https://github.com/The-Bds-Maneger/core/actions/workflows/codeql-analysis.yml) [![Total alerts](https://img.shields.io/lgtm/alerts/g/Bds-Maneger/bds_maneger_api.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/Bds-Maneger/bds_maneger_api/alerts/) [![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/Bds-Maneger/bds_maneger_api.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/Bds-Maneger/bds_maneger_api/context:javascript) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/4d19af8fe5b146608a8f4a5e2092f66d)](https://www.codacy.com/gh/Bds-Maneger/bds_maneger_api/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=Bds-Maneger/bds_maneger_api&amp;utm_campaign=Badge_Grade)
## Common Mistakes
* On Windows if you are receiving any error from platform-tools, follow these [steps](https://github.com/nodejs/node-gyp#on-windows) and install [python](https://www.python.org/downloads/).
* If you are using Branch main, there may be several errors and corrections may take time to arrive, I recommend using the Tags.
## Start the Bds Maneger Core docker server
@ -29,18 +35,12 @@ bdsmaneger/maneger:latest
## Azure Deploys
**Recommended to use a new resource group**
### *Recommended to use a new resource group*
### Microsoft Azure Container
#### Microsoft Azure Container
[![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FBds-Maneger%2FThe-Bds-Maneger-Docker%2Fmain%2Fazure%2FBdsMangerCore_docker.json)
### Microsoft Azure Virtual machine
#### Microsoft Azure Virtual machine
[![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FThe-Bds-Maneger%2FAzure_VMs%2Fmain%2Fdeploy.json) More Information Access the repository: [Azure VMs](https://github.com/The-Bds-Maneger/Azure_VMs)
## Common Mistakes
* ### On Windows if you are receiving any error from platform-tools, follow these [steps](https://github.com/nodejs/node-gyp#on-windows), and install [python](https://www.python.org/downloads/).
* ### If you are using Branch main, there may be several errors and corrections may take time to arrive, I recommend using the Tags.

View File

@ -1,4 +0,0 @@
#!/bin/bash
docker_image_name='thebdsmaneger/maneger'
docker build -f Docker/Dockerfile --tag ${docker_image_name} . && \
echo "Run: \"docker run -ti --rm -P -v /tmp/bds:/home/bds ${1} ${docker_image_name}\""

View File

@ -213,7 +213,8 @@ module.exports.SERVER_URLs = SERVER_URLs
// PHP Bins
const PHPbinsUrl = JSON.parse(execSync("curl -sS \"https://raw.githubusercontent.com/The-Bds-Maneger/Raw_files/main/php_bin.json\"").toString())
module.exports.PHPbinsUrls = PHPbinsUrl
console.log(PHPbinsUrl);
// PHP bins System availble in Json File
const PHPurlNames = Object.getOwnPropertyNames(PHPbinsUrl)
module.exports.PHPurlNames = PHPurlNames
@ -227,10 +228,9 @@ else default_platformConfig = "java"
if (fs.existsSync(bds_config_file)){
bds_config = JSON.parse(fs.readFileSync(bds_config_file, "utf8"))
if (bds_config.version !== current_version_bds_core){
let ram_total = Math.trunc((require("os").freemem() / 1000 / 1000) - 212)
if (ram_total >= 1000) ram_total = ram_total - 1000
if (bds_config.platform_version === undefined) bds_config.platform_version = {}
if (bds_config.bedrock_config === undefined) bds_config.bedrock_config = {}
// New Config JSon
bds_config = {
"version": current_version_bds_core,
"bds_pages": (bds_config.bds_pages||"default"),
@ -242,13 +242,8 @@ if (fs.existsSync(bds_config_file)){
"bds_ban": (bds_config.bds_ban||["Steve", "Alex", "steve", "alex"]),
"telegram_token": (bds_config.telegram_token||undefined),
"Google_Drive_root_backup_id": (bds_config.Google_Drive_root_backup_id||undefined),
"telegram_admin": (bds_config.telegram_admin||["all_users"]),
"java_config": {
"max": ram_total
},
"bedrock_config": {
"from": (bds_config.bedrock_config.from||"oficial"), // Use the official version provided by Mojang Studios AB
"url": (bds_config.bedrock_config.from||null) // JSON Array file with versions and download url
}
}
fs.writeFileSync(bds_config_file, JSON.stringify(bds_config, null, 4))

5
package-lock.json generated
View File

@ -1,12 +1,13 @@
{
"name": "@the-bds-maneger/core",
"version": "1.8.5.5",
"version": "1.8.6.5",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@the-bds-maneger/core",
"version": "1.8.5.5",
"version": "1.8.6.5",
"hasInstallScript": true,
"license": "AGPL-3.0-or-later",
"dependencies": {
"adm-zip": "^0.5.1",

View File

@ -3,7 +3,7 @@
"publishConfig": {
"access": "public"
},
"version": "1.8.6",
"version": "1.8.6.5",
"description": "scripts to manage minecraft bedrock server",
"private": false,
"main": "index.js",

View File

@ -106,7 +106,10 @@ module.exports.start = () => {
} else if (process.platform === "darwin") throw Error("We don't have MacOS support yet")
else process.exit(210)
} else if (plat === "java") {
if (require("command-exists").sync("java")) start_server = exec(`java -Xmx${bds.bds_config.java_config.max}M -Xms${bds.bds_config.java_config.max}M -jar server.jar nogui`, {cwd: bds.bds_dir_java});
var ram_max = Math.trunc((require("os").freemem() / 1000 / 1000) - 212)
var ram_minimun = ram_max;
if (ram_max >= 1000) {ram_max = Math.trunc(ram_max / 10);ram_minimun = Math.trunc(ram_max / 50)}
if (require("command-exists").sync("java")) start_server = exec(`java -Xmx${ram_max}M -Xms${ram_minimun}M -jar server.jar nogui`, {cwd: bds.bds_dir_java});
else {
if (bds.system == "windows"){
require("open")("http://docs.sirherobrine23.com/bds_maneger_api_java#Windows");