|
|
@@ -902,7 +902,7 @@ func (s *LogicalLog) AddDeviceLog(request request.AddLogRequest) {
|
|
|
logSC.Account = request.Account
|
|
|
logSC.DeviceId = request.DeviceId
|
|
|
logSC.DeviceImei = request.DeviceImei
|
|
|
- logSC.DeviceIp = request.DeviceIp
|
|
|
+ logSC.DeviceIp = request.SimulatorIp
|
|
|
logSC.DeviceMac = request.DeviceMac
|
|
|
logSC.DeviceManufacturer = request.DeviceManufacturer
|
|
|
logSC.DeviceModel = request.DeviceModel
|
|
|
@@ -915,6 +915,7 @@ func (s *LogicalLog) AddDeviceLog(request request.AddLogRequest) {
|
|
|
logSC.AccountHex = s.AccountHexLog(request)
|
|
|
logSC.CreateDate = time.Now().Format("2006-01-02")
|
|
|
logSC.PcCode = request.PcCode
|
|
|
+ logSC.SimulatorIpCity = request.SimulatorIpCity
|
|
|
ctx := context.Background()
|
|
|
if request.TaskType == 1 {
|
|
|
var deviceLog = log.DeviceLog{}
|
|
|
@@ -1034,8 +1035,8 @@ func (s *LogicalLog) CheckDeviceId(request request.AddLogRequest) {
|
|
|
if request.TaskType == 0 {
|
|
|
b, deviceLog := s.CheckDeviceIdErr(request.ScriptDeviceId, request.LogUuid, request.GameId)
|
|
|
// 有异常处理
|
|
|
- if b {
|
|
|
- s.AddScriptDeviceErr(request.GameId, request.Account, request.ScriptDeviceId, request.ScriptDeviceId, deviceLog.Account, deviceLog.GameId, 2, request.PcCode, request.Operator)
|
|
|
+ if b && len(deviceLog) >= 3 {
|
|
|
+ s.AddScriptDeviceErr(request.GameId, request.Account, request.ScriptDeviceId, request.ScriptDeviceId, deviceLog[0].Account, deviceLog[0].GameId, 2, request.PcCode, request.Operator)
|
|
|
//ct := fmt.Sprintf("<font color=\"warning\">%s:%d, 相同设备id</font>", request.PcCode, request.GameId)
|
|
|
//s.SendDeviceMsg(ct, request.Operator)
|
|
|
}
|
|
|
@@ -1108,9 +1109,10 @@ func (s *LogicalLog) SendMsgData(url string, params interface{}) (result []byte,
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-func (s *LogicalLog) CheckDeviceIdErr(scriptDeviceId string, uuid string, gameId int) (bool, log.DeviceLog) {
|
|
|
- var deviceLog log.DeviceLog
|
|
|
- result := global.GVA_DB.Where("create_date <= ?", time.Now().Format("2006-01-02")).Where("create_date >= ?", time.Now().Add(-time.Hour*24).Format("2006-01-02")).Where("game_id = ?", gameId).Where("script_device_id = ?", scriptDeviceId).Where("log_uuid != ?", uuid).First(&deviceLog)
|
|
|
+func (s *LogicalLog) CheckDeviceIdErr(scriptDeviceId string, uuid string, gameId int) (bool, []log.GameAccount) {
|
|
|
+ var deviceLog []log.GameAccount
|
|
|
+ // result := global.GVA_DB.Where("create_date <= ?", time.Now().Format("2006-01-02")).Where("create_date >= ?", time.Now().Add(-time.Hour*24).Format("2006-01-02")).Where("game_id = ?", gameId).Where("script_device_id = ?", scriptDeviceId).Find(&deviceLog)
|
|
|
+ result := global.GVA_DB.Where("game_id = ?", gameId).Where("script_device_id = ?", scriptDeviceId).Find(&deviceLog)
|
|
|
if result.Error != nil {
|
|
|
if result.Error == gorm.ErrRecordNotFound {
|
|
|
return false, deviceLog
|