后台统计登录结果
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 {
|
type LoginErrorLog struct {
|
||||||
TypeId int32
|
TypeId int32
|
||||||
|
Ts int64
|
||||||
}
|
}
|
||||||
|
|
||||||
//func InsertLoginLogs(logs ...*LoginLog) (err error) {
|
//func InsertLoginLogs(logs ...*LoginLog) (err error) {
|
||||||
|
|
|
@ -63,11 +63,14 @@ func (this *CSLoginHandler) Process(s *netlib.Session, packetid int, data interf
|
||||||
proto.SetDefaults(sclogin)
|
proto.SetDefaults(sclogin)
|
||||||
common.SendToGate(sid, int(login_proto.LoginPacketID_PACKET_SC_LOGIN), sclogin, s)
|
common.SendToGate(sid, int(login_proto.LoginPacketID_PACKET_SC_LOGIN), sclogin, s)
|
||||||
logger.Logger.Trace("CSLoginHandler Process send ", sclogin)
|
logger.Logger.Trace("CSLoginHandler Process send ", sclogin)
|
||||||
|
if code != login_proto.OpResultCode_OPRC_Sucess {
|
||||||
log := &model.LoginErrorLog{
|
log := &model.LoginErrorLog{
|
||||||
TypeId: int32(code.Enum().Number()),
|
TypeId: int32(code.Enum().Number()),
|
||||||
|
Ts: time.Now().Unix(),
|
||||||
}
|
}
|
||||||
mq.Write(log)
|
mq.Write(log)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sendSCDisconnect := func(code int32) {
|
sendSCDisconnect := func(code int32) {
|
||||||
ssDis := &login_proto.SSDisconnect{
|
ssDis := &login_proto.SSDisconnect{
|
||||||
|
|
|
@ -433,8 +433,11 @@ func SCLogin(s *netlib.Session, sid int64, csLogin *login_proto.CSLogin, acc *mo
|
||||||
proto.SetDefaults(sclogin)
|
proto.SetDefaults(sclogin)
|
||||||
common.SendToGate(sid, int(login_proto.LoginPacketID_PACKET_SC_LOGIN), sclogin, s)
|
common.SendToGate(sid, int(login_proto.LoginPacketID_PACKET_SC_LOGIN), sclogin, s)
|
||||||
logger.Logger.Tracef("SCLogin %v", sclogin)
|
logger.Logger.Tracef("SCLogin %v", sclogin)
|
||||||
|
if code != login_proto.OpResultCode_OPRC_Sucess {
|
||||||
log := &model.LoginErrorLog{
|
log := &model.LoginErrorLog{
|
||||||
TypeId: int32(code.Enum().Number()),
|
TypeId: int32(code.Enum().Number()),
|
||||||
|
Ts: time.Now().Unix(),
|
||||||
}
|
}
|
||||||
mq.Write(log)
|
mq.Write(log)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue