add help, operator handlers and screens

This commit is contained in:
Sundog Jones 2021-04-16 16:04:50 -07:00
parent 97cc113329
commit fb4aa62f16
3 changed files with 153 additions and 1 deletions

47
main.go
View File

@ -190,7 +190,52 @@ func menuHandler(ctx context.Context, conn net.Conn, w *gaio.Watcher) {
log.Printf("err loading welcome screen: %v\n", err) log.Printf("err loading welcome screen: %v\n", err)
} }
if err := w.Write(ctx, conn, welcomeStr); err != nil { if err := w.Write(ctx, conn, welcomeStr); err != nil {
log.Printf("error sending welcomeHandler from cmd `welcome`: %v", err) log.Printf("error sending screenHandler from cmd `welcome`: %v", err)
}
case "help":
helpStr, err := screenHandler("help")
if err != nil {
log.Printf("err loading help screen: %v\n", err)
}
if err := w.Write(ctx, conn, helpStr); err != nil {
log.Printf("error sending screenHandler from cmd `help`: %v", err)
}
case "operator":
opStr, err := screenHandler("operator")
if err != nil {
log.Printf("err loading operator screen: %v\n", err)
}
var lineNum int
var line string
baudrate := 40 // 300 baud is ~ 30 characters per second; I'll be nice and bump it to 400
for lineNum, line = range strings.Split(string(opStr), "\n") {
// changed my mind - I actually like it at a nice steady 400 baud, tyvm
// if baudrate < 120 && i > 1 { // 1200 baud is still very readable in realtime without being too fast
// baudrate += 1
//}
if lineNum < 10 { // spit the banner text out quickly
if err := w.Write(ctx, conn, []byte(line+"\r\n")); err != nil {
log.Printf("error sending rune from cmd `operator`: %v", err)
}
} else {
ms := float64(1) / float64(baudrate)
for _, c := range line {
if err := w.Write(ctx, conn, []byte{byte(c)}); err != nil {
log.Printf("error sending rune from cmd `operator`: %v", err)
}
time.Sleep(time.Duration(ms*1000) * time.Millisecond)
}
if err := w.Write(ctx, conn, []byte("\r\n")); err != nil {
log.Printf("error sending rune from cmd `operator`: %v", err)
}
}
}
// add prompt at end
if err := w.Write(ctx, conn, []byte("\r\n> ")); err != nil {
log.Printf("error sending rune from cmd `operator`: %v", err)
} }
case "adventure": case "adventure":

19
screens/help.ans Normal file
View File

@ -0,0 +1,19 @@


__ __________ ____ __ __________ ____ __
/ / / / ____/ / / __ \ / |/ / ____/ | / / / / /
/ /_/ / __/ / / / /_/ / / /|_/ / __/ / |/ / / / / 
/ __ / /___/ /___/ ____/ / / / / /___/ /| / /_/ / 
/_/ /_/_____/_____/_/ /_/ /_/_____/_/ |_/\____/ 
Commands:
welcome - display welcome banner\r\n
info - get information about this server\r\n
operator - get information about this server's operator\r\n
contact - contact server operator\r\n\r\n
help - display this help message\r\n
exit - disconnect from system
>

View File

@ -0,0 +1,88 @@


___ __ __ ________ ____ __
/ | / /_ ____ __ __/ /_ /_ __/ /_ ___ / __ \____ ___ _________ _/ /_____ _____
/ /| | / __ \/ __ \/ / / / __/ / / / __ \/ _ \ / / / / __ \/ _ \/ ___/ __ '/ __/ __ \/ ___/
/ ___ |/ /_/ / /_/ / /_/ / /_ / / / / / / __/ / /_/ / /_/ / __/ / / /_/ / /_/ /_/ / /
/_/ |_/_.___/\____/\__,_/\__/ /_/ /_/ /_/\___/ \____/ .___/\___/_/ \__,_/\__/\____/_/

This bulletin board system is built and operated by David Quick, also known as Sundog.
That's me! You can call me Dave, or David, or Sundog, and I use he/him as my pronouns (though
I have nothing against they/them pronouns either if you prefer)
At various points throughout my life, I
- received my first computer, a Timex Sinclair 1000 with Zilog Z80 processor and 2 kilobytes of RAM
- got the 16 kilobyte RAM expansion pack after I proved I could use all 2 kilobytes after a few
weeks of teaching myself BASIC programming
- learned my first real operating system in the form of CP/M 2.2 running on a Kaypro 2X
- went online the first time with a 300 baud direct connect modem to post messages on Citadel
bulletin board systems
- was paid for writing code for the first time using BASIC to handle scheduling a newspaper motor
delivery route's invoices for our paper delivery person
I have
- worked as a professional musician, an FM radio disc jockey, a newspaper layout editor, and a
short order cook
- built a dial-up ISP using a Sparc 10, an Apple Workgroup Server 6150, a fractional T1 line,
and a few dozen external modems
- taught myself Solaris, TCP/IP networking, web design, bind, sendmail, and numerous other Unix
programs and scripts in the process of building the ISP
- registered more than five of the first 25,000 .com domain names
- taught children how to build web sites
- taught grandparents how to build web sites
- taught rooms full of third-party software engineers how to leverage custom APIs on two continents
- written web applications designed to be displayed on televisions before there were any smart
televisions
- built an online audio streaming radio station with thousands of unique daily listeners for an
MMORPG community
- built private chat functionality for a dating web site ranked in the top five worldwide before
anyone had smartphones
- built a custom video livestreaming infrastructure using commodity hardware and usable by
completely non-technical end users before YouTube Live
- been paid to write Ada, BASIC, C, C++, C#, COBOL, ColdFusion, ElasticSearch pipelines, HTML,
Java, Javascript, various NoSQLs, Perl, PHP, Python, various SQLs, and x86 Assembler,
- at least a passing familiarity with a number of lisps, schemes, and forths, including some I
have ported to various microcontrollers, as well as Go, Lua, Rust, and Haskell,
- a public /28 IPv4 subnet on my home internet connection which hosts most of my personal
infrastructure, including this raspberry pi 4 server
- two nodes on a distributed federated microblogging network, one just for me and one for anyone
who wants to have a place online to talk about music called linernotes.club,
- been called Sundog by my friends for a very long time
- been on stage in front of thousands
- been a consultant to more than one Fortune 50 company
- been backstage at a Parliament Funkadelic show
- a long tradition of listening to jazz all day every Sunday
I've had
- a cigar with John McAfee
- drinks with Bruce Sterling
- lunch with Phil Zimmerman
- a single-digit employee number numerous times
- a double-digit employee number with a company that successfully IPOed
- a triple-digit employee number with a company with offices on five continents
- a four-digit Slashdot UID
- a seven-digit ICQ number
- root on more servers than 99.999% of people who have ever lived
and I want to
- solve problems
- build tools and toolsets
- experiment
- learn and teach
- empower users
- and work with you to do those things
Thanks for reading my bio! -- Sundog

P.S.: as a bonus for reading through all of that, I'll let you know about a command that isn't on the help menu.
Try adventure sometime.