start irc with minisrv
This commit is contained in:
@@ -23,10 +23,12 @@ const WTVClientCapabilities = require(classPath + "/WTVClientCapabilities.js");
|
||||
const WTVClientSessionData = require(classPath + "/WTVClientSessionData.js");
|
||||
const WTVMime = require(classPath + "/WTVMime.js");
|
||||
const WTVFlashrom = require(classPath + "/WTVFlashrom.js");
|
||||
const WTVIRC = require(classPath + "/WTVIRC.js");
|
||||
const vm = require('vm');
|
||||
const debug = require('debug')('minisrv_main');
|
||||
const express = require('express');
|
||||
|
||||
var wtvirc = null;
|
||||
var wtvnewsserver = null;
|
||||
|
||||
|
||||
@@ -2365,6 +2367,12 @@ Object.keys(minisrv_config.services).forEach(function (k) {
|
||||
var using_tls = (minisrv_config.services[k].pc_services && minisrv_config.services[k].https_cert && minisrv_config.services[k].use_https) ? true : false;
|
||||
console.log(" * Configured Service:", k, "on Port", minisrv_config.services[k].port, "- Service Host:", minisrv_config.services[k].host + ((using_tls) ? " (TLS)" : ""), "- Bind Port:", !minisrv_config.services[k].nobind, "- PC Services Mode:", (minisrv_config.services[k].pc_services) ? true : false);
|
||||
|
||||
if (minisrv_config.services[k].run_irc_server) {
|
||||
var ircServer = new WTVIRC(minisrv_config, minisrv_config.config.bind_ip, minisrv_config.services[k].irc_port);
|
||||
ircServer.start();
|
||||
console.log(" * Configured Service: IRC Server on", minisrv_config.config.bind_ip + ":" + minisrv_config.services[k].irc_port);
|
||||
}
|
||||
|
||||
if (minisrv_config.services[k].local_nntp_port) {
|
||||
if (!wtvnewsserver) {
|
||||
const WTVNewsServer = require(classPath + "/WTVNewsServer.js");
|
||||
|
||||
@@ -343,6 +343,13 @@ class WTVIRC {
|
||||
this.broadcast(`:${this.servername} NOTICE * :${message}\r\n`);
|
||||
}
|
||||
|
||||
sendWebTVNoticeTo(username, message) {
|
||||
const socket = Array.from(this.nicknames.keys()).find(s => this.nicknames.get(s) === username);
|
||||
if (socket) {
|
||||
socket.write(`:${this.servername} NOTICE * :${message}\r\n`);
|
||||
}
|
||||
}
|
||||
|
||||
sendToChannelAs(username, channel, message) {
|
||||
const users = this.getUsersInChannel(channel);
|
||||
for (const user of users) {
|
||||
|
||||
@@ -235,7 +235,12 @@
|
||||
"wtv-chat": {
|
||||
// wtv-chat (used for IRC)
|
||||
"port": 1630,
|
||||
"connections": 3
|
||||
"connections": 3,
|
||||
"run_irc_server": true,
|
||||
"irc_port": 1667,
|
||||
"modules": [
|
||||
"WTVIRC"
|
||||
]
|
||||
},
|
||||
"wtvchat": {
|
||||
// wtvchat://server:port/channel passthrough (wni official)
|
||||
|
||||
Reference in New Issue
Block a user