diff --git a/data/gameparam.json b/data/gameparam.json index 4d3a54e..b0d94cd 100644 --- a/data/gameparam.json +++ b/data/gameparam.json @@ -1,5 +1,5 @@ { - "NewPlayerCoin":1000000, + "NewPlayerCoin":100000000, "UpgradeAccountGiveCoin":0, "LogBatchWriteCount":1024, "LogBatchWriteInterval":1, diff --git a/model/gameparam.go b/model/gameparam.go index 7667324..7af9c99 100644 --- a/model/gameparam.go +++ b/model/gameparam.go @@ -79,6 +79,7 @@ type GameParam struct { CloseChannelSwitch bool //关闭渠道开关功能 BackendTimeLocal int //后台时区 GameStaticsFightVersion int // 对战场统计数据版本 + TestRankMatchAward bool // 测试段位奖励领取通知,直接改玩家排位积分使玩家获得奖励 } var GameParamPath = "../data/gameparam.json" diff --git a/model/playerrankseason.go b/model/playerrankseason.go index d555b3d..18717bd 100644 --- a/model/playerrankseason.go +++ b/model/playerrankseason.go @@ -15,8 +15,9 @@ type RankAward struct { } type PlayerRankInfo struct { - Score int64 // 积分 - Awards []*RankAward // 赛季奖励 + LastScore int64 // 上次积分 + Score int64 // 积分 + Awards []*RankAward // 赛季奖励 } type PlayerRankSeason struct { diff --git a/protocol/rankmatch/rankmatch.pb.go b/protocol/rankmatch/rankmatch.pb.go index f41324d..041abd5 100644 --- a/protocol/rankmatch/rankmatch.pb.go +++ b/protocol/rankmatch/rankmatch.pb.go @@ -136,11 +136,12 @@ type SeasonInfo struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty"` // 排位类型 - Lv int32 `protobuf:"varint,2,opt,name=Lv,proto3" json:"Lv,omitempty"` // 段位 - Score int64 `protobuf:"varint,3,opt,name=Score,proto3" json:"Score,omitempty"` // 积分 - LastLv int32 `protobuf:"varint,4,opt,name=LastLv,proto3" json:"LastLv,omitempty"` // 上赛季段位 - LastScore int64 `protobuf:"varint,5,opt,name=LastScore,proto3" json:"LastScore,omitempty"` // 上赛季积分 + Id int32 `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty"` // 排位类型 + Lv int32 `protobuf:"varint,2,opt,name=Lv,proto3" json:"Lv,omitempty"` // 段位 + Score int64 `protobuf:"varint,3,opt,name=Score,proto3" json:"Score,omitempty"` // 积分 + LastLv int32 `protobuf:"varint,4,opt,name=LastLv,proto3" json:"LastLv,omitempty"` // 上赛季段位 + LastScore int64 `protobuf:"varint,5,opt,name=LastScore,proto3" json:"LastScore,omitempty"` // 上赛季积分 + Award *AwardItem `protobuf:"bytes,6,opt,name=Award,proto3" json:"Award,omitempty"` // 奖励列表 } func (x *SeasonInfo) Reset() { @@ -210,6 +211,13 @@ func (x *SeasonInfo) GetLastScore() int64 { return 0 } +func (x *SeasonInfo) GetAward() *AwardItem { + if x != nil { + return x.Award + } + return nil +} + // PACKET_RM_SCRMSeasonInfo type SCRMSeasonInfo struct { state protoimpl.MessageState @@ -791,78 +799,81 @@ var File_rankmatch_proto protoreflect.FileDescriptor var file_rankmatch_proto_rawDesc = []byte{ 0x0a, 0x0f, 0x72, 0x61, 0x6e, 0x6b, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x72, 0x61, 0x6e, 0x6b, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x22, 0x10, 0x0a, 0x0e, - 0x43, 0x53, 0x52, 0x4d, 0x53, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x78, - 0x0a, 0x0a, 0x53, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, - 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, - 0x4c, 0x76, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x4c, 0x76, 0x12, 0x14, 0x0a, 0x05, - 0x53, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x53, 0x63, 0x6f, - 0x72, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x4c, 0x61, 0x73, 0x74, 0x4c, 0x76, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x06, 0x4c, 0x61, 0x73, 0x74, 0x4c, 0x76, 0x12, 0x1c, 0x0a, 0x09, 0x4c, 0x61, - 0x73, 0x74, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x4c, - 0x61, 0x73, 0x74, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x22, 0x6f, 0x0a, 0x0e, 0x53, 0x43, 0x52, 0x4d, - 0x53, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x54, 0x69, - 0x6d, 0x65, 0x53, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x03, 0x28, 0x03, 0x52, 0x09, 0x54, - 0x69, 0x6d, 0x65, 0x53, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2f, 0x0a, 0x07, 0x53, 0x65, 0x61, 0x73, - 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x72, 0x61, 0x6e, 0x6b, - 0x6d, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x53, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, - 0x52, 0x07, 0x53, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x73, 0x22, 0x20, 0x0a, 0x0e, 0x43, 0x53, 0x52, - 0x4d, 0x52, 0x61, 0x6e, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x49, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x22, 0x54, 0x0a, 0x08, 0x52, - 0x61, 0x6e, 0x6b, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, + 0x43, 0x53, 0x52, 0x4d, 0x53, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0xa4, + 0x01, 0x0a, 0x0a, 0x53, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, + 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x0e, 0x0a, + 0x02, 0x4c, 0x76, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x4c, 0x76, 0x12, 0x14, 0x0a, + 0x05, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x53, 0x63, + 0x6f, 0x72, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x4c, 0x61, 0x73, 0x74, 0x4c, 0x76, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x06, 0x4c, 0x61, 0x73, 0x74, 0x4c, 0x76, 0x12, 0x1c, 0x0a, 0x09, 0x4c, + 0x61, 0x73, 0x74, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, + 0x4c, 0x61, 0x73, 0x74, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x2a, 0x0a, 0x05, 0x41, 0x77, 0x61, + 0x72, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x72, 0x61, 0x6e, 0x6b, 0x6d, + 0x61, 0x74, 0x63, 0x68, 0x2e, 0x41, 0x77, 0x61, 0x72, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, + 0x41, 0x77, 0x61, 0x72, 0x64, 0x22, 0x6f, 0x0a, 0x0e, 0x53, 0x43, 0x52, 0x4d, 0x53, 0x65, 0x61, + 0x73, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x54, 0x69, 0x6d, 0x65, 0x53, + 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x03, 0x28, 0x03, 0x52, 0x09, 0x54, 0x69, 0x6d, 0x65, + 0x53, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2f, 0x0a, 0x07, 0x53, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x73, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x72, 0x61, 0x6e, 0x6b, 0x6d, 0x61, 0x74, + 0x63, 0x68, 0x2e, 0x53, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x53, + 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x73, 0x22, 0x20, 0x0a, 0x0e, 0x43, 0x53, 0x52, 0x4d, 0x52, 0x61, + 0x6e, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x22, 0x54, 0x0a, 0x08, 0x52, 0x61, 0x6e, 0x6b, + 0x49, 0x74, 0x65, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x02, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x4c, 0x76, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x02, 0x4c, 0x76, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x63, 0x6f, 0x72, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x22, 0x3b, + 0x0a, 0x0e, 0x53, 0x43, 0x52, 0x4d, 0x52, 0x61, 0x6e, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x12, 0x29, 0x0a, 0x05, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x13, 0x2e, 0x72, 0x61, 0x6e, 0x6b, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x52, 0x61, 0x6e, 0x6b, + 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x22, 0x21, 0x0a, 0x0f, 0x43, + 0x53, 0x52, 0x4d, 0x41, 0x77, 0x61, 0x72, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x0e, + 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x22, 0x29, + 0x0a, 0x05, 0x41, 0x77, 0x61, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x4e, 0x75, 0x6d, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x4e, 0x75, 0x6d, 0x22, 0x8d, 0x01, 0x0a, 0x09, 0x41, 0x77, + 0x61, 0x72, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x4c, 0x76, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x02, 0x4c, 0x76, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x53, - 0x63, 0x6f, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x53, 0x63, 0x6f, 0x72, - 0x65, 0x22, 0x3b, 0x0a, 0x0e, 0x53, 0x43, 0x52, 0x4d, 0x52, 0x61, 0x6e, 0x6b, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x12, 0x29, 0x0a, 0x05, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x72, 0x61, 0x6e, 0x6b, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x52, - 0x61, 0x6e, 0x6b, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x22, 0x21, - 0x0a, 0x0f, 0x43, 0x53, 0x52, 0x4d, 0x41, 0x77, 0x61, 0x72, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, - 0x64, 0x22, 0x29, 0x0a, 0x05, 0x41, 0x77, 0x61, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x4e, 0x75, - 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x4e, 0x75, 0x6d, 0x22, 0x8d, 0x01, 0x0a, - 0x09, 0x41, 0x77, 0x61, 0x72, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x4c, 0x76, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x4c, 0x76, 0x12, 0x28, 0x0a, 0x06, 0x41, 0x77, - 0x61, 0x72, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x72, 0x61, 0x6e, - 0x6b, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x41, 0x77, 0x61, 0x72, 0x64, 0x52, 0x06, 0x41, 0x77, - 0x61, 0x72, 0x64, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x54, - 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x52, 0x65, 0x63, 0x65, 0x69, - 0x76, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x22, 0x3b, 0x0a, 0x0f, - 0x53, 0x43, 0x52, 0x4d, 0x41, 0x77, 0x61, 0x72, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, - 0x28, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, - 0x72, 0x61, 0x6e, 0x6b, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x41, 0x77, 0x61, 0x72, 0x64, 0x49, - 0x74, 0x65, 0x6d, 0x52, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x35, 0x0a, 0x09, 0x43, 0x53, 0x52, - 0x4d, 0x41, 0x77, 0x61, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x41, 0x77, 0x61, 0x72, 0x64, 0x49, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x41, 0x77, 0x61, 0x72, 0x64, 0x49, 0x64, - 0x22, 0x2f, 0x0a, 0x09, 0x53, 0x43, 0x52, 0x4d, 0x41, 0x77, 0x61, 0x72, 0x64, 0x12, 0x12, 0x0a, - 0x04, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x43, 0x6f, 0x64, - 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, - 0x64, 0x2a, 0x8f, 0x02, 0x0a, 0x09, 0x52, 0x61, 0x6e, 0x6b, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x12, - 0x12, 0x0a, 0x0e, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x4d, 0x5f, 0x5a, 0x45, 0x52, - 0x4f, 0x10, 0x00, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x4d, - 0x5f, 0x43, 0x53, 0x52, 0x4d, 0x53, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x10, - 0xdc, 0x15, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x4d, 0x5f, - 0x53, 0x43, 0x52, 0x4d, 0x53, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x10, 0xdd, - 0x15, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x4d, 0x5f, 0x43, - 0x53, 0x52, 0x4d, 0x52, 0x61, 0x6e, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x10, 0xe0, 0x15, - 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x4d, 0x5f, 0x53, 0x43, - 0x52, 0x4d, 0x52, 0x61, 0x6e, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x10, 0xe1, 0x15, 0x12, - 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x4d, 0x5f, 0x43, 0x53, 0x52, - 0x4d, 0x41, 0x77, 0x61, 0x72, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x10, 0xe2, 0x15, 0x12, - 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x4d, 0x5f, 0x53, 0x43, 0x52, - 0x4d, 0x41, 0x77, 0x61, 0x72, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x10, 0xe3, 0x15, 0x12, - 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x4d, 0x5f, 0x43, 0x53, 0x52, - 0x4d, 0x41, 0x77, 0x61, 0x72, 0x64, 0x10, 0xe4, 0x15, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, - 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x4d, 0x5f, 0x53, 0x43, 0x52, 0x4d, 0x41, 0x77, 0x61, 0x72, 0x64, - 0x10, 0xe5, 0x15, 0x42, 0x29, 0x5a, 0x27, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x2e, 0x67, 0x61, 0x6d, - 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x61, 0x6d, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x72, 0x61, 0x6e, 0x6b, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x01, 0x28, 0x05, 0x52, 0x02, 0x4c, 0x76, 0x12, 0x28, 0x0a, 0x06, 0x41, 0x77, 0x61, 0x72, 0x64, + 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x72, 0x61, 0x6e, 0x6b, 0x6d, 0x61, + 0x74, 0x63, 0x68, 0x2e, 0x41, 0x77, 0x61, 0x72, 0x64, 0x52, 0x06, 0x41, 0x77, 0x61, 0x72, 0x64, + 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x54, 0x79, 0x70, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x05, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x22, 0x3b, 0x0a, 0x0f, 0x53, 0x43, 0x52, + 0x4d, 0x41, 0x77, 0x61, 0x72, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x28, 0x0a, 0x04, + 0x4c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x72, 0x61, 0x6e, + 0x6b, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x41, 0x77, 0x61, 0x72, 0x64, 0x49, 0x74, 0x65, 0x6d, + 0x52, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x35, 0x0a, 0x09, 0x43, 0x53, 0x52, 0x4d, 0x41, 0x77, + 0x61, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x02, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x41, 0x77, 0x61, 0x72, 0x64, 0x49, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x41, 0x77, 0x61, 0x72, 0x64, 0x49, 0x64, 0x22, 0x2f, 0x0a, + 0x09, 0x53, 0x43, 0x52, 0x4d, 0x41, 0x77, 0x61, 0x72, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x43, 0x6f, + 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x0e, + 0x0a, 0x02, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x2a, 0x8f, + 0x02, 0x0a, 0x09, 0x52, 0x61, 0x6e, 0x6b, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x12, 0x12, 0x0a, 0x0e, + 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x4d, 0x5f, 0x5a, 0x45, 0x52, 0x4f, 0x10, 0x00, + 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x4d, 0x5f, 0x43, 0x53, + 0x52, 0x4d, 0x53, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x10, 0xdc, 0x15, 0x12, + 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x4d, 0x5f, 0x53, 0x43, 0x52, + 0x4d, 0x53, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x10, 0xdd, 0x15, 0x12, 0x1d, + 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x4d, 0x5f, 0x43, 0x53, 0x52, 0x4d, + 0x52, 0x61, 0x6e, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x10, 0xe0, 0x15, 0x12, 0x1d, 0x0a, + 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x4d, 0x5f, 0x53, 0x43, 0x52, 0x4d, 0x52, + 0x61, 0x6e, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x10, 0xe1, 0x15, 0x12, 0x1e, 0x0a, 0x19, + 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x4d, 0x5f, 0x43, 0x53, 0x52, 0x4d, 0x41, 0x77, + 0x61, 0x72, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x10, 0xe2, 0x15, 0x12, 0x1e, 0x0a, 0x19, + 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x4d, 0x5f, 0x53, 0x43, 0x52, 0x4d, 0x41, 0x77, + 0x61, 0x72, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x10, 0xe3, 0x15, 0x12, 0x18, 0x0a, 0x13, + 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x4d, 0x5f, 0x43, 0x53, 0x52, 0x4d, 0x41, 0x77, + 0x61, 0x72, 0x64, 0x10, 0xe4, 0x15, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, + 0x5f, 0x52, 0x4d, 0x5f, 0x53, 0x43, 0x52, 0x4d, 0x41, 0x77, 0x61, 0x72, 0x64, 0x10, 0xe5, 0x15, + 0x42, 0x29, 0x5a, 0x27, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x2e, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x61, 0x6d, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6c, 0x2f, 0x72, 0x61, 0x6e, 0x6b, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( @@ -895,15 +906,16 @@ var file_rankmatch_proto_goTypes = []interface{}{ (*SCRMAward)(nil), // 12: rankmatch.SCRMAward } var file_rankmatch_proto_depIdxs = []int32{ - 2, // 0: rankmatch.SCRMSeasonInfo.Seasons:type_name -> rankmatch.SeasonInfo - 5, // 1: rankmatch.SCRMRankConfig.Items:type_name -> rankmatch.RankItem - 8, // 2: rankmatch.AwardItem.Awards:type_name -> rankmatch.Award - 9, // 3: rankmatch.SCRMAwardConfig.List:type_name -> rankmatch.AwardItem - 4, // [4:4] is the sub-list for method output_type - 4, // [4:4] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name + 9, // 0: rankmatch.SeasonInfo.Award:type_name -> rankmatch.AwardItem + 2, // 1: rankmatch.SCRMSeasonInfo.Seasons:type_name -> rankmatch.SeasonInfo + 5, // 2: rankmatch.SCRMRankConfig.Items:type_name -> rankmatch.RankItem + 8, // 3: rankmatch.AwardItem.Awards:type_name -> rankmatch.Award + 9, // 4: rankmatch.SCRMAwardConfig.List:type_name -> rankmatch.AwardItem + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name } func init() { file_rankmatch_proto_init() } diff --git a/protocol/rankmatch/rankmatch.proto b/protocol/rankmatch/rankmatch.proto index f722786..525af39 100644 --- a/protocol/rankmatch/rankmatch.proto +++ b/protocol/rankmatch/rankmatch.proto @@ -29,6 +29,7 @@ message SeasonInfo{ int64 Score = 3; // 积分 int32 LastLv = 4; // 上赛季段位 int64 LastScore = 5; // 上赛季积分 + AwardItem Award = 6; // 奖励列表 } // PACKET_RM_SCRMSeasonInfo diff --git a/public b/public index e261341..363a220 160000 --- a/public +++ b/public @@ -1 +1 @@ -Subproject commit e26134143eba5c7ced96afc84bde42705a9297be +Subproject commit 363a22034898c87b42588d088a7838134d84dcb6 diff --git a/worldsrv/action_rankmatch.go b/worldsrv/action_rankmatch.go index 05f8e0f..d29c0ea 100644 --- a/worldsrv/action_rankmatch.go +++ b/worldsrv/action_rankmatch.go @@ -61,6 +61,7 @@ func CSRMSeasonInfo(s *netlib.Session, packetId int, data interface{}, sid int64 pack.Seasons = append(pack.Seasons, info) } } + p.SendToClient(int(rankmatch.RankMatch_PACKET_RM_SCRMSeasonInfo), pack) logger.Logger.Trace("SCTMSeasonInfo:", pack) return nil @@ -270,6 +271,7 @@ func CSRMAward(s *netlib.Session, packetId int, data interface{}, sid int64) err Id: d.Award3Id, Num: d.Award3Num, }) + RankMgrSingleton.CheckShowRed(p.SnId) } p.SendToClient(int(rankmatch.RankMatch_PACKET_RM_SCRMAward), pack) diff --git a/worldsrv/action_server.go b/worldsrv/action_server.go index cd838f5..354e1f9 100644 --- a/worldsrv/action_server.go +++ b/worldsrv/action_server.go @@ -100,7 +100,23 @@ func init() { RankMgrSingleton.UpdateRobotSeason(p.Platform, p.SnId, scene.dbGameFree.GetRankType(), msg.GetRankScore()[scene.dbGameFree.GetRankType()], p.Name, p.Sex, p.HeadUrl, p.Coin, p.PlayerData.GetRoleId()) } else { - RankMgrSingleton.UpdatePlayerSeason(p.SnId, msg.GetRankScore()) + if model.GameParamData.TestRankMatchAward { + if RankMgrSingleton.playerSeasons[p.SnId] != nil { + if RankMgrSingleton.playerSeasons[p.SnId].RankType == nil { + RankMgrSingleton.playerSeasons[p.SnId].RankType = make(map[int32]*model.PlayerRankInfo) + } + if RankMgrSingleton.playerSeasons[p.SnId].RankType[1] == nil { + RankMgrSingleton.playerSeasons[p.SnId].RankType[1] = &model.PlayerRankInfo{} + } + RankMgrSingleton.playerSeasons[p.SnId].RankType[1].LastScore = 7500 + RankMgrSingleton.playerSeasons[p.SnId].RankType[1].Score = 7500 + RankMgrSingleton.playerSeasons[p.SnId].RankType[1].Awards = nil + } + RankMgrSingleton.UpdatePlayerSeason(p.SnId, map[int32]int64{1: 10000}) + } else { + RankMgrSingleton.UpdatePlayerSeason(p.SnId, msg.GetRankScore()) + } + } } //更新玩家等级排行榜 diff --git a/worldsrv/player.go b/worldsrv/player.go index d9570ce..315069d 100644 --- a/worldsrv/player.go +++ b/worldsrv/player.go @@ -3607,7 +3607,7 @@ func (this *Player) SendShowRed(showType hall_proto.ShowRedCode, showChild, isSh }, } proto.SetDefaults(pack) - //logger.Logger.Trace("SCShowRed:", pack) + logger.Logger.Trace("SCShowRed:", pack) this.SendToClient(int(hall_proto.HallPacketID_PACKET_SC_SHOWRED), pack) } @@ -4012,6 +4012,42 @@ func (this *Player) SendRankSeason() { info := &rankmatch.SeasonInfo{Id: k} info.Lv, info.Score = RankMgrSingleton.GetPlayerRankLV(k, this.SnId) info.LastLv, info.LastScore = RankMgrSingleton.GetPlayerLastRankLV(k, this.SnId) + se := RankMgrSingleton.GetPlayerSeason(this.SnId) + if se != nil && se.RankType[k] != nil { + if se.RankType[k].LastScore < se.RankType[k].Score { + oldLv := srvdata.RankLevelMgr.GetRankLevel(k, se.RankType[k].LastScore) + if info.Lv > oldLv { + var awards *rankmatch.AwardItem + var maxLv int32 = -1 + for _, item := range RankMgrSingleton.GetRankAwardList(k) { + // 1 可领取 2已领取 + if info.Lv >= item.Lv { + has := false + // 是否已领取 + for _, vv := range v.Awards { + if vv.Id == item.Id { + if vv.Ts > 0 { + has = true + } + break + } + } + if !has { + if item.Lv > maxLv { + awards = item + maxLv = item.Lv + } + } + } + } + if awards != nil { + info.Award = awards + } + } + se.RankType[k].LastScore = se.RankType[k].Score + } + } + pack.Seasons = append(pack.Seasons, info) } } diff --git a/worldsrv/rankmatch.go b/worldsrv/rankmatch.go index 05726e3..61dbb46 100644 --- a/worldsrv/rankmatch.go +++ b/worldsrv/rankmatch.go @@ -126,6 +126,7 @@ func (this *PlayerRankSeason) CheckNewSeason() { } for k, v := range this.RankType { this.RankType[k].Score = RankMgrSingleton.NewSeasonScore(v.Score) + this.RankType[k].LastScore = this.RankType[k].Score this.RankType[k].Awards = nil } @@ -155,6 +156,7 @@ func (this *PlayerRankSeason) Update(rankScore map[int32]int64) { for k, v := range this.RankType { if v != nil && v.Score != rankScore[k] { + v.LastScore = v.Score v.Score = rankScore[k] this.Dirty = true this.CheckShowRed(k) @@ -207,10 +209,12 @@ here: break } } - if has { - p := PlayerMgrSington.GetPlayerBySnId(this.SnId) - if p != nil { + p := PlayerMgrSington.GetPlayerBySnId(this.SnId) + if p != nil { + if has { p.SendShowRed(hall_proto.ShowRedCode_RankReward, rankType, 1) + } else { + p.SendShowRed(hall_proto.ShowRedCode_RankReward, rankType, 0) } } }