Compare commits

..

No commits in common. "267c0492f6ce39e4888708e6ccd82ebbc947a295" and "62bacfb0d2bdd0988ee283356121ce39dc9d42e8" have entirely different histories.

18 changed files with 81 additions and 131 deletions

View File

@ -796,8 +796,3 @@ var PetIDs = []int32{PetIDChicken}
const ( const (
InviteScoreRecharge = 10000 // 用户每充值$1邀请人获得积分 InviteScoreRecharge = 10000 // 用户每充值$1邀请人获得积分
) )
const (
ChannelSwitchExchange = 1
ChannelSwitchDropItem = 2
)

View File

@ -1,5 +1,5 @@
6с├т├уж├в"║█ю└= 6ж├в├с├т├у├"║█ю└=
.؆Ù†Ú†Û†"¡<>À„= .؆Ù†Ú†Û†"¡<>À„=
Wс├т├в├ь├ы├з├у├ж├ш" ║█─╜Б Wы├з├ш├с├у├в├ь├т├ж" ║█─╜Б
]с├у├ж├в├ь├ы├ш├т├з├э"╒█Т ]у├ж├ш├ы├з├э├с├т├в├ь"╒█Т

Binary file not shown.

View File

@ -53,5 +53,5 @@ 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_EXCHANGECHANNEL = "/game/exchange/channel" // 开启兑换功能的渠道
) )

View File

@ -163,7 +163,6 @@ func init() {
p.LastSyncCoin = p.Coin p.LastSyncCoin = p.Coin
p.IsQM = IsQM p.IsQM = IsQM
p.AppChannel = msg.GetAppChannel()
if sid == 0 && (scene != nil && !scene.IsMatchScene()) { if sid == 0 && (scene != nil && !scene.IsMatchScene()) {
logger.Logger.Warnf("when WGPlayerEnter (sid == 0)") logger.Logger.Warnf("when WGPlayerEnter (sid == 0)")
@ -307,7 +306,6 @@ func init() {
p.SetTakeCoin(msg.GetTakeCoin()) p.SetTakeCoin(msg.GetTakeCoin())
p.LastSyncCoin = p.Coin p.LastSyncCoin = p.Coin
p.IsQM = IsQM p.IsQM = IsQM
p.AppChannel = msg.GetAppChannel()
if scene != nil { if scene != nil {
scene.AudienceEnter(p, isload) scene.AudienceEnter(p, isload)
if !p.IsRobot() && !scene.Testing { if !p.IsRobot() && !scene.Testing {

View File

@ -20,8 +20,6 @@ func init() {
etcd.Register(etcd.ETCDKEY_GAME_CONFIG, webapi.GameConfig{}, platformConfigEtcd) etcd.Register(etcd.ETCDKEY_GAME_CONFIG, webapi.GameConfig{}, platformConfigEtcd)
// 集卡活动 // 集卡活动
etcd.Register(etcd.ETCDKEY_ACT_Collect, webapi.WelfareCollectConfig{}, platformConfigEtcd) etcd.Register(etcd.ETCDKEY_ACT_Collect, webapi.WelfareCollectConfig{}, platformConfigEtcd)
// 渠道开关
etcd.Register(etcd.ETCDKEY_ChannelSwitch, webapi.ChannelSwitchConfig{}, platformConfigEtcd)
} }
func platformConfigEtcd(ctx context.Context, completeKey string, isInit bool, event *clientv3.Event, data interface{}) { func platformConfigEtcd(ctx context.Context, completeKey string, isInit bool, event *clientv3.Event, data interface{}) {
@ -35,8 +33,6 @@ func platformConfigEtcd(ctx context.Context, completeKey string, isInit bool, ev
ConfigMgrInst.GetConfig(d.Platform).GameConfig = d ConfigMgrInst.GetConfig(d.Platform).GameConfig = d
case *webapi.WelfareCollectConfig: case *webapi.WelfareCollectConfig:
ConfigMgrInst.GetConfig(d.Platform).WelfareCollectConfig = d ConfigMgrInst.GetConfig(d.Platform).WelfareCollectConfig = d
case *webapi.ChannelSwitchConfig:
ConfigMgrInst.GetConfig(d.Platform).ChannelSwitch[d.GetTp()] = d
default: default:
logger.Logger.Errorf("etcd completeKey:%s, Not processed", completeKey) logger.Logger.Errorf("etcd completeKey:%s, Not processed", completeKey)
} }

View File

@ -122,7 +122,6 @@ type Player struct {
MatchRobotGrades []MatchRobotGrade MatchRobotGrades []MatchRobotGrade
TestLog []string // 调试日志 TestLog []string // 调试日志
RankScore map[int32]int64 // 段位积分 RankScore map[int32]int64 // 段位积分
AppChannel string // app渠道(玩家本次登录使用的包的渠道类型,换登录包,这个值也会变;玩家model.PlayerData存储的渠道是玩家第一次登录的渠道不会修改)
} }
type MatchRobotGrade struct { type MatchRobotGrade struct {

View File

@ -2119,13 +2119,6 @@ func (this *Scene) TryBillExGameDrop(p *Player) {
if baseScore == 0 { if baseScore == 0 {
return return
} }
// 渠道开关
conf := ConfigMgrInst.GetConfig(p.Platform).ChannelSwitch[common.ChannelSwitchDropItem]
if conf == nil || !common.InSliceString(conf.OnChannelName, p.AppChannel) {
return
}
dropInfo := srvdata.GameDropMgrSingleton.GetDropInfoByBaseScore(int32(this.GameId), baseScore) dropInfo := srvdata.GameDropMgrSingleton.GetDropInfoByBaseScore(int32(this.GameId), baseScore)
if dropInfo != nil && len(dropInfo) != 0 && p.Items != nil { if dropInfo != nil && len(dropInfo) != 0 && p.Items != nil {
realDrop := make(map[int32]int32) realDrop := make(map[int32]int32)

View File

@ -115,8 +115,8 @@ type AllConfig struct {
*webapi.ExchangeShopList *webapi.ExchangeShopList
// 商店 // 商店
ShopInfos map[int32]*ShopInfo // 商品id:商品信息 ShopInfos map[int32]*ShopInfo // 商品id:商品信息
// 渠道开关 // 开启兑换的渠道
ChannelSwitch map[int32]*webapi.ChannelSwitchConfig *webapi.ExchangeChannelConfig
} }
type GlobalConfig struct { type GlobalConfig struct {
@ -143,7 +143,6 @@ func (cm *ConfigMgr) GetConfig(platform string) *AllConfig {
c = &AllConfig{ c = &AllConfig{
// todo 初始化默认值 // todo 初始化默认值
ShopInfos: make(map[int32]*ShopInfo), ShopInfos: make(map[int32]*ShopInfo),
ChannelSwitch: make(map[int32]*webapi.ChannelSwitchConfig),
} }
cm.platform[platform] = c cm.platform[platform] = c
} }

View File

@ -1304,7 +1304,6 @@ type WGPlayerEnter struct {
Items map[int32]int64 `protobuf:"bytes,17,rep,name=Items,proto3" json:"Items,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` Items map[int32]int64 `protobuf:"bytes,17,rep,name=Items,proto3" json:"Items,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
MatchParams []int32 `protobuf:"varint,18,rep,packed,name=MatchParams,proto3" json:"MatchParams,omitempty"` //比赛参数 MatchParams []int32 `protobuf:"varint,18,rep,packed,name=MatchParams,proto3" json:"MatchParams,omitempty"` //比赛参数
RankScore map[int32]int64 `protobuf:"bytes,19,rep,name=RankScore,proto3" json:"RankScore,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // 排位积分 RankScore map[int32]int64 `protobuf:"bytes,19,rep,name=RankScore,proto3" json:"RankScore,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // 排位积分
AppChannel string `protobuf:"bytes,20,opt,name=AppChannel,proto3" json:"AppChannel,omitempty"` // 包渠道
} }
func (x *WGPlayerEnter) Reset() { func (x *WGPlayerEnter) Reset() {
@ -1472,13 +1471,6 @@ func (x *WGPlayerEnter) GetRankScore() map[int32]int64 {
return nil return nil
} }
func (x *WGPlayerEnter) GetAppChannel() string {
if x != nil {
return x.AppChannel
}
return ""
}
//从观众席坐到座位 //从观众席坐到座位
//PACKET_WG_AUDIENCESIT //PACKET_WG_AUDIENCESIT
type WGAudienceSit struct { type WGAudienceSit struct {
@ -8711,7 +8703,7 @@ var file_server_proto_rawDesc = []byte{
0x52, 0x0c, 0x52, 0x65, 0x62, 0x61, 0x74, 0x65, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x12, 0x24, 0x52, 0x0c, 0x52, 0x65, 0x62, 0x61, 0x74, 0x65, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x12, 0x24,
0x0a, 0x0d, 0x52, 0x65, 0x62, 0x61, 0x74, 0x65, 0x47, 0x61, 0x6d, 0x65, 0x43, 0x66, 0x67, 0x18, 0x0a, 0x0d, 0x52, 0x65, 0x62, 0x61, 0x74, 0x65, 0x47, 0x61, 0x6d, 0x65, 0x43, 0x66, 0x67, 0x18,
0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x52, 0x65, 0x62, 0x61, 0x74, 0x65, 0x47, 0x61, 0x6d, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x52, 0x65, 0x62, 0x61, 0x74, 0x65, 0x47, 0x61, 0x6d,
0x65, 0x43, 0x66, 0x67, 0x22, 0xc3, 0x06, 0x0a, 0x0d, 0x57, 0x47, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x65, 0x43, 0x66, 0x67, 0x22, 0xa3, 0x06, 0x0a, 0x0d, 0x57, 0x47, 0x50, 0x6c, 0x61, 0x79, 0x65,
0x72, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x53, 0x69, 0x64, 0x18, 0x01, 0x20, 0x72, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x53, 0x69, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x03, 0x52, 0x03, 0x53, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x47, 0x61, 0x74, 0x65, 0x01, 0x28, 0x03, 0x52, 0x03, 0x53, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x47, 0x61, 0x74, 0x65,
0x53, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x47, 0x61, 0x74, 0x65, 0x53, 0x53, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x47, 0x61, 0x74, 0x65, 0x53,
@ -8754,9 +8746,7 @@ var file_server_proto_rawDesc = []byte{
0x0b, 0x32, 0x24, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x57, 0x47, 0x50, 0x6c, 0x61, 0x0b, 0x32, 0x24, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x57, 0x47, 0x50, 0x6c, 0x61,
0x79, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x52, 0x61, 0x6e, 0x6b, 0x53, 0x63, 0x6f, 0x79, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x52, 0x61, 0x6e, 0x6b, 0x53, 0x63, 0x6f,
0x72, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, 0x52, 0x61, 0x6e, 0x6b, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, 0x52, 0x61, 0x6e, 0x6b, 0x53, 0x63, 0x6f,
0x72, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x41, 0x70, 0x70, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x72, 0x65, 0x1a, 0x38, 0x0a, 0x0a, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79,
0x18, 0x14, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x41, 0x70, 0x70, 0x43, 0x68, 0x61, 0x6e, 0x6e,
0x65, 0x6c, 0x1a, 0x38, 0x0a, 0x0a, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79,
0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b,
0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
0x03, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3c, 0x0a, 0x0e, 0x03, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3c, 0x0a, 0x0e,

View File

@ -228,7 +228,6 @@ message WGPlayerEnter {
map<int32, int64> Items = 17; map<int32, int64> Items = 17;
repeated int32 MatchParams = 18;// repeated int32 MatchParams = 18;//
map<int32, int64> RankScore = 19;// map<int32, int64> RankScore = 19;//
string AppChannel = 20; //
} }
// //

View File

@ -5709,19 +5709,18 @@ func (x *WelfareCollectConfig) GetSwitch() int32 {
return 0 return 0
} }
// etcd /game/channel/switch // etcd /game/exchange/channel
type ChannelSwitchConfig struct { type ExchangeChannelConfig struct {
state protoimpl.MessageState state protoimpl.MessageState
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.道具掉落 Platform string `protobuf:"bytes,1,opt,name=Platform,proto3" json:"Platform,omitempty"`
Platform string `protobuf:"bytes,2,opt,name=Platform,proto3" json:"Platform,omitempty"` // 平台id OnChannelName []string `protobuf:"bytes,2,rep,name=OnChannelName,proto3" json:"OnChannelName,omitempty"` // 开启渠道
OnChannelName []string `protobuf:"bytes,3,rep,name=OnChannelName,proto3" json:"OnChannelName,omitempty"` // 开启渠道
} }
func (x *ChannelSwitchConfig) Reset() { func (x *ExchangeChannelConfig) Reset() {
*x = ChannelSwitchConfig{} *x = ExchangeChannelConfig{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_common_proto_msgTypes[55] mi := &file_common_proto_msgTypes[55]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -5729,13 +5728,13 @@ func (x *ChannelSwitchConfig) Reset() {
} }
} }
func (x *ChannelSwitchConfig) String() string { func (x *ExchangeChannelConfig) String() string {
return protoimpl.X.MessageStringOf(x) return protoimpl.X.MessageStringOf(x)
} }
func (*ChannelSwitchConfig) ProtoMessage() {} func (*ExchangeChannelConfig) ProtoMessage() {}
func (x *ChannelSwitchConfig) ProtoReflect() protoreflect.Message { func (x *ExchangeChannelConfig) ProtoReflect() protoreflect.Message {
mi := &file_common_proto_msgTypes[55] mi := &file_common_proto_msgTypes[55]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -5747,26 +5746,19 @@ func (x *ChannelSwitchConfig) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x) return mi.MessageOf(x)
} }
// Deprecated: Use ChannelSwitchConfig.ProtoReflect.Descriptor instead. // Deprecated: Use ExchangeChannelConfig.ProtoReflect.Descriptor instead.
func (*ChannelSwitchConfig) Descriptor() ([]byte, []int) { func (*ExchangeChannelConfig) Descriptor() ([]byte, []int) {
return file_common_proto_rawDescGZIP(), []int{55} return file_common_proto_rawDescGZIP(), []int{55}
} }
func (x *ChannelSwitchConfig) GetTp() int32 { func (x *ExchangeChannelConfig) GetPlatform() string {
if x != nil {
return x.Tp
}
return 0
}
func (x *ChannelSwitchConfig) GetPlatform() string {
if x != nil { if x != nil {
return x.Platform return x.Platform
} }
return "" return ""
} }
func (x *ChannelSwitchConfig) GetOnChannelName() []string { func (x *ExchangeChannelConfig) GetOnChannelName() []string {
if x != nil { if x != nil {
return x.OnChannelName return x.OnChannelName
} }
@ -6702,16 +6694,15 @@ var file_common_proto_rawDesc = []byte{
0x12, 0x1a, 0x0a, 0x08, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, 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, 0x16, 0x0a, 0x06, 0x28, 0x09, 0x52, 0x08, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x16, 0x0a, 0x06,
0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x53, 0x77, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x53, 0x77,
0x69, 0x74, 0x63, 0x68, 0x22, 0x67, 0x0a, 0x13, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x53, 0x69, 0x74, 0x63, 0x68, 0x22, 0x59, 0x0a, 0x15, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65,
0x77, 0x69, 0x74, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x54, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1a, 0x0a,
0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x54, 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x50, 0x08, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x50, 0x08, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x24, 0x0a, 0x0d, 0x4f, 0x6e, 0x43,
0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x24, 0x0a, 0x0d, 0x4f, 0x6e, 0x43, 0x68, 0x61, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09,
0x6e, 0x6e, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x52, 0x0d, 0x4f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x42,
0x4f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x42, 0x26, 0x5a, 0x26, 0x5a, 0x24, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x2e, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x2e, 0x63,
0x24, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x2e, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6f, 0x6d, 0x2f, 0x67, 0x61, 0x6d, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c,
0x2f, 0x67, 0x61, 0x6d, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x77, 0x2f, 0x77, 0x65, 0x62, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x65, 0x62, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
@ -6783,7 +6774,7 @@ var file_common_proto_goTypes = []interface{}{
(*GameConfig)(nil), // 52: webapi.GameConfig (*GameConfig)(nil), // 52: webapi.GameConfig
(*WelfarePhoneLotteryStatus)(nil), // 53: webapi.WelfarePhoneLotteryStatus (*WelfarePhoneLotteryStatus)(nil), // 53: webapi.WelfarePhoneLotteryStatus
(*WelfareCollectConfig)(nil), // 54: webapi.WelfareCollectConfig (*WelfareCollectConfig)(nil), // 54: webapi.WelfareCollectConfig
(*ChannelSwitchConfig)(nil), // 55: webapi.ChannelSwitchConfig (*ExchangeChannelConfig)(nil), // 55: webapi.ExchangeChannelConfig
nil, // 56: webapi.Platform.BindTelRewardEntry nil, // 56: webapi.Platform.BindTelRewardEntry
nil, // 57: webapi.PlayerData.RankScoreEntry nil, // 57: webapi.PlayerData.RankScoreEntry
nil, // 58: webapi.ItemShop.AwardEntry nil, // 58: webapi.ItemShop.AwardEntry
@ -7504,7 +7495,7 @@ func file_common_proto_init() {
} }
} }
file_common_proto_msgTypes[55].Exporter = func(v interface{}, i int) interface{} { file_common_proto_msgTypes[55].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ChannelSwitchConfig); i { switch v := v.(*ExchangeChannelConfig); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:

View File

@ -634,9 +634,8 @@ message WelfareCollectConfig{
int32 Switch = 2; // 1. 2. int32 Switch = 2; // 1. 2.
} }
// etcd /game/channel/switch // etcd /game/exchange/channel
message ChannelSwitchConfig{ message ExchangeChannelConfig{
int32 Tp = 1; // 1. 2. string Platform = 1;
string Platform = 2; // id repeated string OnChannelName = 2; //
repeated string OnChannelName = 3; //
} }

View File

@ -2240,7 +2240,7 @@ func CSExchangeChannel(s *netlib.Session, packetid int, data interface{}, sid in
} }
var onChannelName []string var onChannelName []string
conf := PlatformMgrSingleton.GetConfig(p.Platform).ChannelSwitch[common.ChannelSwitchExchange] conf := PlatformMgrSingleton.GetConfig(p.Platform).ExchangeChannelConfig
if conf != nil { if conf != nil {
onChannelName = conf.OnChannelName onChannelName = conf.OnChannelName
} }

View File

@ -267,19 +267,10 @@ func (this *CSShopExchangePacketFactory) CreatePacket() interface{} {
func (this *CSShopExchangeHandler) Process(s *netlib.Session, packetid int, data interface{}, sid int64) error { func (this *CSShopExchangeHandler) Process(s *netlib.Session, packetid int, data interface{}, sid int64) error {
logger.Logger.Trace("CSShopExchangeHandler Process recv ", data) logger.Logger.Trace("CSShopExchangeHandler Process recv ", data)
msg, ok := data.(*shop.CSShopExchange) if msg, ok := data.(*shop.CSShopExchange); ok {
if !ok { ExchangeType := msg.ExchangeType
return nil
}
p := PlayerMgrSington.GetPlayer(sid) p := PlayerMgrSington.GetPlayer(sid)
if p == nil { if ExchangeType == 1 {
logger.Logger.Warn("CSShopExchangeHandler p == nil")
return nil
}
switch msg.ExchangeType {
case 1: // 自提
//自提 直接增加道具到背包 //自提 直接增加道具到背包
cdata := ShopMgrSington.GetExchangeData(p.Platform, msg.GoodsId) cdata := ShopMgrSington.GetExchangeData(p.Platform, msg.GoodsId)
if cdata == nil || cdata.ItemId == 0 { if cdata == nil || cdata.ItemId == 0 {
@ -293,7 +284,12 @@ func (this *CSShopExchangeHandler) Process(s *netlib.Session, packetid int, data
ObtainTime: time.Now().Unix(), ObtainTime: time.Now().Unix(),
}) })
BagMgrSingleton.AddJybBagInfo(p, items, 0, common.GainWay_Exchange, "system", "商城兑换") BagMgrSingleton.AddJybBagInfo(p, items, 0, common.GainWay_Exchange, "system", "商城兑换")
default: } else {
if p == nil {
logger.Logger.Warn("CSShopExchangeHandler p == nil")
return nil
}
_, f := BlackListMgrSington.CheckExchange(p.PlayerData) _, f := BlackListMgrSington.CheckExchange(p.PlayerData)
if !f { if !f {
pack := &shop.SCShopExchange{ pack := &shop.SCShopExchange{
@ -307,6 +303,7 @@ func (this *CSShopExchangeHandler) Process(s *netlib.Session, packetid int, data
} }
ShopMgrSington.Exchange(p, msg.GoodsId, msg.UserName, msg.Mobile, msg.Comment, msg.Id, msg.Amount) ShopMgrSington.Exchange(p, msg.GoodsId, msg.UserName, msg.Mobile, msg.Comment, msg.Id, msg.Amount)
} }
}
return nil return nil
} }

View File

@ -7,7 +7,6 @@ import (
"go.etcd.io/etcd/client/v3" "go.etcd.io/etcd/client/v3"
"mongo.games.com/goserver/core/logger" "mongo.games.com/goserver/core/logger"
"mongo.games.com/game/common"
"mongo.games.com/game/etcd" "mongo.games.com/game/etcd"
hallproto "mongo.games.com/game/protocol/gamehall" hallproto "mongo.games.com/game/protocol/gamehall"
"mongo.games.com/game/protocol/webapi" "mongo.games.com/game/protocol/webapi"
@ -36,8 +35,8 @@ func init() {
etcd.Register(etcd.ETCDKEY_SHOP_ITEM, webapi.ItemShopList{}, platformConfigEvent) etcd.Register(etcd.ETCDKEY_SHOP_ITEM, webapi.ItemShopList{}, platformConfigEvent)
// 集卡活动 // 集卡活动
etcd.Register(etcd.ETCDKEY_ACT_Collect, webapi.WelfareCollectConfig{}, platformConfigEvent) etcd.Register(etcd.ETCDKEY_ACT_Collect, webapi.WelfareCollectConfig{}, platformConfigEvent)
// 渠道开关 // 启动兑换功能的渠道
etcd.Register(etcd.ETCDKEY_ChannelSwitch, webapi.ChannelSwitchConfig{}, platformConfigEvent) etcd.Register(etcd.ETCDKEY_EXCHANGECHANNEL, webapi.ExchangeChannelConfig{}, platformConfigEvent)
} }
func platformConfigEvent(ctx context.Context, completeKey string, isInit bool, event *clientv3.Event, data interface{}) { func platformConfigEvent(ctx context.Context, completeKey string, isInit bool, event *clientv3.Event, data interface{}) {
@ -128,19 +127,15 @@ func platformConfigEvent(ctx context.Context, completeKey string, isInit bool, e
} else { } else {
TournamentMgr.UpdateData(false, config) TournamentMgr.UpdateData(false, config)
} }
case *webapi.ChannelSwitchConfig: case *webapi.ExchangeChannelConfig:
PlatformMgrSingleton.GetConfig(config.Platform).ChannelSwitch[config.GetTp()] = config PlatformMgrSingleton.GetConfig(config.Platform).ExchangeChannelConfig = config
if !isInit { if !isInit {
switch config.GetTp() {
case common.ChannelSwitchExchange:
// 通知变更 // 通知变更
for _, v := range PlayerMgrSington.playerOfPlatform[config.Platform] { for _, v := range PlayerMgrSington.playerOfPlatform[config.Platform] {
if v != nil && v.IsOnLine() { if v != nil && v.IsOnLine() {
v.SendToClient(int(hallproto.GameHallPacketID_PACKET_SCExchangeChannel), &hallproto.SCExchangeChannel{}) v.SendToClient(int(hallproto.GameHallPacketID_PACKET_SCExchangeChannel), &hallproto.SCExchangeChannel{})
} }
} }
}
} }
default: default:

View File

@ -490,7 +490,6 @@ func (this *Scene) PlayerEnter(p *Player, pos int, ischangeroom bool) bool {
IParams: p.MarshalIParam(), IParams: p.MarshalIParam(),
SParams: p.MarshalSParam(), SParams: p.MarshalSParam(),
CParams: p.MarshalCParam(), CParams: p.MarshalCParam(),
AppChannel: p.AppChannel,
} }
//sa, err2 := p.MarshalSingleAdjustData(this.dbGameFree.Id) //sa, err2 := p.MarshalSingleAdjustData(this.dbGameFree.Id)
//if err2 == nil && sa != nil { //if err2 == nil && sa != nil {
@ -700,7 +699,6 @@ func (this *Scene) AudienceEnter(p *Player, ischangeroom bool) bool {
IParams: p.MarshalIParam(), IParams: p.MarshalIParam(),
SParams: p.MarshalSParam(), SParams: p.MarshalSParam(),
CParams: p.MarshalCParam(), CParams: p.MarshalCParam(),
AppChannel: p.AppChannel,
} }
if !p.IsRob { //保存下进入时的环境 if !p.IsRob { //保存下进入时的环境

View File

@ -103,6 +103,7 @@ type ExchangeShopInfo struct {
ExchangeTypeId int32 //兑换类型的id ExchangeTypeId int32 //兑换类型的id
ExchangeNum int32 //兑换数量 ExchangeNum int32 //兑换数量
ItemId int32 //转换道具id ItemId int32 //转换道具id
} }
func (this *ShopMgr) ModuleName() string { func (this *ShopMgr) ModuleName() string {