From 1b07027740fc6d33e896fa5dceace8930d938310 Mon Sep 17 00:00:00 2001 From: Cooper <73203995+coopeeo@users.noreply.github.com> Date: Sat, 4 May 2024 12:02:10 -0500 Subject: [PATCH 01/27] Make GJComment work --- src/GDComment.php | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/GDComment.php b/src/GDComment.php index 573a595..d8f217d 100644 --- a/src/GDComment.php +++ b/src/GDComment.php @@ -57,7 +57,8 @@ public function __construct ($h, $u, $p, $s = null){ $ch = curl_init (); curl_setopt ($ch, CURLOPT_URL, $this->host."/accounts/loginGJAccount.php"); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt ($ch, CURLOPT_POSTFIELDS, ["secret" => "Wmfv3899gc9", "userName" => $this->username, "password" => $this->password, "udid" => $udid, "sID" => $sid]); + curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query(["secret" => "Wmfv3899gc9", "userName" => $this->username, "password" => $this->password, "udid" => $udid, "sID" => $sid, "gameVersion" => '22', "binaryVersion" => '35'])); + curl_setopt($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded", "x-forwarded-for: ". $this->getServerIp()]); $info = explode (",", curl_exec ($ch)); $this->usrID = $info[1]; $this->accID = $info[0]; @@ -76,7 +77,8 @@ public function postAccComment ($t, bool $bool = false){ $comment = base64_encode($t); $ch = curl_init ($this->host."/uploadGJAccComment20.php"); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt ($ch, CURLOPT_POSTFIELDS, ["userName" => $this->username, "gjp" => $this->gjp, "comment" => $comment, "accountID" => $this->accID, "secret" => $secret]); + curl_setopt ($ch, CURLOPT_POSTFIELDS, ["userName" => $this->username, "gjp" => $this->gjp, "comment" => $comment, "accountID" => $this->accID, "secret" => $secret, "gameVersion" => '22', "binaryVersion" => '35'])); + curl_setopt($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded", "x-forwarded-for: ". $this->getServerIp()]); $res = curl_exec ($ch); if ($res == "-1"){ include __DIR__."/Exception/GDErrors.php"; @@ -105,17 +107,16 @@ public function postComment (string $t, int $l, $bool = false){ //$chk = "UA4BDAQBC1IPVQUMVw0AUAoCWlAAAFFZUwBYBg0JVFoCWwlWC1cPAQ=="; $ch = curl_init ($this->host."/uploadGJComment21.php"); - $headers = array ("X-FORWARDED-FOR: ". $this->getServerIp()); - curl_setopt ($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt ($ch, CURLOPT_POSTFIELDS, ["userName" => $this->username, "gjp" => $this->gjp,"chk" => $chk, "accountID" => $this->accID, "gameVersion" => $gameVersion, "binaryVersion" => $binaryVersion, "comment" => $comment, "levelID" => $levelID, "percent" => $percent, "secret" => $secret]); + curl_setopt ($ch, CURLOPT_POSTFIELDS, ["userName" => $this->username, "gjp" => $this->gjp,"chk" => $chk, "accountID" => $this->accID, "gameVersion" => "22", "binaryVersion" => "35", "comment" => $comment, "levelID" => $levelID, "percent" => $percent, "secret" => $secret]); + curl_setopt($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded", "x-forwarded-for: ". $this->getServerIp()]); if (curl_exec($ch) == "-1"){ include __DIR__."/Exception/GDErrors.php"; $err = new GDErrors ($this->host); if ($bool = false){ GDErrors::GDPostComment ($levelID); } elseif ($bool = true){ - return curl_exec ($ch)."/". $chk."/". $gameVersion."/". $this->gjp."\/". $comment."/". $secret."/". $this->accID."/". $this->username; + return curl_exec ($ch)."/". $chk."/". "22"."/". $this->gjp."\/". $comment."/". $secret."/". $this->accID."/". $this->username; } } else { return curl_exec ($ch); @@ -132,7 +133,8 @@ public function fetchComment ($i, $m = 0, $c = 0){ $levelID = $i; $ch = curl_init ($url); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt ($ch, CURLOPT_POSTFIELDS, ["secret" => $secret, "levelID" => $levelID, "gameVersion" => $gameVersion, "binaryVersion" => $binaryVersion, "mode" => $m, "page" => $c, "count" => 10]); + curl_setopt ($ch, CURLOPT_POSTFIELDS, ["secret" => $secret, "levelID" => $levelID, "gameVersion" => "22", "binaryVersion" => "35", "mode" => $m, "page" => $c, "count" => 10]); + curl_setopt($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded", "x-forwarded-for: ". $this->getServerIp()]); $arr = explode ("#", curl_exec ($ch))[0]; $arr = explode ("|", $arr); foreach ( $arr as $fetch){ @@ -181,14 +183,14 @@ public function fetchAccComment (){ $page = $this->getPage (); $ch = curl_init ($url); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt ($ch, CURLOPT_POSTFIELDS, [ - "gameVersion" => $gameVersion, - "binaryVersion" => $binaryVersion, + curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query([ + "gameVersion" => '22', + "binaryVersion" => '35', "secret" => $secret, "accountID" => $accounts, "page" => $page, - "total" => 10]); - + "total" => 10])); + curl_setopt($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded", "x-forwarded-for: ". $this->getServerIp()]); $result = curl_exec ($ch); $result = explode ("#", $result)[0]; $result = explode ("|", $result); @@ -214,9 +216,10 @@ public function fetchCommentHistory ($m = 0){ $userID = $this->usrID; $page = $this->getPage (); - $pst = ["gameVersion" => $gameVersion, "binaryVersion" => $binaryVersion, "userID" => $userID, "total" => 10, "secret" => $secret, "mode" => $m, "page" => $page]; + $pst = ["gameVersion" => "22", "binaryVersion" => "35", "userID" => $userID, "total" => 10, "secret" => $secret, "mode" => $m, "page" => $page]; $ch = curl_init ($host); + curl_setopt($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded", "x-forwarded-for: ". $this->getServerIp()]); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt ($ch, CURLOPT_POSTFIELDS, $pst); From 10ce05262acf91a60193f78a5d0622924e661a5e Mon Sep 17 00:00:00 2001 From: Cooper <73203995+coopeeo@users.noreply.github.com> Date: Sat, 4 May 2024 12:07:25 -0500 Subject: [PATCH 02/27] fix GDConfig --- src/GDComment.php | 8 ++++---- src/GDConfig.php | 21 +++++++++++++-------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/GDComment.php b/src/GDComment.php index d8f217d..5963cc5 100644 --- a/src/GDComment.php +++ b/src/GDComment.php @@ -77,7 +77,7 @@ public function postAccComment ($t, bool $bool = false){ $comment = base64_encode($t); $ch = curl_init ($this->host."/uploadGJAccComment20.php"); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt ($ch, CURLOPT_POSTFIELDS, ["userName" => $this->username, "gjp" => $this->gjp, "comment" => $comment, "accountID" => $this->accID, "secret" => $secret, "gameVersion" => '22', "binaryVersion" => '35'])); + curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query(["userName" => $this->username, "gjp" => $this->gjp, "comment" => $comment, "accountID" => $this->accID, "secret" => $secret, "gameVersion" => '22', "binaryVersion" => '35'])); curl_setopt($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded", "x-forwarded-for: ". $this->getServerIp()]); $res = curl_exec ($ch); if ($res == "-1"){ @@ -108,7 +108,7 @@ public function postComment (string $t, int $l, $bool = false){ $ch = curl_init ($this->host."/uploadGJComment21.php"); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt ($ch, CURLOPT_POSTFIELDS, ["userName" => $this->username, "gjp" => $this->gjp,"chk" => $chk, "accountID" => $this->accID, "gameVersion" => "22", "binaryVersion" => "35", "comment" => $comment, "levelID" => $levelID, "percent" => $percent, "secret" => $secret]); + curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query(["userName" => $this->username, "gjp" => $this->gjp,"chk" => $chk, "accountID" => $this->accID, "gameVersion" => "22", "binaryVersion" => "35", "comment" => $comment, "levelID" => $levelID, "percent" => $percent, "secret" => $secret])); curl_setopt($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded", "x-forwarded-for: ". $this->getServerIp()]); if (curl_exec($ch) == "-1"){ include __DIR__."/Exception/GDErrors.php"; @@ -133,7 +133,7 @@ public function fetchComment ($i, $m = 0, $c = 0){ $levelID = $i; $ch = curl_init ($url); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt ($ch, CURLOPT_POSTFIELDS, ["secret" => $secret, "levelID" => $levelID, "gameVersion" => "22", "binaryVersion" => "35", "mode" => $m, "page" => $c, "count" => 10]); + curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query(["secret" => $secret, "levelID" => $levelID, "gameVersion" => "22", "binaryVersion" => "35", "mode" => $m, "page" => $c, "count" => 10])); curl_setopt($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded", "x-forwarded-for: ". $this->getServerIp()]); $arr = explode ("#", curl_exec ($ch))[0]; $arr = explode ("|", $arr); @@ -216,7 +216,7 @@ public function fetchCommentHistory ($m = 0){ $userID = $this->usrID; $page = $this->getPage (); - $pst = ["gameVersion" => "22", "binaryVersion" => "35", "userID" => $userID, "total" => 10, "secret" => $secret, "mode" => $m, "page" => $page]; + $pst = http_build_query(["gameVersion" => "22", "binaryVersion" => "35", "userID" => $userID, "total" => 10, "secret" => $secret, "mode" => $m, "page" => $page]); $ch = curl_init ($host); curl_setopt($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded", "x-forwarded-for: ". $this->getServerIp()]); diff --git a/src/GDConfig.php b/src/GDConfig.php index 7129610..895cc95 100644 --- a/src/GDConfig.php +++ b/src/GDConfig.php @@ -19,7 +19,7 @@ public function __construct ($a, $b = null, $c = null){ $sid = mt_rand(111111111,999999999) . mt_rand(11111111,99999999); curl_setopt ($ch, CURLOPT_URL, $this->host."/accounts/loginGJAccount.php"); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt ($ch, CURLOPT_POSTFIELDS, ["secret" => "Wmfv3899gc9", "userName" => $this->username, "password" => $this->password, "udid" => $udid, "sID" => $sid]); + curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query(["secret" => "Wmfv3899gc9", "userName" => $this->username, "password" => $this->password, "udid" => $udid, "sID" => $sid, "gameVersion" => '22', "binaryVersion" => '35'])); if (curl_exec($ch) == "-1"){ include __DIR__."/Exception/GDErrors.php"; $err = new GDErrors($this->host); @@ -88,17 +88,19 @@ public function downloadSaveData ($p){ include __DIR__."/../config/config.php"; $url = $this->getAccountURL(); $url = $url."/database/accounts/syncGJAccountNew.php"; - $postfields["gameVersion"] = $gameVersion; - $postfields["binaryVersion"] = 35; $postfields["userName"] = $this->username; $postfields["accountID"] = $this->accountID; $postfields["password"] = $this->password; $postfields["secret"] = "Wmfv3899gc9"; $postfields["gdw"] = 0; + $postfields["gameVersion"] = '22' + $postfields["binaryVersion"] = '35' + $ch = curl_init ($url); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt ($ch, CURLOPT_POSTFIELDS, $postfields); + curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query($postfields)); + curl_setopt ($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded"]); $response = curl_exec ($ch); file_put_contents ($p, explode (";", $response)[0]); return $response; @@ -107,8 +109,8 @@ public function uploadSaveData ($kizunaAI){ include __DIR__."/../config/config.php"; $url = $this->getAccountURL(); $url = $url."/database/accounts/backupGJAccountNew.php"; - $postfields["gameVersion"] = $gameVersion; - $postfields["binaryVersion"] = 35; + $postfields["gameVersion"] = '22' + $postfields["binaryVersion"] = '35' $postfields["userName"] = $this->username; $postfields["accountID"] = $this->accountID; $postfields["password"] = $this->password; @@ -118,7 +120,8 @@ public function uploadSaveData ($kizunaAI){ $ch = curl_init ($url); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt ($ch, CURLOPT_POSTFIELDS, $postfields); + curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query($postfields)); + curl_setopt ($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded"]); $response = curl_exec ($ch); if ($response == "-1" || empty ($response)){ return "Upload Save Data Failed! / ". $response; @@ -130,10 +133,12 @@ private function getAccountURL(){ $postURL["accountID"] = $this->accountID; $postURL["type"] = "2"; $postURL["secret"] = "Wmfd2893gb7"; + $ch = curl_init ($this->host."/getAccountURL.php"); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt ($ch, CURLOPT_POSTFIELDS, $postURL); + curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query($postURL)); + curl_setopt ($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded"]); $newHost = curl_exec ($ch); curl_close ($ch); return $newHost; From 268823f99368874fb2617a99aa8ec0e38e6725e4 Mon Sep 17 00:00:00 2001 From: Cooper <73203995+coopeeo@users.noreply.github.com> Date: Sat, 4 May 2024 12:08:26 -0500 Subject: [PATCH 03/27] Fix GDProfile --- src/GDProfile.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/GDProfile.php b/src/GDProfile.php index 9f2902f..b03cdaa 100644 --- a/src/GDProfile.php +++ b/src/GDProfile.php @@ -29,7 +29,8 @@ public function __construct ($u, $a, $s = null){ $host = $u; $ch = curl_init ($host."/getGJUserInfo20.php"); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt ($ch, CURLOPT_POSTFIELDS, ["targetAccountID" => $tar, "secret" => $secret]); + curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query(["targetAccountID" => $tar, "secret" => $secret, "gameVersion" => '22', "binaryVersion" => '35'])); + curl_setopt ($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded"]); if ($s == true){ if (curl_exec ($ch) == "1"){ echo "Not Found"; From 224dc81c4badb933b37a7272b1196955ac427bc1 Mon Sep 17 00:00:00 2001 From: Cooper <73203995+coopeeo@users.noreply.github.com> Date: Sat, 4 May 2024 12:09:35 -0500 Subject: [PATCH 04/27] Fix GDLevel --- src/GDLevel.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/GDLevel.php b/src/GDLevel.php index 8b61ed6..637566f 100644 --- a/src/GDLevel.php +++ b/src/GDLevel.php @@ -26,7 +26,8 @@ public function __construct ($h, $i, $n = null){ $ch = curl_init(); curl_setopt ($ch, CURLOPT_URL, $h."/downloadGJLevel22.php"); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt ($ch, CURLOPT_POSTFIELDS, ["levelID" => $i, "secret" => $secret]); + curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query(["levelID" => $i, "secret" => $secret, "gameVersion" => '22', "binaryVersion" => '35'])); + curl_setopt ($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded"]); $info = explode (":", curl_exec ($ch)); $this->fullString = curl_exec ($ch); From 3cd3008d0487a7be8eee80cc40617c0764c25c3a Mon Sep 17 00:00:00 2001 From: Cooper <73203995+coopeeo@users.noreply.github.com> Date: Sat, 4 May 2024 12:13:09 -0500 Subject: [PATCH 05/27] fix GDMessage --- src/GDComment.php | 12 ++++++------ src/GDMessage.php | 15 ++++++++++----- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/GDComment.php b/src/GDComment.php index 5963cc5..348e2c6 100644 --- a/src/GDComment.php +++ b/src/GDComment.php @@ -58,7 +58,7 @@ public function __construct ($h, $u, $p, $s = null){ curl_setopt ($ch, CURLOPT_URL, $this->host."/accounts/loginGJAccount.php"); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query(["secret" => "Wmfv3899gc9", "userName" => $this->username, "password" => $this->password, "udid" => $udid, "sID" => $sid, "gameVersion" => '22', "binaryVersion" => '35'])); - curl_setopt($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded", "x-forwarded-for: ". $this->getServerIp()]); + curl_setopt ($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded", "x-forwarded-for: ". $this->getServerIp()]); $info = explode (",", curl_exec ($ch)); $this->usrID = $info[1]; $this->accID = $info[0]; @@ -78,7 +78,7 @@ public function postAccComment ($t, bool $bool = false){ $ch = curl_init ($this->host."/uploadGJAccComment20.php"); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query(["userName" => $this->username, "gjp" => $this->gjp, "comment" => $comment, "accountID" => $this->accID, "secret" => $secret, "gameVersion" => '22', "binaryVersion" => '35'])); - curl_setopt($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded", "x-forwarded-for: ". $this->getServerIp()]); + curl_setopt ($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded", "x-forwarded-for: ". $this->getServerIp()]); $res = curl_exec ($ch); if ($res == "-1"){ include __DIR__."/Exception/GDErrors.php"; @@ -109,7 +109,7 @@ public function postComment (string $t, int $l, $bool = false){ $ch = curl_init ($this->host."/uploadGJComment21.php"); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query(["userName" => $this->username, "gjp" => $this->gjp,"chk" => $chk, "accountID" => $this->accID, "gameVersion" => "22", "binaryVersion" => "35", "comment" => $comment, "levelID" => $levelID, "percent" => $percent, "secret" => $secret])); - curl_setopt($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded", "x-forwarded-for: ". $this->getServerIp()]); + curl_setopt ($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded", "x-forwarded-for: ". $this->getServerIp()]); if (curl_exec($ch) == "-1"){ include __DIR__."/Exception/GDErrors.php"; $err = new GDErrors ($this->host); @@ -134,7 +134,7 @@ public function fetchComment ($i, $m = 0, $c = 0){ $ch = curl_init ($url); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query(["secret" => $secret, "levelID" => $levelID, "gameVersion" => "22", "binaryVersion" => "35", "mode" => $m, "page" => $c, "count" => 10])); - curl_setopt($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded", "x-forwarded-for: ". $this->getServerIp()]); + curl_setopt ($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded", "x-forwarded-for: ". $this->getServerIp()]); $arr = explode ("#", curl_exec ($ch))[0]; $arr = explode ("|", $arr); foreach ( $arr as $fetch){ @@ -190,7 +190,7 @@ public function fetchAccComment (){ "accountID" => $accounts, "page" => $page, "total" => 10])); - curl_setopt($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded", "x-forwarded-for: ". $this->getServerIp()]); + curl_setopt ($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded", "x-forwarded-for: ". $this->getServerIp()]); $result = curl_exec ($ch); $result = explode ("#", $result)[0]; $result = explode ("|", $result); @@ -219,7 +219,7 @@ public function fetchCommentHistory ($m = 0){ $pst = http_build_query(["gameVersion" => "22", "binaryVersion" => "35", "userID" => $userID, "total" => 10, "secret" => $secret, "mode" => $m, "page" => $page]); $ch = curl_init ($host); - curl_setopt($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded", "x-forwarded-for: ". $this->getServerIp()]); + curl_setopt ($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded", "x-forwarded-for: ". $this->getServerIp()]); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt ($ch, CURLOPT_POSTFIELDS, $pst); diff --git a/src/GDMessage.php b/src/GDMessage.php index 7d9cae7..d46f300 100644 --- a/src/GDMessage.php +++ b/src/GDMessage.php @@ -74,7 +74,8 @@ public function __construct ($h, $u, $p){ $sid = mt_rand(111111111,999999999) . mt_rand(11111111,99999999); $ch = curl_init ($this->host."/accounts/loginGJAccount.php"); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt ($ch, CURLOPT_POSTFIELDS, ["udid" => $udid, "sID" => $sid,"userName" => $u, "password" => $p, "secret" => "Wmfv3899gc9"]); + curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query(["udid" => $udid, "sID" => $sid,"userName" => $u, "password" => $p, "secret" => "Wmfv3899gc9", "gameVersion" => '22', "binaryVersion" => '35'])); + curl_setopt ($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded"]); $res = curl_exec ($ch); if ($res == "-1"){ include __DIR__."/Exception/GDErrors.php"; @@ -92,7 +93,8 @@ public function getMessage ($pgm = 0){ $url = $this->host."/getGJMessages20.php"; $ch = curl_init ($url); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt ($ch, CURLOPT_POSTFIELDS, ["accountID" => $this->accID, "page" => $pgm, "getSent" => 0, "gjp" => self::$gjp, "secret" => $secret]); + curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query(["accountID" => $this->accID, "page" => $pgm, "getSent" => 0, "gjp" => self::$gjp, "secret" => $secret, "gameVersion" => '22', "binaryVersion" => '35'])); + curl_setopt ($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded"]); $res = curl_exec ($ch); if ($res == "-1"){ return "Nothing here"; @@ -111,7 +113,8 @@ public function readMessage (int $mk){ $url = $this->host."/downloadGJMessage20.php"; $ch = curl_init ($url); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt ($ch, CURLOPT_POSTFIELDS, ["accountID" => $this->accID, "secret" => $secret, "gjp" => self::$gjp, "messageID" => $mk]); + curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query(["accountID" => $this->accID, "secret" => $secret, "gjp" => self::$gjp, "messageID" => $mk, "gameVersion" => '22', "binaryVersion" => '35'])); + curl_setopt ($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded"]); $res = curl_exec ($ch); $info = explode (":", $res); $message = $this->cipher (base64_decode($info[15]), 14251); @@ -121,10 +124,11 @@ public function readMessage (int $mk){ public function deleteMessage (int $o){ include __DIR__."/../config/config.php"; $messageID = $o; - $post = ["accountID" => $this->accID, "gjp" => self::$gjp, "messageID" => $messageID, "secret" => $secret]; + $post = http_build_query(["accountID" => $this->accID, "gjp" => self::$gjp, "messageID" => $messageID, "secret" => $secret, "gameVersion" => '22', "binaryVersion" => '35']); $ch = curl_init ($this->host."/deleteGJMessages20.php"); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt ($ch, CURLOPT_POSTFIELDS, $post); + curl_setopt ($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded"]); echo curl_exec ($ch); } public function sendMessage (string $m, string $s, int $t){ @@ -137,7 +141,8 @@ public function sendMessage (string $m, string $s, int $t){ $toAccount = $t; $ch = curl_init ($this->host."/uploadGJMessage20.php"); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt ($ch, CURLOPT_POSTFIELDS, ["toAccountID" => $toAccount, "accountID" => $this->accID, "gjp" => self::$gjp, "body" => $message, "subject" => $subject, "secret" => $secret]); + curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query(["toAccountID" => $toAccount, "accountID" => $this->accID, "gjp" => self::$gjp, "body" => $message, "subject" => $subject, "secret" => $secret, "gameVersion" => '22', "binaryVersion" => '35'])); + curl_setopt ($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded"]); return curl_exec ($ch); } } \ No newline at end of file From 49847e93dece8db4f33c7e1a2e1a4381bc13d36b Mon Sep 17 00:00:00 2001 From: Cooper <73203995+coopeeo@users.noreply.github.com> Date: Sat, 4 May 2024 12:16:45 -0500 Subject: [PATCH 06/27] fix GDRegister --- src/GDConfig.php | 10 ++++++---- src/GDRegister.php | 5 ++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/GDConfig.php b/src/GDConfig.php index 895cc95..272f0f8 100644 --- a/src/GDConfig.php +++ b/src/GDConfig.php @@ -93,8 +93,8 @@ public function downloadSaveData ($p){ $postfields["password"] = $this->password; $postfields["secret"] = "Wmfv3899gc9"; $postfields["gdw"] = 0; - $postfields["gameVersion"] = '22' - $postfields["binaryVersion"] = '35' + $postfields["gameVersion"] = '22'; + $postfields["binaryVersion"] = '35'; $ch = curl_init ($url); @@ -109,8 +109,8 @@ public function uploadSaveData ($kizunaAI){ include __DIR__."/../config/config.php"; $url = $this->getAccountURL(); $url = $url."/database/accounts/backupGJAccountNew.php"; - $postfields["gameVersion"] = '22' - $postfields["binaryVersion"] = '35' + $postfields["gameVersion"] = '22'; + $postfields["binaryVersion"] = '35'; $postfields["userName"] = $this->username; $postfields["accountID"] = $this->accountID; $postfields["password"] = $this->password; @@ -133,6 +133,8 @@ private function getAccountURL(){ $postURL["accountID"] = $this->accountID; $postURL["type"] = "2"; $postURL["secret"] = "Wmfd2893gb7"; + $postURL["gameVersion"] = '22'; + $postURL["binaryVersion"] = '35'; $ch = curl_init ($this->host."/getAccountURL.php"); diff --git a/src/GDRegister.php b/src/GDRegister.php index 2326b17..51a61ff 100644 --- a/src/GDRegister.php +++ b/src/GDRegister.php @@ -12,10 +12,13 @@ public function __construct ($h, $u, $p, $e){ $post["password"] = $password; $post["email"] = $email; $post["secret"] = "Wmfv3899gc9"; + $post["gameVersion"] = '22'; + $post["binaryVersion"] = '35'; $ch = curl_init ($url); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt ($ch, CURLOPT_POSTFIELDS, $post); + curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query($post)); + curl_setopt ($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded"]); $res = curl_exec ($ch); } } \ No newline at end of file From 38782a09c85ac04ee103e33a69c1185286d82441 Mon Sep 17 00:00:00 2001 From: Cooper <73203995+coopeeo@users.noreply.github.com> Date: Sat, 4 May 2024 12:18:14 -0500 Subject: [PATCH 07/27] fix GDSong --- src/GDSong.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/GDSong.php b/src/GDSong.php index 71129c1..485eab2 100644 --- a/src/GDSong.php +++ b/src/GDSong.php @@ -13,8 +13,11 @@ public function __construct ($i2, $i, $s = null){ $ch = curl_init ($host); $post["songID"] = $i; $post["secret"] = $secret; + $post["gameVersion"] = '22'; + $post["binaryVersion"] = '35'; curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt ($ch, CURLOPT_POSTFIELDS, $post); + curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query($post)); + curl_setopt($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded"]); if ($s == true){ if (curl_exec ($ch) == "-1" OR curl_exec ($ch) == ""){ echo "Not Found"; From 80f55e67b6869875507f04ff340ae6652d367882 Mon Sep 17 00:00:00 2001 From: Cooper <73203995+coopeeo@users.noreply.github.com> Date: Sat, 4 May 2024 12:18:42 -0500 Subject: [PATCH 08/27] update version, hopefully all fixed --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 2e4ec41..a017bab 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "description": "This is a library, i think", "keywords": ["api", "php", "GD-API", "geometrydash", "php-library", "geometrydash-api"], "license":"MIT", - "version": "1.0", + "version": "1.1", "autoload": { "psr-4": { "GD-API\\GD-API\\": "autoload.php" From 4f01dfd8cb88e9930ec190458c3a29c98b764079 Mon Sep 17 00:00:00 2001 From: Cooper <73203995+coopeeo@users.noreply.github.com> Date: Sat, 4 May 2024 12:31:08 -0500 Subject: [PATCH 09/27] test --- src/GDProfile.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/GDProfile.php b/src/GDProfile.php index b03cdaa..355897b 100644 --- a/src/GDProfile.php +++ b/src/GDProfile.php @@ -28,6 +28,7 @@ public function __construct ($u, $a, $s = null){ $tar = $a; $host = $u; $ch = curl_init ($host."/getGJUserInfo20.php"); + curl_setopt ($ch, CURLOPT_POST, true); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query(["targetAccountID" => $tar, "secret" => $secret, "gameVersion" => '22', "binaryVersion" => '35'])); curl_setopt ($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded"]); From 09b8ef10be120fcf1ba6752c2cec0536a02d8328 Mon Sep 17 00:00:00 2001 From: Cooper <73203995+coopeeo@users.noreply.github.com> Date: Sat, 4 May 2024 12:32:22 -0500 Subject: [PATCH 10/27] test number 2 --- src/GDProfile.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/GDProfile.php b/src/GDProfile.php index 355897b..e09e1c5 100644 --- a/src/GDProfile.php +++ b/src/GDProfile.php @@ -27,7 +27,8 @@ public function __construct ($u, $a, $s = null){ include __DIR__."/../config/config.php"; $tar = $a; $host = $u; - $ch = curl_init ($host."/getGJUserInfo20.php"); + $ch = curl_init (); + curl_setopt ($ch, CURLOPT_URL, $host."/getGJUserInfo20.php"); curl_setopt ($ch, CURLOPT_POST, true); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query(["targetAccountID" => $tar, "secret" => $secret, "gameVersion" => '22', "binaryVersion" => '35'])); From 39d6e1f467afe824fe49605e471def5c4cc56ebe Mon Sep 17 00:00:00 2001 From: Cooper <73203995+coopeeo@users.noreply.github.com> Date: Sat, 4 May 2024 12:32:48 -0500 Subject: [PATCH 11/27] test NUMBER 3! --- src/GDProfile.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/GDProfile.php b/src/GDProfile.php index e09e1c5..1c5188e 100644 --- a/src/GDProfile.php +++ b/src/GDProfile.php @@ -42,6 +42,7 @@ public function __construct ($u, $a, $s = null){ } $this->fullString = curl_exec ($ch); $info = explode (":", curl_exec ($ch)); + curl_close($curl); $this->userName = $info[1]; $this->usrID = $info[3]; $this->coins = $info[7]; From 2f5af164aeca126c7912de5adb997efcda61eb68 Mon Sep 17 00:00:00 2001 From: Cooper <73203995+coopeeo@users.noreply.github.com> Date: Sat, 4 May 2024 12:33:21 -0500 Subject: [PATCH 12/27] oops, TEST NUMBER 4!!!!!!!!!!!!!! --- src/GDProfile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GDProfile.php b/src/GDProfile.php index 1c5188e..d1d108a 100644 --- a/src/GDProfile.php +++ b/src/GDProfile.php @@ -42,7 +42,7 @@ public function __construct ($u, $a, $s = null){ } $this->fullString = curl_exec ($ch); $info = explode (":", curl_exec ($ch)); - curl_close($curl); + curl_close($ch); $this->userName = $info[1]; $this->usrID = $info[3]; $this->coins = $info[7]; From 6209cd9e081d5ef2afa211350e87ade094a6e9c5 Mon Sep 17 00:00:00 2001 From: Cooper <73203995+coopeeo@users.noreply.github.com> Date: Sat, 4 May 2024 12:36:20 -0500 Subject: [PATCH 13/27] eeeeeeee more testing! --- src/GDProfile.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/GDProfile.php b/src/GDProfile.php index d1d108a..56d2130 100644 --- a/src/GDProfile.php +++ b/src/GDProfile.php @@ -33,6 +33,11 @@ public function __construct ($u, $a, $s = null){ curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query(["targetAccountID" => $tar, "secret" => $secret, "gameVersion" => '22', "binaryVersion" => '35'])); curl_setopt ($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded"]); + $debug = $_POST["debug"] == "true"; + if ($debug) { + echo json_encode(["accept: */*", "content-type: application/x-www-form-urlencoded"]); + echo http_build_query(["targetAccountID" => $tar, "secret" => $secret, "gameVersion" => '22', "binaryVersion" => '35']); + } if ($s == true){ if (curl_exec ($ch) == "1"){ echo "Not Found"; From 84a531c9cf5d2236269f74d013d5a3d977d4b0d0 Mon Sep 17 00:00:00 2001 From: Cooper <73203995+coopeeo@users.noreply.github.com> Date: Sat, 4 May 2024 12:37:17 -0500 Subject: [PATCH 14/27] AGHGGGGGGGGGGGGGGGGGGGGGHHHHHHHHHHHHHHHHHHHH --- src/GDProfile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GDProfile.php b/src/GDProfile.php index 56d2130..16a3cc4 100644 --- a/src/GDProfile.php +++ b/src/GDProfile.php @@ -33,7 +33,7 @@ public function __construct ($u, $a, $s = null){ curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query(["targetAccountID" => $tar, "secret" => $secret, "gameVersion" => '22', "binaryVersion" => '35'])); curl_setopt ($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded"]); - $debug = $_POST["debug"] == "true"; + $debug = $_GET["debug"] == "true"; if ($debug) { echo json_encode(["accept: */*", "content-type: application/x-www-form-urlencoded"]); echo http_build_query(["targetAccountID" => $tar, "secret" => $secret, "gameVersion" => '22', "binaryVersion" => '35']); From 460839b73dca29caab08c8067bf7b27c3e44279a Mon Sep 17 00:00:00 2001 From: Cooper <73203995+coopeeo@users.noreply.github.com> Date: Sat, 4 May 2024 12:38:54 -0500 Subject: [PATCH 15/27] MOAR TESTING --- src/GDProfile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GDProfile.php b/src/GDProfile.php index 16a3cc4..0e323ca 100644 --- a/src/GDProfile.php +++ b/src/GDProfile.php @@ -36,7 +36,7 @@ public function __construct ($u, $a, $s = null){ $debug = $_GET["debug"] == "true"; if ($debug) { echo json_encode(["accept: */*", "content-type: application/x-www-form-urlencoded"]); - echo http_build_query(["targetAccountID" => $tar, "secret" => $secret, "gameVersion" => '22', "binaryVersion" => '35']); + echo json_encode(["targetAccountID" => $tar, "secret" => $secret, "gameVersion" => '22', "binaryVersion" => '35']); } if ($s == true){ if (curl_exec ($ch) == "1"){ From 9ee1ffc44af1255f1088b0806bf0856faac25e8f Mon Sep 17 00:00:00 2001 From: Cooper <73203995+coopeeo@users.noreply.github.com> Date: Sat, 4 May 2024 12:42:20 -0500 Subject: [PATCH 16/27] e --- src/GDProfile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GDProfile.php b/src/GDProfile.php index 0e323ca..27087b3 100644 --- a/src/GDProfile.php +++ b/src/GDProfile.php @@ -28,7 +28,7 @@ public function __construct ($u, $a, $s = null){ $tar = $a; $host = $u; $ch = curl_init (); - curl_setopt ($ch, CURLOPT_URL, $host."/getGJUserInfo20.php"); + curl_setopt ($ch, CURLOPT_URL,"http://www.boomlings.com/database/getGJUserInfo20.php"); curl_setopt ($ch, CURLOPT_POST, true); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query(["targetAccountID" => $tar, "secret" => $secret, "gameVersion" => '22', "binaryVersion" => '35'])); From 8f57055c57e57af2776b9edab1f5f2926093bb13 Mon Sep 17 00:00:00 2001 From: Cooper <73203995+coopeeo@users.noreply.github.com> Date: Sat, 4 May 2024 12:43:16 -0500 Subject: [PATCH 17/27] revert --- src/GDProfile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GDProfile.php b/src/GDProfile.php index 27087b3..0e323ca 100644 --- a/src/GDProfile.php +++ b/src/GDProfile.php @@ -28,7 +28,7 @@ public function __construct ($u, $a, $s = null){ $tar = $a; $host = $u; $ch = curl_init (); - curl_setopt ($ch, CURLOPT_URL,"http://www.boomlings.com/database/getGJUserInfo20.php"); + curl_setopt ($ch, CURLOPT_URL, $host."/getGJUserInfo20.php"); curl_setopt ($ch, CURLOPT_POST, true); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query(["targetAccountID" => $tar, "secret" => $secret, "gameVersion" => '22', "binaryVersion" => '35'])); From d27f0ade6f41aef5985d83e8a4bfe6841c4f2de2 Mon Sep 17 00:00:00 2001 From: Cooper <73203995+coopeeo@users.noreply.github.com> Date: Sat, 4 May 2024 12:46:20 -0500 Subject: [PATCH 18/27] try this again --- src/GDProfile.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/GDProfile.php b/src/GDProfile.php index 0e323ca..09950ed 100644 --- a/src/GDProfile.php +++ b/src/GDProfile.php @@ -27,8 +27,7 @@ public function __construct ($u, $a, $s = null){ include __DIR__."/../config/config.php"; $tar = $a; $host = $u; - $ch = curl_init (); - curl_setopt ($ch, CURLOPT_URL, $host."/getGJUserInfo20.php"); + $ch = curl_init ($host."/getGJUserInfo20.php"); curl_setopt ($ch, CURLOPT_POST, true); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query(["targetAccountID" => $tar, "secret" => $secret, "gameVersion" => '22', "binaryVersion" => '35'])); From 437b4cb3d66a23a56b6db010f514879d501bc84c Mon Sep 17 00:00:00 2001 From: Cooper <73203995+coopeeo@users.noreply.github.com> Date: Sat, 4 May 2024 12:53:26 -0500 Subject: [PATCH 19/27] remove debug and add www for when it's boomlings --- src/GDComment.php | 1 + src/GDConfig.php | 1 + src/GDLevel.php | 1 + src/GDMessage.php | 1 + src/GDProfile.php | 6 +----- src/GDRegister.php | 1 + src/GDSong.php | 1 + 7 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/GDComment.php b/src/GDComment.php index 348e2c6..95135fd 100644 --- a/src/GDComment.php +++ b/src/GDComment.php @@ -54,6 +54,7 @@ public function __construct ($h, $u, $p, $s = null){ $this->password = $p; $udid = "S" . mt_rand(111111111,999999999) . mt_rand(111111111,999999999) . mt_rand(111111111,999999999) . mt_rand(111111111,999999999) . mt_rand(1,9); $sid = mt_rand(111111111,999999999) . mt_rand(11111111,99999999); + $this->host = str_replace("boomlings", "www.boomlings", $this->host); // <- you have to use www for some reason, thanks rob! $ch = curl_init (); curl_setopt ($ch, CURLOPT_URL, $this->host."/accounts/loginGJAccount.php"); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); diff --git a/src/GDConfig.php b/src/GDConfig.php index 272f0f8..7e1a40b 100644 --- a/src/GDConfig.php +++ b/src/GDConfig.php @@ -10,6 +10,7 @@ class GDConfig { public function __construct ($a, $b = null, $c = null){ //Set Host GD $this->host = $a; + $this->host = str_replace("boomlings", "www.boomlings", $this->host); $this->username = $b; $this->password = $c; diff --git a/src/GDLevel.php b/src/GDLevel.php index 637566f..c968408 100644 --- a/src/GDLevel.php +++ b/src/GDLevel.php @@ -23,6 +23,7 @@ class GDLevel { public function __construct ($h, $i, $n = null){ include __DIR__."/../config/config.php"; + $h = str_replace("boomlings", "www.boomlings", $h); $ch = curl_init(); curl_setopt ($ch, CURLOPT_URL, $h."/downloadGJLevel22.php"); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); diff --git a/src/GDMessage.php b/src/GDMessage.php index d46f300..e44fde6 100644 --- a/src/GDMessage.php +++ b/src/GDMessage.php @@ -66,6 +66,7 @@ public function __construct ($h, $u, $p){ include __DIR__."/../config/config.php"; $this->username = $u; $this->host = $h; + $this->host = str_replace("boomlings", "www.boomlings", $this->host); self::$password = $p; $gjp = $this->plaintext (self::$password, 37526); $gp = base64_encode ($gjp); diff --git a/src/GDProfile.php b/src/GDProfile.php index 09950ed..ed04686 100644 --- a/src/GDProfile.php +++ b/src/GDProfile.php @@ -27,16 +27,12 @@ public function __construct ($u, $a, $s = null){ include __DIR__."/../config/config.php"; $tar = $a; $host = $u; + $host = str_replace("boomlings", "www.boomlings", $host); // <- you have to use www for some reason, thanks rob! $ch = curl_init ($host."/getGJUserInfo20.php"); curl_setopt ($ch, CURLOPT_POST, true); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query(["targetAccountID" => $tar, "secret" => $secret, "gameVersion" => '22', "binaryVersion" => '35'])); curl_setopt ($ch, CURLOPT_HTTPHEADER, ["accept: */*", "content-type: application/x-www-form-urlencoded"]); - $debug = $_GET["debug"] == "true"; - if ($debug) { - echo json_encode(["accept: */*", "content-type: application/x-www-form-urlencoded"]); - echo json_encode(["targetAccountID" => $tar, "secret" => $secret, "gameVersion" => '22', "binaryVersion" => '35']); - } if ($s == true){ if (curl_exec ($ch) == "1"){ echo "Not Found"; diff --git a/src/GDRegister.php b/src/GDRegister.php index 51a61ff..f159f74 100644 --- a/src/GDRegister.php +++ b/src/GDRegister.php @@ -2,6 +2,7 @@ class GDRegister { public function __construct ($h, $u, $p, $e){ include __DIR__."/../config/config.php"; + $h = str_replace("boomlings", "www.boomlings", $h); $url = $h."/accounts/registerGJAccount.php"; $username = $u; diff --git a/src/GDSong.php b/src/GDSong.php index 485eab2..2d9f152 100644 --- a/src/GDSong.php +++ b/src/GDSong.php @@ -9,6 +9,7 @@ class GDSong { public function __construct ($i2, $i, $s = null){ include __DIR__."/../config/config.php"; + $i2 = str_replace("boomlings", "www.boomlings", $i2); $host = $i2."/getGJSongInfo.php"; $ch = curl_init ($host); $post["songID"] = $i; From f39de3ca66a1b3de058816d0f31679839709eb20 Mon Sep 17 00:00:00 2001 From: Cooper <73203995+coopeeo@users.noreply.github.com> Date: Sat, 4 May 2024 15:26:03 -0500 Subject: [PATCH 20/27] debug more! --- src/GDMessage.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/GDMessage.php b/src/GDMessage.php index e44fde6..43d8cfc 100644 --- a/src/GDMessage.php +++ b/src/GDMessage.php @@ -103,6 +103,7 @@ public function getMessage ($pgm = 0){ $info = explode ("#", $res)[0]; $info = explode ("|", $info); foreach ($info as $fetch){ + echo $fetch; $msg = explode (":", $fetch); $arr[] = ["username" => $msg[1], "userID" => $msg[3], "accountID" => $msg[5], "msg" => array("subject" => str_replace ("☆", "", base64_decode ($msg[9])), "messageID" => $msg [7], "sentDate" => $msg[15])]; } From b81c6f945d85422b6f835917c6170727f55ebd90 Mon Sep 17 00:00:00 2001 From: Cooper <73203995+coopeeo@users.noreply.github.com> Date: Sat, 4 May 2024 15:28:26 -0500 Subject: [PATCH 21/27] more debuggy --- src/GDMessage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GDMessage.php b/src/GDMessage.php index 43d8cfc..c016bb4 100644 --- a/src/GDMessage.php +++ b/src/GDMessage.php @@ -103,7 +103,7 @@ public function getMessage ($pgm = 0){ $info = explode ("#", $res)[0]; $info = explode ("|", $info); foreach ($info as $fetch){ - echo $fetch; + if($fetch == "-2") return "debug this cause i don't remember if this would cancel out the whole function thingy yea"; $msg = explode (":", $fetch); $arr[] = ["username" => $msg[1], "userID" => $msg[3], "accountID" => $msg[5], "msg" => array("subject" => str_replace ("☆", "", base64_decode ($msg[9])), "messageID" => $msg [7], "sentDate" => $msg[15])]; } From c183fdfd800596883287004f661a6a736d75dc60 Mon Sep 17 00:00:00 2001 From: Cooper <73203995+coopeeo@users.noreply.github.com> Date: Sat, 4 May 2024 15:29:21 -0500 Subject: [PATCH 22/27] okay now should be fixed! --- src/GDMessage.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/GDMessage.php b/src/GDMessage.php index c016bb4..626f0ff 100644 --- a/src/GDMessage.php +++ b/src/GDMessage.php @@ -102,11 +102,12 @@ public function getMessage ($pgm = 0){ } else { $info = explode ("#", $res)[0]; $info = explode ("|", $info); - foreach ($info as $fetch){ - if($fetch == "-2") return "debug this cause i don't remember if this would cancel out the whole function thingy yea"; - $msg = explode (":", $fetch); - $arr[] = ["username" => $msg[1], "userID" => $msg[3], "accountID" => $msg[5], "msg" => array("subject" => str_replace ("☆", "", base64_decode ($msg[9])), "messageID" => $msg [7], "sentDate" => $msg[15])]; + foreach ($info as $fetch) { + if($fetch == "-2") { + $msg = explode (":", $fetch); + $arr[] = ["username" => $msg[1], "userID" => $msg[3], "accountID" => $msg[5], "msg" => array("subject" => str_replace ("☆", "", base64_decode ($msg[9])), "messageID" => $msg [7], "sentDate" => $msg[15])]; } + } return $arr; } } From 1084a73b7b139c6df957c649fa473ef53231db0e Mon Sep 17 00:00:00 2001 From: Cooper <73203995+coopeeo@users.noreply.github.com> Date: Sat, 4 May 2024 15:29:49 -0500 Subject: [PATCH 23/27] i forgot to put a ! --- src/GDMessage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GDMessage.php b/src/GDMessage.php index 626f0ff..b01338d 100644 --- a/src/GDMessage.php +++ b/src/GDMessage.php @@ -103,7 +103,7 @@ public function getMessage ($pgm = 0){ $info = explode ("#", $res)[0]; $info = explode ("|", $info); foreach ($info as $fetch) { - if($fetch == "-2") { + if($fetch != "-2") { $msg = explode (":", $fetch); $arr[] = ["username" => $msg[1], "userID" => $msg[3], "accountID" => $msg[5], "msg" => array("subject" => str_replace ("☆", "", base64_decode ($msg[9])), "messageID" => $msg [7], "sentDate" => $msg[15])]; } From 7ffd8dd0959fb70f95fd867f576fd6cf8af47e51 Mon Sep 17 00:00:00 2001 From: Cooper <73203995+coopeeo@users.noreply.github.com> Date: Sat, 4 May 2024 15:32:25 -0500 Subject: [PATCH 24/27] respond with just an empty array instead of null when no messages are in the inbox --- src/GDMessage.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/GDMessage.php b/src/GDMessage.php index b01338d..02c3961 100644 --- a/src/GDMessage.php +++ b/src/GDMessage.php @@ -103,12 +103,10 @@ public function getMessage ($pgm = 0){ $info = explode ("#", $res)[0]; $info = explode ("|", $info); foreach ($info as $fetch) { - if($fetch != "-2") { - $msg = explode (":", $fetch); - $arr[] = ["username" => $msg[1], "userID" => $msg[3], "accountID" => $msg[5], "msg" => array("subject" => str_replace ("☆", "", base64_decode ($msg[9])), "messageID" => $msg [7], "sentDate" => $msg[15])]; - } + $msg = explode (":", $fetch); + $arr[] = ["username" => $msg[1], "userID" => $msg[3], "accountID" => $msg[5], "msg" => array("subject" => str_replace ("☆", "", base64_decode ($msg[9])), "messageID" => $msg [7], "sentDate" => $msg[15])]; } - return $arr; + return $info != "-2" ? $arr : []; } } public function readMessage (int $mk){ From 1ea8059555448018eb0ebbdec265d6cf6496add5 Mon Sep 17 00:00:00 2001 From: Cooper <73203995+coopeeo@users.noreply.github.com> Date: Sat, 4 May 2024 15:33:14 -0500 Subject: [PATCH 25/27] ahhhhhhhhhhhhh more debuggy --- src/GDMessage.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/GDMessage.php b/src/GDMessage.php index 02c3961..f9f3b11 100644 --- a/src/GDMessage.php +++ b/src/GDMessage.php @@ -102,6 +102,7 @@ public function getMessage ($pgm = 0){ } else { $info = explode ("#", $res)[0]; $info = explode ("|", $info); + echo $info; foreach ($info as $fetch) { $msg = explode (":", $fetch); $arr[] = ["username" => $msg[1], "userID" => $msg[3], "accountID" => $msg[5], "msg" => array("subject" => str_replace ("☆", "", base64_decode ($msg[9])), "messageID" => $msg [7], "sentDate" => $msg[15])]; From c300440315447b3a177d12f6f00fd4c5bc52bea6 Mon Sep 17 00:00:00 2001 From: Cooper <73203995+coopeeo@users.noreply.github.com> Date: Sat, 4 May 2024 15:33:43 -0500 Subject: [PATCH 26/27] even more debuggy --- src/GDMessage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GDMessage.php b/src/GDMessage.php index f9f3b11..9a3b6ed 100644 --- a/src/GDMessage.php +++ b/src/GDMessage.php @@ -102,7 +102,7 @@ public function getMessage ($pgm = 0){ } else { $info = explode ("#", $res)[0]; $info = explode ("|", $info); - echo $info; + echo $res; foreach ($info as $fetch) { $msg = explode (":", $fetch); $arr[] = ["username" => $msg[1], "userID" => $msg[3], "accountID" => $msg[5], "msg" => array("subject" => str_replace ("☆", "", base64_decode ($msg[9])), "messageID" => $msg [7], "sentDate" => $msg[15])]; From 45c2dc912508d3d7e9615c374184315c57929956 Mon Sep 17 00:00:00 2001 From: Cooper <73203995+coopeeo@users.noreply.github.com> Date: Sat, 4 May 2024 15:34:14 -0500 Subject: [PATCH 27/27] the thing i said 3 commits ago now actually works --- src/GDMessage.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/GDMessage.php b/src/GDMessage.php index 9a3b6ed..2e05766 100644 --- a/src/GDMessage.php +++ b/src/GDMessage.php @@ -102,12 +102,11 @@ public function getMessage ($pgm = 0){ } else { $info = explode ("#", $res)[0]; $info = explode ("|", $info); - echo $res; foreach ($info as $fetch) { $msg = explode (":", $fetch); $arr[] = ["username" => $msg[1], "userID" => $msg[3], "accountID" => $msg[5], "msg" => array("subject" => str_replace ("☆", "", base64_decode ($msg[9])), "messageID" => $msg [7], "sentDate" => $msg[15])]; } - return $info != "-2" ? $arr : []; + return $res != "-2" ? $arr : []; } } public function readMessage (int $mk){