Skip to main content

Server Client Structure for Python

Project description

Python Multiplayer

PyPI version

Framework for Client Server Structure in Python. Is intended to be used for multiplayer games in pygame with this Module.

pygame-multiplayer


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


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)

Uploaded Source

Built Distribution

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

python_multiplayer-0.1.2-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

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

Hashes for python_multiplayer-0.1.2.tar.gz
Algorithm Hash digest
SHA256 892fe5cdce0b54127ad819c5eb5e9732766f77cf017f5d6836eed0cf7a8153e6
MD5 473ecf94f182eea3123e85ff1f50645f
BLAKE2b-256 cf8db914324c7e45eaeb7c4b4a8c8887d840d7311674760eb2961ac3eded9ffd

See more details on using hashes here.

File details

Details for the file python_multiplayer-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for python_multiplayer-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 24a656cf33ffa34667d2a2833ee13559cd520dc09b2d02db5b40b40596e0a349
MD5 feaa38d0b9ff5e3840135c599fcc8827
BLAKE2b-256 f217492355407874cb5694bd75d49ec5193c64c236b7217f71e064d266230e6e

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