mirror of
https://github.com/hakasenyang/osu-tournament-php
synced 2026-08-23 03:33:06 +09:00
+24
-33
@@ -14,13 +14,14 @@
|
||||
*/
|
||||
public $RealID, $OsuID;
|
||||
/**
|
||||
* [$PlayCount User Playcount]
|
||||
* [$Performance User Performance]
|
||||
* [$Rank User Ranking]
|
||||
* [$Playcount User playcount]
|
||||
* [$Performance User performance]
|
||||
* [$Rank User ranking]
|
||||
* [$Occupation Check user occupation]
|
||||
* [$Occupation_Set Setting user occupation data]
|
||||
* @var [string]
|
||||
*/
|
||||
private $PlayCount, $Performance, $Rank, $Occupation;
|
||||
public $Playcount, $Performance, $Rank, $Occupation, $Occupation_Set;
|
||||
/**
|
||||
* [$mode osu! mode
|
||||
* 0 = osu! standard (standard)
|
||||
@@ -29,11 +30,10 @@
|
||||
* 3 = osu!mania (mania)
|
||||
* ]
|
||||
* @var [int]
|
||||
* [$occu User Occupation Data]
|
||||
* @var [string]
|
||||
*/
|
||||
private $mode, $occu;
|
||||
private $mode;
|
||||
/**
|
||||
* Temp data
|
||||
* [$data_profile description]
|
||||
* [$data_userdata description]
|
||||
* @var [string]
|
||||
@@ -100,21 +100,30 @@
|
||||
return false;
|
||||
|
||||
$this->Occupation = $this->Parser->splits($this->data_profile, '<div title=\'Occupation\'><i class=\'icon-pencil\'></i><div>', '</div></div>');
|
||||
|
||||
$this->GetOccupation();
|
||||
$this->GetUserData();
|
||||
|
||||
return $this->OsuID;
|
||||
}
|
||||
public function CheckOccupation()
|
||||
/**
|
||||
* Not using this function.
|
||||
*/
|
||||
/*
|
||||
private function CheckOccupation()
|
||||
{
|
||||
if(empty($this->OsuID))
|
||||
throw new \Exception('Please, CheckUser(OsuID) first!');
|
||||
if(empty($this->occu))
|
||||
if(empty($this->Occupation_Set))
|
||||
$this->GetOccupation();
|
||||
|
||||
if ($this->occu === $this->Occupation)
|
||||
if ($this->Occupation_Set === $this->Occupation)
|
||||
return true;
|
||||
else
|
||||
return $this->Occupation;
|
||||
}
|
||||
public function GetOccupation()
|
||||
*/
|
||||
private function GetOccupation()
|
||||
{
|
||||
/**
|
||||
* md5 = $RealID / $OsuID / date('Ymd') / $mode
|
||||
@@ -122,9 +131,9 @@
|
||||
*/
|
||||
if(empty($this->OsuID))
|
||||
throw new \Exception('Please, CheckUser(OsuID) first!');
|
||||
if(empty($this->occu))
|
||||
$this->occu = substr(md5($this->RealID . $this->OsuID . date('Ymd') . $this->mode), 0, 20);
|
||||
return $this->occu;
|
||||
if(empty($this->Occupation_Set))
|
||||
$this->Occupation_Set = substr(md5($this->RealID . $this->OsuID . date('Ymd') . $this->mode), 0, 20);
|
||||
return $this->Occupation_Set;
|
||||
}
|
||||
private function GetUserData()
|
||||
{
|
||||
@@ -141,31 +150,13 @@
|
||||
|
||||
if (strpos($this->data_userdata, 'This user has not played enough, or has not played recently.') === false)
|
||||
{
|
||||
$this->PlayCount = $this->Parser->splits($this->data_userdata, '<b>Play Count</b>: ', '</div>');
|
||||
$this->Playcount = $this->Parser->splits($this->data_userdata, '<b>Play Count</b>: ', '</div>');
|
||||
$this->Performance = str_replace(',', NULL, $this->Parser->splits($this->data_userdata, 'Performance</a>: ', 'pp'));
|
||||
$this->Rank = str_replace(',', NULL, $this->Parser->splits($this->data_userdata, 'pp (#', ')'));
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* [CheckPlayCount Get PlayCount]
|
||||
*/
|
||||
public function CheckPlayCount()
|
||||
{
|
||||
$this->GetUserData();
|
||||
return $this->PlayCount;
|
||||
}
|
||||
public function CheckPerformance()
|
||||
{
|
||||
$this->GetUserData();
|
||||
return $this->Performance;
|
||||
}
|
||||
public function CheckRank()
|
||||
{
|
||||
$this->GetUserData();
|
||||
return $this->Rank;
|
||||
}
|
||||
public function ResetObject()
|
||||
{
|
||||
foreach ($this as $key => $value)
|
||||
|
||||
@@ -6,23 +6,20 @@
|
||||
{
|
||||
global $Check;
|
||||
echo $Check->RealID . ' (' . $Check->OsuID . ')';
|
||||
$occu = $Check->CheckOccupation();
|
||||
|
||||
if ($Check->CheckOccupation() === true)
|
||||
if ($Check->Occupation_Set === $Check->Occupation)
|
||||
echo '<br>You are applied!';
|
||||
elseif (empty($occu))
|
||||
echo '<br>Please change occupation to ' . $Check->GetOccupation() . '<br>Your Occupation is blank.';
|
||||
elseif (empty($Check->Occupation))
|
||||
echo '<br>Please change occupation to ' . $Check->Occupation_Set . '<br>Your Occupation is blank.';
|
||||
else
|
||||
echo '<br>Please change occupation to ' . $Check->GetOccupation() . '<br>Your Occupation : ' . $occu;
|
||||
echo '<br>Please change occupation to ' . $Check->Occupation_Set . '<br>Your Occupation : ' . $Check->Occupation;
|
||||
echo '<br>';
|
||||
|
||||
if (empty($Check->CheckPerformance()))
|
||||
echo 'Error<br>';
|
||||
echo 'Play Count : ' . $Check->CheckPlayCount();
|
||||
echo 'Play Count : ' . $Check->Playcount;
|
||||
echo '<br>';
|
||||
echo 'Performance : ' . $Check->CheckPerformance();
|
||||
echo 'Performance : ' . $Check->Performance;
|
||||
echo '<br>';
|
||||
echo 'Ranking : ' . $Check->CheckRank();
|
||||
echo 'Ranking : ' . $Check->Rank;
|
||||
echo '<br><br>';
|
||||
}
|
||||
$Check->CheckUser(2558286, 0);
|
||||
|
||||
Reference in New Issue
Block a user