Skip to content
This repository has been archived by the owner on Nov 20, 2022. It is now read-only.

Commit

Permalink
Merge branch 'develop' of github.com:Prophet731/BFAdminCP into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Prophet731 committed May 9, 2016
2 parents 9b45721 + 3464308 commit 1e9b8df
Show file tree
Hide file tree
Showing 30 changed files with 151 additions and 33 deletions.
62 changes: 35 additions & 27 deletions app/bfacp/Adkats/Setting.php
Original file line number Diff line number Diff line change
@@ -1,53 +1,58 @@
<?php namespace BFACP\Adkats;
<?php

namespace BFACP\Adkats;

use BFACP\Elegant;

/**
* Class Setting.
*/
class Setting extends Elegant
{
/**
* Should model handle timestamps
* Should model handle timestamps.
*
* @var boolean
* @var bool
*/
public $timestamps = false;

/**
* Table name
* Table name.
*
* @var string
*/
protected $table = 'adkats_settings';

/**
* Table primary key
* Table primary key.
*
* @var string
*/
protected $primaryKey = 'server_id';

/**
* Fields not allowed to be mass assigned
* Fields not allowed to be mass assigned.
*
* @var array
*/
protected $fillable = ['setting_value'];

/**
* Date fields to convert to carbon instances
* Date fields to convert to carbon instances.
*
* @var array
*/
protected $dates = [];

/**
* Append custom attributes to output
* Append custom attributes to output.
*
* @var array
*/
protected $appends = [];

/**
* Models to be loaded automatically
* Models to be loaded automatically.
*
* @var array
*/
Expand All @@ -58,14 +63,14 @@ class Setting extends Elegant
*/
public function server()
{
return $this->belongsTo('BFACP\Battlefield\Server\Server', 'server_id');
return $this->belongsTo(\BFACP\Battlefield\Server\Server::class, 'server_id');
}

/**
* Quick way of selecting specific commands
* Quick way of selecting specific commands.
*
* @param $query
* @param array|string $names Command Names
* @param $query
* @param array|string $names Command Names
*
* @return
*/
Expand All @@ -79,10 +84,10 @@ public function scopeSettings($query, $names)
}

/**
* Quick way of selecting servers
* Quick way of selecting servers.
*
* @param $query
* @param array $ids Array of server ids
* @param $query
* @param array $ids Array of server ids
*
* @return
*/
Expand All @@ -96,23 +101,22 @@ public function scopeServers($query, $ids)
}

/**
* Convert value to correct type
* Convert value to correct type.
*
* @return mixed
*/
public function getSettingValueAttribute()
{
$value = $this->attributes['setting_value'];
$settingName = $this->attributes['setting_name'];

if (!array_key_exists('setting_name',
$this->attributes) || $this->attributes['setting_name'] == 'Custom HTML Addition'
) {
if (! array_key_exists('setting_name', $this->attributes) || $settingName == 'Custom HTML Addition') {
return $value;
}

switch ($this->setting_type) {
case 'multiline':
if (in_array($this->attributes['setting_name'], [
if (in_array($settingName, [
'Pre-Message List',
'Server Rule List',
'SpamBot Say List',
Expand All @@ -121,12 +125,12 @@ public function getSettingValueAttribute()
$value = rawurldecode(urldecode($value));
}

$valueArray = explode('|', $value);

if (count($valueArray) == 1) {
return head($valueArray);
if (strlen($value) == 0) {
return $value;
}

$valueArray = explode('|', $value);

return $valueArray;
break;

Expand All @@ -135,11 +139,15 @@ public function getSettingValueAttribute()
break;

case 'int':
return (int)$value;
return (int) $value;
break;

case 'double':
return (float)$value;
return (float) $value;
break;

case 'stringarray':
return explode('|', $value);
break;

default:
Expand Down
14 changes: 12 additions & 2 deletions app/bfacp/Repositories/Scoreboard/LiveServerRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ private function serverinfo()
}

if ($this->isLoggedIn) {
$presetMessages = Setting::servers($this->serverID)->settings('Pre-Message List')->first()->setting_value;
$presetMessages = Setting::servers($this->serverID)->settings('Pre-Message List')->first();
}

$_playmode = $this->client->getPlaymodeName($info[4]);
Expand Down Expand Up @@ -388,7 +388,15 @@ private function serverinfo()

$this->setFactions();

$this->data['_presetmessages'] = isset($presetMessages) ? [''] + $presetMessages : [];
if (isset($presetMessages)) {
if (is_array($presetMessages->setting_value)) {
$this->data['_presetmessages'] = array_merge([''], $presetMessages->setting_value);
} else {
$this->data['_presetmessages'][0] = $presetMessages->setting_value;
}
} else {
$this->data['_presetmessages'] = [];
}

$this->data['_teams'] = [
[
Expand Down Expand Up @@ -494,6 +502,8 @@ private function setFactions()
} elseif ($this->data['server']['mode']['uri'] == 'RushLarge0') {
$this->TEAM1 = $teamFactions[0][4];
$this->TEAM2 = $teamFactions[0][5];
$this->TEAM3 = $teamFactions[0][4];
$this->TEAM4 = $teamFactions[0][5];
} else {
if ($this->gameName == 'BF3') {
$this->TEAM0 = $teamFactions[0][0];
Expand Down
89 changes: 89 additions & 0 deletions app/bfacp/ThirdParty/BFHL/mapNames.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@
<map uri="xp2_precinct7" name="Precinct" playmode="TurfWarLarge0"/>
<map uri="xp25_bank" name="Night Job" playmode="TurfWarLarge0"/>
<map uri="xp25_sawmill" name="Night Woods" playmode="TurfWarLarge0"/>
<map uri="xp3_border" name="Double Cross" playmode="TurfWarLarge0"/>
<map uri="xp3_cistern02" name="Diversion" playmode="TurfWarLarge0"/>
<map uri="xp3_highway" name="Pacific Highway" playmode="TurfWarLarge0"/>
<map uri="xp3_traindodge" name="Train Dodge" playmode="TurfWarLarge0"/>
<map uri="xp4_alcatraz" name="Alcatraz" playmode="TurfWarLarge0"/>
<map uri="xp4_cemetery" name="Cementry" playmode="TurfWarLarge0"/>
<map uri="xp4_chinatown" name="Chinatown" playmode="TurfWarLarge0"/>
<map uri="xp4_snowcrash" name="Thin Ice" playmode="TurfWarLarge0"/>

<!-- Small Conquest Maps -->
<map uri="MP_Bank" name="Bank Job" playmode="TurfWarSmall0"/>
Expand All @@ -40,6 +48,14 @@
<map uri="xp2_precinct7" name="Precinct" playmode="TurfWarSmall0"/>
<map uri="xp25_bank" name="Night Job" playmode="TurfWarSmall0"/>
<map uri="xp25_sawmill" name="Night Woods" playmode="TurfWarSmall0"/>
<map uri="xp3_border" name="Double Cross" playmode="TurfWarSmall0"/>
<map uri="xp3_cistern02" name="Diversion" playmode="TurfWarSmall0"/>
<map uri="xp3_highway" name="Pacific Highway" playmode="TurfWarSmall0"/>
<map uri="xp3_traindodge" name="Train Dodge" playmode="TurfWarSmall0"/>
<map uri="xp4_alcatraz" name="Alcatraz" playmode="TurfWarSmall0"/>
<map uri="xp4_cemetery" name="Cementry" playmode="TurfWarSmall0"/>
<map uri="xp4_chinatown" name="Chinatown" playmode="TurfWarSmall0"/>
<map uri="xp4_snowcrash" name="Thin Ice" playmode="TurfWarSmall0"/>

<!-- Hiest Maps -->
<map uri="MP_Bank" name="Bank Job" playmode="Heist0"/>
Expand All @@ -61,6 +77,14 @@
<map uri="xp2_precinct7" name="Precinct" playmode="Heist0"/>
<map uri="xp25_bank" name="Night Job" playmode="Heist0"/>
<map uri="xp25_sawmill" name="Night Woods" playmode="Heist0"/>
<map uri="xp3_border" name="Double Cross" playmode="Heist0"/>
<map uri="xp3_cistern02" name="Diversion" playmode="Heist0"/>
<map uri="xp3_highway" name="Pacific Highway" playmode="Heist0"/>
<map uri="xp3_traindodge" name="Train Dodge" playmode="Heist0"/>
<map uri="xp4_alcatraz" name="Alcatraz" playmode="Heist0"/>
<map uri="xp4_cemetery" name="Cementry" playmode="Heist0"/>
<map uri="xp4_chinatown" name="Chinatown" playmode="Heist0"/>
<map uri="xp4_snowcrash" name="Thin Ice" playmode="Heist0"/>

<!-- Hotwire Maps -->
<map uri="MP_Desert05" name="Dust Bowl" playmode="Hotwire0"/>
Expand All @@ -74,6 +98,11 @@
<map uri="xp2_precinct7" name="Precinct" playmode="Hotwire0"/>
<map uri="xp25_bank" name="Night Job" playmode="Hotwire0"/>
<map uri="xp25_sawmill" name="Night Woods" playmode="Hotwire0"/>
<map uri="xp3_border" name="Double Cross" playmode="Hotwire0"/>
<map uri="xp3_highway" name="Pacific Highway" playmode="Hotwire0"/>
<map uri="xp3_traindodge" name="Train Dodge" playmode="Hotwire0"/>
<map uri="xp4_cemetery" name="Cementry" playmode="Hotwire0"/>
<map uri="xp4_snowcrash" name="Thin Ice" playmode="Hotwire0"/>

<!-- Bloodmoney Maps -->
<map uri="MP_Bank" name="Bank Job" playmode="BloodMoney0"/>
Expand All @@ -95,6 +124,14 @@
<map uri="xp2_precinct7" name="Precinct" playmode="BloodMoney0"/>
<map uri="xp25_bank" name="Night Job" playmode="BloodMoney0"/>
<map uri="xp25_sawmill" name="Night Woods" playmode="BloodMoney0"/>
<map uri="xp3_border" name="Double Cross" playmode="BloodMoney0"/>
<map uri="xp3_cistern02" name="Diversion" playmode="BloodMoney0"/>
<map uri="xp3_highway" name="Pacific Highway" playmode="BloodMoney0"/>
<map uri="xp3_traindodge" name="Train Dodge" playmode="BloodMoney0"/>
<map uri="xp4_alcatraz" name="Alcatraz" playmode="BloodMoney0"/>
<map uri="xp4_cemetery" name="Cementry" playmode="BloodMoney0"/>
<map uri="xp4_chinatown" name="Chinatown" playmode="BloodMoney0"/>
<map uri="xp4_snowcrash" name="Thin Ice" playmode="BloodMoney0"/>

<!-- Crosshair Maps -->
<map uri="MP_Bank" name="Bank Job" playmode="Hit0"/>
Expand All @@ -116,6 +153,14 @@
<map uri="xp2_precinct7" name="Precinct" playmode="Hit0"/>
<map uri="xp25_bank" name="Night Job" playmode="Hit0"/>
<map uri="xp25_sawmill" name="Night Woods" playmode="Hit0"/>
<map uri="xp3_border" name="Double Cross" playmode="Hit0"/>
<map uri="xp3_cistern02" name="Diversion" playmode="Hit0"/>
<map uri="xp3_highway" name="Pacific Highway" playmode="Hit0"/>
<map uri="xp3_traindodge" name="Train Dodge" playmode="Hit0"/>
<map uri="xp4_alcatraz" name="Alcatraz" playmode="Hit0"/>
<map uri="xp4_cemetery" name="Cementry" playmode="Hit0"/>
<map uri="xp4_chinatown" name="Chinatown" playmode="Hit0"/>
<map uri="xp4_snowcrash" name="Thin Ice" playmode="Hit0"/>

<!-- Rescue Maps -->
<map uri="MP_Bank" name="Bank Job" playmode="Hostage0"/>
Expand All @@ -137,6 +182,14 @@
<map uri="xp2_precinct7" name="Precinct" playmode="Hostage0"/>
<map uri="xp25_bank" name="Night Job" playmode="Hostage0"/>
<map uri="xp25_sawmill" name="Night Woods" playmode="Hostage0"/>
<map uri="xp3_border" name="Double Cross" playmode="Hostage0"/>
<map uri="xp3_cistern02" name="Diversion" playmode="Hostage0"/>
<map uri="xp3_highway" name="Pacific Highway" playmode="Hostage0"/>
<map uri="xp3_traindodge" name="Train Dodge" playmode="Hostage0"/>
<map uri="xp4_alcatraz" name="Alcatraz" playmode="Hostage0"/>
<map uri="xp4_cemetery" name="Cementry" playmode="Hostage0"/>
<map uri="xp4_chinatown" name="Chinatown" playmode="Hostage0"/>
<map uri="xp4_snowcrash" name="Thin Ice" playmode="Hostage0"/>

<!-- Team Deathmatch Maps -->
<map uri="MP_Bank" name="Bank Job" playmode="TeamDeathMatch0"/>
Expand All @@ -158,6 +211,14 @@
<map uri="xp2_precinct7" name="Precinct" playmode="TeamDeathMatch0"/>
<map uri="xp25_bank" name="Night Job" playmode="TeamDeathMatch0"/>
<map uri="xp25_sawmill" name="Night Woods" playmode="TeamDeathMatch0"/>
<map uri="xp3_border" name="Double Cross" playmode="TeamDeathMatch0"/>
<map uri="xp3_cistern02" name="Diversion" playmode="TeamDeathMatch0"/>
<map uri="xp3_highway" name="Pacific Highway" playmode="TeamDeathMatch0"/>
<map uri="xp3_traindodge" name="Train Dodge" playmode="TeamDeathMatch0"/>
<map uri="xp4_alcatraz" name="Alcatraz" playmode="TeamDeathMatch0"/>
<map uri="xp4_cemetery" name="Cementry" playmode="TeamDeathMatch0"/>
<map uri="xp4_chinatown" name="Chinatown" playmode="TeamDeathMatch0"/>
<map uri="xp4_snowcrash" name="Thin Ice" playmode="TeamDeathMatch0"/>

<!-- Bounty Hunter Maps -->
<map uri="XP1_MallCops" name="Black Friday" playmode="CashGrab0"/>
Expand All @@ -168,10 +229,38 @@
<map uri="xp2_coastal" name="Break Point" playmode="CashGrab0"/>
<map uri="xp2_museum02" name="Museum" playmode="CashGrab0"/>
<map uri="xp2_precinct7" name="Precinct" playmode="CashGrab0"/>
<map uri="xp25_bank" name="Night Job" playmode="CashGrab0"/>
<map uri="xp25_sawmill" name="Night Woods" playmode="CashGrab0"/>
<map uri="xp3_border" name="Double Cross" playmode="CashGrab0"/>
<map uri="xp3_cistern02" name="Diversion" playmode="CashGrab0"/>
<map uri="xp3_highway" name="Pacific Highway" playmode="CashGrab0"/>
<map uri="xp3_traindodge" name="Train Dodge" playmode="CashGrab0"/>
<map uri="xp4_alcatraz" name="Alcatraz" playmode="CashGrab0"/>
<map uri="xp4_cemetery" name="Cementry" playmode="CashGrab0"/>
<map uri="xp4_chinatown" name="Chinatown" playmode="CashGrab0"/>
<map uri="xp4_snowcrash" name="Thin Ice" playmode="CashGrab0"/>

<!-- Squad Heist Maps -->
<map uri="xp2_cargoship" name="The Docks" playmode="SquadHeist0"/>
<map uri="xp2_coastal" name="Break Point" playmode="SquadHeist0"/>
<map uri="xp2_museum02" name="Museum" playmode="SquadHeist0"/>
<map uri="xp2_precinct7" name="Precinct" playmode="SquadHeist0"/>
<map uri="xp3_border" name="Double Cross" playmode="SquadHeist0"/>
<map uri="xp3_cistern02" name="Diversion" playmode="SquadHeist0"/>
<map uri="xp3_highway" name="Pacific Highway" playmode="SquadHeist0"/>
<map uri="xp3_traindodge" name="Train Dodge" playmode="SquadHeist0"/>
<map uri="xp4_alcatraz" name="Alcatraz" playmode="SquadHeist0"/>
<map uri="xp4_cemetery" name="Cementry" playmode="SquadHeist0"/>
<map uri="xp4_chinatown" name="Chinatown" playmode="SquadHeist0"/>
<map uri="xp4_snowcrash" name="Thin Ice" playmode="SquadHeist0"/>

<!-- Capture the Bag Maps -->
<map uri="xp3_border" name="Double Cross" playmode="CaptureTheFlag0"/>
<map uri="xp3_cistern02" name="Diversion" playmode="CaptureTheFlag0"/>
<map uri="xp3_highway" name="Pacific Highway" playmode="CaptureTheFlag0"/>
<map uri="xp3_traindodge" name="Train Dodge" playmode="CaptureTheFlag0"/>
<map uri="xp4_alcatraz" name="Alcatraz" playmode="CaptureTheFlag0"/>
<map uri="xp4_cemetery" name="Cementry" playmode="CaptureTheFlag0"/>
<map uri="xp4_chinatown" name="Chinatown" playmode="CaptureTheFlag0"/>
<map uri="xp4_snowcrash" name="Thin Ice" playmode="CaptureTheFlag0"/>
</mapNames>
1 change: 1 addition & 0 deletions app/bfacp/ThirdParty/BFHL/playModes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
<playmode uri="TeamDeathMatch0" name="Team Deathmatch"/>
<playmode uri="CashGrab0" name="Bounty Hunter"/>
<playmode uri="SquadHeist0" name="Squad Heist"/>
<playmode uri="CaptureTheFlag0" name="Capture the Bag Maps"/>
</playmodes>
4 changes: 2 additions & 2 deletions app/views/layout/main.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
<strong>&copy; 2013-{{ date('Y') }} <a href="http://www.adkgamers.com" target="_blank">A Different Kind, LLC</a>. All rights reserved.</strong> <em>{{ MainHelper::executionTime(true) }}</em>
</footer>

@if($bfacp->user->ability(null, ['admin.site.pusher.users.view', 'admin.site.pusher.chat.view']) && !empty(getenv('PUSHER_APP_KEY')))
@if($bfacp->isLoggedIn && $bfacp->user->ability(null, ['admin.site.pusher.users.view', 'admin.site.pusher.chat.view']) && !empty(getenv('PUSHER_APP_KEY')))
<!-- Control Sidebar -->
<aside class="control-sidebar control-sidebar-dark">
<!-- Create the tabs -->
Expand Down Expand Up @@ -202,7 +202,7 @@
{{ HTML::script('js/plugins/howler/howler.min.js') }}
{{ HTML::script('js/plugins/slimScroll/jquery.slimscroll.min.js') }}
{{ HTML::script('js/boot.js?v=1') }}
@if($bfacp->user->ability(null, ['admin.site.pusher.users.view', 'admin.site.pusher.chat.view']) && !empty(getenv('PUSHER_APP_KEY')))
@if($bfacp->isLoggedIn && $bfacp->user->ability(null, ['admin.site.pusher.users.view', 'admin.site.pusher.chat.view']) && !empty(getenv('PUSHER_APP_KEY')))
<script type="text/javascript">
var pusher = new Pusher('{{ getenv('PUSHER_APP_KEY') }}', {
authEndpoint: '/api/pusher/auth'
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 12 additions & 2 deletions scripts/deploy_sourceforge.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
#!/bin/bash -eu
#!/bin/bash -e
parentdir="$(dirname "$(pwd)")/BFAdminCP"
FILENAME="${CIRCLE_BRANCH}.zip"

if [[ -v CIRCLE_BRANCH ]]; then
FILENAME="${CIRCLE_BRANCH}.zip"
elif [[ -v CIRCLE_TAG ]]; then
FILENAME="${CIRCLE_TAG}.zip"
else
exit 1
fi
echo "Zipping application into ${FILENAME}."
zip -9 -q -r $FILENAME . -x *.git*
USER="prophet731"
HOST="frs.sourceforge.net"
echo "Uploading ${FILENAME} to sourceforge."
scp -oUserKnownHostsFile=/dev/null "${parentdir}/${FILENAME}" $USER@$HOST:/home/pfs/project/b/bf/bfacp/
echo "${FILENAME} uploaded."

0 comments on commit 1e9b8df

Please sign in to comment.