支持控制台命令

This commit is contained in:
kercylan98
2023-05-23 14:54:43 +08:00
parent aeade860be
commit c8f4827f6c
2 changed files with 60 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
package main
import (
"github.com/kercylan98/minotaur/server"
"github.com/kercylan98/minotaur/utils/log"
"go.uber.org/zap"
)
func main() {
srv := server.New(server.NetworkWebsocket)
srv.RegConsoleCommandEvent("test", func(srv *server.Server) {
log.Info("Console", zap.String("Info", "Test"))
})
if err := srv.Run(":9999"); err != nil {
panic(err)
}
}