Skip to content
Snippets Groups Projects
Commit 813072cd authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Add support for new experimental/optional Area File format: areas.ini

As suggested/requested by Fernando Toledo in issue #826, you can:
1. run 'jsexec make_areas_ini.js' to export your areas.bbs file to areas.ini
   (your old areas.bbs is left in place, in tact, unmodified)
2. change your Area File in echocfg->Paths and Filenames->Area File to
   somepath/somefile.ini (e.g. "../data/areas.ini") and SBBSecho will use
   the .ini file format instead of the old AREAS.BBS format (NIH)

You can always go back to your areas.bbs file by just reverting the Area File
setting back to some other non-ini filename (e.g. "../data/areas.bbs").

Incremented version number to v3.23

Of course documentation and echocfg changes will need to follow, but this is
enough to start testing (looking at your Fernando! :-).

I tried to minimize the diff as much as possible and resisted updating
(modernizing, fixing) the very old AREAS.BBS parsing and areafix code.
The new .ini code is largely modeled after the old areas.bbs code, but oh,
xpdev/ini_file makes things so much nicer and easier.

There are no known fixes for any pre-existing area file/fix issues (including
issue #826), but it's always possible I've introduced a new issue.
parent 51e58fee
No related branches found
No related tags found
No related merge requests found
Pipeline #7190 passed
// Export legacy areas.bbs file to (new/modern) areas.ini format
var areas_bbs = argv[0] || file_getcase(system.data_dir + "areas.bbs");
var areas_ini = system.data_dir + "areas.ini";
if(file_exists(areas_ini) && deny("Overwrite " + areas_ini))
exit(0);
var fin = new File(areas_bbs);
if(!fin.open("r"))
throw new Error("Error " + fin.error + " opening " + fin.name);
var fout = new File(areas_ini);
if(!fout.open("w"))
throw new Error("Error " + fout.error + " opening " + fout.name);
var text = fin.readAll();
var areas = 0;
for(var i in text) {
var line = text[i];
var match = line.match(/(\S+)\s+(\S+)\s+(.*)$/);
if(!match || match.length < 3)
continue;
if(match[1][0] == ';') // comment
continue;
var tag = match[2];
var sub = match[1];
var links = match[3];
fout.writeln(format("[%s]", tag));
if(sub.toUpperCase() == "P")
fout.writeln("pass-through = true");
else
fout.writeln(format("sub = %s", sub));
fout.writeln(format("links = %s", links));
fout.writeln();
++areas;
}
print(areas + " areas from " + areas_bbs + " exported to " + areas_ini);
\ No newline at end of file
This diff is collapsed.
......@@ -28,7 +28,7 @@
#include "ini_file.h"
#define SBBSECHO_VERSION_MAJOR 3
#define SBBSECHO_VERSION_MINOR 22
#define SBBSECHO_VERSION_MINOR 23
#define SBBSECHO_PRODUCT_CODE 0x12FF /* from http://ftsc.org/docs/ftscprod.013 */
......@@ -65,7 +65,7 @@ enum pkt_type {
#define SBBSECHO_MAX_TICPWD_LEN 40 /* FRL-1039: no restrictions on the length ... of the password */
typedef struct {
uint sub; /* Set to INVALID_SUB if pass-thru */
int sub; /* Set to INVALID_SUB if pass-thru */
char* tag; /* AreaTag, a.k.a. 'EchoTag' */
uint imported; /* Total messages imported this run */
uint exported; /* Total messages exported this run */
......
  • excelentttt!!

    imagen

  • Even using just the text editor, having syntax highlighting is a pleasure.

  • hi @rswindell areafix fails:

    I have a APPLE tag already defined

    imagen

    I do a request from my point and it's append as passthrough

    imagen

    2024-11-20 08:38:57 Importing /sbbs/fido/inbound/20083846.PKT (type 2e, 0.2KB) from 4:902/26.3 to 4:902/26
    2024-11-20 08:38:57 Ragnarok Point3 Fido (4:902/26.3) To: areafix (4:902/26)
    2024-11-20 08:38:57 AreaFix (for 4:902/26.3) Request received from Ragnarok Point3 Fido
    2024-11-20 08:38:57 AreaFix (for 4:902/26.3) Adding area from EchoList (/sbbs/fido/ECHOLIST.MOMIA): APPLE
    2024-11-20 08:38:57 Created NetMail (1.msg) from SBBSecho (4:902/26) to Ragnarok Point3 Fido (4:902/26.3), attr: 0181 (PRIVATE, KILLSENT, LOCAL), sub
    ject: Area Management Request
    2024-11-20 08:38:57 AreaFix (for 4:902/26.3) Added links to 1 areas in ../data/areas.ini
    2024-11-20 08:38:57 Deleting /sbbs/fido/inbound/20083846.PKT (from line 6293)
    2024-11-20 08:38:57 Imported:     1 msgs            fidonetbelcharter97en <- BEL.CHARTER97.EN
    2024-11-20 08:38:57 Imported:     1 msgs total
    2024-11-20 08:38:57 Packing NetMail (1.msg) from SBBSecho (4:902/26) to Ragnarok Point3 Fido (4:902/26.3), attr: 0181 (PRIVATE, KILLSENT, LOCAL), sub
    ject: Area Management Request
    2024-11-20 08:38:57 Node (4:902/26.3) successfully locked via: /sbbs/fido/outbound/0386001a.pnt/00000003.bsy
    2024-11-20 08:38:57 New password-protected packet (type 2+) created for linked-node: 4:902/26.3
    2024-11-20 08:38:57 Adding NetMail (1.msg) to new packet for 4:902/26.3: /sbbs/fido/outbound/0386001a.pnt/00000003.out
    
    Edited by Fernando Toledo
  • I was thinking that maybe you should also add some check that you can't create 2 sections with the same name

  • Author Owner

    Please try with the latest code in master branch - fixed a few areafix related bugs.

  • I test:

    1. try to add area, sbbsecho still add as passtrough, sbbsecho reply was "APPLE added"
    2024-11-20 23:01:48 Importing /sbbs/fido/inbound/20230143.PKT (type 2e, 0.2KB) from 4:902/26.3 to 4:902/26
    2024-11-20 23:01:48 Ragnarok Point3 Fido (4:902/26.3) To: Areafix (4:902/26)
    2024-11-20 23:01:48 AreaFix (for 4:902/26.3) Request received from Ragnarok Point3 Fido
    2024-11-20 23:01:48 AreaFix (for 4:902/26.3) Adding area from EchoList (/sbbs/fido/ECHOLIST.MOMIA): APPLE
    2024-11-20 23:01:48 Created NetMail (1.msg) from SBBSecho (4:902/26) to Ragnarok Point3 Fido (4:902/26.3), attr: 0181 (PRIVATE, KILLSENT, LOCAL), subject: Area Management Request
    2024-11-20 23:01:48 AreaFix (for 4:902/26.3) Added links to 1 areas in ../data/areas.ini
    2024-11-20 23:01:48 Deleting /sbbs/fido/inbound/20230143.PKT (from line 6296)
    2024-11-20 23:01:48 Packing NetMail (1.msg) from SBBSecho (4:902/26) to Ragnarok Point3 Fido (4:902/26.3), attr: 0181 (PRIVATE, KILLSENT, LOCAL), subject: Area Management Request
    2024-11-20 23:01:48 Node (4:902/26.3) successfully locked via: /sbbs/fido/outbound/0386001a.pnt/00000003.bsy
    2024-11-20 23:01:48 New password-protected packet (type 2+) created for linked-node: 4:902/26.3
    2024-11-20 23:01:48 Adding NetMail (1.msg) to new packet for 4:902/26.3: /sbbs/fido/outbound/0386001a.pnt/00000003.out
    2024-11-20 23:01:48 Deleting /sbbs/fido/netmail/1.msg (from line 5569)
    2024-11-20 23:01:48 Touching outgoing semfile: ../data/binkout.now
    grep -C5 APPLE areas.ini 
    
    [TREK_CREATIVE]
    sub = fidonettrekcrea
    links = 2:341/66
    
    [APPLE]
    sub = fidonetapple
    links = 2:341/66 4:900/106 4:902/19 4:930/1 4:900/102
    
    [AGN_GEN]
    sub = agn_gen
    --
    
    [ZOOM]
    pass-through = true
    links = 4:930/1 4:900/102
    
    [APPLE]
    pass-through = true
    links = 4:902/26.3
    
    1. I manually remove the apple passtrough section, add point 4:902/26.3 to links for the valid and first section, and try to remove via areafix (-APPLE)
    [APPLE]
    sub = fidonetapple
    links = 2:341/66 4:900/106 4:902/19 4:930/1 4:900/102 4:902/26.3
    

    the link point was not removed, the log don't show the refence text for the remove action

    2024-11-20 22:51:13 Importing /sbbs/fido/inbound/20225103.PKT (type 2e, 0.2KB) from 4:902/26.3 to 4:902/26
    2024-11-20 22:51:13 Ragnarok Point3 Fido (4:902/26.3) To: Areafix (4:902/26)
    2024-11-20 22:51:13 AreaFix (for 4:902/26.3) Request received from Ragnarok Point3 Fido
    2024-11-20 22:51:13 Created NetMail (1.msg) from SBBSecho (4:902/26) to Ragnarok Point3 Fido (4:902/26.3), attr: 0181 (PRIVATE, KILLSENT, LOCAL), subject: Area Management Request
    2024-11-20 22:51:13 Deleting /sbbs/fido/inbound/20225103.PKT (from line 6296)
    2024-11-20 22:51:13 Packing NetMail (1.msg) from SBBSecho (4:902/26) to Ragnarok Point3 Fido (4:902/26.3), attr: 0181 (PRIVATE, KILLSENT, LOCAL), subject: Area Management Request
    2024-11-20 22:51:13 Node (4:902/26.3) successfully locked via: /sbbs/fido/outbound/0386001a.pnt/00000003.bsy
    2024-11-20 22:51:13 New password-protected packet (type 2+) created for linked-node: 4:902/26.3
    2024-11-20 22:51:13 Adding NetMail (1.msg) to new packet for 4:902/26.3: /sbbs/fido/outbound/0386001a.pnt/00000003.out
    2024-11-20 22:51:13 Deleting /sbbs/fido/netmail/1.msg (from line 5569)
    2024-11-20 22:51:13 Touching outgoing semfile: ../data/binkout.now
    

    and reafix reply with "no changes made"

  • I attach my areas.ini

    areas.ini

  • If you think it is convenient, you could add more debug lines to see what happens when searching logic for the area to add/remove the link.

    PS: I don't want to forget to mention that I am very grateful for the time you are taking to do this.

  • Author Owner

    It was a simple bug that I overlooked repeatedly: for most areafix operations, I was treating areas.ini as a areas.bbs file (format) and vice versa. Now fixed.

  • great!! It's works now!!! thanks a lot!

  • Rob Swindell :speech_balloon: @rswindell

    mentioned in commit e2476ebb

    ·

    mentioned in commit e2476ebb

    Toggle commit list
  • Rob Swindell :speech_balloon: @rswindell

    mentioned in commit 68e76982

    ·

    mentioned in commit 68e76982

    Toggle commit list
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment