diff --git a/modules/friend/api_cross_list.go b/modules/friend/api_cross_list.go index 9d092e70c..daa1e5595 100644 --- a/modules/friend/api_cross_list.go +++ b/modules/friend/api_cross_list.go @@ -3,6 +3,7 @@ package friend import ( "go_dreamfactory/comm" "go_dreamfactory/pb" + "go_dreamfactory/sys/configure" "go_dreamfactory/utils" ) @@ -59,6 +60,20 @@ func (this *apiComp) List(session comm.IUserSession, req *pb.FriendListReq) (err list = append(list, base) } + if configure.Now().Unix() >= self.CleanTime || self.CleanTime == 0 { + self.CleanTime = configure.Now().Unix() + 3*24*3600 + self.Weapplyids = []string{} + if err = this.module.modelFriend.Change(session.GetUserId(), map[string]interface{}{ + "weapplyids": self.Weapplyids, + "cleanTime": self.CleanTime, + }); err != nil { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_FriendApplyError, + Title: pb.ErrorCode_FriendApplyError.ToString(), + } + return + } + } resp := &pb.FriendListResp{ List: list, Friend: self, diff --git a/modules/integral/api_getlist.go b/modules/integral/api_getlist.go index 38334f6fc..89d1db755 100644 --- a/modules/integral/api_getlist.go +++ b/modules/integral/api_getlist.go @@ -66,7 +66,7 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.IntegralGetListR list.Reward1 = 0 list.Reward2 = 0 list.Buff = make(map[int32]int32) - list.Score = make(map[int32]int64) + list.Score = make(map[int32]int32) update["hid"] = list.Hid update["etime"] = list.Etime update["maxscore"] = list.Maxscore diff --git a/modules/integral/api_reward.go b/modules/integral/api_reward.go index bf6e1c9c9..8812abf2a 100644 --- a/modules/integral/api_reward.go +++ b/modules/integral/api_reward.go @@ -47,12 +47,12 @@ func (this *apiComp) GetReward(session comm.IUserSession, req *pb.IntegralGetRew for _, v := range conf { if req.Itype == 1 { - if list.Reward1 < v.Val && list.Maxscore > int64(v.Val) { + if list.Reward1 < v.Val && list.Maxscore > v.Val { res = append(res, v.Prize...) list.Reward1 = v.Val } } else { - if list.Reward2 < v.Val && list.Totalscore > int64(v.Val) { + if list.Reward2 < v.Val && list.Totalscore > v.Val { res = append(res, v.Prize...) list.Reward2 = v.Val } diff --git a/modules/integral/model_integral.go b/modules/integral/model_integral.go index f7b3abe31..d3600d4eb 100644 --- a/modules/integral/model_integral.go +++ b/modules/integral/model_integral.go @@ -42,7 +42,7 @@ func (this *modelIntegral) getIntegralList(uid string) (result *pb.DBIntegralBos result.Id = primitive.NewObjectID().Hex() result.Uid = uid result.Buff = make(map[int32]int32) - result.Score = make(map[int32]int64) + result.Score = make(map[int32]int32) // 获取当前的hid curTime := configure.Now().Unix() diff --git a/pb/friend_db.pb.go b/pb/friend_db.pb.go index a09beea2f..e69ccbf25 100644 --- a/pb/friend_db.pb.go +++ b/pb/friend_db.pb.go @@ -40,6 +40,7 @@ type DBFriend struct { AssistScore int32 `protobuf:"varint,13,opt,name=assistScore,proto3" json:"assistScore" bson:"assistScore"` //助战分数合计 Record []*AssistRecord `protobuf:"bytes,14,rep,name=record,proto3" json:"record" bson:"record"` // 助战记录 Weapplyids []string `protobuf:"bytes,15,rep,name=weapplyids,proto3" json:"weapplyids" bson:"weapplyids"` //我申请的用户ID + CleanTime int64 `protobuf:"varint,16,opt,name=cleanTime,proto3" json:"cleanTime" bson:"cleanTime"` //清理申请列表时间 } func (x *DBFriend) Reset() { @@ -179,6 +180,13 @@ func (x *DBFriend) GetWeapplyids() []string { return nil } +func (x *DBFriend) GetCleanTime() int64 { + if x != nil { + return x.CleanTime + } + return 0 +} + //助战记录 type AssistRecord struct { state protoimpl.MessageState @@ -337,7 +345,7 @@ var file_friend_friend_db_proto_rawDesc = []byte{ 0x0a, 0x16, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x2f, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x12, 0x68, 0x65, 0x72, 0x6f, 0x2f, 0x68, 0x65, 0x72, 0x6f, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0a, 0x63, 0x6f, - 0x6d, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc3, 0x03, 0x0a, 0x08, 0x44, 0x42, 0x46, + 0x6d, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe1, 0x03, 0x0a, 0x08, 0x44, 0x42, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, @@ -365,25 +373,27 @@ var file_friend_friend_db_proto_rawDesc = []byte{ 0x64, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x41, 0x73, 0x73, 0x69, 0x73, 0x74, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x77, 0x65, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x69, 0x64, 0x73, 0x18, 0x0f, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x0a, 0x77, 0x65, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x69, 0x64, 0x73, 0x22, 0x64, - 0x0a, 0x0c, 0x41, 0x73, 0x73, 0x69, 0x73, 0x74, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x10, - 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, - 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x73, 0x73, 0x69, 0x73, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x61, 0x73, 0x73, 0x69, 0x73, 0x74, 0x54, 0x69, 0x6d, 0x65, - 0x12, 0x22, 0x0a, 0x0c, 0x61, 0x73, 0x73, 0x69, 0x73, 0x74, 0x48, 0x65, 0x72, 0x6f, 0x49, 0x64, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x73, 0x73, 0x69, 0x73, 0x74, 0x48, 0x65, - 0x72, 0x6f, 0x49, 0x64, 0x22, 0xa6, 0x01, 0x0a, 0x0c, 0x51, 0x69, 0x65, 0x63, 0x75, 0x6f, 0x52, - 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x61, 0x72, 0x67, 0x65, - 0x74, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x61, 0x72, 0x67, 0x65, - 0x74, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, - 0x61, 0x74, 0x63, 0x68, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x61, - 0x74, 0x63, 0x68, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x42, 0x06, 0x5a, - 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x28, 0x09, 0x52, 0x0a, 0x77, 0x65, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x69, 0x64, 0x73, 0x12, 0x1c, + 0x0a, 0x09, 0x63, 0x6c, 0x65, 0x61, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x09, 0x63, 0x6c, 0x65, 0x61, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x64, 0x0a, 0x0c, + 0x41, 0x73, 0x73, 0x69, 0x73, 0x74, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x10, 0x0a, 0x03, + 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1e, + 0x0a, 0x0a, 0x61, 0x73, 0x73, 0x69, 0x73, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x0a, 0x61, 0x73, 0x73, 0x69, 0x73, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x22, + 0x0a, 0x0c, 0x61, 0x73, 0x73, 0x69, 0x73, 0x74, 0x48, 0x65, 0x72, 0x6f, 0x49, 0x64, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x73, 0x73, 0x69, 0x73, 0x74, 0x48, 0x65, 0x72, 0x6f, + 0x49, 0x64, 0x22, 0xa6, 0x01, 0x0a, 0x0c, 0x51, 0x69, 0x65, 0x63, 0x75, 0x6f, 0x52, 0x65, 0x63, + 0x6f, 0x72, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, + 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x61, 0x74, + 0x63, 0x68, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x61, 0x74, 0x63, + 0x68, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, + 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pb/integral_db.pb.go b/pb/integral_db.pb.go index eabc2290c..1a4bca67b 100644 --- a/pb/integral_db.pb.go +++ b/pb/integral_db.pb.go @@ -32,13 +32,13 @@ type DBIntegralBoss struct { CTime int64 `protobuf:"varint,5,opt,name=cTime,proto3" json:"cTime" bson:"cTime"` //修改时间 Etime int64 `protobuf:"varint,6,opt,name=etime,proto3" json:"etime"` // 活动结束时间 Hid int32 `protobuf:"varint,7,opt,name=hid,proto3" json:"hid"` // 活动id - Maxscore int64 `protobuf:"varint,8,opt,name=maxscore,proto3" json:"maxscore"` // 最大积分 - Totalscore int64 `protobuf:"varint,9,opt,name=totalscore,proto3" json:"totalscore"` // 累计积分 + Maxscore int32 `protobuf:"varint,8,opt,name=maxscore,proto3" json:"maxscore"` // 最大积分 + Totalscore int32 `protobuf:"varint,9,opt,name=totalscore,proto3" json:"totalscore"` // 累计积分 Reward1 int32 `protobuf:"varint,10,opt,name=reward1,proto3" json:"reward1"` // 类型1 奖励( Integralreward ) Reward2 int32 `protobuf:"varint,11,opt,name=reward2,proto3" json:"reward2"` // 类型2 奖励( Integralreward ) Buff map[int32]int32 `protobuf:"bytes,12,rep,name=buff,proto3" json:"buff" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // 激活的buff (key Integralcondition value :0 未激活) 注:事件类型 才有值 Nandu int32 `protobuf:"varint,13,opt,name=nandu,proto3" json:"nandu"` // 已经解锁的难度 - Score map[int32]int64 `protobuf:"bytes,14,rep,name=score,proto3" json:"score" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // key 难度 value 积分 + Score map[int32]int32 `protobuf:"bytes,14,rep,name=score,proto3" json:"score" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // key 难度 value 积分 } func (x *DBIntegralBoss) Reset() { @@ -122,14 +122,14 @@ func (x *DBIntegralBoss) GetHid() int32 { return 0 } -func (x *DBIntegralBoss) GetMaxscore() int64 { +func (x *DBIntegralBoss) GetMaxscore() int32 { if x != nil { return x.Maxscore } return 0 } -func (x *DBIntegralBoss) GetTotalscore() int64 { +func (x *DBIntegralBoss) GetTotalscore() int32 { if x != nil { return x.Totalscore } @@ -164,7 +164,7 @@ func (x *DBIntegralBoss) GetNandu() int32 { return 0 } -func (x *DBIntegralBoss) GetScore() map[int32]int64 { +func (x *DBIntegralBoss) GetScore() map[int32]int32 { if x != nil { return x.Score } @@ -186,9 +186,9 @@ var file_integral_integral_db_proto_rawDesc = []byte{ 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x68, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x68, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x6d, - 0x61, 0x78, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, + 0x61, 0x78, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, - 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x74, 0x6f, 0x74, + 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x31, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x31, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x32, 0x18, 0x0b, 0x20, 0x01, @@ -206,7 +206,7 @@ var file_integral_integral_db_proto_rawDesc = []byte{ 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x38, 0x0a, 0x0a, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } diff --git a/pb/integral_msg.pb.go b/pb/integral_msg.pb.go index fc28452a7..7e5a5dfd0 100644 --- a/pb/integral_msg.pb.go +++ b/pb/integral_msg.pb.go @@ -223,7 +223,7 @@ type IntegralChallengeOverReq struct { Nandu int32 `protobuf:"varint,1,opt,name=nandu,proto3" json:"nandu"` // boos 难度 Report *BattleReport `protobuf:"bytes,2,opt,name=report,proto3" json:"report"` //战报 - Score int64 `protobuf:"varint,3,opt,name=score,proto3" json:"score"` //获得积分 或伤害 + Score int32 `protobuf:"varint,3,opt,name=score,proto3" json:"score"` //获得积分 或伤害 } func (x *IntegralChallengeOverReq) Reset() { @@ -272,7 +272,7 @@ func (x *IntegralChallengeOverReq) GetReport() *BattleReport { return nil } -func (x *IntegralChallengeOverReq) GetScore() int64 { +func (x *IntegralChallengeOverReq) GetScore() int32 { if x != nil { return x.Score } @@ -460,7 +460,7 @@ var file_integral_integral_msg_proto_rawDesc = []byte{ 0x01, 0x28, 0x05, 0x52, 0x05, 0x6e, 0x61, 0x6e, 0x64, 0x75, 0x12, 0x25, 0x0a, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, - 0x74, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, + 0x74, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x22, 0x40, 0x0a, 0x19, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x23, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01,