Merge branch 'develop' into release
This commit is contained in:
commit
c5886c22b0
|
@ -792,9 +792,11 @@ const (
|
||||||
var PetIDs = []int32{PetIDChicken}
|
var PetIDs = []int32{PetIDChicken}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
ChannelSwitchExchange = 1
|
ChannelSwitchExchange = 1 // 兑换商城开关
|
||||||
ChannelSwitchDropItem = 2
|
ChannelSwitchDropItem = 2 // v卡掉落开关
|
||||||
DiamondLottery = 4
|
ChannelSwitchInvite = 3 // 邀请开关
|
||||||
|
ChannelSwitchPermit = 4 // 典藏通行证开关
|
||||||
|
ChannelSwitchDiamondLottery = 5 // 钻石抽奖开关
|
||||||
)
|
)
|
||||||
|
|
||||||
// 特殊商品id
|
// 特殊商品id
|
||||||
|
|
|
@ -6202,7 +6202,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.邀请活动开关 4.钻石抽奖
|
Tp int32 `protobuf:"varint,1,opt,name=Tp,proto3" json:"Tp,omitempty"` // 开关类型 1.兑换 2.道具掉落 3.邀请活动开关 4.通行证 5.钻石抽奖
|
||||||
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"` // 开启渠道
|
||||||
}
|
}
|
||||||
|
|
|
@ -691,7 +691,7 @@ message WelfareCollectConfig{
|
||||||
|
|
||||||
// etcd /game/channel/switch
|
// etcd /game/channel/switch
|
||||||
message ChannelSwitchConfig{
|
message ChannelSwitchConfig{
|
||||||
int32 Tp = 1; // 开关类型 1.兑换 2.道具掉落 3.邀请活动开关 4.钻石抽奖
|
int32 Tp = 1; // 开关类型 1.兑换 2.道具掉落 3.邀请活动开关 4.通行证 5.钻石抽奖
|
||||||
string Platform = 2; // 平台id
|
string Platform = 2; // 平台id
|
||||||
repeated string OnChannelName = 3; // 开启渠道
|
repeated string OnChannelName = 3; // 开启渠道
|
||||||
}
|
}
|
||||||
|
|
2
public
2
public
|
@ -1 +1 @@
|
||||||
Subproject commit 867b106a8e8daadf6e7c7ae3b3b0b4bf55da83a9
|
Subproject commit 4206616316ed483d02fc9fc13299c51a278ae53e
|
|
@ -80,7 +80,7 @@ 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
|
||||||
}
|
}
|
||||||
conf := PlatformMgrSingleton.GetConfig(p.Platform).ChannelSwitch[common.DiamondLottery]
|
conf := PlatformMgrSingleton.GetConfig(p.Platform).ChannelSwitch[common.ChannelSwitchDiamondLottery]
|
||||||
if !model.GameParamData.CloseChannelSwitch && (conf == nil || !common.InSliceString(conf.OnChannelName, p.LastChannel)) {
|
if !model.GameParamData.CloseChannelSwitch && (conf == nil || !common.InSliceString(conf.OnChannelName, p.LastChannel)) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -227,7 +227,7 @@ func (this *CSDiamondLotteryInfoHandler) Process(s *netlib.Session, packetid int
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
// 渠道开关
|
// 渠道开关
|
||||||
conf := PlatformMgrSingleton.GetConfig(p.Platform).ChannelSwitch[common.DiamondLottery]
|
conf := PlatformMgrSingleton.GetConfig(p.Platform).ChannelSwitch[common.ChannelSwitchDiamondLottery]
|
||||||
if !model.GameParamData.CloseChannelSwitch && (conf == nil || !common.InSliceString(conf.OnChannelName, p.LastChannel)) {
|
if !model.GameParamData.CloseChannelSwitch && (conf == nil || !common.InSliceString(conf.OnChannelName, p.LastChannel)) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -278,7 +278,7 @@ func (this *CSDiamondLotteryHandler) Process(s *netlib.Session, packetid int, da
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
// 渠道开关
|
// 渠道开关
|
||||||
conf := PlatformMgrSingleton.GetConfig(p.Platform).ChannelSwitch[common.DiamondLottery]
|
conf := PlatformMgrSingleton.GetConfig(p.Platform).ChannelSwitch[common.ChannelSwitchDiamondLottery]
|
||||||
if !model.GameParamData.CloseChannelSwitch && (conf == nil || !common.InSliceString(conf.OnChannelName, p.LastChannel)) {
|
if !model.GameParamData.CloseChannelSwitch && (conf == nil || !common.InSliceString(conf.OnChannelName, p.LastChannel)) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -311,15 +311,14 @@ func (this *CSDiamondLotteryHandler) Process(s *netlib.Session, packetid int, da
|
||||||
}
|
}
|
||||||
p.AddDiamond(-diamondNum, 0, common.GainWayDiamondLottery, "sys", "钻石抽奖")
|
p.AddDiamond(-diamondNum, 0, common.GainWayDiamondLottery, "sys", "钻石抽奖")
|
||||||
pack := &player_proto.SCDiamondLottery{}
|
pack := &player_proto.SCDiamondLottery{}
|
||||||
|
|
||||||
weight := 0
|
|
||||||
for _, lotteryInfo := range config.Info {
|
|
||||||
if lotteryInfo.Type == 1 {
|
|
||||||
weight += int(lotteryInfo.Oddrate)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var items []*Item
|
var items []*Item
|
||||||
for i := 1; i <= int(count); i++ {
|
for i := 1; i <= int(count); i++ {
|
||||||
|
weight := 0
|
||||||
|
for _, lotteryInfo := range config.Info {
|
||||||
|
if lotteryInfo.Type == 1 {
|
||||||
|
weight += int(lotteryInfo.Oddrate)
|
||||||
|
}
|
||||||
|
}
|
||||||
random := rand.Intn(weight) + 1
|
random := rand.Intn(weight) + 1
|
||||||
value := 0
|
value := 0
|
||||||
p.DiamondLotteryScore += 1
|
p.DiamondLotteryScore += 1
|
||||||
|
@ -435,7 +434,7 @@ func (this *CSDiamondLotteryLuckyAwardHandler) Process(s *netlib.Session, packet
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
// 渠道开关
|
// 渠道开关
|
||||||
conf := PlatformMgrSingleton.GetConfig(p.Platform).ChannelSwitch[common.DiamondLottery]
|
conf := PlatformMgrSingleton.GetConfig(p.Platform).ChannelSwitch[common.ChannelSwitchDiamondLottery]
|
||||||
if !model.GameParamData.CloseChannelSwitch && (conf == nil || !common.InSliceString(conf.OnChannelName, p.LastChannel)) {
|
if !model.GameParamData.CloseChannelSwitch && (conf == nil || !common.InSliceString(conf.OnChannelName, p.LastChannel)) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue