Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
custom:text.dat [2011/11/03 23:56] digitalmancustom:text.dat [2020/08/23 15:31] – Change links from viewcvs/cvsweb to gitlab. digital man
Line 1: Line 1:
 ====== text.dat file ====== ====== text.dat file ======
  
-Much of the text and color that the BBS [[server:terminal|Terminal Server]] displays is stored in the file +Much of the text and color that the BBS [[server:terminal|Terminal Server]] displays (sends to a remote terminal) is stored as strings of text in the ''[[dir:ctrl]]/text.dat'' file. The syntax of the ''text.dat'' file is very specific and extreme caution should be taken when editing the file. 
-''[[dir:ctrl]]/text.dat'' file. The syntax of this file is VERY specific and + 
-extreme caution should be taken when editing itKnowledge of the C language +Each line of the ''text.dat'' is limited to 255 characters (including comments), while each text string defined in the ''text.dat'' file has a maximum length of 2000 characters
-would be very helpful in producing the desired resultsIf all you want to + 
-do is change colors of certain text linetake care not to disturb the +===== Syntax ===== 
-arrangement of the other characters on the line. Ctrl-A codes can be preceded +Each ''text.dat'' string value is defined with string of ASCII characters between double-quote characters: 
-by an embedded actually Ctrl-(ASCII 0x01) character or by a '\1'  +  "this is an example text.dat string" 
-(the printf() equivalent of Ctrl-A).+Any text after the terminating (ending) double-quote character is ignored when the ''text.dat'' file is parsed by Synchronet. The stock ''text.dat'' file contains helpful numbers and names (comments) after the terminating quotesbut these comments are not actually required. 
 + 
 +The content between the double-quotes is mostly just printable ASCII characters, but may also include: 
 +  * [[custom:Ctrl-A codes]] (e.g. to change the color of the text, if/when supported by the terminal) 
 +  * [[custom:atcodes|@-codes]] (e.g. used to perform terminal cursor control or include external content) 
 +  * [[wp>Printf_format_string|C printf-specifiers]] (e.g. ''%s'', ''%d'', used for dynamic variable content) 
 +  * [[wp>Escape_sequences_in_C|C printf escape sequences]] (e.g. ''\r'', ''\n'', used for special non-printable characters) 
 +  * Mmemonics (e.g. prompts with command keys denoted with a ''~'' character)
  
 The syntax of the characters between the double quotations is identical to  The syntax of the characters between the double quotations is identical to 
Line 16: Line 23:
 you may need to pad the attribute number with zeroes. For example; to set the  you may need to pad the attribute number with zeroes. For example; to set the 
 background to blue, you might try to use the sequence "\14" which won't work. background to blue, you might try to use the sequence "\14" which won't work.
-You could either embed the actual ctrl-character (which is preferred) or+You could either embed the actual Ctrl-character or
 use "\0014". use "\0014".
  
-Some of the strings have characters preceded by a tilde ('~'). These strings+==== Escape Sequences ==== 
 + 
 +^ Sequences ^ Explanation ^ 
 +| ''\\''    | Backslash ('\') character | 
 +| ''\?''    | Question Mark (not normally necessary) | 
 +| ''\'''    | Single Quotation Mark | 
 +| ''\"''    | Double Quotation Mark | 
 +| ''\xXX''  | Embedded character in hexadecimal notation (''\x00'' through ''\xFF'') | 
 +| ''\nnn''  | Embedded character in decimal notation (''\000'' through ''\255'') | 
 +| ''\r''    | Carriage Return (ASCII 13) character | 
 +| ''\n''    | Line-feed (ASCII 10) character | 
 +| ''\t''    | Horizontal Tab (ASCII 9) character | 
 +| ''\b''    | Backspace (ASCII 8) character | 
 +| ''\a''    | Alarm/bell (ASCII 7) character | 
 +| ''\f''    | Form-feed (ASCII 12) character | 
 +| ''\v''    | Vertical Tab (ASCII 11) character | 
 +See Also: [[wp>Escape_sequences_in_C]] 
 + 
 +To continue a text string onto the next line of the ''text.dat'' file (e.g. to create long text strings, up to 2000 characters, from multiple shorter lines): place a backslash ('\') character immediately after the terminating double-quote character of each line, except for the last. 
 + 
 +The order of the % specifiers (if they exist) in a ''text.dat'' line cannot be 
 +altered. The display of %s specifiers can be suppressed by changing the ''%s'' to 
 +''%.0s''. There are advanced Ctrl-A codes that may also be used for the suppression of text sent to users with an insufficient security level or lacking a security flag. 
 + 
 +You can suppress the display of an entire ''text.dat'' line by simply 
 +setting the text to a blank string (''""''). 
 + 
 +==== Mnemonics ==== 
 + 
 +Some of the ''text.dat'' strings have characters preceded by a tilde ('~'). These strings
 are referred to as mnemonics. The tilde precedes a character that is to be are referred to as mnemonics. The tilde precedes a character that is to be
 highlighted for users supporting ANSI and enclosed in parenthesis for non-ANSI highlighted for users supporting ANSI and enclosed in parenthesis for non-ANSI
-users. Usually used for prompt strings that contain the valid key commands.+users. Mnemonics are usually used for prompt strings that contain the valid key commands.
 The colors to use for the highlighted characters, normal characters, and the The colors to use for the highlighted characters, normal characters, and the
 command character are specified in the ''[[dir:ctrl]]/attr.cfg'' file. command character are specified in the ''[[dir:ctrl]]/attr.cfg'' file.
  
-The order of the % specifiers (if they exist) in a ''text.dat'' line cannot be +==== @-Codes ====
-altered. The display of %s specifiers can be suppressed by changing the ''"%s"'' to +
-''"%.0s"''. Another way to suppress the display of specifiers is to enclose them +
-between Ctrl-A( and Ctrl-A). Any text between Ctrl-A( and Ctrl-A) would only +
-be displayed to users of level 90 or higher. To suppress the display to all +
-users, put the text/specifiers between Ctrl-ACtrl-Z and Ctrl-A) (assuming +
-that the Z flag from flag set #1 is not set on any user accounts).+
  
-You can suppress the display of an entire ''text.dat'' line by simply +So-called [[custom:atcodes|@-codes]] may be used in many ''text.dat'' lines. With the use of the ''MENU'', ''TYPE'', ''INCLUDE'', ''EXEC'', and ''EXEC_XTRN'' @-codes, the text.dat may be enhanced with externally-loaded and potentially dynamically-changing content. 
-setting the text to a blank string (''""'')((In Synchronet v3.15b and later)).+ 
 +**Exception**: For security reasons, ''text.dat'' lines that contain %-specifiers **may not** also include @-codes. 
 + 
 + 
 +===== Customize ===== 
 + 
 +Knowledge of the C programming language may be very helpful in producing the desired results. If all you want to 
 +do is change colors of a certain text line, take care not to disturb the 
 +arrangement of the other characters on the line. Ctrl-A codes can be preceded 
 +by an embedded actual Ctrl-A (ASCII 0x01) character or by a '\1'  
 +(the C printf() escape sequence representing a Ctrl-A character). 
 + 
 + 
 +==== Customization Methods ==== 
 +There are multiple ways to customize the contents of the ''text.dat'' file: 
 +  - Edit the ''text.dat'' file directly (e.g. using a text editor, but do this with care, see above) 
 +  - Use the [[util:Baja]] ''REPLACE_TEXT'' or [[custom:JavaScript]] ''bbs.replace_text'' function to replace single line, programmatically (e.g. in a login/logon script or command-shell) 
 +  - Use the [[util:Baja]] ''LOAD_TEXT'' or [[custom:JavaScript]] ''bbs.load_text'' function to load an alternative ''text.dat'' file (e.g. in a login/logon script or command-shell) 
 +  - The [[util:Baja]] ''REVERT_TEXT'' or [[custom:JavaScript]] ''bbs.revert_text'' function may be used to revert to the original set of text strings loaded from the ''text.dat'' file upon initialization 
 + 
 +The current ''text.dat'' strings may be obtained (e.g. for display purposes) using the [[custom:JavaScript]] ''bbs.text'' function. The caller must pass the number of the text string they wish to obtain. 
 + 
 +All of the ''text.dat'' names and numbers can be found in: 
 +  - The [[custom:JavaScript]] load file: ''[[dir:exec]]/load/[[https://gitlab.synchro.net/sbbs/sbbs/-/blob/master/exec/load/text.js|text.js]]'' 
 +  - The C header file: ''[[https://gitlab.synchro.net/sbbs/sbbs/-/blob/master/src/sbbs3/text.h]]'' 
 + 
 +**Note**: The default (US-English) values of all ''text.dat'' strings are hard-coded into Synchronet (e.g. ''sbbs.dll'' or ''libsbbs.so''so if any lines are missing from your ''text.dat'' file or the file itself is missing, the default values will be automatically used.
  
 ** WARNING ** ** WARNING **
Line 42: Line 98:
 initialize. initialize.
  
 +==== Suppressing Questions ====
 +
 +The Yes/No prompts in the ''text.dat'' file may by identified by their names (in the comments) which end in a capital ''Q'' (for "Question"). Examples:
 +  * AnonymousQ
 +  * DeleteMailQ
 +  * DeletePostQ
 +  * AreYouSureQ
 +  * LogOffQ
 +
 +These questions may be suppressed (never asked of the user) by changing the corresponding text value to a blank string (i.e. ''""''). When suppressed, the default answer to the question will be assumed by the BBS (script or program) and user will never be prompted for an answer to that particular question. The default answer may be "Yes" or "No", depending on the context of the question.
 +
 +In many cases, ''Q'' or Ctrl-C (abort) may also be an acceptable answer to the question, but this will never be the default answer.
 +
 +===== Using Defaults =====
 +
 +The default values of all the ''text.dat'' strings are stored in the Synchronet Terminal Server library (''sbbs.dll'', ''libsbbs.so'').
 +
 +To use all default text strings you can either:
  
 +  * Download the ''[[https://gitlab.synchro.net/sbbs/sbbs/-/commits/master/ctrl/text.dat|text.dat]]'' revision from the Source Repository which correlates with the executables you're using and overwrite your local file, or
 +  * Replace (overwrite) your ''text.dat'' file with a 0-length file (each 'missing' string is replaced with the default string).
  
 ===== See Also ===== ===== See Also =====
   * [[:dir:CTRL]] Directory   * [[:dir:CTRL]] Directory
-  * [[http://cvs.synchro.net/cgi-bin/viewcvs.cgi/ctrl/text.dat?view=markup|Current text.dat file in CVS]]+  * [[https://gitlab.synchro.net/sbbs/sbbs/-/raw/master/ctrl/text.dat|Current text.dat file in Git]]
   * [[:config:|Customization]]   * [[:config:|Customization]]
  
-{{tag>}}+{{tag>text.dat customization ansi}}
  
custom/text.dat.txt · Last modified: 2023/10/27 19:10 by digital man
Back to top
CC Attribution 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0