竞技馆

This commit is contained in:
sk 2024-09-02 11:05:45 +08:00
parent 03cd5dda2b
commit 9f490a7aca
8 changed files with 26 additions and 21 deletions

View File

@ -3,6 +3,8 @@ package base
import (
"reflect"
"mongo.games.com/goserver/core/logger"
"mongo.games.com/game/model"
"mongo.games.com/game/mq"
)
@ -38,6 +40,7 @@ func (c *LogChannel) WriteLog(log interface{}) {
if cname == "" {
cname = "_null_"
}
logger.Logger.Tracef("LogChannel ==> %#v", log)
mq.Send(cname, log)
}

View File

@ -2114,6 +2114,7 @@ func (this *TienLenSceneData) SaveCustomLog() {
state = 1
}
log := &model.CustomLog{
Platform: this.Platform,
CycleId: this.CycleID,
RoomConfigId: this.GetCustom().GetRoomConfigId(),
RoomId: this.SceneId,

View File

@ -2608,7 +2608,7 @@ func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) {
if p != nil {
var items []*model.Item
for _, v := range packBilled.List[0].Award {
itemData := srvdata.GameItemMgr.Get(p.Platform, p.SnId)
itemData := srvdata.GameItemMgr.Get(p.Platform, v.GetId())
if itemData != nil {
items = append(items, &model.Item{
ItemId: v.GetId(),

View File

@ -1,9 +1,5 @@
package model
import (
"github.com/globalsign/mgo/bson"
)
var (
DbCustomLogDBName = "log"
DbCustomLogCollName = "log_custom"
@ -22,7 +18,6 @@ type RoundInfo struct {
}
type CustomLog struct {
Id bson.ObjectId `bson:"_id"`
Platform string `bson:"-"`
CycleId string // 本轮id多局游戏属于同一轮
RoomConfigId int32 // 房间配置id

View File

@ -99,6 +99,7 @@ func NewGamePlayerListLogEx(snid int32, gamedetailedlogid string, platform, chan
cl.Time = tNow
cl.MatchId = matchid
cl.MatchType = matchType
cl.CycleId = cycleId
return cl
}

View File

@ -1348,6 +1348,8 @@ func CSGetPrivateRoomListHandler(s *netlib.Session, packetId int, data interface
return nil
}
PlayerNotifySingle.AddTime(p.SnId, common.NotifyPrivateRoomList, time.Second*15)
pack := &gamehall.SCGetPrivateRoomList{}
scenes := SceneMgrSingleton.FindRoomList(&FindRoomParam{
Platform: p.Platform,

View File

@ -3,6 +3,8 @@ package main
import (
"time"
"mongo.games.com/goserver/core/logger"
"mongo.games.com/game/common"
)
@ -76,4 +78,5 @@ func (p *PlayerNotify) GetPlayers(tp common.NotifyType) []int32 {
func (p *PlayerNotify) SendToClient(tp common.NotifyType, packetId int, pack interface{}) {
ids := p.GetPlayers(tp)
PlayerMgrSington.BroadcastMessageToTarget(ids, packetId, pack)
logger.Logger.Tracef("PlayerNotify SendToClient tp:%v ids:%v", tp, ids)
}

View File

@ -85,7 +85,7 @@ func (m *SceneMgr) GenOneMatchSceneId() int {
func (m *SceneMgr) GenPassword() string {
for i := 0; i < 100; i++ {
s := strconv.Itoa(common.RandInt(10000, 100000))
s := strconv.Itoa(common.RandInt(100000, 1000000))
if _, ok := m.password[s]; !ok {
m.password[s] = struct{}{}
return s