Compare commits

...

3 Commits

Author SHA1 Message Date
sk 54a13fe8ae Merge branch 'develop' of git.pogorockgames.com:mango-games/server/game into develop 2024-09-04 15:08:22 +08:00
sk 9c1fed84e9 竞技馆读取后台配置 2024-09-04 14:53:29 +08:00
sk ac86a5e294 删除竞技馆测试配置 2024-09-04 14:21:21 +08:00
2 changed files with 6 additions and 76 deletions

View File

@ -93,80 +93,10 @@ func init() {
etcd.Register(etcd.ETCDKEY_MatchAudience, webapi.MatchAudience{}, handlerEvent) etcd.Register(etcd.ETCDKEY_MatchAudience, webapi.MatchAudience{}, handlerEvent)
// 小精灵配置 // 小精灵配置
etcd.Register(etcd.ETCDKEY_Spirit, webapi.SpiritConfig{}, platformConfigEvent) etcd.Register(etcd.ETCDKEY_Spirit, webapi.SpiritConfig{}, platformConfigEvent)
// 竞技馆房间配置
PlatformMgrSingleton.GetConfig("1").RoomType = map[int32]*webapi.RoomType{ etcd.Register(etcd.ETCDKEY_RoomConfig, webapi.RoomConfig{}, handlerEvent)
1: { // 竞技馆房间类型配置
Platform: "1", etcd.Register(etcd.ETCDKEY_RoomType, webapi.RoomType{}, handlerEvent)
Id: 1,
Name: "{\"zh\":\"话费赛\",\"kh\":\"话费赛\",\"vi\":\"话费赛\",\"en\":\"话费赛\"}",
On: 1,
SortId: 1,
},
2: {
Platform: "1",
Id: 2,
Name: "{\"zh\":\"物品赛\",\"kh\":\"物品赛\",\"vi\":\"物品赛\",\"en\":\"物品赛\"}",
On: 1,
SortId: 2,
},
}
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: 2,
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{}) {

View File

@ -514,8 +514,6 @@ func (this *Scene) lastScene(p *Player) {
} }
func (this *Scene) DelPlayer(p *Player) bool { func (this *Scene) DelPlayer(p *Player) bool {
FirePlayerLeaveScene(p, this)
this.sp.OnPlayerLeave(this, p)
if p.scene != this { if p.scene != this {
roomId := 0 roomId := 0
if p.scene != nil { if p.scene != nil {
@ -556,6 +554,8 @@ func (this *Scene) DelPlayer(p *Player) bool {
if !p.IsRob { if !p.IsRob {
this.lastTime = time.Now() this.lastTime = time.Now()
} }
FirePlayerLeaveScene(p, this)
this.sp.OnPlayerLeave(this, p)
return true return true
} }