diff --git a/cmd/gameserver/action/RoleAction.go b/cmd/gameserver/action/RoleAction.go index b3dd8b6..f4ed2e0 100644 --- a/cmd/gameserver/action/RoleAction.go +++ b/cmd/gameserver/action/RoleAction.go @@ -233,18 +233,20 @@ func RoleEndBattleRpc(role *models.RoleModel, msg components.IMessage) (int32, i reward = role.Award(reward) //exp - var exp int32 + var amount int32 if req.Pass { - exp = carbonInfo.CarbonExp + amount = carbonInfo.CarbonExp } else { - exp = carbonInfo.CarbonFailExp + amount = carbonInfo.CarbonFailExp } - level, exp := role.UpLevel(exp) + level, exp := role.UpLevel(amount) rsp := pb.RoleEndBattleRsp{ - RoleLevel: level, - RoleExp: exp, - Reward: common.MapNumToString(reward), + RoleLevel: level, + RoleExp: exp, + RoleExpamount: amount, + Pass: req.Pass, + Reward: common.MapNumToString(reward), } return 0, rsp } diff --git a/models/rolePlugin.go b/models/rolePlugin.go index 8db1e9e..c2f4fd6 100644 --- a/models/rolePlugin.go +++ b/models/rolePlugin.go @@ -134,7 +134,7 @@ func (m *RoleModel) UpLevel(exp int32) (int32, int32) { level := m.Role.Level oldLevelExp := csvdata.Get().TbAccountLevelExp.Get(level) if exp >= oldLevelExp.NeedExp-m.Role.Exp { - exp = exp - oldLevelExp.NeedExp + exp = exp - (oldLevelExp.NeedExp - m.Role.Exp) level++ for exp > 0 { diff --git a/pb/protocode.pb.go b/pb/protocode.pb.go index cb79ae4..f613576 100644 --- a/pb/protocode.pb.go +++ b/pb/protocode.pb.go @@ -38,9 +38,8 @@ const ( ProtoCode_RoleStartBattleReq ProtoCode = 12 ProtoCode_RoleEndBattleReq ProtoCode = 13 ProtoCode_RoleEndBattleRsp ProtoCode = 14 - ProtoCode_RoleRewardRsp ProtoCode = 15 - ProtoCode_EquipmentDelReq ProtoCode = 16 - ProtoCode_EquipmentAddRsp ProtoCode = 17 + ProtoCode_EquipmentDelReq ProtoCode = 15 + ProtoCode_EquipmentAddRsp ProtoCode = 16 ) // Enum value maps for ProtoCode. @@ -61,9 +60,8 @@ var ( 12: "RoleStartBattleReq", 13: "RoleEndBattleReq", 14: "RoleEndBattleRsp", - 15: "RoleRewardRsp", - 16: "EquipmentDelReq", - 17: "EquipmentAddRsp", + 15: "EquipmentDelReq", + 16: "EquipmentAddRsp", } ProtoCode_value = map[string]int32{ "UNKNOWN": 0, @@ -81,9 +79,8 @@ var ( "RoleStartBattleReq": 12, "RoleEndBattleReq": 13, "RoleEndBattleRsp": 14, - "RoleRewardRsp": 15, - "EquipmentDelReq": 16, - "EquipmentAddRsp": 17, + "EquipmentDelReq": 15, + "EquipmentAddRsp": 16, } ) @@ -118,7 +115,7 @@ var File_protocode_proto protoreflect.FileDescriptor var file_protocode_proto_rawDesc = []byte{ 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x12, 0x09, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x64, 0x65, 0x2a, 0xe1, 0x02, 0x0a, + 0x6f, 0x12, 0x09, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x64, 0x65, 0x2a, 0xce, 0x02, 0x0a, 0x09, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x73, 0x70, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x48, 0x65, 0x61, 0x72, 0x74, 0x52, 0x65, @@ -137,12 +134,11 @@ var file_protocode_proto_rawDesc = []byte{ 0x6c, 0x65, 0x52, 0x65, 0x71, 0x10, 0x0c, 0x12, 0x14, 0x0a, 0x10, 0x52, 0x6f, 0x6c, 0x65, 0x45, 0x6e, 0x64, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x10, 0x0d, 0x12, 0x14, 0x0a, 0x10, 0x52, 0x6f, 0x6c, 0x65, 0x45, 0x6e, 0x64, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x52, 0x73, - 0x70, 0x10, 0x0e, 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x77, 0x61, 0x72, - 0x64, 0x52, 0x73, 0x70, 0x10, 0x0f, 0x12, 0x13, 0x0a, 0x0f, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, - 0x65, 0x6e, 0x74, 0x44, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x10, 0x10, 0x12, 0x13, 0x0a, 0x0f, 0x45, - 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x52, 0x73, 0x70, 0x10, 0x11, - 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2e, 0x2f, 0x70, 0x62, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x70, 0x10, 0x0e, 0x12, 0x13, 0x0a, 0x0f, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, + 0x44, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x10, 0x0f, 0x12, 0x13, 0x0a, 0x0f, 0x45, 0x71, 0x75, 0x69, + 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x52, 0x73, 0x70, 0x10, 0x10, 0x42, 0x0a, 0x5a, + 0x08, 0x2e, 0x2e, 0x2f, 0x70, 0x62, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( -- libgit2 0.21.2