Skip to content

Commit

Permalink
Update server.py
Browse files Browse the repository at this point in the history
  • Loading branch information
andiricum2 committed Dec 22, 2023
1 parent 59f52a3 commit cc6f058
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions piebedrock/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import random

class BedrockServer:
def __init__(self, hostname="0.0.0.0", port=19132, logger=logging.getLogger("PieBedrock"), gamemode="survival", timeout=20):
def __init__(self, hostname="0.0.0.0", port=19132, logger=logging.getLogger("PieBedrock"), gamemode="survival", timeout=20, dev_mode=False):
self.initialized = False
self.logger = logger
self.server_status = None
Expand All @@ -37,10 +37,13 @@ def __init__(self, hostname="0.0.0.0", port=19132, logger=logging.getLogger("Pie
self.running = False
self.start_time = int(time.time())
self.pieraknet_thread = None
self.dev_mode = dev_mode

def pieraknet_init(self):
self.pieraknet = PieRakNet(self.hostname, self.port, logging.getLogger("PieRakNet"))
self.pieraknet.interface = self
if self.dev_mode:
logging.getLogger("PierakNet").setLevel(logging.DEBUG)
logging.getLogger("PierakNet").addHandler(logging.StreamHandler())
self.pieraknet = PieRakNet(self.hostname, self.port, logging.getLogger("PierakNet"))
self.update_server_status()
self.pieraknet.protocol_version = self.raknet_version
self.pieraknet.timeout = self.timeout
Expand Down

0 comments on commit cc6f058

Please sign in to comment.