From 90d401bbc3c68a8f5d4f6d04641919a738ae260b Mon Sep 17 00:00:00 2001 From: kremsy Date: Thu, 8 May 2014 19:34:19 +0200 Subject: [PATCH] customvotesplugin update dedicated api --- .../plugins/MCTeam/CustomVotesPlugin.php | 42 ++++++------------- 1 file changed, 12 insertions(+), 30 deletions(-) diff --git a/application/plugins/MCTeam/CustomVotesPlugin.php b/application/plugins/MCTeam/CustomVotesPlugin.php index 9677d781..649c5efd 100644 --- a/application/plugins/MCTeam/CustomVotesPlugin.php +++ b/application/plugins/MCTeam/CustomVotesPlugin.php @@ -173,24 +173,13 @@ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkP } /* Disable Standard Votes */ - $array["Command"] = VoteRatio::COMMAND_BAN; - $array["Param"] = ""; - $array["Ratio"] = (float)-1; - $ratioArray[] = $array; + $ratioArray[] = new VoteRatio(VoteRatio::COMMAND_BAN, -1.); + $ratioArray[] = new VoteRatio(VoteRatio::COMMAND_KICK, -1.); + $ratioArray[] = new VoteRatio(VoteRatio::COMMAND_RESTART_MAP, -1.); + $ratioArray[] = new VoteRatio(VoteRatio::COMMAND_TEAM_BALANCE, -1.); + $ratioArray[] = new VoteRatio(VoteRatio::COMMAND_NEXT_MAP, -1.); - $array["Command"] = VoteRatio::COMMAND_KICK; - $ratioArray[] = $array; - - $array["Command"] = VoteRatio::COMMAND_RESTART_MAP; - $ratioArray[] = $array; - - $array["Command"] = VoteRatio::COMMAND_TEAM_BALANCE; - $ratioArray[] = $array; - - $array["Command"] = VoteRatio::COMMAND_NEXT_MAP; - $ratioArray[] = $array; - - $this->maniaControl->client->setCallVoteRatiosEx(false, $ratioArray); + $this->maniaControl->client->setCallVoteRatios($ratioArray, false); $this->constructMenu(); return true; @@ -386,20 +375,13 @@ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkP //Enable Standard Votes $defaultRatio = $this->maniaControl->client->getCallVoteRatio(); - $array["Command"] = VoteRatio::COMMAND_BAN; - $array["Param"] = ""; - $array["Ratio"] = (float)$defaultRatio; - $ratioArray[] = $array; - $array["Command"] = VoteRatio::COMMAND_KICK; - $ratioArray[] = $array; - $array["Command"] = VoteRatio::COMMAND_RESTART_MAP; - $ratioArray[] = $array; - $array["Command"] = VoteRatio::COMMAND_TEAM_BALANCE; - $ratioArray[] = $array; - $array["Command"] = VoteRatio::COMMAND_NEXT_MAP; - $ratioArray[] = $array; + $ratioArray[] = new VoteRatio(VoteRatio::COMMAND_BAN, $defaultRatio); + $ratioArray[] = new VoteRatio(VoteRatio::COMMAND_KICK, $defaultRatio); + $ratioArray[] = new VoteRatio(VoteRatio::COMMAND_RESTART_MAP, $defaultRatio); + $ratioArray[] = new VoteRatio(VoteRatio::COMMAND_TEAM_BALANCE, $defaultRatio); + $ratioArray[] = new VoteRatio(VoteRatio::COMMAND_NEXT_MAP, $defaultRatio); - $this->maniaControl->client->setCallVoteRatiosEx(false, $ratioArray); + $this->maniaControl->client->setCallVoteRatios($ratioArray, false); $this->destroyVote(); $this->maniaControl->manialinkManager->hideManialink(self::MLID_ICON);