Merge commit 'ed96e0f8589042fb8e9d6cfee713c5150612bb34'

This commit is contained in:
mzl
2025-08-22 18:16:13 +08:00
parent d715708728
commit 11165fcfb9
23 changed files with 1465 additions and 32 deletions
+38
View File
@@ -0,0 +1,38 @@
<?php
namespace plugin\webman\gateway;
use app\common\utils\WsEvents;
use GatewayWorker\Lib\Gateway;
class Events
{
protected static $wsEvents;
public static function onWorkerStart($worker)
{
self::$wsEvents = new WsEvents();
}
public static function onConnect($client_id)
{
// 仅 TCP 连接,不一定有 WebSocket 握手
}
public static function onWebSocketConnect($client_id, $data)
{
self::$wsEvents->auth($client_id, $data);
}
public static function onMessage($client_id, $message)
{
self::$wsEvents->message($client_id, $message);
}
public static function onClose($client_id)
{
var_dump('关闭客户端ID:'.$client_id);
}
}