From f9b652e2804efe80a445dae705f2d51a5654aab3 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Wed, 30 Aug 2023 01:19:02 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E8=BF=9B=E5=BA=A6=E9=82=AE=E4=BB=B6?= =?UTF-8?q?=E5=A5=96=E5=8A=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comm/const.go | 1 + modules/caravan/api_buyorsell.go | 16 +++------ modules/caravan/api_refreshcity.go | 3 +- pb/caravan_msg.pb.go | 56 ++++++++++++++++++------------ 4 files changed, 40 insertions(+), 36 deletions(-) diff --git a/comm/const.go b/comm/const.go index 4be4b1d7a..4fc3b74f1 100644 --- a/comm/const.go +++ b/comm/const.go @@ -961,6 +961,7 @@ const ( Welcomemail string = "Welcomemail" // 欢迎邮件 Venturegifts string = "Venturegifts" // 转盘活动 CaravanLvReward string = "CaravanLvReward" // 商队升级 + CaravanReward string = "CaravanReward" // 商队进度 ) // open funcName diff --git a/modules/caravan/api_buyorsell.go b/modules/caravan/api_buyorsell.go index c867279ce..69ab25a9e 100644 --- a/modules/caravan/api_buyorsell.go +++ b/modules/caravan/api_buyorsell.go @@ -54,7 +54,6 @@ func (this *apiComp) BuyOrSell(session comm.IUserSession, req *pb.CaravanBuyOrSe // special 城市卖给玩家的商品 // exspecial 城市想要玩家卖给他的商品库 if !req.IsBuy { // 卖给npc - for k, v := range req.Items { // 校验背包数据够不够 caravan.Items[k].Count -= v @@ -92,8 +91,9 @@ func (this *apiComp) BuyOrSell(session comm.IUserSession, req *pb.CaravanBuyOrSe } sellValue += price * v - addScore = sellValue } + sellValue = 150000 + addScore = sellValue if errdata = this.module.DispenseRes(session, []*cfg.Gameatn{{ A: "attr", T: "merchantmoney", @@ -139,22 +139,14 @@ func (this *apiComp) BuyOrSell(session comm.IUserSession, req *pb.CaravanBuyOrSe if len(lvReward) > 0 { // 商队等级奖励 改发邮件 this.module.mail.SendRewardMailByCid(session, comm.CaravanLvReward, lvReward) } - + caravan.Profit = 0 // 商队盈利收益奖励 reward := this.configure.GetCaravanReward() for _, v := range reward { if v.Key > 0 { if caravan.Profit > int64(v.Key) { if _, ok := caravan.Reward[v.Key]; !ok { - var res []*pb.UserAssets - 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) + this.module.mail.SendRewardMailByCid(session, comm.CaravanLvReward, v.Reward) caravan.Reward[v.Key] = true update["reward"] = caravan.Reward } diff --git a/modules/caravan/api_refreshcity.go b/modules/caravan/api_refreshcity.go index be0f8b32a..22c0258b2 100644 --- a/modules/caravan/api_refreshcity.go +++ b/modules/caravan/api_refreshcity.go @@ -26,7 +26,8 @@ func (this *apiComp) RefreshCity(session comm.IUserSession, req *pb.CaravanRefre this.module.refreshCaravanCityInfo(session.GetUserId(), list) resp.Goods = list.Goods resp.City = list.City - resp.Resettime = list.Resettime + resp.Citytime = list.Citystime + resp.Itemtime = list.Itemtime session.SendMsg(string(this.module.GetType()), "refreshcity", resp) return } diff --git a/pb/caravan_msg.pb.go b/pb/caravan_msg.pb.go index 938f5299f..301fd3b56 100644 --- a/pb/caravan_msg.pb.go +++ b/pb/caravan_msg.pb.go @@ -648,10 +648,11 @@ type CaravanRefreshCityResp struct { sizeCache protoimpl.SizeCache 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 - 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"` - Resettime int64 `protobuf:"varint,4,opt,name=resettime,proto3" json:"resettime"` // 赛季结算时间 + 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"` // 城市信息 + 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"` + 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() { @@ -707,9 +708,16 @@ func (x *CaravanRefreshCityResp) GetOldprice() map[string]int32 { return nil } -func (x *CaravanRefreshCityResp) GetResettime() int64 { +func (x *CaravanRefreshCityResp) GetItemtime() int64 { if x != nil { - return x.Resettime + return x.Itemtime + } + return 0 +} + +func (x *CaravanRefreshCityResp) GetCitytime() int64 { + if x != nil { + return x.Citytime } 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, 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, - 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, 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, @@ -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, 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, - 0x52, 0x08, 0x4f, 0x6c, 0x64, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, - 0x73, 0x65, 0x74, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x72, - 0x65, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6d, 0x65, 0x1a, 0x40, 0x0a, 0x0a, 0x47, 0x6f, 0x6f, 0x64, - 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x06, 0x2e, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x42, 0x0a, 0x09, 0x43, 0x69, - 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1f, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x43, 0x69, 0x74, 0x79, 0x49, - 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3b, - 0x0a, 0x0d, 0x4f, 0x6c, 0x64, 0x70, 0x72, 0x69, 0x63, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, - 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 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, + 0x52, 0x08, 0x4f, 0x6c, 0x64, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x74, + 0x65, 0x6d, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x69, 0x74, + 0x65, 0x6d, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x69, 0x74, 0x79, 0x74, 0x69, + 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x63, 0x69, 0x74, 0x79, 0x74, 0x69, + 0x6d, 0x65, 0x1a, 0x40, 0x0a, 0x0a, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x12, 0x1c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x06, 0x2e, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x42, 0x0a, 0x09, 0x43, 0x69, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x1f, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x43, 0x69, 0x74, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3b, 0x0a, 0x0d, 0x4f, 0x6c, 0x64, 0x70, + 0x72, 0x69, 0x63, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, + 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 ( From 338607d7ce98c4f1971d607d4452ee8f665afe11 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Tue, 29 Aug 2023 15:38:45 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E8=B5=9B=E5=AD=A3=E7=BB=93=E6=9D=9F=20?= =?UTF-8?q?=E6=B8=85=E7=90=86=E5=95=86=E9=98=9F=E8=83=8C=E5=8C=85=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/caravan/api_getlist.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/caravan/api_getlist.go b/modules/caravan/api_getlist.go index ef721c0e6..f29988a9b 100644 --- a/modules/caravan/api_getlist.go +++ b/modules/caravan/api_getlist.go @@ -38,8 +38,10 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.CaravanGetListRe if errdata = this.module.InitCaravanTicket(session, conf); errdata != nil { return } - // list.Merchantmoney = conf.Moneynumtop.N update := make(map[string]interface{}) + // 清除玩家货物信息 + list.Items = make(map[string]*pb.BagInfo, 0) + update["items"] = list.Items list.Reward = make(map[int32]bool, 0) list.Profit = 0 update["reward"] = list.Reward // 初始化利润奖励 From fc8826511e04c01ff3b9c6ddeb3ee8350f164a43 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Tue, 29 Aug 2023 15:46:22 +0800 Subject: [PATCH 3/6] =?UTF-8?q?Rtype212=20=E5=95=86=E9=98=9F=E5=88=B0?= =?UTF-8?q?=E8=BE=BE=E6=8C=87=E5=AE=9A=E5=9F=8E=E5=B8=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comm/const.go | 19 ------------------- modules/caravan/api_buyorsell.go | 2 +- modules/caravan/api_gotocity.go | 4 ++++ 3 files changed, 5 insertions(+), 20 deletions(-) diff --git a/comm/const.go b/comm/const.go index 4fc3b74f1..37742fec5 100644 --- a/comm/const.go +++ b/comm/const.go @@ -934,25 +934,6 @@ const ( ChatSystem15 ChatSystemType = 15 ///狩猎 【玩家名称】通关了巨型猩猩难度8! ) -// 巨兽列车 -const ( - TrollBuyCount int32 = iota + 1 // 单日最大交易次数 - - TrollAIBuyCount //离线最多交易次数 - - TrollItemCount //货物最大存储上限 - - TrollGridCount //背包格子 - - TrollBuy //挂机卖出标准/千分比 - - TrollSell //挂机进货标准/千分比 - - TrollCantSell //不让交易的前后时间/S - - TrollSurprise //惊喜货物售价系数 -) - // 邮件ID const ( Yueka_1 string = "Activity_PrivilegeCardDailyReward_lv1" //月卡1 diff --git a/modules/caravan/api_buyorsell.go b/modules/caravan/api_buyorsell.go index 69ab25a9e..ba069ede9 100644 --- a/modules/caravan/api_buyorsell.go +++ b/modules/caravan/api_buyorsell.go @@ -247,7 +247,7 @@ func (this *apiComp) BuyOrSell(session comm.IUserSession, req *pb.CaravanBuyOrSe // Rtype211 TaskType = 211 // 向指定X城市,贩卖价值X虚拟币以上的对应城市急需货物 szTask = append(szTask, comm.GetBuriedParam(comm.Rtype211, req.City, sellSpValue)) } - szTask = append(szTask, comm.GetBuriedParam(comm.Rtype212, req.City)) // 接取任务后,商队抵达指定城市 + go this.module.ModuleBuried.TriggerBuried(session.Clone(), szTask...) return } diff --git a/modules/caravan/api_gotocity.go b/modules/caravan/api_gotocity.go index fab7b2e67..df915b3e4 100644 --- a/modules/caravan/api_gotocity.go +++ b/modules/caravan/api_gotocity.go @@ -127,5 +127,9 @@ func (this *apiComp) GotoCity(session comm.IUserSession, req *pb.CaravanGotoCity resp.Data = list resp.Newtask = bNewTask session.SendMsg(string(this.module.GetType()), "gotocity", resp) + // 任务统计 + var szTask []*pb.BuriedParam + szTask = append(szTask, comm.GetBuriedParam(comm.Rtype212, req.City)) // 接取任务后,商队抵达指定城市 + go this.module.ModuleBuried.TriggerBuried(session.Clone(), szTask...) return } From b941b855cd1ee6a83aba019455101b62c4fc8a9a Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Tue, 29 Aug 2023 16:29:48 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E5=95=86=E9=98=9F=E7=BB=A7=E7=BB=AD?= =?UTF-8?q?=E8=B4=A7=E7=89=A9=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/caravan/module.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/modules/caravan/module.go b/modules/caravan/module.go index cc010de28..3bd6282da 100644 --- a/modules/caravan/module.go +++ b/modules/caravan/module.go @@ -124,8 +124,6 @@ func (this *Caravan) InitCaravanCityData(uid string, data *pb.DBCaravan) { } data.Citystime = utils.GetZeroTime(configure.Now().Unix()) data.Rtime = configure.Now().Unix() // 修改时间 - - //data.Itemtime = configure.Now().Unix() + } // 初始化货物信息 @@ -205,7 +203,7 @@ func (this *Caravan) refreshCaravanCityInfo(uid string, caravan *pb.DBCaravan) { changeTime = this.configure.GetCityRefreshTime() // 刷新城市货物信息 - if !utils.IsNextToday(caravan.Citystime) { + if utils.IsNextToday(caravan.Citystime) { list := this.configure.GetAllCaravanCity() for _, conf := range list { if v, ok := caravan.City[conf.Id]; ok { @@ -227,7 +225,7 @@ func (this *Caravan) refreshCaravanCityInfo(uid string, caravan *pb.DBCaravan) { } else { // 初始化今天 v.Exspecial = make([]string, 0) // 初始化下一天的信息 - if len(v.Exspecial) > int(conf.ExspecialNum) { + if len(conf.Exspecial) > int(conf.ExspecialNum) { ids := utils.RandomNumbers(0, len(conf.Exspecial), int(conf.ExspecialNum)) for _, id := range ids { v.Exspecial = append(v.Exspecial, conf.Exspecial[id]) @@ -257,14 +255,12 @@ func (this *Caravan) refreshCaravanCityInfo(uid string, caravan *pb.DBCaravan) { update["city"] = caravan.City update["citystime"] = caravan.Citystime bChange = true + caravan.Itemtime = curTime } - subTime := int32(curTime - caravan.Itemtime) if subTime >= 0 { bChange = true - icount := int32(subTime/changeTime) + 1 // 循环周期 - caravan.Itemtime += int64(changeTime * icount) update["itemtime"] = caravan.Itemtime for k, v := range caravan.Goods { From 4c11d7540df20e428c00b7dd50e2a0f103bba0e5 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Tue, 29 Aug 2023 16:35:31 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E8=B0=83=E8=AF=95?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/caravan/api_buyorsell.go | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/caravan/api_buyorsell.go b/modules/caravan/api_buyorsell.go index ba069ede9..66817b811 100644 --- a/modules/caravan/api_buyorsell.go +++ b/modules/caravan/api_buyorsell.go @@ -92,7 +92,6 @@ func (this *apiComp) BuyOrSell(session comm.IUserSession, req *pb.CaravanBuyOrSe sellValue += price * v } - sellValue = 150000 addScore = sellValue if errdata = this.module.DispenseRes(session, []*cfg.Gameatn{{ A: "attr", From bc6284afc23b0e40a0892b4ceda0add97fe7019f Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Tue, 29 Aug 2023 16:46:19 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E5=95=86=E9=98=9F=E7=AD=89=E7=BA=A7?= =?UTF-8?q?=E5=A5=96=E5=8A=B1=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comm/imodule.go | 2 +- modules/caravan/api_buyorsell.go | 3 ++- modules/caravan/module.go | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/comm/imodule.go b/comm/imodule.go index 3987a7918..7661a319c 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -51,11 +51,11 @@ type ( //邮件业务模块对外接口定义 提供给其他模块使用的 Imail interface { + IGetReddot // 注意 此接口逐步废弃 SendMailByCid(session IUserSession, cid string, res []*pb.UserAssets) bool SendNewMail(mail *pb.DBMailData, uid ...string) bool // 批量发送邮件 支持跨服 SendMailByUID(uid string, cid string, res []*cfg.Gameatn, Param []string) bool - IGetReddot // 所有邮件奖励统一调这个接口 SendRewardMailByCid(session IUserSession, cid string, res []*cfg.Gameatn) bool // 批量发邮件结果: cid 邮件表ID, 没有附件 res 传空 diff --git a/modules/caravan/api_buyorsell.go b/modules/caravan/api_buyorsell.go index 66817b811..cac80c710 100644 --- a/modules/caravan/api_buyorsell.go +++ b/modules/caravan/api_buyorsell.go @@ -92,6 +92,7 @@ func (this *apiComp) BuyOrSell(session comm.IUserSession, req *pb.CaravanBuyOrSe sellValue += price * v } + addScore = sellValue if errdata = this.module.DispenseRes(session, []*cfg.Gameatn{{ A: "attr", @@ -138,7 +139,7 @@ func (this *apiComp) BuyOrSell(session comm.IUserSession, req *pb.CaravanBuyOrSe if len(lvReward) > 0 { // 商队等级奖励 改发邮件 this.module.mail.SendRewardMailByCid(session, comm.CaravanLvReward, lvReward) } - caravan.Profit = 0 + // 商队盈利收益奖励 reward := this.configure.GetCaravanReward() for _, v := range reward { diff --git a/modules/caravan/module.go b/modules/caravan/module.go index 3bd6282da..e32b9507a 100644 --- a/modules/caravan/module.go +++ b/modules/caravan/module.go @@ -449,7 +449,7 @@ func (this *Caravan) CheckOverweight(data *pb.DBCaravan) (b bool) { func (this *Caravan) CheckCaravavLvUp(data *pb.DBCaravan) (curLv int32) { curLv = data.Lv for { - if conf, err := this.configure.GetCaravanLv(curLv + 1); err == nil { + if conf, err := this.configure.GetCaravanLv(curLv); err == nil { if conf.Newmoneyexp <= int32(data.Profit) { //data.Profit -= int64(conf.Newmoneyexp) curLv++