PHPackages                             dsg/beyondthewire-rcon-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. dsg/beyondthewire-rcon-php

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

dsg/beyondthewire-rcon-php
==========================

Squad Server RCon library

00PHP

Since Dec 19Pushed 5y ago1 watchersCompare

[ Source](https://github.com/Deutsche-Squad-Gemeinschaft/BeyondTheWire-RCON-PHP)[ Packagist](https://packagist.org/packages/dsg/beyondthewire-rcon-php)[ RSS](/packages/dsg-beyondthewire-rcon-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

 [![Beyond the Wire RCON PHP Logo](https://raw.githubusercontent.com/Deutsche-Squad-Gemeinschaft/BeyondTheWire-RCON-PHP/master/logo.svg)](https://raw.githubusercontent.com/Deutsche-Squad-Gemeinschaft/BeyondTheWire-RCON-PHP/master/logo.svg)

Beyond the Wire RCON PHP
========================

[](#beyond-the-wire-rcon-php)

 **RCON PHP wrapper for Beyond the Wire server management**

---

 [ ![Deutsche Squad Gemeinschaft](https://github.com/Deutsche-Squad-Gemeinschaft/BeyondTheWire-RCON-PHP/workflows/CI/badge.svg) ](https://github.com/Deutsche-Squad-Gemeinschaft/BeyondTheWire-RCON-PHP/actions) [ ![Deutsche Squad Gemeinschaft](https://camo.githubusercontent.com/436c9eca4dee1ccce3f75786f920ddb01b334804aa2f41d7e8bb147e5154d437/68747470733a2f2f636f6465636f762e696f2f67682f44657574736368652d53717561642d47656d65696e7363686166742f4265796f6e64546865576972652d52434f4e2d5048502f6272616e63682f6d61737465722f67726170682f62616467652e737667) ](https://codecov.io/gh/Deutsche-Squad-Gemeinschaft/BeyondTheWire-RCON-PHP) [ ![Total Downloads](https://camo.githubusercontent.com/d7e51a461244ad73166e02d2ba2dce2562b1b4759a687a14e921ad1b2e7837b4/68747470733a2f2f706f7365722e707567782e6f72672f6473672f6265796f6e64746865776972652d72636f6e2d7068702f646f776e6c6f6164732e706e67) ](https://packagist.org/packages/dsg/beyondthewire-rcon-php) [ ![Latest Stable Version](https://camo.githubusercontent.com/6b4b99ff69c059838359315c3c6f1eb854e39fa013a9e588e1f002a8b9bbb924/68747470733a2f2f706f7365722e707567782e6f72672f6473672f6265796f6e64746865776972652d72636f6e2d7068702f762f737461626c65) ](https://packagist.org/packages/dsg/beyondthewire-rcon-php) [ ![Latest Unstable Version](https://camo.githubusercontent.com/042283ca10c9344a0ea522b21d507a9bfe2b77933e9c04aa14ba009e632e70de/68747470733a2f2f706f7365722e707567782e6f72672f6473672f6265796f6e64746865776972652d72636f6e2d7068702f762f756e737461626c65) ](https://packagist.org/packages/dsg/beyondthewire-rcon-php) [ ![License](https://camo.githubusercontent.com/ff5432c97f857aea0fa61e6bfa32298751e08e0464f172328245462cafd81246/68747470733a2f2f706f7365722e707567782e6f72672f6473672f6265796f6e64746865776972652d72636f6e2d7068702f6c6963656e7365) ](https://packagist.org/packages/dsg/beyondthewire-rcon-php)
 [ ![Deutsche Squad Gemeinschaft](https://raw.githubusercontent.com/Deutsche-Squad-Gemeinschaft/battlemetrics-php/master/dsg-badge.svg) ](https://dsg-gaming.de) [ ![Discord](https://camo.githubusercontent.com/72a9c5ed48d13e8627ab2fd07e55bb22f6423fb3186c0f875f43765656c8a169/68747470733a2f2f696d672e736869656c64732e696f2f646973636f72642f3236363231303232333430363937323932382e7376673f7374796c653d666c61742d737175617265266c6f676f3d646973636f7264) ](https://discord.gg/9F2Ng5C)

Join the Squad RCON Community
-----------------------------

[](#join-the-squad-rcon-community)

If you have any questions or need help with getting started with RCON in OWI games you should make sure to join the [Squad RCON Community on Discord](https://discord.gg/9F2Ng5C).

Installation
------------

[](#installation)

You can install this package by using composer and the following command:

```
composer require dsg/beyondthewire-rcon-php

```

The code will then be available under the `DSG\BeyondTheWireRCON` namespace.

Commands
--------

[](#commands)

- ListPlayers
- ListSquads
- AdminListDisconnectedPlayers
- ShowNextMap
- AdminKick "&lt;NameOrSteamId&gt;" &lt;KickReason&gt;
- AdminKickById &lt;PlayerId&gt; &lt;KickReason&gt;
- AdminBan "&lt;NameOrSteamId&gt;" "&lt;BanLength&gt;" &lt;BanReason&gt;
- AdminBanById &lt;PlayerId&gt; "&lt;BanLength&gt;" &lt;BanReason&gt;
- AdminBroadcast &lt;Message&gt;
- AdminRestartMatch
- AdminEndMatch
- AdminChangeMap &lt;MapName&gt;
- AdminSetNextMap &lt;MapName&gt;
- AdminSetMaxNumPlayers &lt;NumPlayers&gt;
- AdminSetServerPassword &lt;Password&gt;
- AdminSlomo &lt;TimeDilation&gt;
- AdminForceTeamChange &lt;NameOrSteamId&gt;
- AdminForceTeamChangeById &lt;PlayerId&gt;
- AdminDemoteCommander &lt;PlayerName&gt;
- AdminDemoteCommanderById &lt;PlayerId&gt;
- AdminDisbandSquad &lt;TeamId&gt; &lt;SquadId&gt;
- AdminRemovePlayerFromSquad &lt;PlayerName&gt;
- AdminRemovePlayerFromSquadById &lt;PlayerId&gt;
- AdminWarn &lt;NameOrSteamId&gt; &lt;WarnReason&gt;
- AdminWarnById &lt;PlayerId&gt; &lt;WarnReason&gt;

USAGE
-----

[](#usage)

### Create an instance

[](#create-an-instance)

Instanciate the BeyondTheWireServer class to open a new RCON connection. This will throw an Exception if no connection can be made.

```
use DSG\BeyondTheWireRCON\BeyondTheWireServer;

...

/** @var BeyondTheWireServer */
$server = new BeyondTheWireServer(new ServerConnectionInfo('127.0.0.1', 21114, 'YourRconPassword'));
```

### Get current server population (Teams, Squads, Players)

[](#get-current-server-population-teams-squads-players)

Get the current population. This does use ListPlayers &amp; ListSquads to get the Teams, Squads and Players properly ordered.

```
/** @var Population */
$population = $server->serverPopulation();

/** @var Team[] */
$teams = $population->getTeams();

// or

/** @var Player[] */
$players = $population->getPlayers();

// or

/** @var Player|null */
$player = $population->getPlayerBySteamId('76561197960287930');
```

### ListPlayers

[](#listplayers)

Get the current Player list using the ListPlayers command. This does not include disconnected players.

```
/** @var Player[] */
$players = $server->listPlayers();
```

### Get disconnected Players

[](#get-disconnected-players)

Get disconnected players using the ListPlayers command.

```
/** @var Player[] */
$players = $server->listDisconnectedPlayers();
```

### ListSquads

[](#listsquads)

Get currently active squads (and teams)

```
/** @var Team[] */
$teams = $server->listSquads();
```

### AdminKick

[](#adminkick)

Kick a player by name, SteamId or ingame id.

```
/** @var bool */
$success = $server->adminKick('76561197960287930', 'Reason');

// or

/** @var bool */
$success = $server->adminKickById($player->getId(), 'Reason');
```

### AdminBan

[](#adminban)

Ban a player by name, SteamId or ingame id.

```
/** @var bool */
$success = $server->adminBan('76561197960287930', '1h', 'Reason');

// or

/** @var bool */
$success = $server->adminBanById($player->getId(), '1h', 'Reason');
```

### Get the current map

[](#get-the-current-map)

Get the current map using the ShowNextMap command

```
/** @var string */
$map = $server->currentMap();
```

### Get the next map

[](#get-the-next-map)

Get the next map using the ShowNextMap command

```
/** @var string */
$map = $server->nextMap();
```

### AdminRestartMatch

[](#adminrestartmatch)

Restart the current match

```
/** @var bool */
$success = $server->adminRestartMatch();
```

### AdminEndMatch

[](#adminendmatch)

End the current match

```
/** @var bool */
$success = $server->adminEndMatch();
```

### AdminBroadcast

[](#adminbroadcast)

Broadcast message to all players on the server

```
/** @var bool */
$success = $server->adminBroadcast('Hello from the other side');
```

### AdminChangeMap

[](#adminchangemap)

Set the next map and end the current game immediately.

```
/** @var bool */
$success = $server->adminChangeMap('Sumari AAS v1');
```

### AdminSetNextMap

[](#adminsetnextmap)

Sets next map

```
/** @var bool */
$success = $server->adminSetNextMap('Sumari AAS v1');
```

### AdminSetMaxNumPlayers

[](#adminsetmaxnumplayers)

Set the maximum amount of players / slots

```
/** @var bool */
$success = $server->adminSetMaxNumPlayers(80);
```

### AdminSetServerPassword

[](#adminsetserverpassword)

Set the server password

```
/** @var bool */
$success = $server->adminSetServerPassword('secret');
```

### AdminSlomo

[](#adminslomo)

Sets the game speed with the AdminSlomo. Default 1.0

```
/** @var bool */
$success = $server->adminSlomo(1.5);
```

### AdminForceTeamChange

[](#adminforceteamchange)

Forces a player to the opposite team by providing the name or steamid.

```
/** @var bool */
$success = $server->adminForceTeamChange('Name or SteamId');
```

### AdminForceTeamChangeById

[](#adminforceteamchangebyid)

Forces a player to the opposite team by providing the ingame Player id.

```
/** @var bool */
$success = $server->adminForceTeamChangeById($player->getId());
```

### AdminDisbandSquad command.

[](#admindisbandsquad-command)

Disbands a Squad by providing the Team id / index &amp; Squad id / index.

```
/** @var bool */
$success = $server->adminDisbandSquad($team->getId(), $squad->getId());
```

### AdminRemovePlayerFromSquad

[](#adminremoveplayerfromsquad)

Removes a Player from his Squad by providing the Player name.

```
/** @var bool */
$success = $server->adminRemovePlayerFromSquad('Name');
```

### AdminRemovePlayerFromSquadById

[](#adminremoveplayerfromsquadbyid)

Removes a player from his Squad by providing the ingame Player id.

```
/** @var bool */
$success = $server->adminRemovePlayerFromSquadById($player->getId());
```

### AdminWarn

[](#adminwarn)

Warns a Player by providing his name / steamid and a message.

```
/** @var bool */
$success = $server->adminWarn('Name or SteamId', 'Warn Reason');
```

### AdminWarnById

[](#adminwarnbyid)

Warns a Player by id.

```
/** @var bool */
$success = $server->adminWarnById($player->getId(), 'Warn Reason');
```

Important Note
--------------

[](#important-note)

Make sure to always close the connection manually or trigger a disconnect by destructing the object to preventt blocking the RCON server by using up it'S available connections.

```
$server->disconnect();
// Or
unset($server);
```

Special Thanks
--------------

[](#special-thanks)

- [SquadSlovenia](https://github.com/SquadSlovenia) (Intial creators)
- [Brozowski](https://github.com/Brozowski) (Major contributor)
- \[ToG\] subtlerod (Major contributions to the used SquadRcon implementation)
- [Thomas Smyth](https://github.com/Thomas-Smyth/SquadJS) (Creator of SquadJS, a great resource for Squad RCON).

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity31

Early-stage or recently created project

 Bus Factor1

Top contributor holds 70.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/509a5baf8d7d8f7ae8c5b569ee81b1d04ed6af1af625696777e51e997ff9a685?d=identicon)[bumbummen99](/maintainers/bumbummen99)

---

Top Contributors

[![bumbummen99](https://avatars.githubusercontent.com/u/4533331?v=4)](https://github.com/bumbummen99 "bumbummen99 (19 commits)")[![SquadSlovenia](https://avatars.githubusercontent.com/u/23271091?v=4)](https://github.com/SquadSlovenia "SquadSlovenia (6 commits)")[![Brozowski](https://avatars.githubusercontent.com/u/15922579?v=4)](https://github.com/Brozowski "Brozowski (2 commits)")

### Embed Badge

![Health badge](/badges/dsg-beyondthewire-rcon-php/health.svg)

```
[![Health](https://phpackages.com/badges/dsg-beyondthewire-rcon-php/health.svg)](https://phpackages.com/packages/dsg-beyondthewire-rcon-php)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
