From 365557aea45c31df2a4109e13d27dc102dee592c Mon Sep 17 00:00:00 2001 From: andiricum2 Date: Tue, 1 Aug 2023 15:57:07 +0200 Subject: [PATCH] Bug Fixes + Version.dat --- .gitignore | 1 - README.md | 3 +++ piemc/config.py | 3 +-- piemc/server.py | 12 ++++++------ version.dat | 1 + 5 files changed, 11 insertions(+), 9 deletions(-) create mode 100644 version.dat diff --git a/.gitignore b/.gitignore index fcb8f2a..64a6fe8 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,6 @@ piemc/lang/__pycache__/ piemc/meta/__pycache__/ piemc/__pycache__/ -version.dat pieuid.dat piemc_test.py log/ diff --git a/README.md b/README.md index 00f159e..b471edf 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,9 @@ First of all you need to install requirements with: ```bash pip install -r requirements.txt ``` + +**⚠️ INSTALL [PIERAKNET](https://github.com/PieMC-Dev/PieRakNet) MANUALLY ⚠️** + which if you run `start.cmd` it will automatically install on startup To run the server, execute the following command in PieMC directory: [See how to get to the directory here](https://PieMC-Dev.github.io/directory) ```bash diff --git a/piemc/config.py b/piemc/config.py index 0e1156b..17d018f 100644 --- a/piemc/config.py +++ b/piemc/config.py @@ -5,6 +5,5 @@ MAX_PLAYERS = 20 GAMEMODE = "Survival" LANG = "en" -MOTD1 = "PieMC Server" -MOTD2 = "Powered by PieMC" +MOTD = "PieMC Server" LOG_LEVEL = '' # ONLY FOR DEVELOPERS. Set the desired log level in uppercase (e.g., 'INFO', 'DEBUG', 'WARNING', 'ERROR', 'CRITICAL') diff --git a/piemc/server.py b/piemc/server.py index a11cda8..d5b6a1a 100644 --- a/piemc/server.py +++ b/piemc/server.py @@ -50,8 +50,8 @@ def __init__(self, hostname, port): self.edition = "MCPE" self.protocol_version = 594 self.version_name = "1.20.12" - self.motd1 = config.MOTD1 - self.motd2 = config.MOTD2 + self.motd = config.MOTD + self.level = "Powered by PieMC" self.players_online = 2 # 2 players online XD. Update (By andiri): YES :sunglasses: self.max_players = config.MAX_PLAYERS self.gamemode_map = { @@ -84,20 +84,20 @@ def __init__(self, hostname, port): self.logger.info(self.lang['SERVER_INITIALIZED']) self.start_time = int(time.time()) initialize_commands(piemc.handlers.command) - + def get_time_ms(self): return round(time.time() - self.start_time, 4) - + def update_server_status(self): self.server_status = ';'.join([ self.edition, - self.motd1, + self.motd, str(self.protocol_version), self.version_name, str(self.players_online), str(self.max_players), str(self.uid), - self.motd2, + self.level, self.gamemode[0], str(self.gamemode[1]), str(self.port), diff --git a/version.dat b/version.dat new file mode 100644 index 0000000..59d3f7d --- /dev/null +++ b/version.dat @@ -0,0 +1 @@ +2022-08-01T11:33:00Z \ No newline at end of file