解决冲突

This commit is contained in:
sk 2024-06-19 15:26:25 +08:00
commit 2520ec2e7d
38 changed files with 1489 additions and 783 deletions

View File

@ -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 // 周卡
)

View File

@ -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
}

View File

@ -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

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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 {

View File

@ -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
}

View File

@ -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

View File

@ -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"

View File

@ -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,

View File

@ -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

View File

@ -78,7 +78,8 @@ type GameParam struct {
RankPlayerLevelMaxNum int //等级榜最大人数
CloseChannelSwitch bool //关闭渠道开关功能
BackendTimeLocal int //后台时区
GameStaticsFightVersion int // 对战场游戏统计数据版本号
GameStaticsFightVersion int // 对战场统计数据版本
TestRankMatchAward bool // 测试段位奖励领取通知,直接改玩家排位积分使玩家获得奖励
}
var GameParamPath = "../data/gameparam.json"

View File

@ -54,6 +54,8 @@ type InviteScore struct {
Score int64 // 积分
Ts int64 // 时间戳
Money int64 // 充值金额
WeekIndex int64 // 所在周
MonthIndex int64 // 所在月
}
type InviteScoreReq struct {

View File

@ -38,6 +38,7 @@ type MatchLog struct {
StartTime time.Time //开始时间
EndTime time.Time //结束时间
Players []*MatchPlayer //参赛人员数据
SortId int64 // 本场id
}
var (

View File

@ -15,8 +15,9 @@ type RankAward struct {
}
type PlayerRankInfo struct {
Score int64 // 积分
Awards []*RankAward // 赛季奖励
LastScore int64 // 上次积分
Score int64 // 积分
Awards []*RankAward // 赛季奖励
}
type PlayerRankSeason struct {

View File

@ -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

View File

@ -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() }

View File

@ -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

View File

@ -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

View File

@ -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; //

View File

@ -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
}

View File

@ -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,

View File

@ -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),

View File

@ -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)

View File

@ -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())
}
}
}
//更新玩家等级排行榜

View File

@ -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)
}

View File

@ -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 {

View File

@ -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)
}
}

View File

@ -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)
}
}
}

View File

@ -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

View File

@ -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,

View File

@ -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 {

View File

@ -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,