From b1b91cf6b15e9e109d8cda74811166c11ec14b99 Mon Sep 17 00:00:00 2001 From: zqj <582132116@qq.com> Date: Mon, 20 Jun 2022 09:43:04 +0800 Subject: [PATCH] fix: ItemTypeInterval limit 10000 -> 100000 --- cmd/gameserver/action/EmailAction.go | 9 ++++++--- common/const.go | 2 +- models/rolePlugin.go | 3 ++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/cmd/gameserver/action/EmailAction.go b/cmd/gameserver/action/EmailAction.go index 9c76493..5616e63 100644 --- a/cmd/gameserver/action/EmailAction.go +++ b/cmd/gameserver/action/EmailAction.go @@ -23,7 +23,7 @@ func EmailListRpc(role *models.RoleModel, msg components.IMessage) (int32, inter // load emails := role.LoadEmails() - return 0, emails + return 0, &pb.EmailListRsp{Emails: emails} } func GetEmailPBAttachMents(email *pb.Email) string { @@ -65,7 +65,7 @@ func EmailDrawRpc(role *models.RoleModel, msg components.IMessage) (int32, inter continue } email := models.NewEmailModelPB(e) - email.SetProperty("status", 2) + email.SetProperty("status", int32(2)) email.Log(role, 2) email.Update() ids = append(ids, e.Id) @@ -93,8 +93,11 @@ func EmailCheckRpc(role *models.RoleModel, msg components.IMessage) (int32, inte if err := email.Load(); err != nil { return 2, nil } + if email.Data.Status != 0 { + return 3, nil + } - email.SetProperty("status", 1) + email.SetProperty("status", int32(1)) email.Log(role, 1) email.Update() return 0, nil diff --git a/common/const.go b/common/const.go index 4e81f9e..56c127e 100644 --- a/common/const.go +++ b/common/const.go @@ -54,7 +54,7 @@ const ( ) const ( - ItemTypeInterval = 10000 + ItemTypeInterval = 100000 ItemType = 0 EquipType = 1 ) diff --git a/models/rolePlugin.go b/models/rolePlugin.go index b8f0d3a..25ada29 100644 --- a/models/rolePlugin.go +++ b/models/rolePlugin.go @@ -346,7 +346,8 @@ func (m *RoleModel) DelExpireEmail() error { for _, email := range emails { ids = append(ids, email.Id) } - filter = append(filter, bson.E{Key: "$in", Value: ids}) + + filter = append(filter, bson.E{"id", bson.D{{"$in", ids}}}) err = mongoproxy.DelMany("email", filter) if err != nil { return err -- libgit2 0.21.2