docs: 优化文档内容兼容 WithShunt
This commit is contained in:
parent
810a9fdb73
commit
00eaa36226
|
|
@ -97,9 +97,7 @@ import "github.com/kercylan98/minotaur/server"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
srv := server.New(server.NetworkWebsocket,
|
srv := server.New(server.NetworkWebsocket,
|
||||||
server.WithShunt(func(guid int64) chan *server.Message {
|
server.WithShunt(func(conn *server.Conn) (guid int64, allowToCreate bool) {
|
||||||
return make(chan *server.Message, 1024*100)
|
|
||||||
}, func(conn *server.Conn) (guid int64, allowToCreate bool) {
|
|
||||||
guid, allowToCreate = conn.GetData("roomId").(int64)
|
guid, allowToCreate = conn.GetData("roomId").(int64)
|
||||||
return
|
return
|
||||||
}),
|
}),
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,7 @@ import "github.com/kercylan98/minotaur/server"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
srv := server.New(server.NetworkWebsocket,
|
srv := server.New(server.NetworkWebsocket,
|
||||||
server.WithShunt(func(guid int64) chan *server.Message {
|
server.WithShunt(func(conn *server.Conn) (guid int64, allowToCreate bool) {
|
||||||
return make(chan *server.Message, 1024*100)
|
|
||||||
}, func(conn *server.Conn) (guid int64, allowToCreate bool) {
|
|
||||||
guid, allowToCreate = conn.GetData("roomId").(int64)
|
guid, allowToCreate = conn.GetData("roomId").(int64)
|
||||||
return
|
return
|
||||||
}),
|
}),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue