This commit is contained in:
by 2024-09-19 13:35:57 +08:00
commit 5c4e4d0f4a
13 changed files with 3626 additions and 975 deletions

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

View File

@ -446,6 +446,9 @@ func TienLenCreateRoomInfoPacket(s *base.Scene, p *base.Player, sceneEx *TienLen
if s.GetCustom().GetPassword() != "" {
pack.NeedPassword = 1
}
if s.IsCustom() {
pack.MasterSnid = s.GetCreator()
}
pack.IsMatch = int32(0)
// 0.普通场 1.锦标赛 2.冠军赛 3.vip专属
if s.IsMatchScene() {

View File

@ -140,7 +140,7 @@ func init() {
}
pack.List = append(pack.List, item)
}
return common.ResponseTag_Ok, pack
default:
pack.Tag = webapiproto.TagCode_FAILED
pack.Msg = "未实现"

View File

@ -6,8 +6,10 @@ import (
"encoding/json"
"fmt"
"io"
"mongo.games.com/game/common"
"mongo.games.com/game/model"
"net/http"
"sync/atomic"
"time"
"mongo.games.com/goserver/core"
"mongo.games.com/goserver/core/admin"
"mongo.games.com/goserver/core/logger"
@ -15,9 +17,11 @@ import (
"mongo.games.com/goserver/core/transact"
"mongo.games.com/goserver/core/utils"
"mongo.games.com/goserver/srvlib"
"net/http"
"sync/atomic"
"time"
"mongo.games.com/game/common"
"mongo.games.com/game/model"
"mongo.games.com/game/proto"
"mongo.games.com/game/protocol/webapi"
)
const (
@ -173,7 +177,15 @@ func init() {
}),
OnChildRespWrapper: transact.OnChildRespWrapper(func(tNode *transact.TransNode, hChild transact.TransNodeID, retCode int, ud interface{}) transact.TransExeResult {
logger.Logger.Tracef("GameSrvApi OnChildRespWrapper %v:%v", hChild, ud)
tNode.TransEnv.SetField(GAMESRVAPI_TRANSACTE_RESPONSE, ud)
if v, ok := ud.([]byte); ok {
var msg webapi.SARoomInfo
err := proto.Unmarshal(netlib.SkipHeaderGetRaw(v), &msg)
if err == nil && msg.GetTag() == webapi.TagCode_SUCCESS {
tNode.TransEnv.SetField(GAMESRVAPI_TRANSACTE_RESPONSE, ud)
} else if err != nil {
logger.Logger.Errorf("GameSrvApi OnChildRespWrapper unmarshal err %v", err)
}
}
return transact.TransExeResult(retCode)
}),
})

File diff suppressed because it is too large Load Diff

View File

@ -248,6 +248,7 @@ message RoomInfo{
string Password = 22;//
int32 CostType = 23;// 1 2AA
int32 Voice = 24;// 1
int32 PlayerNum = 25; //
}
message PlayerSingleAdjust{

View File

@ -2818,27 +2818,33 @@ func CSBillList(s *netlib.Session, packetId int, data interface{}, sid int64) er
fromIndex := msg.GetPageNo() * msg.GetPageSize()
toIndex := fromIndex + msg.GetPageSize()
logs, _, err := model.GetCoinLogGame(p.Platform, p.SnId, common.BillTypeCoin, startTs, endTs, int(fromIndex), int(toIndex))
if err != nil {
logger.Logger.Errorf("GetCoinLogGame err:%v", err)
p.SendToClient(int(player_proto.PlayerPacketID_PACKET_SCBillList), ret)
return err
}
var err error
var logs []model.CoinLog
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
logs, _, err = model.GetCoinLogGame(p.Platform, p.SnId, common.BillTypeCoin, startTs, endTs, int(fromIndex), int(toIndex))
return nil
}), task.CompleteNotifyWrapper(func(i interface{}, t task.Task) {
if err != nil {
logger.Logger.Errorf("GetCoinLogGame err:%v", err)
p.SendToClient(int(player_proto.PlayerPacketID_PACKET_SCBillList), ret)
return
}
for _, v := range logs {
ret.Items = append(ret.Items, &player_proto.BillItem{
Ts: v.Ts,
Id: v.LogId.Hex(),
BillType: int64(v.LogType),
Amount: v.Count,
Balance: v.RestCount,
GameID: int64(v.InGame),
GameFreeID: v.GameFreeId,
BaseCoin: v.BaseCoin,
})
}
p.SendToClient(int(player_proto.PlayerPacketID_PACKET_SCBillList), ret)
logger.Logger.Tracef("SCBillList pageNo:%d, pageSize:%d %v", msg.GetPageNo(), msg.GetPageSize(), ret)
for _, v := range logs {
ret.Items = append(ret.Items, &player_proto.BillItem{
Ts: v.Ts,
Id: v.LogId.Hex(),
BillType: int64(v.LogType),
Amount: v.Count,
Balance: v.RestCount,
GameID: int64(v.InGame),
GameFreeID: v.GameFreeId,
BaseCoin: v.BaseCoin,
})
}
p.SendToClient(int(player_proto.PlayerPacketID_PACKET_SCBillList), ret)
logger.Logger.Tracef("SCBillList pageNo:%d, pageSize:%d %v", msg.GetPageNo(), msg.GetPageSize(), ret)
}), "GetCoinLogGame").Start()
return nil
}

View File

@ -1963,7 +1963,7 @@ func (this *Player) AddCoin(num, add int64, gainWay int32, oper, remark string)
//this.TotalData(num, gainWay)
async := false
if num > 0 && this.scene != nil && !this.scene.IsTestScene() && !this.scene.IsMatchScene() && this.scene.sceneMode != common.SceneModeThr { //游戏场中加币,需要同步到gamesrv上
if num > 0 && this.scene != nil && !this.scene.IsTestScene() && !this.scene.IsMatchScene() && !this.scene.IsCustom() && this.scene.sceneMode != common.SceneModeThr { //游戏场中加币,需要同步到gamesrv上
if StartAsyncAddCoinTransact(this, num, gainWay, oper, remark, true, 0, true) {
async = true
}

View File

@ -199,6 +199,7 @@ func (m *SceneMgr) MarshalAllRoom(platform string, groupId, gameId int, gameMode
Password: s.GetPassword(),
CostType: s.GetCostType(),
Voice: s.GetVoice(),
PlayerNum: int32(s.playerNum),
}
if s.starting {
si.Start = 1

Binary file not shown.