Skip to content

Per Room Data Recording and Modification

Damon Getsman edited this page Mar 14, 2015 · 5 revisions

dperroom.js

Notes

This particular block is to be used for holding informational record schema and routines used for accessing data such as each room's particular 'i'nfo field, lists of users' zapped rooms, etc.

Layout

See also: JSON Room/User Record Structure

Current OO Structure of roomData

Properties
  • userDir - directory for all of our configuration files
  • roomSettingsFilename - file for JSON blobs regarding the settings for individual rooms
  • maxInfoLines - total number of lines allowed for room info
  • userRoomSettingsFilename - file for JSON blobs regarding per-room settings per-user (ie 'z'apped rooms list, etc)
Sub-Objects
roomRecords
  • defaultSettings() - ripe for the filling
userRoomSettings
  • defaultSettings() - ripe for the filling, as well
fileIO

####### Properties

  • roomRecFilename
  • userZapRecFilename

####### Methods

  • saveRoomInfo() - saves the text array passed as the new room info
  • stripNRead() - strips comments/headers from JSON blob to read from
  • snagRoomInfoBlob() - opens, parses the JSON once stripped, returns the appropriate object
  • snagUserZappedRooms() - self-explanatory, returning the correct blob, etc