简体中文 繁體中文 English 日本語 Deutsch 한국 사람 بالعربية TÜRKÇE português คนไทย

导读切换到宽版
Online Supporting

Stream Dock 论坛

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 73|回复: 1

[Bug] Plugin main never called connect-Socket Methods

[复制链接]

1

主题

0

回帖

11

积分

新手上路

积分
11
发表于 4 天前 | 显示全部楼层 |阅读模式
本帖最后由 Bizzi 于 2025-3-30 01:54 编辑

I have a following Plugin-Skeleton:

/plugins/<plugin>/manifest.json
  1. {
  2.     "CodePath":                "plugin/main.html",
  3.     // [...] Other Manifest.json Data
  4. }
复制代码
/plugins/<plugin>/plugin/main.html
  1. <!DOCTYPE html>
  2. <html>
  3.         <head>
  4.                 <script type="text/javascript">
  5.                         (new class Main {
  6.                                 Socket = null;
  7.                                 
  8.                                 constructor() {
  9.                                         console.log('Main');
  10.                                        
  11.                                         [
  12.                                                 'connectSocket',
  13.                                                 'connectSDSocket',
  14.                                                 'connectMiraBoxSDSocket',
  15.                                                 'connectElgatoStreamDeckSocket',
  16.                                         ].forEach((name) => {
  17.                                                 window[name] = this.connect.bind(this);
  18.                                         });
  19.                                 }
  20.                                 
  21.                                 connect(port, uuid, event, info) {
  22.                                         console.log('connect', arguments);
  23.                                        
  24.                                         this.Socket = new WebSocket('ws://127.0.0.1:' + port);
  25.                                        
  26.                                         this.Socket.addEventListener('open',        () => this.onConnect(port, uuid, event));
  27.                                         this.Socket.addEventListener('message',        this.onReceive.bind(this));
  28.                                         this.Socket.addEventListener('close',        this.onClose.bind(this));
  29.                                         this.Socket.addEventListener('error',        this.onError.bind(this));
  30.                                 }
  31.                                 
  32.                                 send(data) {
  33.                                         console.warn('[Send]', data);
  34.                                         this.Socket.send(JSON.stringify(data));
  35.                                 }
  36.                                 
  37.                                 onConnect(port, uuid, event) {
  38.                                         console.warn('[Connect]', { event: event, uuid: uuid });
  39.                                         this.send({ event: event, uuid: uuid });
  40.                                 }
  41.                                 
  42.                                 onClose(event) {
  43.                                         console.warn('[Close]', event);
  44.                                 }
  45.                                 
  46.                                 onError(event) {
  47.                                         console.error('[Error]', event, event.data);
  48.                                 }
  49.                                 
  50.                                 onReceive(event) {
  51.                                         let packet = JSON.parse(event.data);
  52.                                         console.log('[Receive]', packet.action, packet.event, packet);
  53.                                 }
  54.                         }());
  55.                 </script>
  56.         </head>
  57.         <body></body>
  58. </html>
复制代码

When i start the Stream Dock Application, the Plugin will be shown, the Action can be placed and the Property Inspector works.

But only the Main.html will never called the connectElgatoStreamDeckSocket Method:
Bild_2025-03-29_174237313.png

Why the connect-Methods will never been called by the Stream Dock Application?

Stream Dock Version: 3.10.189.0313
The full code is here: https://github.com/Bizarrus/KnuddelsAdmin

Edit:

The Problem is definitively on the Stream Dock Application.
When the Computer going into the Energy saving mode and will be reactived, the command connectElgatoStreamDeckSocket will be called and the connection will be started:
Bild_2025-03-29_185455485.png



0

主题

18

回帖

56

积分

注册会员

积分
56
发表于 3 天前 | 显示全部楼层
Yes, we have also found this problem recently. Maybe you have installed too few plugins? This is a bug in the software recently. If you install more plugins, this problem will not occur easily. We are currently working on fixing it.
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Stream Dock 论坛 ( 粤ICP备16086630号 )

GMT+8, 2025-4-3 06:53 , Processed in 0.155016 second(s), 26 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表