-
Notifications
You must be signed in to change notification settings - Fork 4
Home
Andoni edited this page Sep 23, 2024
·
5 revisions
Welcome to the PieRakNet wiki!
To create a pieraknet server youll need to create a raknet instance:
server = BedrockServer()
later youll need to attach an interface to handle game packages:
interface = GameInterface()
server.interface = interface
GameInterface.py:
class GameInterface:
def on_game_packet(self, packet_body, connection):
print(f"We just receive a packet {packet_body} from {connection.address}")
then youll need to handle game packages.
To customize raknet server:
Example server.py:
from pieraknet.server import Server as RakNetServer
class BedrockServer:
def main(self):
from piebedrock.interface import GameInterface
server = BedrockServer()
interface = GameInterface()
server = RakNetServer()
server.logger.setLevel("INFO")
server.game="MCPE"
server.name="H"
server.modt="G"
server.interface = interface
server.start()
if __name__ == '__main__':
server = BedrockServer()
server.main()