From 00eaa362262f158fd71bc72c8c0522a5b6bb0d0e Mon Sep 17 00:00:00 2001 From: kercylan98 Date: Mon, 18 Sep 2023 16:01:45 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E4=BC=98=E5=8C=96=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E5=85=BC=E5=AE=B9=20WithShunt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 +--- examples/internal/room-shunt-server/main.go | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f8c3913..22f17b2 100644 --- a/README.md +++ b/README.md @@ -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 }), diff --git a/examples/internal/room-shunt-server/main.go b/examples/internal/room-shunt-server/main.go index b8662e2..78241d5 100644 --- a/examples/internal/room-shunt-server/main.go +++ b/examples/internal/room-shunt-server/main.go @@ -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 }),