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 src/Adapter/MockServerQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 . ")");
}

Expand Down
2 changes: 1 addition & 1 deletion src/Adapter/ServerQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 . ")");
}

Expand Down
2 changes: 1 addition & 1 deletion src/Adapter/ServerQuery/Reply.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
10 changes: 10 additions & 0 deletions src/TeamSpeak3.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down