From e36757d9fa584d7e1ac0a5458518245de36806b0 Mon Sep 17 00:00:00 2001 From: by <123456@qq.com> Date: Fri, 17 Jan 2025 14:07:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E7=BB=9F=E8=AE=A1=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/loginlog.go | 6 +++++- mq/keyconf.go | 1 + worldsrv/action_login.go | 6 ++++++ worldsrv/mq.go | 1 + worldsrv/task_login.go | 4 ++++ 5 files changed, 17 insertions(+), 1 deletion(-) diff --git a/model/loginlog.go b/model/loginlog.go index 6a16581..6d3ef96 100644 --- a/model/loginlog.go +++ b/model/loginlog.go @@ -55,7 +55,7 @@ type LoginLog struct { BuildVersion string AppChannel string DeviceOS string - ClientVer int32 + ClientVer int32 } func NewLoginLog(snId, logType int32, tel, ip, platform, channel, promoter, packageId, city string, @@ -101,6 +101,10 @@ func NewLoginLog(snId, logType int32, tel, ip, platform, channel, promoter, pack return cl } +type LoginErrorLog struct { + TypeId int32 +} + //func InsertLoginLogs(logs ...*LoginLog) (err error) { // if rpcCli == nil { // logger.Logger.Error("model.InsertLoginLogs rpcCli == nil") diff --git a/mq/keyconf.go b/mq/keyconf.go index 5e13415..7638967 100644 --- a/mq/keyconf.go +++ b/mq/keyconf.go @@ -21,6 +21,7 @@ const ( BackOnlineGame = "back_onlinegame" BackRedPacket = "back_redpacket" NianPlayerRank = "log_nianplayerrank" + LoginError = "log_loginerror" ) // go后端 diff --git a/worldsrv/action_login.go b/worldsrv/action_login.go index 2ac86b9..bf5d3d4 100644 --- a/worldsrv/action_login.go +++ b/worldsrv/action_login.go @@ -5,6 +5,7 @@ import ( "encoding/hex" "fmt" "io" + "mongo.games.com/game/mq" "strconv" "time" @@ -61,6 +62,11 @@ func (this *CSLoginHandler) Process(s *netlib.Session, packetid int, data interf } proto.SetDefaults(sclogin) common.SendToGate(sid, int(login_proto.LoginPacketID_PACKET_SC_LOGIN), sclogin, s) + logger.Logger.Trace("CSLoginHandler Process send ", sclogin) + log := &model.LoginErrorLog{ + TypeId: int32(code.Enum().Number()), + } + mq.Write(log) } sendSCDisconnect := func(code int32) { diff --git a/worldsrv/mq.go b/worldsrv/mq.go index e2ab918..c4b27ee 100644 --- a/worldsrv/mq.go +++ b/worldsrv/mq.go @@ -36,6 +36,7 @@ func init() { mq.RegisterMessage(&mq.RegisterMessageParam{Name: mq.DBLotteryLog, Data: &model.LotteryLog{}}) mq.RegisterMessage(&mq.RegisterMessageParam{Name: model.MQRankNian, Data: &model.NianInfo{}}) mq.RegisterMessage(&mq.RegisterMessageParam{Name: mq.NianPlayerRank, Data: &model.NianPlayerRankLog{}}) + mq.RegisterMessage(&mq.RegisterMessageParam{Name: mq.LoginError, Data: &model.LoginErrorLog{}}) } func init() { diff --git a/worldsrv/task_login.go b/worldsrv/task_login.go index 2840aa3..509279f 100644 --- a/worldsrv/task_login.go +++ b/worldsrv/task_login.go @@ -433,4 +433,8 @@ func SCLogin(s *netlib.Session, sid int64, csLogin *login_proto.CSLogin, acc *mo proto.SetDefaults(sclogin) common.SendToGate(sid, int(login_proto.LoginPacketID_PACKET_SC_LOGIN), sclogin, s) logger.Logger.Tracef("SCLogin %v", sclogin) + log := &model.LoginErrorLog{ + TypeId: int32(code.Enum().Number()), + } + mq.Write(log) }