look at the code if you want to know what i did

This commit is contained in:
adman
2026-03-22 00:35:07 +01:00
parent a6102b7ec9
commit ea024fe808
21 changed files with 294 additions and 78 deletions
+8 -9
View File
@@ -60,13 +60,19 @@ type Conn struct {
func (c *Conn) StartConn() (err error) {
c.RegisterCritical(c.OnTick)
return c.Loop.Start()
if c.state == proto_base.Play {
c.ActivateReceiveRoutine()
}
err = c.Loop.StartLoop()
c.Loop = event.NewLoop()
return
}
func (c *Conn) ReceiveJob() {
ctx := c.Ctx
for {
select {
case <-c.Ctx.Done():
case <-ctx.Done():
return
default:
packet, err := c.Receive()
@@ -233,10 +239,3 @@ func (c *Conn) OnTick(_ event.Tick) (err error) {
}
return
}
func (c *Conn) Start() (err error) {
if c.Loop == nil {
c.Loop = &event.Loop{}
}
return c.Loop.Start()
}