Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .poggit.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
--- # Poggit-CI Manifest. Open the CI at https://poggit.pmmp.io/ci/mathchat900/EconomyAPI-PM5
--- # Poggit-CI Manifest. Open the CI at https://poggit.pmmp.io/ci/BlackD14/EconomyAPI-PM5
build-by-default: true
branches:
- main
Expand Down
2 changes: 1 addition & 1 deletion src/onebone/economyapi/command/TopMoneyCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function execute(CommandSender $sender, string $label, array $params): bo
}
}

$task = new SortTask($sender->getName(), $this->plugin->getAllMoney(), $this->plugin->getConfig()->get("add-op-at-rank"), $page, $ops, $banned);
$task = new SortTask($sender->getName(), serialize($this->plugin->getAllMoney()), $this->plugin->getConfig()->get("add-op-at-rank"), $page, serialize($ops), serialize($banned));
$server->getAsyncPool()->submitTask($task);
return true;
}
Expand Down
15 changes: 7 additions & 8 deletions src/onebone/economyapi/task/SortTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,24 @@ class SortTask extends AsyncTask

/**
* @param string $player
* @param string $moneyData
* @param bool $addOp
* @param int $page
* @param array $ops
* @param array $banList
* @param string $ops
* @param string $banList
*/
//public function __construct(private string $sender, private array $addOp, private int $page, private array $ops, private array $banList) {}
public function __construct(private string $sender, private string $moneyData, private bool $addOp, private int $page, private string $ops, private string $banList) {}

//j'ai pas d'idée comment régler le problème. à compléter si vous avez.
//I have no idea how to fix the problem. to complete if you have.
public function onRun(): void
{
$this->topList = serialize((array)$this->getTopList());
}

private function getTopList()
{
$money = (array)$this->moneyData;
$banList = (array)$this->banList;
$ops = (array)$this->ops;
$money = (array)unserialize($this->moneyData);
$banList = (array)unserialize($this->banList);
$ops = (array)unserialize($this->ops);
arsort($money);

$ret = [];
Expand Down