From cfd97f461dbd53b35789b9f03a3613f07842fa95 Mon Sep 17 00:00:00 2001 From: Beu Date: Wed, 16 Jun 2021 21:07:16 +0200 Subject: [PATCH] keep players who disconnect during the match & fix 1 page gsheet bug --- MatchManagerGSheet.zip | Bin 4824 -> 9344 bytes MatchManagerSuite/MatchManagerGSheet.php | 81 +++++++++++++---------- MatchManagerWidget.zip | Bin 0 -> 4180 bytes 3 files changed, 45 insertions(+), 36 deletions(-) create mode 100644 MatchManagerWidget.zip diff --git a/MatchManagerGSheet.zip b/MatchManagerGSheet.zip index 3d691dbe6a309097ae748c8a1d7c9bf29e1b0d4e..1106943a406fc3aff6e4eaffda2bb748f386ca31 100644 GIT binary patch literal 9344 zcma)?V{j(SyQgE@n&63TK1n7sv2EM7t%+^hwr$%^CbqTjf46Gut#fKmZFSwPFTeiO z)qT|^CkYOL0RjR71JYDFtDq%c(WZqC0wU-L0zw5s03xmLWN0R>Z=-K&?4amu?qtmP z?;TM^Gh<^X20Jr5WhGb;@DRyyz5kT68$1Xo#9wd_kpJCXYFWFki`9QwegBExM~v+o zW=vb_a=XM05bsAC=J#WDm5CQLG7Gc`8Wii7G2#6FR8e-7q$lxba@$^ZbTO1uRaI41 zRpry(+RxdM9a*@v9?7)xwLszmat8LjY&uP%KDV>d?v8A1uoC3}lhs|bdL1vHofn#G zruryo|;$P%)SibRF@Y<)+=ap7e`9;1>Co@fq>Ie zM9Sp*ZVve2P1s6*T(xTS@mA}t+I@76TIrqZ`iAazjiqBQ7X<}QK1Kol?xiIEM>e*JRgjURI_v@sJ`+_fWtX(zS#3s3qa z-di$v(wvl&11?9e_tsCm(lBn3^gmOXf~#Aa9^+^Jc32~}9^6+|F}F%IDYSKTY~XV@ z@U7r08)fL~*KDX>u(yYpH%zRtv(+Y>(KWQxa`ob`qTW6o@1#pv^MhXB;!0M3 zvq-w>rG*a#eaX9bcR|JnSo*c)0(~m1Y!PpO9ah?1HqGx-4OM@8&|PjWT}NR5v_#3Y zxX&$zJv~Rq3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p+000E&0{{R}O9ci1000010097Q0000~5&!@I0M*%QzyJUM diff --git a/MatchManagerSuite/MatchManagerGSheet.php b/MatchManagerSuite/MatchManagerGSheet.php index 5e33182..dde94d7 100644 --- a/MatchManagerSuite/MatchManagerGSheet.php +++ b/MatchManagerSuite/MatchManagerGSheet.php @@ -35,7 +35,7 @@ class MatchManagerGSheet implements CallbackListener, CommandListener, Plugin { * Constants */ const PLUGIN_ID = 156; - const PLUGIN_VERSION = 0.2; + const PLUGIN_VERSION = 0.3; const PLUGIN_NAME = 'MatchManager GSheet'; const PLUGIN_AUTHOR = 'Beu'; @@ -61,6 +61,8 @@ class MatchManagerGSheet implements CallbackListener, CommandListener, Plugin { private $access_token = ""; private $matchid = ""; + private $playerlist = array(); + /** * @param \ManiaControl\ManiaControl $maniaControl * @see \ManiaControl\Plugins\Plugin::prepare() @@ -375,6 +377,8 @@ class MatchManagerGSheet implements CallbackListener, CommandListener, Plugin { }); $asyncHttpRequest->getData(1000); + } else { + $this->maniaControl->getChat()->sendError("Can't have access to Google API service", $player); } } @@ -404,9 +408,13 @@ class MatchManagerGSheet implements CallbackListener, CommandListener, Plugin { $data->data[1] = new \stdClass; $data->data[1]->range = "'" . $sheetname . "'!A7"; - $players = []; + foreach ($this->maniaControl->getPlayerManager()->getPlayers() as $player) { - array_push($players,array($player->login, $player->nickname)); + $this->playerlist[$player->login] = $player->nickname; + } + $players = []; + foreach ($this->playerlist as $login => $nickname) { + array_push($players,array($login, $nickname)); } $data->data[1]->values = $players; @@ -465,22 +473,24 @@ class MatchManagerGSheet implements CallbackListener, CommandListener, Plugin { Logger::logError('Json parse error: ' . $json); return; } - if ($data->properties->title) { - $sheetname = $this->getSheetName(); + if ($data->properties->title) { $sheetsid = array(); + $sheetname = $this->getSheetName(); + $sheetexists = false; foreach($data->sheets as $value) { if ($value->properties->title == $sheetname) { unset($sheetsid); $sheetsid = array(); $sheetsid[0] = $value->properties->sheetId; + $sheetexists = true; break; } else { array_push($sheetsid,$value->properties->sheetId); } } $this->matchstatus = "starting"; - $this->PrepareSheet($sheetname, $sheetsid); + $this->PrepareSheet($sheetname, $sheetexists, $sheetsid ); } }); @@ -489,13 +499,19 @@ class MatchManagerGSheet implements CallbackListener, CommandListener, Plugin { } } - private function PrepareSheet(String $sheetname, array $sheetsid) { + private function PrepareSheet(String $sheetname, bool $sheetexists, Array $sheetsid) { if ($this->refreshTokenIfNeeded()) { + + $this->playerlist = array(); + foreach ($this->maniaControl->getPlayerManager()->getPlayers() as $player) { + $this->playerlist[$player->login] = $player->nickname; + } + $data = new \stdClass; $data->requests = array(); $i = 0; - if (count($sheetsid) > 1 || (count($sheetsid) == 1 && $sheetsid[0] == "0")) { + if (!$sheetexists) { Logger::Log("Creating new Sheet: " . $sheetname); $sheetid = rand(1000000000,2147483646); while (in_array($sheetid, $sheetsid)) { @@ -610,56 +626,49 @@ class MatchManagerGSheet implements CallbackListener, CommandListener, Plugin { $asyncHttpRequest->setHeaders(array("Authorization: Bearer " . $this->access_token)); $asyncHttpRequest->setContent(json_encode($data)); $asyncHttpRequest->setCallable(function ($json, $error) use ($sheetname) { - var_dump($json); $data = json_decode($json); if ($error || !$data) { Logger::logError('Error while Sending data: ' . print_r($error, true)); } - - // Add headers data - $data = new \stdClass; - $data->valueInputOption = "USER_ENTERED"; - - $data->data[0] = new \stdClass; - $data->data[0]->range = "'" . $sheetname . "'!A1"; - $data->data[0]->values = array(array("Informations"),array("Match status:", $this->matchstatus),array("Maps:","0/0"),array("Rounds:","0/0"),array(),array("Login:","Nickname:")); - - $data->data[1] = new \stdClass; - $data->data[1]->range = "'" . $sheetname . "'!D1"; - $data->data[1]->values = array(array("Rank","Login", "MatchPoints", "RoundPoints","Time","Team")); - - $data->data[2] = new \stdClass; - $data->data[2]->range = "'" . $sheetname . "'!K1"; - $data->data[2]->values = array(array("Rank","Team ID", "Name", "MatchPoints")); - - $asyncHttpRequest = new AsyncHttpRequest($this->maniaControl, 'https://sheets.googleapis.com/v4/spreadsheets/' . $this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_MATCHMANAGERGSHEET_SPREADSHEET) . '/values:batchUpdate'); - $asyncHttpRequest->setContentType(AsyncHttpRequest::CONTENT_TYPE_JSON); + // Clear Scoreboards data + $asyncHttpRequest = new AsyncHttpRequest($this->maniaControl, 'https://sheets.googleapis.com/v4/spreadsheets/' . $this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_MATCHMANAGERGSHEET_SPREADSHEET) . '/values/' . urlencode("'". $sheetname . "'") . '!A1:N300:clear'); $asyncHttpRequest->setHeaders(array("Authorization: Bearer " . $this->access_token)); - $asyncHttpRequest->setContent(json_encode($data)); $asyncHttpRequest->setCallable(function ($json, $error) use ($sheetname) { - var_dump($json); $data = json_decode($json); if ($error || !$data) { Logger::logError('Error while Sending data: ' . print_r($error, true)); } + // Add headers data + $data = new \stdClass; + $data->valueInputOption = "USER_ENTERED"; - // Clear Scoreboards data - $asyncHttpRequest = new AsyncHttpRequest($this->maniaControl, 'https://sheets.googleapis.com/v4/spreadsheets/' . $this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_MATCHMANAGERGSHEET_SPREADSHEET) . '/values/' . urlencode("'". $sheetname . "'") . '!D2:N300:clear'); + $data->data[0] = new \stdClass; + $data->data[0]->range = "'" . $sheetname . "'!A1"; + $data->data[0]->values = array(array("Informations"),array("Match status:", $this->matchstatus),array("Maps:","0/0"),array("Rounds:","0/0"),array(),array("Login:","Nickname:")); + + $data->data[1] = new \stdClass; + $data->data[1]->range = "'" . $sheetname . "'!D1"; + $data->data[1]->values = array(array("Rank","Login", "MatchPoints", "RoundPoints","Time","Team")); + + $data->data[2] = new \stdClass; + $data->data[2]->range = "'" . $sheetname . "'!K1"; + $data->data[2]->values = array(array("Rank","Team ID", "Name", "MatchPoints")); + + $asyncHttpRequest = new AsyncHttpRequest($this->maniaControl, 'https://sheets.googleapis.com/v4/spreadsheets/' . $this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_MATCHMANAGERGSHEET_SPREADSHEET) . '/values:batchUpdate'); + $asyncHttpRequest->setContentType(AsyncHttpRequest::CONTENT_TYPE_JSON); $asyncHttpRequest->setHeaders(array("Authorization: Bearer " . $this->access_token)); - $asyncHttpRequest->setCallable(function ($json, $error) { + $asyncHttpRequest->setContent(json_encode($data)); + $asyncHttpRequest->setCallable(function ($json, $error) use ($sheetname) { $data = json_decode($json); if ($error || !$data) { - var_dump($json); Logger::logError('Error while Sending data: ' . print_r($error, true)); } }); - $asyncHttpRequest->postData(1000); }); $asyncHttpRequest->postData(1000); }); $asyncHttpRequest->postData(1000); - } } } diff --git a/MatchManagerWidget.zip b/MatchManagerWidget.zip new file mode 100644 index 0000000000000000000000000000000000000000..fc0dec041b2c85f5851fc5881d64c36e3fd3eb90 GIT binary patch literal 4180 zcmaKwXEYlQ+r~puV$aryzY)X=u~$l|J!-EKTa0S0ioLgrR>Y{SwpyiBYZkTD)*_{9 z7PV`SzJ1>J%X8jyp6A@>y4Q#6^ZmOGbbug600006>_mPxQdvx#@u2xTX#fEH05-q_ zdtXP_2lgKJE@&TPjGHeS@$VaRHzyaguZWkcm#GOE0C-K`XZPo?FaZ<*BG6AD0Pw$Q zhmGLJs&V)*L`@@}L0y_Y^%sweVKvo#i)9cObYHE1@(1Pk$4@P#FS4s zj5>8l2v2vf+p688`Sv3?Bjiyayo@OM3vmVnMUhbxv(-1@z>I*BQ*_V4DQlmj)R7&R ziRucT>iBa^{cmVj!G=v9>4H7j(Kdc1`LdEBNcr2DQgncV$v{Bk{lXfrRAGf9oyA5P zzMhsHI1ADb zHr(&~bpD(&G_zju8VqsPa~oW(9l^=FD!I8QT@}AE#Fn!Y6mwa4-qG+$*6J_J&dn=2 zNis_n@neJRpGZbOnSW1K1ZC$YD&>}kdTWCENd_REAn;&rl1scK@J_TDEdu5t3N5s% zhx9t&Rl1bjwhP~IF&0@K_mH_PO@K8R)8sfEzq%AoHpfaXJ`U_wW)#%VXB@!8Va(W- zX~ZrxKW?J0kItIb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