Commit 5ab431fd authored by Prophet731's avatar Prophet731

Updates

parent e79eeaa8
......@@ -11,7 +11,7 @@
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# http://www.gnu.org/licenses/.
#
# Last Updated: 5/18/19 1:06 PM
# Last Updated: 5/26/19 12:30 PM
# Filename: Kernel.php
# Project Version: 3.0
#############################################################################*/
......@@ -36,6 +36,7 @@ class Kernel extends ConsoleKernel
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
*
* @return void
*/
protected function schedule(Schedule $schedule)
......
......@@ -5,10 +5,10 @@
# Copyright 2014 A Different Kind, LLC.
#
# The BFACP is free software: You can redistribute it and/or modify it under the terms of the GNU
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. BFACP is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# http://www.gnu.org/licenses/.
#
# Last Updated: 5/18/19 1:06 PM
......
......@@ -5,13 +5,13 @@
# Copyright 2014 A Different Kind, LLC.
#
# The BFACP is free software: You can redistribute it and/or modify it under the terms of the GNU
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. BFACP is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# http://www.gnu.org/licenses/.
#
# Last Updated: 5/18/19 1:06 PM
# Last Updated: 5/26/19 12:30 PM
# Filename: Handler.php
# Project Version: 3.0
#############################################################################*/
......@@ -46,6 +46,7 @@ class Handler extends ExceptionHandler
* Report or log an exception.
*
* @param \Exception $exception
*
* @return void
*/
public function report(Exception $exception)
......@@ -58,6 +59,7 @@ class Handler extends ExceptionHandler
*
* @param \Illuminate\Http\Request $request
* @param \Exception $exception
*
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $exception)
......
<?php
/*##############################################################################
# BFACP - Battlefield Admin Control Panel for AdKats
#
# Copyright 2014 A Different Kind, LLC.
#
# The BFACP is free software: You can redistribute it and/or modify it under the terms of the GNU
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. BFACP is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# http://www.gnu.org/licenses/.
#
# Last Updated: 5/26/19 12:30 PM
# Filename: OverviewController.php
# Project Version: 3.0
#############################################################################*/
namespace BFACP\Http\Controllers\API\Battlefield\Server;
use BFACP\Http\Controllers\Controller;
use BFACP\Realm\Server;
use BFACP\Repositories\Battlefield\Rcon\RconRepository;
use Illuminate\Http\Request;
class OverviewController extends Controller
{
/**
* @var RconRepository
*/
protected $rcon;
/**
* OverviewController constructor.
*
* @param RconRepository $rcon
*/
public function __construct(RconRepository $rcon)
{
$this->rcon = $rcon;
}
/**
* Display a listing of the resource.
*
* @return array
* @throws \Throwable
*/
public function index()
{
$server = Server::findOrFail(1);
return $this->rcon->setServer($server)->getAll();
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
*
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
//
}
/**
* Display the specified resource.
*
* @param int $id
*
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
*
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
//
}
/**
* Remove the specified resource from storage.
*
* @param int $id
*
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
//
}
}
......@@ -5,10 +5,10 @@
# Copyright 2014 A Different Kind, LLC.
#
# The BFACP is free software: You can redistribute it and/or modify it under the terms of the GNU
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. BFACP is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# http://www.gnu.org/licenses/.
#
# Last Updated: 5/18/19 1:06 PM
......
......@@ -5,10 +5,10 @@
# Copyright 2014 A Different Kind, LLC.
#
# The BFACP is free software: You can redistribute it and/or modify it under the terms of the GNU
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. BFACP is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# http://www.gnu.org/licenses/.
#
# Last Updated: 5/18/19 1:06 PM
......
......@@ -5,13 +5,13 @@
# Copyright 2014 A Different Kind, LLC.
#
# The BFACP is free software: You can redistribute it and/or modify it under the terms of the GNU
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. BFACP is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# http://www.gnu.org/licenses/.
#
# Last Updated: 5/18/19 1:06 PM
# Last Updated: 5/26/19 12:30 PM
# Filename: RegisterController.php
# Project Version: 3.0
#############################################################################*/
......@@ -60,6 +60,7 @@ class RegisterController extends Controller
* Get a validator for an incoming registration request.
*
* @param array $data
*
* @return \Illuminate\Contracts\Validation\Validator
*/
protected function validator(array $data)
......@@ -75,6 +76,7 @@ class RegisterController extends Controller
* Create a new user instance after a valid registration.
*
* @param array $data
*
* @return \BFACP\User
*/
protected function create(array $data)
......
......@@ -5,10 +5,10 @@
# Copyright 2014 A Different Kind, LLC.
#
# The BFACP is free software: You can redistribute it and/or modify it under the terms of the GNU
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. BFACP is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# http://www.gnu.org/licenses/.
#
# Last Updated: 5/18/19 1:06 PM
......
......@@ -5,10 +5,10 @@
# Copyright 2014 A Different Kind, LLC.
#
# The BFACP is free software: You can redistribute it and/or modify it under the terms of the GNU
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. BFACP is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# http://www.gnu.org/licenses/.
#
# Last Updated: 5/18/19 1:06 PM
......
......@@ -5,13 +5,13 @@
# Copyright 2014 A Different Kind, LLC.
#
# The BFACP is free software: You can redistribute it and/or modify it under the terms of the GNU
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. BFACP is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# http://www.gnu.org/licenses/.
#
# Last Updated: 5/18/19 1:06 PM
# Last Updated: 5/26/19 12:30 PM
# Filename: Authenticate.php
# Project Version: 3.0
#############################################################################*/
......@@ -26,6 +26,7 @@ class Authenticate extends Middleware
* Get the path the user should be redirected to when they are not authenticated.
*
* @param \Illuminate\Http\Request $request
*
* @return string
*/
protected function redirectTo($request)
......
......@@ -5,10 +5,10 @@
# Copyright 2014 A Different Kind, LLC.
#
# The BFACP is free software: You can redistribute it and/or modify it under the terms of the GNU
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. BFACP is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# http://www.gnu.org/licenses/.
#
# Last Updated: 5/18/19 1:06 PM
......
......@@ -5,10 +5,10 @@
# Copyright 2014 A Different Kind, LLC.
#
# The BFACP is free software: You can redistribute it and/or modify it under the terms of the GNU
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. BFACP is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# http://www.gnu.org/licenses/.
#
# Last Updated: 5/18/19 1:06 PM
......
......@@ -5,13 +5,13 @@
# Copyright 2014 A Different Kind, LLC.
#
# The BFACP is free software: You can redistribute it and/or modify it under the terms of the GNU
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. BFACP is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# http://www.gnu.org/licenses/.
#
# Last Updated: 5/18/19 1:06 PM
# Last Updated: 5/26/19 12:30 PM
# Filename: RedirectIfAuthenticated.php
# Project Version: 3.0
#############################################################################*/
......@@ -29,6 +29,7 @@ class RedirectIfAuthenticated
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @param string|null $guard
*
* @return mixed
*/
public function handle($request, Closure $next, $guard = null)
......
......@@ -5,10 +5,10 @@
# Copyright 2014 A Different Kind, LLC.
#
# The BFACP is free software: You can redistribute it and/or modify it under the terms of the GNU
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. BFACP is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# http://www.gnu.org/licenses/.
#
# Last Updated: 5/18/19 1:06 PM
......
......@@ -5,10 +5,10 @@
# Copyright 2014 A Different Kind, LLC.
#
# The BFACP is free software: You can redistribute it and/or modify it under the terms of the GNU
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. BFACP is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# http://www.gnu.org/licenses/.
#
# Last Updated: 5/18/19 1:06 PM
......
......@@ -5,10 +5,10 @@
# Copyright 2014 A Different Kind, LLC.
#
# The BFACP is free software: You can redistribute it and/or modify it under the terms of the GNU
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. BFACP is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# http://www.gnu.org/licenses/.
#
# Last Updated: 5/18/19 1:06 PM
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -5,10 +5,10 @@
# Copyright 2014 A Different Kind, LLC.
#
# The BFACP is free software: You can redistribute it and/or modify it under the terms of the GNU
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. BFACP is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# http://www.gnu.org/licenses/.
#
# Last Updated: 5/18/19 1:06 PM
......
......@@ -5,10 +5,10 @@
# Copyright 2014 A Different Kind, LLC.
#
# The BFACP is free software: You can redistribute it and/or modify it under the terms of the GNU
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. BFACP is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# http://www.gnu.org/licenses/.
#
# Last Updated: 5/18/19 1:06 PM
......
......@@ -5,10 +5,10 @@
# Copyright 2014 A Different Kind, LLC.
#
# The BFACP is free software: You can redistribute it and/or modify it under the terms of the GNU
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. BFACP is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# http://www.gnu.org/licenses/.
#
# Last Updated: 5/18/19 1:06 PM
......
......@@ -5,10 +5,10 @@
# Copyright 2014 A Different Kind, LLC.
#
# The BFACP is free software: You can redistribute it and/or modify it under the terms of the GNU
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. BFACP is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# http://www.gnu.org/licenses/.
#
# Last Updated: 5/18/19 1:06 PM
......
......@@ -5,10 +5,10 @@
# Copyright 2014 A Different Kind, LLC.
#
# The BFACP is free software: You can redistribute it and/or modify it under the terms of the GNU
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. BFACP is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# http://www.gnu.org/licenses/.
#
# Last Updated: 5/18/19 1:06 PM
......
......@@ -5,10 +5,10 @@
# Copyright 2014 A Different Kind, LLC.
#
# The BFACP is free software: You can redistribute it and/or modify it under the terms of the GNU
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. BFACP is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# http://www.gnu.org/licenses/.
#
# Last Updated: 5/18/19 1:06 PM
......
......@@ -5,10 +5,10 @@
# Copyright 2014 A Different Kind, LLC.
#
# The BFACP is free software: You can redistribute it and/or modify it under the terms of the GNU
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. BFACP is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# http://www.gnu.org/licenses/.
#
# Last Updated: 5/18/19 1:06 PM
......
......@@ -5,10 +5,10 @@
# Copyright 2014 A Different Kind, LLC.
#
# The BFACP is free software: You can redistribute it and/or modify it under the terms of the GNU
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. BFACP is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# http://www.gnu.org/licenses/.
#
# Last Updated: 5/18/19 1:06 PM
......
......@@ -5,10 +5,10 @@
# Copyright 2014 A Different Kind, LLC.
#
# The BFACP is free software: You can redistribute it and/or modify it under the terms of the GNU
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. BFACP is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# http://www.gnu.org/licenses/.
#
# Last Updated: 5/18/19 1:06 PM
......
......@@ -5,10 +5,10 @@
# Copyright 2014 A Different Kind, LLC.
#
# The BFACP is free software: You can redistribute it and/or modify it under the terms of the GNU
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. BFACP is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# http://www.gnu.org/licenses/.
#
# Last Updated: 5/18/19 1:06 PM
......
......@@ -5,10 +5,10 @@
# Copyright 2014 A Different Kind, LLC.
#
# The BFACP is free software: You can redistribute it and/or modify it under the terms of the GNU
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. BFACP is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# http://www.gnu.org/licenses/.
#
# Last Updated: 5/18/19 1:06 PM
......
......@@ -5,10 +5,10 @@
# Copyright 2014 A Different Kind, LLC.
#
# The BFACP is free software: You can redistribute it and/or modify it under the terms of the GNU
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. BFACP is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# http://www.gnu.org/licenses/.
#
# Last Updated: 5/18/19 1:06 PM
......
<?php
/*##############################################################################
# BFACP - Battlefield Admin Control Panel for AdKats
#
# Copyright 2014 A Different Kind, LLC.
#
# The BFACP is free software: You can redistribute it and/or modify it under the terms of the GNU
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. BFACP is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# http://www.gnu.org/licenses/.
#
# Last Updated: 5/26/19 9:09 AM
# Filename: BackendServiceProvider.php
# Project Version: 3.0
#############################################################################*/
namespace BFACP\Repositories;
use BFACP\Repositories\Battlefield\Rcon\RconRepository;
use Illuminate\Support\ServiceProvider;
class BackendServiceProvider extends ServiceProvider
{
public function register()
{
$this->app->bind(
RconRepository::class
);
}
}
\ No newline at end of file
<?php
/*##############################################################################
# BFACP - Battlefield Admin Control Panel for AdKats
#
# Copyright 2014 A Different Kind, LLC.
#
# The BFACP is free software: You can redistribute it and/or modify it under the terms of the GNU
# General Public License as published by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. BFACP is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details. To view this license, visit
# http://www.gnu.org/licenses/.
#
# Last Updated: 5/26/19 12:30 PM
# Filename: RconRepository.php
# Project Version: 3.0
#############################################################################*/
namespace BFACP\Repositories\Battlefield\Rcon;
use BFACP\Exceptions\RconConnectionException;
use BFACP\Libraries\BattlefieldConn;
use BFACP\Realm\Server;
/**
* Class RconRepository
* @package BFACP\Repositories\Battlefield\Rcon
*/
class RconRepository
{
/**
* @var BattlefieldConn
*/
private $rcon;
/**
* @var array
*/
private $dataset = [];
/**
* @var Server
*/
private $server;
/**
* @param Server $server
*
* @return RconRepository
* @throws \Throwable
*/
public function setServer(Server $server): RconRepository
{
$this->server = $server;
$this->initConnection();
return $this;
}
/**
* @throws RconConnectionException
* @throws \Throwable
*/
private function initConnection()
{
$this->rcon = new BattlefieldConn($this->server, true);
/**
* Temporary code until testing is done.
*/
$this->rcon->loginSecure(env('BFACP_RCON'));
throw_unless($this->rcon->isLoggedIn(), RconConnectionException::class);
}
/**
* @return BattlefieldConn
*/
public function getRcon(): BattlefieldConn
{
return $this->rcon;
}
/**
*
*/
public function getAll(): array
{
return [
'server' => $this->getServerInfo(),
'playerlist' => $this->getPlayerlist(),
];
}
/**
* @return array
* @throws \Throwable
*/
public function getServerInfo(): array
{
return [
'obj' => $this->server,
'rcon' => $this->rcon->getServerInfo(),
];
}
/**
* @return int
* @throws \Throwable
*/
public function getPlayerlist(): array
{
return $this->rcon->listPlayers();
}
}
\ No newline at end of file
......@@ -16,3 +16,9 @@ use Illuminate\Http\Request;
Route::middleware('auth:api')->get('/user', function (Request $request) {
return $request->user();
});
Route::group(['namespace' => 'API\Battlefield'], function () {
Route::group(['namespace' => 'Server', 'prefix' => 'battlefield'], function () {
Route::apiResource('rcon', 'OverviewController');
});
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment