修正server中保持连接的处理逻辑

This commit is contained in:
lwch
2021-08-24 16:03:48 +08:00
parent 9c1f3b9bb4
commit 423208574f

View File

@@ -156,7 +156,7 @@ func (h *Handler) onMessage(from *client, conn *network.Conn, msg *network.Msg)
func (h *Handler) msgHook(msg *network.Msg, from, to *client) {
switch msg.GetXType() {
case network.Msg_connect_req:
id := msg.GetCrep().GetId()
id := msg.GetCreq().GetId()
var pair [2]*client
if from != nil {
from.addLink(id)