中文 | English
The src folder of this project is the front-end Vue.js source code, and most of the other folders are the back-end Express source code.
The directory for the danmaku sender is located in routes/sender, see routes/sender/danmaku.js.
module.exports = { router, socket, info, init, pushDanmaku };The explanation is as follows
router: used to createExpress Routersocket: used to bindSocket.IOinfo: for generating backend panel rendering datainit: used to initialize the plugin when it is enabled, e.g. to createTokenpushDanmaku: the interface that the file implements itself
These sections are taken as needed, e.g. only the info section is implemented in routes/sender/develop.js.
The authentication function is in utils/auth.js. There are three cases of requesting authentication.
Vuebackend authentication:auth.routerSessionAuthExpress Routeruses Token authentication:auth.routerActivityByTokenSocket.IOusing Token authentication:auth.socketActivityByToken
Please refer to the source code for specific usage.
The directory for the danmaku filter is located in utils/filter, info is used to create additional configuration addons, and filter should be implemented as a middleware to be used in utils/audit.js. See also utils/filter/default.js.
The data of the Web backend panel is generated by the backend and rendered by the frontend, so you only need to modify the backend sender. See the section defining info in routes/sender/danmaku.js. We specify that each sender has at most one display panel. And additional configuration addons can also be added in filter.
If the current renderer does not meet the requirements, it is also possible to improve the front-end by adding new rendering features.
When submitting code to the main repository, you should ensure that the display text added to the front-end supports all languages under src/langs, such as following fields:
sender:danmaku sender namefilter:danmaku filter name- New descriptions in the backend panel
Overall, all text you see in the backend panel should be localized.