From ff7452d335d1ec2ee901416c8caf2ba6e2a18732 Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Thu, 19 Sep 2024 18:35:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E7=AB=AF=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B8=A0=E9=81=93=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gatesrv/clientlog.go | 16 ++++++++++------ model/clientlog.go | 12 +++++++----- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/gatesrv/clientlog.go b/gatesrv/clientlog.go index 6716387..92bc608 100644 --- a/gatesrv/clientlog.go +++ b/gatesrv/clientlog.go @@ -26,7 +26,7 @@ func CSClientLog(s *netlib.Session, packetid int, pack interface{}) error { return nil } - var platform string + var platform, appChannel, channelId string var snid int32 var createTs int64 var p *model.PlayerData @@ -44,6 +44,8 @@ func CSClientLog(s *netlib.Session, packetid int, pack interface{}) error { platform = p.Platform snid = p.SnId createTs = p.CreateTime.Unix() + appChannel = p.Channel + channelId = p.ChannelId } //LogChannelSingleton.WriteLog(&model.ClientLog{ @@ -54,11 +56,13 @@ func CSClientLog(s *netlib.Session, packetid int, pack interface{}) error { //}) LogChannelSingleton.WriteLog(&model.ClientLogMysql{ - Data: msg.GetData(), - Platform: platform, - Snid: snid, - Ts: time.Now().Unix(), - CreateTs: createTs, + Data: msg.GetData(), + Platform: platform, + Snid: snid, + Ts: time.Now().Unix(), + CreateTs: createTs, + AppChannel: appChannel, + ChannelId: channelId, }) return nil diff --git a/model/clientlog.go b/model/clientlog.go index 3e4aa37..ada3b3d 100644 --- a/model/clientlog.go +++ b/model/clientlog.go @@ -7,11 +7,13 @@ var ( ) type ClientLog struct { - Data string // 客户端数据,json格式 - Platform string // 平台id - Snid int32 // 玩家id - Ts int64 // 时间戳 - CreateTs int64 // 注册时间 + Data string // 客户端数据,json格式 + Platform string // 平台id + Snid int32 // 玩家id + Ts int64 // 时间戳 + CreateTs int64 // 注册时间 + AppChannel string // 注册时的包渠道 + ChannelId string // 推广渠道 } type CustomData struct {