Skip to main content

Python library that made for Multiplayer games.

Project description

BGM

Python library made for python multiplayer games.

About

This library made for python multilplayer games. It uses UDP protocol for transfering packets, library requires central server also packets are not encrypted but it gonna be soon.

Packets

  1. Connect packet
CONNECT|[From ip]|[To ip]|[From port]|[To port]
  1. Disconnect packet
DISCONNECT|[From ip]|[To ip]

Other packets are made by user.

Functions

Server

  1. Recive event - runs function everytime server recives message. Can be used as decorator
BGM_Server.recive_event(callback: Callable)
  1. Start server - Starts server on defined ip and port
BGM_Server.start_server()
  1. Broadcast - Sends a same packet to everyone
BGM_Server.broadcast(message: Bytes)
  1. Constructor - Construct packet with data given and type.
Packets.Constructor(data: Dict, type: String)
  1. Deconstructor - Deconstructs packet given in arg.
Packets.Deconstructor(message: Str)

Client

  1. Connect - Connects to server with given information
BGM_Client.connect(ip: Str, port: Int)
  1. Send - Send packet to connected server with given information.
BGM_Client.send(data: Dict, packet: Str)
  1. Recive Event - If u are connected to any server it will call callback everytime u recive message (can be used more that 1 time)
BGM_Client.recive_event(callback: Callable)
  1. Disconnect - Disconnects you from connected server
BGM_Client.disconnect()
  1. Constructor - Construct packet with data given and type.
Packets.Constructor(data: Dict, type: String)
  1. Deconstructor - Deconstructs packet given in arg.
Packets.Deconstructor(message: Str)
  1. Disconnect - Returns constructed packet for disconnect
Packets.disconnect(fromip: Str, toip: Str)
  1. Deconstructor - Returns constructed packet for connection
Packets.connect(fromip: Str, toip: Str, fromport: Int, toport: Int)

Credits

Made by danxvo

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bgm_net-0.1.0.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bgm_net-0.1.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file bgm_net-0.1.0.tar.gz.

File metadata

  • Download URL: bgm_net-0.1.0.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.1

File hashes

Hashes for bgm_net-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7befa09efb00889f42ef2db08ba5fe45c7aba562a8eb482e1210c1128d16bfb1
MD5 e88c2a5acf5e3eacce99470156c0075e
BLAKE2b-256 09b6c7a8813608cf0b83c729114c8d2df2816c88d55d6e55919b6ec0ee335efb

See more details on using hashes here.

File details

Details for the file bgm_net-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: bgm_net-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.1

File hashes

Hashes for bgm_net-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f12b3f7a76c57bd0b9702bbe0193f2738dcf09f86d5b79442b685875335c7737
MD5 ed7b1a9b8c8e1de545fdde36c74f774c
BLAKE2b-256 2b5ada837fca53b0513e59bb6228db937e02f15cf3b52637c619e4138b860bbd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page