竞技馆
This commit is contained in:
parent
03cd5dda2b
commit
9f490a7aca
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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(),
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
package model
|
||||
|
||||
import (
|
||||
"github.com/globalsign/mgo/bson"
|
||||
)
|
||||
|
||||
var (
|
||||
DbCustomLogDBName = "log"
|
||||
DbCustomLogCollName = "log_custom"
|
||||
|
@ -22,19 +18,18 @@ type RoundInfo struct {
|
|||
}
|
||||
|
||||
type CustomLog struct {
|
||||
Id bson.ObjectId `bson:"_id"`
|
||||
Platform string `bson:"-"`
|
||||
CycleId string // 本轮id,多局游戏属于同一轮
|
||||
RoomConfigId int32 // 房间配置id
|
||||
GameFreeId int32 // 场次id
|
||||
TotalRound int32 // 总局数
|
||||
PlayerNum int32 // 最大人数
|
||||
Password string // 密码
|
||||
CostType int32 // 付费方式 1房主 2AA
|
||||
Voice int32 // 是否开启语音 1开启
|
||||
RoomId int32 // 房间id
|
||||
SnId []PlayerInfo // 所有玩家
|
||||
List []RoundInfo // 对局记录
|
||||
StartTs, EndTs int64 // 开始,结束时间
|
||||
State int32 // 0正常结束 1后台中途解散
|
||||
Platform string `bson:"-"`
|
||||
CycleId string // 本轮id,多局游戏属于同一轮
|
||||
RoomConfigId int32 // 房间配置id
|
||||
GameFreeId int32 // 场次id
|
||||
TotalRound int32 // 总局数
|
||||
PlayerNum int32 // 最大人数
|
||||
Password string // 密码
|
||||
CostType int32 // 付费方式 1房主 2AA
|
||||
Voice int32 // 是否开启语音 1开启
|
||||
RoomId int32 // 房间id
|
||||
SnId []PlayerInfo // 所有玩家
|
||||
List []RoundInfo // 对局记录
|
||||
StartTs, EndTs int64 // 开始,结束时间
|
||||
State int32 // 0正常结束 1后台中途解散
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue