diff --git a/etcd/keyconf.go b/etcd/keyconf.go index 1dc4fd5..0f1813b 100644 --- a/etcd/keyconf.go +++ b/etcd/keyconf.go @@ -41,4 +41,6 @@ const ( ETCDKEY_GUIDE = "/game/guide_config" //新手引导配置 ETCDKEY_MatchAudience = "/game/match_audience" //比赛观众 ETCDKEY_Spirit = "/game/spirit" // 小精灵配置 + ETCDKEY_RoomType = "/game/room_type" // 房间类型配置 + ETCDKEY_RoomConfig = "/game/room_config" // 房间配置 ) diff --git a/model/config.go b/model/config.go index f3336f8..e60e6fa 100644 --- a/model/config.go +++ b/model/config.go @@ -1,10 +1,13 @@ package model import ( + "strconv" + + "mongo.games.com/goserver/core/logger" + "mongo.games.com/game/common" "mongo.games.com/game/protocol/shop" "mongo.games.com/game/protocol/webapi" - "strconv" ) /* @@ -138,6 +141,10 @@ type AllConfig struct { MatchAudience map[int32]*webapi.MatchAudience // 比赛观众列表 key: 玩家id // 小精灵配置 *webapi.SpiritConfig + // 房卡场房间类型 + RoomType map[int32]*webapi.RoomType // key: 房间类型id + // 房卡场房间配置 + RoomConfig map[int32]*webapi.RoomConfig // key: 房间配置id } type GlobalConfig struct { @@ -167,6 +174,8 @@ func (cm *ConfigMgr) GetConfig(platform string) *AllConfig { ShopInfos: make(map[int32]*ShopInfo), ChannelSwitch: make(map[int32]*webapi.ChannelSwitchConfig), MatchAudience: make(map[int32]*webapi.MatchAudience), + RoomType: make(map[int32]*webapi.RoomType), + RoomConfig: make(map[int32]*webapi.RoomConfig), } cm.platform[platform] = c } @@ -366,8 +375,9 @@ func (cm *ConfigMgr) AddMatchAudience(d *webapi.MatchAudience) { cfg.MatchAudience[d.GetSnId()] = d } -func (cm *ConfigMgr) DelMatchAudience(d *webapi.MatchAudience) { - delete(cm.GetConfig(d.Platform).MatchAudience, d.GetSnId()) +func (cm *ConfigMgr) DelMatchAudience(plt string, snid int32) { + logger.Logger.Tracef("del match audience plt:%s, snid:%d", plt, snid) + delete(cm.GetConfig(plt).MatchAudience, snid) } // IsMatchAudience 是不是比赛场观众 @@ -375,3 +385,19 @@ func (cm *ConfigMgr) IsMatchAudience(plt string, snId int32) bool { _, ok := cm.GetConfig(plt).MatchAudience[snId] return ok } + +func (cm *ConfigMgr) UpdateRoomType(data *webapi.RoomType) { + cm.GetConfig(data.GetPlatform()).RoomType[data.GetId()] = data +} + +func (cm *ConfigMgr) DelRoomType(plt string, id int32) { + delete(cm.GetConfig(plt).RoomType, id) +} + +func (cm *ConfigMgr) UpdateRoomConfig(data *webapi.RoomConfig) { + cm.GetConfig(data.GetPlatform()).RoomConfig[data.GetId()] = data +} + +func (cm *ConfigMgr) DelRoomConfig(plt string, id int32) { + delete(cm.GetConfig(plt).RoomConfig, id) +} diff --git a/protocol/webapi/common.pb.go b/protocol/webapi/common.pb.go index cecb617..d672d3c 100644 --- a/protocol/webapi/common.pb.go +++ b/protocol/webapi/common.pb.go @@ -8273,6 +8273,254 @@ func (x *SpiritConfig) GetUrl() string { return "" } +// etcd /game/room_type +type RoomType struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Platform string `protobuf:"bytes,1,opt,name=Platform,proto3" json:"Platform,omitempty"` // 平台 + Id int32 `protobuf:"varint,2,opt,name=Id,proto3" json:"Id,omitempty"` // 配置ID + Name string `protobuf:"bytes,3,opt,name=Name,proto3" json:"Name,omitempty"` // 类型名称 + On int32 `protobuf:"varint,4,opt,name=On,proto3" json:"On,omitempty"` // 开关 1开启 2关闭 + SortId int32 `protobuf:"varint,5,opt,name=SortId,proto3" json:"SortId,omitempty"` // 排序ID +} + +func (x *RoomType) Reset() { + *x = RoomType{} + if protoimpl.UnsafeEnabled { + mi := &file_common_proto_msgTypes[88] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RoomType) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RoomType) ProtoMessage() {} + +func (x *RoomType) ProtoReflect() protoreflect.Message { + mi := &file_common_proto_msgTypes[88] + 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 RoomType.ProtoReflect.Descriptor instead. +func (*RoomType) Descriptor() ([]byte, []int) { + return file_common_proto_rawDescGZIP(), []int{88} +} + +func (x *RoomType) GetPlatform() string { + if x != nil { + return x.Platform + } + return "" +} + +func (x *RoomType) GetId() int32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *RoomType) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *RoomType) GetOn() int32 { + if x != nil { + return x.On + } + return 0 +} + +func (x *RoomType) GetSortId() int32 { + if x != nil { + return x.SortId + } + return 0 +} + +// etcd /game/room_config +type RoomConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Platform string `protobuf:"bytes,1,opt,name=Platform,proto3" json:"Platform,omitempty"` // 平台 + Id int32 `protobuf:"varint,2,opt,name=Id,proto3" json:"Id,omitempty"` // 配置id + Name string `protobuf:"bytes,3,opt,name=Name,proto3" json:"Name,omitempty"` // 配置名称 + RoomType int32 `protobuf:"varint,4,opt,name=RoomType,proto3" json:"RoomType,omitempty"` // 房间类型id + On int32 `protobuf:"varint,5,opt,name=On,proto3" json:"On,omitempty"` // 开关 1开启 2关闭 + SortId int32 `protobuf:"varint,6,opt,name=SortId,proto3" json:"SortId,omitempty"` // 排序ID + Cost []*ItemInfo `protobuf:"bytes,7,rep,name=Cost,proto3" json:"Cost,omitempty"` // 进入房间消耗 + Reward []*ItemInfo `protobuf:"bytes,8,rep,name=Reward,proto3" json:"Reward,omitempty"` // 进入房间奖励 + OnChannelName []string `protobuf:"bytes,9,rep,name=OnChannelName,proto3" json:"OnChannelName,omitempty"` // 开启的渠道名称 + GameFreeId []int32 `protobuf:"varint,10,rep,packed,name=GameFreeId,proto3" json:"GameFreeId,omitempty"` // 场次id + Round []int32 `protobuf:"varint,11,rep,packed,name=Round,proto3" json:"Round,omitempty"` // 局数 + PlayerNum []int32 `protobuf:"varint,12,rep,packed,name=PlayerNum,proto3" json:"PlayerNum,omitempty"` // 人数 + NeedPassword int32 `protobuf:"varint,13,opt,name=NeedPassword,proto3" json:"NeedPassword,omitempty"` // 是否需要密码 1是 2否 3自定义 + CostType int32 `protobuf:"varint,14,opt,name=CostType,proto3" json:"CostType,omitempty"` // 消耗类型 1AA 2房主 3自定义 + Voice int32 `protobuf:"varint,15,opt,name=Voice,proto3" json:"Voice,omitempty"` // 是否开启语音 1是 2否 3自定义 + ImageURI string `protobuf:"bytes,16,opt,name=ImageURI,proto3" json:"ImageURI,omitempty"` // 奖励图片 +} + +func (x *RoomConfig) Reset() { + *x = RoomConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_common_proto_msgTypes[89] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RoomConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RoomConfig) ProtoMessage() {} + +func (x *RoomConfig) ProtoReflect() protoreflect.Message { + mi := &file_common_proto_msgTypes[89] + 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 RoomConfig.ProtoReflect.Descriptor instead. +func (*RoomConfig) Descriptor() ([]byte, []int) { + return file_common_proto_rawDescGZIP(), []int{89} +} + +func (x *RoomConfig) GetPlatform() string { + if x != nil { + return x.Platform + } + return "" +} + +func (x *RoomConfig) GetId() int32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *RoomConfig) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *RoomConfig) GetRoomType() int32 { + if x != nil { + return x.RoomType + } + return 0 +} + +func (x *RoomConfig) GetOn() int32 { + if x != nil { + return x.On + } + return 0 +} + +func (x *RoomConfig) GetSortId() int32 { + if x != nil { + return x.SortId + } + return 0 +} + +func (x *RoomConfig) GetCost() []*ItemInfo { + if x != nil { + return x.Cost + } + return nil +} + +func (x *RoomConfig) GetReward() []*ItemInfo { + if x != nil { + return x.Reward + } + return nil +} + +func (x *RoomConfig) GetOnChannelName() []string { + if x != nil { + return x.OnChannelName + } + return nil +} + +func (x *RoomConfig) GetGameFreeId() []int32 { + if x != nil { + return x.GameFreeId + } + return nil +} + +func (x *RoomConfig) GetRound() []int32 { + if x != nil { + return x.Round + } + return nil +} + +func (x *RoomConfig) GetPlayerNum() []int32 { + if x != nil { + return x.PlayerNum + } + return nil +} + +func (x *RoomConfig) GetNeedPassword() int32 { + if x != nil { + return x.NeedPassword + } + return 0 +} + +func (x *RoomConfig) GetCostType() int32 { + if x != nil { + return x.CostType + } + return 0 +} + +func (x *RoomConfig) GetVoice() int32 { + if x != nil { + return x.Voice + } + return 0 +} + +func (x *RoomConfig) GetImageURI() string { + if x != nil { + return x.ImageURI + } + return "" +} + var File_common_proto protoreflect.FileDescriptor var file_common_proto_rawDesc = []byte{ @@ -9569,10 +9817,46 @@ var file_common_proto_rawDesc = []byte{ 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, 0x0e, 0x0a, 0x02, 0x4f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x4f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x55, 0x72, 0x6c, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x55, 0x72, 0x6c, 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, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x55, 0x72, 0x6c, 0x22, 0x72, 0x0a, 0x08, 0x52, 0x6f, + 0x6f, 0x6d, 0x54, 0x79, 0x70, 0x65, 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, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, + 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x4f, 0x6e, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x02, 0x4f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x6f, 0x72, 0x74, 0x49, 0x64, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x53, 0x6f, 0x72, 0x74, 0x49, 0x64, 0x22, 0xcc, + 0x03, 0x0a, 0x0a, 0x52, 0x6f, 0x6f, 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, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, + 0x08, 0x52, 0x6f, 0x6f, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x08, 0x52, 0x6f, 0x6f, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x4f, 0x6e, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x4f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x6f, 0x72, + 0x74, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x53, 0x6f, 0x72, 0x74, 0x49, + 0x64, 0x12, 0x24, 0x0a, 0x04, 0x43, 0x6f, 0x73, 0x74, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x10, 0x2e, 0x77, 0x65, 0x62, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x04, 0x43, 0x6f, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x06, 0x52, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x77, 0x65, 0x62, 0x61, 0x70, 0x69, + 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x52, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x12, 0x24, 0x0a, 0x0d, 0x4f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4e, 0x61, + 0x6d, 0x65, 0x18, 0x09, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x4f, 0x6e, 0x43, 0x68, 0x61, 0x6e, + 0x6e, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x47, 0x61, 0x6d, 0x65, 0x46, + 0x72, 0x65, 0x65, 0x49, 0x64, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x05, 0x52, 0x0a, 0x47, 0x61, 0x6d, + 0x65, 0x46, 0x72, 0x65, 0x65, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x52, 0x6f, 0x75, 0x6e, 0x64, + 0x18, 0x0b, 0x20, 0x03, 0x28, 0x05, 0x52, 0x05, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x1c, 0x0a, + 0x09, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x05, + 0x52, 0x09, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x12, 0x22, 0x0a, 0x0c, 0x4e, + 0x65, 0x65, 0x64, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x0c, 0x4e, 0x65, 0x65, 0x64, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, + 0x1a, 0x0a, 0x08, 0x43, 0x6f, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x08, 0x43, 0x6f, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x56, + 0x6f, 0x69, 0x63, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x56, 0x6f, 0x69, 0x63, + 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x55, 0x52, 0x49, 0x18, 0x10, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x55, 0x52, 0x49, 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 ( @@ -9587,7 +9871,7 @@ func file_common_proto_rawDescGZIP() []byte { return file_common_proto_rawDescData } -var file_common_proto_msgTypes = make([]protoimpl.MessageInfo, 98) +var file_common_proto_msgTypes = make([]protoimpl.MessageInfo, 100) var file_common_proto_goTypes = []interface{}{ (*MysqlDbSetting)(nil), // 0: webapi.MysqlDbSetting (*MongoDbSetting)(nil), // 1: webapi.MongoDbSetting @@ -9677,105 +9961,109 @@ var file_common_proto_goTypes = []interface{}{ (*GuideConfig)(nil), // 85: webapi.GuideConfig (*MatchAudience)(nil), // 86: webapi.MatchAudience (*SpiritConfig)(nil), // 87: webapi.SpiritConfig - nil, // 88: webapi.Platform.BindTelRewardEntry - nil, // 89: webapi.PlayerData.RankScoreEntry - nil, // 90: webapi.ItemShop.AwardEntry - nil, // 91: webapi.VIPcfg.AwardEntry - nil, // 92: webapi.VIPcfg.Privilege1Entry - nil, // 93: webapi.VIPcfg.Privilege7Entry - nil, // 94: webapi.VIPcfg.Privilege9Entry - nil, // 95: webapi.ActInviteConfig.PayScoreEntry - nil, // 96: webapi.SkinLevel.UpItemEntry - nil, // 97: webapi.SkinItem.UnlockParamEntry - (*server.DB_GameFree)(nil), // 98: server.DB_GameFree - (*server.DB_GameItem)(nil), // 99: server.DB_GameItem + (*RoomType)(nil), // 88: webapi.RoomType + (*RoomConfig)(nil), // 89: webapi.RoomConfig + nil, // 90: webapi.Platform.BindTelRewardEntry + nil, // 91: webapi.PlayerData.RankScoreEntry + nil, // 92: webapi.ItemShop.AwardEntry + nil, // 93: webapi.VIPcfg.AwardEntry + nil, // 94: webapi.VIPcfg.Privilege1Entry + nil, // 95: webapi.VIPcfg.Privilege7Entry + nil, // 96: webapi.VIPcfg.Privilege9Entry + nil, // 97: webapi.ActInviteConfig.PayScoreEntry + nil, // 98: webapi.SkinLevel.UpItemEntry + nil, // 99: webapi.SkinItem.UnlockParamEntry + (*server.DB_GameFree)(nil), // 100: server.DB_GameFree + (*server.DB_GameItem)(nil), // 101: server.DB_GameItem } var file_common_proto_depIdxs = []int32{ - 2, // 0: webapi.Platform.Leaderboard:type_name -> webapi.RankSwitch - 3, // 1: webapi.Platform.ClubConfig:type_name -> webapi.ClubConfig - 4, // 2: webapi.Platform.ThirdGameMerchant:type_name -> webapi.ThirdGame - 88, // 3: webapi.Platform.BindTelReward:type_name -> webapi.Platform.BindTelRewardEntry - 6, // 4: webapi.GameConfigGlobal.GameStatus:type_name -> webapi.GameStatus - 98, // 5: webapi.GameFree.DbGameFree:type_name -> server.DB_GameFree - 8, // 6: webapi.PlatformGameConfig.DbGameFrees:type_name -> webapi.GameFree - 0, // 7: webapi.PlatformDbConfig.Mysql:type_name -> webapi.MysqlDbSetting - 1, // 8: webapi.PlatformDbConfig.MongoDb:type_name -> webapi.MongoDbSetting - 1, // 9: webapi.PlatformDbConfig.MongoDbLog:type_name -> webapi.MongoDbSetting - 98, // 10: webapi.GameConfigGroup.DbGameFree:type_name -> server.DB_GameFree - 89, // 11: webapi.PlayerData.RankScore:type_name -> webapi.PlayerData.RankScoreEntry - 32, // 12: webapi.PlayerData.Items:type_name -> webapi.ItemInfo - 14, // 13: webapi.PlayerData.RoleUnlockList:type_name -> webapi.ModInfo - 14, // 14: webapi.PlayerData.PetUnlockList:type_name -> webapi.ModInfo - 14, // 15: webapi.PlayerData.PetSkillUnlockList:type_name -> webapi.ModInfo - 14, // 16: webapi.PlayerData.SkinUnlockList:type_name -> webapi.ModInfo - 21, // 17: webapi.OnlineReport.GameCount:type_name -> webapi.OnlineGameCnt - 23, // 18: webapi.CommonNoticeList.List:type_name -> webapi.CommonNotice - 27, // 19: webapi.ExchangeShop.ExType:type_name -> webapi.ExchangeType - 26, // 20: webapi.ExchangeShop.TelData:type_name -> webapi.TelChargeData - 32, // 21: webapi.ExchangeShop.Items:type_name -> webapi.ItemInfo - 25, // 22: webapi.ExchangeShopList.List:type_name -> webapi.ExchangeShop - 29, // 23: webapi.ExchangeShopList.Weight:type_name -> webapi.ShopWeight - 90, // 24: webapi.ItemShop.Award:type_name -> webapi.ItemShop.AwardEntry - 30, // 25: webapi.ItemShopList.List:type_name -> webapi.ItemShop - 32, // 26: webapi.MatchInfoAward.ItemId:type_name -> webapi.ItemInfo - 33, // 27: webapi.GameMatchDate.Award:type_name -> webapi.MatchInfoAward - 32, // 28: webapi.GameMatchDate.SignupCostItem:type_name -> webapi.ItemInfo - 34, // 29: webapi.GameMatchDateList.List:type_name -> webapi.GameMatchDate - 36, // 30: webapi.GameMatchType.List:type_name -> webapi.MatchTypeInfo - 38, // 31: webapi.WelfareTurnplateDate.Date:type_name -> webapi.WelfareDate - 39, // 32: webapi.WelfareTurnplateDateList.List:type_name -> webapi.WelfareTurnplateDate - 40, // 33: webapi.WelfareTurnplateDateList.RateList:type_name -> webapi.WelfareTurnplateRate - 38, // 34: webapi.AddUpWelfareDate.AddUpDate:type_name -> webapi.WelfareDate - 38, // 35: webapi.Welfare7SignDate.Date:type_name -> webapi.WelfareDate - 42, // 36: webapi.Welfare7SignDate.AddUpDate:type_name -> webapi.AddUpWelfareDate - 42, // 37: webapi.Welfare7SignDate.AddUpDate2:type_name -> webapi.AddUpWelfareDate - 42, // 38: webapi.Welfare7SignDate.AddUpDate2Google:type_name -> webapi.AddUpWelfareDate - 43, // 39: webapi.Welfare7SignDate.AddUpDate2Type:type_name -> webapi.AddUpDate2TypeData - 44, // 40: webapi.Welfare7SignDateList.List:type_name -> webapi.Welfare7SignDate - 46, // 41: webapi.WelfareBlindBoxDataList.List:type_name -> webapi.BlindBoxData - 38, // 42: webapi.WelfareSpree.Item:type_name -> webapi.WelfareDate - 48, // 43: webapi.WelfareFirstPayDataList.List:type_name -> webapi.WelfareSpree - 48, // 44: webapi.WelfareContinuousPayDataList.List:type_name -> webapi.WelfareSpree - 91, // 45: webapi.VIPcfg.Award:type_name -> webapi.VIPcfg.AwardEntry - 92, // 46: webapi.VIPcfg.Privilege1:type_name -> webapi.VIPcfg.Privilege1Entry - 93, // 47: webapi.VIPcfg.Privilege7:type_name -> webapi.VIPcfg.Privilege7Entry - 94, // 48: webapi.VIPcfg.Privilege9:type_name -> webapi.VIPcfg.Privilege9Entry - 51, // 49: webapi.VIPcfgDataList.List:type_name -> webapi.VIPcfg - 38, // 50: webapi.ChessRankConfig.Item:type_name -> webapi.WelfareDate - 55, // 51: webapi.ChessRankcfgData.Datas:type_name -> webapi.ChessRankConfig - 95, // 52: webapi.ActInviteConfig.PayScore:type_name -> webapi.ActInviteConfig.PayScoreEntry - 62, // 53: webapi.ActInviteConfig.Awards1:type_name -> webapi.RankAward - 62, // 54: webapi.ActInviteConfig.Awards2:type_name -> webapi.RankAward - 62, // 55: webapi.ActInviteConfig.Awards3:type_name -> webapi.RankAward - 32, // 56: webapi.PermitLevelConfig.Award1:type_name -> webapi.ItemInfo - 32, // 57: webapi.PermitLevelConfig.Award2:type_name -> webapi.ItemInfo - 32, // 58: webapi.PermitExchangeConfig.Gain:type_name -> webapi.ItemInfo - 32, // 59: webapi.PermitExchangeConfig.Cost:type_name -> webapi.ItemInfo - 32, // 60: webapi.PermitRankConfig.ItemId:type_name -> webapi.ItemInfo - 64, // 61: webapi.PermitChannelConfig.LevelConfig:type_name -> webapi.PermitLevelConfig - 65, // 62: webapi.PermitChannelConfig.ExchangeConfig:type_name -> webapi.PermitExchangeConfig - 66, // 63: webapi.PermitChannelConfig.RankConfig:type_name -> webapi.PermitRankConfig - 67, // 64: webapi.ActPermitConfig.Configs:type_name -> webapi.PermitChannelConfig - 71, // 65: webapi.DiamondLotteryPlayers.Award:type_name -> webapi.AwardData - 69, // 66: webapi.DiamondLotteryData.Info:type_name -> webapi.DiamondLotteryInfo - 70, // 67: webapi.DiamondLotteryData.Players:type_name -> webapi.DiamondLotteryPlayers - 72, // 68: webapi.DiamondLotteryConfig.LotteryData:type_name -> webapi.DiamondLotteryData - 99, // 69: webapi.ItemConfig.Items:type_name -> server.DB_GameItem - 32, // 70: webapi.RankAwardInfo.Item:type_name -> webapi.ItemInfo - 75, // 71: webapi.RankTypeInfo.Award:type_name -> webapi.RankAwardInfo - 76, // 72: webapi.RankTypeConfig.Info:type_name -> webapi.RankTypeInfo - 96, // 73: webapi.SkinLevel.UpItem:type_name -> webapi.SkinLevel.UpItemEntry - 97, // 74: webapi.SkinItem.UnlockParam:type_name -> webapi.SkinItem.UnlockParamEntry - 78, // 75: webapi.SkinItem.Levels:type_name -> webapi.SkinLevel - 79, // 76: webapi.SkinConfig.Items:type_name -> webapi.SkinItem - 82, // 77: webapi.AwardLogConfig.AwardLog:type_name -> webapi.AwardLogData - 84, // 78: webapi.AwardLogConfig.AnnouncerLog:type_name -> webapi.AnnouncerLogInfo - 83, // 79: webapi.AwardLogData.AwardLog:type_name -> webapi.AwardLogInfo - 80, // [80:80] is the sub-list for method output_type - 80, // [80:80] is the sub-list for method input_type - 80, // [80:80] is the sub-list for extension type_name - 80, // [80:80] is the sub-list for extension extendee - 0, // [0:80] is the sub-list for field type_name + 2, // 0: webapi.Platform.Leaderboard:type_name -> webapi.RankSwitch + 3, // 1: webapi.Platform.ClubConfig:type_name -> webapi.ClubConfig + 4, // 2: webapi.Platform.ThirdGameMerchant:type_name -> webapi.ThirdGame + 90, // 3: webapi.Platform.BindTelReward:type_name -> webapi.Platform.BindTelRewardEntry + 6, // 4: webapi.GameConfigGlobal.GameStatus:type_name -> webapi.GameStatus + 100, // 5: webapi.GameFree.DbGameFree:type_name -> server.DB_GameFree + 8, // 6: webapi.PlatformGameConfig.DbGameFrees:type_name -> webapi.GameFree + 0, // 7: webapi.PlatformDbConfig.Mysql:type_name -> webapi.MysqlDbSetting + 1, // 8: webapi.PlatformDbConfig.MongoDb:type_name -> webapi.MongoDbSetting + 1, // 9: webapi.PlatformDbConfig.MongoDbLog:type_name -> webapi.MongoDbSetting + 100, // 10: webapi.GameConfigGroup.DbGameFree:type_name -> server.DB_GameFree + 91, // 11: webapi.PlayerData.RankScore:type_name -> webapi.PlayerData.RankScoreEntry + 32, // 12: webapi.PlayerData.Items:type_name -> webapi.ItemInfo + 14, // 13: webapi.PlayerData.RoleUnlockList:type_name -> webapi.ModInfo + 14, // 14: webapi.PlayerData.PetUnlockList:type_name -> webapi.ModInfo + 14, // 15: webapi.PlayerData.PetSkillUnlockList:type_name -> webapi.ModInfo + 14, // 16: webapi.PlayerData.SkinUnlockList:type_name -> webapi.ModInfo + 21, // 17: webapi.OnlineReport.GameCount:type_name -> webapi.OnlineGameCnt + 23, // 18: webapi.CommonNoticeList.List:type_name -> webapi.CommonNotice + 27, // 19: webapi.ExchangeShop.ExType:type_name -> webapi.ExchangeType + 26, // 20: webapi.ExchangeShop.TelData:type_name -> webapi.TelChargeData + 32, // 21: webapi.ExchangeShop.Items:type_name -> webapi.ItemInfo + 25, // 22: webapi.ExchangeShopList.List:type_name -> webapi.ExchangeShop + 29, // 23: webapi.ExchangeShopList.Weight:type_name -> webapi.ShopWeight + 92, // 24: webapi.ItemShop.Award:type_name -> webapi.ItemShop.AwardEntry + 30, // 25: webapi.ItemShopList.List:type_name -> webapi.ItemShop + 32, // 26: webapi.MatchInfoAward.ItemId:type_name -> webapi.ItemInfo + 33, // 27: webapi.GameMatchDate.Award:type_name -> webapi.MatchInfoAward + 32, // 28: webapi.GameMatchDate.SignupCostItem:type_name -> webapi.ItemInfo + 34, // 29: webapi.GameMatchDateList.List:type_name -> webapi.GameMatchDate + 36, // 30: webapi.GameMatchType.List:type_name -> webapi.MatchTypeInfo + 38, // 31: webapi.WelfareTurnplateDate.Date:type_name -> webapi.WelfareDate + 39, // 32: webapi.WelfareTurnplateDateList.List:type_name -> webapi.WelfareTurnplateDate + 40, // 33: webapi.WelfareTurnplateDateList.RateList:type_name -> webapi.WelfareTurnplateRate + 38, // 34: webapi.AddUpWelfareDate.AddUpDate:type_name -> webapi.WelfareDate + 38, // 35: webapi.Welfare7SignDate.Date:type_name -> webapi.WelfareDate + 42, // 36: webapi.Welfare7SignDate.AddUpDate:type_name -> webapi.AddUpWelfareDate + 42, // 37: webapi.Welfare7SignDate.AddUpDate2:type_name -> webapi.AddUpWelfareDate + 42, // 38: webapi.Welfare7SignDate.AddUpDate2Google:type_name -> webapi.AddUpWelfareDate + 43, // 39: webapi.Welfare7SignDate.AddUpDate2Type:type_name -> webapi.AddUpDate2TypeData + 44, // 40: webapi.Welfare7SignDateList.List:type_name -> webapi.Welfare7SignDate + 46, // 41: webapi.WelfareBlindBoxDataList.List:type_name -> webapi.BlindBoxData + 38, // 42: webapi.WelfareSpree.Item:type_name -> webapi.WelfareDate + 48, // 43: webapi.WelfareFirstPayDataList.List:type_name -> webapi.WelfareSpree + 48, // 44: webapi.WelfareContinuousPayDataList.List:type_name -> webapi.WelfareSpree + 93, // 45: webapi.VIPcfg.Award:type_name -> webapi.VIPcfg.AwardEntry + 94, // 46: webapi.VIPcfg.Privilege1:type_name -> webapi.VIPcfg.Privilege1Entry + 95, // 47: webapi.VIPcfg.Privilege7:type_name -> webapi.VIPcfg.Privilege7Entry + 96, // 48: webapi.VIPcfg.Privilege9:type_name -> webapi.VIPcfg.Privilege9Entry + 51, // 49: webapi.VIPcfgDataList.List:type_name -> webapi.VIPcfg + 38, // 50: webapi.ChessRankConfig.Item:type_name -> webapi.WelfareDate + 55, // 51: webapi.ChessRankcfgData.Datas:type_name -> webapi.ChessRankConfig + 97, // 52: webapi.ActInviteConfig.PayScore:type_name -> webapi.ActInviteConfig.PayScoreEntry + 62, // 53: webapi.ActInviteConfig.Awards1:type_name -> webapi.RankAward + 62, // 54: webapi.ActInviteConfig.Awards2:type_name -> webapi.RankAward + 62, // 55: webapi.ActInviteConfig.Awards3:type_name -> webapi.RankAward + 32, // 56: webapi.PermitLevelConfig.Award1:type_name -> webapi.ItemInfo + 32, // 57: webapi.PermitLevelConfig.Award2:type_name -> webapi.ItemInfo + 32, // 58: webapi.PermitExchangeConfig.Gain:type_name -> webapi.ItemInfo + 32, // 59: webapi.PermitExchangeConfig.Cost:type_name -> webapi.ItemInfo + 32, // 60: webapi.PermitRankConfig.ItemId:type_name -> webapi.ItemInfo + 64, // 61: webapi.PermitChannelConfig.LevelConfig:type_name -> webapi.PermitLevelConfig + 65, // 62: webapi.PermitChannelConfig.ExchangeConfig:type_name -> webapi.PermitExchangeConfig + 66, // 63: webapi.PermitChannelConfig.RankConfig:type_name -> webapi.PermitRankConfig + 67, // 64: webapi.ActPermitConfig.Configs:type_name -> webapi.PermitChannelConfig + 71, // 65: webapi.DiamondLotteryPlayers.Award:type_name -> webapi.AwardData + 69, // 66: webapi.DiamondLotteryData.Info:type_name -> webapi.DiamondLotteryInfo + 70, // 67: webapi.DiamondLotteryData.Players:type_name -> webapi.DiamondLotteryPlayers + 72, // 68: webapi.DiamondLotteryConfig.LotteryData:type_name -> webapi.DiamondLotteryData + 101, // 69: webapi.ItemConfig.Items:type_name -> server.DB_GameItem + 32, // 70: webapi.RankAwardInfo.Item:type_name -> webapi.ItemInfo + 75, // 71: webapi.RankTypeInfo.Award:type_name -> webapi.RankAwardInfo + 76, // 72: webapi.RankTypeConfig.Info:type_name -> webapi.RankTypeInfo + 98, // 73: webapi.SkinLevel.UpItem:type_name -> webapi.SkinLevel.UpItemEntry + 99, // 74: webapi.SkinItem.UnlockParam:type_name -> webapi.SkinItem.UnlockParamEntry + 78, // 75: webapi.SkinItem.Levels:type_name -> webapi.SkinLevel + 79, // 76: webapi.SkinConfig.Items:type_name -> webapi.SkinItem + 82, // 77: webapi.AwardLogConfig.AwardLog:type_name -> webapi.AwardLogData + 84, // 78: webapi.AwardLogConfig.AnnouncerLog:type_name -> webapi.AnnouncerLogInfo + 83, // 79: webapi.AwardLogData.AwardLog:type_name -> webapi.AwardLogInfo + 32, // 80: webapi.RoomConfig.Cost:type_name -> webapi.ItemInfo + 32, // 81: webapi.RoomConfig.Reward:type_name -> webapi.ItemInfo + 82, // [82:82] is the sub-list for method output_type + 82, // [82:82] is the sub-list for method input_type + 82, // [82:82] is the sub-list for extension type_name + 82, // [82:82] is the sub-list for extension extendee + 0, // [0:82] is the sub-list for field type_name } func init() { file_common_proto_init() } @@ -10840,6 +11128,30 @@ func file_common_proto_init() { return nil } } + file_common_proto_msgTypes[88].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RoomType); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_proto_msgTypes[89].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RoomConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -10847,7 +11159,7 @@ func file_common_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_common_proto_rawDesc, NumEnums: 0, - NumMessages: 98, + NumMessages: 100, NumExtensions: 0, NumServices: 0, }, diff --git a/protocol/webapi/common.proto b/protocol/webapi/common.proto index 77e0520..f02ef15 100644 --- a/protocol/webapi/common.proto +++ b/protocol/webapi/common.proto @@ -904,4 +904,33 @@ message SpiritConfig { string Platform = 1; // 平台 int32 On = 2; // 精灵开关 1开启 2关闭 string Url = 3; +} + +// etcd /game/room_type +message RoomType { + string Platform = 1; // 平台 + int32 Id = 2; // 配置ID + string Name = 3; // 类型名称 + int32 On = 4; // 开关 1开启 2关闭 + int32 SortId = 5; // 排序ID +} + +// etcd /game/room_config +message RoomConfig { + string Platform = 1; // 平台 + int32 Id = 2; // 配置id + string Name = 3; // 配置名称 + int32 RoomType = 4; // 房间类型id + int32 On = 5; // 开关 1开启 2关闭 + int32 SortId = 6; // 排序ID + repeated ItemInfo Cost = 7; // 进入房间消耗 + repeated ItemInfo Reward = 8; // 进入房间奖励 + repeated string OnChannelName = 9; // 开启的渠道名称 + repeated int32 GameFreeId = 10; // 场次id + repeated int32 Round = 11; // 局数 + repeated int32 PlayerNum = 12; // 人数 + int32 NeedPassword = 13; // 是否需要密码 1是 2否 3自定义 + int32 CostType = 14; // 消耗类型 1AA 2房主 3自定义 + int32 Voice = 15; // 是否开启语音 1是 2否 3自定义 + string ImageURI = 16; // 奖励图片 } \ No newline at end of file diff --git a/worldsrv/etcd.go b/worldsrv/etcd.go index ba725f7..5eadcbc 100644 --- a/worldsrv/etcd.go +++ b/worldsrv/etcd.go @@ -56,7 +56,7 @@ func init() { // 代理 etcd.Register(etcd.ETCDKEY_PROMOTER_PREFIX, PromoterConfig{}, handlerEvent) // 赠送 - etcd.Register(etcd.ETCDKEY_ACT_GIVE_PREFIX, PromoterConfig{}, handlerEvent) + etcd.Register(etcd.ETCDKEY_ACT_GIVE_PREFIX, ActGivePlateformConfig{}, handlerEvent) // 7日签到 etcd.Register(etcd.ETCDKEY_ACT_7SIGN, webapi.Welfare7SignDateList{}, platformConfigEvent) // 转盘 @@ -93,6 +93,46 @@ func init() { etcd.Register(etcd.ETCDKEY_MatchAudience, webapi.MatchAudience{}, handlerEvent) // 小精灵配置 etcd.Register(etcd.ETCDKEY_Spirit, webapi.SpiritConfig{}, platformConfigEvent) + + PlatformMgrSingleton.GetConfig("1").RoomType = map[int32]*webapi.RoomType{ + 1: { + Platform: "1", + Id: 1, + Name: "话费赛", + On: 1, + SortId: 1, + }, + } + PlatformMgrSingleton.GetConfig("1").RoomConfig = map[int32]*webapi.RoomConfig{ + 1: { + Platform: "1", + Id: 1, + Name: "1元话费赛", + RoomType: 1, + On: 1, + SortId: 1, + Cost: []*webapi.ItemInfo{ + { + ItemId: 100001, + ItemNum: 12, + }, + }, + Reward: []*webapi.ItemInfo{ + { + ItemId: 100001, + ItemNum: 12, + }, + }, + OnChannelName: []string{common.ChannelOfficial, common.ChannelWeb, common.ChannelGooglePlay}, + GameFreeId: []int32{2150001, 2160001, 2170001, 2180001}, + Round: []int32{1, 2, 3, 4}, + PlayerNum: []int32{2, 3, 4}, + NeedPassword: 3, + CostType: 3, + Voice: 3, + ImageURI: "", + }, + } } func platformConfigEvent(ctx context.Context, completeKey string, isInit bool, event *clientv3.Event, data interface{}) { @@ -331,12 +371,43 @@ func platformConfigEvent(ctx context.Context, completeKey string, isInit bool, e } func handlerEvent(ctx context.Context, completeKey string, isInit bool, event *clientv3.Event, data interface{}) { - if data == nil { - return + var plt string + var param []int + equalFunc := func(key string) bool { + plt = "" + param = param[:0] + if strings.HasPrefix(completeKey, key) { + arr := strings.Split(strings.TrimPrefix(completeKey, key), "/") + for k, v := range arr { + if v == "" { + continue + } + if len(v) > 0 { + plt = v + for _, v := range arr[k+1:] { + n, err := strconv.Atoi(v) + if err != nil { + continue + } + param = append(param, n) + } + return true + } + } + } + return false } - switch config := data.(type) { - case *BlackInfoApi: + + switch { + case equalFunc(etcd.ETCDKEY_BLACKLIST_PREFIX): + var config *BlackInfoApi + if data != nil { + config = data.(*BlackInfoApi) + } if isInit { + if config == nil { + return + } BlackListMgrSington.InitBlackInfo(config) } else { switch event.Type { @@ -353,6 +424,9 @@ func handlerEvent(ctx context.Context, completeKey string, isInit bool, event *c } } case clientv3.EventTypePut: + if config == nil { + return + } BlackListMgrSington.UpsertBlackInfo(config) if (config.Space & int32(BlackState_Login)) != 0 { var targetPlayer []*Player //确定用户是否在线 @@ -372,8 +446,16 @@ func handlerEvent(ctx context.Context, completeKey string, isInit bool, event *c } } } - case *PromoterConfig: + + case equalFunc(etcd.ETCDKEY_PROMOTER_PREFIX): + var config *PromoterConfig + if data != nil { + config = data.(*PromoterConfig) + } if isInit { + if config == nil { + return + } PromoterMgrSington.AddConfig(config) } else { switch event.Type { @@ -385,16 +467,32 @@ func handlerEvent(ctx context.Context, completeKey string, isInit bool, event *c PromoterMgrSington.RemoveConfigByKey(promoterConfig) } case clientv3.EventTypePut: + if config == nil { + return + } PromoterMgrSington.AddConfig(config) } } - case *ActGivePlateformConfig: + + case equalFunc(etcd.ETCDKEY_ACT_GIVE_PREFIX): + var config *ActGivePlateformConfig + if data != nil { + config = data.(*ActGivePlateformConfig) + } + if config == nil { + return + } if isInit || event.Type == clientv3.EventTypePut { ActMgrSington.AddGiveConfig(config, config.Platform) } - case *webapi.MatchAudience: + + case equalFunc(etcd.ETCDKEY_MatchAudience): switch event.Type { case clientv3.EventTypePut: + if data == nil { + return + } + config := data.(*webapi.MatchAudience) PlatformMgrSingleton.AddMatchAudience(config) if !isInit { p := PlayerMgrSington.GetPlayerBySnId(config.GetSnId()) @@ -403,15 +501,58 @@ func handlerEvent(ctx context.Context, completeKey string, isInit bool, event *c } } case clientv3.EventTypeDelete: - PlatformMgrSingleton.DelMatchAudience(config) + if plt == "" || len(param) == 0 { + return + } + PlatformMgrSingleton.DelMatchAudience(plt, int32(param[0])) if !isInit { - p := PlayerMgrSington.GetPlayerBySnId(config.GetSnId()) + p := PlayerMgrSington.GetPlayerBySnId(int32(param[0])) if p != nil { p.SCDataConfig(common.DataConfigMatchAudience) } } } + case equalFunc(etcd.ETCDKEY_RoomType): + switch event.Type { + case clientv3.EventTypePut: + if data == nil { + return + } + config := data.(*webapi.RoomType) + PlatformMgrSingleton.UpdateRoomType(config) + if !isInit { + PlayerMgrSington.BroadcastMessageToPlatform(config.GetPlatform(), int(0), nil) + } + case clientv3.EventTypeDelete: + if plt == "" || len(param) == 0 { + return + } + PlatformMgrSingleton.DelRoomType(plt, int32(param[0])) + if !isInit { + PlayerMgrSington.BroadcastMessageToPlatform(plt, int(0), nil) + } + } + case equalFunc(etcd.ETCDKEY_RoomConfig): + switch event.Type { + case clientv3.EventTypePut: + if data == nil { + return + } + config := data.(*webapi.RoomConfig) + PlatformMgrSingleton.UpdateRoomConfig(config) + if !isInit { + PlayerMgrSington.BroadcastMessageToPlatform(config.GetPlatform(), int(0), nil) + } + case clientv3.EventTypeDelete: + if plt == "" || len(param) == 0 { + return + } + PlatformMgrSingleton.DelRoomConfig(plt, int32(param[0])) + if !isInit { + PlayerMgrSington.BroadcastMessageToPlatform(plt, int(0), nil) + } + } default: logger.Logger.Errorf("etcd completeKey:%s, Not processed", completeKey) }