Compare commits

..

No commits in common. "d16e49448f989dd4f326d8e4347020c3376480c1" and "4880d41aa3947202bf0456d892320148254e8ad8" have entirely different histories.

10 changed files with 48 additions and 55 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -674,6 +674,11 @@
0
],
"PrivilegeShow": 17000
},
{
"ParamName": [
""
]
}
]
}

2
public

@ -1 +1 @@
Subproject commit ad1f72f58fe9edb6d812dd58066366cf586332eb
Subproject commit d789cca81a36ddbaf30e5414b6c4fe530e0631f6

View File

@ -8,7 +8,6 @@ import (
"mongo.games.com/game/srvdata"
"mongo.games.com/goserver/core/logger"
"mongo.games.com/goserver/core/netlib"
"time"
)
type CSHundredSceneGetPlayerNumPacketFactory struct {
@ -211,38 +210,38 @@ func (this *CSGameObservePacketFactory) CreatePacket() interface{} {
func (this *CSGameObserveHandler) Process(s *netlib.Session, packetid int, data interface{}, sid int64) error {
logger.Logger.Trace("CSGameObserveHandler Process recv ", data)
if msg, ok := data.(*gamehall.CSGameObserve); ok {
if _, ok := data.(*gamehall.CSGameObserve); ok {
p := PlayerMgrSington.GetPlayer(sid)
if p != nil {
if msg.GetStartOrEnd() {
gameStateMgr.PlayerRegiste(p, msg.GetGameId(), msg.GetStartOrEnd())
pack := &gamehall.SCGameSubList{}
statePack := &gamehall.SCGameState{}
scenes := HundredSceneMgrSington.GetPlatformScene(p.Platform, msg.GetGameId())
for _, value := range scenes {
pack.List = append(pack.List, &gamehall.GameSubRecord{
GameFreeId: proto.Int32(value.dbGameFree.GetId()),
NewLog: proto.Int32(-1),
LogCnt: proto.Int(len(value.GameLog)),
TotleLog: value.GameLog,
})
leftTime := int64(value.StateSec) - (time.Now().Unix() - value.StateTs)
if leftTime < 0 {
leftTime = 0
}
statePack.List = append(statePack.List, &gamehall.GameState{
GameFreeId: proto.Int32(value.dbGameFree.GetId()),
Ts: proto.Int64(leftTime),
Sec: proto.Int32(value.StateSec),
})
}
p.SendToClient(int(gamehall.GameHallPacketID_PACKET_SC_GAMESUBLIST), pack)
logger.Logger.Trace("SCGameSubList:", pack)
p.SendToClient(int(gamehall.GameHallPacketID_PACKET_SC_GAMESTATE), statePack)
logger.Logger.Trace("SCGameState:", statePack)
} else {
gameStateMgr.PlayerClear(p)
}
//if msg.GetStartOrEnd() {
// gameStateMgr.PlayerRegiste(p, msg.GetGameId(), msg.GetStartOrEnd())
// pack := &gamehall.SCGameSubList{}
// statePack := &gamehall.SCGameState{}
// scenes := HundredSceneMgrSington.GetPlatformScene(p.Platform, msg.GetGameId())
// for _, value := range scenes {
// pack.List = append(pack.List, &gamehall.GameSubRecord{
// GameFreeId: proto.Int32(value.dbGameFree.GetId()),
// NewLog: proto.Int32(-1),
// LogCnt: proto.Int(len(value.GameLog)),
// TotleLog: value.GameLog,
// })
// leftTime := int64(value.StateSec) - (time.Now().Unix() - value.StateTs)
// if leftTime < 0 {
// leftTime = 0
// }
// statePack.List = append(statePack.List, &gamehall.GameState{
// GameFreeId: proto.Int32(value.dbGameFree.GetId()),
// Ts: proto.Int64(leftTime),
// Sec: proto.Int32(value.StateSec),
// })
// }
// p.SendToClient(int(gamehall.GameHallPacketID_PACKET_SC_GAMESUBLIST), pack)
// logger.Logger.Trace("SCGameSubList:", pack)
// p.SendToClient(int(gamehall.GameHallPacketID_PACKET_SC_GAMESTATE), statePack)
// logger.Logger.Trace("SCGameState:", statePack)
//} else {
// gameStateMgr.PlayerClear(p)
//}
}
}
return nil

View File

@ -177,16 +177,7 @@ func (tm *TmMatch) CreateRobotGrades(round int) {
}
}
sort.Slice(tm.robotGrades[round-1], func(i, j int) bool {
if tm.robotGrades[round-1][i].copySnid > 0 && tm.robotGrades[round-1][j].copySnid == 0 {
return true
}
if tm.robotGrades[round-1][i].copySnid > 0 && tm.robotGrades[round-1][j].copySnid > 0 {
return tm.robotGrades[round-1][i].grade > tm.robotGrades[round-1][j].grade
}
if tm.robotGrades[round-1][i].copySnid == 0 && tm.robotGrades[round-1][j].copySnid > 0 {
return false
}
return false
return tm.robotGrades[round-1][i].grade > tm.robotGrades[round-1][j].grade
})
// 当前轮数据
@ -300,11 +291,11 @@ func (tm *TmMatch) RobotGradesDecline(round int) {
}
}
}
//logger.Logger.Tracef("======积分衰减======当前第 %v 轮============", round)
//for i, infos := range tm.robotGrades {
// logger.Logger.Tracef(">>>积分历史>>> 第 %v 轮", i)
// for _, info := range infos {
// logger.Logger.Trace("Snid: ", info.copySnid, " grade: ", info.grade, " copyLv: ", info.copyLv, " copyRoleId: ", info.copyRoleId)
// }
//}
logger.Logger.Tracef("======积分衰减======当前第 %v 轮============", round)
for i, infos := range tm.robotGrades {
logger.Logger.Tracef(">>>积分历史>>> 第 %v 轮", i)
for _, info := range infos {
logger.Logger.Trace("Snid: ", info.copySnid, " grade: ", info.grade, " copyLv: ", info.copyLv, " copyRoleId: ", info.copyRoleId)
}
}
}

View File

@ -137,9 +137,9 @@ func (this *Tournament) checkData(cfg *webapiproto.GameMatchDate) bool {
if num%4 != 0 { //必须是4的整倍数
return false
}
//if num <= cfg.MatchPromotion[i+1] { //必须递减
// return false
//}
if num <= cfg.MatchPromotion[i+1] { //必须递减
return false
}
}
}
@ -959,9 +959,7 @@ func (this *Tournament) NextRoundStartSingle(sortId int64, playerCtx *PlayerMatc
}
if promotionNum != 1 {
if int(promotionNum) < len(arr) {
arr = arr[:promotionNum]
}
arr = arr[:promotionNum]
playerCtx.tm.robotGrades[int(round)] = arr
}

Binary file not shown.