diff --git a/src/Adapter/MockServerQuery.php b/src/Adapter/MockServerQuery.php index 3a4e71dc..92b8fc5b 100644 --- a/src/Adapter/MockServerQuery.php +++ b/src/Adapter/MockServerQuery.php @@ -26,7 +26,7 @@ protected function syn(): void $rdy = $this->getTransport()->readLine(); - if (!$rdy->startsWith(TeamSpeak3::TS3_PROTO_IDENT) && !$rdy->startsWith(TeamSpeak3::TEA_PROTO_IDENT) && !(defined("CUSTOM_PROTO_IDENT") && $rdy->startsWith(CUSTOM_PROTO_IDENT))) { + if (!$rdy->startsWith(TeamSpeak3::TS3_PROTO_IDENT) && !$rdy->startsWith(TeamSpeak3::TEA_PROTO_IDENT) && !$rdy->startsWith(TeamSpeak3::GREENTEA_PROTO_IDENT) && !(defined("CUSTOM_PROTO_IDENT") && $rdy->startsWith(CUSTOM_PROTO_IDENT))) { throw new AdapterException("invalid reply from the server (" . $rdy . ")"); } diff --git a/src/Adapter/ServerQuery.php b/src/Adapter/ServerQuery.php index e0ecde2c..d0243439 100644 --- a/src/Adapter/ServerQuery.php +++ b/src/Adapter/ServerQuery.php @@ -64,7 +64,7 @@ protected function syn(): void $rdy = $this->getTransport()->readLine(); - if (!$rdy->startsWith(TeamSpeak3::TS3_PROTO_IDENT) && !$rdy->startsWith(TeamSpeak3::TEA_PROTO_IDENT) && !(defined("CUSTOM_PROTO_IDENT") && $rdy->startsWith(CUSTOM_PROTO_IDENT))) { + if (!$rdy->startsWith(TeamSpeak3::TS3_PROTO_IDENT) && !$rdy->startsWith(TeamSpeak3::TEA_PROTO_IDENT) && !$rdy->startsWith(TeamSpeak3::GREENTEA_PROTO_IDENT) && !(defined("CUSTOM_PROTO_IDENT") && $rdy->startsWith(CUSTOM_PROTO_IDENT))) { throw new AdapterException("invalid reply from the server (" . $rdy . ")"); } diff --git a/src/Adapter/ServerQuery/Reply.php b/src/Adapter/ServerQuery/Reply.php index 68872f80..0209d99f 100644 --- a/src/Adapter/ServerQuery/Reply.php +++ b/src/Adapter/ServerQuery/Reply.php @@ -300,7 +300,7 @@ protected function fetchError(StringHelper $err): void protected function fetchReply(array $rpl): void { foreach ($rpl as $key => $val) { - if ($val->startsWith(TeamSpeak3::TS3_MOTD_PREFIX) || $val->startsWith(TeamSpeak3::TEA_MOTD_PREFIX) || (defined("CUSTOM_MOTD_PREFIX") && $val->startsWith(CUSTOM_MOTD_PREFIX))) { + if ($val->startsWith(TeamSpeak3::TS3_MOTD_PREFIX) || $val->startsWith(TeamSpeak3::TEA_MOTD_PREFIX) || $val->startsWith(TeamSpeak3::GREENTEA_MOTD_PREFIX) || (defined("CUSTOM_MOTD_PREFIX") && $val->startsWith(CUSTOM_MOTD_PREFIX))) { unset($rpl[$key]); } elseif ($val->startsWith(TeamSpeak3::EVENT)) { $this->evt[] = new Event($val, $this->con); diff --git a/src/TeamSpeak3.php b/src/TeamSpeak3.php index d54a49c2..e00705d4 100644 --- a/src/TeamSpeak3.php +++ b/src/TeamSpeak3.php @@ -69,6 +69,16 @@ class TeamSpeak3 */ public const TEA_MOTD_PREFIX = "Welcome"; + /** + * GreenTeaSpeak protocol welcome message. + */ + public const GREENTEA_PROTO_IDENT = "GreenTeaSpeak"; + + /** + * GreenTeaSpeak protocol greeting message prefix. + */ + public const GREENTEA_MOTD_PREFIX = "Welcome"; + /** * TeamSpeak 3 protocol error message prefix. */