Skip to content

Commit

Permalink
Bug Fixes + Version.dat
Browse files Browse the repository at this point in the history
  • Loading branch information
andiricum2 committed Aug 1, 2023
1 parent 23e2143 commit 365557a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
piemc/lang/__pycache__/
piemc/meta/__pycache__/
piemc/__pycache__/
version.dat
pieuid.dat
piemc_test.py
log/
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions piemc/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
12 changes: 6 additions & 6 deletions piemc/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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),
Expand Down
1 change: 1 addition & 0 deletions version.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2022-08-01T11:33:00Z

0 comments on commit 365557a

Please sign in to comment.