docs: 优化文档内容兼容 WithShunt

This commit is contained in:
kercylan98 2023-09-18 16:01:45 +08:00
parent 810a9fdb73
commit 00eaa36226
2 changed files with 2 additions and 6 deletions

View File

@ -97,9 +97,7 @@ import "github.com/kercylan98/minotaur/server"
func main() {
srv := server.New(server.NetworkWebsocket,
server.WithShunt(func(guid int64) chan *server.Message {
return make(chan *server.Message, 1024*100)
}, func(conn *server.Conn) (guid int64, allowToCreate bool) {
server.WithShunt(func(conn *server.Conn) (guid int64, allowToCreate bool) {
guid, allowToCreate = conn.GetData("roomId").(int64)
return
}),

View File

@ -4,9 +4,7 @@ import "github.com/kercylan98/minotaur/server"
func main() {
srv := server.New(server.NetworkWebsocket,
server.WithShunt(func(guid int64) chan *server.Message {
return make(chan *server.Message, 1024*100)
}, func(conn *server.Conn) (guid int64, allowToCreate bool) {
server.WithShunt(func(conn *server.Conn) (guid int64, allowToCreate bool) {
guid, allowToCreate = conn.GetData("roomId").(int64)
return
}),