Skip to content

Per User Data Recording and Modification

Damon Getsman edited this page Mar 12, 2015 · 3 revisions

dperuser.js

Notes

A lot of the features available for an individual to make their own online persona unique in vDOC or DOC/Citadel do not exist anywhere in Synchronet. Fortunately, the /sbbs/user/ subdirectory is not solely hogged by standard user data. It is also available for any sort of per-user information that needs to be stored, whether it be by external doors, new Synchronet additions, or whatever. I had been contemplating storing 'i'nfo and 'd'oing information in the extended comments section of the userbase record, but that would be a horrible place for a blob. Especially being as I already have utilized this section for notes regarding certain accounts.

This file is for any of the per-user informational setting/display routines, as well as the file IO necessary to ensure that this information is saved in the schema.

Layout

Current OO structure of userRecords

See also: JSON User Record Structure

Properties
  • userDir - directory to be used for our own record structures
  • settingsFilename - filename for the user settings set to be stored from here
  • maxInfoLines - for the user's 'i'nfo field
  • doingChars - how many characters can be utilized for the 'd'oing field (once implemented)
Sub-Objects
  • defaultSettings - alias set, all debugging options are false, optionals are null
  • userDataIO - for handling disk IO in order to save and retrieve per-user information
  • userDataUI - for handling user interface for setting and displaying information from the per-user infoz
userDataIO Methods
  • stripComments() - strips blank lines and comments from a JSON blob file (finds where comment header stops and data begins, more accurately)
  • loadSettingsBlob() - loads the dDoc specific settings file
  • loadSettings() - takes the blob returned from above and loads the appropriate user's records (defined by number) into the appropriate JSON object/return
  • saveInfo() - is passed an array (the info field) to store
  • openFileWrap() - avoids duplicating so much try/catch crap around file access NOTE: This probably could be used in more areas
userDataUI Methods
  • getInfo() - utilized to retrieve the correct amount of text from the user in order to set the 'i'nfo field as they see fit (almost certainly used directly within the call to saveInfo())
  • getDoing() - does the same for the 'd'oing field
  • queryDebugSettings() - returns the specific user's debug settings
  • displayDebugFlags() - shows each of the user's debug statii
  • displayInfo() - derp

Current OO structure of userConfig

Properties
  • cMenu - Config menu display
  • cConfPrompt - derp
Methods
  • reConfigure() - allows user to change and reconfigure their standard shell options