now most of logic works as it should
This commit is contained in:
@@ -38,7 +38,7 @@ class WebSocketServer implements MessageComponentInterface
|
||||
{
|
||||
foreach ($this->connectionsData as $connectionData) {
|
||||
if ($connectionData["username"] !== $username) {
|
||||
$connectionData["connection"]->send("{\"sender\": \"{$username}\",\"msg\": \"{$msg}\"");
|
||||
$connectionData["connection"]->send("{\"sender\": \"{$username}\",\"msg\": \"{$msg}\"}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -72,7 +72,7 @@ class WebSocketServer implements MessageComponentInterface
|
||||
if ($index === null) return;
|
||||
|
||||
if ($this->connectionsData[$index]["username"]) {
|
||||
$msgContent = $decodedMsg["msg"] ?? null;
|
||||
$msgContent = $decodedMsg["message"] ?? null;
|
||||
if ($msgContent) {
|
||||
$this->sendToAllAuthenticated($this->connectionsData[$index]["username"], $msgContent);
|
||||
$from->send("{\"success\"}: \"message send\"");
|
||||
|
||||
Reference in New Issue
Block a user