add help, operator handlers and screens
This commit is contained in:
parent
97cc113329
commit
fb4aa62f16
47
main.go
47
main.go
|
@ -190,7 +190,52 @@ func menuHandler(ctx context.Context, conn net.Conn, w *gaio.Watcher) {
|
|||
log.Printf("err loading welcome screen: %v\n", err)
|
||||
}
|
||||
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":
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
[2J[H
|
||||
[38;2;255;255;0m
|
||||
__ __________ ____ __ __________ ____ __[38;2;224;224;0m
|
||||
/ / / / ____/ / / __ \ / |/ / ____/ | / / / / /[38;2;192;192;0m
|
||||
/ /_/ / __/ / / / /_/ / / /|_/ / __/ / |/ / / / / [38;2;160;160;0m
|
||||
/ __ / /___/ /___/ ____/ / / / / /___/ /| / /_/ / [38;2;128;128;0m
|
||||
/_/ /_/_____/_____/_/ /_/ /_/_____/_/ |_/\____/ [38;2;224;224;0m
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
[32m>
|
|
@ -0,0 +1,88 @@
|
|||
[2J[H
|
||||
[38;2;255;0;96m
|
||||
___ __ __ ________ ____ __[38;2;224;0;128m
|
||||
/ | / /_ ____ __ __/ /_ /_ __/ /_ ___ / __ \____ ___ _________ _/ /_____ _____[38;2;192;0;160m
|
||||
/ /| | / __ \/ __ \/ / / / __/ / / / __ \/ _ \ / / / / __ \/ _ \/ ___/ __ '/ __/ __ \/ ___/[38;2;160;0;192m
|
||||
/ ___ |/ /_/ / /_/ / /_/ / /_ / / / / / / __/ / /_/ / /_/ / __/ / / /_/ / /_/ /_/ / /[38;2;128;0;224m
|
||||
/_/ |_/_.___/\____/\__,_/\__/ /_/ /_/ /_/\___/ \____/ .___/\___/_/ \__,_/\__/\____/_/[38;2;96;0;255m
|
||||
|
||||
|
||||
[32m
|
||||
This bulletin board system is built and operated by [38;2;90;255;0mDavid Quick[32m, also known as [38;2;90;255;0mSundog[32m.
|
||||
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 [38;2;90;255;0mTimex Sinclair 1000[32m with [38;2;90;255;0mZilog Z80 processor[32m 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 [38;2;90;255;0mCP/M 2.2[32m running on a [38;2;90;255;0mKaypro 2X[32m
|
||||
- went online the first time with a [38;2;90;255;0m300 baud[32m 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 [38;2;90;255;0mAda, BASIC, C, C++, C#, COBOL, ColdFusion, ElasticSearch pipelines, HTML,
|
||||
Java, Javascript, various NoSQLs, Perl, PHP, Python, various SQLs, and x86 Assembler[32m,
|
||||
- at least a passing familiarity with a number of [38;2;90;255;0mlisps, schemes, and forths,[32m including some I
|
||||
have ported to various microcontrollers, as well as [38;2;90;255;0mGo, Lua, Rust, and Haskell[32m,
|
||||
- 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 [38;2;90;255;0mlinernotes.club[32m,
|
||||
- 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 [38;2;90;255;0mjazz[32m 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 [38;2;90;255;0mwork with you[32m to do those things
|
||||
|
||||
Thanks for reading my bio! -- [38;2;90;255;0mSundog
|
||||
|
||||
[32m
|
||||
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 [38;2;90;255;0madventure[32m sometime.
|
||||
|
Loading…
Reference in New Issue