telnetroulette/main.go

32 lines
886 B
Go
Raw Normal View History

2024-06-08 11:52:12 +02:00
package main
import (
"github.com/BRNSystems/go-telnet"
"sync"
)
2024-06-09 11:02:18 +02:00
var clients []*client
2024-06-08 11:52:12 +02:00
var clientsMutex sync.Mutex
2024-06-09 11:02:18 +02:00
var matches []*match
2024-06-08 13:52:22 +02:00
var matchesMutex sync.Mutex
2024-06-08 11:52:12 +02:00
func main() {
addr := ":6969"
2024-06-09 11:02:18 +02:00
commandRegistry := newCommandRegistry()
termHandler := newInternalTerminalHandler("# ",
2024-06-08 11:52:12 +02:00
` ____ _ _ ____ _ _ _
/ ___|| |__ ___ | |_ __ _ _ _ _ __ | _ \ ___ _ _| | ___| |_| |_ ___
\___ \| '_ \ / _ \| __/ _`+"`"+` | | | | '_ \ | |_) / _ \| | | | |/ _ \ __| __/ _ \
___) | | | | (_) | || (_| | |_| | | | | | _ < (_) | |_| | | __/ |_| || __/
|____/|_| |_|\___/ \__\__, |\__,_|_| |_| |_| \_\___/ \__,_|_|\___|\__|\__\___|
|___/`,
commandRegistry)
// Register commands
2024-06-09 11:02:18 +02:00
registerCommands(commandRegistry)
2024-06-08 11:52:12 +02:00
if err := telnet.ListenAndServe(addr, termHandler); nil != err {
panic(err)
}
}