Compare commits
No commits in common. "67a85f6535f6411a0fccb77e9d034d65943e135c" and "b4bab0de1eea56a93536bfbd9b40984cfed1049c" have entirely different histories.
67a85f6535
...
b4bab0de1e
|
@ -13,6 +13,43 @@ import (
|
|||
"mongo.games.com/game/srvdata"
|
||||
)
|
||||
|
||||
type CSDestroyRoomPacketFactory struct {
|
||||
}
|
||||
type CSDestroyRoomHandler struct {
|
||||
}
|
||||
|
||||
func (this *CSDestroyRoomPacketFactory) CreatePacket() interface{} {
|
||||
pack := &gamehall.CSDestroyRoom{}
|
||||
return pack
|
||||
}
|
||||
|
||||
func (this *CSDestroyRoomHandler) Process(s *netlib.Session, packetid int, data interface{}, sid int64) error {
|
||||
logger.Logger.Trace("CSDestroyRoomHandler Process recv ", data)
|
||||
p := base.PlayerMgrSington.GetPlayer(sid)
|
||||
if p == nil {
|
||||
logger.Logger.Warn("CSDestroyRoomHandler p == nil")
|
||||
return nil
|
||||
}
|
||||
scene := p.GetScene()
|
||||
if scene == nil {
|
||||
logger.Logger.Warn("CSDestroyRoomHandler p.GetScene() == nil")
|
||||
return nil
|
||||
}
|
||||
if !scene.HasPlayer(p) {
|
||||
return nil
|
||||
}
|
||||
if scene.Creator != p.SnId {
|
||||
logger.Logger.Warn("CSDestroyRoomHandler s.creator != p.AccountId")
|
||||
return nil
|
||||
}
|
||||
// 房卡场开始后不能解散
|
||||
if scene.IsCustom() && scene.NumOfGames > 0 {
|
||||
return nil
|
||||
}
|
||||
scene.Destroy(true)
|
||||
return nil
|
||||
}
|
||||
|
||||
type CSLeaveRoomPacketFactory struct {
|
||||
}
|
||||
type CSLeaveRoomHandler struct {
|
||||
|
|
|
@ -148,9 +148,6 @@ func (this *ScenePolicyTienLen) OnPlayerLeave(s *base.Scene, p *base.Player, rea
|
|||
}
|
||||
sceneEx.OnPlayerLeave(p, reason)
|
||||
s.FirePlayerEvent(p, base.PlayerEventLeave, []int64{int64(reason)})
|
||||
if s.IsCustom() && len(s.Players) == 0 {
|
||||
s.Destroy(true)
|
||||
}
|
||||
}
|
||||
|
||||
// 玩家掉线
|
||||
|
@ -606,6 +603,9 @@ func (this *SceneBaseStateTienLen) OnTick(s *base.Scene) {
|
|||
s.RandRobotCnt()
|
||||
s.SetTimerRandomRobot(s.GetRobotTime())
|
||||
}
|
||||
if s.IsCustom() && len(s.Players) == 0 {
|
||||
s.Destroy(true)
|
||||
}
|
||||
}
|
||||
|
||||
// 发送玩家操作情况
|
||||
|
|
|
@ -63,7 +63,6 @@ const (
|
|||
const (
|
||||
ShopTypeCoin = iota + 1 // 金币
|
||||
ShopTypeDiamond // 钻石
|
||||
SHopTypeItem // 道具
|
||||
)
|
||||
|
||||
// 商品参数类型
|
||||
|
@ -1268,45 +1267,26 @@ func (this *ShopMgr) SendAPICreateOrder(p *Player, ConfigPayId int32, data any,
|
|||
//钻石
|
||||
amount[ShopParamDiamond] = bbd.Grade
|
||||
}
|
||||
|
||||
var itemInfo []model.ItemInfo
|
||||
var webItemInfo []*webapi_proto.ItemInfo
|
||||
for _, info := range shopInfo.GetItems() {
|
||||
itemInfo = append(itemInfo, model.ItemInfo{
|
||||
ItemId: info.ItemId,
|
||||
ItemNum: info.ItemNum,
|
||||
})
|
||||
webItemInfo = append(webItemInfo, &webapi_proto.ItemInfo{
|
||||
ItemId: info.ItemId,
|
||||
ItemNum: info.ItemNum,
|
||||
})
|
||||
}
|
||||
|
||||
dbShop = this.NewDbShop(p, 0, amount[:], ShopConsumeMoney, int32(bbd.Price2), common.GainWay_ActBlindBox, itemInfo, 0, "", 0, remark, []int32{bbd.Id})
|
||||
dbShop = this.NewDbShop(p, 0, amount[:], ShopConsumeMoney, int32(bbd.Price2), common.GainWay_ActBlindBox, nil, 0, "", 0, remark, []int32{bbd.Id})
|
||||
err := model.InsertDbShopLog(dbShop)
|
||||
if err != nil {
|
||||
logger.Logger.Errorf("model.InsertDbShopLog err:", err)
|
||||
return nil
|
||||
}
|
||||
return webapi.API_CreateOrder(common.GetAppId(), dbShop.LogId.Hex(), ConfigPayId, p.SnId, 0, p.Platform, p.PackageID, p.DeviceOS,
|
||||
p.DeviceId, bbd.Name, amount, int32(bbd.Price2), webItemInfo, "", p.Channel, p.ChannelId)
|
||||
p.DeviceId, bbd.Name, amount, int32(bbd.Price2), nil, "", p.Channel, p.ChannelId)
|
||||
} else if wfs, ok := data.(*webapi_proto.WelfareSpree); ok {
|
||||
var items []model.ItemInfo
|
||||
var webItemInfo []*webapi_proto.ItemInfo
|
||||
for _, it := range wfs.Item {
|
||||
if it.Type == ShopTypeCoin {
|
||||
if it.Type == 1 {
|
||||
amount[ShopParamCoin] = it.Grade
|
||||
} else if it.Type == ShopTypeDiamond {
|
||||
} else if it.Type == 2 {
|
||||
amount[ShopParamDiamond] = it.Grade
|
||||
} else if it.Type == SHopTypeItem {
|
||||
} else if it.Type == 3 {
|
||||
items = append(items, model.ItemInfo{
|
||||
ItemId: it.Item_Id,
|
||||
ItemNum: int64(it.Grade),
|
||||
})
|
||||
webItemInfo = append(webItemInfo, &webapi_proto.ItemInfo{
|
||||
ItemId: it.GetItem_Id(),
|
||||
ItemNum: int64(it.GetGrade()),
|
||||
})
|
||||
}
|
||||
}
|
||||
var gainWay int32 = common.GainWay_ActFirstPay
|
||||
|
@ -1320,7 +1300,7 @@ func (this *ShopMgr) SendAPICreateOrder(p *Player, ConfigPayId int32, data any,
|
|||
return nil
|
||||
}
|
||||
return webapi.API_CreateOrder(common.GetAppId(), dbShop.LogId.Hex(), ConfigPayId, p.SnId, 0, p.Platform, p.PackageID, p.DeviceOS,
|
||||
p.DeviceId, "FirstRecharge", amount, int32(wfs.Price2), webItemInfo, "", p.Channel, p.ChannelId)
|
||||
p.DeviceId, "FirstRecharge", amount, int32(wfs.Price2), nil, "", p.Channel, p.ChannelId)
|
||||
}
|
||||
return nil
|
||||
}), task.CompleteNotifyWrapper(func(retdata interface{}, t task.Task) {
|
||||
|
|
Loading…
Reference in New Issue