32 lines
886 B
Go
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)
|
|
}
|
|
}
|