Compare commits
4 Commits
20b8fe91a0
...
972861ee83
Author | SHA1 | Date |
---|---|---|
|
972861ee83 | |
|
c75df5742e | |
|
4c7abf167e | |
|
2805e4ca6c |
|
@ -149,6 +149,16 @@ func IsLocalGame(gameId int) bool {
|
|||
return false
|
||||
}
|
||||
|
||||
func IsDaZhong(gameId int) bool {
|
||||
switch gameId {
|
||||
case GameId_TienLenSelect,
|
||||
GameId_TienLenSelect_yl, GameId_TienLenSelect_toend,
|
||||
GameId_TienLenSelect_yl_toend:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// 房间编号区间
|
||||
const (
|
||||
PrivateSceneStartId = 10000000
|
||||
|
@ -277,6 +287,11 @@ const (
|
|||
GainWaySign7Add = 91 // 累计签到进阶奖励获得
|
||||
GainWayItemChange = 92 //背包内使用道具兑换话费
|
||||
GainWayPetSkillLevelUp = 93 //宠物技能升级
|
||||
GainWayPermitAward = 94 // 赛季通行证普通奖励
|
||||
GainWayPermitAwardSupper = 95 // 赛季通行证典藏奖励
|
||||
GainWayPermitExchangeCost = 96 // 赛季通行证兑换消耗
|
||||
GainWayPermitExchangeGain = 97 // 赛季通行证兑换获得
|
||||
GainWayItemTaskPermit = 98 // 赛季通行证任务
|
||||
)
|
||||
|
||||
// 后台选择 金币变化类型 的充值 类型id号起始
|
||||
|
@ -580,6 +595,8 @@ const (
|
|||
ItemIDCoffee = 100008 // 咖啡
|
||||
ItemIDBucket = 100009 // 水桶
|
||||
ItemIDSlippers = 100010 // 拖鞋
|
||||
ItemIDPermit = 100011 // 赛季通行证积分
|
||||
ItemIDLong = 50013 // 龙币
|
||||
)
|
||||
|
||||
func ToItemId(id int32) int32 {
|
||||
|
@ -677,8 +694,16 @@ const (
|
|||
TaskTypeTurnplate = 17 // 转盘抽奖次数
|
||||
TaskTypeInviteRecharge = 18 // 被邀请人充值金额*
|
||||
TaskTypeLoseCoin = 19 // 输的金币数量
|
||||
TaskTypeTienlenLoseCoin = 20 // Tienlen输的金币数量
|
||||
TaskTypeTienlenWinCoin = 21 // Tienlen赢取金币数量
|
||||
TaskType20 = 20 // 未使用
|
||||
TaskTypeOnlineTs = 21 // 在线时长,秒
|
||||
TaskTypeBuyPig = 22 // 购买任意存钱罐
|
||||
TaskTypeDaZhong = 23 // 大众场胜利
|
||||
TaskTypeInvitePlay = 24 // 邀请好友私人桌对局
|
||||
TaskTypeJoinMatch = 25 // 参与比赛场
|
||||
TaskTypeMatchRank10 = 26 // 比赛场前10名
|
||||
TaskTypeCostDiamond = 27 // 消耗钻石数量
|
||||
TaskTypeTienlenLoseCoin = 28 // Tienlen输的金币数量
|
||||
TaskTypeTienlenWinCoin = 29 // Tienlen赢取金币数量
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -694,6 +719,7 @@ const (
|
|||
TaskActivityTypeNovice = 3 // 新手任务
|
||||
TaskActivityTypeInvite = 4 // 邀请任务
|
||||
TaskActivityTypeAchieve = 5 // 成就任务
|
||||
TaskActivityTypePermit = 6 // 赛季通行证任务
|
||||
)
|
||||
|
||||
const HeadRange = 3 // 机器人头像id范围
|
||||
|
@ -763,4 +789,9 @@ const (
|
|||
// 特殊商品id
|
||||
const (
|
||||
ShopIdWeekCard = 970001 // 周卡
|
||||
ShopIdPermit = 990001 // 典藏通行证
|
||||
)
|
||||
|
||||
const PermitStartTsKey = "permit_start_ts"
|
||||
|
||||
const PermitTaskScore = 100
|
||||
|
|
|
@ -155,6 +155,13 @@ func GetWeekStartTs(ts int64) int64 {
|
|||
return st
|
||||
}
|
||||
|
||||
func GetDayStartTs(ts int64) int64 {
|
||||
now := time.Unix(ts, 0).Local()
|
||||
year, month, day := now.Date()
|
||||
today := time.Date(year, month, day, 0, 0, 0, 0, time.Local)
|
||||
return today.Unix()
|
||||
}
|
||||
|
||||
func GetMonthTimestamp() []int64 {
|
||||
now := time.Now().Local()
|
||||
year, month, _ := now.Date()
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
|
||||
<18>‰z Łś
|
||||
|
||||
‘N ‘N
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"Arr": [
|
||||
{
|
||||
"Id": 1,
|
||||
"ShowType": 1,
|
||||
"ShowVolume": 2000003,
|
||||
"Location": 20003
|
||||
},
|
||||
{
|
||||
"Id": 2,
|
||||
"ShowType": 2,
|
||||
"ShowVolume": 10001,
|
||||
"Location": 10001
|
||||
}
|
||||
]
|
||||
}
|
Binary file not shown.
BIN
data/DB_Task.dat
BIN
data/DB_Task.dat
Binary file not shown.
|
@ -798,6 +798,148 @@
|
|||
"100001": 2000000,
|
||||
"100002": 20
|
||||
}
|
||||
},
|
||||
{
|
||||
"Id": 11001,
|
||||
"Order": 1,
|
||||
"ActivityType": 6,
|
||||
"TaskType": 17,
|
||||
"TargetTimes": 1,
|
||||
"FinishTimes": 1,
|
||||
"Award": {
|
||||
"100011": 50
|
||||
}
|
||||
},
|
||||
{
|
||||
"Id": 11002,
|
||||
"Order": 2,
|
||||
"ActivityType": 6,
|
||||
"TaskType": 21,
|
||||
"TargetTimes": 3600,
|
||||
"FinishTimes": 1,
|
||||
"Award": {
|
||||
"100011": 51
|
||||
},
|
||||
"Position": [
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": 11003,
|
||||
"Order": 3,
|
||||
"ActivityType": 6,
|
||||
"TaskType": 2,
|
||||
"TargetTimes": 1,
|
||||
"FinishTimes": 1,
|
||||
"Award": {
|
||||
"100011": 52
|
||||
},
|
||||
"Position": [
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": 11004,
|
||||
"Order": 4,
|
||||
"ActivityType": 6,
|
||||
"TaskType": 22,
|
||||
"TargetTimes": 1,
|
||||
"FinishTimes": 1,
|
||||
"Award": {
|
||||
"100011": 53
|
||||
}
|
||||
},
|
||||
{
|
||||
"Id": 11005,
|
||||
"Order": 5,
|
||||
"ActivityType": 6,
|
||||
"TaskType": 23,
|
||||
"TargetTimes": 3,
|
||||
"FinishTimes": 1,
|
||||
"Award": {
|
||||
"100011": 54
|
||||
},
|
||||
"GameType": 1
|
||||
},
|
||||
{
|
||||
"Id": 11006,
|
||||
"Order": 6,
|
||||
"ActivityType": 6,
|
||||
"TaskType": 6,
|
||||
"TargetTimes": 3,
|
||||
"FinishTimes": 1,
|
||||
"Award": {
|
||||
"100011": 55
|
||||
},
|
||||
"GameType": 1
|
||||
},
|
||||
{
|
||||
"Id": 11007,
|
||||
"Order": 7,
|
||||
"ActivityType": 6,
|
||||
"TaskType": 24,
|
||||
"TargetTimes": 1,
|
||||
"FinishTimes": 1,
|
||||
"Award": {
|
||||
"100011": 56
|
||||
},
|
||||
"GameType": 1
|
||||
},
|
||||
{
|
||||
"Id": 11008,
|
||||
"Order": 8,
|
||||
"ActivityType": 6,
|
||||
"TaskType": 25,
|
||||
"TargetTimes": 3,
|
||||
"FinishTimes": 1,
|
||||
"Award": {
|
||||
"100011": 57
|
||||
},
|
||||
"GameType": 1
|
||||
},
|
||||
{
|
||||
"Id": 11009,
|
||||
"Order": 9,
|
||||
"ActivityType": 6,
|
||||
"TaskType": 26,
|
||||
"TargetTimes": 1,
|
||||
"FinishTimes": 1,
|
||||
"Award": {
|
||||
"100011": 58
|
||||
},
|
||||
"GameType": 1
|
||||
},
|
||||
{
|
||||
"Id": 11010,
|
||||
"Order": 10,
|
||||
"ActivityType": 6,
|
||||
"TaskType": 27,
|
||||
"TargetTimes": 100,
|
||||
"FinishTimes": 1,
|
||||
"Award": {
|
||||
"100011": 59
|
||||
},
|
||||
"Position": [
|
||||
1,
|
||||
1
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": 11011,
|
||||
"Order": 11,
|
||||
"ActivityType": 6,
|
||||
"TaskType": 7,
|
||||
"TargetTimes": 1,
|
||||
"FinishTimes": 1,
|
||||
"Award": {
|
||||
"100011": 60
|
||||
},
|
||||
"Position": [
|
||||
1,
|
||||
1
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
|
@ -101,4 +101,32 @@ func init() {
|
|||
}
|
||||
return nil
|
||||
}, broker.Queue(model.MQRankPlayerLevel), broker.DisableAutoAck(), rabbitmq.DurableQueue())
|
||||
// 赛季通行证积分
|
||||
mq.RegisterSubscriber(model.MQRankPlayerPermit, func(e broker.Event) (err error) {
|
||||
msg := e.Message()
|
||||
if msg != nil {
|
||||
defer func() {
|
||||
e.Ack()
|
||||
}()
|
||||
|
||||
var log model.PermitScore
|
||||
err = json.Unmarshal(msg.Body, &log)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
logger.Logger.Tracef("SubscriberRankPlayerPermit: %+v", log)
|
||||
|
||||
core.CoreObject().SendCommand(basic.CommandWrapper(func(o *basic.Object) error {
|
||||
err := svc.RankPlayerPermitUpsert(&log)
|
||||
if err != nil {
|
||||
logger.Logger.Errorf("RankPlayerPermitUpsert err: %v", err)
|
||||
}
|
||||
return nil
|
||||
}), true)
|
||||
|
||||
return
|
||||
}
|
||||
return nil
|
||||
}, broker.Queue(model.MQRankPlayerPermit), broker.DisableAutoAck(), rabbitmq.DurableQueue())
|
||||
}
|
||||
|
|
|
@ -0,0 +1,72 @@
|
|||
package svc
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"github.com/globalsign/mgo"
|
||||
"github.com/globalsign/mgo/bson"
|
||||
"mongo.games.com/game/dbproxy/mongo"
|
||||
"mongo.games.com/game/model"
|
||||
"mongo.games.com/goserver/core/logger"
|
||||
"net/rpc"
|
||||
)
|
||||
|
||||
var (
|
||||
RankPlayerPermitDBName = "log"
|
||||
RankPlayerPermitCollName = "log_rankplayerpermit"
|
||||
RankPlayerPermitColError = errors.New("RankPlayerPermit collection open failed")
|
||||
)
|
||||
|
||||
func RankPlayerPermitCollection(plt string) *mongo.Collection {
|
||||
s := mongo.MgoSessionMgrSington.GetPltMgoSession(plt, RankPlayerPermitDBName)
|
||||
if s != nil {
|
||||
c, first := s.DB().C(RankPlayerPermitCollName)
|
||||
if first {
|
||||
c.EnsureIndex(mgo.Index{Key: []string{"snid"}, Background: true, Sparse: true})
|
||||
c.EnsureIndex(mgo.Index{Key: []string{"startts", "-exp"}, Background: true, Sparse: true})
|
||||
}
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func RankPlayerPermitUpsert(args *model.PermitScore) error {
|
||||
cc := RankPlayerPermitCollection(args.Platform)
|
||||
if cc == nil {
|
||||
return RankPlayerPermitColError
|
||||
}
|
||||
_, err := cc.Upsert(bson.M{"startts": args.StartTs, "snid": args.SnId}, args)
|
||||
if err != nil && !errors.Is(err, mgo.ErrNotFound) {
|
||||
logger.Logger.Error("RankPlayerPermitSvc.Upsert is err: ", err)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type RankPlayerPermitSvc struct {
|
||||
}
|
||||
|
||||
func (svc *RankPlayerPermitSvc) Upsert(args *model.PermitScore, ret *bool) error {
|
||||
err := RankPlayerPermitUpsert(args)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*ret = true
|
||||
return nil
|
||||
}
|
||||
|
||||
func (svc *RankPlayerPermitSvc) Find(args *model.FindPlayerPermitListArgs, ret *model.FindPlayerPermitListReply) error {
|
||||
fc := RankPlayerPermitCollection(args.Platform)
|
||||
if fc == nil {
|
||||
return RankPlayerPermitColError
|
||||
}
|
||||
|
||||
err := fc.Find(bson.M{"startts": args.StartTs}).Sort("-exp").Limit(int(model.GameParamData.RankPlayerPermitMaxNum)).All(&ret.List)
|
||||
if err != nil && !errors.Is(err, mgo.ErrNotFound) {
|
||||
logger.Logger.Error("QueryPermit is err: ", err)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func init() {
|
||||
rpc.Register(new(RankPlayerPermitSvc))
|
||||
}
|
|
@ -32,4 +32,5 @@ const (
|
|||
ETCDKEY_ACT_PHONELOTTERY = "/game/act_phoneLottery"
|
||||
ETCDKEY_ChannelSwitch = "/game/channel/switch" // 渠道开关
|
||||
ETCDKEY_ACT_Invite = "/game/act_invite" // 邀请活动配置
|
||||
ETCDKEY_ACT_Permit = "/game/act_permit" // 赛季通行证配置
|
||||
)
|
||||
|
|
|
@ -119,6 +119,10 @@ type AllConfig struct {
|
|||
ChannelSwitch map[int32]*webapi.ChannelSwitchConfig
|
||||
// 邀请活动
|
||||
*webapi.ActInviteConfig
|
||||
// 赛季通行证活动
|
||||
*webapi.ActPermitConfig
|
||||
PermitStartTs int64 // 开始时间戳
|
||||
PermitEndTs int64 // 结束时间戳
|
||||
}
|
||||
|
||||
type GlobalConfig struct {
|
||||
|
@ -221,3 +225,41 @@ func (cm *ConfigMgr) GetShopInfo(plt string, shopId int32) *ShopInfo {
|
|||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (cm *ConfigMgr) GetPermitLevel(plt, channel string, score int64) int64 {
|
||||
cfg := cm.GetConfig(plt).ActPermitConfig
|
||||
if cfg == nil {
|
||||
return 0
|
||||
}
|
||||
|
||||
level := 0
|
||||
for _, v := range cfg.Configs {
|
||||
if v.Channel == channel {
|
||||
for _, vv := range v.LevelConfig {
|
||||
if score >= vv.Score {
|
||||
level = int(vv.Rank)
|
||||
} else {
|
||||
break
|
||||
}
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
return int64(level)
|
||||
}
|
||||
|
||||
func (cm *ConfigMgr) GetPermitConfig(plt, channel string) *webapi.PermitChannelConfig {
|
||||
cfg := cm.GetConfig(plt).ActPermitConfig
|
||||
if cfg == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
for _, v := range cfg.Configs {
|
||||
if v.Channel == channel {
|
||||
return v
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -184,3 +184,7 @@ func UptIntArrKVGameData(key string, arr []int64) error {
|
|||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type PermitStartTs struct {
|
||||
StartTs, EndTs int64
|
||||
}
|
||||
|
|
|
@ -80,6 +80,7 @@ type GameParam struct {
|
|||
BackendTimeLocal int //后台时区
|
||||
GameStaticsFightVersion int // 对战场统计数据版本
|
||||
TestRankMatchAward bool // 测试段位奖励领取通知,直接改玩家排位积分使玩家获得奖励
|
||||
RankPlayerPermitMaxNum int32 // 赛季通行证积分排行榜最大人数
|
||||
}
|
||||
|
||||
var GameParamPath = "../data/gameparam.json"
|
||||
|
@ -204,4 +205,7 @@ func InitGameParam() {
|
|||
if GameParamData.BackendTimeLocal == 0 {
|
||||
GameParamData.BackendTimeLocal = 8
|
||||
}
|
||||
if GameParamData.RankPlayerPermitMaxNum == 0 {
|
||||
GameParamData.RankPlayerPermitMaxNum = 100
|
||||
}
|
||||
}
|
||||
|
|
|
@ -109,6 +109,9 @@ const (
|
|||
SystemFreeGive_GiveType_TaskAchievement // 成就任务
|
||||
SystemFreeGive_GiveType_TaskEveryDay // 每日任务
|
||||
SystemFreeGive_GiveType_TaskWeekActive // 周活跃奖励
|
||||
SystemFreeGive_GiveType_PermitAward // 赛季通行证普通奖励
|
||||
SystemFreeGive_GiveType_PermitAwardSupper // 赛季通行证典藏奖励
|
||||
SystemFreeGive_GiveType_TaskPermit // 赛季通行证任务
|
||||
)
|
||||
const (
|
||||
SystemFreeGive_CoinType_Coin int32 = iota //金币
|
||||
|
@ -468,6 +471,8 @@ type PlayerData struct {
|
|||
INum int64 // 邀请人数
|
||||
IMoney int64 // 邀请人充值金额
|
||||
IScoreTs time.Time // 邀请积分更新时间
|
||||
Permit time.Time // 赛季通行证领取时间
|
||||
PermitStartTs int64 // 赛季通行证开始时间戳
|
||||
}
|
||||
|
||||
// 七日签到数据
|
||||
|
@ -513,7 +518,8 @@ type WelfareData struct {
|
|||
PhoneLotteryTask map[int32]*TaskData // 抽手机任务
|
||||
PigBank *PigBankData // 存钱罐
|
||||
DiamondBank *DiamondBankData // 钻石储存罐
|
||||
|
||||
PermitAward map[int32]int64 // 赛季通行证奖励领取时间
|
||||
PermitExchange map[int32][]int64 // 赛季通行证兑换次数, 多次的兑换时间
|
||||
}
|
||||
|
||||
func NewWelfareData() *WelfareData {
|
||||
|
@ -524,6 +530,8 @@ func NewWelfareData() *WelfareData {
|
|||
PhoneLotteryTask: make(map[int32]*TaskData),
|
||||
PigBank: &PigBankData{},
|
||||
DiamondBank: &DiamondBankData{},
|
||||
PermitAward: make(map[int32]int64),
|
||||
PermitExchange: make(map[int32][]int64),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1082,6 +1090,7 @@ func GetPlayerDataBySnId(plt string, snid int32, correctData, createIfNotExist b
|
|||
ret.Pd.LastLoginTime = ret.Pd.LastLoginTime.Local()
|
||||
ret.Pd.LastLogoutTime = ret.Pd.LastLogoutTime.Local()
|
||||
ret.Pd.IScoreTs = ret.Pd.IScoreTs.Local()
|
||||
ret.Pd.Permit = ret.Pd.Permit.Local()
|
||||
|
||||
return ret.Pd, ret.IsNew
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ const (
|
|||
MQRankPlayerCoin = "log_rankplayercoin"
|
||||
MQRankPlayerInvite = "log_rankplayerinvite"
|
||||
MQRankPlayerLevel = "log_rankplayerlevel"
|
||||
MQRankPlayerPermit = "log_rankplayerpermit" // 赛季通行证排行榜
|
||||
)
|
||||
|
||||
type PlayerRankScore struct {
|
||||
|
@ -275,3 +276,36 @@ func FindPlayerLevelList(args *FindPlayerLevelListArgs) (*FindPlayerLevelListRep
|
|||
}
|
||||
return ret, nil
|
||||
}
|
||||
|
||||
// PermitScore 赛季通行证排行榜
|
||||
type PermitScore struct {
|
||||
Platform string `bson:"-"`
|
||||
SnId int32
|
||||
Name string
|
||||
Exp int64
|
||||
ModId int32 //头像
|
||||
StartTs int64 // 赛季开始时间戳
|
||||
}
|
||||
|
||||
type FindPlayerPermitListArgs struct {
|
||||
Platform string
|
||||
StartTs int64
|
||||
}
|
||||
type FindPlayerPermitListReply struct {
|
||||
List []*PermitScore
|
||||
}
|
||||
|
||||
func FindPlayerPermitList(args *FindPlayerPermitListArgs) (*FindPlayerPermitListReply, error) {
|
||||
if rpcCli == nil {
|
||||
logger.Logger.Error("model.FindPlayerLevelList rpcCli == nil")
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
ret := new(FindPlayerPermitListReply)
|
||||
err := rpcCli.CallWithTimeout("RankPlayerPermitSvc.Find", args, ret, time.Second*30)
|
||||
if err != nil {
|
||||
logger.Logger.Error("GetPlayerLevelList error:", err)
|
||||
return ret, err
|
||||
}
|
||||
return ret, nil
|
||||
}
|
||||
|
|
|
@ -42,6 +42,9 @@ const (
|
|||
//等级榜
|
||||
Rank_PACKET_RANK_CSLevel Rank = 10010
|
||||
Rank_PACKET_RANK_SCLevel Rank = 10011
|
||||
//赛季通行证排行榜
|
||||
Rank_PACKET_RANK_CSPermit Rank = 10012
|
||||
Rank_PACKET_RANK_SCPermit Rank = 10013
|
||||
)
|
||||
|
||||
// Enum value maps for Rank.
|
||||
|
@ -60,6 +63,8 @@ var (
|
|||
10009: "PACKET_RANK_SCWinCoin",
|
||||
10010: "PACKET_RANK_CSLevel",
|
||||
10011: "PACKET_RANK_SCLevel",
|
||||
10012: "PACKET_RANK_CSPermit",
|
||||
10013: "PACKET_RANK_SCPermit",
|
||||
}
|
||||
Rank_value = map[string]int32{
|
||||
"PACKET_RANK_ZERO": 0,
|
||||
|
@ -75,6 +80,8 @@ var (
|
|||
"PACKET_RANK_SCWinCoin": 10009,
|
||||
"PACKET_RANK_CSLevel": 10010,
|
||||
"PACKET_RANK_SCLevel": 10011,
|
||||
"PACKET_RANK_CSPermit": 10012,
|
||||
"PACKET_RANK_SCPermit": 10013,
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -1567,6 +1574,221 @@ func (x *SCPlayerLevelRank) GetLimit() int32 {
|
|||
return 0
|
||||
}
|
||||
|
||||
//PACKET_RANK_CSPermit
|
||||
type CSPermit struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Skip int32 `protobuf:"varint,1,opt,name=Skip,proto3" json:"Skip,omitempty"` // 偏移量
|
||||
Limit int32 `protobuf:"varint,2,opt,name=Limit,proto3" json:"Limit,omitempty"` // 请求数量
|
||||
}
|
||||
|
||||
func (x *CSPermit) Reset() {
|
||||
*x = CSPermit{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_rank_proto_msgTypes[19]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *CSPermit) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CSPermit) ProtoMessage() {}
|
||||
|
||||
func (x *CSPermit) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_rank_proto_msgTypes[19]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use CSPermit.ProtoReflect.Descriptor instead.
|
||||
func (*CSPermit) Descriptor() ([]byte, []int) {
|
||||
return file_rank_proto_rawDescGZIP(), []int{19}
|
||||
}
|
||||
|
||||
func (x *CSPermit) GetSkip() int32 {
|
||||
if x != nil {
|
||||
return x.Skip
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *CSPermit) GetLimit() int32 {
|
||||
if x != nil {
|
||||
return x.Limit
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type PermitRank struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Snid int32 `protobuf:"varint,1,opt,name=Snid,proto3" json:"Snid,omitempty"` // 玩家id
|
||||
Name string `protobuf:"bytes,2,opt,name=Name,proto3" json:"Name,omitempty"` // 昵称
|
||||
Rank int32 `protobuf:"varint,3,opt,name=Rank,proto3" json:"Rank,omitempty"` //段位排名
|
||||
Score int64 `protobuf:"varint,4,opt,name=Score,proto3" json:"Score,omitempty"` // 积分
|
||||
ModId int32 `protobuf:"varint,5,opt,name=ModId,proto3" json:"ModId,omitempty"` // 头像模型
|
||||
}
|
||||
|
||||
func (x *PermitRank) Reset() {
|
||||
*x = PermitRank{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_rank_proto_msgTypes[20]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *PermitRank) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*PermitRank) ProtoMessage() {}
|
||||
|
||||
func (x *PermitRank) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_rank_proto_msgTypes[20]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use PermitRank.ProtoReflect.Descriptor instead.
|
||||
func (*PermitRank) Descriptor() ([]byte, []int) {
|
||||
return file_rank_proto_rawDescGZIP(), []int{20}
|
||||
}
|
||||
|
||||
func (x *PermitRank) GetSnid() int32 {
|
||||
if x != nil {
|
||||
return x.Snid
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *PermitRank) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *PermitRank) GetRank() int32 {
|
||||
if x != nil {
|
||||
return x.Rank
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *PermitRank) GetScore() int64 {
|
||||
if x != nil {
|
||||
return x.Score
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *PermitRank) GetModId() int32 {
|
||||
if x != nil {
|
||||
return x.ModId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// PACKET_RANK_SCPermit
|
||||
type SCPermit struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Ranks []*PermitRank `protobuf:"bytes,1,rep,name=Ranks,proto3" json:"Ranks,omitempty"` // 排行榜
|
||||
Me *PermitRank `protobuf:"bytes,2,opt,name=Me,proto3" json:"Me,omitempty"` // 玩家自己的排行信息
|
||||
Skip int32 `protobuf:"varint,3,opt,name=Skip,proto3" json:"Skip,omitempty"` // 偏移量
|
||||
IsEndNum bool `protobuf:"varint,4,opt,name=IsEndNum,proto3" json:"IsEndNum,omitempty"`
|
||||
RankMaxNum int32 `protobuf:"varint,5,opt,name=RankMaxNum,proto3" json:"RankMaxNum,omitempty"` // 排行榜最大上限
|
||||
}
|
||||
|
||||
func (x *SCPermit) Reset() {
|
||||
*x = SCPermit{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_rank_proto_msgTypes[21]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *SCPermit) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SCPermit) ProtoMessage() {}
|
||||
|
||||
func (x *SCPermit) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_rank_proto_msgTypes[21]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use SCPermit.ProtoReflect.Descriptor instead.
|
||||
func (*SCPermit) Descriptor() ([]byte, []int) {
|
||||
return file_rank_proto_rawDescGZIP(), []int{21}
|
||||
}
|
||||
|
||||
func (x *SCPermit) GetRanks() []*PermitRank {
|
||||
if x != nil {
|
||||
return x.Ranks
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *SCPermit) GetMe() *PermitRank {
|
||||
if x != nil {
|
||||
return x.Me
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *SCPermit) GetSkip() int32 {
|
||||
if x != nil {
|
||||
return x.Skip
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SCPermit) GetIsEndNum() bool {
|
||||
if x != nil {
|
||||
return x.IsEndNum
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *SCPermit) GetRankMaxNum() int32 {
|
||||
if x != nil {
|
||||
return x.RankMaxNum
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_rank_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_rank_proto_rawDesc = []byte{
|
||||
|
@ -1711,40 +1933,65 @@ var file_rank_proto_rawDesc = []byte{
|
|||
0x66, 0x6f, 0x52, 0x02, 0x4d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x6b, 0x69, 0x70, 0x18, 0x03,
|
||||
0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x53, 0x6b, 0x69, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x4c, 0x69,
|
||||
0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x4c, 0x69, 0x6d, 0x69, 0x74,
|
||||
0x2a, 0xde, 0x02, 0x0a, 0x04, 0x52, 0x61, 0x6e, 0x6b, 0x12, 0x14, 0x0a, 0x10, 0x50, 0x41, 0x43,
|
||||
0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x5a, 0x45, 0x52, 0x4f, 0x10, 0x00, 0x12,
|
||||
0x1c, 0x0a, 0x17, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x43,
|
||||
0x53, 0x52, 0x61, 0x6e, 0x6b, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x10, 0x90, 0x4e, 0x12, 0x1c, 0x0a,
|
||||
0x17, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x53, 0x43, 0x52,
|
||||
0x61, 0x6e, 0x6b, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x10, 0x91, 0x4e, 0x12, 0x17, 0x0a, 0x12, 0x50,
|
||||
0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x43, 0x53, 0x43, 0x6f, 0x69,
|
||||
0x6e, 0x10, 0x92, 0x4e, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52,
|
||||
0x41, 0x4e, 0x4b, 0x5f, 0x53, 0x43, 0x43, 0x6f, 0x69, 0x6e, 0x10, 0x93, 0x4e, 0x12, 0x19, 0x0a,
|
||||
0x14, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x43, 0x53, 0x49,
|
||||
0x6e, 0x76, 0x69, 0x74, 0x65, 0x10, 0x94, 0x4e, 0x12, 0x19, 0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b,
|
||||
0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x53, 0x43, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65,
|
||||
0x10, 0x95, 0x4e, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53,
|
||||
0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x4c, 0x6f, 0x67, 0x10, 0x96, 0x4e, 0x12, 0x17, 0x0a, 0x12,
|
||||
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x4c,
|
||||
0x6f, 0x67, 0x10, 0x97, 0x4e, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f,
|
||||
0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x43, 0x53, 0x57, 0x69, 0x6e, 0x43, 0x6f, 0x69, 0x6e, 0x10, 0x98,
|
||||
0x4e, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b,
|
||||
0x5f, 0x53, 0x43, 0x57, 0x69, 0x6e, 0x43, 0x6f, 0x69, 0x6e, 0x10, 0x99, 0x4e, 0x12, 0x18, 0x0a,
|
||||
0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x43, 0x53, 0x4c,
|
||||
0x65, 0x76, 0x65, 0x6c, 0x10, 0x9a, 0x4e, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45,
|
||||
0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x53, 0x43, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x10, 0x9b,
|
||||
0x4e, 0x2a, 0x8d, 0x01, 0x0a, 0x0a, 0x52, 0x61, 0x6e, 0x6b, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65,
|
||||
0x12, 0x13, 0x0a, 0x0f, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x4e,
|
||||
0x6f, 0x6e, 0x65, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x54,
|
||||
0x79, 0x70, 0x65, 0x5f, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x49,
|
||||
0x6e, 0x76, 0x69, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x57, 0x65, 0x65, 0x6b, 0x10, 0x02,
|
||||
0x12, 0x14, 0x0a, 0x10, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x4d,
|
||||
0x6f, 0x6e, 0x74, 0x68, 0x10, 0x03, 0x12, 0x15, 0x0a, 0x11, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65,
|
||||
0x54, 0x79, 0x70, 0x65, 0x5f, 0x55, 0x70, 0x57, 0x65, 0x65, 0x6b, 0x10, 0x04, 0x12, 0x12, 0x0a,
|
||||
0x0e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x4d, 0x61, 0x78, 0x10,
|
||||
0x05, 0x42, 0x24, 0x5a, 0x22, 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, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x22, 0x34, 0x0a, 0x08, 0x43, 0x53, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x12, 0x12, 0x0a, 0x04,
|
||||
0x53, 0x6b, 0x69, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x53, 0x6b, 0x69, 0x70,
|
||||
0x12, 0x14, 0x0a, 0x05, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||
0x05, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x74, 0x0a, 0x0a, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x74,
|
||||
0x52, 0x61, 0x6e, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x6e, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x05, 0x52, 0x04, 0x53, 0x6e, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65,
|
||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04,
|
||||
0x52, 0x61, 0x6e, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x52, 0x61, 0x6e, 0x6b,
|
||||
0x12, 0x14, 0x0a, 0x05, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52,
|
||||
0x05, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x4d, 0x6f, 0x64, 0x49, 0x64, 0x18,
|
||||
0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x4d, 0x6f, 0x64, 0x49, 0x64, 0x22, 0xa4, 0x01, 0x0a,
|
||||
0x08, 0x53, 0x43, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x12, 0x26, 0x0a, 0x05, 0x52, 0x61, 0x6e,
|
||||
0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x72, 0x61, 0x6e, 0x6b, 0x2e,
|
||||
0x50, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x52, 0x61, 0x6e, 0x6b, 0x52, 0x05, 0x52, 0x61, 0x6e, 0x6b,
|
||||
0x73, 0x12, 0x20, 0x0a, 0x02, 0x4d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e,
|
||||
0x72, 0x61, 0x6e, 0x6b, 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x52, 0x61, 0x6e, 0x6b, 0x52,
|
||||
0x02, 0x4d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x6b, 0x69, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28,
|
||||
0x05, 0x52, 0x04, 0x53, 0x6b, 0x69, 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x49, 0x73, 0x45, 0x6e, 0x64,
|
||||
0x4e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x49, 0x73, 0x45, 0x6e, 0x64,
|
||||
0x4e, 0x75, 0x6d, 0x12, 0x1e, 0x0a, 0x0a, 0x52, 0x61, 0x6e, 0x6b, 0x4d, 0x61, 0x78, 0x4e, 0x75,
|
||||
0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x52, 0x61, 0x6e, 0x6b, 0x4d, 0x61, 0x78,
|
||||
0x4e, 0x75, 0x6d, 0x2a, 0x94, 0x03, 0x0a, 0x04, 0x52, 0x61, 0x6e, 0x6b, 0x12, 0x14, 0x0a, 0x10,
|
||||
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x5a, 0x45, 0x52, 0x4f,
|
||||
0x10, 0x00, 0x12, 0x1c, 0x0a, 0x17, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e,
|
||||
0x4b, 0x5f, 0x43, 0x53, 0x52, 0x61, 0x6e, 0x6b, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x10, 0x90, 0x4e,
|
||||
0x12, 0x1c, 0x0a, 0x17, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f,
|
||||
0x53, 0x43, 0x52, 0x61, 0x6e, 0x6b, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x10, 0x91, 0x4e, 0x12, 0x17,
|
||||
0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x43, 0x53,
|
||||
0x43, 0x6f, 0x69, 0x6e, 0x10, 0x92, 0x4e, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45,
|
||||
0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x53, 0x43, 0x43, 0x6f, 0x69, 0x6e, 0x10, 0x93, 0x4e,
|
||||
0x12, 0x19, 0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f,
|
||||
0x43, 0x53, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x10, 0x94, 0x4e, 0x12, 0x19, 0x0a, 0x14, 0x50,
|
||||
0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x53, 0x43, 0x49, 0x6e, 0x76,
|
||||
0x69, 0x74, 0x65, 0x10, 0x95, 0x4e, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54,
|
||||
0x5f, 0x43, 0x53, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x4c, 0x6f, 0x67, 0x10, 0x96, 0x4e, 0x12,
|
||||
0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x49, 0x6e, 0x76, 0x69,
|
||||
0x74, 0x65, 0x4c, 0x6f, 0x67, 0x10, 0x97, 0x4e, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b,
|
||||
0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x43, 0x53, 0x57, 0x69, 0x6e, 0x43, 0x6f, 0x69,
|
||||
0x6e, 0x10, 0x98, 0x4e, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52,
|
||||
0x41, 0x4e, 0x4b, 0x5f, 0x53, 0x43, 0x57, 0x69, 0x6e, 0x43, 0x6f, 0x69, 0x6e, 0x10, 0x99, 0x4e,
|
||||
0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f,
|
||||
0x43, 0x53, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x10, 0x9a, 0x4e, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41,
|
||||
0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x53, 0x43, 0x4c, 0x65, 0x76, 0x65,
|
||||
0x6c, 0x10, 0x9b, 0x4e, 0x12, 0x19, 0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52,
|
||||
0x41, 0x4e, 0x4b, 0x5f, 0x43, 0x53, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x10, 0x9c, 0x4e, 0x12,
|
||||
0x19, 0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x52, 0x41, 0x4e, 0x4b, 0x5f, 0x53,
|
||||
0x43, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x10, 0x9d, 0x4e, 0x2a, 0x8d, 0x01, 0x0a, 0x0a, 0x52,
|
||||
0x61, 0x6e, 0x6b, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x12, 0x13, 0x0a, 0x0f, 0x49, 0x6e, 0x76,
|
||||
0x69, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x4e, 0x6f, 0x6e, 0x65, 0x10, 0x00, 0x12, 0x14,
|
||||
0x0a, 0x10, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x54, 0x6f, 0x74,
|
||||
0x61, 0x6c, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x54, 0x79,
|
||||
0x70, 0x65, 0x5f, 0x57, 0x65, 0x65, 0x6b, 0x10, 0x02, 0x12, 0x14, 0x0a, 0x10, 0x49, 0x6e, 0x76,
|
||||
0x69, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x4d, 0x6f, 0x6e, 0x74, 0x68, 0x10, 0x03, 0x12,
|
||||
0x15, 0x0a, 0x11, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x5f, 0x55, 0x70,
|
||||
0x57, 0x65, 0x65, 0x6b, 0x10, 0x04, 0x12, 0x12, 0x0a, 0x0e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65,
|
||||
0x54, 0x79, 0x70, 0x65, 0x5f, 0x4d, 0x61, 0x78, 0x10, 0x05, 0x42, 0x24, 0x5a, 0x22, 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,
|
||||
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
@ -1760,7 +2007,7 @@ func file_rank_proto_rawDescGZIP() []byte {
|
|||
}
|
||||
|
||||
var file_rank_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
|
||||
var file_rank_proto_msgTypes = make([]protoimpl.MessageInfo, 19)
|
||||
var file_rank_proto_msgTypes = make([]protoimpl.MessageInfo, 22)
|
||||
var file_rank_proto_goTypes = []interface{}{
|
||||
(Rank)(0), // 0: rank.Rank
|
||||
(RankInvite)(0), // 1: rank.RankInvite
|
||||
|
@ -1783,6 +2030,9 @@ var file_rank_proto_goTypes = []interface{}{
|
|||
(*CSPlayerLevelRank)(nil), // 18: rank.CSPlayerLevelRank
|
||||
(*PlayerLevelRankInfo)(nil), // 19: rank.PlayerLevelRankInfo
|
||||
(*SCPlayerLevelRank)(nil), // 20: rank.SCPlayerLevelRank
|
||||
(*CSPermit)(nil), // 21: rank.CSPermit
|
||||
(*PermitRank)(nil), // 22: rank.PermitRank
|
||||
(*SCPermit)(nil), // 23: rank.SCPermit
|
||||
}
|
||||
var file_rank_proto_depIdxs = []int32{
|
||||
3, // 0: rank.SCRankMatch.Ranks:type_name -> rank.SeasonRank
|
||||
|
@ -1796,11 +2046,13 @@ var file_rank_proto_depIdxs = []int32{
|
|||
16, // 8: rank.SCWinCoin.Me:type_name -> rank.WinCoinInfo
|
||||
19, // 9: rank.SCPlayerLevelRank.Ranks:type_name -> rank.PlayerLevelRankInfo
|
||||
19, // 10: rank.SCPlayerLevelRank.Me:type_name -> rank.PlayerLevelRankInfo
|
||||
11, // [11:11] is the sub-list for method output_type
|
||||
11, // [11:11] is the sub-list for method input_type
|
||||
11, // [11:11] is the sub-list for extension type_name
|
||||
11, // [11:11] is the sub-list for extension extendee
|
||||
0, // [0:11] is the sub-list for field type_name
|
||||
22, // 11: rank.SCPermit.Ranks:type_name -> rank.PermitRank
|
||||
22, // 12: rank.SCPermit.Me:type_name -> rank.PermitRank
|
||||
13, // [13:13] is the sub-list for method output_type
|
||||
13, // [13:13] is the sub-list for method input_type
|
||||
13, // [13:13] is the sub-list for extension type_name
|
||||
13, // [13:13] is the sub-list for extension extendee
|
||||
0, // [0:13] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_rank_proto_init() }
|
||||
|
@ -2037,6 +2289,42 @@ func file_rank_proto_init() {
|
|||
return nil
|
||||
}
|
||||
}
|
||||
file_rank_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*CSPermit); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_rank_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*PermitRank); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_rank_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*SCPermit); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
|
@ -2044,7 +2332,7 @@ func file_rank_proto_init() {
|
|||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_rank_proto_rawDesc,
|
||||
NumEnums: 2,
|
||||
NumMessages: 19,
|
||||
NumMessages: 22,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
|
|
|
@ -22,6 +22,9 @@ enum Rank{
|
|||
//等级榜
|
||||
PACKET_RANK_CSLevel = 10010;
|
||||
PACKET_RANK_SCLevel = 10011;
|
||||
//赛季通行证排行榜
|
||||
PACKET_RANK_CSPermit = 10012;
|
||||
PACKET_RANK_SCPermit = 10013;
|
||||
}
|
||||
|
||||
// 排位榜
|
||||
|
@ -182,3 +185,26 @@ message SCPlayerLevelRank{
|
|||
int32 Skip = 3; // 页数
|
||||
int32 Limit = 4; // 每页数量
|
||||
}
|
||||
|
||||
//PACKET_RANK_CSPermit
|
||||
message CSPermit{
|
||||
int32 Skip = 1; // 偏移量
|
||||
int32 Limit = 2; // 请求数量
|
||||
}
|
||||
|
||||
message PermitRank {
|
||||
int32 Snid = 1; // 玩家id
|
||||
string Name = 2; // 昵称
|
||||
int32 Rank = 3;//段位排名
|
||||
int64 Score = 4; // 积分
|
||||
int32 ModId = 5; // 头像模型
|
||||
}
|
||||
|
||||
// PACKET_RANK_SCPermit
|
||||
message SCPermit{
|
||||
repeated PermitRank Ranks = 1; // 排行榜
|
||||
PermitRank Me = 2; // 玩家自己的排行信息
|
||||
int32 Skip = 3; // 偏移量
|
||||
bool IsEndNum = 4;
|
||||
int32 RankMaxNum = 5; // 排行榜最大上限
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -1237,6 +1237,22 @@ message DB_NewPlayerArray {
|
|||
repeated DB_NewPlayer Arr = 1;
|
||||
}
|
||||
|
||||
message DB_PassShow {
|
||||
|
||||
int32 Id = 1;
|
||||
|
||||
int32 ShowType = 2;
|
||||
|
||||
int32 ShowVolume = 3;
|
||||
|
||||
int32 Location = 4;
|
||||
|
||||
}
|
||||
|
||||
message DB_PassShowArray {
|
||||
repeated DB_PassShow Arr = 1;
|
||||
}
|
||||
|
||||
message DB_PetSkill {
|
||||
|
||||
int32 Id = 1;
|
||||
|
|
|
@ -332,8 +332,8 @@ type CSTaskReward struct {
|
|||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Tp int32 `protobuf:"varint,1,opt,name=Tp,proto3" json:"Tp,omitempty"` // 任务类型 1:日常任务 2:周活跃任务 3:新手任务 4:邀请任务 5:成就系统
|
||||
Id int32 `protobuf:"varint,2,opt,name=Id,proto3" json:"Id,omitempty"` // 任务id
|
||||
Tp int32 `protobuf:"varint,1,opt,name=Tp,proto3" json:"Tp,omitempty"` // 任务类型 1:日常任务 2:周活跃任务 3:新手任务 4:邀请任务 5:成就系统 6:赛季通行证任务
|
||||
Id int32 `protobuf:"varint,2,opt,name=Id,proto3" json:"Id,omitempty"` // 任务id; 0 表示一键领取
|
||||
}
|
||||
|
||||
func (x *CSTaskReward) Reset() {
|
||||
|
@ -388,9 +388,10 @@ type SCTaskReward struct {
|
|||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
OpCode OpResultCode `protobuf:"varint,1,opt,name=OpCode,proto3,enum=task.OpResultCode" json:"OpCode,omitempty"` // 操作码
|
||||
Tp int32 `protobuf:"varint,2,opt,name=Tp,proto3" json:"Tp,omitempty"` // 任务类型
|
||||
Id int32 `protobuf:"varint,3,opt,name=Id,proto3" json:"Id,omitempty"` // 任务id
|
||||
OpCode OpResultCode `protobuf:"varint,1,opt,name=OpCode,proto3,enum=task.OpResultCode" json:"OpCode,omitempty"` // 操作码
|
||||
Tp int32 `protobuf:"varint,2,opt,name=Tp,proto3" json:"Tp,omitempty"` // 任务类型
|
||||
Id int32 `protobuf:"varint,3,opt,name=Id,proto3" json:"Id,omitempty"` // 任务id
|
||||
Reward map[int64]int64 `protobuf:"bytes,5,rep,name=Reward,proto3" json:"Reward,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // 奖励
|
||||
}
|
||||
|
||||
func (x *SCTaskReward) Reset() {
|
||||
|
@ -446,6 +447,13 @@ func (x *SCTaskReward) GetId() int32 {
|
|||
return 0
|
||||
}
|
||||
|
||||
func (x *SCTaskReward) GetReward() map[int64]int64 {
|
||||
if x != nil {
|
||||
return x.Reward
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// 任务变更通知
|
||||
// PACKET_SCTaskChange
|
||||
type SCTaskChange struct {
|
||||
|
@ -640,45 +648,52 @@ var file_task_proto_rawDesc = []byte{
|
|||
0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x2e, 0x0a, 0x0c, 0x43, 0x53,
|
||||
0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x54, 0x70,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x54, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64,
|
||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x22, 0x5a, 0x0a, 0x0c, 0x53, 0x43,
|
||||
0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x2a, 0x0a, 0x06, 0x4f, 0x70,
|
||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x22, 0xcd, 0x01, 0x0a, 0x0c, 0x53,
|
||||
0x43, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x2a, 0x0a, 0x06, 0x4f,
|
||||
0x70, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x74, 0x61,
|
||||
0x73, 0x6b, 0x2e, 0x4f, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x52,
|
||||
0x06, 0x4f, 0x70, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x54, 0x70, 0x18, 0x02, 0x20,
|
||||
0x01, 0x28, 0x05, 0x52, 0x02, 0x54, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x03, 0x20,
|
||||
0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x36, 0x0a, 0x06, 0x52, 0x65, 0x77, 0x61, 0x72,
|
||||
0x64, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x74, 0x61, 0x73, 0x6b, 0x2e, 0x53,
|
||||
0x43, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x2e, 0x52, 0x65, 0x77, 0x61,
|
||||
0x72, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x1a,
|
||||
0x39, 0x0a, 0x0b, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10,
|
||||
0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6b, 0x65, 0x79,
|
||||
0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52,
|
||||
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x42, 0x0a, 0x0c, 0x53, 0x43,
|
||||
0x54, 0x61, 0x73, 0x6b, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x54, 0x70,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x54, 0x70, 0x12, 0x22, 0x0a, 0x04, 0x4c, 0x69,
|
||||
0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x74, 0x61, 0x73, 0x6b, 0x2e,
|
||||
0x54, 0x61, 0x73, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x48,
|
||||
0x0a, 0x0e, 0x43, 0x53, 0x54, 0x61, 0x73, 0x6b, 0x44, 0x65, 0x62, 0x75, 0x67, 0x49, 0x6e, 0x63,
|
||||
0x12, 0x0e, 0x0a, 0x02, 0x54, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x54, 0x70,
|
||||
0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64,
|
||||
0x12, 0x16, 0x0a, 0x06, 0x41, 0x64, 0x64, 0x4e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05,
|
||||
0x52, 0x06, 0x41, 0x64, 0x64, 0x4e, 0x75, 0x6d, 0x22, 0x3c, 0x0a, 0x0e, 0x53, 0x43, 0x54, 0x61,
|
||||
0x73, 0x6b, 0x44, 0x65, 0x62, 0x75, 0x67, 0x49, 0x6e, 0x63, 0x12, 0x2a, 0x0a, 0x06, 0x4f, 0x70,
|
||||
0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x74, 0x61, 0x73,
|
||||
0x6b, 0x2e, 0x4f, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x06,
|
||||
0x4f, 0x70, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x54, 0x70, 0x18, 0x02, 0x20, 0x01,
|
||||
0x28, 0x05, 0x52, 0x02, 0x54, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01,
|
||||
0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x22, 0x42, 0x0a, 0x0c, 0x53, 0x43, 0x54, 0x61, 0x73, 0x6b,
|
||||
0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x54, 0x70, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x05, 0x52, 0x02, 0x54, 0x70, 0x12, 0x22, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x02,
|
||||
0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x74, 0x61, 0x73, 0x6b, 0x2e, 0x54, 0x61, 0x73, 0x6b,
|
||||
0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x48, 0x0a, 0x0e, 0x43, 0x53,
|
||||
0x54, 0x61, 0x73, 0x6b, 0x44, 0x65, 0x62, 0x75, 0x67, 0x49, 0x6e, 0x63, 0x12, 0x0e, 0x0a, 0x02,
|
||||
0x54, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x54, 0x70, 0x12, 0x0e, 0x0a, 0x02,
|
||||
0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06,
|
||||
0x41, 0x64, 0x64, 0x4e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x41, 0x64,
|
||||
0x64, 0x4e, 0x75, 0x6d, 0x22, 0x3c, 0x0a, 0x0e, 0x53, 0x43, 0x54, 0x61, 0x73, 0x6b, 0x44, 0x65,
|
||||
0x62, 0x75, 0x67, 0x49, 0x6e, 0x63, 0x12, 0x2a, 0x0a, 0x06, 0x4f, 0x70, 0x43, 0x6f, 0x64, 0x65,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x74, 0x61, 0x73, 0x6b, 0x2e, 0x4f, 0x70,
|
||||
0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x06, 0x4f, 0x70, 0x43, 0x6f,
|
||||
0x64, 0x65, 0x2a, 0x30, 0x0a, 0x0c, 0x4f, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f,
|
||||
0x64, 0x65, 0x12, 0x10, 0x0a, 0x0c, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x53, 0x75, 0x63, 0x63, 0x65,
|
||||
0x73, 0x73, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x45, 0x72, 0x72,
|
||||
0x6f, 0x72, 0x10, 0x01, 0x2a, 0xd2, 0x01, 0x0a, 0x0c, 0x54, 0x61, 0x73, 0x6b, 0x50, 0x61, 0x63,
|
||||
0x6b, 0x65, 0x74, 0x49, 0x44, 0x12, 0x14, 0x0a, 0x10, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f,
|
||||
0x54, 0x61, 0x73, 0x6b, 0x5f, 0x5a, 0x45, 0x52, 0x4f, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x11, 0x50,
|
||||
0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x54, 0x61, 0x73, 0x6b, 0x4c, 0x69, 0x73, 0x74,
|
||||
0x10, 0xe0, 0x12, 0x12, 0x16, 0x0a, 0x11, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43,
|
||||
0x54, 0x61, 0x73, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x10, 0xe1, 0x12, 0x12, 0x18, 0x0a, 0x13, 0x50,
|
||||
0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x77, 0x61,
|
||||
0x72, 0x64, 0x10, 0xe2, 0x12, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f,
|
||||
0x53, 0x43, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x10, 0xe3, 0x12, 0x12,
|
||||
0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x54, 0x61, 0x73, 0x6b,
|
||||
0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x10, 0xe4, 0x12, 0x12, 0x16, 0x0a, 0x11, 0x50, 0x41, 0x43,
|
||||
0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x44, 0x65, 0x62, 0x75, 0x67, 0x49, 0x6e, 0x63, 0x10, 0xe5,
|
||||
0x12, 0x12, 0x16, 0x0a, 0x11, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x44, 0x65,
|
||||
0x62, 0x75, 0x67, 0x49, 0x6e, 0x63, 0x10, 0xe6, 0x12, 0x42, 0x24, 0x5a, 0x22, 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, 0x74, 0x61, 0x73, 0x6b, 0x62,
|
||||
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x4f, 0x70, 0x43, 0x6f, 0x64, 0x65, 0x2a, 0x30, 0x0a, 0x0c, 0x4f, 0x70, 0x52, 0x65, 0x73, 0x75,
|
||||
0x6c, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x0c, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x53,
|
||||
0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x4f, 0x50, 0x52, 0x43,
|
||||
0x5f, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x01, 0x2a, 0xd2, 0x01, 0x0a, 0x0c, 0x54, 0x61, 0x73,
|
||||
0x6b, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x44, 0x12, 0x14, 0x0a, 0x10, 0x50, 0x41, 0x43,
|
||||
0x4b, 0x45, 0x54, 0x5f, 0x54, 0x61, 0x73, 0x6b, 0x5f, 0x5a, 0x45, 0x52, 0x4f, 0x10, 0x00, 0x12,
|
||||
0x16, 0x0a, 0x11, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x54, 0x61, 0x73, 0x6b,
|
||||
0x4c, 0x69, 0x73, 0x74, 0x10, 0xe0, 0x12, 0x12, 0x16, 0x0a, 0x11, 0x50, 0x41, 0x43, 0x4b, 0x45,
|
||||
0x54, 0x5f, 0x53, 0x43, 0x54, 0x61, 0x73, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x10, 0xe1, 0x12, 0x12,
|
||||
0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x54, 0x61, 0x73, 0x6b,
|
||||
0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x10, 0xe2, 0x12, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43,
|
||||
0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64,
|
||||
0x10, 0xe3, 0x12, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43,
|
||||
0x54, 0x61, 0x73, 0x6b, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x10, 0xe4, 0x12, 0x12, 0x16, 0x0a,
|
||||
0x11, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x44, 0x65, 0x62, 0x75, 0x67, 0x49,
|
||||
0x6e, 0x63, 0x10, 0xe5, 0x12, 0x12, 0x16, 0x0a, 0x11, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f,
|
||||
0x53, 0x43, 0x44, 0x65, 0x62, 0x75, 0x67, 0x49, 0x6e, 0x63, 0x10, 0xe6, 0x12, 0x42, 0x24, 0x5a,
|
||||
0x22, 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, 0x74,
|
||||
0x61, 0x73, 0x6b, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
@ -694,7 +709,7 @@ func file_task_proto_rawDescGZIP() []byte {
|
|||
}
|
||||
|
||||
var file_task_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
|
||||
var file_task_proto_msgTypes = make([]protoimpl.MessageInfo, 9)
|
||||
var file_task_proto_msgTypes = make([]protoimpl.MessageInfo, 10)
|
||||
var file_task_proto_goTypes = []interface{}{
|
||||
(OpResultCode)(0), // 0: task.OpResultCode
|
||||
(TaskPacketID)(0), // 1: task.TaskPacketID
|
||||
|
@ -707,18 +722,20 @@ var file_task_proto_goTypes = []interface{}{
|
|||
(*CSTaskDebugInc)(nil), // 8: task.CSTaskDebugInc
|
||||
(*SCTaskDebugInc)(nil), // 9: task.SCTaskDebugInc
|
||||
nil, // 10: task.TaskData.RewardEntry
|
||||
nil, // 11: task.SCTaskReward.RewardEntry
|
||||
}
|
||||
var file_task_proto_depIdxs = []int32{
|
||||
10, // 0: task.TaskData.Reward:type_name -> task.TaskData.RewardEntry
|
||||
2, // 1: task.SCTaskList.List:type_name -> task.TaskData
|
||||
0, // 2: task.SCTaskReward.OpCode:type_name -> task.OpResultCode
|
||||
2, // 3: task.SCTaskChange.List:type_name -> task.TaskData
|
||||
0, // 4: task.SCTaskDebugInc.OpCode:type_name -> task.OpResultCode
|
||||
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
|
||||
11, // 3: task.SCTaskReward.Reward:type_name -> task.SCTaskReward.RewardEntry
|
||||
2, // 4: task.SCTaskChange.List:type_name -> task.TaskData
|
||||
0, // 5: task.SCTaskDebugInc.OpCode:type_name -> task.OpResultCode
|
||||
6, // [6:6] is the sub-list for method output_type
|
||||
6, // [6:6] is the sub-list for method input_type
|
||||
6, // [6:6] is the sub-list for extension type_name
|
||||
6, // [6:6] is the sub-list for extension extendee
|
||||
0, // [0:6] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_task_proto_init() }
|
||||
|
@ -830,7 +847,7 @@ func file_task_proto_init() {
|
|||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_task_proto_rawDesc,
|
||||
NumEnums: 2,
|
||||
NumMessages: 9,
|
||||
NumMessages: 10,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
|
|
|
@ -44,14 +44,15 @@ message SCTaskList{
|
|||
// 领取任务奖励
|
||||
// PACKET_CSTaskReward
|
||||
message CSTaskReward{
|
||||
int32 Tp = 1; // 任务类型 1:日常任务 2:周活跃任务 3:新手任务 4:邀请任务 5:成就系统
|
||||
int32 Id = 2; // 任务id
|
||||
int32 Tp = 1; // 任务类型 1:日常任务 2:周活跃任务 3:新手任务 4:邀请任务 5:成就系统 6:赛季通行证任务
|
||||
int32 Id = 2; // 任务id; 0 表示一键领取
|
||||
}
|
||||
// PACKET_SCTaskReward
|
||||
message SCTaskReward{
|
||||
OpResultCode OpCode = 1; // 操作码
|
||||
int32 Tp = 2; // 任务类型
|
||||
int32 Id = 3; // 任务id
|
||||
map<int64, int64> Reward = 5; // 奖励
|
||||
}
|
||||
|
||||
// 任务变更通知
|
||||
|
|
|
@ -6214,6 +6214,389 @@ func (x *ActInviteConfig) GetAwards3() []*RankAward {
|
|||
return nil
|
||||
}
|
||||
|
||||
// 等级奖励
|
||||
type PermitLevelConfig struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Rank int32 `protobuf:"varint,1,opt,name=Rank,proto3" json:"Rank,omitempty"` // 等级
|
||||
Score int64 `protobuf:"varint,2,opt,name=Score,proto3" json:"Score,omitempty"` // 积分
|
||||
Award1 []*ItemInfo `protobuf:"bytes,3,rep,name=Award1,proto3" json:"Award1,omitempty"` // 普通奖励
|
||||
Award2 []*ItemInfo `protobuf:"bytes,4,rep,name=Award2,proto3" json:"Award2,omitempty"` // 典藏奖励
|
||||
}
|
||||
|
||||
func (x *PermitLevelConfig) Reset() {
|
||||
*x = PermitLevelConfig{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_common_proto_msgTypes[61]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *PermitLevelConfig) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*PermitLevelConfig) ProtoMessage() {}
|
||||
|
||||
func (x *PermitLevelConfig) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_common_proto_msgTypes[61]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use PermitLevelConfig.ProtoReflect.Descriptor instead.
|
||||
func (*PermitLevelConfig) Descriptor() ([]byte, []int) {
|
||||
return file_common_proto_rawDescGZIP(), []int{61}
|
||||
}
|
||||
|
||||
func (x *PermitLevelConfig) GetRank() int32 {
|
||||
if x != nil {
|
||||
return x.Rank
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *PermitLevelConfig) GetScore() int64 {
|
||||
if x != nil {
|
||||
return x.Score
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *PermitLevelConfig) GetAward1() []*ItemInfo {
|
||||
if x != nil {
|
||||
return x.Award1
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *PermitLevelConfig) GetAward2() []*ItemInfo {
|
||||
if x != nil {
|
||||
return x.Award2
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// 兑换配置
|
||||
type PermitExchangeConfig struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Id int32 `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty"` // 商品id
|
||||
SortId int32 `protobuf:"varint,2,opt,name=SortId,proto3" json:"SortId,omitempty"` // 排序序号
|
||||
Gain []*ItemInfo `protobuf:"bytes,3,rep,name=Gain,proto3" json:"Gain,omitempty"` // 获得商品
|
||||
Cost []*ItemInfo `protobuf:"bytes,4,rep,name=Cost,proto3" json:"Cost,omitempty"` // 消耗
|
||||
IsPermit bool `protobuf:"varint,5,opt,name=IsPermit,proto3" json:"IsPermit,omitempty"` // 是否需要典藏通行证
|
||||
Level int64 `protobuf:"varint,6,opt,name=Level,proto3" json:"Level,omitempty"` // 达到等级
|
||||
Times int64 `protobuf:"varint,7,opt,name=Times,proto3" json:"Times,omitempty"` // 最大兑换次数
|
||||
IsShow bool `protobuf:"varint,8,opt,name=IsShow,proto3" json:"IsShow,omitempty"` // 开关,true 开启, false 关闭
|
||||
}
|
||||
|
||||
func (x *PermitExchangeConfig) Reset() {
|
||||
*x = PermitExchangeConfig{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_common_proto_msgTypes[62]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *PermitExchangeConfig) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*PermitExchangeConfig) ProtoMessage() {}
|
||||
|
||||
func (x *PermitExchangeConfig) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_common_proto_msgTypes[62]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use PermitExchangeConfig.ProtoReflect.Descriptor instead.
|
||||
func (*PermitExchangeConfig) Descriptor() ([]byte, []int) {
|
||||
return file_common_proto_rawDescGZIP(), []int{62}
|
||||
}
|
||||
|
||||
func (x *PermitExchangeConfig) GetId() int32 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *PermitExchangeConfig) GetSortId() int32 {
|
||||
if x != nil {
|
||||
return x.SortId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *PermitExchangeConfig) GetGain() []*ItemInfo {
|
||||
if x != nil {
|
||||
return x.Gain
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *PermitExchangeConfig) GetCost() []*ItemInfo {
|
||||
if x != nil {
|
||||
return x.Cost
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *PermitExchangeConfig) GetIsPermit() bool {
|
||||
if x != nil {
|
||||
return x.IsPermit
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *PermitExchangeConfig) GetLevel() int64 {
|
||||
if x != nil {
|
||||
return x.Level
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *PermitExchangeConfig) GetTimes() int64 {
|
||||
if x != nil {
|
||||
return x.Times
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *PermitExchangeConfig) GetIsShow() bool {
|
||||
if x != nil {
|
||||
return x.IsShow
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// 排行配置
|
||||
type PermitRankConfig struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Start int32 `protobuf:"varint,1,opt,name=Start,proto3" json:"Start,omitempty"` // 开始排名;第一名为0
|
||||
End int32 `protobuf:"varint,2,opt,name=End,proto3" json:"End,omitempty"` // 结束排名
|
||||
ItemId []*ItemInfo `protobuf:"bytes,3,rep,name=ItemId,proto3" json:"ItemId,omitempty"` // 奖励
|
||||
}
|
||||
|
||||
func (x *PermitRankConfig) Reset() {
|
||||
*x = PermitRankConfig{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_common_proto_msgTypes[63]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *PermitRankConfig) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*PermitRankConfig) ProtoMessage() {}
|
||||
|
||||
func (x *PermitRankConfig) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_common_proto_msgTypes[63]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use PermitRankConfig.ProtoReflect.Descriptor instead.
|
||||
func (*PermitRankConfig) Descriptor() ([]byte, []int) {
|
||||
return file_common_proto_rawDescGZIP(), []int{63}
|
||||
}
|
||||
|
||||
func (x *PermitRankConfig) GetStart() int32 {
|
||||
if x != nil {
|
||||
return x.Start
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *PermitRankConfig) GetEnd() int32 {
|
||||
if x != nil {
|
||||
return x.End
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *PermitRankConfig) GetItemId() []*ItemInfo {
|
||||
if x != nil {
|
||||
return x.ItemId
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type PermitChannelConfig struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Channel string `protobuf:"bytes,1,opt,name=Channel,proto3" json:"Channel,omitempty"` // 渠道
|
||||
LevelConfig []*PermitLevelConfig `protobuf:"bytes,2,rep,name=LevelConfig,proto3" json:"LevelConfig,omitempty"` // 等级奖励
|
||||
ExchangeConfig []*PermitExchangeConfig `protobuf:"bytes,3,rep,name=ExchangeConfig,proto3" json:"ExchangeConfig,omitempty"` // 兑换配置
|
||||
RankConfig []*PermitRankConfig `protobuf:"bytes,4,rep,name=RankConfig,proto3" json:"RankConfig,omitempty"` // 排行配置
|
||||
}
|
||||
|
||||
func (x *PermitChannelConfig) Reset() {
|
||||
*x = PermitChannelConfig{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_common_proto_msgTypes[64]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *PermitChannelConfig) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*PermitChannelConfig) ProtoMessage() {}
|
||||
|
||||
func (x *PermitChannelConfig) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_common_proto_msgTypes[64]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use PermitChannelConfig.ProtoReflect.Descriptor instead.
|
||||
func (*PermitChannelConfig) Descriptor() ([]byte, []int) {
|
||||
return file_common_proto_rawDescGZIP(), []int{64}
|
||||
}
|
||||
|
||||
func (x *PermitChannelConfig) GetChannel() string {
|
||||
if x != nil {
|
||||
return x.Channel
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *PermitChannelConfig) GetLevelConfig() []*PermitLevelConfig {
|
||||
if x != nil {
|
||||
return x.LevelConfig
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *PermitChannelConfig) GetExchangeConfig() []*PermitExchangeConfig {
|
||||
if x != nil {
|
||||
return x.ExchangeConfig
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *PermitChannelConfig) GetRankConfig() []*PermitRankConfig {
|
||||
if x != nil {
|
||||
return x.RankConfig
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// etcd /game/act_permit
|
||||
type ActPermitConfig struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Platform string `protobuf:"bytes,1,opt,name=Platform,proto3" json:"Platform,omitempty"` // 平台
|
||||
StartTs int64 `protobuf:"varint,2,opt,name=StartTs,proto3" json:"StartTs,omitempty"` // 开始日期
|
||||
Days int32 `protobuf:"varint,3,opt,name=Days,proto3" json:"Days,omitempty"` // 持续天数
|
||||
Configs []*PermitChannelConfig `protobuf:"bytes,4,rep,name=Configs,proto3" json:"Configs,omitempty"` // 渠道配置
|
||||
}
|
||||
|
||||
func (x *ActPermitConfig) Reset() {
|
||||
*x = ActPermitConfig{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_common_proto_msgTypes[65]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ActPermitConfig) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ActPermitConfig) ProtoMessage() {}
|
||||
|
||||
func (x *ActPermitConfig) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_common_proto_msgTypes[65]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ActPermitConfig.ProtoReflect.Descriptor instead.
|
||||
func (*ActPermitConfig) Descriptor() ([]byte, []int) {
|
||||
return file_common_proto_rawDescGZIP(), []int{65}
|
||||
}
|
||||
|
||||
func (x *ActPermitConfig) GetPlatform() string {
|
||||
if x != nil {
|
||||
return x.Platform
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ActPermitConfig) GetStartTs() int64 {
|
||||
if x != nil {
|
||||
return x.StartTs
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ActPermitConfig) GetDays() int32 {
|
||||
if x != nil {
|
||||
return x.Days
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ActPermitConfig) GetConfigs() []*PermitChannelConfig {
|
||||
if x != nil {
|
||||
return x.Configs
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_common_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_common_proto_rawDesc = []byte{
|
||||
|
@ -7223,10 +7606,65 @@ var file_common_proto_rawDesc = []byte{
|
|||
0x53, 0x63, 0x6f, 0x72, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65,
|
||||
0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05,
|
||||
0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x76, 0x61, 0x6c,
|
||||
0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x26, 0x5a, 0x24, 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, 0x77, 0x65, 0x62, 0x61, 0x70, 0x69, 0x62, 0x06,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x91, 0x01, 0x0a, 0x11, 0x50, 0x65, 0x72, 0x6d, 0x69,
|
||||
0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x12, 0x0a, 0x04,
|
||||
0x52, 0x61, 0x6e, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x52, 0x61, 0x6e, 0x6b,
|
||||
0x12, 0x14, 0x0a, 0x05, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52,
|
||||
0x05, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x28, 0x0a, 0x06, 0x41, 0x77, 0x61, 0x72, 0x64, 0x31,
|
||||
0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x77, 0x65, 0x62, 0x61, 0x70, 0x69, 0x2e,
|
||||
0x49, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x41, 0x77, 0x61, 0x72, 0x64, 0x31,
|
||||
0x12, 0x28, 0x0a, 0x06, 0x41, 0x77, 0x61, 0x72, 0x64, 0x32, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b,
|
||||
0x32, 0x10, 0x2e, 0x77, 0x65, 0x62, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x6e,
|
||||
0x66, 0x6f, 0x52, 0x06, 0x41, 0x77, 0x61, 0x72, 0x64, 0x32, 0x22, 0xea, 0x01, 0x0a, 0x14, 0x50,
|
||||
0x65, 0x72, 0x6d, 0x69, 0x74, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x43, 0x6f, 0x6e,
|
||||
0x66, 0x69, 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||
0x02, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x6f, 0x72, 0x74, 0x49, 0x64, 0x18, 0x02, 0x20,
|
||||
0x01, 0x28, 0x05, 0x52, 0x06, 0x53, 0x6f, 0x72, 0x74, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x04, 0x47,
|
||||
0x61, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x77, 0x65, 0x62, 0x61,
|
||||
0x70, 0x69, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x47, 0x61, 0x69,
|
||||
0x6e, 0x12, 0x24, 0x0a, 0x04, 0x43, 0x6f, 0x73, 0x74, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32,
|
||||
0x10, 0x2e, 0x77, 0x65, 0x62, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66,
|
||||
0x6f, 0x52, 0x04, 0x43, 0x6f, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x49, 0x73, 0x50, 0x65, 0x72,
|
||||
0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x49, 0x73, 0x50, 0x65, 0x72,
|
||||
0x6d, 0x69, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x06, 0x20, 0x01,
|
||||
0x28, 0x03, 0x52, 0x05, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x54, 0x69, 0x6d,
|
||||
0x65, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x12,
|
||||
0x16, 0x0a, 0x06, 0x49, 0x73, 0x53, 0x68, 0x6f, 0x77, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52,
|
||||
0x06, 0x49, 0x73, 0x53, 0x68, 0x6f, 0x77, 0x22, 0x64, 0x0a, 0x10, 0x50, 0x65, 0x72, 0x6d, 0x69,
|
||||
0x74, 0x52, 0x61, 0x6e, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x53,
|
||||
0x74, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x53, 0x74, 0x61, 0x72,
|
||||
0x74, 0x12, 0x10, 0x0a, 0x03, 0x45, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03,
|
||||
0x45, 0x6e, 0x64, 0x12, 0x28, 0x0a, 0x06, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x18, 0x03, 0x20,
|
||||
0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x77, 0x65, 0x62, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x74, 0x65,
|
||||
0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x22, 0xec, 0x01,
|
||||
0x0a, 0x13, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x43,
|
||||
0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12,
|
||||
0x3b, 0x0a, 0x0b, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02,
|
||||
0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x77, 0x65, 0x62, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x65,
|
||||
0x72, 0x6d, 0x69, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52,
|
||||
0x0b, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x44, 0x0a, 0x0e,
|
||||
0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x03,
|
||||
0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x77, 0x65, 0x62, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x65,
|
||||
0x72, 0x6d, 0x69, 0x74, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x66,
|
||||
0x69, 0x67, 0x52, 0x0e, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x66,
|
||||
0x69, 0x67, 0x12, 0x38, 0x0a, 0x0a, 0x52, 0x61, 0x6e, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
|
||||
0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x77, 0x65, 0x62, 0x61, 0x70, 0x69, 0x2e,
|
||||
0x50, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x52, 0x61, 0x6e, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
|
||||
0x52, 0x0a, 0x52, 0x61, 0x6e, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x92, 0x01, 0x0a,
|
||||
0x0f, 0x41, 0x63, 0x74, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
|
||||
0x12, 0x1a, 0x0a, 0x08, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x08, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x18, 0x0a, 0x07,
|
||||
0x53, 0x74, 0x61, 0x72, 0x74, 0x54, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x53,
|
||||
0x74, 0x61, 0x72, 0x74, 0x54, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x44, 0x61, 0x79, 0x73, 0x18, 0x03,
|
||||
0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x44, 0x61, 0x79, 0x73, 0x12, 0x35, 0x0a, 0x07, 0x43, 0x6f,
|
||||
0x6e, 0x66, 0x69, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x77, 0x65,
|
||||
0x62, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x6e,
|
||||
0x65, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x07, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
|
||||
0x73, 0x42, 0x26, 0x5a, 0x24, 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, 0x77, 0x65, 0x62, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
@ -7241,7 +7679,7 @@ func file_common_proto_rawDescGZIP() []byte {
|
|||
return file_common_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_common_proto_msgTypes = make([]protoimpl.MessageInfo, 67)
|
||||
var file_common_proto_msgTypes = make([]protoimpl.MessageInfo, 72)
|
||||
var file_common_proto_goTypes = []interface{}{
|
||||
(*MysqlDbSetting)(nil), // 0: webapi.MysqlDbSetting
|
||||
(*MongoDbSetting)(nil), // 1: webapi.MongoDbSetting
|
||||
|
@ -7304,33 +7742,38 @@ var file_common_proto_goTypes = []interface{}{
|
|||
(*ChannelSwitchConfig)(nil), // 58: webapi.ChannelSwitchConfig
|
||||
(*RankAward)(nil), // 59: webapi.RankAward
|
||||
(*ActInviteConfig)(nil), // 60: webapi.ActInviteConfig
|
||||
nil, // 61: webapi.Platform.BindTelRewardEntry
|
||||
nil, // 62: webapi.PlayerData.RankScoreEntry
|
||||
nil, // 63: webapi.ItemShop.AwardEntry
|
||||
nil, // 64: webapi.VIPcfg.AwardEntry
|
||||
nil, // 65: webapi.VIPcfg.Privilege7Entry
|
||||
nil, // 66: webapi.ActInviteConfig.PayScoreEntry
|
||||
(*server.DB_GameFree)(nil), // 67: server.DB_GameFree
|
||||
(*PermitLevelConfig)(nil), // 61: webapi.PermitLevelConfig
|
||||
(*PermitExchangeConfig)(nil), // 62: webapi.PermitExchangeConfig
|
||||
(*PermitRankConfig)(nil), // 63: webapi.PermitRankConfig
|
||||
(*PermitChannelConfig)(nil), // 64: webapi.PermitChannelConfig
|
||||
(*ActPermitConfig)(nil), // 65: webapi.ActPermitConfig
|
||||
nil, // 66: webapi.Platform.BindTelRewardEntry
|
||||
nil, // 67: webapi.PlayerData.RankScoreEntry
|
||||
nil, // 68: webapi.ItemShop.AwardEntry
|
||||
nil, // 69: webapi.VIPcfg.AwardEntry
|
||||
nil, // 70: webapi.VIPcfg.Privilege7Entry
|
||||
nil, // 71: webapi.ActInviteConfig.PayScoreEntry
|
||||
(*server.DB_GameFree)(nil), // 72: server.DB_GameFree
|
||||
}
|
||||
var file_common_proto_depIdxs = []int32{
|
||||
2, // 0: webapi.Platform.Leaderboard:type_name -> webapi.RankSwitch
|
||||
3, // 1: webapi.Platform.ClubConfig:type_name -> webapi.ClubConfig
|
||||
4, // 2: webapi.Platform.ThirdGameMerchant:type_name -> webapi.ThirdGame
|
||||
61, // 3: webapi.Platform.BindTelReward:type_name -> webapi.Platform.BindTelRewardEntry
|
||||
66, // 3: webapi.Platform.BindTelReward:type_name -> webapi.Platform.BindTelRewardEntry
|
||||
6, // 4: webapi.GameConfigGlobal.GameStatus:type_name -> webapi.GameStatus
|
||||
67, // 5: webapi.GameFree.DbGameFree:type_name -> server.DB_GameFree
|
||||
72, // 5: webapi.GameFree.DbGameFree:type_name -> server.DB_GameFree
|
||||
8, // 6: webapi.PlatformGameConfig.DbGameFrees:type_name -> webapi.GameFree
|
||||
0, // 7: webapi.PlatformDbConfig.Mysql:type_name -> webapi.MysqlDbSetting
|
||||
1, // 8: webapi.PlatformDbConfig.MongoDb:type_name -> webapi.MongoDbSetting
|
||||
1, // 9: webapi.PlatformDbConfig.MongoDbLog:type_name -> webapi.MongoDbSetting
|
||||
67, // 10: webapi.GameConfigGroup.DbGameFree:type_name -> server.DB_GameFree
|
||||
62, // 11: webapi.PlayerData.RankScore:type_name -> webapi.PlayerData.RankScoreEntry
|
||||
72, // 10: webapi.GameConfigGroup.DbGameFree:type_name -> server.DB_GameFree
|
||||
67, // 11: webapi.PlayerData.RankScore:type_name -> webapi.PlayerData.RankScoreEntry
|
||||
29, // 12: webapi.PlayerData.Items:type_name -> webapi.ItemInfo
|
||||
20, // 13: webapi.OnlineReport.GameCount:type_name -> webapi.OnlineGameCnt
|
||||
22, // 14: webapi.CommonNoticeList.List:type_name -> webapi.CommonNotice
|
||||
25, // 15: webapi.ExchangeShop.ExType:type_name -> webapi.ExchangeType
|
||||
24, // 16: webapi.ExchangeShopList.List:type_name -> webapi.ExchangeShop
|
||||
63, // 17: webapi.ItemShop.Award:type_name -> webapi.ItemShop.AwardEntry
|
||||
68, // 17: webapi.ItemShop.Award:type_name -> webapi.ItemShop.AwardEntry
|
||||
27, // 18: webapi.ItemShopList.List:type_name -> webapi.ItemShop
|
||||
29, // 19: webapi.MatchInfoAward.ItemId:type_name -> webapi.ItemInfo
|
||||
30, // 20: webapi.GameMatchDate.Award:type_name -> webapi.MatchInfoAward
|
||||
|
@ -7351,20 +7794,29 @@ var file_common_proto_depIdxs = []int32{
|
|||
35, // 35: webapi.WelfareSpree.Item:type_name -> webapi.WelfareDate
|
||||
45, // 36: webapi.WelfareFirstPayDataList.List:type_name -> webapi.WelfareSpree
|
||||
45, // 37: webapi.WelfareContinuousPayDataList.List:type_name -> webapi.WelfareSpree
|
||||
64, // 38: webapi.VIPcfg.Award:type_name -> webapi.VIPcfg.AwardEntry
|
||||
65, // 39: webapi.VIPcfg.Privilege7:type_name -> webapi.VIPcfg.Privilege7Entry
|
||||
69, // 38: webapi.VIPcfg.Award:type_name -> webapi.VIPcfg.AwardEntry
|
||||
70, // 39: webapi.VIPcfg.Privilege7:type_name -> webapi.VIPcfg.Privilege7Entry
|
||||
48, // 40: webapi.VIPcfgDataList.List:type_name -> webapi.VIPcfg
|
||||
35, // 41: webapi.ChessRankConfig.Item:type_name -> webapi.WelfareDate
|
||||
52, // 42: webapi.ChessRankcfgData.Datas:type_name -> webapi.ChessRankConfig
|
||||
66, // 43: webapi.ActInviteConfig.PayScore:type_name -> webapi.ActInviteConfig.PayScoreEntry
|
||||
71, // 43: webapi.ActInviteConfig.PayScore:type_name -> webapi.ActInviteConfig.PayScoreEntry
|
||||
59, // 44: webapi.ActInviteConfig.Awards1:type_name -> webapi.RankAward
|
||||
59, // 45: webapi.ActInviteConfig.Awards2:type_name -> webapi.RankAward
|
||||
59, // 46: webapi.ActInviteConfig.Awards3:type_name -> webapi.RankAward
|
||||
47, // [47:47] is the sub-list for method output_type
|
||||
47, // [47:47] is the sub-list for method input_type
|
||||
47, // [47:47] is the sub-list for extension type_name
|
||||
47, // [47:47] is the sub-list for extension extendee
|
||||
0, // [0:47] is the sub-list for field type_name
|
||||
29, // 47: webapi.PermitLevelConfig.Award1:type_name -> webapi.ItemInfo
|
||||
29, // 48: webapi.PermitLevelConfig.Award2:type_name -> webapi.ItemInfo
|
||||
29, // 49: webapi.PermitExchangeConfig.Gain:type_name -> webapi.ItemInfo
|
||||
29, // 50: webapi.PermitExchangeConfig.Cost:type_name -> webapi.ItemInfo
|
||||
29, // 51: webapi.PermitRankConfig.ItemId:type_name -> webapi.ItemInfo
|
||||
61, // 52: webapi.PermitChannelConfig.LevelConfig:type_name -> webapi.PermitLevelConfig
|
||||
62, // 53: webapi.PermitChannelConfig.ExchangeConfig:type_name -> webapi.PermitExchangeConfig
|
||||
63, // 54: webapi.PermitChannelConfig.RankConfig:type_name -> webapi.PermitRankConfig
|
||||
64, // 55: webapi.ActPermitConfig.Configs:type_name -> webapi.PermitChannelConfig
|
||||
56, // [56:56] is the sub-list for method output_type
|
||||
56, // [56:56] is the sub-list for method input_type
|
||||
56, // [56:56] is the sub-list for extension type_name
|
||||
56, // [56:56] is the sub-list for extension extendee
|
||||
0, // [0:56] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_common_proto_init() }
|
||||
|
@ -8105,6 +8557,66 @@ func file_common_proto_init() {
|
|||
return nil
|
||||
}
|
||||
}
|
||||
file_common_proto_msgTypes[61].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*PermitLevelConfig); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_common_proto_msgTypes[62].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*PermitExchangeConfig); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_common_proto_msgTypes[63].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*PermitRankConfig); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_common_proto_msgTypes[64].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*PermitChannelConfig); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_common_proto_msgTypes[65].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ActPermitConfig); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
|
@ -8112,7 +8624,7 @@ func file_common_proto_init() {
|
|||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_common_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 67,
|
||||
NumMessages: 72,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
|
|
|
@ -690,3 +690,45 @@ message ActInviteConfig {
|
|||
repeated RankAward Awards2 = 7; // 周榜奖励列表
|
||||
repeated RankAward Awards3 = 8; // 周榜奖励列表
|
||||
}
|
||||
|
||||
// 等级奖励
|
||||
message PermitLevelConfig{
|
||||
int32 Rank = 1; // 等级
|
||||
int64 Score = 2; // 积分
|
||||
repeated ItemInfo Award1 = 3; // 普通奖励
|
||||
repeated ItemInfo Award2 = 4; // 典藏奖励
|
||||
}
|
||||
|
||||
// 兑换配置
|
||||
message PermitExchangeConfig{
|
||||
int32 Id = 1; // 商品id
|
||||
int32 SortId = 2; // 排序序号
|
||||
repeated ItemInfo Gain = 3; // 获得商品
|
||||
repeated ItemInfo Cost = 4; // 消耗
|
||||
bool IsPermit = 5; // 是否需要典藏通行证
|
||||
int64 Level = 6; // 达到等级
|
||||
int64 Times = 7; // 最大兑换次数
|
||||
bool IsShow = 8; // 开关,true 开启, false 关闭
|
||||
}
|
||||
|
||||
// 排行配置
|
||||
message PermitRankConfig{
|
||||
int32 Start = 1; // 开始排名;第一名为0
|
||||
int32 End = 2; // 结束排名
|
||||
repeated ItemInfo ItemId = 3; // 奖励
|
||||
}
|
||||
|
||||
message PermitChannelConfig{
|
||||
string Channel = 1; // 渠道
|
||||
repeated PermitLevelConfig LevelConfig = 2; // 等级奖励
|
||||
repeated PermitExchangeConfig ExchangeConfig = 3; // 兑换配置
|
||||
repeated PermitRankConfig RankConfig = 4; // 排行配置
|
||||
}
|
||||
|
||||
// etcd /game/act_permit
|
||||
message ActPermitConfig{
|
||||
string Platform = 1; // 平台
|
||||
int64 StartTs = 2; // 开始日期
|
||||
int32 Days = 3; // 持续天数
|
||||
repeated PermitChannelConfig Configs = 4; // 渠道配置
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -15,7 +15,11 @@ enum OpResultCode {
|
|||
OPRC_DiamondLess = 9; // 钻石不足
|
||||
OPRC_PigbankNotFull = 10; // 存钱罐未满
|
||||
OPRC_PigbankOverTakeTimes = 11; // 存钱罐超过每日领取次数
|
||||
|
||||
OPRC_ExchangeLimit = 12; // 兑换次数不足
|
||||
OPRC_ExchangeLevelLimit = 13; // 兑换等级不足
|
||||
OPRC_NeedPermit = 14; // 需要典藏通行证
|
||||
OPRC_ErrCost = 15; // 消耗道具不足
|
||||
OPRC_NotFound = 16; // 商品没找到
|
||||
}
|
||||
// 福利大厅
|
||||
enum SPacketID {
|
||||
|
@ -61,7 +65,20 @@ enum SPacketID {
|
|||
PACKET_SCDiamondBankGetInfo = 2915; //钻石存钱罐信息返回
|
||||
PACKET_SCDiamondBankTakeDiamond = 2916; //钻石存钱罐领取返回
|
||||
|
||||
PACKET_CSPermitInfo = 2917;// 通行证奖励
|
||||
PACKET_SCPermitInfo = 2918;// 通行证奖励
|
||||
|
||||
PACKET_CSPermitExchangeList = 2919; // 通行证兑换列表
|
||||
PACKET_SCPermitExchangeList = 2920; // 通行证兑换列表
|
||||
|
||||
PACKET_CSPermitAward = 2921; // 领取通行证奖励
|
||||
PACKET_SCPermitAward = 2922; // 领取通行证奖励
|
||||
|
||||
PACKET_CSPermitExchange = 2923; // 通行证兑换
|
||||
PACKET_SCPermitExchange = 2924; // 通行证兑换
|
||||
|
||||
PACKET_CSPermitShop = 2925; // 典藏通行证商品信息
|
||||
PACKET_SCPermitShop = 2956; // 典藏通行证商品信息
|
||||
}
|
||||
|
||||
//救济金领取
|
||||
|
@ -377,3 +394,106 @@ message SCDiamondBankTakeDiamond{
|
|||
int64 NowPrice = 7; //现价
|
||||
int32 ShopId = 8; //商城ID
|
||||
}
|
||||
|
||||
// 赛季通行证信息
|
||||
//PACKET_CSPermitInfo
|
||||
message CSPermitInfo{
|
||||
}
|
||||
|
||||
message PropInfo{
|
||||
int32 ItemId = 1;//物品ID
|
||||
int64 ItemNum = 2;//物品数量
|
||||
}
|
||||
|
||||
message PropItem{
|
||||
repeated PropInfo Award = 1; // 奖励
|
||||
int64 Status = 2; // 奖励状态 0默认 1可领取 2已领取
|
||||
int32 Id = 3; // 奖励id; 领奖时使用
|
||||
}
|
||||
|
||||
message PermitAward{
|
||||
int64 Exp = 1; // 赛季经验
|
||||
int64 Level = 2; // 等级
|
||||
PropItem Award1 = 3; // 普通奖励
|
||||
PropItem Award2 = 4; // 典藏奖励
|
||||
}
|
||||
|
||||
message PermitShow{
|
||||
int32 ShowType = 1; // 类型
|
||||
int32 ShowVolume = 2; // id
|
||||
int32 Location = 3; // 跳转界面
|
||||
}
|
||||
|
||||
message PermitRankAward{
|
||||
int32 Start = 1; // 开始排名;第一名为0
|
||||
int32 End = 2; // 结束排名
|
||||
repeated PropInfo ItemId = 3; // 奖励
|
||||
}
|
||||
|
||||
//PACKET_SCPermitInfo
|
||||
message SCPermitInfo{
|
||||
int64 Exp = 1; // 玩家赛季经验
|
||||
int64 Level = 2; // 玩家等级
|
||||
repeated PermitAward Award = 3; // 奖励列表
|
||||
repeated int64 Timestamp = 4; // 赛季开始和结束时间戳 [开始时间戳,结束时间戳]
|
||||
repeated PermitShow ShowList = 5; // 展示列表
|
||||
bool IsPermit = 6; // 是否已购买典藏通行证
|
||||
repeated PermitRankAward RankAward = 7; // 排行榜奖励
|
||||
}
|
||||
|
||||
// 领取赛季通行证奖励
|
||||
//PACKET_CSPermitAward
|
||||
message CSPermitAward{
|
||||
int32 Tp = 1; // 0奖励 1普通奖励 2典藏奖励
|
||||
int32 Id = 2; // 奖励id; 0:一键领取
|
||||
}
|
||||
//PACKET_SCPermitAward
|
||||
message SCPermitAward{
|
||||
OpResultCode OpRetCode = 1; // 错误码
|
||||
repeated PropInfo Award1 = 2; // 普通奖励
|
||||
repeated PropInfo Award2 = 3; // 典藏奖励
|
||||
int32 Id = 4; // 奖励id; 0:一键领取
|
||||
int32 Tp = 5; // 0奖励 1普通奖励 2典藏奖励
|
||||
}
|
||||
|
||||
// 赛季通行证兑换商城
|
||||
//PACKET_CSPermitExchangeList
|
||||
message CSPermitExchangeList{
|
||||
}
|
||||
|
||||
message ShopInfo{
|
||||
int32 Id = 1; // 商品id
|
||||
repeated PropInfo Gain = 2; // 获得商品
|
||||
repeated PropInfo Cost = 3; // 消耗商品
|
||||
int32 ExchangeTimes = 4; // 最大兑换次数
|
||||
int32 RemainTimes = 5; // 剩余兑换次数
|
||||
int64 Level = 6; // 兑换所需等级
|
||||
bool NeedPermit = 7; // 需要典藏通行证
|
||||
int32 SortId = 8; // 序号
|
||||
}
|
||||
|
||||
//PACKET_SCPermitExchangeList
|
||||
message SCPermitExchangeList{
|
||||
repeated ShopInfo List = 1; // 兑换列表
|
||||
}
|
||||
|
||||
// 赛季通行证商城兑换
|
||||
//PACKET_CSPermitExchange
|
||||
message CSPermitExchange{
|
||||
int32 Id = 1; // 商品id
|
||||
}
|
||||
//PACKET_SCPermitExchange
|
||||
message SCPermitExchange{
|
||||
OpResultCode OpRetCode = 1; // 错误码
|
||||
}
|
||||
|
||||
//PACKET_CSPermitShop
|
||||
message CSPermitShop{
|
||||
}
|
||||
//PACKET_SCPermitShop
|
||||
message SCPermitShop{
|
||||
int32 Id = 1; // 序号
|
||||
string Name = 2; // 名称
|
||||
int32 Consume = 3; // 购买消耗类型 1金币 2钻石
|
||||
int64 price = 4; // 价格
|
||||
}
|
2
public
2
public
|
@ -1 +1 @@
|
|||
Subproject commit aef8c489a27508831d69b4f66dee10c5258abb92
|
||||
Subproject commit 65710a75b2bc39d1e899c49492db6b9978ab52e9
|
|
@ -26,6 +26,8 @@ func init() {
|
|||
com.Register(int(rankproto.Rank_PACKET_RANK_CSWinCoin), rankproto.CSWinCoin{}, CSWinCoin)
|
||||
//等级榜
|
||||
com.Register(int(rankproto.Rank_PACKET_RANK_CSLevel), rankproto.CSPlayerLevelRank{}, CSPlayerLevelRank)
|
||||
// 赛季通行证积分排行
|
||||
com.Register(int(rankproto.Rank_PACKET_RANK_CSPermit), rankproto.CSPermit{}, CSPermit)
|
||||
}
|
||||
|
||||
func CSRankMatch(s *netlib.Session, d *rankproto.GateTransmit, packetId int, data interface{}, sid int64) error {
|
||||
|
@ -477,3 +479,69 @@ func CSPlayerLevelRank(s *netlib.Session, d *rankproto.GateTransmit, packetId in
|
|||
})
|
||||
return nil
|
||||
}
|
||||
|
||||
func CSPermit(s *netlib.Session, d *rankproto.GateTransmit, packetId int, data interface{}, sid int64) error {
|
||||
logger.Logger.Trace("CSPermit data:", data)
|
||||
msg, ok := data.(*rankproto.CSPermit)
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
|
||||
rank.RankPermitMgrInstance.Take(d.Platform, 0, func(list []*model.PermitScore, err error) {
|
||||
if err != nil {
|
||||
logger.Logger.Errorf("CSPermit error: %v", err)
|
||||
return
|
||||
}
|
||||
|
||||
start, end := com.SkipLimitToStartEnd(msg.GetSkip(), msg.GetLimit(), len(list))
|
||||
|
||||
IsEndNum := false
|
||||
if end == int32(len(list)) {
|
||||
IsEndNum = true
|
||||
}
|
||||
|
||||
var i int32
|
||||
var ranks []*rankproto.PermitRank
|
||||
if end > start && int(start) < len(list) {
|
||||
for _, v := range list[start:end] {
|
||||
r := &rankproto.PermitRank{
|
||||
Snid: v.SnId,
|
||||
Name: v.Name,
|
||||
Rank: start + i,
|
||||
Score: v.Exp,
|
||||
ModId: v.ModId,
|
||||
}
|
||||
ranks = append(ranks, r)
|
||||
i++
|
||||
}
|
||||
}
|
||||
|
||||
var me *rankproto.PermitRank
|
||||
for k, v := range list {
|
||||
if v.SnId == d.Snid {
|
||||
me = &rankproto.PermitRank{
|
||||
Snid: v.SnId,
|
||||
Name: v.Name,
|
||||
Score: v.Exp,
|
||||
Rank: int32(k),
|
||||
ModId: v.ModId,
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
f := func() {
|
||||
pack := &rankproto.SCPermit{
|
||||
Ranks: ranks,
|
||||
Me: me,
|
||||
Skip: msg.GetSkip(),
|
||||
IsEndNum: IsEndNum,
|
||||
RankMaxNum: model.GameParamData.RankPlayerPermitMaxNum,
|
||||
}
|
||||
common.SendToGate(sid, int(rankproto.Rank_PACKET_RANK_SCPermit), pack, s)
|
||||
logger.Logger.Tracef("SCPermit: %v", pack)
|
||||
}
|
||||
f()
|
||||
})
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
package rank
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"mongo.games.com/game/common"
|
||||
"mongo.games.com/goserver/core/logger"
|
||||
|
||||
"mongo.games.com/game/model"
|
||||
"mongo.games.com/game/ranksrv/com"
|
||||
)
|
||||
|
||||
var RankPermitMgrInstance = com.NewListMgr[*model.PermitScore](
|
||||
func() int64 {
|
||||
return int64(model.GameParamData.RankTimeout)
|
||||
},
|
||||
func(platform string, index int32) ([]*model.PermitScore, error) {
|
||||
logger.Logger.Tracef("load rank permit platform:%s rankType:%d", platform, index)
|
||||
se := new(model.PermitStartTs)
|
||||
b := model.GetStrKVGameData(common.PermitStartTsKey + platform)
|
||||
json.Unmarshal([]byte(b), se)
|
||||
seasonList, err := model.FindPlayerPermitList(&model.FindPlayerPermitListArgs{
|
||||
Platform: platform,
|
||||
StartTs: se.StartTs,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return seasonList.List, nil
|
||||
})
|
|
@ -0,0 +1,77 @@
|
|||
|
||||
// Code generated by xlsx2proto.
|
||||
// DO NOT EDIT!
|
||||
|
||||
package srvdata
|
||||
|
||||
import (
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
||||
"mongo.games.com/game/protocol/server"
|
||||
)
|
||||
|
||||
var PBDB_PassShowMgr = &DB_PassShowMgr{
|
||||
Datas: &server.DB_PassShowArray{},
|
||||
pool: make(map[int32]*server.DB_PassShow),
|
||||
|
||||
}
|
||||
|
||||
type DB_PassShowMgr struct {
|
||||
Datas *server.DB_PassShowArray
|
||||
pool map[int32]*server.DB_PassShow
|
||||
|
||||
}
|
||||
|
||||
func (this *DB_PassShowMgr) unmarshal(data []byte) error {
|
||||
err := proto.Unmarshal(data, this.Datas)
|
||||
if err == nil {
|
||||
this.arrangeData()
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func (this *DB_PassShowMgr) reunmarshal(data []byte) error {
|
||||
newDatas := &server.DB_PassShowArray{}
|
||||
err := proto.Unmarshal(data, newDatas)
|
||||
if err == nil {
|
||||
for _, item := range newDatas.Arr {
|
||||
existItem := this.GetData(item.GetId())
|
||||
if existItem == nil {
|
||||
this.pool[item.GetId()] = item
|
||||
this.Datas.Arr = append(this.Datas.Arr, item)
|
||||
|
||||
} else {
|
||||
*existItem = *item
|
||||
}
|
||||
}
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func (this *DB_PassShowMgr) arrangeData() {
|
||||
if this.Datas == nil {
|
||||
return
|
||||
}
|
||||
|
||||
dataArr := this.Datas.GetArr()
|
||||
if dataArr == nil {
|
||||
return
|
||||
}
|
||||
|
||||
for _, data := range dataArr {
|
||||
this.pool[data.GetId()] = data
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
func (this *DB_PassShowMgr) GetData(id int32) *server.DB_PassShow {
|
||||
if data, ok := this.pool[id]; ok {
|
||||
return data
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
func init() {
|
||||
DataMgr.register("DB_PassShow.dat", &ProtobufDataLoader{dh: PBDB_PassShowMgr})
|
||||
}
|
|
@ -309,6 +309,13 @@ func (this *CSInviteFriendHandler) Process(s *netlib.Session, packetid int, data
|
|||
proto.SetDefaults(pack)
|
||||
player.SendToClient(int(friend.FriendPacketID_PACKET_SCInviteFriend), pack)
|
||||
logger.Logger.Trace("SCInviteFriendHandler: ", pack)
|
||||
|
||||
// 记录邀请记录
|
||||
if opRetCode == friend.OpResultCode_OPRC_Sucess {
|
||||
if p.SnId != player.SnId {
|
||||
p.TaskInviteList[player.SnId] = p.scene.sceneId
|
||||
}
|
||||
}
|
||||
}
|
||||
//不能邀请自己
|
||||
if p.SnId == friendSnid {
|
||||
|
|
|
@ -167,6 +167,22 @@ func (this *CSEnterRoomHandler) Process(s *netlib.Session, packetid int, data in
|
|||
|
||||
if !scene.PlayerEnter(p, -1, true) {
|
||||
code = gamehall.OpResultCode_Game_OPRC_Error_Game
|
||||
} else {
|
||||
// 进入成功
|
||||
for _, v := range scene.players {
|
||||
if v == nil || len(v.TaskInviteList) == 0 || v.SnId == p.SnId {
|
||||
continue
|
||||
}
|
||||
if v.TaskInviteList[p.SnId] == scene.sceneId {
|
||||
delete(v.TaskInviteList, p.SnId)
|
||||
TaskSubjectSingleton.Touch(common.TaskTypeInvitePlay, &TaskData{
|
||||
SnId: v.SnId,
|
||||
GameID: scene.gameId,
|
||||
GameFreeID: scene.dbGameFree.GetId(),
|
||||
Num: 1,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
failed:
|
||||
|
|
|
@ -454,6 +454,15 @@ func init() {
|
|||
GameFreeID: scene.dbGameFree.GetId(),
|
||||
Num: 1,
|
||||
})
|
||||
// 大众场
|
||||
if common.IsDaZhong(scene.gameId) {
|
||||
TaskSubjectSingleton.Touch(common.TaskTypeDaZhong, &TaskData{
|
||||
SnId: player.SnId,
|
||||
GameID: scene.gameId,
|
||||
GameFreeID: scene.dbGameFree.GetId(),
|
||||
Num: 1,
|
||||
})
|
||||
}
|
||||
}
|
||||
// task 游戏局数
|
||||
TaskSubjectSingleton.Touch(common.TaskTypePlayTimes, &TaskData{
|
||||
|
|
|
@ -98,6 +98,9 @@ func SendReward(p *Player, m map[int64]int64, tp int32) {
|
|||
case 5:
|
||||
gain = common.GainWayItemTaskAchievement
|
||||
giveType = model.SystemFreeGive_GiveType_TaskAchievement
|
||||
case 6:
|
||||
gain = common.GainWayItemTaskPermit
|
||||
giveType = model.SystemFreeGive_GiveType_TaskPermit
|
||||
}
|
||||
BagMgrSingleton.AddItems(p, items, 0, gain, "system", "任务奖励", 0, 0, false)
|
||||
for _, v := range items {
|
||||
|
@ -164,19 +167,46 @@ func CSTaskReward(s *netlib.Session, packetId int, data interface{}, sid int64)
|
|||
return nil
|
||||
}
|
||||
|
||||
isPermit := p.GetIsPermit()
|
||||
|
||||
ret := &taskproto.SCTaskReward{
|
||||
OpCode: taskproto.OpResultCode_OPRC_Error,
|
||||
Tp: msg.GetTp(),
|
||||
Id: msg.GetId(),
|
||||
Reward: make(map[int64]int64),
|
||||
}
|
||||
|
||||
if IsTaskFinish(p, msg.GetId()) && !IsTaskReward(p, msg.GetId()) {
|
||||
p.WelfData.Task[msg.GetId()].Ts = time.Now().Unix()
|
||||
data := srvdata.PBDB_TaskMgr.GetData(msg.GetId())
|
||||
if data != nil {
|
||||
SendReward(p, data.Award, msg.Tp)
|
||||
f := func(id int32) {
|
||||
if IsTaskFinish(p, id) && !IsTaskReward(p, id) {
|
||||
p.WelfData.Task[id].Ts = time.Now().Unix()
|
||||
data := srvdata.PBDB_TaskMgr.GetData(id)
|
||||
if data != nil {
|
||||
SendReward(p, data.Award, msg.Tp)
|
||||
for k, vv := range data.GetAward() {
|
||||
ret.Reward[k] = ret.Reward[k] + vv
|
||||
}
|
||||
// 赛季通行证积分
|
||||
if data.GetActivityType() == common.TaskActivityTypePermit {
|
||||
ret.Reward[common.ItemIDPermit] = common.PermitTaskScore
|
||||
if isPermit {
|
||||
ret.Reward[common.ItemIDPermit] = common.PermitTaskScore * 1.5
|
||||
}
|
||||
BagMgrSingleton.AddItem(
|
||||
p, common.ItemIDPermit, ret.Reward[common.ItemIDPermit], 0, 0,
|
||||
"system", "任务获得赛季通行证积分", 0, 0, true)
|
||||
}
|
||||
}
|
||||
ret.OpCode = taskproto.OpResultCode_OPRC_Success
|
||||
}
|
||||
ret.OpCode = taskproto.OpResultCode_OPRC_Success
|
||||
}
|
||||
|
||||
if msg.Tp > 0 && msg.Id == 0 {
|
||||
// 一键领取
|
||||
for _, v := range srvdata.TaskMgr.GetActivityType(msg.GetTp()) {
|
||||
f(v.GetId())
|
||||
}
|
||||
} else {
|
||||
f(msg.GetId())
|
||||
}
|
||||
|
||||
p.SendToClient(int(taskproto.TaskPacketID_PACKET_SCTaskReward), ret)
|
||||
|
|
|
@ -469,6 +469,646 @@ func CSBindInvite(s *netlib.Session, packetid int, data interface{}, sid int64)
|
|||
return nil
|
||||
}
|
||||
|
||||
// IsPermitReward 是否已经领取
|
||||
func IsPermitReward(p *Player, id int32) bool {
|
||||
channelConfig := PlatformMgrSingleton.GetPermitConfig(p.Platform, p.LastChannel)
|
||||
if channelConfig == nil {
|
||||
return true
|
||||
}
|
||||
|
||||
startTs := PlatformMgrSingleton.GetConfig(p.Platform).PermitStartTs
|
||||
endTs := PlatformMgrSingleton.GetConfig(p.Platform).PermitEndTs
|
||||
|
||||
if p.WelfData != nil && p.WelfData.Task != nil {
|
||||
ts := p.WelfData.PermitAward[id]
|
||||
if ts == 0 {
|
||||
return false
|
||||
}
|
||||
if ts >= startTs && ts < endTs {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// IsPermitCanReward 是否可以领取
|
||||
func IsPermitCanReward(p *Player, id int32) bool {
|
||||
if IsPermitReward(p, id) {
|
||||
return false
|
||||
}
|
||||
|
||||
channelConfig := PlatformMgrSingleton.GetPermitConfig(p.Platform, p.LastChannel)
|
||||
if channelConfig == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
exp := int64(0)
|
||||
item := BagMgrSingleton.GetItem(p.SnId, common.ItemIDPermit)
|
||||
if item != nil {
|
||||
exp = item.ItemNum
|
||||
}
|
||||
level := PlatformMgrSingleton.GetPermitLevel(p.Platform, p.LastChannel, exp)
|
||||
|
||||
for _, v := range channelConfig.GetLevelConfig() {
|
||||
if v.GetRank() == id || v.GetRank()*1000 == id {
|
||||
if v.GetRank() == id {
|
||||
return level >= int64(v.GetRank())
|
||||
} else {
|
||||
return p.GetIsPermit() && level >= int64(v.GetRank())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SendPermitReward 发赛季通行证奖励
|
||||
// tp 1普通,2典藏
|
||||
func SendPermitReward(p *Player, m map[int64]int64, tp int32) {
|
||||
var items []*Item
|
||||
for k, v := range m {
|
||||
items = append(items, &Item{
|
||||
ItemId: int32(k),
|
||||
ItemNum: v,
|
||||
})
|
||||
}
|
||||
gain := int32(0)
|
||||
giveType := int32(-1)
|
||||
switch tp {
|
||||
case 1:
|
||||
gain = common.GainWayPermitAward
|
||||
giveType = model.SystemFreeGive_GiveType_PermitAward
|
||||
case 2:
|
||||
gain = common.GainWayPermitAwardSupper
|
||||
giveType = model.SystemFreeGive_GiveType_PermitAwardSupper
|
||||
}
|
||||
BagMgrSingleton.AddItems(p, items, 0, gain, "system", "通行证奖励", 0, 0, false)
|
||||
for _, v := range items {
|
||||
tp1 := int32(-1)
|
||||
if v.ItemId == common.ItemIDCoin {
|
||||
tp1 = model.SystemFreeGive_CoinType_Coin
|
||||
} else if v.ItemId == common.ItemIDDiamond {
|
||||
tp1 = model.SystemFreeGive_CoinType_Diamond
|
||||
}
|
||||
if !p.IsRob && tp1 >= 0 && giveType >= 0 {
|
||||
LogChannelSingleton.WriteMQData(
|
||||
model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, p.Channel, giveType, tp1, v.ItemNum))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func CSPermitInfo(s *netlib.Session, packetid int, data interface{}, sid int64) error {
|
||||
logger.Logger.Tracef("CSPermitInfo Process recv %v", data)
|
||||
_, ok := data.(*welfare.CSPermitInfo)
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
p := PlayerMgrSington.GetPlayer(sid)
|
||||
if p == nil {
|
||||
return nil
|
||||
}
|
||||
if p.LastChannel == "" {
|
||||
logger.Logger.Errorf("CSPermitInfo not channel %v", p.SnId)
|
||||
return nil
|
||||
}
|
||||
|
||||
channelConfig := PlatformMgrSingleton.GetPermitConfig(p.Platform, p.LastChannel)
|
||||
if channelConfig == nil {
|
||||
logger.Logger.Errorf("CSPermitInfo not channelConfig %v", p.SnId)
|
||||
return nil
|
||||
}
|
||||
startTs := PlatformMgrSingleton.GetConfig(p.Platform).PermitStartTs
|
||||
endTs := PlatformMgrSingleton.GetConfig(p.Platform).PermitEndTs
|
||||
if startTs == 0 || endTs == 0 {
|
||||
logger.Logger.Errorf("CSPermitInfo not startTs %v", p.SnId)
|
||||
return nil
|
||||
}
|
||||
// 赛季积分
|
||||
exp := int64(0)
|
||||
item := BagMgrSingleton.GetItem(p.SnId, common.ItemIDPermit)
|
||||
if item != nil {
|
||||
exp = item.ItemNum
|
||||
}
|
||||
// 等级
|
||||
level := PlatformMgrSingleton.GetPermitLevel(p.Platform, p.LastChannel, exp)
|
||||
|
||||
pack := &welfare.SCPermitInfo{
|
||||
Exp: exp,
|
||||
Level: level,
|
||||
Timestamp: []int64{startTs, endTs},
|
||||
IsPermit: p.GetIsPermit(),
|
||||
}
|
||||
// 等级奖励
|
||||
for _, v := range channelConfig.GetLevelConfig() {
|
||||
var a1, a2 []*welfare.PropInfo
|
||||
for _, vv := range v.GetAward1() {
|
||||
a1 = append(a1, &welfare.PropInfo{
|
||||
ItemId: vv.GetItemId(),
|
||||
ItemNum: vv.GetItemNum(),
|
||||
})
|
||||
}
|
||||
for _, vv := range v.GetAward2() {
|
||||
a2 = append(a2, &welfare.PropInfo{
|
||||
ItemId: vv.GetItemId(),
|
||||
ItemNum: vv.GetItemNum(),
|
||||
})
|
||||
}
|
||||
|
||||
status1 := 0
|
||||
if IsPermitReward(p, v.GetRank()) {
|
||||
status1 = 2
|
||||
} else {
|
||||
if IsPermitCanReward(p, v.GetRank()) {
|
||||
status1 = 1
|
||||
}
|
||||
}
|
||||
|
||||
status2 := 0
|
||||
if IsPermitReward(p, v.GetRank()*1000) {
|
||||
status2 = 2
|
||||
} else {
|
||||
if IsPermitCanReward(p, v.GetRank()*1000) {
|
||||
status2 = 1
|
||||
}
|
||||
}
|
||||
|
||||
pack.Award = append(pack.Award, &welfare.PermitAward{
|
||||
Exp: v.GetScore(),
|
||||
Level: int64(v.GetRank()),
|
||||
Award1: &welfare.PropItem{
|
||||
Award: a1,
|
||||
Status: int64(status1),
|
||||
Id: v.GetRank(),
|
||||
},
|
||||
Award2: &welfare.PropItem{
|
||||
Award: a2,
|
||||
Status: int64(status2),
|
||||
Id: v.GetRank() * 1000,
|
||||
},
|
||||
})
|
||||
}
|
||||
// 排行奖励
|
||||
for _, v := range channelConfig.GetRankConfig() {
|
||||
var items []*welfare.PropInfo
|
||||
for _, vv := range v.GetItemId() {
|
||||
items = append(items, &welfare.PropInfo{
|
||||
ItemId: vv.GetItemId(),
|
||||
ItemNum: vv.GetItemNum(),
|
||||
})
|
||||
}
|
||||
pack.RankAward = append(pack.RankAward, &welfare.PermitRankAward{
|
||||
Start: v.GetStart(),
|
||||
End: v.GetEnd(),
|
||||
ItemId: items,
|
||||
})
|
||||
}
|
||||
// 客户端轮播配置
|
||||
for _, v := range srvdata.PBDB_PassShowMgr.Datas.GetArr() {
|
||||
pack.ShowList = append(pack.ShowList, &welfare.PermitShow{
|
||||
ShowType: v.GetShowType(),
|
||||
ShowVolume: v.GetShowVolume(),
|
||||
Location: v.GetLocation(),
|
||||
})
|
||||
}
|
||||
p.SendToClient(int(welfare.SPacketID_PACKET_SCPermitInfo), pack)
|
||||
logger.Logger.Tracef("SCPermitInfo: %v", pack)
|
||||
return nil
|
||||
}
|
||||
|
||||
func CSPermitAward(s *netlib.Session, packetid int, data interface{}, sid int64) error {
|
||||
logger.Logger.Tracef("CSPermitAward Process recv %v", data)
|
||||
msg, ok := data.(*welfare.CSPermitAward)
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
p := PlayerMgrSington.GetPlayer(sid)
|
||||
if p == nil {
|
||||
return nil
|
||||
}
|
||||
if p.LastChannel == "" {
|
||||
logger.Logger.Errorf("CSPermitAward not channel %v", p.SnId)
|
||||
return nil
|
||||
}
|
||||
|
||||
channelConfig := PlatformMgrSingleton.GetPermitConfig(p.Platform, p.LastChannel)
|
||||
if channelConfig == nil {
|
||||
logger.Logger.Errorf("CSPermitAward not channelConfig %v", p.SnId)
|
||||
return nil
|
||||
}
|
||||
startTs := PlatformMgrSingleton.GetConfig(p.Platform).PermitStartTs
|
||||
endTs := PlatformMgrSingleton.GetConfig(p.Platform).PermitEndTs
|
||||
if startTs == 0 || endTs == 0 {
|
||||
logger.Logger.Errorf("CSPermitAward not startTs %v", p.SnId)
|
||||
return nil
|
||||
}
|
||||
|
||||
now := time.Now()
|
||||
|
||||
pack := &welfare.SCPermitAward{
|
||||
OpRetCode: welfare.OpResultCode_OPRC_Error,
|
||||
Tp: msg.GetTp(),
|
||||
Id: msg.GetId(),
|
||||
}
|
||||
|
||||
switch msg.GetTp() {
|
||||
case 0: // 所有
|
||||
for _, v := range channelConfig.GetLevelConfig() {
|
||||
if IsPermitCanReward(p, v.GetRank()) {
|
||||
for _, vv := range v.GetAward1() {
|
||||
pack.Award1 = append(pack.Award1, &welfare.PropInfo{
|
||||
ItemId: vv.GetItemId(),
|
||||
ItemNum: vv.GetItemNum(),
|
||||
})
|
||||
}
|
||||
p.WelfData.PermitAward[v.GetRank()] = now.Unix()
|
||||
}
|
||||
if IsPermitCanReward(p, v.GetRank()*1000) {
|
||||
for _, vv := range v.GetAward2() {
|
||||
pack.Award2 = append(pack.Award2, &welfare.PropInfo{
|
||||
ItemId: vv.GetItemId(),
|
||||
ItemNum: vv.GetItemNum(),
|
||||
})
|
||||
}
|
||||
p.WelfData.PermitAward[v.GetRank()*1000] = now.Unix()
|
||||
}
|
||||
}
|
||||
|
||||
case 1: // 普通
|
||||
for _, v := range channelConfig.GetLevelConfig() {
|
||||
if msg.GetId() == 0 {
|
||||
if IsPermitCanReward(p, v.GetRank()) {
|
||||
for _, vv := range v.GetAward1() {
|
||||
pack.Award1 = append(pack.Award1, &welfare.PropInfo{
|
||||
ItemId: vv.GetItemId(),
|
||||
ItemNum: vv.GetItemNum(),
|
||||
})
|
||||
}
|
||||
p.WelfData.PermitAward[v.GetRank()] = now.Unix()
|
||||
}
|
||||
} else {
|
||||
if v.GetRank() == msg.GetId() {
|
||||
if IsPermitCanReward(p, v.GetRank()) {
|
||||
for _, vv := range v.GetAward1() {
|
||||
pack.Award1 = append(pack.Award1, &welfare.PropInfo{
|
||||
ItemId: vv.GetItemId(),
|
||||
ItemNum: vv.GetItemNum(),
|
||||
})
|
||||
}
|
||||
p.WelfData.PermitAward[v.GetRank()] = now.Unix()
|
||||
} else {
|
||||
pack.OpRetCode = welfare.OpResultCode_OPRC_NoTimes
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
case 2: // 典藏
|
||||
for _, v := range channelConfig.GetLevelConfig() {
|
||||
if msg.GetId() == 0 {
|
||||
if IsPermitCanReward(p, v.GetRank()*1000) {
|
||||
for _, vv := range v.GetAward2() {
|
||||
pack.Award2 = append(pack.Award2, &welfare.PropInfo{
|
||||
ItemId: vv.GetItemId(),
|
||||
ItemNum: vv.GetItemNum(),
|
||||
})
|
||||
}
|
||||
p.WelfData.PermitAward[v.GetRank()*1000] = now.Unix()
|
||||
}
|
||||
} else {
|
||||
if v.GetRank() == msg.GetId() {
|
||||
if IsPermitCanReward(p, v.GetRank()*1000) {
|
||||
for _, vv := range v.GetAward2() {
|
||||
pack.Award2 = append(pack.Award2, &welfare.PropInfo{
|
||||
ItemId: vv.GetItemId(),
|
||||
ItemNum: vv.GetItemNum(),
|
||||
})
|
||||
}
|
||||
p.WelfData.PermitAward[v.GetRank()*1000] = now.Unix()
|
||||
} else {
|
||||
pack.OpRetCode = welfare.OpResultCode_OPRC_NoTimes
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 奖励合并
|
||||
var award1 = map[int32]*welfare.PropInfo{}
|
||||
var award2 = map[int32]*welfare.PropInfo{}
|
||||
var awards1 = map[int64]int64{}
|
||||
var awards2 = map[int64]int64{}
|
||||
for _, v := range pack.GetAward1() {
|
||||
e, ok := award1[v.GetItemId()]
|
||||
if !ok {
|
||||
e = &welfare.PropInfo{
|
||||
ItemId: v.GetItemId(),
|
||||
ItemNum: v.GetItemNum(),
|
||||
}
|
||||
award1[v.GetItemId()] = e
|
||||
} else {
|
||||
e.ItemNum = e.GetItemNum() + v.GetItemNum()
|
||||
}
|
||||
awards1[int64(v.GetItemId())] = awards1[int64(v.GetItemId())] + v.GetItemNum()
|
||||
}
|
||||
for _, v := range pack.GetAward2() {
|
||||
e, ok := award2[v.GetItemId()]
|
||||
if !ok {
|
||||
e = &welfare.PropInfo{
|
||||
ItemId: v.GetItemId(),
|
||||
ItemNum: v.GetItemNum(),
|
||||
}
|
||||
award2[v.GetItemId()] = e
|
||||
} else {
|
||||
e.ItemNum = e.GetItemNum() + v.GetItemNum()
|
||||
}
|
||||
awards2[int64(v.GetItemId())] = awards2[int64(v.GetItemId())] + v.GetItemNum()
|
||||
}
|
||||
// 发奖
|
||||
SendPermitReward(p, awards1, 1)
|
||||
SendPermitReward(p, awards2, 2)
|
||||
pack.Award1 = nil
|
||||
pack.Award2 = nil
|
||||
for _, v := range award1 {
|
||||
pack.Award1 = append(pack.Award1, &welfare.PropInfo{
|
||||
ItemId: v.GetItemId(),
|
||||
ItemNum: v.GetItemNum(),
|
||||
})
|
||||
}
|
||||
for _, v := range award2 {
|
||||
pack.Award2 = append(pack.Award2, &welfare.PropInfo{
|
||||
ItemId: v.GetItemId(),
|
||||
ItemNum: v.GetItemNum(),
|
||||
})
|
||||
}
|
||||
p.SendToClient(int(welfare.SPacketID_PACKET_SCPermitAward), pack)
|
||||
logger.Logger.Tracef("SCPermitAward: %v", pack)
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetPermitExchangeNum 获取已兑换次数
|
||||
func GetPermitExchangeNum(p *Player, id int32) int {
|
||||
channelConfig := PlatformMgrSingleton.GetPermitConfig(p.Platform, p.LastChannel)
|
||||
if channelConfig == nil {
|
||||
return 0
|
||||
}
|
||||
|
||||
return len(p.WelfData.PermitExchange[id])
|
||||
}
|
||||
|
||||
// GetPermitCanExchange 是否可以兑换
|
||||
// 1等级不足 2需要典藏通行证 3兑换次数不足 4商品不存在
|
||||
func GetPermitCanExchange(p *Player, id int32) (bool, int) {
|
||||
channelConfig := PlatformMgrSingleton.GetPermitConfig(p.Platform, p.LastChannel)
|
||||
if channelConfig == nil {
|
||||
return false, 0
|
||||
}
|
||||
|
||||
times := GetPermitExchangeNum(p, id)
|
||||
exp := int64(0)
|
||||
item := BagMgrSingleton.GetItem(p.SnId, common.ItemIDPermit)
|
||||
if item != nil {
|
||||
exp = item.ItemNum
|
||||
}
|
||||
level := PlatformMgrSingleton.GetPermitLevel(p.Platform, p.LastChannel, exp)
|
||||
|
||||
for _, v := range channelConfig.GetExchangeConfig() {
|
||||
if v.GetId() == id {
|
||||
// 等级
|
||||
if level < v.GetLevel() {
|
||||
return false, 1
|
||||
}
|
||||
// 通行证
|
||||
if v.GetIsPermit() && !p.GetIsPermit() {
|
||||
return false, 2
|
||||
}
|
||||
// 剩余兑换次数
|
||||
if v.GetTimes() > 0 && int64(times) >= v.GetTimes() {
|
||||
return false, 3
|
||||
}
|
||||
return true, 0
|
||||
}
|
||||
}
|
||||
|
||||
return false, 4
|
||||
}
|
||||
|
||||
func CSPermitExchangeList(s *netlib.Session, packetid int, data interface{}, sid int64) error {
|
||||
logger.Logger.Tracef("CSPermitExchangeList Process recv %v", data)
|
||||
_, ok := data.(*welfare.CSPermitExchangeList)
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
p := PlayerMgrSington.GetPlayer(sid)
|
||||
if p == nil {
|
||||
return nil
|
||||
}
|
||||
if p.LastChannel == "" {
|
||||
logger.Logger.Errorf("CSPermitExchangeList not channel %v", p.SnId)
|
||||
return nil
|
||||
}
|
||||
|
||||
channelConfig := PlatformMgrSingleton.GetPermitConfig(p.Platform, p.LastChannel)
|
||||
if channelConfig == nil {
|
||||
logger.Logger.Errorf("CSPermitExchangeList not channelConfig %v", p.SnId)
|
||||
return nil
|
||||
}
|
||||
startTs := PlatformMgrSingleton.GetConfig(p.Platform).PermitStartTs
|
||||
endTs := PlatformMgrSingleton.GetConfig(p.Platform).PermitEndTs
|
||||
if startTs == 0 || endTs == 0 {
|
||||
logger.Logger.Errorf("CSPermitExchangeList not startTs %v", p.SnId)
|
||||
return nil
|
||||
}
|
||||
|
||||
pack := &welfare.SCPermitExchangeList{}
|
||||
|
||||
for _, v := range channelConfig.GetExchangeConfig() {
|
||||
var gain, cost []*welfare.PropInfo
|
||||
for _, vv := range v.GetGain() {
|
||||
gain = append(gain, &welfare.PropInfo{
|
||||
ItemId: vv.GetItemId(),
|
||||
ItemNum: vv.GetItemNum(),
|
||||
})
|
||||
}
|
||||
for _, vv := range v.GetCost() {
|
||||
cost = append(cost, &welfare.PropInfo{
|
||||
ItemId: vv.GetItemId(),
|
||||
ItemNum: vv.GetItemNum(),
|
||||
})
|
||||
}
|
||||
|
||||
times := int32(v.GetTimes()) - int32(GetPermitExchangeNum(p, v.GetId()))
|
||||
|
||||
pack.List = append(pack.List, &welfare.ShopInfo{
|
||||
Id: v.GetId(),
|
||||
Gain: gain,
|
||||
Cost: cost,
|
||||
ExchangeTimes: int32(v.GetTimes()),
|
||||
RemainTimes: times,
|
||||
Level: v.GetLevel(),
|
||||
NeedPermit: v.GetIsPermit(),
|
||||
SortId: v.GetSortId(),
|
||||
})
|
||||
}
|
||||
p.SendToClient(int(welfare.SPacketID_PACKET_SCPermitExchangeList), pack)
|
||||
logger.Logger.Tracef("SCPermitExchangeList: %v", pack)
|
||||
return nil
|
||||
}
|
||||
|
||||
func CSPermitExchange(s *netlib.Session, packetid int, data interface{}, sid int64) error {
|
||||
logger.Logger.Tracef("CSPermitExchange Process recv %v", data)
|
||||
msg, ok := data.(*welfare.CSPermitExchange)
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
p := PlayerMgrSington.GetPlayer(sid)
|
||||
if p == nil {
|
||||
return nil
|
||||
}
|
||||
if p.LastChannel == "" {
|
||||
logger.Logger.Errorf("CSPermitExchange not channel %v", p.SnId)
|
||||
return nil
|
||||
}
|
||||
channelConfig := PlatformMgrSingleton.GetPermitConfig(p.Platform, p.LastChannel)
|
||||
if channelConfig == nil {
|
||||
logger.Logger.Errorf("CSPermitExchange not channelConfig %v", p.SnId)
|
||||
return nil
|
||||
}
|
||||
startTs := PlatformMgrSingleton.GetConfig(p.Platform).PermitStartTs
|
||||
endTs := PlatformMgrSingleton.GetConfig(p.Platform).PermitEndTs
|
||||
if startTs == 0 || endTs == 0 {
|
||||
logger.Logger.Errorf("CSPermitExchange not startTs %v", p.SnId)
|
||||
return nil
|
||||
}
|
||||
|
||||
now := time.Now()
|
||||
|
||||
isExchange, code := GetPermitCanExchange(p, msg.GetId())
|
||||
pack := &welfare.SCPermitExchange{
|
||||
OpRetCode: welfare.OpResultCode_OPRC_Sucess,
|
||||
}
|
||||
send := func(d welfare.OpResultCode) {
|
||||
// 1等级不足 2需要典藏通行证 3兑换次数不足 4商品不存在
|
||||
switch code {
|
||||
case 1:
|
||||
pack.OpRetCode = welfare.OpResultCode_OPRC_ExchangeLevelLimit
|
||||
case 2:
|
||||
pack.OpRetCode = welfare.OpResultCode_OPRC_NeedPermit
|
||||
case 3:
|
||||
pack.OpRetCode = welfare.OpResultCode_OPRC_ExchangeLimit
|
||||
case 4:
|
||||
pack.OpRetCode = welfare.OpResultCode_OPRC_NotFound
|
||||
}
|
||||
if code == 0 {
|
||||
pack.OpRetCode = d
|
||||
}
|
||||
p.SendToClient(int(welfare.SPacketID_PACKET_SCPermitExchange), pack)
|
||||
logger.Logger.Tracef("SCPermitExchange: %v", pack)
|
||||
}
|
||||
|
||||
if isExchange {
|
||||
var exchangeConfig *webapi_proto.PermitExchangeConfig
|
||||
for _, v := range channelConfig.GetExchangeConfig() {
|
||||
if v.GetId() == msg.GetId() {
|
||||
exchangeConfig = v
|
||||
break
|
||||
}
|
||||
}
|
||||
if exchangeConfig != nil {
|
||||
// 检查背包是否足够
|
||||
var items []*Item
|
||||
var costItems []*Item
|
||||
for k, v := range exchangeConfig.GetCost() {
|
||||
item := BagMgrSingleton.GetItem(p.SnId, int32(k))
|
||||
if item == nil || item.ItemNum < v.GetItemNum() {
|
||||
send(welfare.OpResultCode_OPRC_ErrCost)
|
||||
return nil
|
||||
}
|
||||
info := srvdata.PBDB_GameItemMgr.GetData(int32(k))
|
||||
if info != nil {
|
||||
costItems = append(costItems, &Item{
|
||||
ItemId: int32(k),
|
||||
ItemNum: v.GetItemNum(),
|
||||
Name: info.Name,
|
||||
})
|
||||
}
|
||||
}
|
||||
for k, v := range exchangeConfig.GetGain() {
|
||||
info := srvdata.PBDB_GameItemMgr.GetData(int32(k))
|
||||
if info != nil {
|
||||
items = append(items, &Item{
|
||||
ItemId: int32(k),
|
||||
ItemNum: v.GetItemNum(),
|
||||
Name: info.Name,
|
||||
})
|
||||
}
|
||||
}
|
||||
// 扣除背包物品
|
||||
for _, item := range costItems {
|
||||
BagMgrSingleton.AddItem(p, int64(item.ItemId), -item.ItemNum, 0, common.GainWayPermitExchangeCost, "system", "赛季通行证兑换消耗", 0, 0, false)
|
||||
}
|
||||
// 增加背包物品
|
||||
BagMgrSingleton.AddItems(p, items, 0, common.GainWayPermitExchangeGain, "system", "赛季通行证兑换获得", 0, 0, false)
|
||||
p.WelfData.PermitExchange[msg.GetId()] = append(p.WelfData.PermitExchange[msg.GetId()], now.Unix())
|
||||
}
|
||||
}
|
||||
|
||||
if !isExchange {
|
||||
pack.OpRetCode = welfare.OpResultCode_OPRC_Error
|
||||
}
|
||||
p.SendToClient(int(welfare.SPacketID_PACKET_SCPermitExchange), pack)
|
||||
logger.Logger.Tracef("SCPermitExchange: %v", pack)
|
||||
return nil
|
||||
}
|
||||
|
||||
func CSPermitShop(s *netlib.Session, packetid int, data interface{}, sid int64) error {
|
||||
logger.Logger.Tracef("CSPermitShop Process recv %v", data)
|
||||
_, ok := data.(*welfare.CSPermitShop)
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
p := PlayerMgrSington.GetPlayer(sid)
|
||||
if p == nil {
|
||||
return nil
|
||||
}
|
||||
if p.LastChannel == "" {
|
||||
logger.Logger.Errorf("CSPermitShop not channel %v", p.SnId)
|
||||
return nil
|
||||
}
|
||||
channelConfig := PlatformMgrSingleton.GetPermitConfig(p.Platform, p.LastChannel)
|
||||
if channelConfig == nil {
|
||||
logger.Logger.Errorf("CSPermitShop not channelConfig %v", p.SnId)
|
||||
return nil
|
||||
}
|
||||
startTs := PlatformMgrSingleton.GetConfig(p.Platform).PermitStartTs
|
||||
endTs := PlatformMgrSingleton.GetConfig(p.Platform).PermitEndTs
|
||||
if startTs == 0 || endTs == 0 {
|
||||
logger.Logger.Errorf("CSPermitShop not startTs %v", p.SnId)
|
||||
return nil
|
||||
}
|
||||
|
||||
shopInfo := ShopMgrSington.GetShopInfo(common.ShopIdPermit, p)
|
||||
if shopInfo == nil {
|
||||
logger.Logger.Errorf("CSPermitShop is null %v", p.SnId)
|
||||
return nil
|
||||
}
|
||||
price := int64(0)
|
||||
if len(shopInfo.CostArea) > 0 {
|
||||
price = int64(shopInfo.CostArea[0])
|
||||
}
|
||||
|
||||
pack := &welfare.SCPermitShop{
|
||||
Id: shopInfo.Id,
|
||||
Name: shopInfo.Name,
|
||||
Consume: shopInfo.ConstType,
|
||||
Price: price,
|
||||
}
|
||||
p.SendToClient(int(welfare.SPacketID_PACKET_SCPermitShop), pack)
|
||||
logger.Logger.Tracef("SCPermitShop: %v", pack)
|
||||
return nil
|
||||
}
|
||||
|
||||
// ------------------------------------------------
|
||||
type CSPigBankGetInfoPacketFactory struct {
|
||||
}
|
||||
|
@ -647,4 +1287,15 @@ func init() {
|
|||
//领取钻石储存罐
|
||||
/* common.RegisterHandler(int(welfare.SPacketID_PACKET_CSDiamondBankTakeDiamond), &CSDiamondBankTakeDiamondHandler{})
|
||||
netlib.RegisterFactory(int(welfare.SPacketID_PACKET_CSDiamondBankTakeDiamond), &CSDiamondBankTakeDiamondPacketFactory{})*/
|
||||
|
||||
// 赛季通行证信息
|
||||
common.Register(int(welfare.SPacketID_PACKET_CSPermitInfo), welfare.CSPermitInfo{}, CSPermitInfo)
|
||||
// 赛季通行证奖励领取
|
||||
common.Register(int(welfare.SPacketID_PACKET_CSPermitAward), welfare.CSPermitAward{}, CSPermitAward)
|
||||
// 赛季通行证兑换列表
|
||||
common.Register(int(welfare.SPacketID_PACKET_CSPermitExchangeList), welfare.CSPermitExchangeList{}, CSPermitExchangeList)
|
||||
// 赛季通行证兑换
|
||||
common.Register(int(welfare.SPacketID_PACKET_CSPermitExchange), welfare.CSPermitExchange{}, CSPermitExchange)
|
||||
// 赛季典藏通行证商品信息
|
||||
common.Register(int(welfare.SPacketID_PACKET_CSPermitShop), welfare.CSPermitShop{}, CSPermitShop)
|
||||
}
|
||||
|
|
|
@ -290,12 +290,32 @@ func (this *BagMgr) AddItems(p *Player, addItems []*Item, add int64, gainWay int
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
if len(changeItems) > 0 {
|
||||
newBagInfo.dirty = true
|
||||
p.dirty = true
|
||||
this.PlayerBag[p.SnId] = newBagInfo
|
||||
this.SyncBagData(p.SnId, changeItems...)
|
||||
}
|
||||
|
||||
for _, v := range changeItems {
|
||||
if v == common.ItemIDPermit {
|
||||
item := this.GetItem(p.SnId, v)
|
||||
startTs := PlatformMgrSingleton.GetConfig(p.Platform).PermitStartTs
|
||||
if item != nil && item.ItemNum > 0 && startTs > 0 {
|
||||
// 赛季积分排行榜
|
||||
LogChannelSingleton.WriteLog(&model.PermitScore{
|
||||
Platform: p.Platform,
|
||||
SnId: p.SnId,
|
||||
Name: p.Name,
|
||||
Exp: item.ItemNum,
|
||||
ModId: p.Roles.ModId,
|
||||
StartTs: startTs,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if code != bag.OpResultCode_OPRC_Sucess {
|
||||
return newBagInfo, code, false
|
||||
}
|
||||
|
|
142
worldsrv/etcd.go
142
worldsrv/etcd.go
|
@ -2,17 +2,22 @@ package main
|
|||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"go.etcd.io/etcd/client/v3"
|
||||
"mongo.games.com/goserver/core/logger"
|
||||
"mongo.games.com/goserver/core/basic"
|
||||
"mongo.games.com/goserver/core/task"
|
||||
|
||||
"mongo.games.com/game/common"
|
||||
"mongo.games.com/game/etcd"
|
||||
"mongo.games.com/game/model"
|
||||
hallproto "mongo.games.com/game/protocol/gamehall"
|
||||
loginproto "mongo.games.com/game/protocol/login"
|
||||
playerproto "mongo.games.com/game/protocol/player"
|
||||
"mongo.games.com/game/protocol/webapi"
|
||||
"mongo.games.com/goserver/core/logger"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@ -68,6 +73,8 @@ func init() {
|
|||
etcd.Register(etcd.ETCDKEY_ACT_PHONELOTTERY, webapi.WelfarePhoneLotteryStatus{}, platformConfigEvent)
|
||||
// 邀请活动
|
||||
etcd.Register(etcd.ETCDKEY_ACT_Invite, webapi.ActInviteConfig{}, platformConfigEvent)
|
||||
// 赛季通行证
|
||||
etcd.Register(etcd.ETCDKEY_ACT_Permit, webapi.ActPermitConfig{}, platformConfigEvent)
|
||||
}
|
||||
|
||||
func platformConfigEvent(ctx context.Context, completeKey string, isInit bool, event *clientv3.Event, data interface{}) {
|
||||
|
@ -199,9 +206,142 @@ func platformConfigEvent(ctx context.Context, completeKey string, isInit bool, e
|
|||
WelfareMgrSington.UpdatePhoneLotteryStatus(config)
|
||||
case *webapi.ActInviteConfig:
|
||||
PlatformMgrSingleton.GetConfig(config.Platform).ActInviteConfig = config
|
||||
case *webapi.ActPermitConfig:
|
||||
break
|
||||
PlatformMgrSingleton.GetConfig(config.Platform).ActPermitConfig = config
|
||||
st := new(model.PermitStartTs)
|
||||
permit := model.GetStrKVGameData(common.PermitStartTsKey + config.Platform)
|
||||
if permit != "" {
|
||||
if err := json.Unmarshal([]byte(permit), st); err != nil {
|
||||
logger.Logger.Errorf("permit startts error: %v", err)
|
||||
return
|
||||
}
|
||||
// 修改循环周期
|
||||
endTs := st.StartTs + int64(config.GetDays()*24*3600)
|
||||
if st.StartTs > 0 && endTs != st.EndTs {
|
||||
st.EndTs = endTs
|
||||
}
|
||||
PlatformMgrSingleton.GetConfig(config.Platform).PermitStartTs = st.StartTs
|
||||
PlatformMgrSingleton.GetConfig(config.Platform).PermitEndTs = st.EndTs
|
||||
} else {
|
||||
startTs := common.GetDayStartTs(config.StartTs)
|
||||
endTs := startTs + int64(config.Days*24*3600)
|
||||
st.StartTs = startTs
|
||||
st.EndTs = endTs
|
||||
PlatformMgrSingleton.GetConfig(config.Platform).PermitStartTs = startTs
|
||||
PlatformMgrSingleton.GetConfig(config.Platform).PermitEndTs = endTs
|
||||
}
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
if st.StartTs <= 0 || st.EndTs <= 0 {
|
||||
return nil
|
||||
}
|
||||
b, err := json.Marshal(st)
|
||||
if err != nil {
|
||||
logger.Logger.Errorf("permit startts save error: %v", err)
|
||||
} else {
|
||||
logger.Logger.Infof("update permit startts: %v %v", st.StartTs, st.EndTs)
|
||||
err := model.UptStrKVGameData(common.PermitStartTsKey+config.Platform, string(b))
|
||||
if err != nil {
|
||||
logger.Logger.Errorf("permit startts update error:%v", err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}), nil).StartByExecutor("permit_start_ts")
|
||||
|
||||
default:
|
||||
logger.Logger.Errorf("etcd completeKey:%s, Not processed", completeKey)
|
||||
}
|
||||
// test
|
||||
actConfig := &webapi.ActPermitConfig{
|
||||
Platform: "1",
|
||||
StartTs: 1719646575,
|
||||
Days: 7,
|
||||
}
|
||||
channelConfig := webapi.PermitChannelConfig{
|
||||
Channel: "Official",
|
||||
}
|
||||
for i := 0; i < 100; i++ {
|
||||
channelConfig.LevelConfig = append(channelConfig.LevelConfig, &webapi.PermitLevelConfig{
|
||||
Rank: int32(i + 1),
|
||||
Score: int64((i + 1) * 100),
|
||||
Award1: []*webapi.ItemInfo{
|
||||
{
|
||||
ItemId: common.ItemIDCoin,
|
||||
ItemNum: 100,
|
||||
},
|
||||
},
|
||||
Award2: []*webapi.ItemInfo{
|
||||
{
|
||||
ItemId: common.ItemIDCoin,
|
||||
ItemNum: 100,
|
||||
},
|
||||
{
|
||||
ItemId: common.ItemIDDiamond,
|
||||
ItemNum: 100,
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
itemId := []int32{100001, 100002, 10001, 20001, 20002, 20003}
|
||||
for i := 0; i < 10; i++ {
|
||||
level := 0
|
||||
if common.RandInt(0, 3) == 0 {
|
||||
level = common.RandInt(1, 101)
|
||||
}
|
||||
channelConfig.ExchangeConfig = append(channelConfig.ExchangeConfig, &webapi.PermitExchangeConfig{
|
||||
Id: int32(i + 1),
|
||||
SortId: int32(100 - i),
|
||||
Gain: []*webapi.ItemInfo{
|
||||
{
|
||||
ItemId: itemId[common.RandInt(len(itemId))],
|
||||
ItemNum: 1,
|
||||
},
|
||||
},
|
||||
Cost: []*webapi.ItemInfo{{
|
||||
ItemId: common.ItemIDLong,
|
||||
ItemNum: int64(common.RandInt(50, 101)),
|
||||
}},
|
||||
IsPermit: common.RandInt(0, 3) == 0,
|
||||
Level: int64(level),
|
||||
Times: int64(common.RandInt(0, 5)),
|
||||
IsShow: common.RandInt(0, 4) != 0,
|
||||
})
|
||||
}
|
||||
rankN := 1
|
||||
for i := 0; i < 3; i++ {
|
||||
sub := common.RandInt(0, 3)
|
||||
items := []*webapi.ItemInfo{
|
||||
{
|
||||
ItemId: common.ItemIDCoin,
|
||||
ItemNum: 100,
|
||||
},
|
||||
}
|
||||
if common.RandInt(2) == 0 {
|
||||
items = append(items, &webapi.ItemInfo{
|
||||
ItemId: common.ItemIDDiamond,
|
||||
ItemNum: 100,
|
||||
})
|
||||
}
|
||||
channelConfig.RankConfig = append(channelConfig.RankConfig, &webapi.PermitRankConfig{
|
||||
Start: int32(rankN),
|
||||
End: int32(rankN + sub),
|
||||
ItemId: items,
|
||||
})
|
||||
rankN = rankN + sub + 1
|
||||
}
|
||||
|
||||
actConfig.Configs = append(actConfig.Configs, &channelConfig)
|
||||
webConfig := channelConfig
|
||||
webConfig.Channel = "Web"
|
||||
actConfig.Configs = append(actConfig.Configs, &webConfig)
|
||||
googleConfig := channelConfig
|
||||
googleConfig.Channel = "GooglePlay"
|
||||
actConfig.Configs = append(actConfig.Configs, &googleConfig)
|
||||
PlatformMgrSingleton.GetConfig("1").ActPermitConfig = actConfig
|
||||
PlatformMgrSingleton.GetConfig("1").PermitStartTs = common.GetDayStartTs(1719646575)
|
||||
PlatformMgrSingleton.GetConfig("1").PermitEndTs = common.GetDayStartTs(1719646575) + int64(actConfig.GetDays()*24*3600)
|
||||
logger.Logger.Tracef("==> PermitConfig: %v ", actConfig)
|
||||
// test
|
||||
}
|
||||
|
||||
func handlerEvent(ctx context.Context, completeKey string, isInit bool, event *clientv3.Event, data interface{}) {
|
||||
|
|
|
@ -60,4 +60,5 @@ func init() {
|
|||
LogChannelSingleton.RegisterLogCName(mq.BackReliefund, &model.ReliefFundLog{})
|
||||
LogChannelSingleton.RegisterLogCName(model.EvtInvite, &model.EvtInviteMsg{})
|
||||
LogChannelSingleton.RegisterLogCName(model.MQRankPlayerLevel, &model.PlayerLevelInfo{})
|
||||
LogChannelSingleton.RegisterLogCName(model.MQRankPlayerPermit, &model.PermitScore{})
|
||||
}
|
||||
|
|
|
@ -29,20 +29,23 @@ func main() {
|
|||
core.LoadPackages("config.json")
|
||||
// core hook
|
||||
core.RegisteHook(core.HOOK_BEFORE_START, func() error {
|
||||
etcd.Start()
|
||||
model.StartupRPClient(common.CustomConfig.GetString("MgoRpcCliNet"), common.CustomConfig.GetString("MgoRpcCliAddr"), time.Duration(common.CustomConfig.GetInt("MgoRpcCliReconnInterV"))*time.Second)
|
||||
mq.StartConsumer(common.CustomConfig.GetString("RabbitMQURL"), common.CustomConfig.GetString("RMQExchange"), true)
|
||||
mq.StartPublisher(common.CustomConfig.GetString("RabbitMQURL"), common.CustomConfig.GetString("RMQExchange"), true, common.CustomConfig.GetInt("RMQPublishBacklog"))
|
||||
err := model.InitGameKVData()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
var err error
|
||||
CacheMemory, err = cache.NewCache("memory", `{"interval":60}`)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
etcd.Start()
|
||||
gameStateMgr.Init()
|
||||
HorseRaceLampMgrSington.InitHorseRaceLamp()
|
||||
model.InitGameKVData()
|
||||
|
||||
model.GetAllCoinPoolSettingData()
|
||||
MsgMgrSington.InitMsg()
|
||||
return nil
|
||||
|
|
|
@ -0,0 +1,76 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"time"
|
||||
|
||||
"mongo.games.com/goserver/core/basic"
|
||||
"mongo.games.com/goserver/core/logger"
|
||||
"mongo.games.com/goserver/core/task"
|
||||
|
||||
"mongo.games.com/game/common"
|
||||
"mongo.games.com/game/model"
|
||||
)
|
||||
|
||||
var PermitMgrInst = new(PermitMgr)
|
||||
|
||||
type PermitMgr struct {
|
||||
BaseClockSinker
|
||||
}
|
||||
|
||||
func (r *PermitMgr) InterestClockEvent() int {
|
||||
return 1 << CLOCK_EVENT_DAY
|
||||
}
|
||||
|
||||
func (r *PermitMgr) OnDayTimer() {
|
||||
logger.Logger.Info("(this *PermitMgr) OnDayTimer")
|
||||
now := time.Now()
|
||||
for _, v := range PlatformMgrSingleton.GetPlatforms() {
|
||||
pl := PlatformMgrSingleton.GetConfig(v.IdStr).ActPermitConfig
|
||||
if pl == nil {
|
||||
continue
|
||||
}
|
||||
b := model.GetStrKVGameData(common.PermitStartTsKey + v.IdStr)
|
||||
if b == "" {
|
||||
logger.Logger.Errorf("(this *PermitMgr) OnDayTimer GetStrKVGameData not found")
|
||||
continue
|
||||
}
|
||||
se := new(model.PermitStartTs)
|
||||
if err := json.Unmarshal([]byte(b), se); err != nil {
|
||||
logger.Logger.Errorf("(this *PermitMgr) OnDayTimer json.Unmarshal err:%v", err)
|
||||
continue
|
||||
}
|
||||
if se.StartTs <= now.Unix() && now.Unix() < se.EndTs {
|
||||
// 在活动内
|
||||
continue
|
||||
}
|
||||
if now.Unix() < se.StartTs {
|
||||
// 活动未开始
|
||||
continue
|
||||
}
|
||||
if now.Unix() >= se.EndTs {
|
||||
// 活动已结束, 新开始
|
||||
se.StartTs = se.EndTs
|
||||
se.EndTs = se.EndTs + int64(pl.Days*24*3600)
|
||||
if now.Unix() < se.StartTs || now.Unix() >= se.EndTs {
|
||||
se.StartTs = common.GetDayStartTs(now.Unix())
|
||||
se.EndTs = se.StartTs + int64(pl.Days*24*3600)
|
||||
}
|
||||
PlatformMgrSingleton.GetConfig(v.IdStr).PermitStartTs = se.StartTs
|
||||
PlatformMgrSingleton.GetConfig(v.IdStr).PermitEndTs = se.EndTs
|
||||
b, err := json.Marshal(se)
|
||||
if err != nil {
|
||||
logger.Logger.Errorf("(this *PermitMgr) OnDayTimer json.Marshal err:%v", err)
|
||||
continue
|
||||
}
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
model.UptStrKVGameData(common.PermitStartTsKey+v.IdStr, string(b))
|
||||
return nil
|
||||
}), nil).StartByExecutor("permit_start_ts")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func init() {
|
||||
ClockMgrSington.RegisteSinker(PermitMgrInst)
|
||||
}
|
|
@ -144,9 +144,10 @@ type Player struct {
|
|||
BuildVersion string // app构建版本
|
||||
AppChannel string // app渠道(玩家本次登录使用的包的渠道类型,换登录包,这个值也会变;玩家model.PlayerData存储的渠道是玩家第一次登录的渠道,不会修改)
|
||||
// 最后玩的游戏id
|
||||
LastGameId int
|
||||
GameID []int32 // 最近三天玩的游戏
|
||||
ApplyList []int32 //玩家申请好友记录
|
||||
LastGameId int
|
||||
GameID []int32 // 最近三天玩的游戏
|
||||
ApplyList []int32 //玩家申请好友记录
|
||||
TaskInviteList map[int32]int // 邀请好友私人桌对局 好友id:房间id
|
||||
}
|
||||
|
||||
func NewPlayer(sid int64, pd *model.PlayerData, s *netlib.Session) *Player {
|
||||
|
@ -164,6 +165,7 @@ func NewPlayer(sid int64, pd *model.PlayerData, s *netlib.Session) *Player {
|
|||
thirdBalanceRefreshMark: make(map[string]bool),
|
||||
layered: make(map[int]bool),
|
||||
miniScene: make(map[int32]*Scene),
|
||||
TaskInviteList: make(map[int32]int),
|
||||
}
|
||||
if p.IsRob {
|
||||
p.RobotRandName()
|
||||
|
@ -265,6 +267,9 @@ func (this *Player) OnLogined() {
|
|||
if this.CreateTime.Unix() > this.LastLogoutTime.Unix() {
|
||||
isFirstLogin = true
|
||||
}
|
||||
if !this.IsRob {
|
||||
this.ResetPermit()
|
||||
}
|
||||
|
||||
// 跨天业务处理
|
||||
tNow := time.Now()
|
||||
|
@ -1891,6 +1896,10 @@ func (this *Player) AddDiamond(num, add int64, gainWay int32, oper, remark strin
|
|||
} else {
|
||||
this.Diamond += num
|
||||
}
|
||||
TaskSubjectSingleton.Touch(common.TaskTypeCostDiamond, &TaskData{
|
||||
SnId: this.SnId,
|
||||
Num: -num,
|
||||
})
|
||||
}
|
||||
|
||||
this.SendDiffData()
|
||||
|
@ -2176,6 +2185,10 @@ func (this *Player) OnSecTimer() {
|
|||
|
||||
func (this *Player) OnMiniTimer() {
|
||||
FirePlayerMiniTimer(this)
|
||||
TaskSubjectSingleton.Touch(common.TaskTypeOnlineTs, &TaskData{
|
||||
SnId: this.SnId,
|
||||
Num: 60,
|
||||
})
|
||||
}
|
||||
|
||||
func (this *Player) OnHourTimer() {
|
||||
|
@ -2221,6 +2234,9 @@ func (this *Player) OnDayTimer(login, continuous bool, t int) {
|
|||
for _, v := range srvdata.TaskMgr.GetActivityType(common.TaskActivityTypeEveryDay) {
|
||||
this.WelfData.Task[v.GetId()] = &model.TaskData{}
|
||||
}
|
||||
for _, v := range srvdata.TaskMgr.GetActivityType(common.TaskActivityTypePermit) {
|
||||
this.WelfData.Task[v.GetId()] = &model.TaskData{}
|
||||
}
|
||||
}
|
||||
}
|
||||
//周卡数据更新
|
||||
|
@ -2243,10 +2259,36 @@ func (this *Player) OnDayTimer(login, continuous bool, t int) {
|
|||
this.GetWeekCardAwary(id)
|
||||
}
|
||||
}
|
||||
// 赛季通行证活动
|
||||
this.ResetPermit()
|
||||
TaskSubjectSingleton.Touch(common.TaskTypeFirstLogin, &TaskData{SnId: this.SnId, Num: 1}) // 首次登录游戏
|
||||
TaskSubjectSingleton.Touch(common.TaskTypeLogin, &TaskData{SnId: this.SnId, Num: 1}) // 登录游戏
|
||||
}
|
||||
|
||||
func (this *Player) ResetPermit() {
|
||||
permitStartTs := PlatformMgrSingleton.GetConfig(this.Platform).PermitStartTs
|
||||
if (this.PermitStartTs == 0 || this.PermitStartTs < permitStartTs) && permitStartTs > 0 {
|
||||
this.PermitStartTs = permitStartTs
|
||||
// 清理数据
|
||||
bag := BagMgrSingleton.GetBagInfo(this.SnId)
|
||||
if bag != nil {
|
||||
delete(bag.BagItem, common.ItemIDPermit)
|
||||
//todo 上线前删除
|
||||
bagInfo := BagMgrSingleton.GetBagInfo(this.SnId)
|
||||
if bagInfo != nil {
|
||||
bagInfo.BagItem[common.ItemIDPermit] = &Item{
|
||||
ItemId: common.ItemIDPermit,
|
||||
ItemNum: 845,
|
||||
ObtainTime: time.Now().Unix(),
|
||||
}
|
||||
}
|
||||
//todo 上线前删除
|
||||
}
|
||||
this.WelfData.PermitAward = make(map[int32]int64)
|
||||
this.WelfData.PermitExchange = make(map[int32][]int64)
|
||||
}
|
||||
}
|
||||
|
||||
//func (this *Player) OnTimeDayTotal(continuous bool, t int) {
|
||||
// for k, tgd := range this.TotalGameData {
|
||||
// for i := 0; i < t; i++ {
|
||||
|
@ -3873,6 +3915,9 @@ func (this *Player) GetPayGoodsInfo() {
|
|||
if info.PageId == ShopPageDiamondBank {
|
||||
WelfareMgrSington.DiamondBankTakeCoin(this)
|
||||
}
|
||||
if info.PageId == ShopPagePermit {
|
||||
this.Permit = info.CreateTs.Local()
|
||||
}
|
||||
switch info.Remark {
|
||||
case "BlindBox":
|
||||
if len(info.OtherParams) > 0 {
|
||||
|
@ -4630,3 +4675,16 @@ func (this *Player) AddItemRecExpireTime(itemId int32, num, add int64, gainWay i
|
|||
this.SendDiffData()
|
||||
}
|
||||
}
|
||||
|
||||
func (this *Player) GetIsPermit() bool {
|
||||
startTs := PlatformMgrSingleton.GetConfig(this.Platform).PermitStartTs
|
||||
if startTs == 0 {
|
||||
return false
|
||||
}
|
||||
endTs := PlatformMgrSingleton.GetConfig(this.Platform).PermitEndTs
|
||||
|
||||
if this.Permit.Unix() >= startTs && this.Permit.Unix() < endTs {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
|
|
@ -42,16 +42,18 @@ const (
|
|||
|
||||
// page类型
|
||||
const (
|
||||
ShopPageCoin = 1 //金币页面
|
||||
ShopPageDiamond = 2 //钻石页面
|
||||
ShopPageItem = 3 //道具页面
|
||||
ShopPageVip = 4 //VIP页面
|
||||
ShopPagePrivilege = 5 //VIP特权礼包
|
||||
ShopPageCoin = 1 //金币页面
|
||||
ShopPageDiamond = 2 //钻石页面
|
||||
ShopPageItem = 3 //道具页面
|
||||
ShopPageVip = 4 //VIP页面
|
||||
ShopPagePrivilege = 5 //VIP特权礼包
|
||||
ShopPageGift = 7 //礼包页面
|
||||
ShopPageDiamondBank = 8 //钻石存储罐
|
||||
ShopPagePermit = 9 //赛季通行证
|
||||
|
||||
ShopPagePhoneScore = 61 //手机积分商城
|
||||
ShopPagePhoneScoreGoogle = 62
|
||||
ShopPageGift = 7 //礼包页面
|
||||
ShopPageDiamondBank = 8 //钻石存储罐
|
||||
ShopPageBackend = 9 //并不是页面,是后台加币记录类型
|
||||
ShopPageBackend = 63 //并不是页面,是后台加币记录类型
|
||||
)
|
||||
|
||||
// 商品类型
|
||||
|
|
|
@ -249,6 +249,13 @@ func init() {
|
|||
TaskSubjectSingleton.Attach(common.TaskTypeTurnplate, taskHandle)
|
||||
TaskSubjectSingleton.Attach(common.TaskTypeInviteRecharge, taskHandle)
|
||||
TaskSubjectSingleton.Attach(common.TaskTypeLoseCoin, taskHandle)
|
||||
TaskSubjectSingleton.Attach(common.TaskTypeOnlineTs, taskHandle)
|
||||
TaskSubjectSingleton.Attach(common.TaskTypeBuyPig, taskHandle)
|
||||
TaskSubjectSingleton.Attach(common.TaskTypeDaZhong, taskHandle)
|
||||
TaskSubjectSingleton.Attach(common.TaskTypeInvitePlay, taskHandle)
|
||||
TaskSubjectSingleton.Attach(common.TaskTypeJoinMatch, taskHandle)
|
||||
TaskSubjectSingleton.Attach(common.TaskTypeMatchRank10, taskHandle)
|
||||
TaskSubjectSingleton.Attach(common.TaskTypeCostDiamond, taskHandle)
|
||||
TaskSubjectSingleton.Attach(common.TaskTypeTienlenLoseCoin, taskHandle)
|
||||
TaskSubjectSingleton.Attach(common.TaskTypeTienlenWinCoin, taskHandle)
|
||||
}
|
||||
|
|
|
@ -716,6 +716,12 @@ func (this *Tournament) Start(platform string, tmId int32) {
|
|||
// 开始比赛,清除报名数据
|
||||
for _, v := range signInfo.signup {
|
||||
delete(this.singleSignupPlayers, v.SnId)
|
||||
TaskSubjectSingleton.Touch(common.TaskTypeJoinMatch, &TaskData{
|
||||
SnId: v.SnId,
|
||||
GameID: int(tm.dbGameFree.GetGameId()),
|
||||
GameFreeID: tm.dbGameFree.GetId(),
|
||||
Num: 1,
|
||||
})
|
||||
}
|
||||
this.signupPlayers[platform][tmId].signup = make(map[int32]*TmPlayer)
|
||||
}
|
||||
|
@ -1521,6 +1527,12 @@ func (this *Tournament) MakeMatchLog(platform string, tmId int32, sortId int64)
|
|||
Item: items,
|
||||
Rank: rankId,
|
||||
})
|
||||
if rankId >= 10 {
|
||||
TaskSubjectSingleton.Touch(common.TaskTypeMatchRank10, &TaskData{
|
||||
SnId: v.p.SnId,
|
||||
Num: 1,
|
||||
})
|
||||
}
|
||||
}
|
||||
matchLog.MatchId = tmId
|
||||
matchLog.MatchName = gameMatchDate.MatchName
|
||||
|
|
|
@ -4124,6 +4124,9 @@ func init() {
|
|||
if info.PageId == ShopPageDiamondBank {
|
||||
WelfareMgrSington.DiamondBankTakeCoin(player)
|
||||
}
|
||||
if info.PageId == ShopPagePermit {
|
||||
player.Permit = info.CreateTs.Local()
|
||||
}
|
||||
switch info.Remark {
|
||||
case "BlindBox":
|
||||
if len(info.OtherParams) > 0 {
|
||||
|
|
|
@ -1774,6 +1774,10 @@ func (this *WelfareMgr) PigbankTakeCoin(p *Player) {
|
|||
if p.Diamond >= costDiamond {
|
||||
logger.Logger.Trace("开存钱罐消耗钻石", costDiamond)
|
||||
p.AddDiamond(-costDiamond, 0, common.GainWay_PigrankTakeCoin, "system", "-开存钱罐消耗钻石")
|
||||
TaskSubjectSingleton.Touch(common.TaskTypeBuyPig, &TaskData{
|
||||
SnId: p.SnId,
|
||||
Num: 1,
|
||||
})
|
||||
} else {
|
||||
pack.OpRetCode = welfare.OpResultCode_OPRC_DiamondLess
|
||||
logger.Logger.Trace("钻石不足")
|
||||
|
@ -1895,6 +1899,10 @@ func (this *WelfareMgr) DiamondBankTakeCoin(p *Player) {
|
|||
pack.OpRetCode = welfare.OpResultCode_OPRC_Sucess
|
||||
addDiamond := int64(math.Ceil(p.WelfData.DiamondBank.BankDiamond))
|
||||
p.AddDiamond(addDiamond, 0, common.GainWay_PigrankGainDiamond, "sys", "存钱罐领取钻石")
|
||||
TaskSubjectSingleton.Touch(common.TaskTypeBuyPig, &TaskData{
|
||||
SnId: p.SnId,
|
||||
Num: 1,
|
||||
})
|
||||
|
||||
// 领取完之后 设置为0
|
||||
p.WelfData.DiamondBank.BankDiamond = 0.0
|
||||
|
@ -1964,6 +1972,7 @@ func (this *WelfareMgr) UpdateDiamondBankData(p *Player, coinNum int64, isWin bo
|
|||
}
|
||||
logger.Logger.Tracef("玩家更新钻石存储罐数据 snid = %d,coinNum = %d,isWin = %s,当前钻石存储罐钻石数量:%f,本次增加钻石数量:%f", p.SnId, coinNum, isWin, p.WelfData.DiamondBank.BankDiamond, addDiamond)
|
||||
}
|
||||
|
||||
func (this *WelfareMgr) Update() {
|
||||
|
||||
}
|
||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue