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
- 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bgm_net-0.1.1.tar.gz.
File metadata
- Download URL: bgm_net-0.1.1.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c0420f48b8dee66299b3884ddfa50c058c0cb899782dfc40bd599fe84dfaf692
|
|
| MD5 |
e0e5437c7d4b5e5193b9d1e8753bdbf9
|
|
| BLAKE2b-256 |
bf8dbc4d0c13a407f3db0a368909f3b68c7317bd16974f79036b0baeef0a075d
|
File details
Details for the file bgm_net-0.1.1-py3-none-any.whl.
File metadata
- Download URL: bgm_net-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d7b7d463514d0f9d34e5a301a3325f9a4de56e64a17951945958b5141cd75606
|
|
| MD5 |
790700b6b508a7de872af41047e3f484
|
|
| BLAKE2b-256 |
d19999b32eae1ca986216822753469c8656bf1da1f0f484937da2392fa2df92a
|