获奖记录

This commit is contained in:
by 2024-07-30 15:47:35 +08:00
parent 7d5085bf11
commit a5cd7beeeb
7 changed files with 61 additions and 49 deletions

View File

@ -59,7 +59,7 @@ func UpsertAwardLog(platform string, data *AwardLog) {
ret := &AwardLogRes{}
err := rpcCli.CallWithTimeout("AwardLogSvc.UpsertAwardLog", args, ret, time.Second*30)
if err != nil {
logger.Logger.Warn("UpsertApplyList error:", err)
logger.Logger.Warn("UpsertAwardLog error:", err)
return
}
return

View File

@ -10252,7 +10252,7 @@ type AwardLogData struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
TypeId int32 `protobuf:"varint,1,opt,name=TypeId,proto3" json:"TypeId,omitempty"` //排序類型 1-数量 2-序号
SortId int32 `protobuf:"varint,1,opt,name=SortId,proto3" json:"SortId,omitempty"` //排序類型 1-数量 2-序号
AwardLog []*AwardLogInfo `protobuf:"bytes,2,rep,name=AwardLog,proto3" json:"AwardLog,omitempty"`
}
@ -10288,9 +10288,9 @@ func (*AwardLogData) Descriptor() ([]byte, []int) {
return file_player_proto_rawDescGZIP(), []int{147}
}
func (x *AwardLogData) GetTypeId() int32 {
func (x *AwardLogData) GetSortId() int32 {
if x != nil {
return x.TypeId
return x.SortId
}
return 0
}
@ -11483,8 +11483,8 @@ var file_player_proto_rawDesc = []byte{
0x18, 0x2e, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63,
0x65, 0x72, 0x4c, 0x6f, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0c, 0x41, 0x6e, 0x6e, 0x6f, 0x75,
0x6e, 0x63, 0x65, 0x72, 0x4c, 0x6f, 0x67, 0x22, 0x58, 0x0a, 0x0c, 0x41, 0x77, 0x61, 0x72, 0x64,
0x4c, 0x6f, 0x67, 0x44, 0x61, 0x74, 0x61, 0x12, 0x16, 0x0a, 0x06, 0x54, 0x79, 0x70, 0x65, 0x49,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x54, 0x79, 0x70, 0x65, 0x49, 0x64, 0x12,
0x4c, 0x6f, 0x67, 0x44, 0x61, 0x74, 0x61, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x6f, 0x72, 0x74, 0x49,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x53, 0x6f, 0x72, 0x74, 0x49, 0x64, 0x12,
0x30, 0x0a, 0x08, 0x41, 0x77, 0x61, 0x72, 0x64, 0x4c, 0x6f, 0x67, 0x18, 0x02, 0x20, 0x03, 0x28,
0x0b, 0x32, 0x14, 0x2e, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x41, 0x77, 0x61, 0x72, 0x64,
0x4c, 0x6f, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x41, 0x77, 0x61, 0x72, 0x64, 0x4c, 0x6f,

View File

@ -1277,7 +1277,7 @@ message SCAwardLog{
repeated AnnouncerLogInfo AnnouncerLog = 3;
}
message AwardLogData{
int32 TypeId = 1; // 1- 2-
int32 SortId = 1; // 1- 2-
repeated AwardLogInfo AwardLog =2;
}
message AwardLogInfo{

View File

@ -7786,7 +7786,7 @@ type AwardLogConfig struct {
unknownFields protoimpl.UnknownFields
Platform string `protobuf:"bytes,1,opt,name=Platform,proto3" json:"Platform,omitempty"` // 平台
AwardLog *AwardLogData `protobuf:"bytes,2,opt,name=AwardLog,proto3" json:"AwardLog,omitempty"`
AwardLog []*AwardLogData `protobuf:"bytes,2,rep,name=AwardLog,proto3" json:"AwardLog,omitempty"`
AnnouncerLog []*AnnouncerLogInfo `protobuf:"bytes,3,rep,name=AnnouncerLog,proto3" json:"AnnouncerLog,omitempty"`
}
@ -7829,7 +7829,7 @@ func (x *AwardLogConfig) GetPlatform() string {
return ""
}
func (x *AwardLogConfig) GetAwardLog() *AwardLogData {
func (x *AwardLogConfig) GetAwardLog() []*AwardLogData {
if x != nil {
return x.AwardLog
}
@ -7848,8 +7848,9 @@ type AwardLogData struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
TypeId int32 `protobuf:"varint,1,opt,name=TypeId,proto3" json:"TypeId,omitempty"` //排序類型 1-数量 2-序号
AwardLog []*AwardLogInfo `protobuf:"bytes,2,rep,name=AwardLog,proto3" json:"AwardLog,omitempty"`
TypeId int32 `protobuf:"varint,1,opt,name=TypeId,proto3" json:"TypeId,omitempty"` //1话费 2实物
SortId int32 `protobuf:"varint,2,opt,name=SortId,proto3" json:"SortId,omitempty"` //排序類型 1-数量 2-序号
AwardLog []*AwardLogInfo `protobuf:"bytes,3,rep,name=AwardLog,proto3" json:"AwardLog,omitempty"`
}
func (x *AwardLogData) Reset() {
@ -7891,6 +7892,13 @@ func (x *AwardLogData) GetTypeId() int32 {
return 0
}
func (x *AwardLogData) GetSortId() int32 {
if x != nil {
return x.SortId
}
return 0
}
func (x *AwardLogData) GetAwardLog() []*AwardLogInfo {
if x != nil {
return x.AwardLog
@ -7903,7 +7911,6 @@ type AwardLogInfo struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
TypeId int32 `protobuf:"varint,1,opt,name=TypeId,proto3" json:"TypeId,omitempty"` //1话费 2实物
ItemId int32 `protobuf:"varint,2,opt,name=ItemId,proto3" json:"ItemId,omitempty"` //道具ID
Num int64 `protobuf:"varint,4,opt,name=Num,proto3" json:"Num,omitempty"` //数量
Url string `protobuf:"bytes,5,opt,name=Url,proto3" json:"Url,omitempty"` //话费icon
@ -7942,13 +7949,6 @@ func (*AwardLogInfo) Descriptor() ([]byte, []int) {
return file_common_proto_rawDescGZIP(), []int{83}
}
func (x *AwardLogInfo) GetTypeId() int32 {
if x != nil {
return x.TypeId
}
return 0
}
func (x *AwardLogInfo) GetItemId() int32 {
if x != nil {
return x.ItemId
@ -9292,21 +9292,21 @@ var file_common_proto_rawDesc = []byte{
0x72, 0x64, 0x4c, 0x6f, 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1a, 0x0a, 0x08, 0x50,
0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x50,
0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x30, 0x0a, 0x08, 0x41, 0x77, 0x61, 0x72, 0x64,
0x4c, 0x6f, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x77, 0x65, 0x62, 0x61,
0x4c, 0x6f, 0x67, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x77, 0x65, 0x62, 0x61,
0x70, 0x69, 0x2e, 0x41, 0x77, 0x61, 0x72, 0x64, 0x4c, 0x6f, 0x67, 0x44, 0x61, 0x74, 0x61, 0x52,
0x08, 0x41, 0x77, 0x61, 0x72, 0x64, 0x4c, 0x6f, 0x67, 0x12, 0x3c, 0x0a, 0x0c, 0x41, 0x6e, 0x6e,
0x6f, 0x75, 0x6e, 0x63, 0x65, 0x72, 0x4c, 0x6f, 0x67, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x18, 0x2e, 0x77, 0x65, 0x62, 0x61, 0x70, 0x69, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63,
0x65, 0x72, 0x4c, 0x6f, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0c, 0x41, 0x6e, 0x6e, 0x6f, 0x75,
0x6e, 0x63, 0x65, 0x72, 0x4c, 0x6f, 0x67, 0x22, 0x58, 0x0a, 0x0c, 0x41, 0x77, 0x61, 0x72, 0x64,
0x6e, 0x63, 0x65, 0x72, 0x4c, 0x6f, 0x67, 0x22, 0x70, 0x0a, 0x0c, 0x41, 0x77, 0x61, 0x72, 0x64,
0x4c, 0x6f, 0x67, 0x44, 0x61, 0x74, 0x61, 0x12, 0x16, 0x0a, 0x06, 0x54, 0x79, 0x70, 0x65, 0x49,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x54, 0x79, 0x70, 0x65, 0x49, 0x64, 0x12,
0x30, 0x0a, 0x08, 0x41, 0x77, 0x61, 0x72, 0x64, 0x4c, 0x6f, 0x67, 0x18, 0x02, 0x20, 0x03, 0x28,
0x0b, 0x32, 0x14, 0x2e, 0x77, 0x65, 0x62, 0x61, 0x70, 0x69, 0x2e, 0x41, 0x77, 0x61, 0x72, 0x64,
0x4c, 0x6f, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x41, 0x77, 0x61, 0x72, 0x64, 0x4c, 0x6f,
0x67, 0x22, 0x78, 0x0a, 0x0c, 0x41, 0x77, 0x61, 0x72, 0x64, 0x4c, 0x6f, 0x67, 0x49, 0x6e, 0x66,
0x6f, 0x12, 0x16, 0x0a, 0x06, 0x54, 0x79, 0x70, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
0x05, 0x52, 0x06, 0x54, 0x79, 0x70, 0x65, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x49, 0x74, 0x65,
0x16, 0x0a, 0x06, 0x53, 0x6f, 0x72, 0x74, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52,
0x06, 0x53, 0x6f, 0x72, 0x74, 0x49, 0x64, 0x12, 0x30, 0x0a, 0x08, 0x41, 0x77, 0x61, 0x72, 0x64,
0x4c, 0x6f, 0x67, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x77, 0x65, 0x62, 0x61,
0x70, 0x69, 0x2e, 0x41, 0x77, 0x61, 0x72, 0x64, 0x4c, 0x6f, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x52,
0x08, 0x41, 0x77, 0x61, 0x72, 0x64, 0x4c, 0x6f, 0x67, 0x22, 0x60, 0x0a, 0x0c, 0x41, 0x77, 0x61,
0x72, 0x64, 0x4c, 0x6f, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x49, 0x74, 0x65,
0x6d, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x49, 0x74, 0x65, 0x6d, 0x49,
0x64, 0x12, 0x10, 0x0a, 0x03, 0x4e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03,
0x4e, 0x75, 0x6d, 0x12, 0x10, 0x0a, 0x03, 0x55, 0x72, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09,

View File

@ -857,16 +857,16 @@ message SkinConfig {
// etcd /game/awardlog_config
message AwardLogConfig{
string Platform = 1; //
AwardLogData AwardLog =2;
repeated AwardLogData AwardLog =2;
repeated AnnouncerLogInfo AnnouncerLog = 3;
}
message AwardLogData{
int32 TypeId = 1; // 1- 2-
repeated AwardLogInfo AwardLog =2;
int32 TypeId = 1; //1 2
int32 SortId = 2; // 1- 2-
repeated AwardLogInfo AwardLog =3;
}
message AwardLogInfo{
int32 TypeId = 1; //1 2
int32 ItemId = 2; //ID
int64 Num = 4; //
string Url = 5; //icon

View File

@ -2914,33 +2914,35 @@ func CSAwardLog(s *netlib.Session, packetId int, data interface{}, sid int64) er
awardData.AwardLog = append(awardData.AwardLog, infoData)
}
//处理后台数据
for _, awardLog := range awardLogConfig.AwardLog.AwardLog {
for _, awardLog := range awardLogConfig.AwardLog {
if awardLog.TypeId == msg.TypeId {
status := false
for _, info := range awardData.AwardLog {
if awardLog.ItemId == info.ItemId {
status = true
if awardLog.Num > info.Num {
info.Num = awardLog.Num
for _, log := range awardLog.AwardLog {
status := false
for _, info := range awardData.AwardLog {
if log.ItemId == info.ItemId {
status = true
if log.Num > info.Num {
info.Num = log.Num
}
break
}
break
}
if !status {
infoData := &player_proto.AwardLogInfo{}
infoData.ItemId = log.ItemId
infoData.Num = log.Num
awardData.AwardLog = append(awardData.AwardLog, infoData)
}
}
if !status {
infoData := &player_proto.AwardLogInfo{}
infoData.ItemId = awardLog.ItemId
infoData.Num = awardLog.Num
awardData.AwardLog = append(awardData.AwardLog, infoData)
}
awardData.SortId = awardLog.SortId
}
}
awardData.TypeId = awardLogConfig.AwardLog.TypeId
ret.AwardLog = awardData
//实时播报数据
AnnouncerLog := AwardLogMgr.GetAnnouncerLog(msg.TypeId)
for _, logInfo := range AnnouncerLog {
infoData := &player_proto.AnnouncerLogInfo{}
infoData.Snid = logInfo.Snid
//infoData.Snid = logInfo.Snid
infoData.Name = logInfo.Name
infoData.Phone = logInfo.Phone[len(logInfo.Phone)-4:]
infoData.ItemId = logInfo.ItemId
@ -2953,7 +2955,7 @@ func CSAwardLog(s *netlib.Session, packetId int, data interface{}, sid int64) er
for _, info := range awardLogConfig.AnnouncerLog {
if info.TypeId == msg.TypeId {
infoData := &player_proto.AnnouncerLogInfo{}
infoData.Snid = info.Snid
//infoData.Snid = info.Snid
infoData.Name = info.Name
infoData.Phone = info.Phone[len(info.Phone)-4:]
infoData.ItemId = info.ItemId

View File

@ -2,7 +2,9 @@ package main
import (
"mongo.games.com/game/model"
"mongo.games.com/goserver/core/basic"
"mongo.games.com/goserver/core/logger"
"mongo.games.com/goserver/core/task"
"time"
"mongo.games.com/goserver/core/module"
@ -90,7 +92,15 @@ func (this *AwardLogManager) Shutdown() {
}
func (this *AwardLogManager) OnHourTimer() {
this.Save()
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
awardData := &model.AwardLog{}
awardData.Platform = "1"
awardData.AwardMap = this.AwardMap
awardData.Ts = time.Now()
model.UpsertAwardLog("1", awardData)
return nil
}), task.CompleteNotifyWrapper(func(data interface{}, tt task.Task) {
})).StartByFixExecutor("AwardLogTask")
}
func (this *AwardLogManager) Save() {