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
- Connect packet
CONNECT|[From ip]|[To ip]|[From port]|[To port]
- Disconnect packet
DISCONNECT|[From ip]|[To ip]
Other packets are made by user.
Functions
Server
- Recive event - runs function everytime server recives message. Can be used as decorator
BGM_Server.recive_event(callback: Callable (data: Tuple, address: Tuple) )
- Connect event - runs function everytime server recives connection. Can be used as decorator
BGM_Server.connect_event(callback: Callable (address: Tuple) )
- Disconnect event - runs function everytime server recives disconnection. Can be used as decorator
BGM_Server.disconnect_event(callback: Callable (address: Tuple) )
- Start server - Starts server on defined ip and port
BGM_Server.start_server()
- Broadcast - Sends a same packet to everyone
BGM_Server.broadcast(message: Bytes)
- Constructor - Construct packet with data given and type.
Packets.Constructor(data: Dict, type: String)
- Deconstructor - Deconstructs packet given in arg.
Packets.Deconstructor(message: Str)
Client
- Connect - Connects to server with given information
BGM_Client.connect(ip: Str, port: Int)
- Send - Send packet to connected server with given information.
BGM_Client.send(data: Dict, packet: Str)
- 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)
- Disconnect - Disconnects you from connected server
BGM_Client.disconnect()
- Constructor - Construct packet with data given and type.
Packets.Constructor(data: Dict, type: String)
- Deconstructor - Deconstructs packet given in arg.
Packets.Deconstructor(message: Str)
- Disconnect - Returns constructed packet for disconnect
Packets.disconnect(fromip: Str, toip: Str)
- 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)
| File | Size | Uploaded | |
|---|---|---|---|
| bgm_net-0.1.1.tar.gz | 3.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|