diff --git a/protocol/welfare/welfare.pb.go b/protocol/welfare/welfare.pb.go index 6f8ac49..25af2d6 100644 --- a/protocol/welfare/welfare.pb.go +++ b/protocol/welfare/welfare.pb.go @@ -4186,6 +4186,7 @@ type LotteryInfo struct { // 玩家数据 CostRoomCard int64 `protobuf:"varint,17,opt,name=CostRoomCard,proto3" json:"CostRoomCard,omitempty"` // 消耗房卡 Codes []string `protobuf:"bytes,18,rep,name=Codes,proto3" json:"Codes,omitempty"` // 本期获得号码 + RemainTime int64 `protobuf:"varint,19,opt,name=RemainTime,proto3" json:"RemainTime,omitempty"` // 剩余时间,单位秒 } func (x *LotteryInfo) Reset() { @@ -4346,6 +4347,13 @@ func (x *LotteryInfo) GetCodes() []string { return nil } +func (x *LotteryInfo) GetRemainTime() int64 { + if x != nil { + return x.RemainTime + } + return 0 +} + //PACKET_SCLotteryInfo type SCLotteryInfo struct { state protoimpl.MessageState @@ -4918,7 +4926,7 @@ var file_welfare_proto_rawDesc = []byte{ 0x75, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x22, 0x0f, 0x0a, 0x0d, 0x43, 0x53, 0x4c, 0x6f, - 0x74, 0x74, 0x65, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0xe0, 0x03, 0x0a, 0x0b, 0x4c, 0x6f, + 0x74, 0x74, 0x65, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x80, 0x04, 0x0a, 0x0b, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x53, 0x74, 0x61, 0x72, 0x74, 0x54, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x53, 0x74, 0x61, 0x72, @@ -4948,7 +4956,9 @@ var file_welfare_proto_rawDesc = []byte{ 0x52, 0x4c, 0x12, 0x22, 0x0a, 0x0c, 0x43, 0x6f, 0x73, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x43, 0x61, 0x72, 0x64, 0x18, 0x11, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x43, 0x6f, 0x73, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x43, 0x61, 0x72, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x43, 0x6f, 0x64, 0x65, 0x73, 0x18, - 0x12, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x43, 0x6f, 0x64, 0x65, 0x73, 0x22, 0x63, 0x0a, 0x0d, + 0x12, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x43, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x1e, 0x0a, 0x0a, + 0x52, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x13, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x0a, 0x52, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x63, 0x0a, 0x0d, 0x53, 0x43, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x28, 0x0a, 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x77, 0x65, 0x6c, 0x66, 0x61, 0x72, 0x65, 0x2e, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x49, 0x6e, 0x66, diff --git a/protocol/welfare/welfare.proto b/protocol/welfare/welfare.proto index e35ffe0..c2c1520 100644 --- a/protocol/welfare/welfare.proto +++ b/protocol/welfare/welfare.proto @@ -530,6 +530,7 @@ message LotteryInfo { // 玩家数据 int64 CostRoomCard = 17; // 消耗房卡 repeated string Codes = 18; // 本期获得号码 + int64 RemainTime = 19; // 剩余时间,单位秒 } //PACKET_SCLotteryInfo diff --git a/worldsrv/lotterymgr.go b/worldsrv/lotterymgr.go index 93e104e..680e5bf 100644 --- a/worldsrv/lotterymgr.go +++ b/worldsrv/lotterymgr.go @@ -626,6 +626,7 @@ func (l *LotteryMgr) GetList(plt string) []*welfare.LotteryInfo { } state := 1 + remainTime := int64(0) switch { case d.WinTs <= now.Unix(): state = common.LotteryStateOver // 已结束 @@ -633,6 +634,7 @@ func (l *LotteryMgr) GetList(plt string) []*welfare.LotteryInfo { state = common.LotteryStateNoStart // 未开始 default: state = common.LotteryStateRun // 进行中 + remainTime = d.WinTs - now.Unix() } info := &welfare.LotteryInfo{ @@ -652,6 +654,7 @@ func (l *LotteryMgr) GetList(plt string) []*welfare.LotteryInfo { Price: d.Price, NeedRoomCard: LotteryRoomCard, ImageURL: d.ImageURL, + RemainTime: remainTime, } if d.WinTs > 0 && d.WinTs > now.Unix() {