1
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
昔念
2026-02-07 02:59:38 +08:00
parent bc88d58e59
commit 0c3f56d7bb
3 changed files with 7 additions and 3 deletions

View File

@@ -11,14 +11,16 @@ import (
"blazing/common/socket/codec"
"blazing/cool"
"blazing/logic/service/player"
"blazing/modules/config/service"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gtime"
"github.com/panjf2000/gnet/v2"
)
func (s *Server) Boot() error {
func (s *Server) Boot(serverid, port uint16) error {
// go s.bootws()
err := gnet.Run(s, s.network+"://"+s.addr,
gnet.WithMulticore(true),
gnet.WithTicker(true),
@@ -84,6 +86,7 @@ func (s *Server) OnTick() (delay time.Duration, action gnet.Action) {
func (s *Server) OnBoot(eng gnet.Engine) gnet.Action {
s.eng = eng
service.NewServerService().SetServerID(s.serverid, s.port) //设置当前服务器端口
return gnet.None
}

View File

@@ -25,6 +25,8 @@ type Server struct {
discorse bool
quit bool
batchRead int
serverid uint16
port uint16
}
type Option func(*Server)