This is an old revision of the document!
Table of Contents
Services
Synchronet Services1) are loadable modules or external executables designed to be loaded by the Synchronet Services Server to service a particular TCP or UDP protocol for remote client connections. Synchronet Services are similar in concept to UNIX's [x]inetd services.
Configure
The Services Server can be configured via SCFG:Servers->Services Server:
╔══════════════════════════════════════════════╗ ║ Services Server ║ ╠══════════════════════════════════════════════╣ ║ │Enabled Yes ║ ║ │Log Level Informational ║ ║ │Network Interfaces 0.0.0.0, :: ║ ║ │Lookup Client Hostname No ║ ║ │Configuration File services.ini ║ ║ │JavaScript Settings... ║ ║ │Failed Login Attempts... ║ ╚══════════════════════════════════════════════╝
... or (on Windows) via SBBSCTRL:Services->Configure:
... or by editing the [Services] section of the ctrl/sbbs.ini file.
Services
Services are normally configured via the ctrl/services.ini file with some global settings controlled via the [Services] section of the sbbs.ini file.
... or (on Windows) via the “Services” tab of the SBBSCTRL:Services->Configure dialog:
Some static services (e.g. the IRC Daemon) may alternatively be executed independently of the Services Server using JSexec.
Service Types
There are four types of services currently supported:
- Dynamic JavaScript (the most common service type)
- Static JavaScript (e.g. the IRC Daemon)
- Dynamic Native
- Static Native
JavaScript Services
Additional methods and properties available to Synchronet Services written in JavaScript:
Properties
| Property | Type | Description |
|---|---|---|
logged_in | boolean | Indication if user has successfully authenticated or not |
datagram | string | Contents of received UDP datagram (when applicable) |
Methods
Along with the common global methods, JavaScript services include support for the following methods:
| Method | Returns | Usage | Description |
|---|---|---|---|
login | boolean | login(user, password [,increment_logins=false]) | Attempt to authenticate as specified user (name or number) |
logout | boolean | logout() | Logout currently authenticated user |
server.client_add | void | server.client_add(Socket, [user], [host]) | Register client based on specified socket connection, with optional username and hostname |
server.client_update | void | server.client_update(Socket, [user], [host]) | Update client based on specified socket connection, with optional username and hostname |
server.client_remove | void | server.client_remove(Socket) | Unregister client based on specified socket connection |

