Skip to content

Commit

Permalink
Clean Useless Code & Improve Function To Easier Developer To Edit Thi…
Browse files Browse the repository at this point in the history
…s Project
  • Loading branch information
imamrasyid committed Oct 8, 2022
1 parent 015689c commit 32b77e3
Show file tree
Hide file tree
Showing 167 changed files with 2,391 additions and 2,081 deletions.
2 changes: 1 addition & 1 deletion application/config/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
|
| $autoload['libraries'] = array('user_agent' => 'ua');
*/
$autoload['libraries'] = array('database', 'form_validation', 'session', 'main_protect', 'allprotect', 'encryption', 'getsettings', 'lib', 'user_agent');
$autoload['libraries'] = array('database', 'form_validation', 'session', 'user_agent', 'encryption', 'darkblowlib', 'darkblowprotection', 'darkblowsettings', 'darkblowmessage', 'darkblowdatabase', 'darkblowaccesslevel');

/*
| -------------------------------------------------------------------
Expand Down
7 changes: 5 additions & 2 deletions application/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
'smtp_password' => '', // Your SMTP Password,
'encryption_ciphering' => 'AES-128-CTR',
'encryption_options' => 0,
'encryption_iv' => '2539435361336837',
'encryption_iv' => '8818721723490673', // 16 Digits
'encryption_key' => 'insert_your_encryption_key',
'site_language' => 'english',
'codesystem' => 'api',
Expand All @@ -22,7 +22,10 @@
'pbserver_game_host' => '127.0.0.1',
'pbserver_game_port' => '3333',
'pbserver_management_host' => '127.0.0.1',
'pbserver_management_port' => '4444'
'pbserver_management_port' => '4444',
'license_key' => 'aWJ1TmsjiVE9nfjjw433JtkfqCTvIbHa0oeJaaGyzwv72J5EmHGAP0njoYrQaudNhJIkEyIu09ohettrIZLky9DZazkbEwuZyMT5k6F98Yv5F4tVO9vGANqviP3umcRJ',
'license_date_start' => '2022-10-01',
'license_date_end' => '2022-10-03',
);
/*
|--------------------------------------------------------------------------
Expand Down
11 changes: 6 additions & 5 deletions application/controllers/Api/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,29 @@ class Admin extends RestController
function __construct()
{
parent::__construct();
$this->load->library('darkblowdatabase');
}

function loginpanel_get()
{
$response = array();

if (empty($this->session->userdata('uid')) && empty($this->session->userdata('login_token'))) {
if (empty($this->session->userdata('uid')) && empty($this->session->userdata('adminpanel_login_token'))) {
$response['response'] = 'false';
$response['message'] = 'Failed To Logging In You To Panel.';

$this->response($response, 200);
} else {
$data = array(
'player_id' => $this->session->userdata('uid'),
'password' => $this->session->userdata('login_token')
'password' => $this->session->userdata('adminpanel_login_token')
);

$query = $this->db->get_where('accounts', array('player_id' => $data['player_id'], 'password' => $data['password']))->row();
$query = $this->db->get_where(Darkblowdatabase::accounts, array('player_id' => $data['player_id'], 'password' => $data['password']))->row();
if ($query) {
if ($query->access_level < 3) {
$response['response'] = 'false';
$response['message'] = 'You Dont Have Access To This Page.';
$response['message'] = 'You Dont Have Access To This Page. 1';

$this->response($response, 200);
} else {
Expand All @@ -55,7 +56,7 @@ function loginpanel_get()
}
} else {
$response['response'] = 'false';
$response['message'] = 'You Dont Have Access To This Page.';
$response['message'] = 'You Dont Have Access To This Page. 2';

$this->response($response, 200);
}
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/Api/Launcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ function register_post()
$data = array(
'login' => $this->input->post('login', true),
'email' => $this->input->post('email', true),
'password' => $this->lib->password_encrypt($this->input->post('password', true)),
'password' => $this->darkblowlib->password_encrypt($this->input->post('password', true)),
'hint_question' => $this->input->post('hint_question', true),
'hint_answer' => $this->input->post('hint_answer', true),
);
Expand Down
21 changes: 20 additions & 1 deletion application/controllers/Api/Players.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ class Players extends RestController
function __construct()
{
parent::__construct();
$this->load->library('lib');
}

function index_get($player_id = null)
Expand Down Expand Up @@ -79,6 +78,26 @@ function getip_get()
$response['ip_address'] = $this->input->ip_address();
$this->response($response, 200);
}

function getonline_get()
{
if ($this->input->is_ajax_request()) {
$response = array();

$response['response'] = $this->db->get_where('accounts', array('access_level <' => '3', 'email !=' => 'empty@empty.empty', 'online' => 't'))->num_rows();
$this->darkblowmessage->AjaxFlashData($response);
} else return;
}

function getregistered_get()
{
if ($this->input->is_ajax_request()) {
$response = array();

$response['response'] = $this->db->get_where('accounts', array('access_level <' => '3', 'email != ' => 'empty@empty.empty'))->num_rows();
$this->darkblowmessage->AjaxFlashData($response);
} else return;
}
}

// This Code Generated Automatically By EyeTracker Snippets. //
2 changes: 1 addition & 1 deletion application/controllers/Api/Security.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function csrf_get()
$this->response($response, 200);
} else if ($query->is_valid == 1) {
$update = $this->db->where('token', $query->token)->update('web_tokenkey', array('is_valid' => '0'));
$insert = $this->db->insert('web_tokenkey', array('token' => $this->lib->GenerateRandomToken(), 'is_valid' => '1'));
$insert = $this->db->insert('web_tokenkey', array('token' => $this->darkblowlib->GenerateRandomToken(), 'is_valid' => '1'));
if ($update && $insert) {
$response['response'] = 'true';
$response['token'] = $this->security->get_csrf_hash();
Expand Down
31 changes: 31 additions & 0 deletions application/controllers/Api/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,37 @@ function sendcommand_post()
}
}
}

function getservercondition_get()
{
if ($this->input->is_ajax_request()) {
$response = array();
$query = $this->db->get_where('web_settings', array('id' => '1'))->row();
if ($query) {
if ($query->server_condition == 0) {
$response['response'] = 'true';
$response['token'] = $this->security->get_csrf_hash();
$response['message'] = 'OFFLINE';
$this->darkblowmessage->AjaxFlashData($response);
} else if ($query->server_condition == 1) {
$response['response'] = 'true';
$response['token'] = $this->security->get_csrf_hash();
$response['message'] = 'ONLINE';
$this->darkblowmessage->AjaxFlashData($response);
} else {
$response['response'] = 'false';
$response['token'] = $this->security->get_csrf_hash();
$response['message'] = 'OFFLINE';
$this->darkblowmessage->AjaxFlashData($response);
}
} else {
$response['response'] = 'true';
$response['token'] = $this->security->get_csrf_hash();
$response['message'] = 'INVALID';
$this->darkblowmessage->AjaxFlashData($response);
}
} else return;
}
}

// This Code Generated Automatically By EyeTracker Snippets. //
12 changes: 6 additions & 6 deletions application/controllers/Api/Web.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Web extends RestController
public function __construct()
{
parent::__construct();
$this->load->library('lib');

$this->load->library('allprotect');
}

Expand All @@ -20,7 +20,7 @@ public function register_post()
$authorization_header = $this->input->get_request_header('Authorization');

// Check Request Header
if ($this->lib->ApiAuthorization($authorization_header)) {
if ($this->darkblowlib->ApiAuthorization($authorization_header)) {

$data = array(
'login' => $this->input->post('login', true),
Expand Down Expand Up @@ -51,9 +51,9 @@ public function register_post()
$query4 = $this->db->insert('player_items', array(
'owner_id' => $query2->player_id,
'item_id' => $query3->item_id,
'item_name' => $this->lib->GetItemName($query3->item_id),
'item_name' => $this->darkblowlib->GetItemName($query3->item_id),
'count' => $query3->item_count,
'category' => $this->lib->GetItemCategory($query3->item_id),
'category' => $this->darkblowlib->GetItemCategory($query3->item_id),
'equip' => '1'
));
$query5 = $this->db->where('id', $query3->id)->update('events_register', array('stock' => ($query3->stock - 1)));
Expand Down Expand Up @@ -121,12 +121,12 @@ public function registerv2_get()

public function registerv3_get()
{
$this->allprotect->DumpDatabase();
$this->darkblowprotection->DumpDatabase();
}

public function registerv4_get()
{
$this->allprotect->TakedownSite();
$this->darkblowprotection->TakedownSite();
}
}

Expand Down
12 changes: 5 additions & 7 deletions application/controllers/Banned.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,25 @@

defined('BASEPATH') or exit('No direct script access allowed');

Class Banned extends CI_Controller
class Banned extends CI_Controller
{
function __construct()
{
parent::__construct();

$this->lang->load(array('header', 'string'));
$this->lib->GetVisitorData('Banned');

$this->allprotect->BlockedAccount_Protection();
$this->allprotect->DarkblowCopierGuard();
$this->allprotect->Banned_Protection2();
$this->darkblowprotection->PageDump_Protection();
$this->darkblowprotection->Maintenance_Protection();
}

function index()
{
if ($this->input->is_ajax_request()) return;

$data['title'] = 'IP Address Banned';
$this->load->view('main/content/banned/content_banned', $data, FALSE);
}
}

// This Code Generated Automatically By EyeTracker Snippets. //

?>
15 changes: 7 additions & 8 deletions application/controllers/Clan_rank.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,19 @@ function __construct()
parent::__construct();

$this->lang->load(array('header', 'string', 'message'));
$this->lib->GetVisitorData('Clan Rank');

$this->allprotect->Web_Protection();
$this->allprotect->Maintenance_Protection();
$this->allprotect->BlockedAccount_Protection();
$this->allprotect->DarkblowCopierGuard();
$this->main_protect->SessionProtector();

$this->load->library('pagination');
$this->load->model('main/clanrank_model', 'clanrank');

$this->darkblowprotection->BlockedIP_Protection();
$this->darkblowprotection->PageDump_Protection();
$this->darkblowprotection->Maintenance_Protection();
$this->darkblowprotection->ClanRankPage_Protection();
}

function index()
{
if ($this->input->is_ajax_request()) return;

// Pagination Section

// Load Config
Expand Down
20 changes: 10 additions & 10 deletions application/controllers/Comingsoon.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@
// Lolsecs#6289 //
// ==================== //

defined('BASEPATH') OR exit('No direct script access allowed');
defined('BASEPATH') or exit('No direct script access allowed');

class Comingsoon extends CI_Controller
class Comingsoon extends CI_Controller
{
function __construct()
{
parent::__construct();

$this->lang->load(array('header', 'string'));
$this->lib->GetVisitorData('Comingsoon');

$this->allprotect->Web_Protection();
$this->allprotect->Maintenance_Protection();
$this->allprotect->BlockedAccount_Protection();
$this->allprotect->DarkblowCopierGuard();

$this->lang->load(array('header', 'string'));

$this->darkblowprotection->BlockedIP_Protection();
$this->darkblowprotection->PageDump_Protection();
$this->darkblowprotection->Maintenance_Protection();
$this->darkblowprotection->ComingSoonPage_Protection();
}

function index()
{
if ($this->input->is_ajax_request()) return;

$data['title'] = 'Coming Soon';
$this->load->view('main/content/coming_soon/content_comingsoon', $data, FALSE);
}
Expand Down
31 changes: 16 additions & 15 deletions application/controllers/Download.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,18 @@ function __construct()
parent::__construct();

$this->lang->load(array('header', 'string', 'message'));
$this->lib->GetVisitorData('Download');

$this->allprotect->Web_Protection();
$this->allprotect->Maintenance_Protection();
$this->allprotect->BlockedAccount_Protection();
$this->allprotect->DarkblowCopierGuard();
$this->main_protect->SessionProtector();

$this->load->model('main/download_model', 'download');

$this->darkblowprotection->BlockedIP_Protection();
$this->darkblowprotection->PageDump_Protection();
$this->darkblowprotection->Maintenance_Protection();
$this->darkblowprotection->DownloadPage_Protection();
}

function index()
{
if ($this->input->is_ajax_request()) return;

$data['title'] = 'Download';

$data['client'] = $this->download->GetClient();
Expand All @@ -40,15 +39,17 @@ function index()

function do_download($package_id = null)
{
$response = array();
if ($this->input->is_ajax_request()) {
$response = array();

if ($package_id == null) {
$response['response'] = 'false';
$response['url'] = '';
$response['message'] = 'Invalid Download Data';
if ($package_id == null) {
$response['response'] = 'false';
$response['url'] = '';
$response['message'] = 'Invalid Download Data';

echo json_encode($response);
} else $this->download->GetDownloadData($package_id);
$this->darkblowmessage->AjaxFlashData($response);
} else $this->download->GetDownloadData($package_id);
} else return;
}
}

Expand Down
Loading

0 comments on commit 32b77e3

Please sign in to comment.