marioz2002 / fm-steamcondenser-bundle
Symfony SteamcondenserBundle
Requires
- php: >=5.3.3
- koraktor/steam-condenser: master
- sensio/framework-extra-bundle: *@dev
- symfony/symfony: ~2.4
- symfony/twig-bundle: ~2.0
Requires (Dev)
This package is not auto-updated.
Last update: 2024-10-02 08:21:26 UTC
README
将一些 Steam[http://steampowered.com] 添加到您的 Symfony 2 项目中!
此包允许您查询游戏服务器,获取有关玩家/Steam用户的信息,获取服务器信息,例如当前玩家列表等。包依赖于 Steam Condenser 库,由 Sebastian Staudt 提供
此包的状态为 WIP(进行中)
安装
要安装此包,您需要 Steam Condenser 和此包。
步骤 1:安装
使用 Composer,只需将以下配置添加到您的 composer.json
{ "require": { "helios-ag/fm-steamcondenser-bundle": "dev-master" } }
现在运行以下命令让 composer 下载包
$ php composer.phar update helios-ag/fm-steamcondenser-bundle
步骤 2:启用包
最后,在 kernel 中启用该包
<?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new FM\SteamcondenserBundle\FMSteamcondenserBundle(), ); }
配置
在使用此包之前,您需要配置包
fm_steamcondenser: server_list: my_server: address: 127.0.0.1 port: 27015 password: passw0rd source: true
在 server_list 节点下,您可以定义多个服务器。每个服务器都有一个地址 - 服务器的 IP 地址和端口号。密码字段用于设置 Rcon(远程控制台)密码。Source 选项,定义服务器是否使用基于源的游戏引擎(如 Team Fortress 2、Half-Life 2、CS:S 等游戏,但不包括 Half-Life 1、CS 1.6)
##命令行工具
包提供一些有用的 CLI 命令,用于调查服务器、获取关于 Steam 用户的信息等。
Rcon 命令
php app/console steam:rcon [server] [command]
向服务器发送 rcon 命令,语法为 [server] - 服务器别名(在配置中定义),例如 "my_server" [command] - 要发送的命令
服务器信息命令
php app/console steam:serverinfo [server] --ip [ip] --port [port] --showplayers
显示服务器信息,如服务器名称、游戏、当前玩家列表、ping。参数:[server] - 配置中定义的服务器别名
可选参数:--ip 和 --port 选项可用于通过 CLI 显式定义服务器(在这种情况下,您省略服务器别名)--showplayers - 显示服务器上的当前玩家
用户信息命令
php app/console steam:userinfo [username/steamID]
接受 Steam ID(64 位唯一数字)或 Steam 用户名
显示用户名和可用游戏列表。还显示用户的当前昵称和在线状态。
服务器列表命令
php app/console steam:serverlist
显示通过 config.yml 定义的已定义服务器列表
##服务
进行中
##Twig 扩展
目前有两个 twig 扩展(实际上是小部件)
{{steam_server(ip,port,source)}}
显示服务器信息。列出当前玩家等。参数:ip - 服务器 IP 地址 port - 服务器端口 source - true 或 false,如果为基于源的服务器则为 true,否则为 false
{{steam_user(steamID || steam name,showgames)}}
显示 STEAM 用户信息。头像和游戏。提供用户个人资料链接。接受 steamID 或 steam 昵称。参数:showgames - boolean(true||false),指定是否显示用户所属的游戏列表。
#翻译
目前支持两种语言:英语和俄语,欢迎贡献力量。