改名
This commit is contained in:
@@ -70,9 +70,6 @@ class WebSocket extends Server
|
|||||||
$this->application->set(WebSocket::class, $this);
|
$this->application->set(WebSocket::class, $this);
|
||||||
$this->application->set(Pool::class, $pool);
|
$this->application->set(Pool::class, $pool);
|
||||||
|
|
||||||
$annotation = $this->application->annotation;
|
|
||||||
$annotation->register('websocket', AWebsocket::class);
|
|
||||||
|
|
||||||
ServerManager::set($this, $settings, $this->application, $events, $config);
|
ServerManager::set($this, $settings, $this->application, $events, $config);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,14 +82,14 @@ class WebSocket extends Server
|
|||||||
public function onMessage(Server $server, Frame $frame)
|
public function onMessage(Server $server, Frame $frame)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$event = Snowflake::get()->event;
|
|
||||||
if ($event->exists(Event::SERVER_MESSAGE)) {
|
|
||||||
$event->trigger(Event::SERVER_MESSAGE, [$server, $frame]);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if ($frame->opcode == 0x08) {
|
if ($frame->opcode == 0x08) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$event = Snowflake::get()->event;
|
||||||
|
if ($event->exists(Event::SERVER_MESSAGE)) {
|
||||||
|
$frame->data = $event->trigger(Event::SERVER_MESSAGE, [$server, $frame]);
|
||||||
|
}
|
||||||
$json = json_decode($frame->data, true);
|
$json = json_decode($frame->data, true);
|
||||||
|
|
||||||
/** @var AWebsocket $manager */
|
/** @var AWebsocket $manager */
|
||||||
|
|||||||
Reference in New Issue
Block a user