mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-08-04 08:51:51 +02:00
* msg_network.js: Management of message network modules (start/stop/etc.)
* Minor updates to ES6 in some areas * Better bbs.js startup seq * Better iterator support for loadModulesForCategory() * Start work on loading message network modules & tieing in record() (WIP) * FTN PacketHeader is now a ES6 class * Various FTN utils, e.g. Via line creation
This commit is contained in:
parent
13d5c4d8f4
commit
74f5342997
10 changed files with 388 additions and 96 deletions
|
@ -34,7 +34,7 @@ module.exports = class Address {
|
|||
);
|
||||
}
|
||||
|
||||
isMatch(pattern) {
|
||||
getMatchAddr(pattern) {
|
||||
const m = FTN_PATTERN_REGEXP.exec(pattern);
|
||||
if(m) {
|
||||
let addr = { };
|
||||
|
@ -81,6 +81,35 @@ module.exports = class Address {
|
|||
addr.domain = '*';
|
||||
}
|
||||
|
||||
return addr;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
getMatchScore(pattern) {
|
||||
let score = 0;
|
||||
const addr = this.getMatchAddr(pattern);
|
||||
if(addr) {
|
||||
const PARTS = [ 'net', 'node', 'zone', 'point', 'domain' ];
|
||||
for(let i = 0; i < PARTS.length; ++i) {
|
||||
const member = PARTS[i];
|
||||
if(this[member] === addr[member]) {
|
||||
score += 2;
|
||||
} else if('*' === addr[member]) {
|
||||
score += 1;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return score;
|
||||
}
|
||||
*/
|
||||
|
||||
isMatch(pattern) {
|
||||
const addr = this.getMatchAddr(pattern);
|
||||
if(addr) {
|
||||
return (
|
||||
('*' === addr.net || this.net === addr.net) &&
|
||||
('*' === addr.node || this.node === addr.node) &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue