Skip to content

Commit

Permalink
Sync
Browse files Browse the repository at this point in the history
  • Loading branch information
miomoor committed May 24, 2021
1 parent 6ede03a commit 97e008f
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 199 deletions.
37 changes: 1 addition & 36 deletions launcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@
-----------------------------------------------------
File: launcher.php
-----------------------------------------------------
<<<<<<< Updated upstream
Version: 0.0.20.0 Experimental
=======
Version: 0.0.22.0 Experimental
>>>>>>> Stashed changes
-----------------------------------------------------
Usage: All the functions of Arvind can be obtained in here
=====================================================
Expand All @@ -24,10 +20,7 @@
define('INCLUDE_CHECK',true);
define('NO_DEBUG',true);
include ("scripts/actionScript.php");
<<<<<<< Updated upstream
=======
require ('scripts/auth.class.php');
>>>>>>> Stashed changes
//===================================================
if(!$_REQUEST){
die("No request!");
Expand All @@ -49,34 +42,6 @@
exit;
}

<<<<<<< Updated upstream
try {
//To merge
if(!file_exists($config['uploaddirs'])) {
die ("Skins path is not a folder!");
}

if(!file_exists($config['uploaddirp'])) {
die ("Cloak path is not a folder!");
}
//******

require ('scripts/auth.class.php');
$auth = new auth($ctoken, $login, $postPass, $launchermd5, false);

//$hash = generateLoginHash();
$db->run("UPDATE LOW_PRIORITY dle_users SET lastdate='".CURRENT_TIME."', logged_ip='".REMOTE_IP."' WHERE name='$login'"); //,hash='$hash'
if($action == 'auth') {
require_once ('scripts/geoIP.class.php');
$geoplugin = new geoPlugin();
require_once ("scripts/loadFiles.php");
}

} catch(PDOException $pe) {
die(Security::encrypt("errorsql<$>", $config['key1']).$pe);
}
=======
if($action == 'auth') {
$auth = new auth($action, $client, $login, $postPass, $launchermd5, $ctoken);
}
>>>>>>> Stashed changes
}
128 changes: 0 additions & 128 deletions scripts/auth.class.php
Original file line number Diff line number Diff line change
@@ -1,100 +1,16 @@
<?php
/*
=====================================================
<<<<<<< Updated upstream
Hey you! Come here! | Auth
-----------------------------------------------------
https://FoxesWorld.ru/
=======
Come here, I may know you! | auth
-----------------------------------------------------
https://Foxesworld.ru/
>>>>>>> Stashed changes
-----------------------------------------------------
Copyright (c) 2016-2021 FoxesWorld
-----------------------------------------------------
This code is reserved
-----------------------------------------------------
File: auth.class.php
-----------------------------------------------------
<<<<<<< Updated upstream
Version: 0.0.1.0 Experimental
-----------------------------------------------------
Usage: Authorisation
=====================================================
*/
class auth {

private $debug = false;
protected $inputLogin;
protected $realUser;
protected $inputPassword;
protected $realPass;
protected $checkPass;
protected $launchermd5;

private $accessToken;

function __construct($ctoken, $login, $postPass, $launchermd5, $debug){
global $config, $db;
$this->debug = $debug;
$this->inputLogin = $this->pregMatch($login);
$this->inputPassword = $this->pregMatch($postPass);
$this->$launchermd5 = $this->pregMatch($launchermd5);

if($ctoken == "null") {
if($config['crypt'] === 'hash_md5' || $config['crypt'] === 'hash_foxy') {
$this->selectPassword($this->inputLogin);
}
$this->checkPass = hash_name($config['crypt'], $this->realPass, $this->inputPassword, @$salt);
$this->antiBrute();
$this->accessToken = token();
} else {
$this->accessToken = $this->inputPassword;
}

$sessid = token();
$stmt = $db->prepare("SELECT user, token FROM usersession WHERE user = :login");
$stmt->bindValue(':login', $this->realUser);
$stmt->execute();
$rU = $stmt->fetch(PDO::FETCH_ASSOC);
if($rU['user'] != null) {
$this->realUser = $rU['user'];
}

if($ctoken != "null") {
if($rU['token'] != $this->accessToken || $this->inputLogin != $this->realUser) {
exit(Security::encrypt("errorLogin<$>", $config['key1']));
}
}
$this->setSession($this->realUser);
}

private function selectPassword($login) {
global $db, $config;
$stmt = $db->prepare("SELECT ".$config['db_columnUser'].",".$config['db_columnPass']." FROM ".$config['db_table']." WHERE BINARY ".$config['db_columnUser']." = :login");
$stmt->bindValue(':login', $login);
$stmt->execute();
$stmt->bindColumn($config['db_columnPass'], $this->realPass);
$stmt->bindColumn($config['db_columnUser'], $this->realUser);
if($this->debug === true) {
echo '<div style="border: 1px solid black; padding: 5px; border-radius: 10px; width: fit-content; margin: 15px;">
'.'<h1 style="font-size: large;margin: 0;">Selected data</h1><br>'.
'Login: <b>'.$this->realUser.'</b>'.
'Pass: <b>'. $this->realPass.'</b>';
}
$stmt->fetch();
}

private function setSession ($userToSet){
global $db;
if($this->inputLogin == $userToSet) {
if($ctoken == "null") {
$stmt = $db->prepare("UPDATE usersession SET session = '$sessid', token = :token WHERE user= :login");
$stmt->bindValue(':token', $this->accessToken);
} else {
$stmt = $db->prepare("UPDATE usersession SET session = '$sessid' WHERE user = :login");
=======
Version: 0.0.2.2 Experimental
-----------------------------------------------------
Usage: Auth + SetSession + LoadFiles
Expand Down Expand Up @@ -213,64 +129,21 @@ private function setSession() {
$stmt->bindValue(':token', $this->accessToken);
} else {
$stmt = $db->prepare("UPDATE usersession SET session = '".$this->sessID."' WHERE user = :login");
>>>>>>> Stashed changes
}

$stmt->bindValue(':login', $this->realUser);
$stmt->execute();
<<<<<<< Updated upstream
} else {
if($ctoken == "null" || $this->inputLogin != $userToSet) {
$stmt = $db->prepare("INSERT INTO usersession (user, session, md5, token) VALUES (:login, '$sessid', :md5, '$acesstoken')");
=======

} else {
if($this->ctoken == "null" || $this->inputUser != $this->realUser) {
$stmt = $db->prepare("INSERT INTO usersession (user, session, md5, token) VALUES (:login, '".$this->sessID."', :md5, '".$this->accessToken."')");
>>>>>>> Stashed changes
$stmt->bindValue(':login', $this->realUser);
$stmt->bindValue(':md5', str_replace('-', '', uuidConvert($this->realUser)));
$stmt->execute();
}
}
}

<<<<<<< Updated upstream
private function pregMatch($toCheck){
global $config;
if (!preg_match("/^[a-zA-Z0-9_-]+$/", $toCheck)) {
exit(Security::encrypt("errorLogin<$>", $config['key1']));
}

return $toCheck;
}

private function antiBrute(){
global $config, $db;
if($config['useantibrut'] === true) {
$stmt = $db->getRow("SELECT sip,time FROM sip WHERE sip='".REMOTE_IP."' And time >'".CURRENT_TIME."'");
$bannedIP = $stmt['sip'];
if(REMOTE_IP == $bannedIP) {
$stmt = $db->run("DELETE FROM sip WHERE time < '".CURRENT_TIME."';");
exit(Security::encrypt("temp<$>", $config['key1']));
}

if ($this->inputLogin != $this->realUser) {
$stmt = $db->run("INSERT INTO sip (sip, time)VALUES ('".REMOTE_IP."', '".$config['bantime']."')");
exit(Security::encrypt("errorLogin<$>", $config['key1']));
}

if(!strcmp($this->realPass,$this->checkPass) == 0 || !$this->realPass) {
$stmt = $db->run("INSERT INTO sip (sip, time)VALUES ('".REMOTE_IP."', '".$config['bantime']."')");
exit(Security::encrypt("errorLogin<$>", $config['key1']));
}

} else {
if ($this->checkPass != $this->realPass) {
die(Security::encrypt('errorLogin<$>', $config['key1']));
}
}
=======
private function selectRealData($login) {
global $db, $config;
$stmt = $db->prepare("SELECT ".$config['db_columnUser'].",".$config['db_columnPass']." FROM ".$config['db_table']." WHERE BINARY ".$config['db_columnUser']." = :login");
Expand All @@ -285,6 +158,5 @@ private function selectRealData($login) {
'Pass: <b>'. $this->realPass.'</b>';
}
$stmt->fetch();
>>>>>>> Stashed changes
}
}
20 changes: 0 additions & 20 deletions scripts/loadFiles.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,9 @@
-----------------------------------------------------
File: loadFiles.class.php
-----------------------------------------------------
<<<<<<< Updated upstream
Версия: 0.0.1.3 Alpha
-----------------------------------------------------
Назначение: Files out + crypt + size
=======
Version: 0.0.2.5 Experimental
-----------------------------------------------------
Usage: Files out + crypt + size
>>>>>>> Stashed changes
=====================================================
*/

Expand All @@ -39,19 +33,6 @@ function __construct($client, $sessid, $acesstoken, $realUser){
$this->version = $serverInfo[0]['version'];
$this->checkStructure();

<<<<<<< Updated upstream
/* Basic client structure (Alpha) */
$clientStructureCheck = array($config['clientsDir']."assets",
$config['clientsDir']."versions/".$version,
$config['clientsDir']."versions/".$version."/libraries",
$config['clientsDir']."versions/".$version."/".$version.".jar",
$config['clientsDir']."versions/".$version."/natives/");

foreach($clientStructureCheck as $key) {
if(!file_exists($key)) {
die(Security::encrypt("client<$> $client", $config['key1']));
}
=======
$md5user = strtoint(xorencode(str_replace('-', '', uuidConvert($realUser)), $config['protectionKey']));
$md5ServersDat = @md5_file($config['clientsDir']."clients/".$client."/servers.dat");
$sizeServersDat = @filesize($config['clientsDir']."clients/".$client."/servers.dat");
Expand All @@ -64,7 +45,6 @@ function __construct($client, $sessid, $acesstoken, $realUser){
$hash_md5 = hashcVersion($client);
}
echo Security::encrypt($usrsessions.$hash_md5, $config['key1']);
>>>>>>> Stashed changes
}

private function checkStructure() {
Expand Down
15 changes: 0 additions & 15 deletions scripts/startUpSound.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@
-----------------------------------------------------
File: startUpSound.class.php
-----------------------------------------------------
<<<<<<< Updated upstream
Version: 0.1.12 Alpha
=======
Version: 0.1.13 Final
>>>>>>> Stashed changes
-----------------------------------------------------
Usage: Sound generation
=====================================================
Expand Down Expand Up @@ -82,11 +78,8 @@ public function generateAudio() {
*/
private function eventNow() {
$eventName = 'common';
<<<<<<< Updated upstream
=======
$musRange = 0;
$soundRange = 0;
>>>>>>> Stashed changes
$eventArray = array();
$dateExploded = explode ('.',startUpSound::$currentDate);
$dayToday = $dateExploded[0];
Expand Down Expand Up @@ -217,11 +210,7 @@ private function generateMusic($debug = false) {
startUpSound::$musFilesNum = countFilesNum($currentMusFolder, '.mp3'); //Count of music
$maxRange = startUpSound::$musFilesNum;

<<<<<<< Updated upstream
if(isset(static::$musRange)) {
=======
if(isset(static::$musRange) && static::$musRange !== 0) {
>>>>>>> Stashed changes
$RandMusFile = $this->genRange('mus', static::$musRange);
} else {
$RandMusFile = 'mus'.rand($minRange,$maxRange).'.mp3'; //Getting random musFile
Expand Down Expand Up @@ -271,11 +260,7 @@ private function generateSound($debug = false) {
$currentSoundFolder = static::$AbsolutesoundPath.'/'.static::$eventNow.static::$easter; //Folder of Sounds
startUpSound::$soundFilesNum = countFilesNum($currentSoundFolder, '.mp3'); //Count of Sounds

<<<<<<< Updated upstream
if(isset(static::$soundRange)) {
=======
if(isset(static::$soundRange) && static::$soundRange !== 0) {
>>>>>>> Stashed changes
$RandSoundFile = $this->genRange('voice', static::$soundRange);
} else {
$RandSoundFile = 'voice'.rand($minRange,static::$soundFilesNum).'.mp3'; //Getting random sound file
Expand Down

0 comments on commit 97e008f

Please sign in to comment.