Server Client Structure for Python
Project description
Python Multiplayer
Framework for Client Server Structure in Python. Is intended to be used for multiplayer games in pygame with this Module.
Planned features
- Command based Network
- Threaded Network
- Async Network
Installation
pip install python-multiplayer
Usage (Command Server/Client)
Server:
from py_mp import CommandServer
from py_mp import ServerSideServerCommand
from py_mp.commands import NetworkFlag
server = CommandServer("localhost", 5000)
server.accept()
# Receive a Command from the Client
com = server.recv(server.clients[0])
print(com)
# Send a Test Command back to the Client
server.send(
ServerSideServerCommand(NetworkFlag.CONNECTED, server.clients[0], test="test"),
server.clients[0]
)
Client:
from py_mp import CommandClient
from py_mp import ClientCommand
from py_mp.commands import NetworkFlag
client = CommandClient("localhost", 5000)
# Send a Test Command to the Server
client.send(ClientCommand(NetworkFlag.CONNECTED, test="test"))
# Receive a Command from the Server
com = client.recv()
print(com)
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
python_multiplayer-0.1.2.tar.gz
(13.3 kB
view details)
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 python_multiplayer-0.1.2.tar.gz.
File metadata
- Download URL: python_multiplayer-0.1.2.tar.gz
- Upload date:
- Size: 13.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.10.9 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
892fe5cdce0b54127ad819c5eb5e9732766f77cf017f5d6836eed0cf7a8153e6
|
|
| MD5 |
473ecf94f182eea3123e85ff1f50645f
|
|
| BLAKE2b-256 |
cf8db914324c7e45eaeb7c4b4a8c8887d840d7311674760eb2961ac3eded9ffd
|
File details
Details for the file python_multiplayer-0.1.2-py3-none-any.whl.
File metadata
- Download URL: python_multiplayer-0.1.2-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.10.9 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
24a656cf33ffa34667d2a2833ee13559cd520dc09b2d02db5b40b40596e0a349
|
|
| MD5 |
feaa38d0b9ff5e3840135c599fcc8827
|
|
| BLAKE2b-256 |
f217492355407874cb5694bd75d49ec5193c64c236b7217f71e064d266230e6e
|