Compare commits
20 Commits
604f7099ec
...
2520ec2e7d
| Author | SHA1 | Date |
|---|---|---|
|
|
2520ec2e7d | |
|
|
9d246dcba3 | |
|
|
a2584b22bc | |
|
|
af7572f923 | |
|
|
2a7ada450a | |
|
|
5e212ae658 | |
|
|
d57909b05a | |
|
|
b24d97fe59 | |
|
|
f1dee4a54a | |
|
|
feda7fd5c1 | |
|
|
c429d41900 | |
|
|
a8500da1a7 | |
|
|
3526ef069f | |
|
|
699596d022 | |
|
|
ceac412a25 | |
|
|
4ec8d6bc22 | |
|
|
c72b74824e | |
|
|
41361621ef | |
|
|
d7b72cd6ea | |
|
|
869a2c91d2 |
|
|
@ -268,6 +268,10 @@ const (
|
|||
GainWayItemWeekActive = 82 //周活跃奖励
|
||||
GainWayContinueSign = 83 //累计签到
|
||||
GainWayBackend = 84 // 后台操作
|
||||
GainWayBuyCoin = 85 // 商城购买金币
|
||||
GainWayBuyItem = 86 // 商城购买道具
|
||||
GainWayBuyWeekCard = 87 // 商城购买周卡
|
||||
GainWayVipBuyCoin = 88 // vip商城购买金币
|
||||
)
|
||||
|
||||
// 后台选择 金币变化类型 的充值 类型id号起始
|
||||
|
|
@ -753,3 +757,8 @@ const (
|
|||
ChannelSwitchExchange = 1
|
||||
ChannelSwitchDropItem = 2
|
||||
)
|
||||
|
||||
// 特殊商品id
|
||||
const (
|
||||
ShopIdWeekCard = 970001 // 周卡
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"NewPlayerCoin":1000000,
|
||||
"NewPlayerCoin":100000000,
|
||||
"UpgradeAccountGiveCoin":0,
|
||||
"LogBatchWriteCount":1024,
|
||||
"LogBatchWriteInterval":1,
|
||||
|
|
@ -22,5 +22,6 @@
|
|||
"RobotInviteIntervalMax": 1,
|
||||
"ClosePreCreateRoom": true,
|
||||
"AgoraAddress": "http://47.105.78.29:8081",
|
||||
"InviteUrl": "http://47.105.78.29:8000/"
|
||||
"InviteUrl": "http://47.105.78.29:8000/",
|
||||
"RankTimeout": 5
|
||||
}
|
||||
|
|
@ -13,6 +13,7 @@ import (
|
|||
"mongo.games.com/game/dbproxy/svc"
|
||||
"mongo.games.com/game/model"
|
||||
"mongo.games.com/game/mq"
|
||||
rankproto "mongo.games.com/game/protocol/rank"
|
||||
)
|
||||
|
||||
var InviteNumCache = cache.NewMemoryCache()
|
||||
|
|
@ -44,7 +45,7 @@ func init() {
|
|||
if n > 0 {
|
||||
n++
|
||||
} else {
|
||||
n, err = svc.GetInviteNum(log.Platform, log.InviteSnId)
|
||||
n, err = svc.GetInviteNum(log.Platform, log.InviteSnId, int32(rankproto.RankInvite_InviteType_Total))
|
||||
if err != nil {
|
||||
logger.Logger.Errorf("BindInviteSnId error:%v", err)
|
||||
return err
|
||||
|
|
|
|||
|
|
@ -31,6 +31,8 @@ func CoinLogsCollection(plt string) *mongo.Collection {
|
|||
c_coinlogrec.EnsureIndex(mgo.Index{Key: []string{"gamefreeid"}, Background: true, Sparse: true})
|
||||
c_coinlogrec.EnsureIndex(mgo.Index{Key: []string{"cointype"}, Background: true, Sparse: true})
|
||||
c_coinlogrec.EnsureIndex(mgo.Index{Key: []string{"ts"}, Background: true, Sparse: true})
|
||||
c_coinlogrec.EnsureIndex(mgo.Index{Key: []string{"channel"}, Background: true, Sparse: true})
|
||||
c_coinlogrec.EnsureIndex(mgo.Index{Key: []string{"-ts", "logtype", "cointype", "channel"}, Background: true, Sparse: true})
|
||||
}
|
||||
return c_coinlogrec
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,11 +18,16 @@ func GameDetailedLogsCollection(plt string) *mongo.Collection {
|
|||
if s != nil {
|
||||
c_gamedetailed, first := s.DB().C(model.GameDetailedLogCollName)
|
||||
if first {
|
||||
c_gamedetailed.EnsureIndex(mgo.Index{Key: []string{"platform"}, Background: true, Sparse: true}) // 兼容老代码
|
||||
c_gamedetailed.EnsureIndex(mgo.Index{Key: []string{"gameid"}, Background: true, Sparse: true})
|
||||
c_gamedetailed.EnsureIndex(mgo.Index{Key: []string{"gamefreeid"}, Background: true, Sparse: true})
|
||||
c_gamedetailed.EnsureIndex(mgo.Index{Key: []string{"logid"}, Background: true, Sparse: true})
|
||||
c_gamedetailed.EnsureIndex(mgo.Index{Key: []string{"time"}, Background: true, Sparse: true})
|
||||
c_gamedetailed.EnsureIndex(mgo.Index{Key: []string{"-time"}, Background: true, Sparse: true})
|
||||
c_gamedetailed.EnsureIndex(mgo.Index{Key: []string{"ts"}, Background: true, Sparse: true})
|
||||
c_gamedetailed.EnsureIndex(mgo.Index{Key: []string{"matchid"}, Background: true, Sparse: true})
|
||||
c_gamedetailed.EnsureIndex(mgo.Index{Key: []string{"-ts", "gameid"}, Background: true, Sparse: true})
|
||||
c_gamedetailed.EnsureIndex(mgo.Index{Key: []string{"-ts", "gamefreeid"}, Background: true, Sparse: true})
|
||||
}
|
||||
return c_gamedetailed
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ func GamePlayerListLogsCollection(plt string) *mongo.Collection {
|
|||
if s != nil {
|
||||
c_gameplayerlistlog, first := s.DB().C(model.GamePlayerListLogCollName)
|
||||
if first {
|
||||
c_gameplayerlistlog.EnsureIndex(mgo.Index{Key: []string{"platform"}, Background: true, Sparse: true}) // 兼容老代码
|
||||
c_gameplayerlistlog.EnsureIndex(mgo.Index{Key: []string{"snid"}, Background: true, Sparse: true})
|
||||
c_gameplayerlistlog.EnsureIndex(mgo.Index{Key: []string{"channel"}, Background: true, Sparse: true})
|
||||
c_gameplayerlistlog.EnsureIndex(mgo.Index{Key: []string{"promoter"}, Background: true, Sparse: true})
|
||||
|
|
@ -32,7 +33,14 @@ func GamePlayerListLogsCollection(plt string) *mongo.Collection {
|
|||
c_gameplayerlistlog.EnsureIndex(mgo.Index{Key: []string{"gamedetailedlogid"}, Background: true, Sparse: true})
|
||||
c_gameplayerlistlog.EnsureIndex(mgo.Index{Key: []string{"ts"}, Background: true, Sparse: true})
|
||||
c_gameplayerlistlog.EnsureIndex(mgo.Index{Key: []string{"time"}, Background: true, Sparse: true})
|
||||
c_gameplayerlistlog.EnsureIndex(mgo.Index{Key: []string{"-time"}, Background: true, Sparse: true})
|
||||
c_gameplayerlistlog.EnsureIndex(mgo.Index{Key: []string{"name"}, Background: true, Sparse: true})
|
||||
c_gameplayerlistlog.EnsureIndex(mgo.Index{Key: []string{"matchid"}, Background: true, Sparse: true})
|
||||
c_gameplayerlistlog.EnsureIndex(mgo.Index{Key: []string{"matchtype"}, Background: true, Sparse: true})
|
||||
c_gameplayerlistlog.EnsureIndex(mgo.Index{Key: []string{"-ts", "gameid"}, Background: true, Sparse: true})
|
||||
c_gameplayerlistlog.EnsureIndex(mgo.Index{Key: []string{"-ts", "gamefreeid"}, Background: true, Sparse: true})
|
||||
c_gameplayerlistlog.EnsureIndex(mgo.Index{Key: []string{"-ts", "snid", "gameid"}, Background: true, Sparse: true})
|
||||
c_gameplayerlistlog.EnsureIndex(mgo.Index{Key: []string{"-ts", "snid", "gamefreeid"}, Background: true, Sparse: true})
|
||||
}
|
||||
return c_gameplayerlistlog
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,13 @@ func ItemLogsCollection(plt string) *mongo.Collection {
|
|||
c_itemlog, first := s.DB().C(model.ItemLogCollName)
|
||||
if first {
|
||||
c_itemlog.EnsureIndex(mgo.Index{Key: []string{"snid"}, Background: true, Sparse: true})
|
||||
c_itemlog.EnsureIndex(mgo.Index{Key: []string{"platform"}, Background: true, Sparse: true})
|
||||
c_itemlog.EnsureIndex(mgo.Index{Key: []string{"logtype"}, Background: true, Sparse: true})
|
||||
c_itemlog.EnsureIndex(mgo.Index{Key: []string{"itemid"}, Background: true, Sparse: true})
|
||||
c_itemlog.EnsureIndex(mgo.Index{Key: []string{"createts"}, Background: true, Sparse: true})
|
||||
c_itemlog.EnsureIndex(mgo.Index{Key: []string{"-createts"}, Background: true, Sparse: true})
|
||||
c_itemlog.EnsureIndex(mgo.Index{Key: []string{"typeid"}, Background: true, Sparse: true})
|
||||
c_itemlog.EnsureIndex(mgo.Index{Key: []string{"gameid"}, Background: true, Sparse: true})
|
||||
c_itemlog.EnsureIndex(mgo.Index{Key: []string{"gamefreeid"}, Background: true, Sparse: true})
|
||||
}
|
||||
return c_itemlog
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,12 @@ func MatchLogCollection(plt string) *mongo.Collection {
|
|||
c, first := s.DB().C(model.MatchLogCollName)
|
||||
if first {
|
||||
c.EnsureIndex(mgo.Index{Key: []string{"gamefreeid"}, Background: true, Sparse: true})
|
||||
c.EnsureIndex(mgo.Index{Key: []string{"matchid"}, Background: true, Sparse: true})
|
||||
c.EnsureIndex(mgo.Index{Key: []string{"starttime"}, Background: true, Sparse: true})
|
||||
c.EnsureIndex(mgo.Index{Key: []string{"-starttime"}, Background: true, Sparse: true})
|
||||
c.EnsureIndex(mgo.Index{Key: []string{"endtime"}, Background: true, Sparse: true})
|
||||
c.EnsureIndex(mgo.Index{Key: []string{"-endtime"}, Background: true, Sparse: true})
|
||||
c.EnsureIndex(mgo.Index{Key: []string{"sortid"}, Background: true, Sparse: true})
|
||||
}
|
||||
return c
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,9 @@ func InviteScoreCollection(plt string) *mongo.Collection {
|
|||
c.EnsureIndex(mgo.Index{Key: []string{"invitesnid"}, Background: true, Sparse: true})
|
||||
c.EnsureIndex(mgo.Index{Key: []string{"tp"}, Background: true, Sparse: true})
|
||||
c.EnsureIndex(mgo.Index{Key: []string{"ts"}, Background: true, Sparse: true})
|
||||
c.EnsureIndex(mgo.Index{Key: []string{"-ts"}, Background: true, Sparse: true})
|
||||
c.EnsureIndex(mgo.Index{Key: []string{"weekindex"}, Background: true, Sparse: true})
|
||||
c.EnsureIndex(mgo.Index{Key: []string{"monthindex"}, Background: true, Sparse: true})
|
||||
}
|
||||
return c
|
||||
}
|
||||
|
|
@ -136,6 +139,25 @@ func (b *BindScoreSvc) SaveInviteScore(req *model.InviteScore, ret *bool) error
|
|||
return InviteScoreColError
|
||||
}
|
||||
|
||||
ts := req.Ts
|
||||
if req.Tp != common.InviteScoreTypeBind {
|
||||
a := &model.InviteScore{}
|
||||
err = c.Find(bson.M{"snid": req.SnId, "tp": common.InviteScoreTypeBind}).One(a)
|
||||
if err != nil && !errors.Is(err, mgo.ErrNotFound) {
|
||||
logger.Logger.Errorf("GetInviteScore Find BindTime error:%v", err)
|
||||
return err
|
||||
}
|
||||
ts = a.Ts
|
||||
}
|
||||
|
||||
bindTime := time.Unix(0, ts).Local()
|
||||
year, month, day := bindTime.Date()
|
||||
today := time.Date(year, month, day, 0, 0, 0, 0, time.Local)
|
||||
// 本周起始日期(周日)
|
||||
req.WeekIndex = today.AddDate(0, 0, -int(today.Weekday())).Unix()
|
||||
// 本月起始日期
|
||||
req.MonthIndex = time.Date(year, month, 1, 0, 0, 0, 0, time.Local).Unix()
|
||||
|
||||
err = c.Insert(req)
|
||||
if err != nil {
|
||||
logger.Logger.Errorf("SaveInviteScore Insert error:%v", err)
|
||||
|
|
@ -158,19 +180,21 @@ func (b *BindScoreSvc) GetInviteRankList(req *model.FindPlayerRankInviteListArgs
|
|||
return InviteScoreColError
|
||||
}
|
||||
|
||||
NowTime := time.Now().Local()
|
||||
endTime := NowTime.UnixNano()
|
||||
startTime := NowTime.AddDate(-100, 0, 0).UnixNano()
|
||||
|
||||
year, month, day := NowTime.Date()
|
||||
matchParam := bson.M{
|
||||
"score": bson.M{"$gt": 0},
|
||||
}
|
||||
now := time.Now().Local()
|
||||
startTime := now.AddDate(-100, 0, 0).UnixNano()
|
||||
year, month, day := now.Date()
|
||||
today := time.Date(year, month, day, 0, 0, 0, 0, time.Local)
|
||||
if req.RankType == int32(rankproto.RankInvite_InviteType_Week) {
|
||||
// 本周起始日期(周日)
|
||||
startTime = today.AddDate(0, 0, -int(today.Weekday())).UnixNano()
|
||||
matchParam["weekindex"] = today.AddDate(0, 0, -int(today.Weekday())).Unix()
|
||||
} else if req.RankType == int32(rankproto.RankInvite_InviteType_Month) {
|
||||
// 本月起始日期
|
||||
startTime = time.Date(year, month, 1, 0, 0, 0, 0, time.Local).UnixNano()
|
||||
//startTime = NowTime.AddDate(0, 0, -NowTime.Day()+1).UnixNano()
|
||||
matchParam["monthindex"] = time.Date(year, month, 1, 0, 0, 0, 0, time.Local).Unix()
|
||||
} else {
|
||||
matchParam["ts"] = bson.M{"$gte": startTime, "$lte": now.UnixNano()}
|
||||
}
|
||||
|
||||
type M struct {
|
||||
|
|
@ -180,10 +204,7 @@ func (b *BindScoreSvc) GetInviteRankList(req *model.FindPlayerRankInviteListArgs
|
|||
|
||||
var tc []M
|
||||
err := c.Pipe([]bson.M{
|
||||
{"$match": bson.M{
|
||||
"score": bson.M{"$gt": 0},
|
||||
"ts": bson.M{"$gte": startTime, "$lte": endTime},
|
||||
}},
|
||||
{"$match": matchParam},
|
||||
{"$group": bson.M{
|
||||
"_id": bson.M{
|
||||
"invitesnid": "$invitesnid",
|
||||
|
|
@ -249,7 +270,7 @@ func (b *BindScoreSvc) GetInviteRankList(req *model.FindPlayerRankInviteListArgs
|
|||
}
|
||||
RankInvite.ModId = int32(roleId)
|
||||
|
||||
RankInvite.InviteNum, _ = GetInviteNum(req.Platform, inviteInfo.InviteSnId)
|
||||
RankInvite.InviteNum, _ = GetInviteNum(req.Platform, inviteInfo.InviteSnId, req.RankType)
|
||||
ret.List = append(ret.List, &RankInvite)
|
||||
|
||||
break
|
||||
|
|
@ -262,6 +283,86 @@ func (b *BindScoreSvc) GetInviteRankList(req *model.FindPlayerRankInviteListArgs
|
|||
return nil
|
||||
}
|
||||
|
||||
func (b *BindScoreSvc) GetInviteScoreByType(req *model.FindPlayerRankInviteScoreArgs, ret *model.FindPlayerRankInviteScoreReply) error {
|
||||
c := InviteScoreCollection(req.Platform)
|
||||
if c == nil {
|
||||
return InviteScoreColError
|
||||
}
|
||||
|
||||
matchParam := bson.M{
|
||||
"invitesnid": req.SnId,
|
||||
"score": bson.M{"$gt": 0},
|
||||
}
|
||||
now := time.Now().Local()
|
||||
startTime := now.AddDate(-100, 0, 0).UnixNano()
|
||||
year, month, day := now.Date()
|
||||
today := time.Date(year, month, day, 0, 0, 0, 0, time.Local)
|
||||
if req.RankType == int32(rankproto.RankInvite_InviteType_Week) {
|
||||
// 本周起始日期(周日)
|
||||
matchParam["weekindex"] = today.AddDate(0, 0, -int(today.Weekday())).Unix()
|
||||
} else if req.RankType == int32(rankproto.RankInvite_InviteType_Month) {
|
||||
// 本月起始日期
|
||||
matchParam["monthindex"] = time.Date(year, month, 1, 0, 0, 0, 0, time.Local).Unix()
|
||||
} else {
|
||||
matchParam["ts"] = bson.M{"$gte": startTime, "$lte": now.UnixNano()}
|
||||
}
|
||||
|
||||
type M struct {
|
||||
InviteSnId int32 // 邀请人id
|
||||
Score int64 // 积分
|
||||
}
|
||||
|
||||
var tc []M
|
||||
err := c.Pipe([]bson.M{
|
||||
{"$match": matchParam},
|
||||
{"$group": bson.M{
|
||||
"_id": nil,
|
||||
"invitesnid": bson.M{"$first": "$invitesnid"},
|
||||
"score": bson.M{"$sum": "$score"},
|
||||
}},
|
||||
}).AllowDiskUse().All(&tc)
|
||||
if err != nil {
|
||||
logger.Logger.Error("GetInviteScoreByType z AllowDiskUse is error", err)
|
||||
return err
|
||||
}
|
||||
|
||||
type PInfo struct {
|
||||
SnId int32
|
||||
Name string // 昵称
|
||||
Roles *model.RolePetInfo
|
||||
}
|
||||
|
||||
var retPlayer PInfo
|
||||
u := PlayerDataCollection(req.Platform)
|
||||
if u == nil {
|
||||
return err
|
||||
}
|
||||
err = u.Find(bson.M{"snid": req.SnId}).Select(bson.M{"snid": 1, "name": 1, "roles": 1}).One(&retPlayer)
|
||||
if err != nil {
|
||||
logger.Logger.Error("svc.GetInviteScoreByType is error", err)
|
||||
return nil
|
||||
}
|
||||
|
||||
var rankInvite model.PlayerRankInvite
|
||||
rankInvite.Name = retPlayer.Name
|
||||
if len(tc) > 0 {
|
||||
rankInvite.Score = tc[0].Score
|
||||
}
|
||||
rankInvite.SnId = req.SnId
|
||||
// 头像模型ID
|
||||
roleId := common.DefaultRoleId
|
||||
if retPlayer.Roles != nil {
|
||||
roleId = int(retPlayer.Roles.ModId)
|
||||
}
|
||||
rankInvite.ModId = int32(roleId)
|
||||
rankInvite.InviteNum, _ = GetInviteNum(req.Platform, req.SnId, req.RankType)
|
||||
ret.Data = rankInvite
|
||||
|
||||
ret.RankType = req.RankType
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (b *BindScoreSvc) GetInviteList(req *model.InviteLisArgs, ret *model.InviteListRet) error {
|
||||
c := InviteScoreCollection(req.Platform)
|
||||
if c == nil {
|
||||
|
|
|
|||
|
|
@ -18,6 +18,10 @@ func MessageCollection(plt string) *mongo.Collection {
|
|||
if first {
|
||||
c.EnsureIndex(mgo.Index{Key: []string{"snid"}, Background: true, Sparse: true})
|
||||
c.EnsureIndex(mgo.Index{Key: []string{"state"}, Background: true, Sparse: true})
|
||||
c.EnsureIndex(mgo.Index{Key: []string{"mtype"}, Background: true, Sparse: true})
|
||||
c.EnsureIndex(mgo.Index{Key: []string{"srcid"}, Background: true, Sparse: true})
|
||||
c.EnsureIndex(mgo.Index{Key: []string{"-creatts"}, Background: true, Sparse: true})
|
||||
c.EnsureIndex(mgo.Index{Key: []string{"creatts"}, Background: true, Sparse: true})
|
||||
}
|
||||
return c
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,13 +12,16 @@ import (
|
|||
"time"
|
||||
|
||||
"mongo.games.com/goserver/core/basic"
|
||||
"mongo.games.com/goserver/core/logger"
|
||||
"mongo.games.com/goserver/core/task"
|
||||
|
||||
"github.com/globalsign/mgo"
|
||||
"github.com/globalsign/mgo/bson"
|
||||
|
||||
"mongo.games.com/game/common"
|
||||
"mongo.games.com/game/dbproxy/mongo"
|
||||
"mongo.games.com/game/model"
|
||||
"mongo.games.com/goserver/core/logger"
|
||||
rankproto "mongo.games.com/game/protocol/rank"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
@ -37,13 +40,12 @@ func PlayerDataCollection(plt string) *mongo.Collection {
|
|||
c_playerdata.EnsureIndex(mgo.Index{Key: []string{"snid"}, Unique: true, Background: true, Sparse: true})
|
||||
c_playerdata.EnsureIndex(mgo.Index{Key: []string{"channel"}, Background: true, Sparse: true})
|
||||
c_playerdata.EnsureIndex(mgo.Index{Key: []string{"tel"}, Background: true, Sparse: true})
|
||||
c_playerdata.EnsureIndex(mgo.Index{Key: []string{"bankaccount"}, Background: true, Sparse: true})
|
||||
c_playerdata.EnsureIndex(mgo.Index{Key: []string{"alipayaccount"}, Background: true, Sparse: true})
|
||||
c_playerdata.EnsureIndex(mgo.Index{Key: []string{"alipayaccname"}, Background: true, Sparse: true})
|
||||
c_playerdata.EnsureIndex(mgo.Index{Key: []string{"bankaccname"}, Background: true, Sparse: true})
|
||||
c_playerdata.EnsureIndex(mgo.Index{Key: []string{"invitecode"}, Background: true, Sparse: true})
|
||||
c_playerdata.EnsureIndex(mgo.Index{Key: []string{"invitesnid"}, Background: true, Sparse: true})
|
||||
c_playerdata.EnsureIndex(mgo.Index{Key: []string{"name"}, Background: true, Sparse: true})
|
||||
c_playerdata.EnsureIndex(mgo.Index{Key: []string{"createtime"}, Background: true, Sparse: true})
|
||||
c_playerdata.EnsureIndex(mgo.Index{Key: []string{"-createtime"}, Background: true, Sparse: true})
|
||||
c_playerdata.EnsureIndex(mgo.Index{Key: []string{"othercode"}, Background: true, Sparse: true})
|
||||
}
|
||||
return c_playerdata
|
||||
}
|
||||
|
|
@ -1509,7 +1511,7 @@ func (svc *PlayerDataSvc) GetPlayerInviteSnid(req *model.PlayerIsExistBySnIdArgs
|
|||
}
|
||||
|
||||
func (svc *PlayerDataSvc) GetInviteNum(req *model.PlayerIsExistBySnIdArgs, resp *int32) error {
|
||||
n, err := GetInviteNum(req.Plt, req.SnId)
|
||||
n, err := GetInviteNum(req.Plt, req.SnId, int32(rankproto.RankInvite_InviteType_Total))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
@ -1517,15 +1519,43 @@ func (svc *PlayerDataSvc) GetInviteNum(req *model.PlayerIsExistBySnIdArgs, resp
|
|||
return nil
|
||||
}
|
||||
|
||||
func GetInviteNum(platform string, snId int32) (int32, error) {
|
||||
c := PlayerDataCollection(platform)
|
||||
if c == nil {
|
||||
return 0, PlayerColError
|
||||
}
|
||||
func GetInviteNum(platform string, snId int32, rankType int32) (int32, error) {
|
||||
var err error
|
||||
var n int
|
||||
switch rankType {
|
||||
case int32(rankproto.RankInvite_InviteType_Week), int32(rankproto.RankInvite_InviteType_Month):
|
||||
matchParam := bson.M{
|
||||
"invitesnid": snId,
|
||||
"tp": common.InviteScoreTypeBind,
|
||||
}
|
||||
now := time.Now().Local()
|
||||
year, month, day := now.Date()
|
||||
today := time.Date(year, month, day, 0, 0, 0, 0, time.Local)
|
||||
if rankType == int32(rankproto.RankInvite_InviteType_Week) {
|
||||
// 本周起始日期(周日)
|
||||
matchParam["weekindex"] = today.AddDate(0, 0, -int(today.Weekday())).Unix()
|
||||
} else if rankType == int32(rankproto.RankInvite_InviteType_Month) {
|
||||
// 本月起始日期
|
||||
matchParam["monthindex"] = time.Date(year, month, 1, 0, 0, 0, 0, time.Local).Unix()
|
||||
}
|
||||
c := InviteScoreCollection(platform)
|
||||
if c == nil {
|
||||
return 0, InviteScoreColError
|
||||
}
|
||||
n, err = c.Find(matchParam).Count()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
n, err := c.Find(bson.M{"invitesnid": snId}).Count()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
default:
|
||||
c := PlayerDataCollection(platform)
|
||||
if c == nil {
|
||||
return 0, PlayerColError
|
||||
}
|
||||
n, err = c.Find(bson.M{"invitesnid": snId}).Count()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
}
|
||||
|
||||
return int32(n), nil
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ const (
|
|||
ETCDKEY_GAME_NOTICE = "/game/common_notice"
|
||||
ETCDKEY_SHOP_ITEM = "/game/item_shop"
|
||||
ETCDKEY_GAME_MATCH = "/game/game_match"
|
||||
ETCDKEY_GAME_MATCH_TYPE = "/game/match_type"
|
||||
ETCDKEY_ACT_TURNPLATE = "/game/act_turnplate"
|
||||
ETCDKEY_ACT_7SIGN = "/game/act_7sign"
|
||||
ETCDKEY_ACT_BLINDBOX = "/game/act_blindbox"
|
||||
|
|
|
|||
|
|
@ -68,33 +68,30 @@ func init() {
|
|||
}))
|
||||
|
||||
//删除场景
|
||||
// 立刻删除,不管游戏是否结束
|
||||
netlib.RegisterFactory(int(server.SSPacketID_PACKET_WG_DESTROYSCENE), netlib.PacketFactoryWrapper(func() interface{} {
|
||||
return &server.WGDestroyScene{}
|
||||
}))
|
||||
netlib.RegisterHandler(int(server.SSPacketID_PACKET_WG_DESTROYSCENE), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
|
||||
logger.Logger.Trace("receive WGDestroyScene:", pack)
|
||||
if msg, ok := pack.(*server.WGDestroyScene); ok {
|
||||
sceneId := int(msg.GetSceneId())
|
||||
s := base.SceneMgrSington.GetScene(sceneId)
|
||||
if s != nil {
|
||||
if gameScene, ok := s.ExtraData.(base.GameScene); ok {
|
||||
gameScene.SceneDestroy(true)
|
||||
msg, ok := pack.(*server.WGDestroyScene)
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
if !msg.IsGrace {
|
||||
// 立刻删除,不管游戏是否结束
|
||||
for _, v := range msg.Ids {
|
||||
s := base.SceneMgrSington.GetScene(int(v))
|
||||
if s != nil {
|
||||
if gameScene, ok := s.ExtraData.(base.GameScene); ok {
|
||||
gameScene.SceneDestroy(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}))
|
||||
|
||||
//删除场景
|
||||
netlib.RegisterFactory(int(server.SSPacketID_PACKET_WG_GRACE_DESTROYSCENE), netlib.PacketFactoryWrapper(func() interface{} {
|
||||
return &server.WGGraceDestroyScene{}
|
||||
}))
|
||||
netlib.RegisterHandler(int(server.SSPacketID_PACKET_WG_GRACE_DESTROYSCENE), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
|
||||
logger.Logger.Trace("receive WGGraceDestroyScene:", pack)
|
||||
if msg, ok := pack.(*server.WGGraceDestroyScene); ok {
|
||||
ids := msg.GetIds()
|
||||
for _, id := range ids {
|
||||
s := base.SceneMgrSington.GetScene(int(id))
|
||||
} else {
|
||||
// 游戏结束后删除房间
|
||||
for _, v := range msg.Ids {
|
||||
s := base.SceneMgrSington.GetScene(int(v))
|
||||
if s != nil {
|
||||
if s.IsHundredScene() || s.Gaming {
|
||||
s.SetGraceDestroy(true)
|
||||
|
|
@ -109,6 +106,7 @@ func init() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}))
|
||||
|
||||
|
|
|
|||
|
|
@ -445,6 +445,7 @@ func (this *Player) AddCoin(num int64, gainWay int32, syncFlag int, oper, remark
|
|||
log := model.NewCoinLogEx(&model.CoinLogParam{
|
||||
Platform: this.Platform,
|
||||
SnID: this.SnId,
|
||||
Channel: this.Channel,
|
||||
ChangeType: common.BillTypeCoin,
|
||||
ChangeNum: num,
|
||||
RemainNum: this.Coin,
|
||||
|
|
@ -529,6 +530,7 @@ func (this *Player) AddCoinAsync(num int64, gainWay int32, notifyC, broadcast bo
|
|||
log := model.NewCoinLogEx(&model.CoinLogParam{
|
||||
Platform: this.Platform,
|
||||
SnID: this.SnId,
|
||||
Channel: this.Channel,
|
||||
ChangeType: common.BillTypeCoin,
|
||||
ChangeNum: num,
|
||||
RemainNum: this.Coin,
|
||||
|
|
|
|||
|
|
@ -1046,8 +1046,8 @@ func (this *Scene) Destroy(force bool) {
|
|||
isCompleted := this.sp.IsCompleted(this) || this.completed
|
||||
SceneMgrSington.DestroyScene(this.SceneId)
|
||||
pack := &server.GWDestroyScene{
|
||||
SceneId: proto.Int(this.SceneId),
|
||||
IsCompleted: proto.Bool(isCompleted),
|
||||
SceneId: int64(this.SceneId),
|
||||
IsCompleted: isCompleted,
|
||||
}
|
||||
proto.SetDefaults(pack)
|
||||
this.SendToWorld(int(server.SSPacketID_PACKET_GW_DESTROYSCENE), pack)
|
||||
|
|
|
|||
|
|
@ -77,6 +77,7 @@ func NewCoinLog() *CoinLog {
|
|||
type CoinLogParam struct {
|
||||
Platform string // 平台id
|
||||
SnID int32 // 玩家id
|
||||
Channel string // 渠道
|
||||
ChangeType int32 // 变化类型 common.BillTypeCoin 金币 common.BillTypeDiamond 钻石
|
||||
ChangeNum int64 // 变化数量
|
||||
RemainNum int64 // 余额
|
||||
|
|
@ -92,8 +93,9 @@ type CoinLogParam struct {
|
|||
func NewCoinLogEx(param *CoinLogParam) *CoinLog {
|
||||
tNow := time.Now()
|
||||
cl := NewCoinLog()
|
||||
cl.SnId = param.SnID
|
||||
cl.Platform = param.Platform
|
||||
cl.SnId = param.SnID
|
||||
cl.Channel = param.Channel
|
||||
cl.Count = param.ChangeNum
|
||||
cl.Oper = param.Operator
|
||||
cl.Remark = param.Remark
|
||||
|
|
|
|||
|
|
@ -46,18 +46,8 @@ type GameParam struct {
|
|||
InvalidRobotAccRate int //每次更换过期机器人账号的比例,百分比
|
||||
InvalidRobotDay int //机器人过期的天数
|
||||
CreatePrivateSceneCnt int //每人可以创建私有房间数量
|
||||
PrivateSceneLogLimit int //私有房间日志上限
|
||||
PrivateSceneFreeDistroySec int //私有房间免费解散时间,默认600秒
|
||||
PrivateSceneDestroyTax int //私有房间提前解散税收,百分比
|
||||
NumOfGamesConfig []int32 //私人房间局数
|
||||
BacklogGameHorseRaceLamp int //游戏内公告储备多少条,超出丢弃
|
||||
IsRobFightTest bool //是否开启机器人自己对战功能
|
||||
BullFightCtrl0108 bool //牛牛是否使用新功能规则
|
||||
OpenPoolRec bool //是否打开水池数据记录
|
||||
CoinPoolMinOutRate int32 //水池最小出分
|
||||
CoinPoolMaxOutRate int32 //水池最大出分
|
||||
MaxRTP float64 //最大rtp
|
||||
AddRTP float64 //附加rtp
|
||||
PlayerWatchNum int32 //百人游戏允许围观的局数
|
||||
NotifyPlayerWatchNum int32 //百人游戏围观多少局的时候开始提示
|
||||
CgAddr string //后台cg工程地址
|
||||
|
|
@ -65,7 +55,6 @@ type GameParam struct {
|
|||
MaxAudienceNum int //最大观战人数
|
||||
IsFindRoomByGroup bool //查询房间列表时是否使用互通查询,默认是不使用
|
||||
NoOpTimes int32 //对战场允许托管的局数
|
||||
UseBevRobot bool //是否使用行为树机器人
|
||||
ClosePreCreateRoom bool //关闭予创建房间
|
||||
CloseQMThr bool //关闭全民三方流水计算
|
||||
ErrResetMongo bool //发生主从问题,是否重置连接
|
||||
|
|
@ -89,7 +78,8 @@ type GameParam struct {
|
|||
RankPlayerLevelMaxNum int //等级榜最大人数
|
||||
CloseChannelSwitch bool //关闭渠道开关功能
|
||||
BackendTimeLocal int //后台时区
|
||||
GameStaticsFightVersion int // 对战场游戏统计数据版本号
|
||||
GameStaticsFightVersion int // 对战场统计数据版本
|
||||
TestRankMatchAward bool // 测试段位奖励领取通知,直接改玩家排位积分使玩家获得奖励
|
||||
}
|
||||
|
||||
var GameParamPath = "../data/gameparam.json"
|
||||
|
|
@ -129,15 +119,6 @@ func InitGameParam() {
|
|||
if GameParamData.KickoutDefaultFreezeMinute == 0 {
|
||||
GameParamData.KickoutDefaultFreezeMinute = 5
|
||||
}
|
||||
|
||||
if GameParamData.MaxRTP <= 0.00001 {
|
||||
GameParamData.MaxRTP = 0.999999
|
||||
}
|
||||
|
||||
if GameParamData.AddRTP <= 0.00001 {
|
||||
GameParamData.AddRTP = 0.1
|
||||
}
|
||||
|
||||
mgo.SetDebug(GameParamData.MongoDebug)
|
||||
if GameParamData.RbAutoBalance {
|
||||
if GameParamData.RbAutoBalanceRate == 0 {
|
||||
|
|
@ -168,26 +149,6 @@ func InitGameParam() {
|
|||
if GameParamData.CreatePrivateSceneCnt == 0 {
|
||||
GameParamData.CreatePrivateSceneCnt = 20
|
||||
}
|
||||
if GameParamData.PrivateSceneLogLimit == 0 {
|
||||
GameParamData.PrivateSceneLogLimit = 7000
|
||||
}
|
||||
if GameParamData.PrivateSceneFreeDistroySec == 0 {
|
||||
GameParamData.PrivateSceneFreeDistroySec = 600
|
||||
}
|
||||
if GameParamData.PrivateSceneDestroyTax == 0 {
|
||||
GameParamData.PrivateSceneDestroyTax = 5
|
||||
}
|
||||
if len(GameParamData.NumOfGamesConfig) == 0 {
|
||||
GameParamData.NumOfGamesConfig = []int32{5, 10, 20, 50}
|
||||
}
|
||||
if GameParamData.CoinPoolMinOutRate == 0 {
|
||||
GameParamData.CoinPoolMinOutRate = 33
|
||||
}
|
||||
|
||||
if GameParamData.CoinPoolMaxOutRate == 0 {
|
||||
GameParamData.CoinPoolMaxOutRate = 66
|
||||
}
|
||||
|
||||
if GameParamData.PlayerWatchNum <= 2 {
|
||||
GameParamData.PlayerWatchNum = 20
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,6 +54,8 @@ type InviteScore struct {
|
|||
Score int64 // 积分
|
||||
Ts int64 // 时间戳
|
||||
Money int64 // 充值金额
|
||||
WeekIndex int64 // 所在周
|
||||
MonthIndex int64 // 所在月
|
||||
}
|
||||
|
||||
type InviteScoreReq struct {
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ type MatchLog struct {
|
|||
StartTime time.Time //开始时间
|
||||
EndTime time.Time //结束时间
|
||||
Players []*MatchPlayer //参赛人员数据
|
||||
SortId int64 // 本场id
|
||||
}
|
||||
|
||||
var (
|
||||
|
|
|
|||
|
|
@ -15,8 +15,9 @@ type RankAward struct {
|
|||
}
|
||||
|
||||
type PlayerRankInfo struct {
|
||||
Score int64 // 积分
|
||||
Awards []*RankAward // 赛季奖励
|
||||
LastScore int64 // 上次积分
|
||||
Score int64 // 积分
|
||||
Awards []*RankAward // 赛季奖励
|
||||
}
|
||||
|
||||
type PlayerRankSeason struct {
|
||||
|
|
|
|||
|
|
@ -154,6 +154,32 @@ func FindPlayerRankInviteList(args *FindPlayerRankInviteListArgs) (*FindPlayerRa
|
|||
return ret, nil
|
||||
}
|
||||
|
||||
type FindPlayerRankInviteScoreArgs struct {
|
||||
Platform string
|
||||
RankType int32 // 邀请榜时间类型: 总榜 周榜 月榜
|
||||
SnId int32
|
||||
}
|
||||
|
||||
type FindPlayerRankInviteScoreReply struct {
|
||||
RankType int32 // 邀请榜时间类型: 总榜 周榜 月榜
|
||||
Data PlayerRankInvite
|
||||
}
|
||||
|
||||
func FindPlayerRankInviteScoreType(args *FindPlayerRankInviteScoreArgs) (*FindPlayerRankInviteScoreReply, error) {
|
||||
if rpcCli == nil {
|
||||
logger.Logger.Error("model.FindPlayerRankInviteScoreType rpcCli == nil")
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
ret := new(FindPlayerRankInviteScoreReply)
|
||||
err := rpcCli.CallWithTimeout("BindScoreSvc.GetInviteScoreByType", args, ret, time.Second*30)
|
||||
if err != nil {
|
||||
logger.Logger.Error("FindPlayerRankInviteScoreType error:", err)
|
||||
return ret, err
|
||||
}
|
||||
return ret, nil
|
||||
}
|
||||
|
||||
type WinCoinInfo struct {
|
||||
SnId int32
|
||||
Name string
|
||||
|
|
|
|||
|
|
@ -136,11 +136,12 @@ type SeasonInfo struct {
|
|||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Id int32 `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty"` // 排位类型
|
||||
Lv int32 `protobuf:"varint,2,opt,name=Lv,proto3" json:"Lv,omitempty"` // 段位
|
||||
Score int64 `protobuf:"varint,3,opt,name=Score,proto3" json:"Score,omitempty"` // 积分
|
||||
LastLv int32 `protobuf:"varint,4,opt,name=LastLv,proto3" json:"LastLv,omitempty"` // 上赛季段位
|
||||
LastScore int64 `protobuf:"varint,5,opt,name=LastScore,proto3" json:"LastScore,omitempty"` // 上赛季积分
|
||||
Id int32 `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty"` // 排位类型
|
||||
Lv int32 `protobuf:"varint,2,opt,name=Lv,proto3" json:"Lv,omitempty"` // 段位
|
||||
Score int64 `protobuf:"varint,3,opt,name=Score,proto3" json:"Score,omitempty"` // 积分
|
||||
LastLv int32 `protobuf:"varint,4,opt,name=LastLv,proto3" json:"LastLv,omitempty"` // 上赛季段位
|
||||
LastScore int64 `protobuf:"varint,5,opt,name=LastScore,proto3" json:"LastScore,omitempty"` // 上赛季积分
|
||||
Award *AwardItem `protobuf:"bytes,6,opt,name=Award,proto3" json:"Award,omitempty"` // 奖励列表
|
||||
}
|
||||
|
||||
func (x *SeasonInfo) Reset() {
|
||||
|
|
@ -210,6 +211,13 @@ func (x *SeasonInfo) GetLastScore() int64 {
|
|||
return 0
|
||||
}
|
||||
|
||||
func (x *SeasonInfo) GetAward() *AwardItem {
|
||||
if x != nil {
|
||||
return x.Award
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// PACKET_RM_SCRMSeasonInfo
|
||||
type SCRMSeasonInfo struct {
|
||||
state protoimpl.MessageState
|
||||
|
|
@ -791,78 +799,81 @@ var File_rankmatch_proto protoreflect.FileDescriptor
|
|||
var file_rankmatch_proto_rawDesc = []byte{
|
||||
0x0a, 0x0f, 0x72, 0x61, 0x6e, 0x6b, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x12, 0x09, 0x72, 0x61, 0x6e, 0x6b, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x22, 0x10, 0x0a, 0x0e,
|
||||
0x43, 0x53, 0x52, 0x4d, 0x53, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x78,
|
||||
0x0a, 0x0a, 0x53, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02,
|
||||
0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02,
|
||||
0x4c, 0x76, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x4c, 0x76, 0x12, 0x14, 0x0a, 0x05,
|
||||
0x53, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x53, 0x63, 0x6f,
|
||||
0x72, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x4c, 0x61, 0x73, 0x74, 0x4c, 0x76, 0x18, 0x04, 0x20, 0x01,
|
||||
0x28, 0x05, 0x52, 0x06, 0x4c, 0x61, 0x73, 0x74, 0x4c, 0x76, 0x12, 0x1c, 0x0a, 0x09, 0x4c, 0x61,
|
||||
0x73, 0x74, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x4c,
|
||||
0x61, 0x73, 0x74, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x22, 0x6f, 0x0a, 0x0e, 0x53, 0x43, 0x52, 0x4d,
|
||||
0x53, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x54, 0x69,
|
||||
0x6d, 0x65, 0x53, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x03, 0x28, 0x03, 0x52, 0x09, 0x54,
|
||||
0x69, 0x6d, 0x65, 0x53, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2f, 0x0a, 0x07, 0x53, 0x65, 0x61, 0x73,
|
||||
0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x72, 0x61, 0x6e, 0x6b,
|
||||
0x6d, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x53, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f,
|
||||
0x52, 0x07, 0x53, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x73, 0x22, 0x20, 0x0a, 0x0e, 0x43, 0x53, 0x52,
|
||||
0x4d, 0x52, 0x61, 0x6e, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x49,
|
||||
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x22, 0x54, 0x0a, 0x08, 0x52,
|
||||
0x61, 0x6e, 0x6b, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20,
|
||||
0x43, 0x53, 0x52, 0x4d, 0x53, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0xa4,
|
||||
0x01, 0x0a, 0x0a, 0x53, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a,
|
||||
0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x0e, 0x0a,
|
||||
0x02, 0x4c, 0x76, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x4c, 0x76, 0x12, 0x14, 0x0a,
|
||||
0x05, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x53, 0x63,
|
||||
0x6f, 0x72, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x4c, 0x61, 0x73, 0x74, 0x4c, 0x76, 0x18, 0x04, 0x20,
|
||||
0x01, 0x28, 0x05, 0x52, 0x06, 0x4c, 0x61, 0x73, 0x74, 0x4c, 0x76, 0x12, 0x1c, 0x0a, 0x09, 0x4c,
|
||||
0x61, 0x73, 0x74, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09,
|
||||
0x4c, 0x61, 0x73, 0x74, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x2a, 0x0a, 0x05, 0x41, 0x77, 0x61,
|
||||
0x72, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x72, 0x61, 0x6e, 0x6b, 0x6d,
|
||||
0x61, 0x74, 0x63, 0x68, 0x2e, 0x41, 0x77, 0x61, 0x72, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05,
|
||||
0x41, 0x77, 0x61, 0x72, 0x64, 0x22, 0x6f, 0x0a, 0x0e, 0x53, 0x43, 0x52, 0x4d, 0x53, 0x65, 0x61,
|
||||
0x73, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20,
|
||||
0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x54, 0x69, 0x6d, 0x65, 0x53,
|
||||
0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x03, 0x28, 0x03, 0x52, 0x09, 0x54, 0x69, 0x6d, 0x65,
|
||||
0x53, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2f, 0x0a, 0x07, 0x53, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x73,
|
||||
0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x72, 0x61, 0x6e, 0x6b, 0x6d, 0x61, 0x74,
|
||||
0x63, 0x68, 0x2e, 0x53, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x53,
|
||||
0x65, 0x61, 0x73, 0x6f, 0x6e, 0x73, 0x22, 0x20, 0x0a, 0x0e, 0x43, 0x53, 0x52, 0x4d, 0x52, 0x61,
|
||||
0x6e, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x22, 0x54, 0x0a, 0x08, 0x52, 0x61, 0x6e, 0x6b,
|
||||
0x49, 0x74, 0x65, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
|
||||
0x52, 0x02, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x4c, 0x76, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05,
|
||||
0x52, 0x02, 0x4c, 0x76, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x63, 0x6f, 0x72,
|
||||
0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x22, 0x3b,
|
||||
0x0a, 0x0e, 0x53, 0x43, 0x52, 0x4d, 0x52, 0x61, 0x6e, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
|
||||
0x12, 0x29, 0x0a, 0x05, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32,
|
||||
0x13, 0x2e, 0x72, 0x61, 0x6e, 0x6b, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x52, 0x61, 0x6e, 0x6b,
|
||||
0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x22, 0x21, 0x0a, 0x0f, 0x43,
|
||||
0x53, 0x52, 0x4d, 0x41, 0x77, 0x61, 0x72, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x0e,
|
||||
0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x22, 0x29,
|
||||
0x0a, 0x05, 0x41, 0x77, 0x61, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20,
|
||||
0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x4e, 0x75, 0x6d, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x4e, 0x75, 0x6d, 0x22, 0x8d, 0x01, 0x0a, 0x09, 0x41, 0x77,
|
||||
0x61, 0x72, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20,
|
||||
0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x4c, 0x76, 0x18, 0x02, 0x20,
|
||||
0x01, 0x28, 0x05, 0x52, 0x02, 0x4c, 0x76, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18,
|
||||
0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x53,
|
||||
0x63, 0x6f, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x53, 0x63, 0x6f, 0x72,
|
||||
0x65, 0x22, 0x3b, 0x0a, 0x0e, 0x53, 0x43, 0x52, 0x4d, 0x52, 0x61, 0x6e, 0x6b, 0x43, 0x6f, 0x6e,
|
||||
0x66, 0x69, 0x67, 0x12, 0x29, 0x0a, 0x05, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03,
|
||||
0x28, 0x0b, 0x32, 0x13, 0x2e, 0x72, 0x61, 0x6e, 0x6b, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x52,
|
||||
0x61, 0x6e, 0x6b, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x22, 0x21,
|
||||
0x0a, 0x0f, 0x43, 0x53, 0x52, 0x4d, 0x41, 0x77, 0x61, 0x72, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69,
|
||||
0x67, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49,
|
||||
0x64, 0x22, 0x29, 0x0a, 0x05, 0x41, 0x77, 0x61, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x4e, 0x75,
|
||||
0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x4e, 0x75, 0x6d, 0x22, 0x8d, 0x01, 0x0a,
|
||||
0x09, 0x41, 0x77, 0x61, 0x72, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x4c, 0x76,
|
||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x4c, 0x76, 0x12, 0x28, 0x0a, 0x06, 0x41, 0x77,
|
||||
0x61, 0x72, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x72, 0x61, 0x6e,
|
||||
0x6b, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x41, 0x77, 0x61, 0x72, 0x64, 0x52, 0x06, 0x41, 0x77,
|
||||
0x61, 0x72, 0x64, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x54,
|
||||
0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x52, 0x65, 0x63, 0x65, 0x69,
|
||||
0x76, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x18,
|
||||
0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x22, 0x3b, 0x0a, 0x0f,
|
||||
0x53, 0x43, 0x52, 0x4d, 0x41, 0x77, 0x61, 0x72, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12,
|
||||
0x28, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e,
|
||||
0x72, 0x61, 0x6e, 0x6b, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x41, 0x77, 0x61, 0x72, 0x64, 0x49,
|
||||
0x74, 0x65, 0x6d, 0x52, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x35, 0x0a, 0x09, 0x43, 0x53, 0x52,
|
||||
0x4d, 0x41, 0x77, 0x61, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x41, 0x77, 0x61, 0x72, 0x64, 0x49,
|
||||
0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x41, 0x77, 0x61, 0x72, 0x64, 0x49, 0x64,
|
||||
0x22, 0x2f, 0x0a, 0x09, 0x53, 0x43, 0x52, 0x4d, 0x41, 0x77, 0x61, 0x72, 0x64, 0x12, 0x12, 0x0a,
|
||||
0x04, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x43, 0x6f, 0x64,
|
||||
0x65, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49,
|
||||
0x64, 0x2a, 0x8f, 0x02, 0x0a, 0x09, 0x52, 0x61, 0x6e, 0x6b, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x12,
|
||||
0x12, 0x0a, 0x0e, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x4d, 0x5f, 0x5a, 0x45, 0x52,
|
||||
0x4f, 0x10, 0x00, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x4d,
|
||||
0x5f, 0x43, 0x53, 0x52, 0x4d, 0x53, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x10,
|
||||
0xdc, 0x15, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x4d, 0x5f,
|
||||
0x53, 0x43, 0x52, 0x4d, 0x53, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x10, 0xdd,
|
||||
0x15, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x4d, 0x5f, 0x43,
|
||||
0x53, 0x52, 0x4d, 0x52, 0x61, 0x6e, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x10, 0xe0, 0x15,
|
||||
0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x4d, 0x5f, 0x53, 0x43,
|
||||
0x52, 0x4d, 0x52, 0x61, 0x6e, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x10, 0xe1, 0x15, 0x12,
|
||||
0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x4d, 0x5f, 0x43, 0x53, 0x52,
|
||||
0x4d, 0x41, 0x77, 0x61, 0x72, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x10, 0xe2, 0x15, 0x12,
|
||||
0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x4d, 0x5f, 0x53, 0x43, 0x52,
|
||||
0x4d, 0x41, 0x77, 0x61, 0x72, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x10, 0xe3, 0x15, 0x12,
|
||||
0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x4d, 0x5f, 0x43, 0x53, 0x52,
|
||||
0x4d, 0x41, 0x77, 0x61, 0x72, 0x64, 0x10, 0xe4, 0x15, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43,
|
||||
0x4b, 0x45, 0x54, 0x5f, 0x52, 0x4d, 0x5f, 0x53, 0x43, 0x52, 0x4d, 0x41, 0x77, 0x61, 0x72, 0x64,
|
||||
0x10, 0xe5, 0x15, 0x42, 0x29, 0x5a, 0x27, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x2e, 0x67, 0x61, 0x6d,
|
||||
0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x61, 0x6d, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x72, 0x61, 0x6e, 0x6b, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x62, 0x06,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x01, 0x28, 0x05, 0x52, 0x02, 0x4c, 0x76, 0x12, 0x28, 0x0a, 0x06, 0x41, 0x77, 0x61, 0x72, 0x64,
|
||||
0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x72, 0x61, 0x6e, 0x6b, 0x6d, 0x61,
|
||||
0x74, 0x63, 0x68, 0x2e, 0x41, 0x77, 0x61, 0x72, 0x64, 0x52, 0x06, 0x41, 0x77, 0x61, 0x72, 0x64,
|
||||
0x73, 0x12, 0x20, 0x0a, 0x0b, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x54, 0x79, 0x70, 0x65,
|
||||
0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x54,
|
||||
0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x06, 0x20, 0x01,
|
||||
0x28, 0x03, 0x52, 0x05, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x22, 0x3b, 0x0a, 0x0f, 0x53, 0x43, 0x52,
|
||||
0x4d, 0x41, 0x77, 0x61, 0x72, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x28, 0x0a, 0x04,
|
||||
0x4c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x72, 0x61, 0x6e,
|
||||
0x6b, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x41, 0x77, 0x61, 0x72, 0x64, 0x49, 0x74, 0x65, 0x6d,
|
||||
0x52, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x35, 0x0a, 0x09, 0x43, 0x53, 0x52, 0x4d, 0x41, 0x77,
|
||||
0x61, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||
0x02, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x41, 0x77, 0x61, 0x72, 0x64, 0x49, 0x64, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x41, 0x77, 0x61, 0x72, 0x64, 0x49, 0x64, 0x22, 0x2f, 0x0a,
|
||||
0x09, 0x53, 0x43, 0x52, 0x4d, 0x41, 0x77, 0x61, 0x72, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x43, 0x6f,
|
||||
0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x0e,
|
||||
0x0a, 0x02, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x2a, 0x8f,
|
||||
0x02, 0x0a, 0x09, 0x52, 0x61, 0x6e, 0x6b, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x12, 0x12, 0x0a, 0x0e,
|
||||
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x4d, 0x5f, 0x5a, 0x45, 0x52, 0x4f, 0x10, 0x00,
|
||||
0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x4d, 0x5f, 0x43, 0x53,
|
||||
0x52, 0x4d, 0x53, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x10, 0xdc, 0x15, 0x12,
|
||||
0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x4d, 0x5f, 0x53, 0x43, 0x52,
|
||||
0x4d, 0x53, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x10, 0xdd, 0x15, 0x12, 0x1d,
|
||||
0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x4d, 0x5f, 0x43, 0x53, 0x52, 0x4d,
|
||||
0x52, 0x61, 0x6e, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x10, 0xe0, 0x15, 0x12, 0x1d, 0x0a,
|
||||
0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x4d, 0x5f, 0x53, 0x43, 0x52, 0x4d, 0x52,
|
||||
0x61, 0x6e, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x10, 0xe1, 0x15, 0x12, 0x1e, 0x0a, 0x19,
|
||||
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x4d, 0x5f, 0x43, 0x53, 0x52, 0x4d, 0x41, 0x77,
|
||||
0x61, 0x72, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x10, 0xe2, 0x15, 0x12, 0x1e, 0x0a, 0x19,
|
||||
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x4d, 0x5f, 0x53, 0x43, 0x52, 0x4d, 0x41, 0x77,
|
||||
0x61, 0x72, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x10, 0xe3, 0x15, 0x12, 0x18, 0x0a, 0x13,
|
||||
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x4d, 0x5f, 0x43, 0x53, 0x52, 0x4d, 0x41, 0x77,
|
||||
0x61, 0x72, 0x64, 0x10, 0xe4, 0x15, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54,
|
||||
0x5f, 0x52, 0x4d, 0x5f, 0x53, 0x43, 0x52, 0x4d, 0x41, 0x77, 0x61, 0x72, 0x64, 0x10, 0xe5, 0x15,
|
||||
0x42, 0x29, 0x5a, 0x27, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x2e, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x2e,
|
||||
0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x61, 0x6d, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f,
|
||||
0x6c, 0x2f, 0x72, 0x61, 0x6e, 0x6b, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x62, 0x06, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
|
@ -895,15 +906,16 @@ var file_rankmatch_proto_goTypes = []interface{}{
|
|||
(*SCRMAward)(nil), // 12: rankmatch.SCRMAward
|
||||
}
|
||||
var file_rankmatch_proto_depIdxs = []int32{
|
||||
2, // 0: rankmatch.SCRMSeasonInfo.Seasons:type_name -> rankmatch.SeasonInfo
|
||||
5, // 1: rankmatch.SCRMRankConfig.Items:type_name -> rankmatch.RankItem
|
||||
8, // 2: rankmatch.AwardItem.Awards:type_name -> rankmatch.Award
|
||||
9, // 3: rankmatch.SCRMAwardConfig.List:type_name -> rankmatch.AwardItem
|
||||
4, // [4:4] is the sub-list for method output_type
|
||||
4, // [4:4] is the sub-list for method input_type
|
||||
4, // [4:4] is the sub-list for extension type_name
|
||||
4, // [4:4] is the sub-list for extension extendee
|
||||
0, // [0:4] is the sub-list for field type_name
|
||||
9, // 0: rankmatch.SeasonInfo.Award:type_name -> rankmatch.AwardItem
|
||||
2, // 1: rankmatch.SCRMSeasonInfo.Seasons:type_name -> rankmatch.SeasonInfo
|
||||
5, // 2: rankmatch.SCRMRankConfig.Items:type_name -> rankmatch.RankItem
|
||||
8, // 3: rankmatch.AwardItem.Awards:type_name -> rankmatch.Award
|
||||
9, // 4: rankmatch.SCRMAwardConfig.List:type_name -> rankmatch.AwardItem
|
||||
5, // [5:5] is the sub-list for method output_type
|
||||
5, // [5:5] is the sub-list for method input_type
|
||||
5, // [5:5] is the sub-list for extension type_name
|
||||
5, // [5:5] is the sub-list for extension extendee
|
||||
0, // [0:5] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_rankmatch_proto_init() }
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ message SeasonInfo{
|
|||
int64 Score = 3; // 积分
|
||||
int32 LastLv = 4; // 上赛季段位
|
||||
int64 LastScore = 5; // 上赛季积分
|
||||
AwardItem Award = 6; // 奖励列表
|
||||
}
|
||||
|
||||
// PACKET_RM_SCRMSeasonInfo
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -42,7 +42,7 @@ enum SSPacketID {
|
|||
PACKET_WG_AUDIENCESIT = 1123;
|
||||
PACKET_WG_RECHARGE = 1124;
|
||||
PACKET_GW_SCENESTATE = 1125;
|
||||
PACKET_WG_GRACE_DESTROYSCENE = 1126;
|
||||
PACKET_WG_GRACE_DESTROYSCENE = 1126; // 废弃
|
||||
PACKET_GW_SCENEEND = 1127;
|
||||
PACKET_GW_FISHRECORD = 1128;
|
||||
PACKET_GW_PLAYERFORCELEAVE = 1129;
|
||||
|
|
@ -189,20 +189,16 @@ message WGCreateScene {
|
|||
|
||||
//PACKET_WG_DESTROYSCENE
|
||||
message WGDestroyScene {
|
||||
int32 SceneId = 1;
|
||||
bool IsCompleted = 2;
|
||||
repeated int64 Ids = 1;
|
||||
bool IsGrace = 2; // 游戏结束后删除
|
||||
}
|
||||
|
||||
//PACKET_GW_DESTROYSCENE
|
||||
message GWDestroyScene {
|
||||
int32 SceneId = 1;
|
||||
int64 SceneId = 1;
|
||||
bool IsCompleted = 2;
|
||||
}
|
||||
|
||||
//PACKET_WG_GRACE_DESTROYSCENE
|
||||
message WGGraceDestroyScene {
|
||||
repeated int32 Ids = 1;
|
||||
}
|
||||
message RebateTask {
|
||||
bool RebateSwitch = 1; //返利开关
|
||||
repeated string RebateGameCfg = 2; //已打开的游戏配置 gameid+gamemode
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -63,11 +63,21 @@ message TMInfo{
|
|||
string Rule = 19;
|
||||
int32 SortId = 20;
|
||||
repeated string OnChannelName = 21;//在哪个渠道开启
|
||||
int32 ShowId = 22; // 比赛区分
|
||||
}
|
||||
//比赛场场次 激战人数刷新也走这个
|
||||
|
||||
message MatchTypeInfo{
|
||||
string Name = 1; // 名称
|
||||
int32 SortId = 2; // 排序序号
|
||||
bool On = 3; // 开关
|
||||
int32 Id = 4; // 类型id
|
||||
}
|
||||
|
||||
//比赛场场次
|
||||
//PACKET_TM_SCTMInfos
|
||||
message SCTMInfos{
|
||||
repeated TMInfo TMInfo = 1;//比赛场场次信息
|
||||
repeated MatchTypeInfo TypeList = 2; // 比赛类型列表
|
||||
}
|
||||
//单场次排行榜
|
||||
//PACKET_TM_CSTMRankList
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -446,6 +446,7 @@ message GameMatchDate {
|
|||
int32 MatchLevel = 22; // 难度等级
|
||||
repeated string OnChannelName = 23; // 开启的渠道名称
|
||||
int32 CardType = 24; // 手机卡类型
|
||||
int32 ShowId = 25; // 比赛区分
|
||||
}
|
||||
|
||||
// etcd /game/game_match
|
||||
|
|
@ -454,6 +455,18 @@ message GameMatchDateList{
|
|||
string Platform = 2;
|
||||
}
|
||||
|
||||
message MatchTypeInfo{
|
||||
string Name = 1; // 名称
|
||||
int32 SortId = 2; // 序号
|
||||
bool On = 3; // 开关
|
||||
int32 Id = 4; // 类型id
|
||||
}
|
||||
|
||||
// etcd /game/match_type
|
||||
message GameMatchType{
|
||||
string Platform = 1;
|
||||
repeated MatchTypeInfo List = 2; // 比赛类型列表
|
||||
}
|
||||
|
||||
message WelfareDate {
|
||||
int32 Grade = 1; // 数量
|
||||
|
|
|
|||
|
|
@ -236,17 +236,47 @@ func CSInvite(s *netlib.Session, d *rankproto.GateTransmit, packetId int, data i
|
|||
}
|
||||
}
|
||||
|
||||
pack := &rankproto.SCInvite{
|
||||
Id: msg.GetId(),
|
||||
Ranks: ranks,
|
||||
Me: me,
|
||||
Skip: msg.GetSkip(),
|
||||
IsEndNum: IsEndNum,
|
||||
RankMaxNum: model.GameParamData.RankInviteMaxNum,
|
||||
f := func() {
|
||||
pack := &rankproto.SCInvite{
|
||||
Id: msg.GetId(),
|
||||
Ranks: ranks,
|
||||
Me: me,
|
||||
Skip: msg.GetSkip(),
|
||||
IsEndNum: IsEndNum,
|
||||
RankMaxNum: model.GameParamData.RankInviteMaxNum,
|
||||
}
|
||||
|
||||
common.SendToGate(sid, int(rankproto.Rank_PACKET_RANK_SCInvite), pack, s)
|
||||
logger.Logger.Tracef("SCInvite: %v", pack)
|
||||
}
|
||||
|
||||
common.SendToGate(sid, int(rankproto.Rank_PACKET_RANK_SCInvite), pack, s)
|
||||
logger.Logger.Tracef("SCInvite: %v", pack)
|
||||
// 查询自己
|
||||
if me == nil {
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
r, err := model.FindPlayerRankInviteScoreType(&model.FindPlayerRankInviteScoreArgs{
|
||||
Platform: d.Platform,
|
||||
RankType: msg.GetId(),
|
||||
SnId: d.Snid,
|
||||
})
|
||||
if err != nil || r == nil {
|
||||
logger.Logger.Errorf("FindPlayerRankInviteScoreType error: %v", err)
|
||||
return nil
|
||||
}
|
||||
me = &rankproto.InviteRank{
|
||||
Snid: r.Data.SnId,
|
||||
Name: r.Data.Name,
|
||||
Rank: model.GameParamData.RankInviteMaxNum,
|
||||
Score: r.Data.Score,
|
||||
InviteNum: r.Data.InviteNum,
|
||||
ModId: r.Data.ModId,
|
||||
}
|
||||
return nil
|
||||
}), task.CompleteNotifyWrapper(func(i interface{}, t task.Task) {
|
||||
f()
|
||||
}), "rank_invite_me").Start()
|
||||
} else {
|
||||
f()
|
||||
}
|
||||
})
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,13 @@ func init() {
|
|||
netlib.Register(int(gamehallproto.GameHallPacketID_PACKET_SC_QUITGAME), gamehallproto.SCQuitGame{}, SCQuitGame)
|
||||
}
|
||||
|
||||
func cleanRoomState(s *netlib.Session) {
|
||||
s.RemoveAttribute(SessionAttributeScene)
|
||||
s.RemoveAttribute(SessionAttributeSceneId)
|
||||
s.RemoveAttribute(SessionAttributeEnteringScene)
|
||||
s.RemoveAttribute(SessionAttributeEnteringMatchScene)
|
||||
}
|
||||
|
||||
func SCEnterRoom(s *netlib.Session, packid int, pack interface{}) error {
|
||||
logger.Logger.Trace("SCEnterRoom ", pack)
|
||||
msg, ok := pack.(*gamehallproto.SCEnterRoom)
|
||||
|
|
@ -44,10 +51,7 @@ func SCDestroyRoom(s *netlib.Session, packid int, pack interface{}) error {
|
|||
}
|
||||
|
||||
if msg.GetOpRetCode() == gamehallproto.OpResultCode_Game_OPRC_Sucess_Game {
|
||||
s.RemoveAttribute(SessionAttributeScene)
|
||||
s.RemoveAttribute(SessionAttributeSceneId)
|
||||
s.RemoveAttribute(SessionAttributeEnteringScene)
|
||||
s.RemoveAttribute(SessionAttributeEnteringMatchScene)
|
||||
cleanRoomState(s)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -72,10 +76,7 @@ func SCLeaveRoom(s *netlib.Session, packid int, pack interface{}) error {
|
|||
scene.DelPlayer(p.GetSnId())
|
||||
}
|
||||
}
|
||||
s.RemoveAttribute(SessionAttributeScene)
|
||||
s.RemoveAttribute(SessionAttributeSceneId)
|
||||
s.RemoveAttribute(SessionAttributeEnteringScene)
|
||||
s.RemoveAttribute(SessionAttributeEnteringMatchScene)
|
||||
cleanRoomState(s)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -118,10 +119,7 @@ func SCQuitGame(s *netlib.Session, packid int, pack interface{}) error {
|
|||
scene.DelPlayer(p.GetSnId())
|
||||
}
|
||||
}
|
||||
s.RemoveAttribute(SessionAttributeScene)
|
||||
s.RemoveAttribute(SessionAttributeSceneId)
|
||||
s.RemoveAttribute(SessionAttributeEnteringScene)
|
||||
s.RemoveAttribute(SessionAttributeEnteringMatchScene)
|
||||
cleanRoomState(s)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -522,6 +522,7 @@ func _LeaveTransferThird2SystemTask(p *Player) {
|
|||
coinlogex = model.NewCoinLogEx(&model.CoinLogParam{
|
||||
Platform: p.Platform,
|
||||
SnID: p.SnId,
|
||||
Channel: p.Channel,
|
||||
ChangeType: common.BillTypeCoin,
|
||||
ChangeNum: amount,
|
||||
RemainNum: p.Coin + amount,
|
||||
|
|
@ -1162,6 +1163,7 @@ func RefreshTransferThird2SystemTask(p *Player) {
|
|||
coinlogex = model.NewCoinLogEx(&model.CoinLogParam{
|
||||
Platform: p.Platform,
|
||||
SnID: p.SnId,
|
||||
Channel: p.Channel,
|
||||
ChangeType: common.BillTypeCoin,
|
||||
ChangeNum: amount,
|
||||
RemainNum: p.Coin + amount,
|
||||
|
|
@ -1237,36 +1239,6 @@ func RefreshTransferThird2SystemTask(p *Player) {
|
|||
})
|
||||
}
|
||||
|
||||
type CSGetPrivateRoomHistoryPacketFactory struct {
|
||||
}
|
||||
type CSGetPrivateRoomHistoryHandler struct {
|
||||
}
|
||||
|
||||
func (this *CSGetPrivateRoomHistoryPacketFactory) CreatePacket() interface{} {
|
||||
pack := &gamehall.CSGetPrivateRoomHistory{}
|
||||
return pack
|
||||
}
|
||||
|
||||
func (this *CSGetPrivateRoomHistoryHandler) Process(s *netlib.Session, packetid int, data interface{}, sid int64) error {
|
||||
logger.Logger.Trace("CSGetPrivateRoomHistoryHandler Process recv ", data)
|
||||
if msg, ok := data.(*gamehall.CSGetPrivateRoomHistory); ok {
|
||||
p := PlayerMgrSington.GetPlayer(sid)
|
||||
if p == nil {
|
||||
logger.Logger.Warn("CSGetPrivateRoomHistoryHandler p == nil")
|
||||
return nil
|
||||
}
|
||||
|
||||
pps := PrivateSceneMgrSington.GetOrCreatePlayerPrivateScene(p)
|
||||
if pps == nil {
|
||||
logger.Logger.Warnf("CSGetPrivateRoomHistoryHandler PrivateSceneMgrSington.GetOrCreatePlayerPrivateScene(%v)", p.SnId)
|
||||
return nil
|
||||
}
|
||||
|
||||
pps.LoadLogs(p, msg.GetQueryTime())
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type CSQueryRoomInfoPacketFactory struct {
|
||||
}
|
||||
type CSQueryRoomInfoHandler struct {
|
||||
|
|
|
|||
|
|
@ -1414,6 +1414,7 @@ func (this *CSPlayerRegisterHandler) Process(s *netlib.Session, packetid int, da
|
|||
log := model.NewCoinLogEx(&model.CoinLogParam{
|
||||
Platform: pi.Platform,
|
||||
SnID: pi.SnId,
|
||||
Channel: pi.Channel,
|
||||
ChangeType: common.BillTypeCoin,
|
||||
ChangeNum: int64(model.GameParamData.NewPlayerCoin),
|
||||
RemainNum: pi.Coin + int64(model.GameParamData.NewPlayerCoin),
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@ func CSRMSeasonInfo(s *netlib.Session, packetId int, data interface{}, sid int64
|
|||
pack.Seasons = append(pack.Seasons, info)
|
||||
}
|
||||
}
|
||||
|
||||
p.SendToClient(int(rankmatch.RankMatch_PACKET_RM_SCRMSeasonInfo), pack)
|
||||
logger.Logger.Trace("SCTMSeasonInfo:", pack)
|
||||
return nil
|
||||
|
|
@ -270,6 +271,7 @@ func CSRMAward(s *netlib.Session, packetId int, data interface{}, sid int64) err
|
|||
Id: d.Award3Id,
|
||||
Num: d.Award3Num,
|
||||
})
|
||||
RankMgrSingleton.CheckShowRed(p.SnId)
|
||||
}
|
||||
|
||||
p.SendToClient(int(rankmatch.RankMatch_PACKET_RM_SCRMAward), pack)
|
||||
|
|
|
|||
|
|
@ -100,7 +100,23 @@ func init() {
|
|||
RankMgrSingleton.UpdateRobotSeason(p.Platform, p.SnId, scene.dbGameFree.GetRankType(),
|
||||
msg.GetRankScore()[scene.dbGameFree.GetRankType()], p.Name, p.Sex, p.HeadUrl, p.Coin, p.PlayerData.GetRoleId())
|
||||
} else {
|
||||
RankMgrSingleton.UpdatePlayerSeason(p.SnId, msg.GetRankScore())
|
||||
if model.GameParamData.TestRankMatchAward {
|
||||
if RankMgrSingleton.playerSeasons[p.SnId] != nil {
|
||||
if RankMgrSingleton.playerSeasons[p.SnId].RankType == nil {
|
||||
RankMgrSingleton.playerSeasons[p.SnId].RankType = make(map[int32]*model.PlayerRankInfo)
|
||||
}
|
||||
if RankMgrSingleton.playerSeasons[p.SnId].RankType[1] == nil {
|
||||
RankMgrSingleton.playerSeasons[p.SnId].RankType[1] = &model.PlayerRankInfo{}
|
||||
}
|
||||
RankMgrSingleton.playerSeasons[p.SnId].RankType[1].LastScore = 7500
|
||||
RankMgrSingleton.playerSeasons[p.SnId].RankType[1].Score = 7500
|
||||
RankMgrSingleton.playerSeasons[p.SnId].RankType[1].Awards = nil
|
||||
}
|
||||
RankMgrSingleton.UpdatePlayerSeason(p.SnId, map[int32]int64{1: 10000})
|
||||
} else {
|
||||
RankMgrSingleton.UpdatePlayerSeason(p.SnId, msg.GetRankScore())
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
//更新玩家等级排行榜
|
||||
|
|
@ -260,7 +276,6 @@ func init() {
|
|||
scene.starting = msg.GetStart()
|
||||
scene.currRound = msg.GetCurrRound()
|
||||
scene.totalRound = msg.GetMaxRound()
|
||||
scene.lastTime = time.Now()
|
||||
if scene.starting {
|
||||
if scene.currRound == 1 {
|
||||
scene.startTime = time.Now()
|
||||
|
|
|
|||
|
|
@ -59,6 +59,8 @@ func CSSignRace(s *netlib.Session, packetid int, data interface{}, sid int64) er
|
|||
pack.RetCode = code //0成功 1重复报名 2比赛没有开启 3道具不足 4不在报名时间段 5金币不足 6钻石不足
|
||||
}
|
||||
|
||||
logger.Logger.Infof("player(%v) match(%v) SignUp is ok.", p.SnId, tmId)
|
||||
|
||||
if code == int32(tournament.SignRaceCode_OPRC_Close) ||
|
||||
code == int32(tournament.SignRaceCode_OPRC_Time) {
|
||||
TournamentMgr.CancelSignUpAll(platform, tmId)
|
||||
|
|
@ -73,7 +75,7 @@ func CSSignRace(s *netlib.Session, packetid int, data interface{}, sid int64) er
|
|||
logger.Logger.Trace("SCSignRace ", pack)
|
||||
|
||||
// 检查是否可以开始比赛(关闭机器人时,比赛开赛)
|
||||
if code == 0 && signSucc && !TournamentMgr.IsUseRobot(platform, tmId) {
|
||||
if code == 0 && signSucc && !TournamentMgr.IsUseRobot(platform, tmId, 0) {
|
||||
if TournamentMgr.CanStart(platform, tmId) {
|
||||
TournamentMgr.Start(platform, tmId)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,13 +8,11 @@ import (
|
|||
"mongo.games.com/goserver/core/logger"
|
||||
"mongo.games.com/goserver/core/module"
|
||||
"mongo.games.com/goserver/core/transact"
|
||||
"mongo.games.com/goserver/srvlib"
|
||||
|
||||
"mongo.games.com/game/common"
|
||||
"mongo.games.com/game/proto"
|
||||
hall_proto "mongo.games.com/game/protocol/gamehall"
|
||||
"mongo.games.com/game/protocol/server"
|
||||
server_proto "mongo.games.com/game/protocol/server"
|
||||
"mongo.games.com/game/protocol/webapi"
|
||||
"mongo.games.com/game/srvdata"
|
||||
)
|
||||
|
|
@ -465,16 +463,15 @@ func (this *CoinSceneMgr) OnPlatformDestroy(p *Platform) {
|
|||
if p == nil {
|
||||
return
|
||||
}
|
||||
var ids []int
|
||||
if v, ok := this.scenesOfPlatform[p.IdStr]; ok {
|
||||
for _, csp := range v {
|
||||
pack := &server_proto.WGGraceDestroyScene{}
|
||||
for _, scene := range csp.scenes {
|
||||
pack.Ids = append(pack.Ids, int32(scene.sceneId))
|
||||
ids = append(ids, scene.sceneId)
|
||||
}
|
||||
// 房间中记录的有游服连接,广播的方式也可以
|
||||
srvlib.ServerSessionMgrSington.Broadcast(int(server_proto.SSPacketID_PACKET_WG_GRACE_DESTROYSCENE), pack, common.GetSelfAreaId(), srvlib.GameServerType)
|
||||
}
|
||||
}
|
||||
SceneMgrSingleton.DoDelete(ids, true)
|
||||
}
|
||||
|
||||
func (this *CoinSceneMgr) OnPlatformChangeDisabled(p *Platform, disabled bool) {
|
||||
|
|
@ -501,12 +498,11 @@ func (this *CoinSceneMgr) OnPlatformGameFreeUpdate(p *Platform, oldCfg, newCfg *
|
|||
|
||||
if cps, ok := ss[newCfg.DbGameFree.Id]; ok {
|
||||
cps.dbGameFree = newCfg.DbGameFree
|
||||
pack := &server_proto.WGGraceDestroyScene{}
|
||||
var ids []int
|
||||
for _, scene := range cps.scenes {
|
||||
pack.Ids = append(pack.Ids, int32(scene.sceneId))
|
||||
ids = append(ids, scene.sceneId)
|
||||
}
|
||||
srvlib.ServerSessionMgrSington.Broadcast(int(server_proto.SSPacketID_PACKET_WG_GRACE_DESTROYSCENE),
|
||||
pack, common.GetSelfAreaId(), srvlib.GameServerType)
|
||||
SceneMgrSingleton.DoDelete(ids, true)
|
||||
this.TouchCreateRoom(p.IdStr, newCfg.DbGameFree.Id)
|
||||
}
|
||||
}
|
||||
|
|
@ -516,15 +512,15 @@ func (this *CoinSceneMgr) OnPlatformDestroyByGameFreeId(p *Platform, gameFreeId
|
|||
return
|
||||
}
|
||||
if csps, ok := this.scenesOfPlatform[p.IdStr]; ok {
|
||||
var ids []int
|
||||
for _, csp := range csps {
|
||||
pack := &server_proto.WGGraceDestroyScene{}
|
||||
for _, scene := range csp.scenes {
|
||||
if scene.dbGameFree.Id == gameFreeId {
|
||||
pack.Ids = append(pack.Ids, int32(scene.sceneId))
|
||||
ids = append(ids, scene.sceneId)
|
||||
}
|
||||
}
|
||||
srvlib.ServerSessionMgrSington.Broadcast(int(server_proto.SSPacketID_PACKET_WG_GRACE_DESTROYSCENE), pack, common.GetSelfAreaId(), srvlib.GameServerType)
|
||||
}
|
||||
SceneMgrSingleton.DoDelete(ids, true)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -550,11 +546,11 @@ func (this *CoinSceneMgr) OnGameGroupUpdate(oldCfg, newCfg *webapi.GameConfigGro
|
|||
//TODO 预创建房间配置更新,unsupport group model
|
||||
cps.dbGameFree = newCfg.DbGameFree
|
||||
if needDestroy {
|
||||
pack := &server_proto.WGGraceDestroyScene{}
|
||||
var ids []int
|
||||
for _, scene := range cps.scenes {
|
||||
pack.Ids = append(pack.Ids, int32(scene.sceneId))
|
||||
ids = append(ids, scene.sceneId)
|
||||
}
|
||||
srvlib.ServerSessionMgrSington.Broadcast(int(server_proto.SSPacketID_PACKET_WG_GRACE_DESTROYSCENE), pack, common.GetSelfAreaId(), srvlib.GameServerType)
|
||||
SceneMgrSingleton.DoDelete(ids, true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -349,7 +349,7 @@ func (csp *CoinScenePool) OnPlayerLeave(s *Scene, p *Player) {
|
|||
// 玩家离开结算空房间的私人房
|
||||
if s.IsPrivateScene() {
|
||||
if s.IsEmpty() {
|
||||
s.ForceDelete(false)
|
||||
s.DoDelete(false)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
@ -364,7 +364,7 @@ func (csp *CoinScenePool) OnPlayerLeave(s *Scene, p *Player) {
|
|||
}
|
||||
}
|
||||
if hasCnt > int(csp.dbGameFree.GetCreateRoomNum()) {
|
||||
s.ForceDelete(false)
|
||||
s.DoDelete(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,8 @@ func init() {
|
|||
etcd.Register(etcd.ETCDKEY_GAME_NOTICE, webapi.CommonNoticeList{}, platformConfigEvent)
|
||||
// 比赛配置
|
||||
etcd.Register(etcd.ETCDKEY_GAME_MATCH, webapi.GameMatchDateList{}, platformConfigEvent)
|
||||
// 比赛场类型
|
||||
etcd.Register(etcd.ETCDKEY_GAME_MATCH_TYPE, webapi.GameMatchType{}, platformConfigEvent)
|
||||
// 个人水池配置
|
||||
etcd.Register(etcd.ETCDKEY_PLAYERPOOL, webapi.PlayerPool{}, platformConfigEvent)
|
||||
// 商品兑换
|
||||
|
|
@ -154,6 +156,12 @@ func platformConfigEvent(ctx context.Context, completeKey string, isInit bool, e
|
|||
} else {
|
||||
TournamentMgr.UpdateData(false, config)
|
||||
}
|
||||
case *webapi.GameMatchType:
|
||||
if isInit {
|
||||
TournamentMgr.UpdateTypeList(true, config)
|
||||
} else {
|
||||
TournamentMgr.UpdateTypeList(false, config)
|
||||
}
|
||||
case *webapi.ChannelSwitchConfig:
|
||||
PlatformMgrSingleton.GetConfig(config.Platform).ChannelSwitch[config.GetTp()] = config
|
||||
if !isInit {
|
||||
|
|
|
|||
|
|
@ -2,18 +2,18 @@ package main
|
|||
|
||||
import (
|
||||
"math/rand"
|
||||
"mongo.games.com/game/protocol/webapi"
|
||||
"time"
|
||||
|
||||
"mongo.games.com/goserver/core/logger"
|
||||
"mongo.games.com/goserver/core/module"
|
||||
|
||||
"mongo.games.com/game/common"
|
||||
"mongo.games.com/game/model"
|
||||
"mongo.games.com/game/proto"
|
||||
gamehall_proto "mongo.games.com/game/protocol/gamehall"
|
||||
server_proto "mongo.games.com/game/protocol/server"
|
||||
"mongo.games.com/game/protocol/webapi"
|
||||
"mongo.games.com/game/srvdata"
|
||||
"mongo.games.com/goserver/core/logger"
|
||||
"mongo.games.com/goserver/core/module"
|
||||
"mongo.games.com/goserver/srvlib"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
@ -555,11 +555,11 @@ func (this *HundredSceneMgr) OnPlatformDestroy(p *Platform) {
|
|||
return
|
||||
}
|
||||
if ss, ok := this.scenesOfPlatform[p.IdStr]; ok {
|
||||
pack := &server_proto.WGGraceDestroyScene{}
|
||||
var ids []int
|
||||
for _, scene := range ss {
|
||||
pack.Ids = append(pack.Ids, int32(scene.sceneId))
|
||||
ids = append(ids, scene.sceneId)
|
||||
}
|
||||
srvlib.ServerSessionMgrSington.Broadcast(int(server_proto.SSPacketID_PACKET_WG_GRACE_DESTROYSCENE), pack, common.GetSelfAreaId(), srvlib.GameServerType)
|
||||
SceneMgrSingleton.DoDelete(ids, true)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -569,11 +569,11 @@ func (this *HundredSceneMgr) OnPlatformChangeIsolated(p *Platform, isolated bool
|
|||
this.OnPlatformCreate(p) //预创建场景
|
||||
} else {
|
||||
if ss, ok := this.scenesOfPlatform[p.IdStr]; ok {
|
||||
pack := &server_proto.WGGraceDestroyScene{}
|
||||
var ids []int
|
||||
for _, scene := range ss {
|
||||
pack.Ids = append(pack.Ids, int32(scene.sceneId))
|
||||
ids = append(ids, scene.sceneId)
|
||||
}
|
||||
srvlib.ServerSessionMgrSington.Broadcast(int(server_proto.SSPacketID_PACKET_WG_GRACE_DESTROYSCENE), pack, common.GetSelfAreaId(), srvlib.GameServerType)
|
||||
SceneMgrSingleton.DoDelete(ids, true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -585,11 +585,11 @@ func (this *HundredSceneMgr) OnPlatformChangeDisabled(p *Platform, disabled bool
|
|||
}
|
||||
if disabled {
|
||||
if ss, ok := this.scenesOfPlatform[p.IdStr]; ok {
|
||||
pack := &server_proto.WGGraceDestroyScene{}
|
||||
var ids []int
|
||||
for _, scene := range ss {
|
||||
pack.Ids = append(pack.Ids, int32(scene.sceneId))
|
||||
ids = append(ids, scene.sceneId)
|
||||
}
|
||||
srvlib.ServerSessionMgrSington.Broadcast(int(server_proto.SSPacketID_PACKET_WG_GRACE_DESTROYSCENE), pack, common.GetSelfAreaId(), srvlib.GameServerType)
|
||||
SceneMgrSingleton.DoDelete(ids, true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -600,25 +600,15 @@ func (this *HundredSceneMgr) OnPlatformGameFreeUpdate(p *Platform, oldCfg, newCf
|
|||
}
|
||||
if oldCfg.GroupId != newCfg.GroupId || oldCfg.GroupId != 0 {
|
||||
if scenes, exist := this.scenesOfGroup[oldCfg.GroupId]; exist {
|
||||
pack := &server_proto.WGGraceDestroyScene{}
|
||||
if s, ok := scenes[newCfg.DbGameFree.Id]; ok {
|
||||
pack.Ids = append(pack.Ids, int32(s.sceneId))
|
||||
}
|
||||
if len(pack.Ids) > 0 {
|
||||
srvlib.ServerSessionMgrSington.Broadcast(int(server_proto.SSPacketID_PACKET_WG_GRACE_DESTROYSCENE),
|
||||
pack, common.GetSelfAreaId(), srvlib.GameServerType)
|
||||
s.DoDelete(false)
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
if scenes, exist := this.scenesOfPlatform[p.IdStr]; exist {
|
||||
pack := &server_proto.WGGraceDestroyScene{}
|
||||
if s, ok := scenes[newCfg.DbGameFree.Id]; ok {
|
||||
pack.Ids = append(pack.Ids, int32(s.sceneId))
|
||||
}
|
||||
if len(pack.Ids) > 0 {
|
||||
srvlib.ServerSessionMgrSington.Broadcast(int(server_proto.SSPacketID_PACKET_WG_GRACE_DESTROYSCENE),
|
||||
pack, common.GetSelfAreaId(), srvlib.GameServerType)
|
||||
s.DoDelete(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -639,9 +629,7 @@ func (this *HundredSceneMgr) OnGameGroupUpdate(oldCfg, newCfg *webapi.GameConfig
|
|||
needDestroy = true
|
||||
}
|
||||
if needDestroy {
|
||||
pack := &server_proto.WGGraceDestroyScene{}
|
||||
pack.Ids = append(pack.Ids, int32(s.sceneId))
|
||||
srvlib.ServerSessionMgrSington.Broadcast(int(server_proto.SSPacketID_PACKET_WG_GRACE_DESTROYSCENE), pack, common.GetSelfAreaId(), srvlib.GameServerType)
|
||||
SceneMgrSingleton.DoDelete([]int{s.sceneId}, true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -726,13 +714,13 @@ func (this *HundredSceneMgr) OnPlatformDestroyByGameFreeId(p *Platform, gameFree
|
|||
return
|
||||
}
|
||||
if scenes, ok := this.scenesOfPlatform[p.IdStr]; ok {
|
||||
var ids []int
|
||||
for _, scene := range scenes {
|
||||
pack := &server_proto.WGGraceDestroyScene{}
|
||||
if scene.dbGameFree.Id == gameFreeId {
|
||||
pack.Ids = append(pack.Ids, int32(scene.sceneId))
|
||||
ids = append(ids, scene.sceneId)
|
||||
}
|
||||
srvlib.ServerSessionMgrSington.Broadcast(int(server_proto.SSPacketID_PACKET_WG_GRACE_DESTROYSCENE), pack, common.GetSelfAreaId(), srvlib.GameServerType)
|
||||
}
|
||||
SceneMgrSingleton.DoDelete(ids, true)
|
||||
}
|
||||
}
|
||||
func init() {
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ func (ms *MatchSceneMgr) MatchStop(tm *TmMatch) {
|
|||
if SceneMgrSingleton.scenes != nil && tm != nil {
|
||||
for _, scene := range SceneMgrSingleton.scenes {
|
||||
if scene.IsMatchScene() && scene.matchId == tm.SortId {
|
||||
scene.ForceDelete(false)
|
||||
scene.DoDelete(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,334 +0,0 @@
|
|||
package main
|
||||
|
||||
//
|
||||
//import (
|
||||
// "mongo.games.com/game/common"
|
||||
// "mongo.games.com/game/proto"
|
||||
// "mongo.games.com/game/protocol/mngame"
|
||||
// server_proto "mongo.games.com/game/protocol/server"
|
||||
// webapi_proto "mongo.games.com/game/protocol/webapi"
|
||||
// "mongo.games.com/game/srvdata"
|
||||
// "mongo.games.com/goserver/core/logger"
|
||||
// "mongo.games.com/goserver/srvlib"
|
||||
// srvlibproto "mongo.games.com/goserver/srvlib/protocol"
|
||||
//)
|
||||
//
|
||||
//var MiniGameMgrSington = &MiniGameMgr{
|
||||
// //按平台管理
|
||||
// scenesOfPlatform: make(map[string]map[int32]*Scene),
|
||||
// //玩家当前打开的小游戏列表
|
||||
// playerGaming: make(map[int32]map[int32]*Scene),
|
||||
// matchAutoId: common.MiniGameSceneStartId,
|
||||
//}
|
||||
//
|
||||
//type MiniGameMgr struct {
|
||||
// BasePlayerListener
|
||||
// //按平台管理
|
||||
// scenesOfPlatform map[string]map[int32]*Scene
|
||||
// //玩家当前打开的小游戏列表
|
||||
// playerGaming map[int32]map[int32]*Scene
|
||||
// matchAutoId int
|
||||
//}
|
||||
//
|
||||
//func (this *MiniGameMgr) GenOneSceneId() int {
|
||||
// this.matchAutoId++
|
||||
// if this.matchAutoId > common.MiniGameSceneMaxId {
|
||||
// this.matchAutoId = common.MiniGameSceneStartId
|
||||
// }
|
||||
// return this.matchAutoId
|
||||
//}
|
||||
//
|
||||
//func (this *MiniGameMgr) PlayerEnter(p *Player, id int32) mngame.MNGameOpResultCode {
|
||||
// plt := p.GetPlatform()
|
||||
// s := this.GetScene(plt, id)
|
||||
// if s == nil {
|
||||
// return mngame.MNGameOpResultCode_MNGAME_OPRC_Error
|
||||
// }
|
||||
//
|
||||
// if !s.PlayerEnterMiniGame(p) {
|
||||
// return mngame.MNGameOpResultCode_MNGAME_OPRC_Error
|
||||
// }
|
||||
//
|
||||
// gamings, ok := this.playerGaming[p.SnId]
|
||||
// if !ok {
|
||||
// gamings = make(map[int32]*Scene)
|
||||
// this.playerGaming[p.SnId] = gamings
|
||||
// }
|
||||
// gamings[id] = s
|
||||
//
|
||||
// return mngame.MNGameOpResultCode_MNGAME_OPRC_Sucess
|
||||
//}
|
||||
//
|
||||
//func (this *MiniGameMgr) PlayerLeave(p *Player, id int32) mngame.MNGameOpResultCode {
|
||||
// plt := p.GetPlatform()
|
||||
// s := this.GetScene(plt, id)
|
||||
// if s == nil {
|
||||
// return mngame.MNGameOpResultCode_MNGAME_OPRC_Error
|
||||
// }
|
||||
//
|
||||
// if !s.PlayerLeaveMiniGame(p) {
|
||||
// return mngame.MNGameOpResultCode_MNGAME_OPRC_Error
|
||||
// }
|
||||
//
|
||||
// gamings, ok := this.playerGaming[p.SnId]
|
||||
// if ok {
|
||||
// delete(gamings, id)
|
||||
// }
|
||||
//
|
||||
// return mngame.MNGameOpResultCode_MNGAME_OPRC_Sucess
|
||||
//}
|
||||
//
|
||||
//func (this *MiniGameMgr) PlayerMsgDispatcher(p *Player, msg *mngame.CSMNGameDispatcher) {
|
||||
// plt := p.GetPlatform()
|
||||
// s := this.GetScene(plt, msg.GetId())
|
||||
// if s == nil {
|
||||
// logger.Logger.Errorf("MiniGameMgr.PlayerMsgDispatcher Can't find scene! plt:%v gameId:%v", plt, msg.GetId())
|
||||
// return
|
||||
// }
|
||||
//
|
||||
// //minigamesrv 重启容错
|
||||
// if !s.HasPlayer(p) {
|
||||
// this.PlayerEnter(p, msg.GetId())
|
||||
// }
|
||||
// s.RedirectMiniGameMsg(p, msg)
|
||||
//}
|
||||
//
|
||||
//func (this *MiniGameMgr) GetScene(p *Platform, id int32) *Scene {
|
||||
// scenes, ok := this.scenesOfPlatform[p.IdStr]
|
||||
// if !ok {
|
||||
// scenes = make(map[int32]*Scene)
|
||||
// this.scenesOfPlatform[p.IdStr] = scenes
|
||||
// }
|
||||
//
|
||||
// s, ok := scenes[id]
|
||||
// if !ok {
|
||||
// cfg := PlatformMgrSingleton.GetGameFree(p.IdStr, id)
|
||||
// if cfg != nil && cfg.Status && cfg.DbGameFree.GetGameType() == common.GameType_Mini {
|
||||
// s = this.CreateSceneByPlatform(p, cfg)
|
||||
// if s != nil {
|
||||
// scenes[cfg.DbGameFree.Id] = s
|
||||
// } else {
|
||||
// return nil
|
||||
// }
|
||||
// return s
|
||||
// } else {
|
||||
// return nil
|
||||
// }
|
||||
// } else {
|
||||
// return s
|
||||
// }
|
||||
// //return nil
|
||||
//}
|
||||
//
|
||||
//func (this *MiniGameMgr) CreateSceneByPlatform(p *Platform, cfg *webapi_proto.GameFree) *Scene {
|
||||
// sceneId := this.GenOneSceneId()
|
||||
// gameId := int(cfg.DbGameFree.GetGameId())
|
||||
// gs := GameSessMgrSington.GetMinLoadSess(gameId)
|
||||
// if gs == nil {
|
||||
// logger.Logger.Errorf("MiniGameMgr.CreateSceneByPlatform Get %v game min session failed.", gameId)
|
||||
// return nil
|
||||
// }
|
||||
// if gs != nil {
|
||||
// gameMode := cfg.DbGameFree.GetGameMode()
|
||||
// dbGameRule := srvdata.PBDB_GameRuleMgr.GetData(cfg.DbGameFree.GetGameRule())
|
||||
// params := dbGameRule.GetParams()
|
||||
// scene := SceneMgrSington.CreateScene(0, 0, sceneId, gameId, int(gameMode), common.SceneMode_Public, 1, -1, params,
|
||||
// gs, p, cfg.GroupId, cfg.DbGameFree, cfg.DbGameFree.Id)
|
||||
// if scene != nil {
|
||||
// scene.hallId = cfg.DbGameFree.Id
|
||||
// return scene
|
||||
// }
|
||||
// }
|
||||
// return nil
|
||||
//}
|
||||
//
|
||||
//func (this *MiniGameMgr) OnPlatformCreate(p *Platform) {
|
||||
// if p == nil {
|
||||
// return
|
||||
// }
|
||||
// scenes := make(map[int32]*Scene)
|
||||
// this.scenesOfPlatform[p.IdStr] = scenes
|
||||
//
|
||||
// gps := PlatformMgrSingleton.GetGameFrees(p.IdStr)
|
||||
// for _, v := range gps {
|
||||
// if v.Status && v.DbGameFree.GetGameType() == common.GameType_Mini {
|
||||
// s := this.CreateSceneByPlatform(p, v)
|
||||
// if s != nil {
|
||||
// scenes[v.DbGameFree.Id] = s
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//func (this *MiniGameMgr) OnPlatformDestroy(p *Platform) {
|
||||
// if p == nil {
|
||||
// return
|
||||
// }
|
||||
// if scenes, ok := this.scenesOfPlatform[p.IdStr]; ok {
|
||||
// for _, s := range scenes {
|
||||
// pack := &server_proto.WGGraceDestroyScene{}
|
||||
// pack.Ids = append(pack.Ids, int32(s.sceneId))
|
||||
// s.SendToGame(int(server_proto.SSPacketID_PACKET_WG_GRACE_DESTROYSCENE), pack)
|
||||
// }
|
||||
// delete(this.scenesOfPlatform, p.IdStr)
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//func (this *MiniGameMgr) OnPlatformChangeIsolated(p *Platform, isolated bool) {
|
||||
// if p == nil {
|
||||
// return
|
||||
// }
|
||||
// if !isolated {
|
||||
// this.OnPlatformDestroy(p)
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//func (this *MiniGameMgr) OnPlatformChangeDisabled(p *Platform, disabled bool) {
|
||||
// if p == nil {
|
||||
// return
|
||||
// }
|
||||
// if disabled {
|
||||
// this.OnPlatformDestroy(p)
|
||||
// } else {
|
||||
// this.OnPlatformCreate(p)
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//func (this *MiniGameMgr) OnPlatformGameFreeUpdate(p *Platform, oldCfg, newCfg *webapi_proto.GameFree) {
|
||||
// if p == nil {
|
||||
// return
|
||||
// }
|
||||
// if scenes, ok := this.scenesOfPlatform[p.IdStr]; ok {
|
||||
// if oldCfg != nil {
|
||||
// if s, ok := scenes[oldCfg.DbGameFree.Id]; ok {
|
||||
// pack := &server_proto.WGGraceDestroyScene{}
|
||||
// pack.Ids = append(pack.Ids, int32(s.sceneId))
|
||||
// s.SendToGame(int(server_proto.SSPacketID_PACKET_WG_GRACE_DESTROYSCENE), pack)
|
||||
// delete(scenes, oldCfg.DbGameFree.Id)
|
||||
// }
|
||||
// } else if newCfg != nil {
|
||||
// if newCfg.Status && newCfg.DbGameFree.GetGameType() == common.GameType_Mini {
|
||||
// s := this.CreateSceneByPlatform(p, newCfg)
|
||||
// if s != nil {
|
||||
// scenes[newCfg.DbGameFree.Id] = s
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//func (this *MiniGameMgr) OnGameGroupUpdate(oldCfg, newCfg *webapi_proto.GameConfigGroup) {
|
||||
// //donothing
|
||||
//}
|
||||
//
|
||||
///*
|
||||
//获取platform下面对应的 player SnId所在的scene
|
||||
//*/
|
||||
//func (this *MiniGameMgr) GetAllSceneByPlayer(p *Player) map[int32]*Scene {
|
||||
// if gameingScenes, ok := this.playerGaming[p.SnId]; ok {
|
||||
// return gameingScenes
|
||||
// }
|
||||
// return nil
|
||||
//}
|
||||
//
|
||||
//func (this *MiniGameMgr) OnPlayerDropLine(p *Player) {
|
||||
// this.BasePlayerListener.OnPlayerDropLine(p)
|
||||
// if gamingScenes, ok := this.playerGaming[p.SnId]; ok {
|
||||
// for _, s := range gamingScenes {
|
||||
// pack := &server_proto.WGPlayerDropLine{
|
||||
// Id: proto.Int32(p.SnId),
|
||||
// SceneId: proto.Int(s.sceneId),
|
||||
// }
|
||||
// proto.SetDefaults(pack)
|
||||
// s.SendToGame(int(server_proto.SSPacketID_PACKET_WG_PLAYERDROPLINE), pack)
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//func (this *MiniGameMgr) OnPlayerRehold(p *Player) {
|
||||
// this.BasePlayerListener.OnPlayerRehold(p)
|
||||
// var gateSid int64
|
||||
// if p.gateSess != nil {
|
||||
// if srvInfo, ok := p.gateSess.GetAttribute(srvlib.SessionAttributeServerInfo).(*srvlibproto.SSSrvRegiste); ok && srvInfo != nil {
|
||||
// sessionId := srvlib.NewSessionIdEx(srvInfo.GetAreaId(), srvInfo.GetType(), srvInfo.GetId(), 0)
|
||||
// gateSid = sessionId.Get()
|
||||
// }
|
||||
// }
|
||||
// if gamingScenes, ok := this.playerGaming[p.SnId]; ok {
|
||||
// for _, s := range gamingScenes {
|
||||
// pack := &server_proto.WGPlayerRehold{
|
||||
// Id: proto.Int32(p.SnId),
|
||||
// Sid: proto.Int64(p.sid),
|
||||
// SceneId: proto.Int(s.sceneId),
|
||||
// GateSid: proto.Int64(gateSid),
|
||||
// }
|
||||
// proto.SetDefaults(pack)
|
||||
// s.SendToGame(int(server_proto.SSPacketID_PACKET_WG_PLAYERREHOLD), pack)
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
//func (this *MiniGameMgr) OnPlayerReturnScene(p *Player) {
|
||||
// this.BasePlayerListener.OnPlayerReturnScene(p)
|
||||
// if gameingScenes, ok := this.playerGaming[p.SnId]; ok {
|
||||
// for _, s := range gameingScenes {
|
||||
// pack := &server_proto.WGPlayerReturn{
|
||||
// PlayerId: p.SnId,
|
||||
// RoomId: int32(s.sceneId),
|
||||
// }
|
||||
// proto.SetDefaults(pack)
|
||||
// s.SendToGame(int(server_proto.SSPacketID_PACKET_WG_PLAYERRETURN), pack)
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//func (this *MiniGameMgr) OnDestroyScene(s *Scene) {
|
||||
//
|
||||
// if pltScenes, ok := this.scenesOfPlatform[s.limitPlatform.IdStr]; ok {
|
||||
// delete(pltScenes, s.dbGameFree.Id)
|
||||
// }
|
||||
//
|
||||
// for snid, _ := range s.players {
|
||||
// if scenes, ok := this.playerGaming[snid]; ok {
|
||||
// delete(scenes, s.dbGameFree.Id)
|
||||
// if len(scenes) == 0 {
|
||||
// delete(this.playerGaming, snid)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//func (this *MiniGameMgr) ClrPlayerWhiteBlackState(p *Player) {
|
||||
// if gamings, ok := this.playerGaming[p.SnId]; ok {
|
||||
// for _, s := range gamings {
|
||||
// pack := &server_proto.WGSetPlayerBlackLevel{
|
||||
// SnId: proto.Int32(p.SnId),
|
||||
// SceneId: proto.Int32(int32(s.sceneId)),
|
||||
// ResetTotalCoin: proto.Bool(true),
|
||||
// }
|
||||
// proto.SetDefaults(pack)
|
||||
// s.SendToGame(int(server_proto.SSPacketID_PACKET_GW_AUTORELIEVEWBLEVEL), pack)
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//func (this *MiniGameMgr) OnPlatformDestroyByGameFreeId(p *Platform, gameFreeId int32) {
|
||||
// if p == nil {
|
||||
// return
|
||||
// }
|
||||
// if scenes, ok := this.scenesOfPlatform[p.IdStr]; ok {
|
||||
// for _, s := range scenes {
|
||||
// if s.dbGameFree.Id == gameFreeId {
|
||||
// pack := &server_proto.WGGraceDestroyScene{}
|
||||
// pack.Ids = append(pack.Ids, int32(s.sceneId))
|
||||
// s.SendToGame(int(server_proto.SSPacketID_PACKET_WG_GRACE_DESTROYSCENE), pack)
|
||||
// delete(scenes, gameFreeId)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//func init() {
|
||||
// RegistePlayerListener(MiniGameMgrSington)
|
||||
// PlatformMgrSingleton.RegisterObserver(MiniGameMgrSington)
|
||||
// PlatformGameGroupMgrSington.RegisterObserver(MiniGameMgrSington)
|
||||
//}
|
||||
|
|
@ -1899,6 +1899,7 @@ func (this *Player) AddDiamond(num, add int64, gainWay int32, oper, remark strin
|
|||
log := model.NewCoinLogEx(&model.CoinLogParam{
|
||||
Platform: this.Platform,
|
||||
SnID: this.SnId,
|
||||
Channel: this.Channel,
|
||||
ChangeType: common.BillTypeDiamond,
|
||||
ChangeNum: num,
|
||||
RemainNum: this.Diamond,
|
||||
|
|
@ -1954,6 +1955,7 @@ func (this *Player) AddCoin(num, add int64, gainWay int32, oper, remark string)
|
|||
log := model.NewCoinLogEx(&model.CoinLogParam{
|
||||
Platform: this.Platform,
|
||||
SnID: this.SnId,
|
||||
Channel: this.Channel,
|
||||
ChangeType: common.BillTypeCoin,
|
||||
ChangeNum: num,
|
||||
RemainNum: this.Coin,
|
||||
|
|
@ -2008,6 +2010,7 @@ func (this *Player) AddCoinAsync(num, add int64, gainWay int32, oper, remark str
|
|||
log := model.NewCoinLogEx(&model.CoinLogParam{
|
||||
Platform: this.Platform,
|
||||
SnID: this.SnId,
|
||||
Channel: this.Channel,
|
||||
ChangeType: common.BillTypeCoin,
|
||||
ChangeNum: num,
|
||||
RemainNum: this.Coin,
|
||||
|
|
@ -3604,7 +3607,7 @@ func (this *Player) SendShowRed(showType hall_proto.ShowRedCode, showChild, isSh
|
|||
},
|
||||
}
|
||||
proto.SetDefaults(pack)
|
||||
//logger.Logger.Trace("SCShowRed:", pack)
|
||||
logger.Logger.Trace("SCShowRed:", pack)
|
||||
this.SendToClient(int(hall_proto.HallPacketID_PACKET_SC_SHOWRED), pack)
|
||||
}
|
||||
|
||||
|
|
@ -4009,6 +4012,42 @@ func (this *Player) SendRankSeason() {
|
|||
info := &rankmatch.SeasonInfo{Id: k}
|
||||
info.Lv, info.Score = RankMgrSingleton.GetPlayerRankLV(k, this.SnId)
|
||||
info.LastLv, info.LastScore = RankMgrSingleton.GetPlayerLastRankLV(k, this.SnId)
|
||||
se := RankMgrSingleton.GetPlayerSeason(this.SnId)
|
||||
if se != nil && se.RankType[k] != nil {
|
||||
if se.RankType[k].LastScore < se.RankType[k].Score {
|
||||
oldLv := srvdata.RankLevelMgr.GetRankLevel(k, se.RankType[k].LastScore)
|
||||
if info.Lv > oldLv {
|
||||
var awards *rankmatch.AwardItem
|
||||
var maxLv int32 = -1
|
||||
for _, item := range RankMgrSingleton.GetRankAwardList(k) {
|
||||
// 1 可领取 2已领取
|
||||
if info.Lv >= item.Lv {
|
||||
has := false
|
||||
// 是否已领取
|
||||
for _, vv := range v.Awards {
|
||||
if vv.Id == item.Id {
|
||||
if vv.Ts > 0 {
|
||||
has = true
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
if !has {
|
||||
if item.Lv > maxLv {
|
||||
awards = item
|
||||
maxLv = item.Lv
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if awards != nil {
|
||||
info.Award = awards
|
||||
}
|
||||
}
|
||||
se.RankType[k].LastScore = se.RankType[k].Score
|
||||
}
|
||||
}
|
||||
|
||||
pack.Seasons = append(pack.Seasons, info)
|
||||
}
|
||||
}
|
||||
|
|
@ -4474,7 +4513,6 @@ func (this *Player) CollectTask(taskId int32, num int64) {
|
|||
|
||||
// 购买周卡检查
|
||||
func (this *Player) CheckWeekCard(shopId int32) bool {
|
||||
srvdata.PBDB_GiftCardMgr.Datas.GetArr()
|
||||
id := int32(-1)
|
||||
for _, card := range srvdata.PBDB_GiftCardMgr.Datas.GetArr() {
|
||||
if card.ShopID == shopId {
|
||||
|
|
@ -4553,25 +4591,24 @@ func (this *Player) GetWeekCardAwary(id int32) {
|
|||
logger.Logger.Trace("周卡已过期,不能领取!")
|
||||
return
|
||||
}
|
||||
if this.WeekCardAward[id] {
|
||||
return
|
||||
}
|
||||
ret := &player_proto.SCGetWeekCardAwary{}
|
||||
//获取周卡奖励
|
||||
items := data.GetDayRewards()
|
||||
addItem := []*Item{}
|
||||
for itemId, itemNum := range items {
|
||||
item := &Item{ItemId: int32(itemId), ItemNum: itemNum, ObtainTime: time.Now().Unix()}
|
||||
addItem = append(addItem, item)
|
||||
itemInfo := &player_proto.PayItem{}
|
||||
itemInfo.ItemId = int32(itemId)
|
||||
itemInfo.ItemNum = itemNum
|
||||
ret.Items = append(ret.Items, itemInfo)
|
||||
if !this.WeekCardAward[id] {
|
||||
//获取周卡奖励
|
||||
items := data.GetDayRewards()
|
||||
addItem := []*Item{}
|
||||
for itemId, itemNum := range items {
|
||||
item := &Item{ItemId: int32(itemId), ItemNum: itemNum, ObtainTime: time.Now().Unix()}
|
||||
addItem = append(addItem, item)
|
||||
itemInfo := &player_proto.PayItem{}
|
||||
itemInfo.ItemId = int32(itemId)
|
||||
itemInfo.ItemNum = itemNum
|
||||
ret.Items = append(ret.Items, itemInfo)
|
||||
}
|
||||
BagMgrSingleton.AddItems(this, addItem, 0, common.GainWay_WeekCardAward, "system", "周卡每日奖励", 0, 0, false)
|
||||
//返回消息
|
||||
this.WeekCardAward[id] = true
|
||||
ret.WeekCardAward = this.WeekCardAward[id]
|
||||
}
|
||||
BagMgrSingleton.AddItems(this, addItem, 0, common.GainWay_WeekCardAward, "system", "周卡每日奖励", 0, 0, false)
|
||||
//返回消息
|
||||
this.WeekCardAward[id] = true
|
||||
ret.WeekCardAward = this.WeekCardAward[id]
|
||||
info := &player_proto.WeekInfo{
|
||||
Id: id,
|
||||
WeekCardTime: this.WeekCardTime[id],
|
||||
|
|
|
|||
|
|
@ -1,276 +0,0 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"container/list"
|
||||
"fmt"
|
||||
"mongo.games.com/game/common"
|
||||
"mongo.games.com/game/model"
|
||||
"mongo.games.com/game/proto"
|
||||
hall_proto "mongo.games.com/game/protocol/gamehall"
|
||||
"mongo.games.com/goserver/core/basic"
|
||||
"mongo.games.com/goserver/core/task"
|
||||
"strconv"
|
||||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
PrivateSceneState_Deleting = iota //删除中
|
||||
PrivateSceneState_Deleted //已删除
|
||||
)
|
||||
|
||||
var PrivateSceneMgrSington = &PrivateSceneMgr{
|
||||
pps: make(map[int32]*PlayerPrivateScene),
|
||||
}
|
||||
|
||||
type PlayerPrivateScene struct {
|
||||
snid int32 // 玩家id
|
||||
creatorName string //创建人昵称
|
||||
platform string // 平台名称
|
||||
channel string // 渠道名称
|
||||
promoter string // 推广员
|
||||
packageTag string // 推广包标识
|
||||
scenes map[int]*Scene
|
||||
logsByDay map[int]*list.List
|
||||
dupLog map[string]struct{}
|
||||
loaded bool
|
||||
}
|
||||
|
||||
func (pps *PlayerPrivateScene) AddScene(s *Scene) {
|
||||
pps.scenes[s.sceneId] = s
|
||||
}
|
||||
|
||||
func (pps *PlayerPrivateScene) GetScene(sceneId int) *Scene {
|
||||
if s, exist := pps.scenes[sceneId]; exist {
|
||||
return s
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (pps *PlayerPrivateScene) GetCount() int {
|
||||
return len(pps.scenes)
|
||||
}
|
||||
|
||||
func (pps *PlayerPrivateScene) CanDelete() bool {
|
||||
return !pps.loaded && len(pps.scenes) == 0
|
||||
}
|
||||
|
||||
func (pps *PlayerPrivateScene) OnPlayerLogin(p *Player) {
|
||||
|
||||
}
|
||||
|
||||
func (pps *PlayerPrivateScene) OnPlayerLogout(p *Player) {
|
||||
pps.logsByDay = nil
|
||||
pps.loaded = false
|
||||
}
|
||||
|
||||
func (pps *PlayerPrivateScene) OnCreateScene(p *Player, s *Scene) {
|
||||
pps.scenes[s.sceneId] = s
|
||||
}
|
||||
|
||||
func (pps *PlayerPrivateScene) LoadLogs(p *Player, yyyymmdd int32) {
|
||||
if !pps.loaded {
|
||||
var logs []*model.PrivateSceneLog
|
||||
var err error
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
logs, err = model.GetPrivateSceneLogBySnId(p.Platform, p.SnId, model.GameParamData.PrivateSceneLogLimit)
|
||||
return nil
|
||||
}), task.CompleteNotifyWrapper(func(data interface{}, t task.Task) {
|
||||
if err == nil {
|
||||
pps.loaded = true
|
||||
pps.TidyLog(logs)
|
||||
pps.SendLogs(p, yyyymmdd)
|
||||
}
|
||||
}), "GetPrivateSceneLogBySnId").Start()
|
||||
} else {
|
||||
pps.SendLogs(p, yyyymmdd)
|
||||
}
|
||||
}
|
||||
|
||||
func (pps *PlayerPrivateScene) TidyLog(logs []*model.PrivateSceneLog) {
|
||||
if pps.logsByDay == nil {
|
||||
pps.logsByDay = make(map[int]*list.List)
|
||||
}
|
||||
|
||||
for _, log := range logs {
|
||||
if _, exist := pps.dupLog[log.LogId.Hex()]; exist {
|
||||
continue
|
||||
}
|
||||
y, m, d := log.CreateTime.Date()
|
||||
day := y*10000 + int(m)*100 + d
|
||||
if lst, exist := pps.logsByDay[day]; exist {
|
||||
lst.PushBack(log)
|
||||
} else {
|
||||
lst = list.New()
|
||||
pps.logsByDay[day] = lst
|
||||
lst.PushBack(log)
|
||||
}
|
||||
}
|
||||
pps.dupLog = nil
|
||||
}
|
||||
|
||||
func (pps *PlayerPrivateScene) SendLogs(p *Player, yyyymmdd int32) {
|
||||
pack := &hall_proto.SCGetPrivateRoomHistory{
|
||||
QueryTime: proto.Int32(yyyymmdd),
|
||||
}
|
||||
if logs, exist := pps.logsByDay[int(yyyymmdd)]; exist {
|
||||
for e := logs.Front(); e != nil; e = e.Next() {
|
||||
if log, ok := e.Value.(*model.PrivateSceneLog); ok {
|
||||
data := &hall_proto.PrivateRoomHistory{
|
||||
GameFreeId: proto.Int32(log.GameFreeId),
|
||||
RoomId: proto.Int32(log.SceneId),
|
||||
CreateTime: proto.Int32(int32(log.CreateTime.Unix())),
|
||||
DestroyTime: proto.Int32(int32(log.DestroyTime.Unix())),
|
||||
CreateFee: proto.Int32(log.CreateFee),
|
||||
}
|
||||
pack.Datas = append(pack.Datas, data)
|
||||
}
|
||||
}
|
||||
}
|
||||
proto.SetDefaults(pack)
|
||||
p.SendToClient(int(hall_proto.GameHallPacketID_PACKET_SC_GETPRIVATEROOMHISTORY), pack)
|
||||
}
|
||||
|
||||
func (pps *PlayerPrivateScene) PushLog(log *model.PrivateSceneLog) {
|
||||
if log == nil {
|
||||
return
|
||||
}
|
||||
|
||||
y, m, d := log.CreateTime.Date()
|
||||
day := y*10000 + int(m)*100 + d
|
||||
if lst, exist := pps.logsByDay[day]; exist {
|
||||
lst.PushFront(log)
|
||||
} else {
|
||||
lst = list.New()
|
||||
pps.logsByDay[day] = lst
|
||||
lst.PushFront(log)
|
||||
}
|
||||
if !pps.loaded {
|
||||
pps.dupLog[log.LogId.Hex()] = struct{}{}
|
||||
}
|
||||
}
|
||||
|
||||
func (pps *PlayerPrivateScene) SendPrivateScenes(p *Player) {
|
||||
pack := &hall_proto.SCGetPrivateRoomList{}
|
||||
for sceneid, s := range pps.scenes {
|
||||
data := &hall_proto.PrivateRoomInfo{
|
||||
GameFreeId: proto.Int32(s.dbGameFree.GetId()),
|
||||
RoomId: proto.Int(sceneid),
|
||||
CurrRound: proto.Int32(s.currRound),
|
||||
MaxRound: proto.Int32(s.totalRound),
|
||||
CurrNum: proto.Int(len(s.players)),
|
||||
MaxPlayer: proto.Int(s.playerNum),
|
||||
CreateTs: proto.Int32(int32(s.createTime.Unix())),
|
||||
}
|
||||
pack.Datas = append(pack.Datas, data)
|
||||
}
|
||||
proto.SetDefaults(pack)
|
||||
p.SendToClient(int(hall_proto.GameHallPacketID_PACKET_SC_GETPRIVATEROOMLIST), pack)
|
||||
}
|
||||
|
||||
type PrivateSceneMgr struct {
|
||||
pps map[int32]*PlayerPrivateScene
|
||||
}
|
||||
|
||||
func (psm *PrivateSceneMgr) GetOrCreatePlayerPrivateScene(p *Player) *PlayerPrivateScene {
|
||||
snid := p.SnId
|
||||
if pps, exist := psm.pps[snid]; exist {
|
||||
return pps
|
||||
}
|
||||
|
||||
pps := &PlayerPrivateScene{
|
||||
snid: snid,
|
||||
creatorName: p.Name,
|
||||
platform: p.Platform,
|
||||
channel: p.Channel,
|
||||
promoter: strconv.Itoa(int(p.PromoterTree)),
|
||||
packageTag: p.PackageID,
|
||||
scenes: make(map[int]*Scene),
|
||||
logsByDay: make(map[int]*list.List),
|
||||
dupLog: make(map[string]struct{}),
|
||||
}
|
||||
|
||||
psm.pps[snid] = pps
|
||||
return pps
|
||||
}
|
||||
|
||||
func (psm *PrivateSceneMgr) GetPlayerPrivateScene(snid int32) *PlayerPrivateScene {
|
||||
if pps, exist := psm.pps[snid]; exist {
|
||||
return pps
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (psm *PrivateSceneMgr) OnDestroyScene(scene *Scene) {
|
||||
if scene == nil {
|
||||
return
|
||||
}
|
||||
|
||||
if !scene.IsPrivateScene() {
|
||||
return
|
||||
}
|
||||
|
||||
pps := psm.GetPlayerPrivateScene(scene.creator)
|
||||
if pps != nil {
|
||||
if pps.GetScene(scene.sceneId) == scene {
|
||||
delete(pps.scenes, scene.sceneId)
|
||||
var tax int32
|
||||
var returnCoin int32
|
||||
p := PlayerMgrSington.GetPlayerBySnId(scene.creator)
|
||||
|
||||
if scene.currRound == 0 && !scene.starting && scene.createFee > 0 { //未开始
|
||||
if scene.manualDelete && time.Now().Sub(scene.createTime) < time.Second*time.Duration(model.GameParamData.PrivateSceneFreeDistroySec) { //低于指定时间,要扣除部分费用
|
||||
tax = scene.createFee * int32(model.GameParamData.PrivateSceneDestroyTax) / 100
|
||||
returnCoin = scene.createFee - tax
|
||||
} else {
|
||||
returnCoin = scene.createFee
|
||||
}
|
||||
if returnCoin > 0 {
|
||||
if p != nil {
|
||||
var remark string
|
||||
if tax > 0 {
|
||||
remark = fmt.Sprintf("提前解散扣除费用%.02f", float32(tax)/100.0)
|
||||
}
|
||||
p.AddCoin(int64(returnCoin), 0, common.GainWay_PrivateSceneReturn, "", remark)
|
||||
} else {
|
||||
//TODO 发送邮件
|
||||
//sendClubMail_ClubCreateRoomRefund(scene.creator, scene.limitPlatform.Name, int32(scene.sceneId), int64(tax), int64(returnCoin))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if p != nil {
|
||||
pack := &hall_proto.SCDestroyPrivateRoom{
|
||||
OpRetCode: hall_proto.OpResultCode_Game_OPRC_Sucess_Game,
|
||||
RoomId: proto.Int(scene.sceneId),
|
||||
State: proto.Int(PrivateSceneState_Deleted),
|
||||
}
|
||||
proto.SetDefaults(pack)
|
||||
p.SendToClient(int(hall_proto.GameHallPacketID_PACKET_SC_DESTROYPRIVATEROOM), pack)
|
||||
}
|
||||
|
||||
//写log
|
||||
log := model.NewPrivateSceneLog()
|
||||
if log != nil {
|
||||
log.SnId = pps.snid
|
||||
log.Platform = pps.platform
|
||||
log.Channel = pps.channel
|
||||
log.Promoter = pps.promoter
|
||||
log.GameFreeId = scene.dbGameFree.GetId()
|
||||
log.SceneId = int32(scene.sceneId)
|
||||
log.CreateTime = scene.createTime
|
||||
log.DestroyTime = time.Now()
|
||||
if returnCoin > 0 {
|
||||
log.CreateFee = tax
|
||||
} else {
|
||||
log.CreateFee = scene.createFee
|
||||
}
|
||||
//PrivateSceneLogChannelSington.Write(log)
|
||||
pps.PushLog(log)
|
||||
}
|
||||
|
||||
if pps.CanDelete() && p == nil {
|
||||
delete(psm.pps, scene.creator)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -126,6 +126,7 @@ func (this *PlayerRankSeason) CheckNewSeason() {
|
|||
}
|
||||
for k, v := range this.RankType {
|
||||
this.RankType[k].Score = RankMgrSingleton.NewSeasonScore(v.Score)
|
||||
this.RankType[k].LastScore = this.RankType[k].Score
|
||||
this.RankType[k].Awards = nil
|
||||
}
|
||||
|
||||
|
|
@ -155,6 +156,7 @@ func (this *PlayerRankSeason) Update(rankScore map[int32]int64) {
|
|||
|
||||
for k, v := range this.RankType {
|
||||
if v != nil && v.Score != rankScore[k] {
|
||||
v.LastScore = v.Score
|
||||
v.Score = rankScore[k]
|
||||
this.Dirty = true
|
||||
this.CheckShowRed(k)
|
||||
|
|
@ -207,10 +209,12 @@ here:
|
|||
break
|
||||
}
|
||||
}
|
||||
if has {
|
||||
p := PlayerMgrSington.GetPlayerBySnId(this.SnId)
|
||||
if p != nil {
|
||||
p := PlayerMgrSington.GetPlayerBySnId(this.SnId)
|
||||
if p != nil {
|
||||
if has {
|
||||
p.SendShowRed(hall_proto.ShowRedCode_RankReward, rankType, 1)
|
||||
} else {
|
||||
p.SendShowRed(hall_proto.ShowRedCode_RankReward, rankType, 0)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,7 +92,6 @@ type Scene struct {
|
|||
clubRoomPos int32 //
|
||||
clubRoomTax int32 //
|
||||
createFee int32 //创建房间的费用
|
||||
manualDelete bool //是否手动解散
|
||||
GameLog []int32 //游戏服务器同步的录单
|
||||
JackPotFund int64 //游戏服务器同步的奖池
|
||||
State int32 //当前游戏状态,后期放到ScenePolicy里去处理
|
||||
|
|
@ -503,6 +502,7 @@ func (this *Scene) PlayerEnter(p *Player, pos int, ischangeroom bool) bool {
|
|||
enterTs: p.enterts.Unix(),
|
||||
totalConvertibleFlow: p.TotalConvertibleFlow,
|
||||
}
|
||||
this.lastTime = time.Now()
|
||||
}
|
||||
msg.TakeCoin = proto.Int64(takeCoin)
|
||||
msg.ExpectLeaveCoin = proto.Int64(leaveCoin)
|
||||
|
|
@ -552,7 +552,6 @@ func (this *Scene) PlayerEnter(p *Player, pos int, ischangeroom bool) bool {
|
|||
proto.SetDefaults(msg)
|
||||
this.SendToGame(int(serverproto.SSPacketID_PACKET_WG_PLAYERENTER), msg)
|
||||
logger.Logger.Tracef("SSPacketID_PACKET_WG_PLAYERENTER Scene:%v ;PlayerEnter(%v, %v)", this.sceneId, p.SnId, pos)
|
||||
this.lastTime = time.Now()
|
||||
FirePlayerEnterScene(p, this)
|
||||
return true
|
||||
} else {
|
||||
|
|
@ -603,8 +602,9 @@ func (this *Scene) PlayerLeave(p *Player, reason int) {
|
|||
|
||||
// 玩家最后所在游戏
|
||||
p.LastGameId = int(this.dbGameFree.GetGameId())
|
||||
|
||||
this.lastTime = time.Now()
|
||||
if !p.IsRob {
|
||||
this.lastTime = time.Now()
|
||||
}
|
||||
}
|
||||
|
||||
func (this *Scene) DelPlayer(p *Player) bool {
|
||||
|
|
@ -701,6 +701,7 @@ func (this *Scene) AudienceEnter(p *Player, ischangeroom bool) bool {
|
|||
enterTs: p.enterts.Unix(),
|
||||
totalConvertibleFlow: p.TotalConvertibleFlow,
|
||||
}
|
||||
this.lastTime = time.Now()
|
||||
}
|
||||
|
||||
takeCoin := p.Coin
|
||||
|
|
@ -709,7 +710,6 @@ func (this *Scene) AudienceEnter(p *Player, ischangeroom bool) bool {
|
|||
proto.SetDefaults(msg)
|
||||
this.SendToGame(int(serverproto.SSPacketID_PACKET_WG_AUDIENCEENTER), msg)
|
||||
p.enterts = time.Now()
|
||||
this.lastTime = time.Now()
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
@ -728,7 +728,9 @@ func (this *Scene) AudienceLeave(p *Player, reason int) {
|
|||
p.SendToClient(int(hallproto.GameHallPacketID_PACKET_SC_LEAVEROOM), pack)
|
||||
//观众直接从房间退出来
|
||||
this.DelAudience(p)
|
||||
this.lastTime = time.Now()
|
||||
if !p.IsRob {
|
||||
this.lastTime = time.Now()
|
||||
}
|
||||
}
|
||||
|
||||
func (this *Scene) DelAudience(p *Player) bool {
|
||||
|
|
@ -808,12 +810,6 @@ func (this *Scene) AudienceSit(p *Player, pos int) bool {
|
|||
p.scene = this
|
||||
this.players[p.SnId] = p
|
||||
|
||||
//NpcServerAgentSington.OnPlayerEnterScene(this, p)
|
||||
if this.IsCoinScene() {
|
||||
//CoinSceneMgrSingleton.OnPlayerEnter(p, this.dbGameFree.GetId())
|
||||
} else if this.IsHallScene() {
|
||||
|
||||
}
|
||||
msg := &serverproto.WGAudienceSit{
|
||||
SnId: proto.Int32(p.SnId),
|
||||
SceneId: proto.Int(this.sceneId),
|
||||
|
|
@ -823,7 +819,9 @@ func (this *Scene) AudienceSit(p *Player, pos int) bool {
|
|||
msg.TakeCoin = proto.Int64(p.Coin)
|
||||
proto.SetDefaults(msg)
|
||||
this.SendToGame(int(serverproto.SSPacketID_PACKET_WG_AUDIENCESIT), msg)
|
||||
this.lastTime = time.Now()
|
||||
if !p.IsRob {
|
||||
this.lastTime = time.Now()
|
||||
}
|
||||
return true
|
||||
}
|
||||
return false
|
||||
|
|
@ -935,23 +933,24 @@ func (this *Scene) BilledRoomCard(snid []int32) {
|
|||
|
||||
func (this *Scene) IsLongTimeInactive() bool {
|
||||
tNow := time.Now()
|
||||
//删除超过指定不活跃时间的房间
|
||||
if len(this.players) == 0 && tNow.Sub(this.lastTime) > time.Second*time.Duration(model.GameParamData.SceneMaxIdle) {
|
||||
// 房间没有真人,没有观众,长时间没有真人进出房间
|
||||
if this.GetTruePlayerCnt() == 0 && this.GetAudienceCnt() == 0 && tNow.Sub(this.lastTime) > time.Second*time.Duration(model.GameParamData.SceneMaxIdle) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (this *Scene) ForceDelete(isManual bool) {
|
||||
this.manualDelete = isManual
|
||||
this.deleting = true
|
||||
this.force = true
|
||||
pack := &serverproto.WGDestroyScene{
|
||||
SceneId: proto.Int(this.sceneId),
|
||||
func (this *Scene) DoDelete(isGrace bool) {
|
||||
if !isGrace {
|
||||
this.deleting = true
|
||||
this.force = true
|
||||
}
|
||||
pack := &serverproto.WGDestroyScene{
|
||||
Ids: []int64{int64(this.sceneId)},
|
||||
IsGrace: isGrace,
|
||||
}
|
||||
proto.SetDefaults(pack)
|
||||
this.SendToGame(int(serverproto.SSPacketID_PACKET_WG_DESTROYSCENE), pack)
|
||||
logger.Logger.Warnf("(this *Scene) ForceDelete() sceneid=%v", this.sceneId)
|
||||
logger.Logger.Tracef("WG_DESTROYSCENE: %v", pack)
|
||||
}
|
||||
|
||||
func (this *Scene) Shutdown() {
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import (
|
|||
"sort"
|
||||
|
||||
"mongo.games.com/goserver/core/logger"
|
||||
"mongo.games.com/goserver/srvlib"
|
||||
|
||||
"mongo.games.com/game/common"
|
||||
"mongo.games.com/game/model"
|
||||
|
|
@ -351,6 +352,26 @@ func (m *SceneMgr) OnPlayerLeaveScene(s *Scene, p *Player) {
|
|||
}
|
||||
}
|
||||
|
||||
func (m *SceneMgr) DoDelete(sceneId []int, isGrace bool) {
|
||||
if len(sceneId) == 0 {
|
||||
return
|
||||
}
|
||||
var ids []int64
|
||||
for _, v := range sceneId {
|
||||
ids = append(ids, int64(v))
|
||||
s, ok := m.scenes[v]
|
||||
if !isGrace && ok && s != nil {
|
||||
s.deleting = true
|
||||
s.force = true
|
||||
}
|
||||
}
|
||||
pack := &serverproto.WGDestroyScene{
|
||||
Ids: ids,
|
||||
IsGrace: isGrace,
|
||||
}
|
||||
srvlib.ServerSessionMgrSington.Broadcast(int(serverproto.SSPacketID_PACKET_WG_DESTROYSCENE), pack, common.GetSelfAreaId(), srvlib.GameServerType)
|
||||
}
|
||||
|
||||
// GetThirdScene 获取三方游戏房间
|
||||
//func (m *SceneMgr) GetThirdScene(i webapi.IThirdPlatform) *Scene {
|
||||
// if i == nil {
|
||||
|
|
@ -393,18 +414,18 @@ func (m *SceneMgr) OnMiniTimer() {
|
|||
case s.IsCoinScene():
|
||||
if s.IsLongTimeInactive() {
|
||||
if s.dbGameFree.GetCreateRoomNum() == 0 {
|
||||
logger.Logger.Warnf("SceneMgr.DeleteLongTimeInactive CoinScene ForceDelete scene:%v IsLongTimeInactive", s.sceneId)
|
||||
s.ForceDelete(false)
|
||||
logger.Logger.Warnf("SceneMgr.DeleteLongTimeInactive CoinScene DoDelete scene:%v IsLongTimeInactive", s.sceneId)
|
||||
s.DoDelete(false)
|
||||
}
|
||||
if s.dbGameFree.GetCreateRoomNum() > 0 && s.csp != nil && s.csp.GetRoomNum() > int(s.dbGameFree.GetCreateRoomNum()) {
|
||||
logger.Logger.Warnf("SceneMgr.DeleteLongTimeInactive CoinScene ForceDelete scene:%v IsLongTimeInactive", s.sceneId)
|
||||
s.ForceDelete(false)
|
||||
logger.Logger.Warnf("SceneMgr.DeleteLongTimeInactive CoinScene DoDelete scene:%v IsLongTimeInactive", s.sceneId)
|
||||
s.DoDelete(false)
|
||||
}
|
||||
}
|
||||
case s.IsPrivateScene():
|
||||
if s.IsLongTimeInactive() {
|
||||
logger.Logger.Warnf("SceneMgr.DeleteLongTimeInactive PrivateScene ForceDelete scene:%v IsLongTimeInactive", s.sceneId)
|
||||
s.ForceDelete(false)
|
||||
logger.Logger.Warnf("SceneMgr.DeleteLongTimeInactive PrivateScene DoDelete scene:%v IsLongTimeInactive", s.sceneId)
|
||||
s.DoDelete(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -179,9 +179,7 @@ func (spd *ScenePolicyData) OnPlayerLeave(s *Scene, p *Player) {
|
|||
|
||||
// 系统维护关闭事件
|
||||
func (spd *ScenePolicyData) OnShutdown(s *Scene) {
|
||||
if s.IsPrivateScene() {
|
||||
PrivateSceneMgrSington.OnDestroyScene(s)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 获得场景的匹配因子(值越大越优先选择)
|
||||
|
|
|
|||
|
|
@ -646,13 +646,28 @@ func (this *ShopMgr) GainShop(shopInfo *model.ShopInfo, p *Player, vipShopId, po
|
|||
costNum := this.GetCostNum(p, shopInfo, vipShopId)
|
||||
if shopInfo.Ad <= 0 { //消耗
|
||||
logger.Logger.Tracef("GainShop ConstType[%v],shopName[%v],costNum[%v]", shopInfo.ConstType, shopName, costNum)
|
||||
|
||||
var gainWay int32 = common.GainWay_Shop_Buy
|
||||
switch shopInfo.Page {
|
||||
case ShopPageCoin:
|
||||
gainWay = common.GainWayBuyCoin
|
||||
case ShopPageGift:
|
||||
if shopInfo.Id == common.ShopIdWeekCard {
|
||||
gainWay = common.GainWayBuyWeekCard
|
||||
}
|
||||
case ShopPageItem:
|
||||
gainWay = common.GainWayBuyItem
|
||||
case ShopPageVip:
|
||||
gainWay = common.GainWayVipBuyCoin
|
||||
}
|
||||
|
||||
switch shopInfo.ConstType {
|
||||
case ShopConsumeCoin:
|
||||
p.AddCoin(-costNum, 0, common.GainWay_Shop_Buy, "sys", shopName)
|
||||
p.AddCoin(-costNum, 0, gainWay, "sys", shopName)
|
||||
case ShopConsumeDiamond:
|
||||
p.AddDiamond(-costNum, 0, common.GainWay_Shop_Buy, "sys", shopName)
|
||||
p.AddDiamond(-costNum, 0, gainWay, "sys", shopName)
|
||||
case ShopConsumePhoneScore:
|
||||
p.AddPhoneScore(-costNum, 0, common.GainWay_Shop_Buy, "sys", shopName)
|
||||
p.AddPhoneScore(-costNum, 0, gainWay, "sys", shopName)
|
||||
default:
|
||||
logger.Logger.Errorf("GainShop ConstType[%v] err", shopInfo.ConstType)
|
||||
return shop.OpResultCode_OPRC_Error
|
||||
|
|
|
|||
|
|
@ -135,6 +135,7 @@ func (t *TaskLogin) Call(o *basic.Object) interface{} {
|
|||
log := model.NewCoinLogEx(&model.CoinLogParam{
|
||||
Platform: playerData.Platform,
|
||||
SnID: playerData.SnId,
|
||||
Channel: playerData.Channel,
|
||||
ChangeType: common.BillTypeCoin,
|
||||
ChangeNum: int64(model.GameParamData.NewPlayerCoin),
|
||||
RemainNum: playerData.Coin + int64(model.GameParamData.NewPlayerCoin),
|
||||
|
|
@ -165,6 +166,7 @@ func (t *TaskLogin) Call(o *basic.Object) interface{} {
|
|||
log := model.NewCoinLogEx(&model.CoinLogParam{
|
||||
Platform: playerData.Platform,
|
||||
SnID: playerData.SnId,
|
||||
Channel: playerData.Channel,
|
||||
ChangeType: common.BillTypeCoin,
|
||||
ChangeNum: coin,
|
||||
RemainNum: playerData.Coin + coin,
|
||||
|
|
@ -189,6 +191,7 @@ func (t *TaskLogin) Call(o *basic.Object) interface{} {
|
|||
log := model.NewCoinLogEx(&model.CoinLogParam{
|
||||
Platform: playerData.Platform,
|
||||
SnID: playerData.SnId,
|
||||
Channel: playerData.Channel,
|
||||
ChangeType: common.BillTypeDiamond,
|
||||
ChangeNum: diamond,
|
||||
RemainNum: playerData.Diamond + diamond,
|
||||
|
|
|
|||
|
|
@ -30,9 +30,12 @@ func init() {
|
|||
}
|
||||
|
||||
const (
|
||||
MatchTypeNormal = 1 // 锦标赛
|
||||
MatchTypeChampion = 2 // 冠军赛
|
||||
MatchTypeVIP = 3 // vip比赛
|
||||
// 如果这里比赛类型没有,默认是锦标赛
|
||||
MatchTypeNormal = iota + 1 // 锦标赛
|
||||
MatchTypeChampion // 冠军赛/实物赛
|
||||
MatchTypeVIP // vip比赛
|
||||
MatchTypePhone // 话费赛
|
||||
MatchTypeMax // 最大比赛类型
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
@ -81,6 +84,7 @@ type PlayerRoundInfo struct {
|
|||
|
||||
type Tournament struct {
|
||||
BaseClockSinker
|
||||
TypeList map[string]*webapiproto.GameMatchType // 比赛类型列表 平台id:比赛类型列表
|
||||
GameMatchDateList map[string]map[int32]*webapiproto.GameMatchDate // 比赛配置,platform:比赛场配置id:比赛配置
|
||||
singleSignupPlayers map[int32]*SignupInfo // 开启机器人时,报名的玩家,玩家Id:报名信息
|
||||
signupPlayers map[string]map[int32]*SignInfo // 报名的玩家 platform:比赛配置id:报名人
|
||||
|
|
@ -93,6 +97,7 @@ type Tournament struct {
|
|||
|
||||
func NewTournament() *Tournament {
|
||||
ret := &Tournament{
|
||||
TypeList: make(map[string]*webapiproto.GameMatchType),
|
||||
GameMatchDateList: make(map[string]map[int32]*webapiproto.GameMatchDate),
|
||||
singleSignupPlayers: make(map[int32]*SignupInfo),
|
||||
signupPlayers: make(map[string]map[int32]*SignInfo),
|
||||
|
|
@ -245,8 +250,34 @@ func (this *Tournament) UpdateData(init bool, data *webapiproto.GameMatchDateLis
|
|||
}
|
||||
}
|
||||
|
||||
func (this *Tournament) UpdateTypeList(init bool, data *webapiproto.GameMatchType) {
|
||||
if data.Platform == "0" {
|
||||
return
|
||||
}
|
||||
this.TypeList[data.Platform] = data
|
||||
if !init {
|
||||
//todo 优化
|
||||
for _, v := range PlayerMgrSington.playerOfPlatform[data.Platform] {
|
||||
pack := TournamentMgr.GetSCTMInfosPack(data.Platform, v.AppChannel)
|
||||
v.SendToClient(int(tournament.TOURNAMENTID_PACKET_TM_SCTMInfos), pack)
|
||||
logger.Logger.Trace("SCTMInfos UpdateTypeList", pack)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// GetMatchInfo 比赛配置
|
||||
func (this *Tournament) GetMatchInfo(platform string, tmId int32) *webapiproto.GameMatchDate {
|
||||
// !!!没有sortId会获取最新配置
|
||||
func (this *Tournament) GetMatchInfo(platform string, tmId int32, sortId int64) *webapiproto.GameMatchDate {
|
||||
if sortId > 0 {
|
||||
v := this.matches[tmId]
|
||||
if v != nil {
|
||||
vv := v[sortId]
|
||||
if vv != nil {
|
||||
return vv.gmd
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
if list, ok := this.GameMatchDateList[platform]; ok {
|
||||
if gmd, ok1 := list[tmId]; ok1 {
|
||||
return gmd
|
||||
|
|
@ -257,7 +288,7 @@ func (this *Tournament) GetMatchInfo(platform string, tmId int32) *webapiproto.G
|
|||
|
||||
// MatchSwitch 比赛开关
|
||||
func (this *Tournament) MatchSwitch(platform string, tmId int32) bool {
|
||||
return this.IsMatchOn(this.GetMatchInfo(platform, tmId))
|
||||
return this.IsMatchOn(this.GetMatchInfo(platform, tmId, 0))
|
||||
}
|
||||
|
||||
// IsMatchOn 比赛开关
|
||||
|
|
@ -266,8 +297,8 @@ func (this *Tournament) IsMatchOn(match *webapiproto.GameMatchDate) bool {
|
|||
}
|
||||
|
||||
// IsUseRobot 是否用机器人
|
||||
func (this *Tournament) IsUseRobot(platform string, tmId int32) bool {
|
||||
return this.IsRobotOn(this.GetMatchInfo(platform, tmId))
|
||||
func (this *Tournament) IsUseRobot(platform string, tmId int32, sortId int64) bool {
|
||||
return this.IsRobotOn(this.GetMatchInfo(platform, tmId, sortId))
|
||||
}
|
||||
|
||||
// IsRobotOn 是否用机器人
|
||||
|
|
@ -387,7 +418,7 @@ func (this *Tournament) IsMatchWaiting(platform string, snId int32) (bool, int32
|
|||
// 报名费用 0成功 3道具不足 5金币不足 6钻石不足 7免费次数不足
|
||||
func (this *Tournament) signUpCost(p *Player, tmId int32, cost bool) (bool, int32) {
|
||||
logger.Logger.Tracef("signUpCost 比赛id:%v 玩家:%v 报名:%v", tmId, p.SnId, cost)
|
||||
gmd := this.GetMatchInfo(p.Platform, tmId)
|
||||
gmd := this.GetMatchInfo(p.Platform, tmId, 0)
|
||||
if gmd == nil || p.IsRob {
|
||||
return true, 0
|
||||
}
|
||||
|
|
@ -482,7 +513,7 @@ func (this *Tournament) signUpCost(p *Player, tmId int32, cost bool) (bool, int3
|
|||
func (this *Tournament) SignUp(tmId int32, p *Player) (bool, int32) {
|
||||
logger.Logger.Tracef("报名 比赛id:%v 玩家:%v", tmId, p.SnId)
|
||||
// 开启
|
||||
info := this.GetMatchInfo(p.Platform, tmId)
|
||||
info := this.GetMatchInfo(p.Platform, tmId, 0)
|
||||
if !this.IsMatchOn(info) {
|
||||
return false, int32(tournament.SignRaceCode_OPRC_Close)
|
||||
}
|
||||
|
|
@ -636,7 +667,7 @@ func (this *Tournament) ForceQuit(platform string, snId int32) {
|
|||
func (this *Tournament) CanStart(platform string, tmId int32) bool {
|
||||
if this.signupPlayers != nil && this.signupPlayers[platform] != nil {
|
||||
if signInfo, ok := this.signupPlayers[platform][tmId]; ok {
|
||||
matchInfo := this.GetMatchInfo(signInfo.Platform, tmId)
|
||||
matchInfo := this.GetMatchInfo(signInfo.Platform, tmId, 0)
|
||||
if matchInfo != nil {
|
||||
n := 0
|
||||
for _, v := range signInfo.signup {
|
||||
|
|
@ -669,7 +700,7 @@ func (this *Tournament) Start(platform string, tmId int32) {
|
|||
this.matches[tmId] = make(map[int64]*TmMatch)
|
||||
}
|
||||
|
||||
matchInfo := this.GetMatchInfo(platform, tmId)
|
||||
matchInfo := this.GetMatchInfo(platform, tmId, 0)
|
||||
signInfo := this.signupPlayers[platform][tmId]
|
||||
|
||||
if matchInfo == nil || signInfo == nil || len(signInfo.signup) == 0 {
|
||||
|
|
@ -1356,6 +1387,7 @@ func (this *Tournament) GetSCTMInfosPack(platform, channelName string) *tourname
|
|||
Rule: info.Rule,
|
||||
SortId: info.SortId,
|
||||
OnChannelName: info.OnChannelName,
|
||||
ShowId: info.ShowId,
|
||||
}
|
||||
if info.MatchTimeWeek != nil && len(info.MatchTimeWeek) > 0 {
|
||||
for _, week := range info.MatchTimeWeek {
|
||||
|
|
@ -1404,12 +1436,26 @@ func (this *Tournament) GetSCTMInfosPack(platform, channelName string) *tourname
|
|||
pack.TMInfo = append(pack.TMInfo, tMInfo)
|
||||
}
|
||||
}
|
||||
if l := this.TypeList[platform]; l != nil {
|
||||
for _, v := range l.GetList() {
|
||||
pack.TypeList = append(pack.TypeList, &tournament.MatchTypeInfo{
|
||||
Name: v.GetName(),
|
||||
SortId: v.GetSortId(),
|
||||
On: v.GetOn(),
|
||||
Id: v.GetId(),
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
return pack
|
||||
}
|
||||
|
||||
func (this *Tournament) MakeMatchLog(platform string, tmId int32, sortId int64) *model.MatchLog {
|
||||
gameMatchDate := this.GetMatchInfo(platform, tmId)
|
||||
gameMatchDate := this.GetMatchInfo(platform, tmId, sortId)
|
||||
if gameMatchDate == nil {
|
||||
logger.Logger.Errorf("MakeMatchLog gameMatchDate == nil tmId:%d sortId:%d", tmId, sortId)
|
||||
return nil
|
||||
}
|
||||
matchLog := model.NewMatchLog()
|
||||
_, ok := this.roundPlayers[sortId]
|
||||
if !ok {
|
||||
|
|
@ -1463,6 +1509,7 @@ func (this *Tournament) MakeMatchLog(platform string, tmId int32, sortId int64)
|
|||
matchLog.GameFreeId = gameMatchDate.GameFreeId
|
||||
matchLog.StartTime = time.Unix(this.matches[tmId][sortId].StartTime, 0)
|
||||
matchLog.EndTime = time.Now()
|
||||
matchLog.SortId = sortId
|
||||
return matchLog
|
||||
}
|
||||
|
||||
|
|
@ -1495,7 +1542,7 @@ func (this *Tournament) Update() {
|
|||
if info == nil || info.Ts <= 0 {
|
||||
continue
|
||||
}
|
||||
matchInfo := this.GetMatchInfo(info.Platform, info.TmId)
|
||||
matchInfo := this.GetMatchInfo(info.Platform, info.TmId, 0)
|
||||
if this.IsMatchOn(matchInfo) && !this.IsOutTime(matchInfo) && this.IsRobotOn(matchInfo) {
|
||||
needTime := this.playerWaitStart[snId]
|
||||
if time.Now().Unix()-info.Ts > needTime {
|
||||
|
|
|
|||
|
|
@ -898,6 +898,7 @@ func init() {
|
|||
coinlogex := model.NewCoinLogEx(&model.CoinLogParam{
|
||||
Platform: pd.Platform,
|
||||
SnID: member_snid,
|
||||
Channel: pd.Channel,
|
||||
ChangeType: common.BillTypeCoin,
|
||||
ChangeNum: coin,
|
||||
RemainNum: oldGold + coin,
|
||||
|
|
@ -1023,6 +1024,7 @@ func init() {
|
|||
coinlogex := model.NewCoinLogEx(&model.CoinLogParam{
|
||||
Platform: pd.Platform,
|
||||
SnID: member_snid,
|
||||
Channel: pd.Channel,
|
||||
ChangeType: common.BillTypeCoin,
|
||||
ChangeNum: coin,
|
||||
RemainNum: oldGold + coin,
|
||||
|
|
@ -1665,6 +1667,7 @@ func init() {
|
|||
coinlogex := model.NewCoinLogEx(&model.CoinLogParam{
|
||||
Platform: player.Platform,
|
||||
SnID: player.SnId,
|
||||
Channel: player.Channel,
|
||||
ChangeType: msg.GetLogType(),
|
||||
ChangeNum: msg.GetGold(),
|
||||
RemainNum: remainNum + msg.GetGold(),
|
||||
|
|
@ -1750,6 +1753,7 @@ func init() {
|
|||
coinlogex := model.NewCoinLogEx(&model.CoinLogParam{
|
||||
Platform: findPlayer.Platform,
|
||||
SnID: findPlayer.SnId,
|
||||
Channel: findPlayer.Channel,
|
||||
ChangeType: msg.GetLogType(),
|
||||
ChangeNum: msg.GetGold(),
|
||||
RemainNum: remainNum + msg.GetGold(),
|
||||
|
|
@ -1871,6 +1875,7 @@ func init() {
|
|||
coinlogex := model.NewCoinLogEx(&model.CoinLogParam{
|
||||
Platform: pd.Platform,
|
||||
SnID: member_snid,
|
||||
Channel: pd.Channel,
|
||||
ChangeType: common.BillTypeCoin,
|
||||
ChangeNum: coin + coinEx,
|
||||
RemainNum: oldGold + coin + coinEx,
|
||||
|
|
@ -1995,6 +2000,7 @@ func init() {
|
|||
coinlogex := model.NewCoinLogEx(&model.CoinLogParam{
|
||||
Platform: pd.Platform,
|
||||
SnID: member_snid,
|
||||
Channel: pd.Channel,
|
||||
ChangeType: common.BillTypeCoin,
|
||||
ChangeNum: coin + coinEx,
|
||||
RemainNum: oldGold + coin + coinEx,
|
||||
|
|
@ -2394,7 +2400,7 @@ func init() {
|
|||
if s != nil && !s.deleting && len(s.players) == 0 {
|
||||
logger.Logger.Warnf("WebService SpecailEmptySceneId destroyroom scene:%v", s.sceneId)
|
||||
s.TryForceDelectMatchInfo()
|
||||
s.ForceDelete(false)
|
||||
s.DoDelete(false)
|
||||
}
|
||||
}
|
||||
case 2: //删除所有未开始的房间
|
||||
|
|
@ -2405,7 +2411,7 @@ func init() {
|
|||
if s != nil && !s.deleting && !s.starting && !s.IsHundredScene() {
|
||||
logger.Logger.Warnf("WebService SpecailUnstartSceneId destroyroom scene:%v", s.sceneId)
|
||||
s.TryForceDelectMatchInfo()
|
||||
s.ForceDelete(false)
|
||||
s.DoDelete(false)
|
||||
}
|
||||
}
|
||||
default: //删除指定房间
|
||||
|
|
@ -2428,7 +2434,7 @@ func init() {
|
|||
}
|
||||
logger.Logger.Warnf("WebService destroyroom scene:%v", s.sceneId)
|
||||
s.TryForceDelectMatchInfo()
|
||||
s.ForceDelete(false)
|
||||
s.DoDelete(false)
|
||||
}
|
||||
}
|
||||
return common.ResponseTag_Ok, pack
|
||||
|
|
|
|||
Loading…
Reference in New Issue