Merge branch 'develop' into release

This commit is contained in:
sk 2024-11-14 17:33:32 +08:00
commit 29a264d789
12 changed files with 605 additions and 506 deletions

View File

@ -11,7 +11,8 @@
"PermitAwardTitle": "{\"zh\":\"通行证排行奖励\",\"vi\":\"Vượt qua phần thưởng xếp hạng\",\"en\":\"Pass Ranking Rewards\",\"kh\":\"រង្វាន់ចំណាត់ថ្នាក់ឆ្លងកាត់\"}",
"PermitAward": "{\"zh\":\"恭喜您在上个赛季通行证排行中名次达到%v名排行奖励已发放请查收\",\"vi\":\"Chúc mừng bạn đã đạt được %v trong bảng xếp hạng vượt qua. Phần thưởng xếp hạng đã được phân phối, vui lòng kiểm tra.\",\"en\":\"Congratulations on reaching %vth place in the pass ranking. Ranking rewards have been issued. Please check.\",\"kh\":\"សូមអបអរសាទរចំពោះការឈានដល់ចំណាត់ថ្នាក់ទី %v ក្នុងចំណាត់ថ្នាក់ឆ្លងកាត់។ រង្វាន់ចំណាត់ថ្នាក់ត្រូវបានចេញ។ សូមត្រួតពិនិត្យ។\"}",
"UpgradeTitle": "{\"zh\":\"更新奖励\",\"vi\":\"Phần thưởng cập nhật\",\"en\":\"Update Rewards\",\"kh\":\"រង្វាន់ដំឡើង\"}",
"Upgrade": "{\"zh\":\"感谢您更新客户端,更新奖励已发放至附近,请注意查收\",\"vi\":\"Cảm ơn bạn đã cập nhật ứng dụng khách. Phần thưởng cập nhật đã được phân phối gần đó, vui lòng chú ý kiểm tra nhận\",\"en\":\"Thank you for updating the client. The update reward has been distributed to everyone. Please check it carefully.\",\"kh\":\"អរគុណសម្រាប់ការធ្វើបច្ចុប្បន្នភាពហ្គេម។ រង្វាន់នៃការធ្វើបច្ចុប្បន្នភាពត្រូវបានចែកចាយទៅគ្រប់គ្នា។ សូមពិនិត្យអោយបានច្បាស់លាស់។\"}",
"LotteryTitle": "{\"zh\":\"玩游戏抽奖品\",\"vi\":\"Chơi game rút thưởng\",\"en\":\"Play games, draw prizes\",\"kh\":\"លេងហ្គេម ចាប់រង្វាន់\"}",
"Lottery": "{\"zh\":\"恭喜您在好友房玩游戏抽奖品活动中获得了大奖,奖品随邮件发放,请注意查收\",\"vi\":\"Chúc mừng bạn đã trúng giải thưởng lớn trong hoạt động rút thưởng trò chơi tại phòng bạn bè. Giải thưởng sẽ được gửi qua email, vui lòng kiểm tra cẩn thận.\",\"en\":\"Congratulations on winning the grand prize in the lucky draw activity in the friend room. The prize will be sent via email, please check it carefully.\",\"kh\":\"សូមអបអរសាទរចំពោះការឈ្នះរង្វាន់ធំក្នុងសកម្មភាពចាប់រង្វាន់ក្នុងបន្ទប់មិត្តភ័ក្តិរបស់អ្នក រង្វាន់នឹងត្រូវបានផ្ញើតាមអ៊ីម៉ែល សូមពិនិត្យមើលវាដោយយកចិត្តទុកដាក់។\"}"
"Upgrade": "{\"zh\":\"感谢您更新客户端,更新奖励已发放至附近,请注意查收\",\"vi\":\"Cảm ơn bạn đã cập nhật ứng dụng khách. Phần thưởng cập nhật đã được phân phối gần đó, vui lòng chú ý kiểm tra nhận\",\"en\":\"Thank you for updating the client. The update reward has been distributed to everyone. Please check it carefully.\",\"kh\":\"អរគុណសម្រាប់ការធ្វើបច្ចុប្បន្នភាពហ្គេម។ រង្វាន់នៃការធ្វើបច្ចុប្បន្នភាពត្រូវបានចែកចាយទៅគ្រប់គ្នា។ សូមពិនិត្យអោយបានច្បាស់លាស់។\"}",
"LotteryTitle": "{\"zh\":\"玩游戏抽奖品\",\"vi\":\"Chơi game rút thưởng\",\"en\":\"Play games, draw prizes\",\"kh\":\"លេងហ្គេម ចាប់រង្វាន់\"}",
"Lottery": "{\"zh\":\"恭喜您在好友房玩游戏抽奖品活动中获得了大奖,奖品随邮件发放,请注意查收\",\"vi\":\"Chúc mừng bạn đã trúng giải thưởng lớn trong hoạt động rút thưởng trò chơi tại phòng bạn bè. Giải thưởng sẽ được gửi qua email, vui lòng kiểm tra cẩn thận.\",\"en\":\"Congratulations on winning the grand prize in the lucky draw activity in the friend room. The prize will be sent via email, please check it carefully.\",\"kh\":\"សូមអបអរសាទរចំពោះការឈ្នះរង្វាន់ធំក្នុងសកម្មភាពចាប់រង្វាន់ក្នុងបន្ទប់មិត្តភ័ក្តិរបស់អ្នក រង្វាន់នឹងត្រូវបានផ្ញើតាមអ៊ីម៉ែល សូមពិនិត្យមើលវាដោយយកចិត្តទុកដាក់។\"}",
"TelCodeTitle": "{\"zh\":\"话费卡兑换码\",\"vi\":\"Mã đổi thẻ điện thoại\",\"en\":\"Phone card redemption code\",\"kh\":\"លេខកូដប្រោសលោះកាតទូរស័ព្ទ\"}"
}

View File

@ -216,7 +216,7 @@ func (this *Player) IsAuto() bool {
}
func (this *Player) IsGameing() bool {
return !this.IsMarkFlag(PlayerState_WaitNext) && !this.IsMarkFlag(PlayerState_GameBreak) && !this.IsMarkFlag(PlayerState_Bankruptcy) && !this.IsMarkFlag(PlayerState_Audience)
return !this.IsMarkFlag(PlayerState_WaitNext) && !this.IsMarkFlag(PlayerState_GameBreak) && !this.IsMarkFlag(PlayerState_Audience)
}
func (this *Player) IsAllFollow() bool {

View File

@ -591,6 +591,11 @@ func (this *SceneBaseStateTienLen) CanChangeTo(s base.SceneState) bool {
// 当前状态能否换桌
func (this *SceneBaseStateTienLen) CanChangeCoinScene(s *base.Scene, p *base.Player) bool {
if s.IsCustom() {
if s.NumOfGames > 0 && s.NumOfGames < int(s.TotalOfGames) {
return false
}
}
return !p.IsGameing() || s.GetDestroyed() || !s.GetGaming()
}

View File

@ -41,6 +41,7 @@ const (
MSGTYPE_RANK_PermitReward // 通行证排行奖励
MSGTYPE_ClientUpgrade // 客户端升级
MSGTYPE_Lottery // 开奖码抽奖
MSGTYPE_TelCode // 手机兑换码
)
const (

File diff suppressed because it is too large Load Diff

View File

@ -698,6 +698,8 @@ message ASCreateExchangeOrder {
message SACreateExchangeOrder {
TagCode Tag = 1; //
ReturnCPO ReturnCPO = 2;
repeated ItemInfo Items = 3; //
string TelCode = 4; //
}
//game_srv/get_exchange_order
message ASGetExchangeOrder{

View File

@ -735,6 +735,8 @@ func (this *CSUpdateVipShopHandler) Process(s *netlib.Session, packetid int, dat
return nil
}
func init() {
// 商城接口
// 获取商城商品信息列表
common.RegisterHandler(int(shop.SPacketID_PACKET_CS_SHOP_INFO), &CSShopInfoHandler{})
netlib.RegisterFactory(int(shop.SPacketID_PACKET_CS_SHOP_INFO), &CSShopInfoPacketFactory{})
@ -748,20 +750,22 @@ func init() {
common.RegisterHandler(int(shop.SPacketID_PACKET_CSGETPAYINFOLIST), &CSGetPayInfoListHandler{})
netlib.RegisterFactory(int(shop.SPacketID_PACKET_CSGETPAYINFOLIST), &CSGetPayInfoListPacketFactory{})
// 兑换商城接口
// 获取商城商品兑换列表
common.RegisterHandler(int(shop.SPacketID_PACKET_CS_SHOP_EXCHANGELIST), &CSShopExchangeListHandler{})
netlib.RegisterFactory(int(shop.SPacketID_PACKET_CS_SHOP_EXCHANGELIST), &CSShopExchangeListPacketFactory{})
// 兑换商品(非现金)
common.RegisterHandler(int(shop.SPacketID_PACKET_CS_SHOP_EXCHANGE), &CSShopExchangeHandler{})
netlib.RegisterFactory(int(shop.SPacketID_PACKET_CS_SHOP_EXCHANGE), &CSShopExchangePacketFactory{})
// 兑换商品(现金,创建订单)
common.RegisterHandler(int(shop.SPacketID_PACKET_CSPAYINFO), &CSPayInfoHandler{})
netlib.RegisterFactory(int(shop.SPacketID_PACKET_CSPAYINFO), &CSPayInfoPacketFactory{})
// 获取兑换记录
//todo 客户端走透传后台获取
common.RegisterHandler(int(shop.SPacketID_PACKET_CS_SHOP_EXCHANGERECORD), &CSShopExchangeRecordHandler{})
netlib.RegisterFactory(int(shop.SPacketID_PACKET_CS_SHOP_EXCHANGERECORD), &CSShopExchangeRecordPacketFactory{})
// 现金,创建订单(所有现金订单)
common.RegisterHandler(int(shop.SPacketID_PACKET_CSPAYINFO), &CSPayInfoHandler{})
netlib.RegisterFactory(int(shop.SPacketID_PACKET_CSPAYINFO), &CSPayInfoPacketFactory{})
//玩家地址操作
common.RegisterHandler(int(shop.SPacketID_PACKET_CSPLAYERADDR), &CSPlayerAddrHandler{})
netlib.RegisterFactory(int(shop.SPacketID_PACKET_CSPLAYERADDR), &CSPlayerAddrPacketFactory{})

View File

@ -41,6 +41,10 @@ func AddMail(param *AddMailParam) {
return
}
if param.SrcName == "" {
param.SrcName = "{\"zh\":\"系统\",\"vi\":\"GM\",\"en\":\"GM\",\"kh\":\"GM\"}"
}
opener := int32(1)
if param.SrcId <= 0 {
opener = 0
@ -149,3 +153,17 @@ func AddMailLottery(plt string, snid int32, items []*model.ItemInfo) {
ShowId: model.HallAll,
})
}
func AddMailTelCode(plt string, snid int32, code string) {
title := i18n.Tr("languages", "TelCodeTitle")
content := code
AddMail(&AddMailParam{
Platform: plt,
Tp: model.MSGTYPE_TelCode,
SnId: snid,
Title: title,
Content: content,
ShowId: model.HallTienlen,
})
}

View File

@ -2,15 +2,17 @@ package main
import (
"fmt"
"mongo.games.com/goserver/core/logger"
"time"
"mongo.games.com/game/common"
"mongo.games.com/game/model"
"mongo.games.com/goserver/core/basic"
"mongo.games.com/goserver/core/logger"
"mongo.games.com/goserver/core/module"
"mongo.games.com/goserver/core/netlib"
"mongo.games.com/goserver/core/task"
"mongo.games.com/game/common"
"mongo.games.com/game/model"
"mongo.games.com/game/worldsrv/internal"
)
const (
@ -236,6 +238,7 @@ func (this *LoginStateMgr) LogoutAllBySession(session *netlib.Session) {
p := PlayerMgrSington.GetOnlinePlayer(sid)
if p != nil {
p.DropLine()
internal.FirePlayerDropLine[*Player, *Scene](p)
}
}
}

View File

@ -86,6 +86,7 @@ type Player struct {
changeIconTime time.Time //上次修改头像时间
enterts time.Time //进入时间
lastChangeScene time.Time //上次换桌时间
dropTime time.Time // 掉线时间
isAudience bool //是否是观众
customerToken string //客服会话token
isDelete bool //是否已删档用户
@ -1155,6 +1156,7 @@ func (this *Player) Kick(reason int32) {
LoginStateMgrSington.LogoutBySid(this.sid)
this.DropLine()
internal.FirePlayerDropLine[*Player, *Scene](this)
}
TournamentMgr.ForceQuit(this.Platform, this.SnId)
}
@ -1632,10 +1634,19 @@ func (this *Player) OnSecTimer() {
}
func (this *Player) OnMiniTimer() {
TaskSubjectSingleton.Touch(common.TaskTypeOnlineTs, &TaskData{
SnId: this.SnId,
Num: 60,
})
if this.IsOnLine() {
TaskSubjectSingleton.Touch(common.TaskTypeOnlineTs, &TaskData{
SnId: this.SnId,
Num: 60,
})
}
// 长时间掉线又没有删除缓存
if !this.dropTime.IsZero() && time.Now().Sub(this.dropTime).Minutes() > 20 {
logger.Logger.Errorf("清除缓存异常玩家 snid:%v dirty:%v lastLogoutTime:%v lastGameId:%v", this.SnId, this.dirty, this.LastLogoutTime, this.LastGameId)
if this.scene != nil {
logger.Logger.Errorf("清除缓存异常玩家 sceneId:%v", this.scene.sceneId)
}
}
}
func (this *Player) OnHourTimer() {
@ -3884,10 +3895,12 @@ func (this *Player) SCDataConfig(tp int) {
func init() {
internal.RegisterPlayerListenerFunc(&internal.PlayerListenerFunc[*Player, *Scene]{
ClockFunc: common.ClockFunc{},
OnPlayerLoginedFunc: nil,
OnPlayerLogoutedFunc: nil,
OnPlayerDropLineFunc: nil,
ClockFunc: common.ClockFunc{},
OnPlayerLoginedFunc: nil,
OnPlayerLogoutedFunc: nil,
OnPlayerDropLineFunc: func(p *Player) {
p.dropTime = time.Now()
},
OnPlayerReholdFunc: nil,
OnPlayerEnterSceneBeforeFunc: nil,
OnPlayerEnterSceneAfterFunc: nil,

View File

@ -21,6 +21,7 @@ import (
serverproto "mongo.games.com/game/protocol/server"
webapiproto "mongo.games.com/game/protocol/webapi"
"mongo.games.com/game/srvdata"
"mongo.games.com/game/worldsrv/internal"
)
type PlayerGameCtx struct {
@ -193,6 +194,9 @@ func (this *Scene) PlayerEnter(p *Player, pos int, ischangeroom bool) bool {
}
}
internal.FirePlayerEnterSceneBefore(p, this)
defer internal.FirePlayerEnterSceneAfter(p, this)
// 非百人,设置座位
if !this.IsHundredScene() {
if pos != -1 {
@ -515,6 +519,9 @@ func (this *Scene) lastScene(p *Player) {
}
func (this *Scene) DelPlayer(p *Player) bool {
internal.FirePlayerLeaveSceneBefore(p, this)
defer internal.FirePlayerLeaveSceneAfter(p, this)
if p.scene != this {
roomId := 0
if p.scene != nil {

View File

@ -973,6 +973,7 @@ func (this *ShopMgr) Exchange(param *ExchangeParam) {
param.CallBackFunc(shop.OpResultCode_OPRC_Error)
return
}
logger.Logger.Tracef("API_CreateExchange: %v", as)
//dbShop
var ret shop.OpResultCode
if as.Tag == webapi_proto.TagCode_SUCCESS {
@ -1009,6 +1010,30 @@ func (this *ShopMgr) Exchange(param *ExchangeParam) {
}
}
}
// 加道具
if as.GetItems() != nil {
var itemInfo []*model.Item
for _, v := range as.GetItems() {
itemInfo = append(itemInfo, &model.Item{
ItemId: v.GetItemId(),
ItemNum: v.GetItemNum(),
})
}
BagMgrSingleton.AddItemsOffline(&model.AddItemParam{
Platform: param.Platform,
SnId: param.SnId,
Change: itemInfo,
GainWay: common.GainWay_Exchange,
Operator: "system",
Remark: "兑换获得",
}, nil)
}
// 发手机兑换码
if as.GetTelCode() != "" {
AddMailTelCode(param.Platform, param.SnId, as.GetTelCode())
}
ret = shop.OpResultCode_OPRC_Sucess
} else {
if as.GetReturnCPO() != nil {
@ -1025,7 +1050,6 @@ func (this *ShopMgr) Exchange(param *ExchangeParam) {
ret = shop.OpResultCode_OPRC_ExchangeSoldOut
}
}
logger.Logger.Trace("API_CreateExchange: ", as.Tag, as.GetReturnCPO())
if len(itemInfo) > 0 {
BagMgrSingleton.AddItemsOffline(&model.AddItemParam{
Platform: param.Platform,