后台统计登录结果
This commit is contained in:
parent
e36757d9fa
commit
a9ec52b183
|
@ -103,6 +103,7 @@ func NewLoginLog(snId, logType int32, tel, ip, platform, channel, promoter, pack
|
|||
|
||||
type LoginErrorLog struct {
|
||||
TypeId int32
|
||||
Ts int64
|
||||
}
|
||||
|
||||
//func InsertLoginLogs(logs ...*LoginLog) (err error) {
|
||||
|
|
|
@ -63,10 +63,13 @@ 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()),
|
||||
if code != login_proto.OpResultCode_OPRC_Sucess {
|
||||
log := &model.LoginErrorLog{
|
||||
TypeId: int32(code.Enum().Number()),
|
||||
Ts: time.Now().Unix(),
|
||||
}
|
||||
mq.Write(log)
|
||||
}
|
||||
mq.Write(log)
|
||||
}
|
||||
|
||||
sendSCDisconnect := func(code int32) {
|
||||
|
|
|
@ -433,8 +433,11 @@ 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()),
|
||||
if code != login_proto.OpResultCode_OPRC_Sucess {
|
||||
log := &model.LoginErrorLog{
|
||||
TypeId: int32(code.Enum().Number()),
|
||||
Ts: time.Now().Unix(),
|
||||
}
|
||||
mq.Write(log)
|
||||
}
|
||||
mq.Write(log)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue