竞技馆后台配置

This commit is contained in:
sk 2024-08-24 18:25:03 +08:00
parent 1db62f9d90
commit 7222426469
1 changed files with 64 additions and 30 deletions

View File

@ -98,41 +98,75 @@ func init() {
1: { 1: {
Platform: "1", Platform: "1",
Id: 1, Id: 1,
Name: "话费赛", Name: "{\"zh\":\"话费赛\",\"kh\":\"话费赛\",\"vi\":\"话费赛\",\"en\":\"话费赛\"}",
On: 1, On: 1,
SortId: 1, SortId: 1,
}, },
} 2: {
PlatformMgrSingleton.GetConfig("1").RoomConfig = map[int32]*webapi.RoomConfig{
1: {
Platform: "1", Platform: "1",
Id: 1, Id: 2,
Name: "1元话费赛", Name: "{\"zh\":\"物品赛\",\"kh\":\"物品赛\",\"vi\":\"物品赛\",\"en\":\"物品赛\"}",
RoomType: 1,
On: 1, On: 1,
SortId: 1, SortId: 2,
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: "",
}, },
} }
PlatformMgrSingleton.UpdateRoomConfig(&webapi.RoomConfig{
Platform: "1",
Id: 1,
Name: "{\"zh\":\"1元话费赛\",\"kh\":\"1元话费赛\",\"vi\":\"1元话费赛\",\"en\":\"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: "",
})
PlatformMgrSingleton.UpdateRoomConfig(&webapi.RoomConfig{
Platform: "1",
Id: 1,
Name: "{\"zh\":\"2元话费赛\",\"kh\":\"2元话费赛\",\"vi\":\"2元话费赛\",\"en\":\"2元话费赛\"}",
RoomType: 1,
On: 1,
SortId: 2,
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{}) { func platformConfigEvent(ctx context.Context, completeKey string, isInit bool, event *clientv3.Event, data interface{}) {
@ -542,7 +576,7 @@ func handlerEvent(ctx context.Context, completeKey string, isInit bool, event *c
config := data.(*webapi.RoomConfig) config := data.(*webapi.RoomConfig)
PlatformMgrSingleton.UpdateRoomConfig(config) PlatformMgrSingleton.UpdateRoomConfig(config)
if !isInit { if !isInit {
PlayerMgrSington.BroadcastMessageToPlatform(config.GetPlatform(), int(0), nil) //PlayerMgrSington.BroadcastMessageToPlatform(config.GetPlatform(), int(0), nil)
} }
case clientv3.EventTypeDelete: case clientv3.EventTypeDelete:
if plt == "" || len(param) == 0 { if plt == "" || len(param) == 0 {
@ -550,7 +584,7 @@ func handlerEvent(ctx context.Context, completeKey string, isInit bool, event *c
} }
PlatformMgrSingleton.DelRoomConfig(plt, int32(param[0])) PlatformMgrSingleton.DelRoomConfig(plt, int32(param[0]))
if !isInit { if !isInit {
PlayerMgrSington.BroadcastMessageToPlatform(plt, int(0), nil) //PlayerMgrSington.BroadcastMessageToPlatform(plt, int(0), nil)
} }
} }
default: default: