mirror of
https://github.com/Matthww/PlayerInfo.git
synced 2025-06-10 03:14:36 +00:00
Saving checks
Added checks for saving
This commit is contained in:
parent
53ffbf451e
commit
289485a784
@ -55,23 +55,25 @@ class PlayerInfo extends PluginBase implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function onJoin(PlayerJoinEvent $joinEvent) {
|
public function onJoin(PlayerJoinEvent $joinEvent) {
|
||||||
$player = $joinEvent->getPlayer();
|
if($this->getConfig()->get("Save") == true) {
|
||||||
$cdata = $this->PlayerData[$player->getName()];
|
$player = $joinEvent->getPlayer();
|
||||||
$os = ["Unknown", "Android", "iOS", "macOS", "FireOS", "GearVR", "HoloLens", "Windows 10", "Windows", "Dedicated", "Orbis", "NX"];
|
$cdata = $this->PlayerData[$player->getName()];
|
||||||
$UI = ["Classic UI", "Pocket UI"];
|
$os = ["Unknown", "Android", "iOS", "macOS", "FireOS", "GearVR", "HoloLens", "Windows 10", "Windows", "Dedicated", "Orbis", "NX"];
|
||||||
$Controls = ["Unknown", "Mouse", "Touch", "Controller"];
|
$UI = ["Classic UI", "Pocket UI"];
|
||||||
$GUI = [-2 => "Minimum", -1 => "Medium", 0 => "Maximum"];
|
$Controls = ["Unknown", "Mouse", "Touch", "Controller"];
|
||||||
|
$GUI = [-2 => "Minimum", -1 => "Medium", 0 => "Maximum"];
|
||||||
|
|
||||||
$this->getServer()->getScheduler()->scheduleTask(new Tasks\SaveTask(
|
$this->getServer()->getScheduler()->scheduleTask(new Tasks\SaveTask(
|
||||||
$this,
|
$this,
|
||||||
$player->getName(),
|
$player->getName(),
|
||||||
$this->DeviceModel($cdata["DeviceModel"]),
|
$this->DeviceModel($cdata["DeviceModel"]),
|
||||||
$os[$cdata["DeviceOS"]],
|
$os[$cdata["DeviceOS"]],
|
||||||
$player->getAddress(),
|
$player->getAddress(),
|
||||||
$UI[$cdata["UIProfile"]],
|
$UI[$cdata["UIProfile"]],
|
||||||
$GUI[$cdata["GuiScale"]],
|
$GUI[$cdata["GuiScale"]],
|
||||||
$Controls[$cdata["CurrentInputMode"]]
|
$Controls[$cdata["CurrentInputMode"]]
|
||||||
));
|
));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function DeviceModel(string $model) {
|
public function DeviceModel(string $model) {
|
||||||
@ -107,7 +109,7 @@ class PlayerInfo extends PluginBase implements Listener {
|
|||||||
if($target = $this->getServer()->getPlayer($args[0])) {
|
if($target = $this->getServer()->getPlayer($args[0])) {
|
||||||
//Nothing
|
//Nothing
|
||||||
} else {
|
} else {
|
||||||
if($this->getConfig()->get("IP") == true) {
|
if($this->getConfig()->get("Save") == true) {
|
||||||
$this->getServer()->getScheduler()->scheduleTask(new Tasks\LoadTask($this, $sender, $args[0]));
|
$this->getServer()->getScheduler()->scheduleTask(new Tasks\LoadTask($this, $sender, $args[0]));
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user