Both sides previous revisionPrevious revisionNext revision | Previous revision |
custom:text.dat [2018/03/07 12:07] – Added "Using Defaults" section digital man | custom:text.dat [2023/10/27 19:10] (current) – [text.dat file] Mention that text.dat is CP437 (not UTF-8) digital man |
---|
====== text.dat file ====== | ====== text.dat 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. | Much of the text and color that the BBS [[server:terminal|Terminal Server]] displays (sends to a remote user-terminal) is stored as strings of CP437 text in the file: ''[[dir:ctrl]]/text.dat''. |
| |
| **Notes:**\\ |
| * The syntax of the ''text.dat'' file is very specific and extreme caution should be taken when modifying the file (especially when dealing with strings that contain the ''%s'' printf-specifier). |
| * 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. |
| * The original/stock ''text.dat'' strings are actually compiled (as the auto-generated ''text_defaults.c'' file) and linked into the Synchronet executable (i.e. ''sbbs.dll'' or ''libsbbs.so'') so that any strings missing from a sysop's copy of ''text.dat'' will contain the stock string value by default |
| |
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. | |
| |
===== Syntax ===== | ===== Syntax ===== |
| |
| |
===== Customization ===== | ===== Customize ===== |
| |
Knowledge of the C programming language may be very helpful in producing the desired results. If all you want to | Knowledge of the C programming language may be very helpful in producing the desired results. If all you want to |
==== Customization Methods ==== | ==== Customization Methods ==== |
There are multiple ways to customize the contents of the ''text.dat'' file: | There are multiple ways to customize the contents of the ''text.dat'' file: |
| - Create a ''[[dir:ctrl]]/[[text.ini]]'' file that contains a "key: value" line for each string you wish to over-ride in the ''text.dat'' file |
| - Alternate-language translations of specified strings can be added to ''[[dir:ctrl]]/text.//lang//.ini'' files |
- Edit the ''text.dat'' file directly (e.g. using a text editor, but do this with care, see above) | - 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 a single line, programmatically (e.g. in a login/logon script or command-shell) | - Use the [[util:Baja]] ''REPLACE_TEXT'' or [[custom:JavaScript]] ''bbs.replace_text'' function to replace a single line, programmatically (e.g. in a login/logon script or command-shell) |
| |
All of the ''text.dat'' names and numbers can be found in: | All of the ''text.dat'' names and numbers can be found in: |
- The [[custom:JavaScript]] load file: ''[[dir:exec]]/load/[[http://cvs.synchro.net/cgi-bin/viewcvs.cgi/text.js|text.js]]'' | - 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: ''[[http://cvs.synchro.net/cgi-bin/viewcvs.cgi/src/sbbs3/text.h]]'' | - 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. | **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. |
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. | 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 ===== | ===== Use Defaults ===== |
| |
The default values of all the ''text.dat'' strings are stored in the Synchronet Terminal Server library (''sbbs.dll'', ''libsbbs.so''). | 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: | To use all default text strings you can either: |
| |
* Download the ''[[http://cvs.synchro.net/cgi-bin/viewcvs.cgi/ctrl/text.dat|text.dat]]'' revision from CVS which correlates with the executables you're using and overwrite your local file, or | 1. 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-byte file. | |
| 2. Replace (overwrite) your ''text.dat'' file with a 0-length file (each 'missing' string is replaced with the default string), e.g. (on *nix): |
| |
| cp /dev/null /sbbs/ctrl/text.dat |
===== See Also ===== | ===== See Also ===== |
* [[:dir:CTRL]] Directory | * [[text.ini]] File |
* [[http://cvs.synchro.net/cgi-bin/viewcvs.cgi/ctrl/text.dat?view=markup|Current text.dat file in CVS]] | * [[:dir:ctrl]] Directory |
| * [[https://gitlab.synchro.net/sbbs/sbbs/-/raw/master/ctrl/text.dat|Current text.dat file in Git]] |
* [[:config:|Customization]] | * [[:config:|Customization]] |
| |
{{tag>text.dat customization ansi}} | {{tag>text.dat customization ansi}} |
| |