This commit is contained in:
by 2024-09-12 09:00:38 +08:00
commit d365e9be6a
8 changed files with 66 additions and 56 deletions

View File

@ -9,6 +9,7 @@ import (
"mongo.games.com/game/etcd" "mongo.games.com/game/etcd"
"mongo.games.com/game/model" "mongo.games.com/game/model"
"mongo.games.com/game/protocol/webapi" "mongo.games.com/game/protocol/webapi"
"mongo.games.com/game/srvdata"
) )
var ConfigMgrInst = model.NewConfigMgr() var ConfigMgrInst = model.NewConfigMgr()
@ -18,6 +19,8 @@ func init() {
etcd.Register(etcd.ETCDKEY_PLAYERPOOL, webapi.PlayerPool{}, platformConfigEtcd) etcd.Register(etcd.ETCDKEY_PLAYERPOOL, webapi.PlayerPool{}, platformConfigEtcd)
// 游戏配置 // 游戏配置
etcd.Register(etcd.ETCDKEY_GAME_CONFIG, webapi.GameConfig{}, platformConfigEtcd) etcd.Register(etcd.ETCDKEY_GAME_CONFIG, webapi.GameConfig{}, platformConfigEtcd)
// 道具列表
etcd.Register(etcd.ETCDKEY_Item, webapi.ItemConfig{}, platformConfigEtcd)
// 集卡活动 // 集卡活动
etcd.Register(etcd.ETCDKEY_ACT_Collect, webapi.WelfareCollectConfig{}, platformConfigEtcd) etcd.Register(etcd.ETCDKEY_ACT_Collect, webapi.WelfareCollectConfig{}, platformConfigEtcd)
// 渠道开关 // 渠道开关
@ -45,6 +48,9 @@ func platformConfigEtcd(ctx context.Context, completeKey string, isInit bool, ev
ConfigMgrInst.GetConfig(d.Platform).SkinConfig = d ConfigMgrInst.GetConfig(d.Platform).SkinConfig = d
case *webapi.MachineConfig: case *webapi.MachineConfig:
ConfigMgrInst.GetConfig(d.Platform).MachineConfig = d ConfigMgrInst.GetConfig(d.Platform).MachineConfig = d
case *webapi.ItemConfig:
ConfigMgrInst.GetConfig(d.Platform).ItemConfig = d
srvdata.GameItemMgr.SetConfig(d)
default: default:
logger.Logger.Errorf("etcd completeKey:%s, Not processed", completeKey) logger.Logger.Errorf("etcd completeKey:%s, Not processed", completeKey)
} }

View File

@ -1964,7 +1964,7 @@ func (this *TienLenSceneData) TrySmallGameBilled() {
score = int64(this.roundScore) * int64(baseScore) / 100 //百分比 score = int64(this.roundScore) * int64(baseScore) / 100 //百分比
} }
losePlayerCoin := losePlayer.GetCoin() losePlayerCoin := losePlayer.GetCoin()
if !this.IsMatchScene() && losePlayerCoin < score { //输完 if !this.IsMatchScene() && !this.IsCustom() && losePlayerCoin < score { //输完
score = losePlayerCoin score = losePlayerCoin
} }
//判断宠物技能生不生效 //判断宠物技能生不生效
@ -1983,7 +1983,7 @@ func (this *TienLenSceneData) TrySmallGameBilled() {
gainScore := int64(float64(score) * float64(10000-taxRate) / 10000.0) //税后 gainScore := int64(float64(score) * float64(10000-taxRate) / 10000.0) //税后
bombTaxScore := score - gainScore bombTaxScore := score - gainScore
// win // win
if this.IsMatchScene() { if this.IsMatchScene() || this.IsCustom() {
winPlayer.AddCoinNoLog(gainScore, 0) winPlayer.AddCoinNoLog(gainScore, 0)
} else { } else {
winPlayer.AddCoin(gainScore, common.GainWay_CoinSceneWin, 0, "system", this.GetSceneName()) winPlayer.AddCoin(gainScore, common.GainWay_CoinSceneWin, 0, "system", this.GetSceneName())
@ -1997,7 +1997,7 @@ func (this *TienLenSceneData) TrySmallGameBilled() {
winPlayer.bombRankScore += rankScore * rule.RankBaseScore winPlayer.bombRankScore += rankScore * rule.RankBaseScore
} }
//lose //lose
if this.IsMatchScene() { if this.IsMatchScene() && this.IsCustom() {
losePlayer.AddCoinNoLog(-score, 0) losePlayer.AddCoinNoLog(-score, 0)
} else { } else {
losePlayer.AddCoin(-score, common.GainWay_CoinSceneLost, 0, "system", this.GetSceneName()) losePlayer.AddCoin(-score, common.GainWay_CoinSceneLost, 0, "system", this.GetSceneName())

View File

@ -47,6 +47,7 @@ const (
OpResultCode_OPRC_InviteFriend_PosIsError OpResultCode = 1019 //座位不存在 OpResultCode_OPRC_InviteFriend_PosIsError OpResultCode = 1019 //座位不存在
OpResultCode_OPRC_InviteFriend_HadInRoom OpResultCode = 1020 //已在房间中 OpResultCode_OPRC_InviteFriend_HadInRoom OpResultCode = 1020 //已在房间中
OpResultCode_OPRC_Friend_NotOpMyself OpResultCode = 1021 //不能操作自己 OpResultCode_OPRC_Friend_NotOpMyself OpResultCode = 1021 //不能操作自己
OpResultCode_OPRC_InviteFriend_CostNotEnough OpResultCode = 1022 // 房卡不足
) )
// Enum value maps for OpResultCode. // Enum value maps for OpResultCode.
@ -75,6 +76,7 @@ var (
1019: "OPRC_InviteFriend_PosIsError", 1019: "OPRC_InviteFriend_PosIsError",
1020: "OPRC_InviteFriend_HadInRoom", 1020: "OPRC_InviteFriend_HadInRoom",
1021: "OPRC_Friend_NotOpMyself", 1021: "OPRC_Friend_NotOpMyself",
1022: "OPRC_InviteFriend_CostNotEnough",
} }
OpResultCode_value = map[string]int32{ OpResultCode_value = map[string]int32{
"OPRC_Sucess": 0, "OPRC_Sucess": 0,
@ -100,6 +102,7 @@ var (
"OPRC_InviteFriend_PosIsError": 1019, "OPRC_InviteFriend_PosIsError": 1019,
"OPRC_InviteFriend_HadInRoom": 1020, "OPRC_InviteFriend_HadInRoom": 1020,
"OPRC_Friend_NotOpMyself": 1021, "OPRC_Friend_NotOpMyself": 1021,
"OPRC_InviteFriend_CostNotEnough": 1022,
} }
) )
@ -1726,7 +1729,7 @@ var file_friend_proto_rawDesc = []byte{
0x72, 0x69, 0x65, 0x6e, 0x64, 0x12, 0x2a, 0x0a, 0x10, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x12, 0x2a, 0x0a, 0x10, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x41, 0x64, 0x64, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x52, 0x41, 0x64, 0x64, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x52,
0x10, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x41, 0x64, 0x64, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x10, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x41, 0x64, 0x64, 0x46, 0x72, 0x69, 0x65, 0x6e,
0x64, 0x2a, 0xf3, 0x05, 0x0a, 0x0c, 0x4f, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x64, 0x2a, 0x99, 0x06, 0x0a, 0x0c, 0x4f, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f,
0x64, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x53, 0x75, 0x63, 0x65, 0x73, 0x64, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x53, 0x75, 0x63, 0x65, 0x73,
0x73, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x45, 0x72, 0x72, 0x6f, 0x73, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x45, 0x72, 0x72, 0x6f,
0x72, 0x10, 0x01, 0x12, 0x19, 0x0a, 0x14, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x46, 0x72, 0x69, 0x65, 0x72, 0x10, 0x01, 0x12, 0x19, 0x0a, 0x14, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x46, 0x72, 0x69, 0x65,
@ -1773,41 +1776,43 @@ var file_friend_proto_rawDesc = []byte{
0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x5f, 0x48, 0x61, 0x64, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x5f, 0x48, 0x61, 0x64,
0x49, 0x6e, 0x52, 0x6f, 0x6f, 0x6d, 0x10, 0xfc, 0x07, 0x12, 0x1c, 0x0a, 0x17, 0x4f, 0x50, 0x52, 0x49, 0x6e, 0x52, 0x6f, 0x6f, 0x6d, 0x10, 0xfc, 0x07, 0x12, 0x1c, 0x0a, 0x17, 0x4f, 0x50, 0x52,
0x43, 0x5f, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x5f, 0x4e, 0x6f, 0x74, 0x4f, 0x70, 0x4d, 0x79, 0x43, 0x5f, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x5f, 0x4e, 0x6f, 0x74, 0x4f, 0x70, 0x4d, 0x79,
0x73, 0x65, 0x6c, 0x66, 0x10, 0xfd, 0x07, 0x2a, 0xe9, 0x03, 0x0a, 0x0e, 0x46, 0x72, 0x69, 0x65, 0x73, 0x65, 0x6c, 0x66, 0x10, 0xfd, 0x07, 0x12, 0x24, 0x0a, 0x1f, 0x4f, 0x50, 0x52, 0x43, 0x5f,
0x6e, 0x64, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x44, 0x12, 0x1c, 0x0a, 0x18, 0x50, 0x41, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x5f, 0x43, 0x6f, 0x73,
0x43, 0x4b, 0x45, 0x54, 0x5f, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x74, 0x4e, 0x6f, 0x74, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0xfe, 0x07, 0x2a, 0xe9, 0x03,
0x54, 0x5f, 0x5a, 0x45, 0x52, 0x4f, 0x10, 0x00, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x0a, 0x0e, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x44,
0x45, 0x54, 0x5f, 0x43, 0x53, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x10, 0x12, 0x1c, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x46, 0x72, 0x69, 0x65, 0x6e,
0x8c, 0x15, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x46, 0x64, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x5a, 0x45, 0x52, 0x4f, 0x10, 0x00, 0x12, 0x18,
0x72, 0x69, 0x65, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x10, 0x8d, 0x15, 0x12, 0x16, 0x0a, 0x11, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x46, 0x72, 0x69, 0x65, 0x6e,
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x4f, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x10, 0x8c, 0x15, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b,
0x70, 0x10, 0x8e, 0x15, 0x12, 0x16, 0x0a, 0x11, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x10,
0x43, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x4f, 0x70, 0x10, 0x8f, 0x15, 0x12, 0x20, 0x0a, 0x1b, 0x8d, 0x15, 0x12, 0x16, 0x0a, 0x11, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x46,
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6c, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x4f, 0x70, 0x10, 0x8e, 0x15, 0x12, 0x16, 0x0a, 0x11, 0x50, 0x41,
0x61, 0x79, 0x65, 0x72, 0x47, 0x61, 0x6d, 0x65, 0x4c, 0x6f, 0x67, 0x10, 0x90, 0x15, 0x12, 0x20, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x4f, 0x70, 0x10,
0x0a, 0x1b, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x51, 0x75, 0x65, 0x72, 0x79, 0x8f, 0x15, 0x12, 0x20, 0x0a, 0x1b, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x51,
0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x47, 0x61, 0x6d, 0x65, 0x4c, 0x6f, 0x67, 0x10, 0x91, 0x15, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x47, 0x61, 0x6d, 0x65, 0x4c, 0x6f,
0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x49, 0x6e, 0x76, 0x67, 0x10, 0x90, 0x15, 0x12, 0x20, 0x0a, 0x1b, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53,
0x69, 0x74, 0x65, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x10, 0x92, 0x15, 0x12, 0x1a, 0x0a, 0x15, 0x43, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x47, 0x61, 0x6d, 0x65,
0x4c, 0x6f, 0x67, 0x10, 0x91, 0x15, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54,
0x5f, 0x43, 0x53, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x10,
0x92, 0x15, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x49,
0x6e, 0x76, 0x69, 0x74, 0x65, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x10, 0x93, 0x15, 0x12, 0x1c,
0x0a, 0x17, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x49, 0x6e, 0x76, 0x69, 0x74,
0x65, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x4f, 0x70, 0x10, 0x94, 0x15, 0x12, 0x1c, 0x0a, 0x17,
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x46, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x46,
0x72, 0x69, 0x65, 0x6e, 0x64, 0x10, 0x93, 0x15, 0x12, 0x1c, 0x0a, 0x17, 0x50, 0x41, 0x43, 0x4b, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x4f, 0x70, 0x10, 0x95, 0x15, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41,
0x45, 0x54, 0x5f, 0x43, 0x53, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x41, 0x70, 0x70,
0x64, 0x4f, 0x70, 0x10, 0x94, 0x15, 0x12, 0x1c, 0x0a, 0x17, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x6c, 0x79, 0x44, 0x61, 0x74, 0x61, 0x10, 0x96, 0x15, 0x12, 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43,
0x5f, 0x53, 0x43, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x4f, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x55, 0x6e, 0x72, 0x65,
0x70, 0x10, 0x95, 0x15, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x61, 0x64, 0x44, 0x61, 0x74, 0x61, 0x10, 0x97, 0x15, 0x12, 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43,
0x43, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x44, 0x61, 0x74, 0x61, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x46, 0x75, 0x7a, 0x7a, 0x79, 0x51, 0x75, 0x65, 0x72, 0x79,
0x10, 0x96, 0x15, 0x12, 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x10, 0x98, 0x15, 0x12, 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43,
0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x55, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x44, 0x61, 0x74, 0x61, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x46, 0x75, 0x7a, 0x7a, 0x79, 0x51, 0x75, 0x65, 0x72, 0x79,
0x10, 0x97, 0x15, 0x12, 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x10, 0x99, 0x15, 0x12, 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43,
0x46, 0x75, 0x7a, 0x7a, 0x79, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x41, 0x64, 0x64,
0x10, 0x98, 0x15, 0x12, 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x10, 0x9a, 0x15, 0x42, 0x26, 0x5a, 0x24, 0x6d, 0x6f, 0x6e,
0x46, 0x75, 0x7a, 0x7a, 0x79, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x67, 0x6f, 0x2e, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x61, 0x6d,
0x10, 0x99, 0x15, 0x12, 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x66, 0x72, 0x69, 0x65, 0x6e,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x41, 0x64, 0x64, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x10, 0x9a, 0x15, 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, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
} }
var ( var (

View File

@ -27,6 +27,7 @@ enum OpResultCode {
OPRC_InviteFriend_PosIsError = 1019; // OPRC_InviteFriend_PosIsError = 1019; //
OPRC_InviteFriend_HadInRoom = 1020; // OPRC_InviteFriend_HadInRoom = 1020; //
OPRC_Friend_NotOpMyself = 1021; // OPRC_Friend_NotOpMyself = 1021; //
OPRC_InviteFriend_CostNotEnough = 1022; //
} }
//id //id

View File

@ -501,6 +501,17 @@ func (this *CSInviteFriendOpHandler) Process(s *netlib.Session, packetid int, da
} }
} }
// 房费是否充足
if scene.IsCustom() {
cfg := PlatformMgrSingleton.GetConfig(p.Platform).RoomConfig[scene.RoomConfigId]
if scene.CostType == 1 && !scene.sp.CostEnough(int(scene.CostType), scene.playerNum, cfg, p) {
logger.Logger.Trace("CSInviteFriendHandler cost error")
opRetCode = friend.OpResultCode_OPRC_InviteFriend_CostNotEnough
send(p)
return nil
}
}
sp := GetScenePolicy(scene.gameId, scene.gameMode) sp := GetScenePolicy(scene.gameId, scene.gameMode)
if sp == nil { if sp == nil {
logger.Logger.Warn("CSInviteFriendHandler game not exist") logger.Logger.Warn("CSInviteFriendHandler game not exist")

View File

@ -1344,7 +1344,7 @@ func CSCreatePrivateRoomHandler(s *netlib.Session, packetId int, data interface{
return nil return nil
} }
if cfg.GetCostType() == 2 { if costType == 2 {
sp.CostPayment(scene, p) sp.CostPayment(scene, p)
} }

View File

@ -142,7 +142,7 @@ func (spd *ScenePolicyData) CostPayment(s *Scene, p *Player) bool {
if roomConfig == nil { if roomConfig == nil {
return false return false
} }
return spd.costEnough(int(roomConfig.GetCostType()), s.playerNum, roomConfig, p.SnId, func(items []*model.Item) { return spd.costEnough(int(s.GetCostType()), s.playerNum, roomConfig, p.SnId, func(items []*model.Item) {
for _, v := range items { for _, v := range items {
v.ItemNum = -v.ItemNum v.ItemNum = -v.ItemNum
} }
@ -166,7 +166,7 @@ func (spd *ScenePolicyData) GiveCostPayment(s *Scene, snid int32) bool {
return false return false
} }
if roomConfig.GetCostType() != 1 { // 只有房主付费才有返还 if s.GetCostType() != 2 { // 只有房主付费才有返还
return false return false
} }

View File

@ -1276,27 +1276,14 @@ func (this *ShopMgr) SendAPICreateOrder(p *Player, ConfigPayId int32, data any,
amount[ShopParamDiamond] = bbd.Grade amount[ShopParamDiamond] = bbd.Grade
} }
var itemInfo []model.ItemInfo dbShop = this.NewDbShop(p, 0, amount[:], ShopConsumeMoney, int32(bbd.Price2), common.GainWay_ActBlindBox, nil, 0, "", 0, remark, []int32{bbd.Id})
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})
err := model.InsertDbShopLog(dbShop) err := model.InsertDbShopLog(dbShop)
if err != nil { if err != nil {
logger.Logger.Errorf("model.InsertDbShopLog err:", err) logger.Logger.Errorf("model.InsertDbShopLog err:", err)
return nil return nil
} }
return webapi.API_CreateOrder(common.GetAppId(), dbShop.LogId.Hex(), ConfigPayId, p.SnId, 0, p.Platform, p.PackageID, p.DeviceOS, 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 { } else if wfs, ok := data.(*webapi_proto.WelfareSpree); ok {
var items []model.ItemInfo var items []model.ItemInfo
var webItemInfo []*webapi_proto.ItemInfo var webItemInfo []*webapi_proto.ItemInfo