Files
bbs/internal/aol/forms.go
T
Claude e75f4ea03d AOL host: AOL clients sign on with BBS accounts
internal/aol serves AOL's own clients over P3: each token the client
sends is handled, and the host answers with atom streams compiled from
FDO91 source.

- Dd, the Welcome form's screen name and password (its two de_data),
  is a BBS login (Authenticate, throttled and logged as any); the client
  becomes a node, is taken online (async_online, its main window 32-296)
  and shown the BBS's Welcome window.  A failed one gets an alert and
  async_force_off; "New User" is told to join by telnet or the web.
- pE (Sign Off) is answered with XS, the host's sign-off.
- Other tokens are answered with uni_wait_off, so the client doesn't
  wait on them, and are logged; before sign-on they're ignored.
- Streams go as aT in one packet, or at pieces with one 4-byte id when
  long; a stream the client spreads over packets (4.0) is put together.

[aol] turns it on, at :5190 by default.  When [oscar] listens there too
the two share the port: OSCAR hands over connections that begin as P3.

Tested with a scripted client (sign-on, refusals, sign-off, long
streams both ways) and through OSCAR's port.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRm1WrfJdB863kw36V
2026-11-09 01:00:22 +00:00

53 lines
1.3 KiB
Go

package aol
import (
"fmt"
"strings"
"github.com/D-Modem/bbs/internal/aol/fdo"
)
// The host's forms, as FDO91 source.
// onlineForm takes the client online after it signs on, and opens its
// main window (32-296).
const onlineForm = `uni_start_stream
async_online
uni_invoke_local <32-296>
uni_end_stream
`
// alertForm is a message box.
func alertForm(text string) string {
return fmt.Sprintf("uni_start_stream\n async_alert <info, %s>\nuni_end_stream\n", fdo.Quote(text))
}
// welcomeForm is the BBS's Welcome window.
func welcomeForm(bbsName, user string, online int) string {
others := "You are the only one here."
switch {
case online == 2:
others = "One other caller is here."
case online > 2:
others = fmt.Sprintf("%d other callers are here.", online-1)
}
text := strings.Join([]string{
fmt.Sprintf("Welcome to %s, %s!", bbsName, user),
"",
"You are signed on with your BBS account. " + others,
}, "\r\n") // the client drops what follows a bare CR
return fmt.Sprintf(`uni_start_stream
man_start_object <ind_group, %s>
mat_orientation <vcf>
mat_position <center_center>
man_start_object <view, "">
mat_size <40, 6>
man_append_data <%s>
man_end_data
man_end_object
man_update_display
uni_wait_off
uni_end_stream
`, fdo.Quote("Welcome, "+user+"!"), fdo.Quote(text))
}