telnetroulette/main.go
2024-06-08 13:52:22 +02:00

32 lines
886 B
Go

package main
import (
"github.com/BRNSystems/go-telnet"
"sync"
)
var clients []*Client
var clientsMutex sync.Mutex
var matches []*Match
var matchesMutex sync.Mutex
func main() {
addr := ":6969"
commandRegistry := NewCommandRegistry()
termHandler := NewInternalTerminalHandler("# ",
` ____ _ _ ____ _ _ _
/ ___|| |__ ___ | |_ __ _ _ _ _ __ | _ \ ___ _ _| | ___| |_| |_ ___
\___ \| '_ \ / _ \| __/ _`+"`"+` | | | | '_ \ | |_) / _ \| | | | |/ _ \ __| __/ _ \
___) | | | | (_) | || (_| | |_| | | | | | _ < (_) | |_| | | __/ |_| || __/
|____/|_| |_|\___/ \__\__, |\__,_|_| |_| |_| \_\___/ \__,_|_|\___|\__|\__\___|
|___/`,
commandRegistry)
// Register commands
RegisterCommands(commandRegistry)
if err := telnet.ListenAndServe(addr, termHandler); nil != err {
panic(err)
}
}