From dca4d4ffcaf56025a099d16da15a52994277971c Mon Sep 17 00:00:00 2001 From: xinian Date: Fri, 13 Feb 2026 01:39:53 +0800 Subject: [PATCH] 1 --- help/三主宠查询.sql | 15 ++++++++++++++- modules/player/service/egg.go | 19 ++++++++++++++----- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/help/三主宠查询.sql b/help/三主宠查询.sql index 3bb6516bd..2f0f32536 100644 --- a/help/三主宠查询.sql +++ b/help/三主宠查询.sql @@ -42,4 +42,17 @@ SELECT pgm.id FROM pet_group_mapping pgm INNER JOIN excess_groups eg ON pgm.player_id = eg.player_id AND pgm.pet_group = eg.pet_group WHERE pgm.rn > 1 -); \ No newline at end of file +); + + +//删除多余的异常融合精灵 +DELETE FROM "player_pet" pp +WHERE + pp.deleted_at IS NULL + AND pp.is_vip = 0 + AND (pp.data->>'OldCatchTime')::BIGINT != 0 + AND NOT EXISTS ( + SELECT 1 + FROM config_fusion_pet cfp + WHERE (pp.data->>'ID')::INT BETWEEN cfp.result_pet_id AND cfp.result_pet_id + 2 + ); \ No newline at end of file diff --git a/modules/player/service/egg.go b/modules/player/service/egg.go index 967704a8a..3d22c9049 100644 --- a/modules/player/service/egg.go +++ b/modules/player/service/egg.go @@ -45,7 +45,18 @@ func (s *EggService) Get() (out *model.Egg) { } func (s *EggService) StartBreed(m, f *model.PetInfo) bool { - + if m.Gender != 1 { + return false + } + if f.Gender != 2 { + return false + } + if m.Generation > 9 { + return false + } + if f.Generation > 9 { + return false + } var tt *model.Egg s.TestModel(s.Model).Scan(&tt) if tt == nil { @@ -61,10 +72,8 @@ func (s *EggService) StartBreed(m, f *model.PetInfo) bool { cureff.EggCatchTime = uint32(time.Now().Unix()) - cureff.EggID = (uint32(m.Generation) + uint32(f.Generation)) / 2 - if cureff.EggID == 0 { - cureff.EggID = 1 - } + cureff.EggID = (uint32(m.Generation)+uint32(f.Generation))/2 + 1 + cureff.OwnerID = uint32(s.userid) cureff.FeMalePetID = f.ID