水果机奖励做好了

This commit is contained in:
fatiao 2025-06-17 19:12:58 +08:00
parent 7e03f18619
commit 1027b63cb5
8 changed files with 2085 additions and 2052 deletions

View File

@ -9,21 +9,13 @@
<change beforePath="$PROJECT_DIR$/../doc/etcd-v3.5.17-windows-amd64/default.etcd/member/wal/0.tmp" beforeDir="false" afterPath="$PROJECT_DIR$/../doc/etcd-v3.5.17-windows-amd64/default.etcd/member/wal/0.tmp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../doc/etcd-v3.5.17-windows-amd64/default.etcd/member/wal/0000000000000000-0000000000000000.wal" beforeDir="false" afterPath="$PROJECT_DIR$/../doc/etcd-v3.5.17-windows-amd64/default.etcd/member/wal/0000000000000000-0000000000000000.wal" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/roserver/baseserver/router/route_table.go" beforeDir="false" afterPath="$PROJECT_DIR$/roserver/baseserver/router/route_table.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/roserver/fruit/model/fruit_manager.go" beforeDir="false" afterPath="$PROJECT_DIR$/roserver/fruit/model/fruit_manager.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/roserver/fruit/model/fruit_player.go" beforeDir="false" afterPath="$PROJECT_DIR$/roserver/fruit/model/fruit_player.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/roserver/fruit/model/fruit_room.go" beforeDir="false" afterPath="$PROJECT_DIR$/roserver/fruit/model/fruit_room.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/roserver/fruit/msg/fruit_msg.go" beforeDir="false" afterPath="$PROJECT_DIR$/roserver/fruit/msg/fruit_msg.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/roserver/game/model/role_bag.go" beforeDir="false" afterPath="$PROJECT_DIR$/roserver/game/model/role_bag.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/roserver/game/model/role_battle.go" beforeDir="false" afterPath="$PROJECT_DIR$/roserver/game/model/role_battle.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/roserver/game/msg/fruit_msg.go" beforeDir="false" afterPath="$PROJECT_DIR$/roserver/game/msg/fruit_msg.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/roserver/pprof/guildmem.pprof/mem.pprof" beforeDir="false" afterPath="$PROJECT_DIR$/roserver/pprof/guildmem.pprof/mem.pprof" afterDir="false" />
<change beforePath="$PROJECT_DIR$/roserver/serverproto/login.pb.go" beforeDir="false" afterPath="$PROJECT_DIR$/roserver/serverproto/login.pb.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/roserver/serverproto/login.proto" beforeDir="false" afterPath="$PROJECT_DIR$/roserver/serverproto/login.proto" afterDir="false" />
<change beforePath="$PROJECT_DIR$/roserver/serverproto/messagedef.pb.go" beforeDir="false" afterPath="$PROJECT_DIR$/roserver/serverproto/messagedef.pb.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/roserver/serverproto/messagedef.proto" beforeDir="false" afterPath="$PROJECT_DIR$/roserver/serverproto/messagedef.proto" afterDir="false" />
<change beforePath="$PROJECT_DIR$/roserver/serverproto/messagedefclient.proto" beforeDir="false" afterPath="$PROJECT_DIR$/roserver/serverproto/messagedefclient.proto" afterDir="false" />
<change beforePath="$PROJECT_DIR$/roserver/serverproto/pbbind_gen.go" beforeDir="false" afterPath="$PROJECT_DIR$/roserver/serverproto/pbbind_gen.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/roserver/serverproto/user.pb.go" beforeDir="false" afterPath="$PROJECT_DIR$/roserver/serverproto/user.pb.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/roserver/serverproto/user.proto" beforeDir="false" afterPath="$PROJECT_DIR$/roserver/serverproto/user.proto" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -69,7 +61,7 @@
"Go Build.db.executor": "Run",
"Go Build.fruit.executor": "Run",
"Go Build.game.executor": "Debug",
"Go Build.game1.executor": "Run",
"Go Build.game1.executor": "Debug",
"Go Build.game2.executor": "Debug",
"Go Build.gate.executor": "Debug",
"Go Build.gate1.executor": "Run",
@ -361,7 +353,7 @@
</line-breakpoint>
<line-breakpoint type="DlvLineBreakpoint">
<url>file://$PROJECT_DIR$/roserver/serverproto/user.pb.go</url>
<line>8416</line>
<line>8424</line>
<option name="timeStamp" value="194" />
</line-breakpoint>
<line-breakpoint type="DlvLineBreakpoint">
@ -464,6 +456,11 @@
<line>74</line>
<option name="timeStamp" value="464" />
</line-breakpoint>
<line-breakpoint enabled="true" type="DlvLineBreakpoint">
<url>file://$PROJECT_DIR$/roserver/game/model/role_battle.go</url>
<line>644</line>
<option name="timeStamp" value="481" />
</line-breakpoint>
</breakpoints>
</breakpoint-manager>
<watches-manager>

View File

@ -307,7 +307,6 @@ func (self *FruitRoom) Settle() {
SettleHistory: self.SettleHistory,
StartSlot: self.CurrStartSlot,
TargetSlot: self.CurrTargetSlot,
AwardItems: make([]int32, 0),
}
SendToAllGame(ntfMsg)
}

View File

@ -247,14 +247,15 @@ type RoleBattle struct {
deletedLevelHandled bool
incomeTime uint64
maxIncomeTime uint64
mapLevel uint32
mapId uint32
mapRewardCount uint32 //累计的挑战boss成功次数
mapRewardId uint32
mapRewardLevel uint32
mapLevelTime uint64
incomeTime uint64
fruitIncomeRewardPoint uint32
maxIncomeTime uint64
mapLevel uint32
mapId uint32
mapRewardCount uint32 //累计的挑战boss成功次数
mapRewardId uint32
mapRewardLevel uint32
mapLevelTime uint64
selfRank uint32
totalRanks uint32
@ -305,6 +306,7 @@ func (this *RoleBattle) Load(msg interface{}) bool {
this.deletedLevelHandled = proRole.RoleBattle.DeletedLevelHandled
this.incomeTime = proRole.RoleBattle.LastIncomeTime
this.fruitIncomeRewardPoint = proRole.RoleBattle.FruitIncomeRewardPoint
if this.incomeTime <= 0 {
//创建新号后默认赠送1次挂机宝箱计数 送4分钟
globalIncomeTime := uint64(model.GlobalIncomeTime) * 1000
@ -496,18 +498,19 @@ func (this *RoleBattle) Save() {
//save to db
saveMsg := &serverproto.SSBattleDataSaveReq{
Battle: &serverproto.RoleBattle{
LastIncomeTime: this.incomeTime,
MapLevel: this.mapLevel,
MapId: this.mapId,
QuickBattle: this.quickBattle,
RewardMapId: this.mapRewardId,
RewardMapLevel: this.mapRewardLevel,
RewardMapCount: this.mapRewardCount,
EvilInfo: this.evilData,
ExpeditionInfo: this.expeditionData,
MapLevelTime: this.mapLevelTime,
RushMap: this.rushMap,
DeletedLevelHandled: this.deletedLevelHandled,
LastIncomeTime: this.incomeTime,
FruitIncomeRewardPoint: this.fruitIncomeRewardPoint,
MapLevel: this.mapLevel,
MapId: this.mapId,
QuickBattle: this.quickBattle,
RewardMapId: this.mapRewardId,
RewardMapLevel: this.mapRewardLevel,
RewardMapCount: this.mapRewardCount,
EvilInfo: this.evilData,
ExpeditionInfo: this.expeditionData,
MapLevelTime: this.mapLevelTime,
RushMap: this.rushMap,
DeletedLevelHandled: this.deletedLevelHandled,
//todo...
//MapChallengeNumList: this.mapLevelChallengeNumList, 数据太大后续做优化处理
},
@ -517,6 +520,7 @@ func (this *RoleBattle) Save() {
func (this *RoleBattle) CopyData(data *serverproto.RoleBattle) {
data.LastIncomeTime = this.incomeTime
data.FruitIncomeRewardPoint = this.fruitIncomeRewardPoint
data.MapId = this.mapId
data.MapLevel = this.mapLevel
data.RewardMapCount = this.getMapRewardShowCount()
@ -639,12 +643,13 @@ func (this *RoleBattle) changeBattleDataNtf() {
}
ntfMsg := &serverproto.SCPlayerBattleDataChangeNtf{
LastIncomeTime: this.incomeTime,
MapId: this.mapId,
MapLevel: this.mapLevel,
MaxIncomeTime: uint64(this.maxIncomeTime),
QuickBattle: this.quickBattle,
RewardMapCount: this.getMapRewardShowCount(),
LastIncomeTime: this.incomeTime,
FruitIncomeRewardPoint: this.fruitIncomeRewardPoint,
MapId: this.mapId,
MapLevel: this.mapLevel,
MaxIncomeTime: uint64(this.maxIncomeTime),
QuickBattle: this.quickBattle,
RewardMapCount: this.getMapRewardShowCount(),
}
this.role.ReplayGate(ntfMsg, true)
}
@ -691,6 +696,11 @@ func (this *RoleBattle) SetIncomeTime(incomeTime uint64) {
this.changeBattleDataNtf()
}
func (this *RoleBattle) AddFruitIncomeRewardPoint(rewardPoint uint32) {
this.fruitIncomeRewardPoint += rewardPoint
this.changeBattleDataNtf()
}
func (this *RoleBattle) GetLevelId() int32 {
return this.getLevelId(this.mapId, this.mapLevel)
}
@ -760,7 +770,7 @@ func (this *RoleBattle) addMapRank(rewardCount uint32, oldMapId, oldMapLevel uin
}
func (this *RoleBattle) FruitIncome(incomeNum int32) map[int32]int32 {
var addItemList = make(map[int32]int32, 0)
var addItemList = make(map[int32]int32)
levelId := this.getLevelId(this.mapId, this.mapLevel)
this.levelOnlineReward(levelId, addItemList, incomeNum)
this.role.AddItemList(addItemList, AddFrom_Fruit, false)
@ -791,11 +801,13 @@ func (this *RoleBattle) Income() serverproto.ErrorCode {
globalIncomeLimitTime := this.maxIncomeTime
deltaTime := nowTime - this.incomeTime
if deltaTime < globalIncomeTime && !this.role.GetRoleBase().HasBossReward() {
if this.fruitIncomeRewardPoint == 0 && deltaTime < globalIncomeTime && !this.role.GetRoleBase().HasBossReward() {
util.WarnF("uid=%v delta time less Global income time !!!", this.role.GetUUid())
return serverproto.ErrorCode_ERROR_BATTLE_INCOME_INVALID
}
tmpFruitIncomeRewardPoint := this.fruitIncomeRewardPoint
this.fruitIncomeRewardPoint = 0
//超过上限时间用上限时间
var incomeNum int32
if deltaTime > globalIncomeLimitTime {
@ -814,7 +826,7 @@ func (this *RoleBattle) Income() serverproto.ErrorCode {
//util.DebugF("deltaTime:%v incomeNum:%v incomeTime:%v globalIncomeTime:%v globalIncomeLimitTime:%v",
// deltaTime, incomeNum, this.incomeTime, globalIncomeTime, globalIncomeLimitTime)
var addItemList = map[int32]int32{}
this.levelOnlineReward(levelId, addItemList, incomeNum)
this.levelOnlineReward(levelId, addItemList, incomeNum+int32(tmpFruitIncomeRewardPoint))
//获取关卡累计奖励
this.GetMapShowReward(addItemList)

View File

@ -99,6 +99,9 @@ func init() {
if msg.AwardChipNum > 0 {
addRmb := msg.AwardChipNum
role.(*model2.Role).AddItem(int32(serverproto.ResType_Res_Rmb), addRmb, model2.AddFrom_Fruit)
rewardPoint := uint32(addRmb / 4)
role.(*model2.Role).GetRoleBattle().AddFruitIncomeRewardPoint(rewardPoint)
msg.AddRewardPoint = rewardPoint
}
role.ReplayGate(msg, true)
})

File diff suppressed because it is too large Load Diff

View File

@ -1055,6 +1055,7 @@ message SCPlayerBattleDataChangeNtf{
uint64 max_income_time = 4; //
QuickBattleData quick_battle = 5; //
uint32 reward_map_count = 6; //
uint32 fruit_income_reward_point = 7;
}
//
message CSGetMapRankReq { //project game //RouteRule game
@ -3817,7 +3818,7 @@ message SCFruitSettleNtf { //project game|fruit //RouteRule game
repeated int32 settle_history = 7; //
int32 start_slot = 8;
int32 target_slot = 9;
repeated int32 award_items = 10; //
uint32 add_reward_point = 10; // 线
}
message SCFruitStartBetNtf { //project game|fruit //RouteRule game
uint64 uid = 1;

File diff suppressed because it is too large Load Diff

View File

@ -497,7 +497,9 @@ message RoleBattle {
RushMap rush_map = 12; //
repeated KeyValueType map_challenge_num_list = 13; //
bool deleted_level_handled = 14; //20243
bool deleted_level_handled = 14; //20243
uint32 fruit_income_reward_point = 15; //
}
message ActorPosition {