mirror of
https://github.com/hakasenyang/osu-tournament-php
synced 2026-08-27 13:33:08 +09:00
Add osu! mode
This commit is contained in:
+34
-2
@@ -16,13 +16,45 @@
|
|||||||
* @var [string]
|
* @var [string]
|
||||||
*/
|
*/
|
||||||
private $OsuID, $PlayCount, $Performance, $Rank, $Occupation;
|
private $OsuID, $PlayCount, $Performance, $Rank, $Occupation;
|
||||||
|
/**
|
||||||
|
* [$mode osu! mode
|
||||||
|
* 0 = osu! standard (standard)
|
||||||
|
* 1 = Taiko (taiko)
|
||||||
|
* 2 = Catch The Beat (ctb)
|
||||||
|
* 3 = osu!mania (mania)
|
||||||
|
* ]
|
||||||
|
* @var [int]
|
||||||
|
*/
|
||||||
|
private $mode;
|
||||||
/**
|
/**
|
||||||
* Other data
|
* Other data
|
||||||
* In production.
|
* In production.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function __construct()
|
public function __construct($mode)
|
||||||
{
|
{
|
||||||
|
switch($mode)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
case 'standard':
|
||||||
|
$this->mode = 0;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
case 'taiko':
|
||||||
|
$this->mode = 1;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
case 'ctb':
|
||||||
|
$this->mode = 2;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
case 'mania':
|
||||||
|
$this->mode = 3;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new Exception('Error Mode');
|
||||||
|
break;
|
||||||
|
}
|
||||||
$this->Parser = new Parser();
|
$this->Parser = new Parser();
|
||||||
}
|
}
|
||||||
public function CheckUser($osuid)
|
public function CheckUser($osuid)
|
||||||
@@ -35,7 +67,7 @@
|
|||||||
}
|
}
|
||||||
public function CheckPlayCount()
|
public function CheckPlayCount()
|
||||||
{
|
{
|
||||||
$data = $this->Parser->WEBParsing('https://osu.ppy.sh/pages/include/profile-general.php?u='. $this->OsuID .'&m=0');
|
$data = $this->Parser->WEBParsing('https://osu.ppy.sh/pages/include/profile-general.php?u=' . $this->OsuID .'&m=' . $this->mode);
|
||||||
$this->PlayCount = $this->Parser->splits($data, '<b>Play Count</b>: ', '</div>');
|
$this->PlayCount = $this->Parser->splits($data, '<b>Play Count</b>: ', '</div>');
|
||||||
return $this->PlayCount;
|
return $this->PlayCount;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user