diff --git a/common/socket/ServerEvent.go b/common/socket/ServerEvent.go index 02c216cf..2a71bda0 100644 --- a/common/socket/ServerEvent.go +++ b/common/socket/ServerEvent.go @@ -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 { diff --git a/logic/controller/controller.go b/logic/controller/controller.go index e8bc204c..fddae933 100644 --- a/logic/controller/controller.go +++ b/logic/controller/controller.go @@ -193,8 +193,7 @@ func Recv(c gnet.Conn, data handler.TomeeHeader) { params = append(params, ptrValue1, reflect.ValueOf(service.GetPlayer(c, data.UserID))) } else { - // fmt.Println("远程地址", c.RemoteAddr(), c) - //c.SetContext("ahahha") + params = append(params, ptrValue1, reflect.ValueOf(c)) } diff --git a/logic/controller/login.go b/logic/controller/login.go index 2a0aff3b..5141b0e4 100644 --- a/logic/controller/login.go +++ b/logic/controller/login.go @@ -13,10 +13,6 @@ import ( // 处理命令: 1001 func (h *Controller) Login(data login.LoginSidInfo, c gnet.Conn) []byte { //这个时候player应该是空的 - //c := *c1 - //c.SetContext("ahahha") - //fmt.Println(data.CheakSession()) //检查结构体 - //fmt.Println("远程地址", c.RemoteAddr(), c) if tt := data.CheakSession(); tt { //说明sid正确 h.RPCClient.Kick(int32(data.Head.UserID)) //先踢人