进度邮件奖励

This commit is contained in:
meixiongfeng 2023-08-30 01:19:02 +08:00
parent 7e0a0f6641
commit f9b652e280
4 changed files with 40 additions and 36 deletions

View File

@ -961,6 +961,7 @@ const (
Welcomemail string = "Welcomemail" // 欢迎邮件 Welcomemail string = "Welcomemail" // 欢迎邮件
Venturegifts string = "Venturegifts" // 转盘活动 Venturegifts string = "Venturegifts" // 转盘活动
CaravanLvReward string = "CaravanLvReward" // 商队升级 CaravanLvReward string = "CaravanLvReward" // 商队升级
CaravanReward string = "CaravanReward" // 商队进度
) )
// open funcName // open funcName

View File

@ -54,7 +54,6 @@ func (this *apiComp) BuyOrSell(session comm.IUserSession, req *pb.CaravanBuyOrSe
// special 城市卖给玩家的商品 // special 城市卖给玩家的商品
// exspecial 城市想要玩家卖给他的商品库 // exspecial 城市想要玩家卖给他的商品库
if !req.IsBuy { // 卖给npc if !req.IsBuy { // 卖给npc
for k, v := range req.Items { for k, v := range req.Items {
// 校验背包数据够不够 // 校验背包数据够不够
caravan.Items[k].Count -= v caravan.Items[k].Count -= v
@ -92,8 +91,9 @@ func (this *apiComp) BuyOrSell(session comm.IUserSession, req *pb.CaravanBuyOrSe
} }
sellValue += price * v sellValue += price * v
addScore = sellValue
} }
sellValue = 150000
addScore = sellValue
if errdata = this.module.DispenseRes(session, []*cfg.Gameatn{{ if errdata = this.module.DispenseRes(session, []*cfg.Gameatn{{
A: "attr", A: "attr",
T: "merchantmoney", T: "merchantmoney",
@ -139,22 +139,14 @@ func (this *apiComp) BuyOrSell(session comm.IUserSession, req *pb.CaravanBuyOrSe
if len(lvReward) > 0 { // 商队等级奖励 改发邮件 if len(lvReward) > 0 { // 商队等级奖励 改发邮件
this.module.mail.SendRewardMailByCid(session, comm.CaravanLvReward, lvReward) this.module.mail.SendRewardMailByCid(session, comm.CaravanLvReward, lvReward)
} }
caravan.Profit = 0
// 商队盈利收益奖励 // 商队盈利收益奖励
reward := this.configure.GetCaravanReward() reward := this.configure.GetCaravanReward()
for _, v := range reward { for _, v := range reward {
if v.Key > 0 { if v.Key > 0 {
if caravan.Profit > int64(v.Key) { if caravan.Profit > int64(v.Key) {
if _, ok := caravan.Reward[v.Key]; !ok { if _, ok := caravan.Reward[v.Key]; !ok {
var res []*pb.UserAssets this.module.mail.SendRewardMailByCid(session, comm.CaravanLvReward, v.Reward)
for _, v1 := range v.Reward {
res = append(res, &pb.UserAssets{
A: v1.A,
T: v1.T,
N: v1.N,
})
}
this.module.ModuleMail.SendMailByCid(session, "CaravanProfitRewards", res)
caravan.Reward[v.Key] = true caravan.Reward[v.Key] = true
update["reward"] = caravan.Reward update["reward"] = caravan.Reward
} }

View File

@ -26,7 +26,8 @@ func (this *apiComp) RefreshCity(session comm.IUserSession, req *pb.CaravanRefre
this.module.refreshCaravanCityInfo(session.GetUserId(), list) this.module.refreshCaravanCityInfo(session.GetUserId(), list)
resp.Goods = list.Goods resp.Goods = list.Goods
resp.City = list.City resp.City = list.City
resp.Resettime = list.Resettime resp.Citytime = list.Citystime
resp.Itemtime = list.Itemtime
session.SendMsg(string(this.module.GetType()), "refreshcity", resp) session.SendMsg(string(this.module.GetType()), "refreshcity", resp)
return return
} }

View File

@ -648,10 +648,11 @@ type CaravanRefreshCityResp struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Goods map[string]*Goods `protobuf:"bytes,1,rep,name=goods,proto3" json:"goods" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // key 货物ID Goods map[string]*Goods `protobuf:"bytes,1,rep,name=goods,proto3" json:"goods" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // key 货物ID
City map[int32]*CityInfo `protobuf:"bytes,2,rep,name=city,proto3" json:"city" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // 城市信息 City map[int32]*CityInfo `protobuf:"bytes,2,rep,name=city,proto3" json:"city" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // 城市信息
Oldprice map[string]int32 `protobuf:"bytes,3,rep,name=Oldprice,proto3" json:"Oldprice" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` Oldprice map[string]int32 `protobuf:"bytes,3,rep,name=Oldprice,proto3" json:"Oldprice" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
Resettime int64 `protobuf:"varint,4,opt,name=resettime,proto3" json:"resettime"` // 赛季结算时间 Itemtime int64 `protobuf:"varint,4,opt,name=itemtime,proto3" json:"itemtime"` // 道具刷新时间
Citytime int64 `protobuf:"varint,5,opt,name=citytime,proto3" json:"citytime"` // 城市刷新时间
} }
func (x *CaravanRefreshCityResp) Reset() { func (x *CaravanRefreshCityResp) Reset() {
@ -707,9 +708,16 @@ func (x *CaravanRefreshCityResp) GetOldprice() map[string]int32 {
return nil return nil
} }
func (x *CaravanRefreshCityResp) GetResettime() int64 { func (x *CaravanRefreshCityResp) GetItemtime() int64 {
if x != nil { if x != nil {
return x.Resettime return x.Itemtime
}
return 0
}
func (x *CaravanRefreshCityResp) GetCitytime() int64 {
if x != nil {
return x.Citytime
} }
return 0 return 0
} }
@ -778,7 +786,7 @@ var file_caravan_caravan_msg_proto_rawDesc = []byte{
0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x43, 0x61, 0x72, 0x61, 0x76, 0x61, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x43, 0x61, 0x72, 0x61, 0x76, 0x61, 0x6e,
0x52, 0x61, 0x6e, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x69, 0x6e, 0x52, 0x61, 0x6e, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x69, 0x6e,
0x66, 0x6f, 0x22, 0x17, 0x0a, 0x15, 0x43, 0x61, 0x72, 0x61, 0x76, 0x61, 0x6e, 0x52, 0x65, 0x66, 0x66, 0x6f, 0x22, 0x17, 0x0a, 0x15, 0x43, 0x61, 0x72, 0x61, 0x76, 0x61, 0x6e, 0x52, 0x65, 0x66,
0x72, 0x65, 0x73, 0x68, 0x43, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x22, 0xad, 0x03, 0x0a, 0x16, 0x72, 0x65, 0x73, 0x68, 0x43, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x22, 0xc7, 0x03, 0x0a, 0x16,
0x43, 0x61, 0x72, 0x61, 0x76, 0x61, 0x6e, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x43, 0x69, 0x43, 0x61, 0x72, 0x61, 0x76, 0x61, 0x6e, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x43, 0x69,
0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x38, 0x0a, 0x05, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x18, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x38, 0x0a, 0x05, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x18,
0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x43, 0x61, 0x72, 0x61, 0x76, 0x61, 0x6e, 0x52, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x43, 0x61, 0x72, 0x61, 0x76, 0x61, 0x6e, 0x52,
@ -791,22 +799,24 @@ var file_caravan_caravan_msg_proto_rawDesc = []byte{
0x69, 0x63, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x43, 0x61, 0x72, 0x61, 0x69, 0x63, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x43, 0x61, 0x72, 0x61,
0x76, 0x61, 0x6e, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x43, 0x69, 0x74, 0x79, 0x52, 0x65, 0x76, 0x61, 0x6e, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x43, 0x69, 0x74, 0x79, 0x52, 0x65,
0x73, 0x70, 0x2e, 0x4f, 0x6c, 0x64, 0x70, 0x72, 0x69, 0x63, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x73, 0x70, 0x2e, 0x4f, 0x6c, 0x64, 0x70, 0x72, 0x69, 0x63, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79,
0x52, 0x08, 0x4f, 0x6c, 0x64, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x52, 0x08, 0x4f, 0x6c, 0x64, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x74,
0x73, 0x65, 0x74, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x72, 0x65, 0x6d, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x69, 0x74,
0x65, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6d, 0x65, 0x1a, 0x40, 0x0a, 0x0a, 0x47, 0x6f, 0x6f, 0x64, 0x65, 0x6d, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x69, 0x74, 0x79, 0x74, 0x69,
0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x63, 0x69, 0x74, 0x79, 0x74, 0x69,
0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x6d, 0x65, 0x1a, 0x40, 0x0a, 0x0a, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79,
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x06, 0x2e, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x52, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b,
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x42, 0x0a, 0x09, 0x43, 0x69, 0x65, 0x79, 0x12, 0x1c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x0b, 0x32, 0x06, 0x2e, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,
0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1f, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x42, 0x0a, 0x09, 0x43, 0x69, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72,
0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x43, 0x69, 0x74, 0x79, 0x49, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03,
0x6e, 0x66, 0x6f, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3b, 0x6b, 0x65, 0x79, 0x12, 0x1f, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01,
0x0a, 0x0d, 0x4f, 0x6c, 0x64, 0x70, 0x72, 0x69, 0x63, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x43, 0x69, 0x74, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x76,
0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3b, 0x0a, 0x0d, 0x4f, 0x6c, 0x64, 0x70,
0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x72, 0x69, 0x63, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79,
0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76,
0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 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,
} }
var ( var (