娃娃机数据清理
This commit is contained in:
parent
6b8e24cba3
commit
37f6b4163e
|
|
@ -62,10 +62,7 @@ func processConnMessageQueue(queue *ConnMessageQueue) {
|
||||||
return true
|
return true
|
||||||
}, nil, 200*time.Millisecond)
|
}, 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) {
|
func DollMachineGrabResult(session *netlib.Session, conn *machinedoll.Conn, snid, id int32) {
|
||||||
|
num := 1
|
||||||
for {
|
for {
|
||||||
// 读取数据
|
// 读取数据
|
||||||
fmt.Println("监听抓取结果返回!")
|
fmt.Println("监听抓取结果返回!")
|
||||||
|
|
@ -181,7 +179,12 @@ func DollMachineGrabResult(session *netlib.Session, conn *machinedoll.Conn, snid
|
||||||
fmt.Println("Failed to read response from client:", err)
|
fmt.Println("Failed to read response from client:", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if n != 0 && num == 1 {
|
||||||
|
num += 1
|
||||||
|
fmt.Println("清除脏数据!!!!!!!!!!!!!buf = ", buf[:n])
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
num++
|
||||||
// 将读取到的数据按照 221 进行分割
|
// 将读取到的数据按照 221 进行分割
|
||||||
parts := bytes.Split(buf[:n], []byte{221})
|
parts := bytes.Split(buf[:n], []byte{221})
|
||||||
fmt.Println("获取到的返回值:", parts)
|
fmt.Println("获取到的返回值:", parts)
|
||||||
|
|
|
||||||
|
|
@ -96,6 +96,7 @@ func (this *MachineManager) Update() {
|
||||||
delConn = append(delConn, v)
|
delConn = append(delConn, v)
|
||||||
v.Close()
|
v.Close()
|
||||||
logger.Logger.Tracef("断开连接:%v", v.Addr)
|
logger.Logger.Tracef("断开连接:%v", v.Addr)
|
||||||
|
fmt.Println("娃娃机断开连接!!!!!!!!!!!")
|
||||||
this.UpdateToGameServer(v, 0)
|
this.UpdateToGameServer(v, 0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -115,6 +116,7 @@ func (this *MachineManager) Update() {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
logger.Logger.Tracef("重连成功:%v", addr)
|
logger.Logger.Tracef("重连成功:%v", addr)
|
||||||
|
fmt.Println("娃娃机重连成功!!!!!!!!!!!")
|
||||||
delIds = append(delIds, &Conn{
|
delIds = append(delIds, &Conn{
|
||||||
Id: id,
|
Id: id,
|
||||||
Conn: conn,
|
Conn: conn,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue