竞技馆
This commit is contained in:
parent
03cd5dda2b
commit
9f490a7aca
|
@ -3,6 +3,8 @@ package base
|
||||||
import (
|
import (
|
||||||
"reflect"
|
"reflect"
|
||||||
|
|
||||||
|
"mongo.games.com/goserver/core/logger"
|
||||||
|
|
||||||
"mongo.games.com/game/model"
|
"mongo.games.com/game/model"
|
||||||
"mongo.games.com/game/mq"
|
"mongo.games.com/game/mq"
|
||||||
)
|
)
|
||||||
|
@ -38,6 +40,7 @@ func (c *LogChannel) WriteLog(log interface{}) {
|
||||||
if cname == "" {
|
if cname == "" {
|
||||||
cname = "_null_"
|
cname = "_null_"
|
||||||
}
|
}
|
||||||
|
logger.Logger.Tracef("LogChannel ==> %#v", log)
|
||||||
mq.Send(cname, log)
|
mq.Send(cname, log)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2114,6 +2114,7 @@ func (this *TienLenSceneData) SaveCustomLog() {
|
||||||
state = 1
|
state = 1
|
||||||
}
|
}
|
||||||
log := &model.CustomLog{
|
log := &model.CustomLog{
|
||||||
|
Platform: this.Platform,
|
||||||
CycleId: this.CycleID,
|
CycleId: this.CycleID,
|
||||||
RoomConfigId: this.GetCustom().GetRoomConfigId(),
|
RoomConfigId: this.GetCustom().GetRoomConfigId(),
|
||||||
RoomId: this.SceneId,
|
RoomId: this.SceneId,
|
||||||
|
|
|
@ -2608,7 +2608,7 @@ func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) {
|
||||||
if p != nil {
|
if p != nil {
|
||||||
var items []*model.Item
|
var items []*model.Item
|
||||||
for _, v := range packBilled.List[0].Award {
|
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 {
|
if itemData != nil {
|
||||||
items = append(items, &model.Item{
|
items = append(items, &model.Item{
|
||||||
ItemId: v.GetId(),
|
ItemId: v.GetId(),
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
package model
|
package model
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/globalsign/mgo/bson"
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
var (
|
||||||
DbCustomLogDBName = "log"
|
DbCustomLogDBName = "log"
|
||||||
DbCustomLogCollName = "log_custom"
|
DbCustomLogCollName = "log_custom"
|
||||||
|
@ -22,19 +18,18 @@ type RoundInfo struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type CustomLog struct {
|
type CustomLog struct {
|
||||||
Id bson.ObjectId `bson:"_id"`
|
Platform string `bson:"-"`
|
||||||
Platform string `bson:"-"`
|
CycleId string // 本轮id,多局游戏属于同一轮
|
||||||
CycleId string // 本轮id,多局游戏属于同一轮
|
RoomConfigId int32 // 房间配置id
|
||||||
RoomConfigId int32 // 房间配置id
|
GameFreeId int32 // 场次id
|
||||||
GameFreeId int32 // 场次id
|
TotalRound int32 // 总局数
|
||||||
TotalRound int32 // 总局数
|
PlayerNum int32 // 最大人数
|
||||||
PlayerNum int32 // 最大人数
|
Password string // 密码
|
||||||
Password string // 密码
|
CostType int32 // 付费方式 1房主 2AA
|
||||||
CostType int32 // 付费方式 1房主 2AA
|
Voice int32 // 是否开启语音 1开启
|
||||||
Voice int32 // 是否开启语音 1开启
|
RoomId int32 // 房间id
|
||||||
RoomId int32 // 房间id
|
SnId []PlayerInfo // 所有玩家
|
||||||
SnId []PlayerInfo // 所有玩家
|
List []RoundInfo // 对局记录
|
||||||
List []RoundInfo // 对局记录
|
StartTs, EndTs int64 // 开始,结束时间
|
||||||
StartTs, EndTs int64 // 开始,结束时间
|
State int32 // 0正常结束 1后台中途解散
|
||||||
State int32 // 0正常结束 1后台中途解散
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,6 +99,7 @@ func NewGamePlayerListLogEx(snid int32, gamedetailedlogid string, platform, chan
|
||||||
cl.Time = tNow
|
cl.Time = tNow
|
||||||
cl.MatchId = matchid
|
cl.MatchId = matchid
|
||||||
cl.MatchType = matchType
|
cl.MatchType = matchType
|
||||||
|
cl.CycleId = cycleId
|
||||||
return cl
|
return cl
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1348,6 +1348,8 @@ func CSGetPrivateRoomListHandler(s *netlib.Session, packetId int, data interface
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PlayerNotifySingle.AddTime(p.SnId, common.NotifyPrivateRoomList, time.Second*15)
|
||||||
|
|
||||||
pack := &gamehall.SCGetPrivateRoomList{}
|
pack := &gamehall.SCGetPrivateRoomList{}
|
||||||
scenes := SceneMgrSingleton.FindRoomList(&FindRoomParam{
|
scenes := SceneMgrSingleton.FindRoomList(&FindRoomParam{
|
||||||
Platform: p.Platform,
|
Platform: p.Platform,
|
||||||
|
|
|
@ -3,6 +3,8 @@ package main
|
||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"mongo.games.com/goserver/core/logger"
|
||||||
|
|
||||||
"mongo.games.com/game/common"
|
"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{}) {
|
func (p *PlayerNotify) SendToClient(tp common.NotifyType, packetId int, pack interface{}) {
|
||||||
ids := p.GetPlayers(tp)
|
ids := p.GetPlayers(tp)
|
||||||
PlayerMgrSington.BroadcastMessageToTarget(ids, packetId, pack)
|
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 {
|
func (m *SceneMgr) GenPassword() string {
|
||||||
for i := 0; i < 100; i++ {
|
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 {
|
if _, ok := m.password[s]; !ok {
|
||||||
m.password[s] = struct{}{}
|
m.password[s] = struct{}{}
|
||||||
return s
|
return s
|
||||||
|
|
Loading…
Reference in New Issue