Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by http://DeZender.Net
- * @ deZender (PHP7 Decoder for ionCube Encoder)
- *
- * @ Version : 4.1.0.0
- * @ Author : DeZender
- * @ Release on : 15.05.2020
- * @ Official site : http://DeZender.Net
- *
- */
- class MulticraftIntegration
- {
- public $logEnabled = true;
- public $logApi = false;
- public $logVerbose = false;
- public $api;
- public $clientData = [];
- public $server = [];
- public $serverConfig = [];
- public $options = [];
- public $clientId = 0;
- public $serviceId = 0;
- public $packageId = 0;
- public $userId = 0;
- public $serverId = 0;
- public $messages = [];
- public $failed = false;
- public $lockFile = false;
- public $action = '';
- public $params = [];
- public $assignedIps = '';
- public $updateAssignedIps = false;
- public $dedicatedIpAvailable = [];
- public $whmcsServerId = 0;
- public $_cfg = false;
- public function __construct()
- {
- $this->server = ['name' => NULL, 'ip' => NULL, 'port' => '', 'dir' => NULL, 'world' => NULL, 'players' => NULL, 'memory' => NULL, 'start_memory' => NULL, 'jarfile' => NULL, 'autostart' => NULL, 'default_level' => NULL, 'daemon_id' => NULL, 'announce_save' => NULL, 'kick_delay' => NULL, 'suspended' => NULL, 'autosave' => NULL, 'jardir' => NULL, 'template' => NULL, 'setup' => NULL, 'prev_jarfile' => NULL, 'params' => NULL, 'crash_check' => NULL, 'disk_quota' => NULL, 'domain' => NULL];
- foreach ($this->server as $k => $v) {
- $this->server[$k] = $this->cfg('server', $k, $v);
- }
- $this->serverConfig = ['ip_auth_role' => NULL, 'give_role' => NULL, 'tp_role' => NULL, 'summon_role' => NULL, 'chat_role' => NULL, 'user_jar' => NULL, 'user_ftp' => NULL, 'visible' => NULL, 'user_schedule' => NULL, 'user_name' => NULL, 'user_visibility' => NULL, 'display_ip' => NULL, 'user_players' => NULL, 'user_mysql' => NULL, 'user_jardir' => NULL, 'user_params' => NULL, 'user_templates' => NULL, 'user_memory' => NULL, 'user_crash_check' => NULL, 'user_subdomain' => NULL];
- foreach ($this->serverConfig as $k => $v) {
- $this->serverConfig[$k] = $this->cfg('server_config', $k, $v);
- }
- $this->options = ['location' => '_default_', 'max_per_daemon' => '', 'allowed_daemons' => '', 'shuffle_daemons' => '', 'delete_worlds' => '', 'delete_user' => '', 'dedicated_ip' => '', 'use_best_daemon' => '', 'retry_times' => '10', 'existing_password' => 'Your existing panel password', 'op_player' => 1, 'store_id_as_domain' => false, 'keep_id_after_terminate' => false, 'keep_domain_after_terminate' => false];
- foreach ($this->options as $k => $v) {
- $this->options[$k] = $this->cfg('settings', $k, $v);
- }
- $this->logEnabled = $this->cfg('log', 'enabled', $this->logEnabled);
- $this->logApi = $this->cfg('log', 'api', $this->logApi);
- $this->logVerbose = $this->cfg('log', 'verbose', $this->logVerbose);
- }
- public function cfg($section, $param, $default)
- {
- if ($this->_cfg === false) {
- $this->_cfg = @include 'config.php';
- if (!$this->_cfg) {
- $this->_cfg = [];
- }
- }
- $o = (isset($this->_cfg[$section][$param]) ? $this->_cfg[$section][$param] : $default);
- if ($o !== $default) {
- $this->debug('Overriding ' . $section . '.' . $param . ': ' . var_export($o, true));
- }
- return $o;
- }
- static public function call($func, $params)
- {
- try {
- $mc = new MulticraftIntegration();
- $mc->action = ucfirst($func);
- if (!$mc->init($params)) {
- return $mc->end();
- }
- $mc->$func();
- return $mc->end();
- }
- catch (Exception $e) {
- return MulticraftIntegration::encode($e->getMessage());
- }
- }
- public function fail($error)
- {
- $this->failed = true;
- $this->debug($error);
- return false;
- }
- public function debug($msg)
- {
- $this->messages[] = $msg;
- if (!$this->logVerbose) {
- return false;
- }
- $this->logModule($msg);
- return false;
- }
- public function _logModuleCall($action, $params, $raw, $pretty)
- {
- if (!$this->logEnabled) {
- return NULL;
- }
- logModuleCall('Multicraft', $action, $params, $raw, $pretty, [$this->params['password'], $this->params['customfields']['password'], $this->params['configoptions']['password'], $this->params['clientsdetails']['password'], $this->params['serverpassword'], $this->params['serveraccesshash']]);
- }
- public function logModule($raw, $pretty = false)
- {
- $this->_logModuleCall($this->action, $this->params, $raw, $pretty);
- }
- public function logApi($method, $params, $response)
- {
- if (!$this->logApi) {
- return NULL;
- }
- $this->_logModuleCall($this->action . '>' . $method, $params, $response, NULL);
- ............................................................................
- ...............................................
- ......................
Add Comment
Please, Sign In to add comment