We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 652736d commit bc626b7Copy full SHA for bc626b7
GatewayWorker_linux/Applications/YourApp/Events.php
@@ -40,7 +40,8 @@ public static function onConnect($client_id)
40
'type' => 'init',
41
'client_id' => $client_id
42
];
43
- Gateway::sendToClient(json_decode($data));
+
44
+ Gateway::sendToClient($client_id,json_encode($data));
45
}
46
47
/**
@@ -51,12 +52,16 @@ public static function onConnect($client_id)
51
52
public static function onMessage($client_id, $message)
53
{
54
// 向所有人发送
- $res = json_decode($message, true);
55
- if ($res['type'] === 'ping'){
56
- // 心跳包 前端50秒发送一次
57
-
58
- }
59
- // Gateway::sendToAll("$client_id said $message\r\n");
+ $res = json_decode($message, true);
+ if ($res['type'] === 'ping'){
+ // 心跳包 前端50秒发送一次
60
+ }
61
62
+ if ($res["msg"] === "gongzuo") {
63
+ Gateway::sendToClient($client_id, "gongzuo");
64
65
66
67
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments