娃娃机数据清理

This commit is contained in:
by 2024-08-15 18:35:22 +08:00
parent 6b8e24cba3
commit 37f6b4163e
2 changed files with 9 additions and 4 deletions

View File

@ -62,10 +62,7 @@ func processConnMessageQueue(queue *ConnMessageQueue) {
return true
}, nil, 200*time.Millisecond)
}()
}
queue.waitGroup.Wait()
}
}
@ -172,6 +169,7 @@ func SMDollMachineGrabHandler(session *netlib.Session, packetId int, data interf
// 监听抓取结果返回
func DollMachineGrabResult(session *netlib.Session, conn *machinedoll.Conn, snid, id int32) {
num := 1
for {
// 读取数据
fmt.Println("监听抓取结果返回!")
@ -181,7 +179,12 @@ func DollMachineGrabResult(session *netlib.Session, conn *machinedoll.Conn, snid
fmt.Println("Failed to read response from client:", err)
return
}
if n != 0 && num == 1 {
num += 1
fmt.Println("清除脏数据buf = ", buf[:n])
continue
}
num++
// 将读取到的数据按照 221 进行分割
parts := bytes.Split(buf[:n], []byte{221})
fmt.Println("获取到的返回值:", parts)

View File

@ -96,6 +96,7 @@ func (this *MachineManager) Update() {
delConn = append(delConn, v)
v.Close()
logger.Logger.Tracef("断开连接:%v", v.Addr)
fmt.Println("娃娃机断开连接!!!!!!!!!!!")
this.UpdateToGameServer(v, 0)
}
}
@ -115,6 +116,7 @@ func (this *MachineManager) Update() {
continue
}
logger.Logger.Tracef("重连成功:%v", addr)
fmt.Println("娃娃机重连成功!!!!!!!!!!!")
delIds = append(delIds, &Conn{
Id: id,
Conn: conn,