refactor(socket): 移除无用的打印语句和注释
- 删除了 ServerEvent.go、controller.go 和 login.go 中的多处打印语句和注释 - 优化了代码的可读性和性能 - 准备后续进一步优化 OnClose 方法
This commit is contained in:
@@ -2,7 +2,6 @@ package socket
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
"blazing/common/data/entity"
|
||||
@@ -31,10 +30,7 @@ func (s *Server) Stop() error {
|
||||
}
|
||||
|
||||
func (s *Server) OnClose(c gnet.Conn, _ error) (action gnet.Action) {
|
||||
//fmt.Println(glog.GetStack(), c.Context().(*entity.ClientData).Player.UserID, "断开连接")
|
||||
//fmt.Println("远程地址", c.RemoteAddr(), c)
|
||||
fmt.Printf("关闭函数地址: %p\n", c.Context()) // 输出类似: 0x1040a1390
|
||||
//if c.Context() != nil {
|
||||
|
||||
v := c.Context().(*entity.ClientData)
|
||||
t := v.GetPlayer()
|
||||
if t != nil {
|
||||
|
||||
Reference in New Issue
Block a user