Skip to main content

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 (data: Tuple, address: Tuple) ) 
  1. Connect event - runs function everytime server recives connection. Can be used as decorator
BGM_Server.connect_event(callback: Callable (address: Tuple) )
  1. Disconnect event - runs function everytime server recives disconnection. Can be used as decorator
BGM_Server.disconnect_event(callback: Callable (address: Tuple) )
  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

Release files for bgm-net 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bgm-net 0.1.1
File Size Uploaded
bgm_net-0.1.1.tar.gz 3.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bgm-net 0.1.1
File Interpreter ABI Platform
bgm_net-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 7.4 kB

Release files / bgm_net-0.1.1.tar.gz

Download URL bgm_net-0.1.1.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c0420f48b8dee66299b3884ddfa50c058c0cb899782dfc40bd599fe84dfaf692
BLAKE2b-256 checksum
How to use checksums
bf8dbc4d0c13a407f3db0a368909f3b68c7317bd16974f79036b0baeef0a075d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.1

Release files / bgm_net-0.1.1-py3-none-any.whl

Download URL bgm_net-0.1.1-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d7b7d463514d0f9d34e5a301a3325f9a4de56e64a17951945958b5141cd75606
BLAKE2b-256 checksum
How to use checksums
d19999b32eae1ca986216822753469c8656bf1da1f0f484937da2392fa2df92a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.1

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page