Download the PHP package hugojf/csgo-server-api-laravel without Composer
On this page you can find all versions of the php package hugojf/csgo-server-api-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hugojf/csgo-server-api-laravel
More information about hugojf/csgo-server-api-laravel
Files in hugojf/csgo-server-api-laravel
Package csgo-server-api-laravel
Short Description A simple way to communicate with CS:GO servers.
License GPL-3.0-only
Informations about the package csgo-server-api-laravel
CS:GO Server API - Laravel package
Laravel package to interface CS:GO Server API.
How it works
This package interfaces my CS:GO API main endpoints:
/send
which you can send a command, with a delay to a single server;
/sendAll
which you can send a command, with a delay to all servers controlled by the API;
Requirements
-
PHP 7.*
- CS:GO Server API installation
Installation
Using Composer, run:
composer require hugojf/csgo-server-api-laravel
Publish config:
php artisan vendor:publish --provider="hugojf\CsgoServerApi\Providers\PackageServiceProvider"
Configuration
Any configuration can be modified inside configs/csgo-api.php
CSGO_API_URL=http://my-csgo-server-api.com/
API server endpoint URL.
CSGO_API_KEY=abcdef123456
API server authentication key.
Usage
Creating a command
Parameters
$command
is the command to be executed;$delay
tells how long the API should wait before sending the command;$wait
tells the API to wait for server response before responding the request.
Examples
Creating a server
Parameters
$address
is the full address or just IP;$port
is the server port.
Examples
Sending a list of commands to a list of servers
Broadcasting a list of commands to all servers controlled by the API
Different ways you can add commands or servers
In an attempt to avoid instantiating every server or command, you can use the following formats:
Servers
Commands
Changing summary class
You can change the way responses are grouped by passing a new Summary class
ByCommandSummary::class
Groups responses by command first and then server after.
ByServerSummary::class
Groups responses by server first and then command after.