解决冲突

This commit is contained in:
sk 2024-07-09 19:05:29 +08:00
commit bc679f529e
11 changed files with 1959 additions and 771 deletions

View File

@ -292,6 +292,7 @@ const (
GainWayPermitExchangeCost = 96 // 赛季通行证兑换消耗 GainWayPermitExchangeCost = 96 // 赛季通行证兑换消耗
GainWayPermitExchangeGain = 97 // 赛季通行证兑换获得 GainWayPermitExchangeGain = 97 // 赛季通行证兑换获得
GainWayItemTaskPermit = 98 // 赛季通行证任务 GainWayItemTaskPermit = 98 // 赛季通行证任务
GainWayDiamondLottery = 99 //钻石抽奖
) )
// 后台选择 金币变化类型 的充值 类型id号起始 // 后台选择 金币变化类型 的充值 类型id号起始
@ -786,6 +787,7 @@ var PetIDs = []int32{PetIDChicken}
const ( const (
ChannelSwitchExchange = 1 ChannelSwitchExchange = 1
ChannelSwitchDropItem = 2 ChannelSwitchDropItem = 2
DiamondLottery = 4
) )
// 特殊商品id // 特殊商品id

View File

@ -30,8 +30,10 @@ const (
ETCDKEY_PLAYERPOOL = "/game/plt/playerpool/" // 个人水池调控配置 ETCDKEY_PLAYERPOOL = "/game/plt/playerpool/" // 个人水池调控配置
ETCDKEY_GAME_CONFIG = "/game/plt/gameconfig/" // 游戏管理/全局配置 ETCDKEY_GAME_CONFIG = "/game/plt/gameconfig/" // 游戏管理/全局配置
ETCDKEY_ACT_PHONELOTTERY = "/game/act_phoneLottery" ETCDKEY_ACT_PHONELOTTERY = "/game/act_phoneLottery"
ETCDKEY_ChannelSwitch = "/game/channel/switch" // 渠道开关 ETCDKEY_ChannelSwitch = "/game/channel/switch" // 渠道开关
ETCDKEY_ACT_Invite = "/game/act_invite" // 邀请活动配置 ETCDKEY_ACT_Invite = "/game/act_invite" // 邀请活动配置
ETCDKEY_ACT_Permit = "/game/act_permit" // 赛季通行证配置 ETCDKEY_ACT_Permit = "/game/act_permit" // 赛季通行证配置
ETCDKEY_Item = "/game/item" // 道具列表 ETCDKEY_DIAMOND_LOTTERY = "/game/diamond_lottery" // 钻石抽奖配置
ETCDKEY_Item = "/game/item" // 道具列表
) )

View File

@ -12,13 +12,14 @@ import (
*/ */
const ( const (
OpAll = 0 OpAll = 0
OpTurnplate = 1 OpTurnplate = 1
OpBlindBox = 2 OpBlindBox = 2
OpFirstPay = 3 OpFirstPay = 3
OpContinuousPay = 4 OpContinuousPay = 4
OpPhoneLottery = 5 OpPhoneLottery = 5
OpCollect = 6 OpCollect = 6
OpDiamondLottery = 7
) )
const ( const (
@ -123,6 +124,7 @@ type AllConfig struct {
*webapi.ActPermitConfig *webapi.ActPermitConfig
PermitStartTs int64 // 开始时间戳 PermitStartTs int64 // 开始时间戳
PermitEndTs int64 // 结束时间戳 PermitEndTs int64 // 结束时间戳
*webapi.DiamondLotteryConfig
// 道具配置 // 道具配置
*webapi.ItemConfig *webapi.ItemConfig
} }

View File

@ -478,6 +478,7 @@ type PlayerData struct {
IScoreTs time.Time // 邀请积分更新时间 IScoreTs time.Time // 邀请积分更新时间
Permit time.Time // 赛季通行证领取时间 Permit time.Time // 赛季通行证领取时间
PermitStartTs int64 // 赛季通行证开始时间戳 PermitStartTs int64 // 赛季通行证开始时间戳
DiamondLotteryScore int64 //钻石抽奖幸运值
} }
// 七日签到数据 // 七日签到数据

File diff suppressed because it is too large Load Diff

View File

@ -211,7 +211,14 @@ enum PlayerPacketID {
PACKET_SCExchangeChannel = 2826; // PACKET_SCExchangeChannel = 2826; //
PACKET_CSSMSConfig = 2827; // PACKET_CSSMSConfig = 2827; //
PACKET_SCSMSConfig = 2828; // PACKET_SCSMSConfig = 2828; //
PACKET_SCItem = 2830; // PACKET_CS_DiamondLotteryInfo = 2829; //
PACKET_SC_DiamondLotteryInfo = 2830; //
PACKET_CS_DiamondLottery = 2831; //
PACKET_SC_DiamondLottery = 2832; //
PACKET_CSDiamondLotteryLuckyAward = 2833; //
PACKET_SCDiamondLotteryLuckyAward = 2834; //
PACKET_SCItem = 2835; //
} }
// //
@ -1153,6 +1160,7 @@ message LotteryItem{
int32 Id = 1; int32 Id = 1;
int32 ItemId = 2; int32 ItemId = 2;
int64 ItemNum =3; int64 ItemNum =3;
int32 TypeId = 4;
} }
// //
@ -1194,7 +1202,7 @@ message CSExchangeChannel{
message ChannelSwitch { message ChannelSwitch {
repeated string OnChannelName = 1; // repeated string OnChannelName = 1; //
int32 Tp = 2; // 1 2v卡掉落 3: int32 Tp = 2; // 1 2v卡掉落 3: 4:
} }
// PACKET_SCExchangeChannel // PACKET_SCExchangeChannel
@ -1215,6 +1223,39 @@ message SMSInfo{
string SmsName = 2; string SmsName = 2;
} }
//
//PACKET_CS_DiamondLotteryInfo
message CSDiamondLotteryInfo{
}
//
//PACKET_SC_DiamondLotteryInfo
message SCDiamondLotteryInfo{
int64 LuckyScore = 1; //
repeated LotteryItem Item = 2;//
int32 MaxScore = 3;//
int32 DiamondNum = 4; //
}
//
//PACKET_CS_DiamondLottery
message CSDiamondLottery{
int32 LotteryType = 1; //1- 2-
}
//
//PACKET_SC_DiamondLottery
message SCDiamondLottery{
int64 LuckyScore = 1; //
repeated LotteryItem Item = 2; //
}
//
//PACKET_CSDiamondLotteryLuckyAward
message CSDiamondLotteryLuckyAward{
}
////PACKET_SCDiamondLotteryLuckyAward
message SCDiamondLotteryLuckyAward{
int64 LuckyScore = 1; //
repeated LotteryItem Item = 2; //
}
// PACKET_SCItem // PACKET_SCItem
message SCItem{ message SCItem{
repeated server.DB_GameItem Items = 1; // repeated server.DB_GameItem Items = 1; //

View File

@ -6028,7 +6028,7 @@ type ChannelSwitchConfig struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Tp int32 `protobuf:"varint,1,opt,name=Tp,proto3" json:"Tp,omitempty"` // 开关类型 1.兑换 2.道具掉落 3.邀请活动开关 Tp int32 `protobuf:"varint,1,opt,name=Tp,proto3" json:"Tp,omitempty"` // 开关类型 1.兑换 2.道具掉落 3.邀请活动开关 4.钻石抽奖
Platform string `protobuf:"bytes,2,opt,name=Platform,proto3" json:"Platform,omitempty"` // 平台id Platform string `protobuf:"bytes,2,opt,name=Platform,proto3" json:"Platform,omitempty"` // 平台id
OnChannelName []string `protobuf:"bytes,3,rep,name=OnChannelName,proto3" json:"OnChannelName,omitempty"` // 开启渠道 OnChannelName []string `protobuf:"bytes,3,rep,name=OnChannelName,proto3" json:"OnChannelName,omitempty"` // 开启渠道
} }
@ -6636,6 +6636,293 @@ func (x *ActPermitConfig) GetConfigs() []*PermitChannelConfig {
return nil return nil
} }
//钻石抽奖
type DiamondLotteryInfo struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int32 `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty"`
Type int32 `protobuf:"varint,2,opt,name=Type,proto3" json:"Type,omitempty"`
Name string `protobuf:"bytes,3,opt,name=Name,proto3" json:"Name,omitempty"`
ItemId int32 `protobuf:"varint,4,opt,name=ItemId,proto3" json:"ItemId,omitempty"`
Grade int32 `protobuf:"varint,5,opt,name=Grade,proto3" json:"Grade,omitempty"`
Oddrate int32 `protobuf:"varint,6,opt,name=Oddrate,proto3" json:"Oddrate,omitempty"`
}
func (x *DiamondLotteryInfo) Reset() {
*x = DiamondLotteryInfo{}
if protoimpl.UnsafeEnabled {
mi := &file_common_proto_msgTypes[66]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DiamondLotteryInfo) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DiamondLotteryInfo) ProtoMessage() {}
func (x *DiamondLotteryInfo) ProtoReflect() protoreflect.Message {
mi := &file_common_proto_msgTypes[66]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DiamondLotteryInfo.ProtoReflect.Descriptor instead.
func (*DiamondLotteryInfo) Descriptor() ([]byte, []int) {
return file_common_proto_rawDescGZIP(), []int{66}
}
func (x *DiamondLotteryInfo) GetId() int32 {
if x != nil {
return x.Id
}
return 0
}
func (x *DiamondLotteryInfo) GetType() int32 {
if x != nil {
return x.Type
}
return 0
}
func (x *DiamondLotteryInfo) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *DiamondLotteryInfo) GetItemId() int32 {
if x != nil {
return x.ItemId
}
return 0
}
func (x *DiamondLotteryInfo) GetGrade() int32 {
if x != nil {
return x.Grade
}
return 0
}
func (x *DiamondLotteryInfo) GetOddrate() int32 {
if x != nil {
return x.Oddrate
}
return 0
}
//钻石抽奖白名单
type DiamondLotteryPlayers struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Uid int32 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"`
Count int32 `protobuf:"varint,2,opt,name=Count,proto3" json:"Count,omitempty"` //抽奖次数
AwatdId []int32 `protobuf:"varint,3,rep,packed,name=AwatdId,proto3" json:"AwatdId,omitempty"` //配置表里的奖励ID
}
func (x *DiamondLotteryPlayers) Reset() {
*x = DiamondLotteryPlayers{}
if protoimpl.UnsafeEnabled {
mi := &file_common_proto_msgTypes[67]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DiamondLotteryPlayers) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DiamondLotteryPlayers) ProtoMessage() {}
func (x *DiamondLotteryPlayers) ProtoReflect() protoreflect.Message {
mi := &file_common_proto_msgTypes[67]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DiamondLotteryPlayers.ProtoReflect.Descriptor instead.
func (*DiamondLotteryPlayers) Descriptor() ([]byte, []int) {
return file_common_proto_rawDescGZIP(), []int{67}
}
func (x *DiamondLotteryPlayers) GetUid() int32 {
if x != nil {
return x.Uid
}
return 0
}
func (x *DiamondLotteryPlayers) GetCount() int32 {
if x != nil {
return x.Count
}
return 0
}
func (x *DiamondLotteryPlayers) GetAwatdId() []int32 {
if x != nil {
return x.AwatdId
}
return nil
}
type DiamondLotteryData struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Channel string `protobuf:"bytes,1,opt,name=Channel,proto3" json:"Channel,omitempty"` //渠道
Info []*DiamondLotteryInfo `protobuf:"bytes,2,rep,name=Info,proto3" json:"Info,omitempty"`
MaxScore int32 `protobuf:"varint,3,opt,name=MaxScore,proto3" json:"MaxScore,omitempty"` //保底奖励最大值
DiamondNum int32 `protobuf:"varint,4,opt,name=DiamondNum,proto3" json:"DiamondNum,omitempty"` //单次抽奖消耗钻石数量
Players []*DiamondLotteryPlayers `protobuf:"bytes,5,rep,name=Players,proto3" json:"Players,omitempty"` //白名单
}
func (x *DiamondLotteryData) Reset() {
*x = DiamondLotteryData{}
if protoimpl.UnsafeEnabled {
mi := &file_common_proto_msgTypes[68]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DiamondLotteryData) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DiamondLotteryData) ProtoMessage() {}
func (x *DiamondLotteryData) ProtoReflect() protoreflect.Message {
mi := &file_common_proto_msgTypes[68]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DiamondLotteryData.ProtoReflect.Descriptor instead.
func (*DiamondLotteryData) Descriptor() ([]byte, []int) {
return file_common_proto_rawDescGZIP(), []int{68}
}
func (x *DiamondLotteryData) GetChannel() string {
if x != nil {
return x.Channel
}
return ""
}
func (x *DiamondLotteryData) GetInfo() []*DiamondLotteryInfo {
if x != nil {
return x.Info
}
return nil
}
func (x *DiamondLotteryData) GetMaxScore() int32 {
if x != nil {
return x.MaxScore
}
return 0
}
func (x *DiamondLotteryData) GetDiamondNum() int32 {
if x != nil {
return x.DiamondNum
}
return 0
}
func (x *DiamondLotteryData) GetPlayers() []*DiamondLotteryPlayers {
if x != nil {
return x.Players
}
return nil
}
// etcd /game/diamond_lottery
type DiamondLotteryConfig struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Platform string `protobuf:"bytes,1,opt,name=Platform,proto3" json:"Platform,omitempty"` // 平台
LotteryData []*DiamondLotteryData `protobuf:"bytes,2,rep,name=LotteryData,proto3" json:"LotteryData,omitempty"`
}
func (x *DiamondLotteryConfig) Reset() {
*x = DiamondLotteryConfig{}
if protoimpl.UnsafeEnabled {
mi := &file_common_proto_msgTypes[69]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DiamondLotteryConfig) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DiamondLotteryConfig) ProtoMessage() {}
func (x *DiamondLotteryConfig) ProtoReflect() protoreflect.Message {
mi := &file_common_proto_msgTypes[69]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DiamondLotteryConfig.ProtoReflect.Descriptor instead.
func (*DiamondLotteryConfig) Descriptor() ([]byte, []int) {
return file_common_proto_rawDescGZIP(), []int{69}
}
func (x *DiamondLotteryConfig) GetPlatform() string {
if x != nil {
return x.Platform
}
return ""
}
func (x *DiamondLotteryConfig) GetLotteryData() []*DiamondLotteryData {
if x != nil {
return x.LotteryData
}
return nil
}
// etcd /game/item // etcd /game/item
type ItemConfig struct { type ItemConfig struct {
state protoimpl.MessageState state protoimpl.MessageState
@ -6649,7 +6936,7 @@ type ItemConfig struct {
func (x *ItemConfig) Reset() { func (x *ItemConfig) Reset() {
*x = ItemConfig{} *x = ItemConfig{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_common_proto_msgTypes[66] mi := &file_common_proto_msgTypes[70]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -6662,7 +6949,7 @@ func (x *ItemConfig) String() string {
func (*ItemConfig) ProtoMessage() {} func (*ItemConfig) ProtoMessage() {}
func (x *ItemConfig) ProtoReflect() protoreflect.Message { func (x *ItemConfig) ProtoReflect() protoreflect.Message {
mi := &file_common_proto_msgTypes[66] mi := &file_common_proto_msgTypes[70]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -6675,7 +6962,7 @@ func (x *ItemConfig) ProtoReflect() protoreflect.Message {
// Deprecated: Use ItemConfig.ProtoReflect.Descriptor instead. // Deprecated: Use ItemConfig.ProtoReflect.Descriptor instead.
func (*ItemConfig) Descriptor() ([]byte, []int) { func (*ItemConfig) Descriptor() ([]byte, []int) {
return file_common_proto_rawDescGZIP(), []int{66} return file_common_proto_rawDescGZIP(), []int{70}
} }
func (x *ItemConfig) GetPlatform() string { func (x *ItemConfig) GetPlatform() string {
@ -7763,16 +8050,51 @@ var file_common_proto_rawDesc = []byte{
0x05, 0x52, 0x04, 0x44, 0x61, 0x79, 0x73, 0x12, 0x35, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x05, 0x52, 0x04, 0x44, 0x61, 0x79, 0x73, 0x12, 0x35, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x66, 0x69,
0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x77, 0x65, 0x62, 0x61, 0x70, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x77, 0x65, 0x62, 0x61, 0x70,
0x69, 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x43, 0x69, 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x43,
0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x07, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x22, 0x53, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x07, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x22, 0x94,
0x0a, 0x0a, 0x49, 0x74, 0x65, 0x6d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1a, 0x0a, 0x08, 0x01, 0x0a, 0x12, 0x44, 0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72,
0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x29, 0x0a, 0x05, 0x49, 0x74, 0x65, 0x6d, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20,
0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x01, 0x28, 0x05, 0x52, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d,
0x2e, 0x44, 0x42, 0x5f, 0x47, 0x61, 0x6d, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x49, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a,
0x65, 0x6d, 0x73, 0x42, 0x26, 0x5a, 0x24, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x2e, 0x67, 0x61, 0x6d, 0x06, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x49,
0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x61, 0x6d, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x47, 0x72, 0x61, 0x64, 0x65, 0x18, 0x05,
0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x77, 0x65, 0x62, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x47, 0x72, 0x61, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x4f,
0x74, 0x6f, 0x33, 0x64, 0x64, 0x72, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x4f, 0x64,
0x64, 0x72, 0x61, 0x74, 0x65, 0x22, 0x59, 0x0a, 0x15, 0x44, 0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64,
0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x12, 0x10,
0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x75, 0x69, 0x64,
0x12, 0x14, 0x0a, 0x05, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52,
0x05, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x41, 0x77, 0x61, 0x74, 0x64, 0x49,
0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x05, 0x52, 0x07, 0x41, 0x77, 0x61, 0x74, 0x64, 0x49, 0x64,
0x22, 0xd3, 0x01, 0x0a, 0x12, 0x44, 0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64, 0x4c, 0x6f, 0x74, 0x74,
0x65, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x43, 0x68, 0x61, 0x6e, 0x6e,
0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65,
0x6c, 0x12, 0x2e, 0x0a, 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x1a, 0x2e, 0x77, 0x65, 0x62, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64,
0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x49, 0x6e, 0x66,
0x6f, 0x12, 0x1a, 0x0a, 0x08, 0x4d, 0x61, 0x78, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x03, 0x20,
0x01, 0x28, 0x05, 0x52, 0x08, 0x4d, 0x61, 0x78, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x1e, 0x0a,
0x0a, 0x44, 0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64, 0x4e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28,
0x05, 0x52, 0x0a, 0x44, 0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64, 0x4e, 0x75, 0x6d, 0x12, 0x37, 0x0a,
0x07, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d,
0x2e, 0x77, 0x65, 0x62, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64, 0x4c,
0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x52, 0x07, 0x50,
0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x22, 0x70, 0x0a, 0x14, 0x44, 0x69, 0x61, 0x6d, 0x6f, 0x6e,
0x64, 0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 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, 0x3c, 0x0a, 0x0b, 0x4c, 0x6f,
0x74, 0x74, 0x65, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x1a, 0x2e, 0x77, 0x65, 0x62, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64,
0x4c, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x52, 0x0b, 0x4c, 0x6f, 0x74,
0x74, 0x65, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x22, 0x53, 0x0a, 0x0a, 0x49, 0x74, 0x65, 0x6d,
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, 0x29, 0x0a, 0x05, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28,
0x0b, 0x32, 0x13, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x44, 0x42, 0x5f, 0x47, 0x61,
0x6d, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x42, 0x26, 0x5a,
0x24, 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, 0x77,
0x65, 0x62, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
@ -7787,7 +8109,7 @@ func file_common_proto_rawDescGZIP() []byte {
return file_common_proto_rawDescData return file_common_proto_rawDescData
} }
var file_common_proto_msgTypes = make([]protoimpl.MessageInfo, 73) var file_common_proto_msgTypes = make([]protoimpl.MessageInfo, 77)
var file_common_proto_goTypes = []interface{}{ var file_common_proto_goTypes = []interface{}{
(*MysqlDbSetting)(nil), // 0: webapi.MysqlDbSetting (*MysqlDbSetting)(nil), // 0: webapi.MysqlDbSetting
(*MongoDbSetting)(nil), // 1: webapi.MongoDbSetting (*MongoDbSetting)(nil), // 1: webapi.MongoDbSetting
@ -7855,35 +8177,39 @@ var file_common_proto_goTypes = []interface{}{
(*PermitRankConfig)(nil), // 63: webapi.PermitRankConfig (*PermitRankConfig)(nil), // 63: webapi.PermitRankConfig
(*PermitChannelConfig)(nil), // 64: webapi.PermitChannelConfig (*PermitChannelConfig)(nil), // 64: webapi.PermitChannelConfig
(*ActPermitConfig)(nil), // 65: webapi.ActPermitConfig (*ActPermitConfig)(nil), // 65: webapi.ActPermitConfig
(*ItemConfig)(nil), // 66: webapi.ItemConfig (*DiamondLotteryInfo)(nil), // 66: webapi.DiamondLotteryInfo
nil, // 67: webapi.Platform.BindTelRewardEntry (*DiamondLotteryPlayers)(nil), // 67: webapi.DiamondLotteryPlayers
nil, // 68: webapi.PlayerData.RankScoreEntry (*DiamondLotteryData)(nil), // 68: webapi.DiamondLotteryData
nil, // 69: webapi.ItemShop.AwardEntry (*DiamondLotteryConfig)(nil), // 69: webapi.DiamondLotteryConfig
nil, // 70: webapi.VIPcfg.AwardEntry (*ItemConfig)(nil), // 70: webapi.ItemConfig
nil, // 71: webapi.VIPcfg.Privilege7Entry nil, // 71: webapi.Platform.BindTelRewardEntry
nil, // 72: webapi.ActInviteConfig.PayScoreEntry nil, // 72: webapi.PlayerData.RankScoreEntry
(*server.DB_GameFree)(nil), // 73: server.DB_GameFree nil, // 73: webapi.ItemShop.AwardEntry
(*server.DB_GameItem)(nil), // 74: server.DB_GameItem nil, // 74: webapi.VIPcfg.AwardEntry
nil, // 75: webapi.VIPcfg.Privilege7Entry
nil, // 76: webapi.ActInviteConfig.PayScoreEntry
(*server.DB_GameFree)(nil), // 77: server.DB_GameFree
(*server.DB_GameItem)(nil), // 78: server.DB_GameItem
} }
var file_common_proto_depIdxs = []int32{ var file_common_proto_depIdxs = []int32{
2, // 0: webapi.Platform.Leaderboard:type_name -> webapi.RankSwitch 2, // 0: webapi.Platform.Leaderboard:type_name -> webapi.RankSwitch
3, // 1: webapi.Platform.ClubConfig:type_name -> webapi.ClubConfig 3, // 1: webapi.Platform.ClubConfig:type_name -> webapi.ClubConfig
4, // 2: webapi.Platform.ThirdGameMerchant:type_name -> webapi.ThirdGame 4, // 2: webapi.Platform.ThirdGameMerchant:type_name -> webapi.ThirdGame
67, // 3: webapi.Platform.BindTelReward:type_name -> webapi.Platform.BindTelRewardEntry 71, // 3: webapi.Platform.BindTelReward:type_name -> webapi.Platform.BindTelRewardEntry
6, // 4: webapi.GameConfigGlobal.GameStatus:type_name -> webapi.GameStatus 6, // 4: webapi.GameConfigGlobal.GameStatus:type_name -> webapi.GameStatus
73, // 5: webapi.GameFree.DbGameFree:type_name -> server.DB_GameFree 77, // 5: webapi.GameFree.DbGameFree:type_name -> server.DB_GameFree
8, // 6: webapi.PlatformGameConfig.DbGameFrees:type_name -> webapi.GameFree 8, // 6: webapi.PlatformGameConfig.DbGameFrees:type_name -> webapi.GameFree
0, // 7: webapi.PlatformDbConfig.Mysql:type_name -> webapi.MysqlDbSetting 0, // 7: webapi.PlatformDbConfig.Mysql:type_name -> webapi.MysqlDbSetting
1, // 8: webapi.PlatformDbConfig.MongoDb:type_name -> webapi.MongoDbSetting 1, // 8: webapi.PlatformDbConfig.MongoDb:type_name -> webapi.MongoDbSetting
1, // 9: webapi.PlatformDbConfig.MongoDbLog:type_name -> webapi.MongoDbSetting 1, // 9: webapi.PlatformDbConfig.MongoDbLog:type_name -> webapi.MongoDbSetting
73, // 10: webapi.GameConfigGroup.DbGameFree:type_name -> server.DB_GameFree 77, // 10: webapi.GameConfigGroup.DbGameFree:type_name -> server.DB_GameFree
68, // 11: webapi.PlayerData.RankScore:type_name -> webapi.PlayerData.RankScoreEntry 72, // 11: webapi.PlayerData.RankScore:type_name -> webapi.PlayerData.RankScoreEntry
29, // 12: webapi.PlayerData.Items:type_name -> webapi.ItemInfo 29, // 12: webapi.PlayerData.Items:type_name -> webapi.ItemInfo
20, // 13: webapi.OnlineReport.GameCount:type_name -> webapi.OnlineGameCnt 20, // 13: webapi.OnlineReport.GameCount:type_name -> webapi.OnlineGameCnt
22, // 14: webapi.CommonNoticeList.List:type_name -> webapi.CommonNotice 22, // 14: webapi.CommonNoticeList.List:type_name -> webapi.CommonNotice
25, // 15: webapi.ExchangeShop.ExType:type_name -> webapi.ExchangeType 25, // 15: webapi.ExchangeShop.ExType:type_name -> webapi.ExchangeType
24, // 16: webapi.ExchangeShopList.List:type_name -> webapi.ExchangeShop 24, // 16: webapi.ExchangeShopList.List:type_name -> webapi.ExchangeShop
69, // 17: webapi.ItemShop.Award:type_name -> webapi.ItemShop.AwardEntry 73, // 17: webapi.ItemShop.Award:type_name -> webapi.ItemShop.AwardEntry
27, // 18: webapi.ItemShopList.List:type_name -> webapi.ItemShop 27, // 18: webapi.ItemShopList.List:type_name -> webapi.ItemShop
29, // 19: webapi.MatchInfoAward.ItemId:type_name -> webapi.ItemInfo 29, // 19: webapi.MatchInfoAward.ItemId:type_name -> webapi.ItemInfo
30, // 20: webapi.GameMatchDate.Award:type_name -> webapi.MatchInfoAward 30, // 20: webapi.GameMatchDate.Award:type_name -> webapi.MatchInfoAward
@ -7904,12 +8230,12 @@ var file_common_proto_depIdxs = []int32{
35, // 35: webapi.WelfareSpree.Item:type_name -> webapi.WelfareDate 35, // 35: webapi.WelfareSpree.Item:type_name -> webapi.WelfareDate
45, // 36: webapi.WelfareFirstPayDataList.List:type_name -> webapi.WelfareSpree 45, // 36: webapi.WelfareFirstPayDataList.List:type_name -> webapi.WelfareSpree
45, // 37: webapi.WelfareContinuousPayDataList.List:type_name -> webapi.WelfareSpree 45, // 37: webapi.WelfareContinuousPayDataList.List:type_name -> webapi.WelfareSpree
70, // 38: webapi.VIPcfg.Award:type_name -> webapi.VIPcfg.AwardEntry 74, // 38: webapi.VIPcfg.Award:type_name -> webapi.VIPcfg.AwardEntry
71, // 39: webapi.VIPcfg.Privilege7:type_name -> webapi.VIPcfg.Privilege7Entry 75, // 39: webapi.VIPcfg.Privilege7:type_name -> webapi.VIPcfg.Privilege7Entry
48, // 40: webapi.VIPcfgDataList.List:type_name -> webapi.VIPcfg 48, // 40: webapi.VIPcfgDataList.List:type_name -> webapi.VIPcfg
35, // 41: webapi.ChessRankConfig.Item:type_name -> webapi.WelfareDate 35, // 41: webapi.ChessRankConfig.Item:type_name -> webapi.WelfareDate
52, // 42: webapi.ChessRankcfgData.Datas:type_name -> webapi.ChessRankConfig 52, // 42: webapi.ChessRankcfgData.Datas:type_name -> webapi.ChessRankConfig
72, // 43: webapi.ActInviteConfig.PayScore:type_name -> webapi.ActInviteConfig.PayScoreEntry 76, // 43: webapi.ActInviteConfig.PayScore:type_name -> webapi.ActInviteConfig.PayScoreEntry
59, // 44: webapi.ActInviteConfig.Awards1:type_name -> webapi.RankAward 59, // 44: webapi.ActInviteConfig.Awards1:type_name -> webapi.RankAward
59, // 45: webapi.ActInviteConfig.Awards2:type_name -> webapi.RankAward 59, // 45: webapi.ActInviteConfig.Awards2:type_name -> webapi.RankAward
59, // 46: webapi.ActInviteConfig.Awards3:type_name -> webapi.RankAward 59, // 46: webapi.ActInviteConfig.Awards3:type_name -> webapi.RankAward
@ -7922,12 +8248,15 @@ var file_common_proto_depIdxs = []int32{
62, // 53: webapi.PermitChannelConfig.ExchangeConfig:type_name -> webapi.PermitExchangeConfig 62, // 53: webapi.PermitChannelConfig.ExchangeConfig:type_name -> webapi.PermitExchangeConfig
63, // 54: webapi.PermitChannelConfig.RankConfig:type_name -> webapi.PermitRankConfig 63, // 54: webapi.PermitChannelConfig.RankConfig:type_name -> webapi.PermitRankConfig
64, // 55: webapi.ActPermitConfig.Configs:type_name -> webapi.PermitChannelConfig 64, // 55: webapi.ActPermitConfig.Configs:type_name -> webapi.PermitChannelConfig
74, // 56: webapi.ItemConfig.Items:type_name -> server.DB_GameItem 66, // 56: webapi.DiamondLotteryData.Info:type_name -> webapi.DiamondLotteryInfo
57, // [57:57] is the sub-list for method output_type 67, // 57: webapi.DiamondLotteryData.Players:type_name -> webapi.DiamondLotteryPlayers
57, // [57:57] is the sub-list for method input_type 68, // 58: webapi.DiamondLotteryConfig.LotteryData:type_name -> webapi.DiamondLotteryData
57, // [57:57] is the sub-list for extension type_name 78, // 59: webapi.ItemConfig.Items:type_name -> server.DB_GameItem
57, // [57:57] is the sub-list for extension extendee 60, // [60:60] is the sub-list for method output_type
0, // [0:57] is the sub-list for field type_name 60, // [60:60] is the sub-list for method input_type
60, // [60:60] is the sub-list for extension type_name
60, // [60:60] is the sub-list for extension extendee
0, // [0:60] is the sub-list for field type_name
} }
func init() { file_common_proto_init() } func init() { file_common_proto_init() }
@ -8729,6 +9058,54 @@ func file_common_proto_init() {
} }
} }
file_common_proto_msgTypes[66].Exporter = func(v interface{}, i int) interface{} { file_common_proto_msgTypes[66].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DiamondLotteryInfo); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_common_proto_msgTypes[67].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DiamondLotteryPlayers); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_common_proto_msgTypes[68].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DiamondLotteryData); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_common_proto_msgTypes[69].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DiamondLotteryConfig); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_common_proto_msgTypes[70].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ItemConfig); i { switch v := v.(*ItemConfig); i {
case 0: case 0:
return &v.state return &v.state
@ -8747,7 +9124,7 @@ func file_common_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_common_proto_rawDesc, RawDescriptor: file_common_proto_rawDesc,
NumEnums: 0, NumEnums: 0,
NumMessages: 73, NumMessages: 77,
NumExtensions: 0, NumExtensions: 0,
NumServices: 0, NumServices: 0,
}, },

View File

@ -672,7 +672,7 @@ message WelfareCollectConfig{
// etcd /game/channel/switch // etcd /game/channel/switch
message ChannelSwitchConfig{ message ChannelSwitchConfig{
int32 Tp = 1; // 1. 2. 3. int32 Tp = 1; // 1. 2. 3. 4.
string Platform = 2; // id string Platform = 2; // id
repeated string OnChannelName = 3; // repeated string OnChannelName = 3; //
} }
@ -737,8 +737,38 @@ message ActPermitConfig{
repeated PermitChannelConfig Configs = 4; // repeated PermitChannelConfig Configs = 4; //
} }
//
message DiamondLotteryInfo{
int32 Id = 1;
int32 Type = 2;
string Name = 3;
int32 ItemId = 4;
int32 Grade = 5;
int32 Oddrate =6;
}
//
message DiamondLotteryPlayers{
int32 uid = 1;
int32 Count = 2; //
repeated int32 AwatdId = 3; //ID
}
message DiamondLotteryData{
string Channel = 1; //
repeated DiamondLotteryInfo Info = 2;
int32 MaxScore = 3; //
int32 DiamondNum = 4; //
repeated DiamondLotteryPlayers Players = 5;//
}
// etcd /game/diamond_lottery
message DiamondLotteryConfig{
string Platform = 1; //
repeated DiamondLotteryData LotteryData = 2;
}
// etcd /game/item // etcd /game/item
message ItemConfig { message ItemConfig {
string Platform = 1; // string Platform = 1; //
repeated server.DB_GameItem Items = 2; // repeated server.DB_GameItem Items = 2; //
} }

View File

@ -6,6 +6,7 @@ import (
"mongo.games.com/game/common" "mongo.games.com/game/common"
"mongo.games.com/game/model" "mongo.games.com/game/model"
player_proto "mongo.games.com/game/protocol/player" player_proto "mongo.games.com/game/protocol/player"
"mongo.games.com/game/protocol/webapi"
"mongo.games.com/game/srvdata" "mongo.games.com/game/srvdata"
"mongo.games.com/goserver/core/logger" "mongo.games.com/goserver/core/logger"
"mongo.games.com/goserver/core/netlib" "mongo.games.com/goserver/core/netlib"
@ -24,7 +25,6 @@ func (this *CSPhoneLotteryInfoPacketFactory) CreatePacket() interface{} {
// 获取抽奖信息 // 获取抽奖信息
func (this *CSPhoneLotteryInfoHandler) Process(s *netlib.Session, packetid int, data interface{}, sid int64) error { func (this *CSPhoneLotteryInfoHandler) Process(s *netlib.Session, packetid int, data interface{}, sid int64) error {
if _, ok := data.(*player_proto.CSPhoneLotteryInfo); ok { if _, ok := data.(*player_proto.CSPhoneLotteryInfo); ok {
p := PlayerMgrSington.GetPlayer(sid) p := PlayerMgrSington.GetPlayer(sid)
logger.Logger.Trace("客户端请求抽奖信息snid = ", p.SnId) logger.Logger.Trace("客户端请求抽奖信息snid = ", p.SnId)
@ -80,7 +80,8 @@ func (this *CSPhoneLotteryHandler) Process(s *netlib.Session, packetid int, data
logger.Logger.Warn("CSPhoneLottery p == nil") logger.Logger.Warn("CSPhoneLottery p == nil")
return nil return nil
} }
if WelfareMgrSington.GetPhoneLotteryStatus(p.Platform) == model.WelfareClose { conf := PlatformMgrSingleton.GetConfig(p.Platform).ChannelSwitch[common.DiamondLottery]
if !model.GameParamData.CloseChannelSwitch && (conf == nil || !common.InSliceString(conf.OnChannelName, p.LastChannel)) {
return nil return nil
} }
countType := msg.GetLotteryType() countType := msg.GetLotteryType()
@ -91,10 +92,6 @@ func (this *CSPhoneLotteryHandler) Process(s *netlib.Session, packetid int, data
count = 10 count = 10
} }
logger.Logger.Tracef("玩家请求抽奖snid =%d,count = %d ", p.SnId, count) logger.Logger.Tracef("玩家请求抽奖snid =%d,count = %d ", p.SnId, count)
if p == nil {
logger.Logger.Warn("CSPhoneLottery p == nil")
return nil
}
if p.LotteryCount < count { if p.LotteryCount < count {
logger.Logger.Trace("剩余抽奖次数不足,无法抽奖 count = ", count) logger.Logger.Trace("剩余抽奖次数不足,无法抽奖 count = ", count)
return nil return nil
@ -209,6 +206,257 @@ func (this *CSPhoneLotteryHandler) Process(s *netlib.Session, packetid int, data
return nil return nil
} }
type CSDiamondLotteryInfoPacketFactory struct {
}
type CSDiamondLotteryInfoHandler struct {
}
func (this *CSDiamondLotteryInfoPacketFactory) CreatePacket() interface{} {
pack := &player_proto.CSDiamondLotteryInfo{}
return pack
}
// 获取钻石抽奖信息
func (this *CSDiamondLotteryInfoHandler) Process(s *netlib.Session, packetid int, data interface{}, sid int64) error {
if _, ok := data.(*player_proto.CSPhoneLotteryInfo); ok {
p := PlayerMgrSington.GetPlayer(sid)
logger.Logger.Trace("客户端请求钻石抽奖信息snid = ", p.SnId)
if p == nil {
logger.Logger.Warn("CSPhoneLotteryInfo p == nil")
return nil
}
// 渠道开关
conf := PlatformMgrSingleton.GetConfig(p.Platform).ChannelSwitch[common.DiamondLottery]
if !model.GameParamData.CloseChannelSwitch && (conf == nil || !common.InSliceString(conf.OnChannelName, p.LastChannel)) {
return nil
}
pack := &player_proto.SCDiamondLotteryInfo{}
pack.LuckyScore = p.DiamondLotteryScore
info := WelfareMgrSington.GetConfig(p.Platform)
if info != nil && info.DiamondLotteryConfig != nil {
for _, data := range info.DiamondLotteryConfig.LotteryData {
if data.Channel == p.Channel {
pack.MaxScore = data.MaxScore
pack.DiamondNum = data.DiamondNum
for _, lotteryInfo := range data.Info {
item := &player_proto.LotteryItem{
Id: lotteryInfo.Id,
ItemId: lotteryInfo.ItemId,
ItemNum: int64(lotteryInfo.Grade),
TypeId: lotteryInfo.Type,
}
pack.Item = append(pack.Item, item)
}
}
}
}
p.SendToClient(int(player_proto.PlayerPacketID_PACKET_SC_DiamondLotteryInfo), pack)
logger.Logger.Trace("返回钻石抽奖信息:", pack.String())
}
return nil
}
type CSDiamondLotteryPacketFactory struct {
}
type CSDiamondLotteryHandler struct {
}
func (this *CSDiamondLotteryPacketFactory) CreatePacket() interface{} {
pack := &player_proto.CSDiamondLottery{}
return pack
}
// 玩家钻石抽奖
func (this *CSDiamondLotteryHandler) Process(s *netlib.Session, packetid int, data interface{}, sid int64) error {
if msg, ok := data.(*player_proto.CSDiamondLottery); ok {
p := PlayerMgrSington.GetPlayer(sid)
if p == nil {
logger.Logger.Warn("CSDiamondLottery p == nil")
return nil
}
// 渠道开关
conf := PlatformMgrSingleton.GetConfig(p.Platform).ChannelSwitch[common.DiamondLottery]
if !model.GameParamData.CloseChannelSwitch && (conf == nil || !common.InSliceString(conf.OnChannelName, p.LastChannel)) {
return nil
}
countType := msg.GetLotteryType()
count := int32(0)
if countType == 1 {
count = 1
} else {
count = 10
}
logger.Logger.Tracef("玩家请求钻石抽奖snid =%d,count = %d ", p.SnId, count)
info := WelfareMgrSington.GetConfig(p.Platform)
var config *webapi.DiamondLotteryData
if info == nil && info.DiamondLotteryConfig != nil {
for _, data := range info.LotteryData {
if data.Channel == p.Channel {
config = data
break
}
}
if config == nil {
logger.Logger.Error("钻石抽奖未找到配置p.Channel = ", p.Channel)
return nil
}
//判断钻石数量
diamondNum := int64(config.DiamondNum * count)
if p.Diamond < diamondNum {
logger.Logger.Trace("钻石抽奖 ,钻石数量不足!")
return nil
}
p.AddDiamond(-diamondNum, 0, common.GainWayDiamondLottery, "sys", "钻石抽奖")
pack := &player_proto.SCDiamondLottery{}
weight := 0
for _, lotteryInfo := range config.Info {
if lotteryInfo.Type == 1 {
weight += int(lotteryInfo.Oddrate)
}
}
var items []*Item
for i := 1; i <= int(count); i++ {
random := rand.Intn(weight) + 1
value := 0
p.DiamondLotteryScore += 1
//判断是否白名单用户
whiteList := config.Players
status := false
var playerData *webapi.DiamondLotteryPlayers
for _, players := range whiteList {
if players.Uid == p.SnId {
playerData = players
break
}
}
if playerData != nil && p.DiamondLotteryScore%int64(playerData.Count) == 0 {
status = true
}
if status {
//白名单从列表里获取奖励
id := rand.Intn(len(playerData.AwatdId)) + 1
awardId := playerData.AwatdId[id]
for _, lotteryInfo := range config.Info {
if lotteryInfo.Id == awardId {
items = append(items, &Item{
ItemId: lotteryInfo.ItemId, // 物品id
ItemNum: int64(lotteryInfo.Grade), // 数量
})
itemData := &player_proto.LotteryItem{
Id: lotteryInfo.Id,
ItemId: lotteryInfo.ItemId,
ItemNum: int64(lotteryInfo.Grade),
}
pack.Item = append(pack.Item, itemData)
break
}
}
} else {
for _, lotteryInfo := range config.Info {
value += int(lotteryInfo.Oddrate)
if lotteryInfo.Type == 1 {
if random <= value {
items = append(items, &Item{
ItemId: lotteryInfo.ItemId, // 物品id
ItemNum: int64(lotteryInfo.Grade), // 数量
})
itemData := &player_proto.LotteryItem{
Id: lotteryInfo.Id,
ItemId: lotteryInfo.ItemId,
ItemNum: int64(lotteryInfo.Grade),
}
pack.Item = append(pack.Item, itemData)
break
}
}
}
}
}
BagMgrSingleton.AddItems(p, items, 0, common.GainWayDiamondLottery, "system", "钻石抽奖", 0, 0, false)
pack.LuckyScore = p.DiamondLotteryScore
p.SendToClient(int(player_proto.PlayerPacketID_PACKET_SC_DiamondLottery), pack)
logger.Logger.Trace("返回钻石抽奖信息:", pack.String())
}
}
return nil
}
// 领取保底奖励
type CSDiamondLotteryLuckyAwardPacketFactory struct {
}
type CSDiamondLotteryLuckyAwardHandler struct {
}
func (this *CSDiamondLotteryLuckyAwardPacketFactory) CreatePacket() interface{} {
pack := &player_proto.CSDiamondLotteryLuckyAward{}
return pack
}
// 玩家钻石抽奖保底奖励
func (this *CSDiamondLotteryLuckyAwardHandler) Process(s *netlib.Session, packetid int, data interface{}, sid int64) error {
if _, ok := data.(*player_proto.CSDiamondLotteryLuckyAward); ok {
p := PlayerMgrSington.GetPlayer(sid)
if p == nil {
logger.Logger.Warn("CSDiamondLotteryLuckyAward p == nil")
return nil
}
// 渠道开关
conf := PlatformMgrSingleton.GetConfig(p.Platform).ChannelSwitch[common.DiamondLottery]
if !model.GameParamData.CloseChannelSwitch && (conf == nil || !common.InSliceString(conf.OnChannelName, p.LastChannel)) {
return nil
}
info := WelfareMgrSington.GetConfig(p.Platform)
var config *webapi.DiamondLotteryData
if info == nil && info.DiamondLotteryConfig != nil {
for _, data := range info.LotteryData {
if data.Channel == p.Channel {
config = data
break
}
}
if config == nil {
logger.Logger.Error("钻石抽奖未找到配置p.Channel = ", p.Channel)
return nil
}
if p.DiamondLotteryScore < int64(config.MaxScore) {
return nil
}
p.DiamondLotteryScore -= int64(config.MaxScore)
pack := &player_proto.SCDiamondLotteryLuckyAward{}
pack.LuckyScore = p.DiamondLotteryScore
//获取奖励
for _, lotteryInfo := range config.Info {
if lotteryInfo.Type == 2 {
var items []*Item
items = append(items, &Item{
ItemId: lotteryInfo.ItemId, // 物品id
ItemNum: int64(lotteryInfo.Grade), // 数量
})
itemData := &player_proto.LotteryItem{
Id: lotteryInfo.Id,
ItemId: lotteryInfo.ItemId,
ItemNum: int64(lotteryInfo.Grade),
}
BagMgrSingleton.AddItems(p, items, 0, common.GainWayDiamondLottery, "system", "钻石抽奖", 0, 0, false)
pack.Item = append(pack.Item, itemData)
break
}
}
p.SendToClient(int(player_proto.PlayerPacketID_PACKET_SCDiamondLotteryLuckyAward), pack)
logger.Logger.Trace("返回钻石抽奖领取保底奖励信息:", pack.String())
}
}
return nil
}
func init() { func init() {
// 抽奖信息 // 抽奖信息
common.RegisterHandler(int(player_proto.PlayerPacketID_PACKET_CS_PhoneLotteryInfo), &CSPhoneLotteryInfoHandler{}) common.RegisterHandler(int(player_proto.PlayerPacketID_PACKET_CS_PhoneLotteryInfo), &CSPhoneLotteryInfoHandler{})
@ -216,4 +464,13 @@ func init() {
// 抽奖 // 抽奖
common.RegisterHandler(int(player_proto.PlayerPacketID_PACKET_CS_PhoneLottery), &CSPhoneLotteryHandler{}) common.RegisterHandler(int(player_proto.PlayerPacketID_PACKET_CS_PhoneLottery), &CSPhoneLotteryHandler{})
netlib.RegisterFactory(int(player_proto.PlayerPacketID_PACKET_CS_PhoneLottery), &CSPhoneLotteryPacketFactory{}) netlib.RegisterFactory(int(player_proto.PlayerPacketID_PACKET_CS_PhoneLottery), &CSPhoneLotteryPacketFactory{})
//钻石抽奖信息
common.RegisterHandler(int(player_proto.PlayerPacketID_PACKET_CS_DiamondLotteryInfo), &CSDiamondLotteryInfoHandler{})
netlib.RegisterFactory(int(player_proto.PlayerPacketID_PACKET_SC_DiamondLotteryInfo), &CSDiamondLotteryInfoPacketFactory{})
// 钻石抽奖
common.RegisterHandler(int(player_proto.PlayerPacketID_PACKET_CS_DiamondLottery), &CSDiamondLotteryHandler{})
netlib.RegisterFactory(int(player_proto.PlayerPacketID_PACKET_CS_DiamondLottery), &CSDiamondLotteryPacketFactory{})
//钻石抽奖保底奖励
common.RegisterHandler(int(player_proto.PlayerPacketID_PACKET_CSDiamondLotteryLuckyAward), &CSDiamondLotteryLuckyAwardHandler{})
netlib.RegisterFactory(int(player_proto.PlayerPacketID_PACKET_CSDiamondLotteryLuckyAward), &CSDiamondLotteryLuckyAwardPacketFactory{})
} }

View File

@ -78,6 +78,8 @@ func init() {
etcd.Register(etcd.ETCDKEY_ACT_Invite, webapi.ActInviteConfig{}, platformConfigEvent) etcd.Register(etcd.ETCDKEY_ACT_Invite, webapi.ActInviteConfig{}, platformConfigEvent)
// 赛季通行证 // 赛季通行证
etcd.Register(etcd.ETCDKEY_ACT_Permit, webapi.ActPermitConfig{}, platformConfigEvent) etcd.Register(etcd.ETCDKEY_ACT_Permit, webapi.ActPermitConfig{}, platformConfigEvent)
// 钻石抽奖
etcd.Register(etcd.ETCDKEY_DIAMOND_LOTTERY, webapi.DiamondLotteryConfig{}, platformConfigEvent)
// 道具列表 // 道具列表
etcd.Register(etcd.ETCDKEY_Item, webapi.ItemConfig{}, platformConfigEvent) etcd.Register(etcd.ETCDKEY_Item, webapi.ItemConfig{}, platformConfigEvent)
} }
@ -209,6 +211,8 @@ func platformConfigEvent(ctx context.Context, completeKey string, isInit bool, e
ChessRankMgrSington.UpdateChessRankConfig(config) ChessRankMgrSington.UpdateChessRankConfig(config)
case *webapi.WelfarePhoneLotteryStatus: case *webapi.WelfarePhoneLotteryStatus:
WelfareMgrSington.UpdatePhoneLotteryStatus(config) WelfareMgrSington.UpdatePhoneLotteryStatus(config)
case *webapi.DiamondLotteryConfig:
WelfareMgrSington.UpdateDiamondLotteryConfig(config)
case *webapi.ActInviteConfig: case *webapi.ActInviteConfig:
PlatformMgrSingleton.GetConfig(config.Platform).ActInviteConfig = config PlatformMgrSingleton.GetConfig(config.Platform).ActInviteConfig = config
case *webapi.ActPermitConfig: case *webapi.ActPermitConfig:

View File

@ -215,6 +215,12 @@ func (this *WelfareMgr) UpdatePhoneLotteryStatus(cfg *webapi_proto.WelfarePhoneL
} }
} }
// 更新钻石抽奖配置
func (this *WelfareMgr) UpdateDiamondLotteryConfig(cfg *webapi_proto.DiamondLotteryConfig) {
info := this.GetConfig(cfg.Platform)
info.DiamondLotteryConfig = cfg
}
func (this *WelfareMgr) GetPhoneLotteryStatus(platform string) int32 { func (this *WelfareMgr) GetPhoneLotteryStatus(platform string) int32 {
info := this.GetConfig(platform) info := this.GetConfig(platform)
if info.WelfarePhoneLotteryStatus != nil { if info.WelfarePhoneLotteryStatus != nil {