QuakeLiveInterface
1.0.0
Quake Live接口是一个Python库,旨在为地震实时游戏服务器提供程序化接口。图书馆的主要组成部分是:
ServerConnection :管理TCP/IP连接到Quake Live服务器的类。它将命令发送到服务器并从服务器接收数据包。
GameState :将数据包从服务器解析为更容易访问的格式的类。游戏状态包括有关玩家位置,其他实体的位置以及其他游戏状态信息的信息。
QuakeLiveClient :一个封装连接到服务器的连接以及游戏状态数据的解释的类。它提供了一个直观的接口,供用户与游戏进行交互。
该项目将诗歌用于包装管理。
$ poetry install创建与Quake Live服务器的连接:
from QuakeLiveInterface . connection import ServerConnection
connection = ServerConnection ( server_ip , server_port )
connection . connect ()将命令发送到服务器:
connection . send_command ( "some_command" )创建地震实时客户端并解释游戏状态数据:
from QuakeLiveInterface . client import QuakeLiveClient
client = QuakeLiveClient ( server_ip , server_port )
client . connect ()
game_state = client . get_game_state ()进行测试:
$ poetry run pytest