定制 xety/laravel-rcon 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

xety/laravel-rcon

Composer 安装命令:

composer require xety/laravel-rcon

包简介

Source RCON Protocol Service Provider for Laravel

README 文档

README

This package is developed to provide Laravel Framework service allowing you to work with source RCON protocol. You can read more protocol specification on this page: https://developer.valvesoftware.com/wiki/Source_RCON_Protocol

Installation

  1. Install composer package using command:
composer require lukasz-adamski/laravel-rcon
  1. Add Service Provider in config/app.php:
Adams\Rcon\RconServiceProvider::class,
  1. Add Facade in config/app.php:
'Rcon' => Adams\Rcon\Facades\Facade::class,
  1. Publish configuration file to your project:
php artisan vendor:publish --provider="Adams\Rcon\RconServiceProvider"

Environment

You can setup environment variables to establish default RCON connection.

  • RCON_CONNECTION - default RCON connection name stored in config/rcon.php,
  • RCON_HOST - RCON server hostname,
  • RCON_PORT - RCON server listening port,
  • RCON_PASSWORD - passphrase used to authorize connection, you can use null to skip authorization,
  • RCON_TIMEOUT - RCON server connection timeout.

Testing

To run predefined test set use:

php vendor/bin/phpunit

Usage

Below you have example controller implementation:

<?php

namespace App\Http\Controllers;

use Rcon;
use App\Http\Controllers\Controller;

class SimpleRconController extends Controller
{
    /**
     * Execute status command on default RCON server.
     *
     * @return Response
     */
    public function defaultStatus()
    {
        $response = Rcon::command('status');

        return view('console', compact('response'));
    }

    /**
     * Execute status command on specified RCON connection.
     *
     * @return Response
     */
    public function gameServerStatus()
    {
        $response = Rcon::connection('game_server')
            ->command('status');

        return view('console', compact('response'));
    }
}

统计信息

  • 总下载量: 11
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-08-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固