Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

The "cutting edge" is getting rather dull. -- Andy Purshottam


dovenet / Synchronet Javascript / Re: Saving data in custom module

SubjectAuthor
* Saving data in custom moduleSam Alexander
+* Saving data in custom moduleechicken
|`* Saving data in custom moduleAndre
| +- Saving data in custom moduleNightfox
| `- Re: Saving data in custom moduleRagnarok
`- Saving data in custom moduleNightfox

1
Saving data in custom module

<623DDC02.3621.dove-syncjs@campbaudot.com>

  copy mid

https://www.rocksolidbbs.com/dovenet/article-flat.php?id=744&group=DOVE-Net.Synchronet_Javascript#744

  copy link   Newsgroups: DOVE-Net.Synchronet_Javascript
From: sam.alexander@VERT/BAUDOT (Sam Alexander)
To: All
Subject: Saving data in custom module
Message-ID: <623DDC02.3621.dove-syncjs@campbaudot.com>
Date: Fri, 25 Mar 2022 08:13:06 -0600
X-Comment-To: All
Path: rocksolidbbs.com!not-for-mail
Organization: Camp Baudot
Newsgroups: DOVE-Net.Synchronet_Javascript
X-FTN-PID: Synchronet 3.19c-Linux master/0b34b299a Mar 20 2022 GCC 9.4.0
X-FTN-CHRS: CP437 2
WhenImported: 20220325083838-0700 c1e0
WhenExported: 20220325115754-0700 c1e0
ExportedFrom: VERT sync-js 3659
WhenImported: 20220325151306-0600 4168
WhenExported: 20220325153843Z 4168
ExportedFrom: BAUDOT dove-syncjs 3621
Content-Type: text/plain; charset=IBM437
Content-Transfer-Encoding: 8bit
 by: Sam Alexander - Fri, 25 Mar 2022 14:13 UTC

I'm probably overlooking this in the docs, but if I'm building a custom module how can I save data back to the Synchronet database or elsewhere? I'm still really foggy in how Sync saves data to the file system. I'm playing with some ideas for custom modules which will need to save data back, just not sure how
to do this.

Appriciate the input.

---
■ Synchronet ■ Camping on the Internet at Camp Baudot BBS - campbaudot.com

Saving data in custom module

<623DEEAC.3628.sync_js@bbs.electronicchicken.com>

  copy mid

https://www.rocksolidbbs.com/dovenet/article-flat.php?id=745&group=DOVE-Net.Synchronet_Javascript#745

  copy link   Newsgroups: DOVE-Net.Synchronet_Javascript
From: echicken@VERT/ECBBS (echicken)
To: Sam Alexander
Subject: Saving data in custom module
Message-ID: <623DEEAC.3628.sync_js@bbs.electronicchicken.com>
Date: Fri, 25 Mar 2022 09:32:44 -0500
X-Comment-To: Sam Alexander
Path: rocksolidbbs.com!not-for-mail
Organization: electronic chicken bbs
Newsgroups: DOVE-Net.Synchronet_Javascript
In-Reply-To: <623DDC02.3621.dove-syncjs@campbaudot.com>
References: <623DDC02.3621.dove-syncjs@campbaudot.com>
X-FTN-PID: Synchronet 3.19c-Linux master/9aaaef9ab Feb 22 2022 GCC 9.3.0
X-FTN-CHRS: CP437 2
WhenImported: 20220325093308-0700 c1e0
WhenExported: 20220325115754-0700 c1e0
ExportedFrom: VERT sync-js 3660
WhenImported: 20220325163244-0500 412c
WhenExported: 20220325163307Z 412c
ExportedFrom: ECBBS sync_js 3628
Content-Type: text/plain; charset=IBM437
Content-Transfer-Encoding: 8bit
 by: echicken - Fri, 25 Mar 2022 14:32 UTC

Re: Saving data in custom module
By: Sam Alexander to All on Fri Mar 25 2022 15:13:06

SA> I'm probably overlooking this in the docs, but if I'm building a custom
SA> module how can I save data back to the Synchronet database or elsewhere?
SA> I'm still really foggy in how Sync saves data to the file system. I'm
SA> playing with some ideas for custom modules which will need to save data
SA> back, just not sure how to do this.

There are a lot of different ways. Synchronet and its modules don't store all of their data in any one place following any one format.

The exec/load/userprops.js library lets you set per-user keys and values arbitrarily.

The built-in File class lets you do typical file IO stuff. It's documented in jsobjs.html* and there are many usage examples in exec/. Create your own file wherever you like and put whatever you want in it. You can use it with ini files and with JSON.parse/JSON.stringify if you like.

There's the JSON-DB service, which lets you share a JS object among multiple clients including remote BBSs. Has a subscription feature so it'll push real-time updates to clients.

The user, message, and file databases can all be interacted with from JS. See the User class, the MsgBase class, the FileBase class in jsobjs.html*.

* https://synchro.net/docs/jsobjs.html

---
echicken
electronic chicken bbs - bbs.electronicchicken.com
---
■ Synchronet ■ electronic chicken bbs - bbs.electronicchicken.com

Saving data in custom module

<623DEDC3.3593.dove_sync_js@digitaldistortionbbs.com>

  copy mid

https://www.rocksolidbbs.com/dovenet/article-flat.php?id=746&group=DOVE-Net.Synchronet_Javascript#746

  copy link   Newsgroups: DOVE-Net.Synchronet_Javascript
From: nightfox@VERT/DIGDIST (Nightfox)
To: Sam Alexander
Subject: Saving data in custom module
Message-ID: <623DEDC3.3593.dove_sync_js@digitaldistortionbbs.com>
Date: Fri, 25 Mar 2022 02:28:51 -0700
X-Comment-To: Sam Alexander
Path: rocksolidbbs.com!not-for-mail
Organization: Digital Distortion
Newsgroups: DOVE-Net.Synchronet_Javascript
In-Reply-To: <623DDC02.3621.dove-syncjs@campbaudot.com>
References: <623DDC02.3621.dove-syncjs@campbaudot.com>
X-FTN-PID: Synchronet 3.19c-Win32 master/066055393 Mar 23 2022 MSC 1929
X-FTN-CHRS: CP437 2
WhenImported: 20220325093548-0700 c1e0
WhenExported: 20220325115754-0700 c1e0
ExportedFrom: VERT sync-js 3661
WhenImported: 20220325092851-0700 c1e0
WhenExported: 20220325093538-0700 c1e0
ExportedFrom: DIGDIST dove_sync_js 3593
Content-Type: text/plain; charset=IBM437
Content-Transfer-Encoding: 8bit
 by: Nightfox - Fri, 25 Mar 2022 09:28 UTC

Re: Saving data in custom module
By: Sam Alexander to All on Fri Mar 25 2022 03:13 pm

SA> I'm probably overlooking this in the docs, but if I'm building a custom
SA> module how can I save data back to the Synchronet database or elsewhere?
SA> I'm still really foggy in how Sync saves data to the file system. I'm
SA> playing with some ideas for custom modules which will need to save data
SA> back, just not sure how to do this.

I don't know of a general "Synchronet database" for generic data, but its JavaScript has a File class that you could use to write data to a file on the drive:
http://www.synchro.net/docs/jsobjs.html#File_class

Nightfox

---
■ Synchronet ■ Digital Distortion: digitaldistortionbbs.com

Saving data in custom module

<623E1564.1160.dove-syncjs@bbs.radiomentor.org>

  copy mid

https://www.rocksolidbbs.com/dovenet/article-flat.php?id=748&group=DOVE-Net.Synchronet_Javascript#748

  copy link   Newsgroups: DOVE-Net.Synchronet_Javascript
From: andre@VERT/RDOMENTR (Andre)
To: echicken
Subject: Saving data in custom module
Message-ID: <623E1564.1160.dove-syncjs@bbs.radiomentor.org>
Date: Fri, 25 Mar 2022 07:17:56 -0500
X-Comment-To: echicken
Path: rocksolidbbs.com!not-for-mail
Organization: Radio Mentor BBS
Newsgroups: DOVE-Net.Synchronet_Javascript
In-Reply-To: <623DEEAC.3628.sync_js@bbs.electronicchicken.com>
References: <623DEEAC.3628.sync_js@bbs.electronicchicken.com>
X-FTN-PID: Synchronet 3.19c-Linux master/f5a4c16bb Mar 24 2022 GCC 9.4.0
X-FTN-CHRS: CP437 2
WhenImported: 20220325131725-0700 c1e0
WhenExported: 20220325175752-0700 c1e0
ExportedFrom: VERT sync-js 3663
WhenImported: 20220325141756-0500 c168
WhenExported: 20220325151727-0500 c168
ExportedFrom: RDOMENTR dove-syncjs 1160
Content-Type: text/plain; charset=IBM437
Content-Transfer-Encoding: 8bit
 by: Andre - Fri, 25 Mar 2022 12:17 UTC

Re: Saving data in custom module
By: echicken to Sam Alexander on Fri Mar 25 2022 04:32 pm

ec> There are a lot of different ways. Synchronet and its modules don't store
ec> all of their data in any one place following any one format.

Lemme go quick make a gitlab issue for "Windows Registry style of data storage."

- Andre

---
■ Synchronet ■ Radio Mentor BBS - bbs.radiomentor.org

Saving data in custom module

<623E2A13.3597.dove_sync_js@digitaldistortionbbs.com>

  copy mid

https://www.rocksolidbbs.com/dovenet/article-flat.php?id=749&group=DOVE-Net.Synchronet_Javascript#749

  copy link   Newsgroups: DOVE-Net.Synchronet_Javascript
From: nightfox@VERT/DIGDIST (Nightfox)
To: Andre
Subject: Saving data in custom module
Message-ID: <623E2A13.3597.dove_sync_js@digitaldistortionbbs.com>
Date: Fri, 25 Mar 2022 06:46:11 -0700
X-Comment-To: Andre
Path: rocksolidbbs.com!not-for-mail
Organization: Digital Distortion
Newsgroups: DOVE-Net.Synchronet_Javascript
In-Reply-To: <623E1564.1160.dove-syncjs@bbs.radiomentor.org>
References: <623E1564.1160.dove-syncjs@bbs.radiomentor.org>
X-FTN-PID: Synchronet 3.19c-Win32 master/066055393 Mar 23 2022 MSC 1929
X-FTN-CHRS: CP437 2
WhenImported: 20220325140750-0700 c1e0
WhenExported: 20220325175752-0700 c1e0
ExportedFrom: VERT sync-js 3664
WhenImported: 20220325134611-0700 c1e0
WhenExported: 20220325140747-0700 c1e0
ExportedFrom: DIGDIST dove_sync_js 3597
Content-Type: text/plain; charset=IBM437
Content-Transfer-Encoding: 8bit
 by: Nightfox - Fri, 25 Mar 2022 13:46 UTC

Re: Saving data in custom module
By: Andre to echicken on Fri Mar 25 2022 02:17 pm

ec>> There are a lot of different ways. Synchronet and its modules don't
ec>> store all of their data in any one place following any one format.

An> Lemme go quick make a gitlab issue for "Windows Registry style of data
An> storage."

https://youtu.be/31g0YE61PLQ

Nightfox

---
■ Synchronet ■ Digital Distortion: digitaldistortionbbs.com

Re: Saving data in custom module

<6244D67D.3607.dovenetsyncprjs@bbs.docksud.com.ar>

  copy mid

https://www.rocksolidbbs.com/dovenet/article-flat.php?id=763&group=DOVE-Net.Synchronet_Javascript#763

  copy link   Newsgroups: DOVE-Net.Sync_JavaScript DOVE-Net.Synchronet_Javascript
From: ragnarok@VERT/DOCKSUD (Ragnarok)
To: Andre
Subject: Re: Saving data in custom module
Message-ID: <6244D67D.3607.dovenetsyncprjs@bbs.docksud.com.ar>
Date: Wed, 30 Mar 2022 12:15:25 -0300
X-Comment-To: Andre
Path: rocksolidbbs.com!not-for-mail
Organization: Dock Sud BBS
Newsgroups: DOVE-Net.Sync_JavaScript,DOVE-Net.Synchronet_Javascript
In-Reply-To: <623E1564.1160.dove-syncjs@bbs.radiomentor.org>
References: <623E1564.1160.dove-syncjs@bbs.radiomentor.org>
X-FTN-PID: Synchronet 3.19c-Linux master/02c962f23 Mar 15 2022 GCC 6.3.0
X-FTN-CHRS: UTF-8 4
WhenImported: 20220330155508-0700 c1e0
WhenExported: 20220330175762-0700 c1e0
ExportedFrom: VERT sync-js 3679
WhenImported: 20220330191525-0300 ff4c
WhenExported: 20220330195506-0300 ff4c
ExportedFrom: DOCKSUD dovenetsyncprjs 3607
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101Firefox/91.0 Thunderbird/91.7.0
Content-Language: es-AR
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
 by: Ragnarok - Wed, 30 Mar 2022 15:15 UTC

El 25/3/22 a las 16:17, Andre escribi�:
> Re: Saving data in custom module
> By: echicken to Sam Alexander on Fri Mar 25 2022 04:32 pm
>
> ec> There are a lot of different ways. Synchronet and its modules don't store
> ec> all of their data in any one place following any one format.
>
> Lemme go quick make a gitlab issue for "Windows Registry style of data storage."
>
>
you can use ini style files too and your future module can be more
portable, windows registry sucks

---
� Synchronet � Dock Sud BBS TLD 24 HS - bbs.docksud.com.ar

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor