Compare commits

..

No commits in common. "4b8f6e62748acc6f4ea907475df90d45a60e6ad0" and "ae085ec66120571130f28937a7f7ca45443c9379" have entirely different histories.

26 changed files with 1922 additions and 2210 deletions

View File

@ -22,7 +22,6 @@ const (
TransTypeMatchSceneChange = 1013 TransTypeMatchSceneChange = 1013
TransTypeMiniGameAddCoin = 1014 TransTypeMiniGameAddCoin = 1014
TransTypeServerCtrl = 1015 TransTypeServerCtrl = 1015
TranTypeAddItem = 1016 // 道具修改
) )
type M2GWebTrascate struct { type M2GWebTrascate struct {

View File

@ -28,8 +28,6 @@ func ItemLogsCollection(plt string) *mongo.Collection {
c_itemlog.EnsureIndex(mgo.Index{Key: []string{"snid", "logtype", "itemid", "typeid"}, Background: true, Sparse: true}) c_itemlog.EnsureIndex(mgo.Index{Key: []string{"snid", "logtype", "itemid", "typeid"}, Background: true, Sparse: true})
c_itemlog.EnsureIndex(mgo.Index{Key: []string{"roomconfigid"}, Background: true, Sparse: true}) c_itemlog.EnsureIndex(mgo.Index{Key: []string{"roomconfigid"}, Background: true, Sparse: true})
c_itemlog.EnsureIndex(mgo.Index{Key: []string{"typeid", "roomconfigid"}, Background: true, Sparse: true}) c_itemlog.EnsureIndex(mgo.Index{Key: []string{"typeid", "roomconfigid"}, Background: true, Sparse: true})
c_itemlog.EnsureIndex(mgo.Index{Key: []string{"ts"}, Background: true, Sparse: true})
c_itemlog.EnsureIndex(mgo.Index{Key: []string{"-ts"}, Background: true, Sparse: true})
} }
return c_itemlog return c_itemlog
} }
@ -128,37 +126,6 @@ func (svc *ItemLogSvc) GetClawdollItemLog(args *model.ClawdollItemLogReq, ret *m
return return
} }
func (svc *ItemLogSvc) GetItemLog(req *model.GetItemLogParam, res *model.GetItemLogRes) error {
c := ItemLogsCollection(req.Plt)
if c == nil {
return nil
}
err := c.Find(bson.M{"snid": req.SnId, "ts": bson.M{"$gt": req.Ts}}).All(&res.Logs)
if err != nil && !errors.Is(err, mgo.ErrNotFound) {
return err
}
return nil
}
func (svc *ItemLogSvc) Insert(req *model.InsertItemLogReq, res *bool) error {
if len(req.Logs) == 0 {
return nil
}
clog := ItemLogsCollection(req.Logs[0].Platform)
if clog == nil {
logger.Logger.Errorf("ItemLogSvc.Insert collection not found Platform:%v", req.Logs[0].Platform)
return nil
}
if err := clog.Insert(req.Logs); err != nil {
logger.Logger.Warn("ItemLogSvc.Insert error:", err)
return err
}
*res = true
return nil
}
func init() { func init() {
rpc.Register(new(ItemLogSvc)) rpc.Register(new(ItemLogSvc))
} }

View File

@ -1266,7 +1266,10 @@ func (this *Player) GetSkillAdd(id int32) int32 {
// 增加或减少道具 // 增加或减少道具
// 同步到 worldsrv // 同步到 worldsrv
func (this *Player) AddItems(args *model.AddItemParam) { func (this *Player) AddItems(args *model.AddItemParam) {
changeItem := map[int32]int64{} pack := &server.PlayerChangeItems{
SnId: args.P.SnId,
}
for _, v := range args.Change { for _, v := range args.Change {
item := srvdata.GameItemMgr.Get(this.Platform, v.ItemId) item := srvdata.GameItemMgr.Get(this.Platform, v.ItemId)
if item == nil { if item == nil {
@ -1279,25 +1282,34 @@ func (this *Player) AddItems(args *model.AddItemParam) {
continue continue
} }
this.Items[v.ItemId] += v.ItemNum this.Items[v.ItemId] += v.ItemNum
changeItem[v.ItemId] += v.ItemNum if !args.NoLog {
logType := 0
if v.ItemNum < 0 {
logType = 1
}
LogChannelSingleton.WriteLog(model.NewItemLogEx(model.ItemParam{
Platform: this.Platform,
SnId: this.SnId,
LogType: int32(logType),
ItemId: v.ItemId,
ItemName: item.Name,
Count: v.ItemNum,
Remark: args.Remark,
TypeId: args.GainWay,
GameId: args.GameId,
GameFreeId: args.GameFreeId,
Cost: args.Cost,
}))
}
pack.Items = append(pack.Items, &server.Item{
Id: v.ItemId,
Num: v.ItemNum,
})
} }
if len(changeItem) > 0 {
args.Change = args.Change[:0] if len(pack.Items) > 0 {
for k, v := range changeItem {
args.Change = append(args.Change, &model.Item{
ItemId: k,
ItemNum: v,
})
}
b, err := netlib.Gob.Marshal(args)
if err != nil {
logger.Logger.Errorf("道具变更日志序列化失败 %v", err)
}
pack := &server.PlayerChangeItems{
Data: b,
}
this.SendToWorld(int(server.SSPacketID_PACKET_PlayerChangeItems), pack) this.SendToWorld(int(server.SSPacketID_PACKET_PlayerChangeItems), pack)
logger.Logger.Tracef("PlayerChangeItems: %v", args) logger.Logger.Tracef("PlayerChangeItems: %v", pack)
} }
} }

View File

@ -1993,8 +1993,7 @@ func (this *Scene) TryBillExGameDrop(p *Player) {
itemData := srvdata.GameItemMgr.Get(p.Platform, id) itemData := srvdata.GameItemMgr.Get(p.Platform, id)
if itemData != nil { if itemData != nil {
p.AddItems(&model.AddItemParam{ p.AddItems(&model.AddItemParam{
Platform: p.Platform, P: p.PlayerData,
SnId: p.SnId,
Change: []*model.Item{ Change: []*model.Item{
{ {
ItemId: id, ItemId: id,
@ -2036,8 +2035,7 @@ func (this *Scene) DropCollectBox(p *Player) {
if itemData != nil { if itemData != nil {
pack.Items = map[int32]int32{itemData.Id: 1} pack.Items = map[int32]int32{itemData.Id: 1}
p.AddItems(&model.AddItemParam{ p.AddItems(&model.AddItemParam{
Platform: p.Platform, P: p.PlayerData,
SnId: p.SnId,
Change: []*model.Item{ Change: []*model.Item{
{ {
ItemId: itemData.Id, ItemId: itemData.Id,

View File

@ -109,8 +109,7 @@ func (this *PlayerEx) CostPlayCoin() bool {
} }
this.AddItems(&model.AddItemParam{ this.AddItems(&model.AddItemParam{
Platform: this.Platform, P: this.PlayerData,
SnId: this.SnId,
Change: items, Change: items,
GainWay: common.GainWayClawdollCostItem, GainWay: common.GainWayClawdollCostItem,
Operator: "system", Operator: "system",
@ -152,8 +151,7 @@ func (this *PlayerEx) CatchCardClawdoll() bool {
} }
this.AddItems(&model.AddItemParam{ this.AddItems(&model.AddItemParam{
Platform: this.Platform, P: this.PlayerData,
SnId: this.SnId,
Change: items, Change: items,
GainWay: common.GainWayClawdollCatch, GainWay: common.GainWayClawdollCatch,
Operator: "system", Operator: "system",

View File

@ -2632,8 +2632,7 @@ func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) {
} }
} }
p.AddItems(&model.AddItemParam{ p.AddItems(&model.AddItemParam{
Platform: p.Platform, P: p.PlayerData,
SnId: p.SnId,
Change: items, Change: items,
GainWay: common.GainWayRoomGain, GainWay: common.GainWayRoomGain,
Operator: "system", Operator: "system",

View File

@ -13,10 +13,7 @@ type BagInfo struct {
SnId int32 //玩家账号直接在这里生成 SnId int32 //玩家账号直接在这里生成
Platform string //平台 Platform string //平台
BagItem map[int32]*Item //背包数据 key为itemId BagItem map[int32]*Item //背包数据 key为itemId
Ts int64 // 最后数据更新纳秒时间戳 GainWay int32 `bson:"-"`
// 临时参数,不保存数据库
GainWay int32 `bson:"-"`
} }
type Item struct { type Item struct {
@ -89,25 +86,14 @@ func SaveToDelBackupBagItem(args *BagInfo) error {
} }
type AddItemParam struct { type AddItemParam struct {
Platform string P *PlayerData
SnId int32
Change []*Item // 道具变化数量 Change []*Item // 道具变化数量
Cost []*Item // 获得道具时消耗的道具数量 Cost []*Item // 获得道具时消耗的道具数量
Add int64 // 加成数量 Add int64 // 加成数量
GainWay int32 // 记录类型 GainWay int32 // 记录类型
Operator, Remark string // 操作人,备注 Operator, Remark string // 操作人,备注
GameId, GameFreeId int64 // 游戏id,场次id GameId, GameFreeId int64 // 游戏id,场次id
NoLog bool // 是否不记录日志
LogId string // 撤销的id,道具兑换失败 LogId string // 撤销的id,道具兑换失败
RoomConfigId int32 // 房间配置id RoomConfigId int32 // 房间配置id
} }
type ChangeItemParam struct {
SnId int32
ItemId int32
ItemNum int64
GainWay int32
RoomConfigId int32
GameId int64
GameFreeId int64
Cost []*Item
}

View File

@ -2,7 +2,6 @@ package model
import ( import (
"errors" "errors"
"mongo.games.com/game/protocol/server"
"time" "time"
"github.com/globalsign/mgo/bson" "github.com/globalsign/mgo/bson"
@ -24,15 +23,13 @@ type ItemLog struct {
ItemName string //道具名称 ItemName string //道具名称
Count int64 //个数 Count int64 //个数
CreateTs int64 //记录时间 CreateTs int64 //记录时间
Ts int64 // 纳秒时间戳
Remark string //备注 Remark string //备注
TypeId int32 // 变化类型 TypeId int32 // 变化类型
GameId int64 // 游戏id,游戏中获得时有值 GameId int32 // 游戏id,游戏中获得时有值
GameFreeId int64 // 场次id,游戏中获得时有值 GameFreeId int32 // 场次id,游戏中获得时有值
Cost []*Item // 消耗的道具 Cost []*Item // 消耗的道具
Id string // 撤销的id兑换失败 Id string // 撤销的id兑换失败
RoomConfigId int32 // 房间配置id RoomConfigId int32 // 房间配置id
Offline int32 // 离线时的记录
} }
func NewItemLog() *ItemLog { func NewItemLog() *ItemLog {
@ -54,11 +51,9 @@ type ItemParam struct {
Cost []*Item // 消耗的道具 Cost []*Item // 消耗的道具
LogId string // 撤销的id兑换失败 LogId string // 撤销的id兑换失败
RoomConfigId int32 // 房间配置id RoomConfigId int32 // 房间配置id
Offline int32 // 离线记录
} }
func NewItemLogEx(param ItemParam) *ItemLog { func NewItemLogEx(param ItemParam) *ItemLog {
now := time.Now()
itemLog := NewItemLog() itemLog := NewItemLog()
itemLog.Platform = param.Platform itemLog.Platform = param.Platform
itemLog.SnId = param.SnId itemLog.SnId = param.SnId
@ -66,16 +61,14 @@ func NewItemLogEx(param ItemParam) *ItemLog {
itemLog.ItemId = param.ItemId itemLog.ItemId = param.ItemId
itemLog.ItemName = param.ItemName itemLog.ItemName = param.ItemName
itemLog.Count = param.Count itemLog.Count = param.Count
itemLog.CreateTs = now.Unix() itemLog.CreateTs = time.Now().Unix()
itemLog.Ts = now.UnixNano()
itemLog.Remark = param.Remark itemLog.Remark = param.Remark
itemLog.TypeId = param.TypeId itemLog.TypeId = param.TypeId
itemLog.GameId = param.GameId itemLog.GameId = int32(param.GameId)
itemLog.GameFreeId = param.GameFreeId itemLog.GameFreeId = int32(param.GameFreeId)
itemLog.Cost = param.Cost itemLog.Cost = param.Cost
itemLog.Id = param.LogId itemLog.Id = param.LogId
itemLog.RoomConfigId = param.RoomConfigId itemLog.RoomConfigId = param.RoomConfigId
itemLog.Offline = param.Offline
return itemLog return itemLog
} }
@ -164,89 +157,3 @@ func GetClawdollItemLog(plt string, snid int32) (logs []ItemLog, err error) {
return return
} }
type GetItemLogParam struct {
Plt string
SnId int32
Ts int64
}
type GetItemLogRes struct {
Logs []*ItemLog
}
func GetItemLog(plt string, snid int32, ts int64) ([]*ItemLog, error) {
if rpcCli == nil {
logger.Logger.Warnf("rpcCli is nil")
return nil, errors.New("rpcCli is nil")
}
var ret GetItemLogRes
err := rpcCli.CallWithTimeout("ItemLogSvc.GetItemLog", &GetItemLogParam{
Plt: plt,
SnId: snid,
Ts: ts,
}, &ret, time.Second*30)
if err != nil {
logger.Logger.Errorf("GetItemLog err:%v", err)
return nil, err
}
return ret.Logs, nil
}
type InsertItemLogReq struct {
Logs []*ItemLog
}
func InsertItemLog(configItems map[string]map[int32]*server.DB_GameItem, param *AddItemParam, isOffline bool) error {
if rpcCli == nil {
logger.Logger.Warnf("rpcCli is nil")
return errors.New("rpcCli is nil")
}
var logs []*ItemLog
for _, v := range param.Change {
num := v.ItemNum
logType := 0
if v.ItemNum < 0 {
logType = 1
num = -v.ItemNum
}
offline := 0
if isOffline {
offline = 1
}
// 日志
name := ""
if configItems != nil && configItems[param.Platform] != nil && configItems[param.Platform][v.ItemId] != nil {
name = configItems[param.Platform][v.ItemId].GetName()
}
log := NewItemLogEx(ItemParam{
Platform: param.Platform,
SnId: param.SnId,
LogType: int32(logType),
ItemId: v.ItemId,
ItemName: name,
Count: num,
Remark: param.Remark,
TypeId: param.GainWay,
GameId: param.GameId,
GameFreeId: param.GameFreeId,
Cost: param.Cost,
LogId: param.LogId,
RoomConfigId: param.RoomConfigId,
Offline: int32(offline),
})
logs = append(logs, log)
}
var ret bool
err := rpcCli.CallWithTimeout("ItemLogSvc.Insert", &InsertItemLogReq{
Logs: logs,
}, &ret, time.Second*30)
if err != nil {
logger.Logger.Errorf("InsertItemLog err:%v", err)
return err
}
return nil
}

View File

@ -8889,7 +8889,8 @@ type PlayerChangeItems struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Data []byte `protobuf:"bytes,1,opt,name=Data,proto3" json:"Data,omitempty"` SnId int32 `protobuf:"varint,1,opt,name=SnId,proto3" json:"SnId,omitempty"`
Items []*Item `protobuf:"bytes,2,rep,name=Items,proto3" json:"Items,omitempty"` // 道具变化数量
} }
func (x *PlayerChangeItems) Reset() { func (x *PlayerChangeItems) Reset() {
@ -8924,9 +8925,16 @@ func (*PlayerChangeItems) Descriptor() ([]byte, []int) {
return file_server_proto_rawDescGZIP(), []int{116} return file_server_proto_rawDescGZIP(), []int{116}
} }
func (x *PlayerChangeItems) GetData() []byte { func (x *PlayerChangeItems) GetSnId() int32 {
if x != nil { if x != nil {
return x.Data return x.SnId
}
return 0
}
func (x *PlayerChangeItems) GetItems() []*Item {
if x != nil {
return x.Items
} }
return nil return nil
} }
@ -9941,197 +9949,199 @@ var file_server_proto_rawDesc = []byte{
0x22, 0x32, 0x0a, 0x0c, 0x57, 0x47, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x6b, 0x69, 0x6e, 0x22, 0x32, 0x0a, 0x0c, 0x57, 0x47, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x6b, 0x69, 0x6e,
0x12, 0x12, 0x0a, 0x04, 0x53, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04,
0x53, 0x6e, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x53, 0x6e, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05,
0x52, 0x02, 0x49, 0x64, 0x22, 0x27, 0x0a, 0x11, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x43, 0x68, 0x52, 0x02, 0x49, 0x64, 0x22, 0x4b, 0x0a, 0x11, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x43, 0x68,
0x61, 0x6e, 0x67, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x6e, 0x67, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x6e, 0x49,
0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x44, 0x61, 0x74, 0x61, 0x2a, 0x83, 0x17, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x53, 0x6e, 0x49, 0x64, 0x12, 0x22, 0x0a,
0x0a, 0x0a, 0x53, 0x53, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x44, 0x12, 0x16, 0x0a, 0x12, 0x05, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x73,
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x45, 0x52, 0x5f, 0x5a, 0x45, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x49, 0x74, 0x65, 0x6d,
0x52, 0x4f, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x73, 0x2a, 0x83, 0x17, 0x0a, 0x0a, 0x53, 0x53, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x44,
0x42, 0x5f, 0x43, 0x55, 0x52, 0x5f, 0x4c, 0x4f, 0x41, 0x44, 0x10, 0xe8, 0x07, 0x12, 0x1b, 0x0a, 0x12, 0x16, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x45,
0x16, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x42, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x52, 0x5f, 0x5a, 0x45, 0x52, 0x4f, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b,
0x5f, 0x53, 0x57, 0x49, 0x54, 0x43, 0x48, 0x10, 0xe9, 0x07, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x45, 0x54, 0x5f, 0x47, 0x42, 0x5f, 0x43, 0x55, 0x52, 0x5f, 0x4c, 0x4f, 0x41, 0x44, 0x10, 0xe8,
0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x47, 0x41, 0x54, 0x45, 0x49, 0x4e, 0x46, 0x4f, 0x07, 0x12, 0x1b, 0x0a, 0x16, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x42, 0x5f, 0x53,
0x10, 0xea, 0x07, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x53, 0x57, 0x49, 0x54, 0x43, 0x48, 0x10, 0xe9, 0x07, 0x12, 0x17,
0x5f, 0x44, 0x49, 0x43, 0x4f, 0x4e, 0x4e, 0x45, 0x43, 0x54, 0x10, 0xec, 0x07, 0x12, 0x16, 0x0a, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x47, 0x41, 0x54, 0x45,
0x11, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x4d, 0x53, 0x5f, 0x53, 0x52, 0x56, 0x43, 0x54, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0xea, 0x07, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45,
0x52, 0x4c, 0x10, 0xed, 0x07, 0x12, 0x1b, 0x0a, 0x16, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x54, 0x5f, 0x53, 0x53, 0x5f, 0x44, 0x49, 0x43, 0x4f, 0x4e, 0x4e, 0x45, 0x43, 0x54, 0x10, 0xec,
0x57, 0x47, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x45, 0x52, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x10, 0x07, 0x12, 0x16, 0x0a, 0x11, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x4d, 0x53, 0x5f, 0x53,
0xf4, 0x07, 0x12, 0x1b, 0x0a, 0x16, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x47, 0x5f, 0x52, 0x56, 0x43, 0x54, 0x52, 0x4c, 0x10, 0xed, 0x07, 0x12, 0x1b, 0x0a, 0x16, 0x50, 0x41, 0x43,
0x42, 0x49, 0x4e, 0x44, 0x47, 0x52, 0x4f, 0x55, 0x50, 0x54, 0x41, 0x47, 0x10, 0xf5, 0x07, 0x12, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x45, 0x52, 0x5f, 0x53, 0x54,
0x22, 0x0a, 0x1d, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x53, 0x5f, 0x43, 0x55, 0x53, 0x41, 0x54, 0x45, 0x10, 0xf4, 0x07, 0x12, 0x1b, 0x0a, 0x16, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54,
0x54, 0x4f, 0x4d, 0x54, 0x41, 0x47, 0x5f, 0x4d, 0x55, 0x4c, 0x54, 0x49, 0x43, 0x41, 0x53, 0x54, 0x5f, 0x53, 0x47, 0x5f, 0x42, 0x49, 0x4e, 0x44, 0x47, 0x52, 0x4f, 0x55, 0x50, 0x54, 0x41, 0x47,
0x10, 0xf6, 0x07, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x10, 0xf5, 0x07, 0x12, 0x22, 0x0a, 0x1d, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x53,
0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x53, 0x43, 0x45, 0x4e, 0x45, 0x10, 0xcd, 0x08, 0x12, 0x5f, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x54, 0x41, 0x47, 0x5f, 0x4d, 0x55, 0x4c, 0x54, 0x49,
0x1b, 0x0a, 0x16, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f, 0x44, 0x45, 0x53, 0x43, 0x41, 0x53, 0x54, 0x10, 0xf6, 0x07, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45,
0x54, 0x52, 0x4f, 0x59, 0x53, 0x43, 0x45, 0x4e, 0x45, 0x10, 0xce, 0x08, 0x12, 0x1a, 0x0a, 0x15, 0x54, 0x5f, 0x57, 0x47, 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x53, 0x43, 0x45, 0x4e, 0x45,
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x10, 0xcd, 0x08, 0x12, 0x1b, 0x0a, 0x16, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47,
0x45, 0x4e, 0x54, 0x45, 0x52, 0x10, 0xcf, 0x08, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x5f, 0x44, 0x45, 0x53, 0x54, 0x52, 0x4f, 0x59, 0x53, 0x43, 0x45, 0x4e, 0x45, 0x10, 0xce, 0x08,
0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x4c, 0x45, 0x41, 0x56, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f, 0x50, 0x4c,
0x45, 0x10, 0xd0, 0x08, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x41, 0x59, 0x45, 0x52, 0x45, 0x4e, 0x54, 0x45, 0x52, 0x10, 0xcf, 0x08, 0x12, 0x1a, 0x0a, 0x15,
0x57, 0x5f, 0x42, 0x49, 0x4c, 0x4c, 0x45, 0x44, 0x52, 0x4f, 0x4f, 0x4d, 0x43, 0x41, 0x52, 0x44,
0x10, 0xd1, 0x08, 0x12, 0x1b, 0x0a, 0x16, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x57,
0x5f, 0x44, 0x45, 0x53, 0x54, 0x52, 0x4f, 0x59, 0x53, 0x43, 0x45, 0x4e, 0x45, 0x10, 0xd2, 0x08,
0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f, 0x50, 0x4c,
0x41, 0x59, 0x45, 0x52, 0x44, 0x52, 0x4f, 0x50, 0x4c, 0x49, 0x4e, 0x45, 0x10, 0xd3, 0x08, 0x12,
0x1b, 0x0a, 0x16, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f, 0x50, 0x4c, 0x41,
0x59, 0x45, 0x52, 0x52, 0x45, 0x48, 0x4f, 0x4c, 0x44, 0x10, 0xd4, 0x08, 0x12, 0x20, 0x0a, 0x1b,
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x47, 0x5f, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52,
0x53, 0x45, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x42, 0x49, 0x4e, 0x44, 0x10, 0xd5, 0x08, 0x12, 0x22,
0x0a, 0x1d, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x47, 0x5f, 0x50, 0x4c, 0x41, 0x59,
0x45, 0x52, 0x53, 0x45, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x55, 0x4e, 0x42, 0x49, 0x4e, 0x44, 0x10,
0xd6, 0x08, 0x12, 0x1b, 0x0a, 0x16, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f,
0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x52, 0x45, 0x54, 0x55, 0x52, 0x4e, 0x10, 0xd7, 0x08, 0x12,
0x1b, 0x0a, 0x16, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x52, 0x5f, 0x52, 0x45, 0x50,
0x4c, 0x41, 0x59, 0x52, 0x45, 0x43, 0x4f, 0x52, 0x44, 0x10, 0xd8, 0x08, 0x12, 0x16, 0x0a, 0x11,
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f, 0x47, 0x41, 0x4d, 0x45, 0x52, 0x45,
0x43, 0x10, 0xd9, 0x08, 0x12, 0x1c, 0x0a, 0x17, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57,
0x47, 0x5f, 0x41, 0x55, 0x44, 0x49, 0x45, 0x4e, 0x43, 0x45, 0x45, 0x4e, 0x54, 0x45, 0x52, 0x10,
0xda, 0x08, 0x12, 0x1c, 0x0a, 0x17, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f,
0x41, 0x55, 0x44, 0x49, 0x45, 0x4e, 0x43, 0x45, 0x4c, 0x45, 0x41, 0x56, 0x45, 0x10, 0xdb, 0x08,
0x12, 0x19, 0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f, 0x53, 0x43,
0x45, 0x4e, 0x45, 0x53, 0x54, 0x41, 0x52, 0x54, 0x10, 0xdc, 0x08, 0x12, 0x1a, 0x0a, 0x15, 0x50,
0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x52, 0x5f, 0x49, 0x4e, 0x56, 0x49, 0x54, 0x45, 0x52,
0x4f, 0x42, 0x4f, 0x54, 0x10, 0xdd, 0x08, 0x12, 0x21, 0x0a, 0x1c, 0x50, 0x41, 0x43, 0x4b, 0x45,
0x54, 0x5f, 0x57, 0x47, 0x5f, 0x41, 0x47, 0x45, 0x4e, 0x54, 0x4b, 0x49, 0x43, 0x4b, 0x4f, 0x55,
0x54, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x10, 0xde, 0x08, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41,
0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x44, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x4e, 0x41, 0x4c, 0x59,
0x53, 0x49, 0x53, 0x10, 0xdf, 0x08, 0x12, 0x1c, 0x0a, 0x17, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54,
0x5f, 0x47, 0x57, 0x5f, 0x43, 0x4c, 0x55, 0x42, 0x42, 0x49, 0x4c, 0x4c, 0x4d, 0x4f, 0x4e, 0x45,
0x59, 0x10, 0xe1, 0x08, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57,
0x47, 0x5f, 0x52, 0x45, 0x42, 0x49, 0x4e, 0x44, 0x5f, 0x53, 0x4e, 0x49, 0x44, 0x10, 0xe2, 0x08,
0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f, 0x41, 0x55,
0x44, 0x49, 0x45, 0x4e, 0x43, 0x45, 0x53, 0x49, 0x54, 0x10, 0xe3, 0x08, 0x12, 0x17, 0x0a, 0x12,
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f, 0x52, 0x45, 0x43, 0x48, 0x41, 0x52,
0x47, 0x45, 0x10, 0xe4, 0x08, 0x12, 0x19, 0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f,
0x47, 0x57, 0x5f, 0x53, 0x43, 0x45, 0x4e, 0x45, 0x53, 0x54, 0x41, 0x54, 0x45, 0x10, 0xe5, 0x08,
0x12, 0x21, 0x0a, 0x1c, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f, 0x47, 0x52,
0x41, 0x43, 0x45, 0x5f, 0x44, 0x45, 0x53, 0x54, 0x52, 0x4f, 0x59, 0x53, 0x43, 0x45, 0x4e, 0x45,
0x10, 0xe6, 0x08, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x57,
0x5f, 0x53, 0x43, 0x45, 0x4e, 0x45, 0x45, 0x4e, 0x44, 0x10, 0xe7, 0x08, 0x12, 0x19, 0x0a, 0x14,
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f, 0x46, 0x49, 0x53, 0x48, 0x52, 0x45,
0x43, 0x4f, 0x52, 0x44, 0x10, 0xe8, 0x08, 0x12, 0x1f, 0x0a, 0x1a, 0x50, 0x41, 0x43, 0x4b, 0x45,
0x54, 0x5f, 0x47, 0x57, 0x5f, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x46, 0x4f, 0x52, 0x43, 0x45,
0x4c, 0x45, 0x41, 0x56, 0x45, 0x10, 0xe9, 0x08, 0x12, 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43, 0x4b,
0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x57, 0x49, 0x4e, 0x53,
0x4f, 0x43, 0x4f, 0x52, 0x45, 0x10, 0xea, 0x08, 0x12, 0x19, 0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b,
0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x44, 0x41, 0x54, 0x41,
0x10, 0xeb, 0x08, 0x12, 0x21, 0x0a, 0x1c, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x44, 0x57,
0x5f, 0x54, 0x68, 0x69, 0x72, 0x64, 0x52, 0x65, 0x62, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x73, 0x73,
0x61, 0x67, 0x65, 0x10, 0xec, 0x08, 0x12, 0x24, 0x0a, 0x1f, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54,
0x5f, 0x57, 0x44, 0x5f, 0x41, 0x43, 0x4b, 0x54, 0x68, 0x69, 0x72, 0x64, 0x52, 0x65, 0x62, 0x61,
0x74, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x10, 0xed, 0x08, 0x12, 0x20, 0x0a, 0x1b,
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x44, 0x57, 0x5f, 0x54, 0x68, 0x69, 0x72, 0x64, 0x52,
0x6f, 0x75, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x10, 0xee, 0x08, 0x12, 0x1f,
0x0a, 0x1a, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x52, 0x5f, 0x49, 0x4e, 0x56, 0x49,
0x54, 0x45, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x52, 0x4f, 0x4f, 0x4d, 0x10, 0xef, 0x08, 0x12,
0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x52, 0x5f, 0x4c, 0x6f, 0x67,
0x69, 0x6e, 0x52, 0x65, 0x63, 0x10, 0xf0, 0x08, 0x12, 0x19, 0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b,
0x45, 0x54, 0x5f, 0x57, 0x52, 0x5f, 0x47, 0x61, 0x6d, 0x65, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c,
0x10, 0xf1, 0x08, 0x12, 0x19, 0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x52,
0x5f, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x10, 0xf2, 0x08, 0x12, 0x1a,
0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f, 0x50, 0x6c, 0x61, 0x79,
0x65, 0x72, 0x4c, 0x45, 0x41, 0x56, 0x45, 0x10, 0xf3, 0x08, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41,
0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f, 0x57, 0x42, 0x43, 0x74, 0x72, 0x6c, 0x43, 0x66,
0x67, 0x10, 0xf4, 0x08, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47,
0x4e, 0x5f, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x43, 0x41, 0x52, 0x44, 0x53, 0x10, 0xdc, 0x0b,
0x12, 0x1b, 0x0a, 0x16, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f, 0x52, 0x45,
0x42, 0x55, 0x49, 0x4c, 0x44, 0x53, 0x43, 0x45, 0x4e, 0x45, 0x10, 0xdd, 0x0b, 0x12, 0x1a, 0x0a,
0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f, 0x50, 0x4c, 0x41, 0x59, 0x45,
0x52, 0x53, 0x54, 0x41, 0x54, 0x45, 0x10, 0xde, 0x0b, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43,
0x4b, 0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f, 0x4e, 0x45, 0x57, 0x4e, 0x4f, 0x54, 0x49, 0x43, 0x45,
0x10, 0xdf, 0x0b, 0x12, 0x1b, 0x0a, 0x16, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x57,
0x5f, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x53, 0x54, 0x41, 0x54, 0x49, 0x43, 0x10, 0xe0, 0x0b,
0x12, 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f, 0x43, 0x4f,
0x49, 0x4e, 0x50, 0x4f, 0x4f, 0x4c, 0x53, 0x45, 0x54, 0x54, 0x49, 0x4e, 0x47, 0x10, 0xe1, 0x0b,
0x12, 0x22, 0x0a, 0x1d, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f, 0x53, 0x45,
0x54, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x42, 0x4c, 0x41, 0x43, 0x4b, 0x4c, 0x45, 0x56, 0x45,
0x4c, 0x10, 0xe2, 0x0b, 0x12, 0x21, 0x0a, 0x1c, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47,
0x57, 0x5f, 0x41, 0x55, 0x54, 0x4f, 0x52, 0x45, 0x4c, 0x49, 0x45, 0x56, 0x45, 0x57, 0x42, 0x4c,
0x45, 0x56, 0x45, 0x4c, 0x10, 0xe3, 0x0b, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45,
0x54, 0x5f, 0x47, 0x4e, 0x5f, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x50, 0x41, 0x52, 0x41, 0x4d,
0x10, 0xe4, 0x0b, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x57,
0x5f, 0x53, 0x43, 0x45, 0x4e, 0x45, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x4c, 0x4f, 0x47, 0x10,
0xe5, 0x0b, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f,
0x53, 0x59, 0x4e, 0x43, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x43, 0x4f, 0x49, 0x4e, 0x10, 0xe6,
0x0b, 0x12, 0x20, 0x0a, 0x1b, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f, 0x50,
0x6c, 0x61, 0x79, 0x65, 0x72, 0x4f, 0x6e, 0x47, 0x61, 0x6d, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74,
0x10, 0xea, 0x0b, 0x12, 0x1b, 0x0a, 0x16, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x52,
0x5f, 0x47, 0x61, 0x6d, 0x65, 0x46, 0x72, 0x65, 0x65, 0x44, 0x61, 0x74, 0x61, 0x10, 0xeb, 0x0b,
0x12, 0x24, 0x0a, 0x1f, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f, 0x53, 0x79,
0x6e, 0x63, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x53, 0x61, 0x66, 0x65, 0x42, 0x6f, 0x78, 0x43,
0x6f, 0x69, 0x6e, 0x10, 0xec, 0x0b, 0x12, 0x1c, 0x0a, 0x17, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54,
0x5f, 0x57, 0x47, 0x5f, 0x52, 0x45, 0x53, 0x45, 0x54, 0x43, 0x4f, 0x49, 0x4e, 0x50, 0x4f, 0x4f,
0x4c, 0x10, 0xed, 0x0b, 0x12, 0x1b, 0x0a, 0x16, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57,
0x47, 0x5f, 0x43, 0x4c, 0x55, 0x42, 0x5f, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x10, 0xee,
0x0b, 0x12, 0x1b, 0x0a, 0x16, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f, 0x47,
0x41, 0x4d, 0x45, 0x53, 0x54, 0x41, 0x54, 0x45, 0x4c, 0x4f, 0x47, 0x10, 0xef, 0x0b, 0x12, 0x18,
0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f, 0x47, 0x41, 0x4d, 0x45,
0x53, 0x54, 0x41, 0x54, 0x45, 0x10, 0xf0, 0x0b, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b,
0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f, 0x4a, 0x41, 0x43, 0x4b, 0x50, 0x4f, 0x54, 0x4c, 0x49, 0x53,
0x54, 0x10, 0xf1, 0x0b, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47,
0x57, 0x5f, 0x4a, 0x41, 0x43, 0x4b, 0x50, 0x4f, 0x54, 0x43, 0x4f, 0x49, 0x4e, 0x10, 0xf2, 0x0b,
0x12, 0x1b, 0x0a, 0x16, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f, 0x4e, 0x49,
0x43, 0x45, 0x49, 0x44, 0x52, 0x45, 0x42, 0x49, 0x4e, 0x44, 0x10, 0xf3, 0x0b, 0x12, 0x1c, 0x0a,
0x17, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f, 0x50, 0x4c, 0x41, 0x59, 0x45,
0x52, 0x57, 0x49, 0x4e, 0x43, 0x4f, 0x49, 0x4e, 0x10, 0xf4, 0x0b, 0x12, 0x20, 0x0a, 0x1b, 0x50,
0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x41,
0x55, 0x54, 0x4f, 0x4d, 0x41, 0x52, 0x4b, 0x54, 0x41, 0x47, 0x10, 0xf5, 0x0b, 0x12, 0x2b, 0x0a,
0x26, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f, 0x49, 0x4e, 0x56, 0x49, 0x54,
0x45, 0x52, 0x4f, 0x42, 0x45, 0x4e, 0x54, 0x45, 0x52, 0x43, 0x4f, 0x49, 0x4e, 0x53, 0x43, 0x45,
0x4e, 0x45, 0x51, 0x55, 0x45, 0x55, 0x45, 0x10, 0xf6, 0x0b, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41,
0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f, 0x47, 0x41, 0x4d, 0x45, 0x46, 0x4f, 0x52, 0x43,
0x45, 0x53, 0x54, 0x41, 0x52, 0x54, 0x10, 0xf7, 0x0b, 0x12, 0x24, 0x0a, 0x1f, 0x50, 0x41, 0x43,
0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f, 0x50, 0x52, 0x4f, 0x46, 0x49, 0x54, 0x43, 0x4f, 0x4e,
0x54, 0x52, 0x4f, 0x4c, 0x5f, 0x43, 0x4f, 0x52, 0x52, 0x45, 0x43, 0x54, 0x10, 0xf8, 0x0b, 0x12,
0x1f, 0x0a, 0x1a, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f, 0x43, 0x48, 0x41,
0x4e, 0x47, 0x45, 0x53, 0x43, 0x45, 0x4e, 0x45, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x10, 0xf9, 0x0b,
0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x54, 0x5f, 0x50, 0x4c,
0x41, 0x59, 0x45, 0x52, 0x50, 0x41, 0x59, 0x10, 0xfa, 0x0b, 0x12, 0x20, 0x0a, 0x1b, 0x50, 0x41,
0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x4d, 0x41,
0x54, 0x43, 0x48, 0x42, 0x49, 0x4c, 0x4c, 0x45, 0x44, 0x10, 0xfb, 0x0b, 0x12, 0x1f, 0x0a, 0x1a,
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52,
0x4d, 0x41, 0x54, 0x43, 0x48, 0x47, 0x52, 0x41, 0x44, 0x45, 0x10, 0xfc, 0x0b, 0x12, 0x1e, 0x0a, 0x4c, 0x45, 0x41, 0x56, 0x45, 0x10, 0xd0, 0x08, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b,
0x19, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f, 0x42, 0x49, 0x4c, 0x4c, 0x45, 0x44, 0x52, 0x4f, 0x4f, 0x4d,
0x52, 0x51, 0x55, 0x49, 0x54, 0x4d, 0x41, 0x54, 0x43, 0x48, 0x10, 0xfd, 0x0b, 0x12, 0x23, 0x0a, 0x43, 0x41, 0x52, 0x44, 0x10, 0xd1, 0x08, 0x12, 0x1b, 0x0a, 0x16, 0x50, 0x41, 0x43, 0x4b, 0x45,
0x1e, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f, 0x53, 0x43, 0x45, 0x4e, 0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f, 0x44, 0x45, 0x53, 0x54, 0x52, 0x4f, 0x59, 0x53, 0x43, 0x45, 0x4e,
0x4d, 0x41, 0x54, 0x43, 0x48, 0x42, 0x41, 0x53, 0x45, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x10, 0x45, 0x10, 0xd2, 0x08, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57,
0xfe, 0x0b, 0x12, 0x1f, 0x0a, 0x1a, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x53, 0x5f, 0x47, 0x5f, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x44, 0x52, 0x4f, 0x50, 0x4c, 0x49, 0x4e, 0x45,
0x52, 0x45, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x54, 0x4f, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x10, 0xd3, 0x08, 0x12, 0x1b, 0x0a, 0x16, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47,
0x10, 0xff, 0x0b, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x52, 0x45, 0x48, 0x4f, 0x4c, 0x44, 0x10, 0xd4, 0x08,
0x5f, 0x49, 0x4e, 0x56, 0x49, 0x54, 0x45, 0x4d, 0x41, 0x54, 0x43, 0x48, 0x52, 0x4f, 0x42, 0x10, 0x12, 0x20, 0x0a, 0x1b, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x47, 0x5f, 0x50, 0x4c,
0x80, 0x0c, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f, 0x41, 0x59, 0x45, 0x52, 0x53, 0x45, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x42, 0x49, 0x4e, 0x44, 0x10,
0x47, 0x41, 0x4d, 0x45, 0x4a, 0x41, 0x43, 0x4b, 0x50, 0x4f, 0x54, 0x10, 0x83, 0x0c, 0x12, 0x23, 0xd5, 0x08, 0x12, 0x22, 0x0a, 0x1d, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x47, 0x5f,
0x0a, 0x1e, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f, 0x50, 0x4c, 0x41, 0x59, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x53, 0x45, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x55, 0x4e, 0x42,
0x45, 0x52, 0x45, 0x4e, 0x54, 0x45, 0x52, 0x5f, 0x4d, 0x49, 0x4e, 0x49, 0x47, 0x41, 0x4d, 0x45, 0x49, 0x4e, 0x44, 0x10, 0xd6, 0x08, 0x12, 0x1b, 0x0a, 0x16, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54,
0x10, 0x85, 0x0c, 0x12, 0x23, 0x0a, 0x1e, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f, 0x57, 0x47, 0x5f, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x52, 0x45, 0x54, 0x55, 0x52, 0x4e,
0x5f, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x4c, 0x45, 0x41, 0x56, 0x45, 0x5f, 0x4d, 0x49, 0x4e, 0x10, 0xd7, 0x08, 0x12, 0x1b, 0x0a, 0x16, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x52,
0x49, 0x47, 0x41, 0x4d, 0x45, 0x10, 0x86, 0x0c, 0x12, 0x23, 0x0a, 0x1e, 0x50, 0x41, 0x43, 0x4b, 0x5f, 0x52, 0x45, 0x50, 0x4c, 0x41, 0x59, 0x52, 0x45, 0x43, 0x4f, 0x52, 0x44, 0x10, 0xd8, 0x08,
0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x4c, 0x45, 0x41, 0x56, 0x12, 0x16, 0x0a, 0x11, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f, 0x47, 0x41,
0x45, 0x5f, 0x4d, 0x49, 0x4e, 0x49, 0x47, 0x41, 0x4d, 0x45, 0x10, 0x87, 0x0c, 0x12, 0x1f, 0x0a, 0x4d, 0x45, 0x52, 0x45, 0x43, 0x10, 0xd9, 0x08, 0x12, 0x1c, 0x0a, 0x17, 0x50, 0x41, 0x43, 0x4b,
0x1a, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f, 0x44, 0x45, 0x53, 0x54, 0x52, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f, 0x41, 0x55, 0x44, 0x49, 0x45, 0x4e, 0x43, 0x45, 0x45, 0x4e,
0x4f, 0x59, 0x4d, 0x49, 0x4e, 0x49, 0x53, 0x43, 0x45, 0x4e, 0x45, 0x10, 0x88, 0x0c, 0x12, 0x1b, 0x54, 0x45, 0x52, 0x10, 0xda, 0x08, 0x12, 0x1c, 0x0a, 0x17, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54,
0x0a, 0x16, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x52, 0x5f, 0x44, 0x45, 0x53, 0x54, 0x5f, 0x47, 0x57, 0x5f, 0x41, 0x55, 0x44, 0x49, 0x45, 0x4e, 0x43, 0x45, 0x4c, 0x45, 0x41, 0x56,
0x52, 0x4f, 0x59, 0x53, 0x43, 0x45, 0x4e, 0x45, 0x10, 0x89, 0x0c, 0x12, 0x19, 0x0a, 0x14, 0x50, 0x45, 0x10, 0xdb, 0x08, 0x12, 0x19, 0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47,
0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f, 0x44, 0x54, 0x52, 0x4f, 0x4f, 0x4d, 0x49, 0x57, 0x5f, 0x53, 0x43, 0x45, 0x4e, 0x45, 0x53, 0x54, 0x41, 0x52, 0x54, 0x10, 0xdc, 0x08, 0x12,
0x4e, 0x46, 0x4f, 0x10, 0x8a, 0x0c, 0x12, 0x19, 0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x52, 0x5f, 0x49, 0x4e, 0x56,
0x5f, 0x47, 0x57, 0x5f, 0x44, 0x54, 0x52, 0x4f, 0x4f, 0x4d, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0x8b, 0x49, 0x54, 0x45, 0x52, 0x4f, 0x42, 0x4f, 0x54, 0x10, 0xdd, 0x08, 0x12, 0x21, 0x0a, 0x1c, 0x50,
0x0c, 0x12, 0x1c, 0x0a, 0x17, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f, 0x44, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f, 0x41, 0x47, 0x45, 0x4e, 0x54, 0x4b, 0x49,
0x54, 0x52, 0x4f, 0x4f, 0x4d, 0x52, 0x45, 0x53, 0x55, 0x4c, 0x54, 0x53, 0x10, 0x8c, 0x0c, 0x12, 0x43, 0x4b, 0x4f, 0x55, 0x54, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x10, 0xde, 0x08, 0x12, 0x1a,
0x1c, 0x0a, 0x17, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f, 0x44, 0x54, 0x52, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x44, 0x5f, 0x44, 0x41, 0x54, 0x41,
0x4f, 0x4f, 0x4d, 0x52, 0x45, 0x53, 0x55, 0x4c, 0x54, 0x53, 0x10, 0x8d, 0x0c, 0x12, 0x1b, 0x0a, 0x4e, 0x41, 0x4c, 0x59, 0x53, 0x49, 0x53, 0x10, 0xdf, 0x08, 0x12, 0x1c, 0x0a, 0x17, 0x50, 0x41,
0x16, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f, 0x53, 0x49, 0x4e, 0x47, 0x4c, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f, 0x43, 0x4c, 0x55, 0x42, 0x42, 0x49, 0x4c, 0x4c,
0x45, 0x41, 0x44, 0x4a, 0x55, 0x53, 0x54, 0x10, 0x8e, 0x0c, 0x12, 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x4d, 0x4f, 0x4e, 0x45, 0x59, 0x10, 0xe1, 0x08, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b,
0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f, 0x41, 0x44, 0x44, 0x53, 0x49, 0x4e, 0x47, 0x4c, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f, 0x52, 0x45, 0x42, 0x49, 0x4e, 0x44, 0x5f, 0x53, 0x4e, 0x49,
0x45, 0x41, 0x44, 0x4a, 0x55, 0x53, 0x54, 0x10, 0x8f, 0x0c, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x44, 0x10, 0xe2, 0x08, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57,
0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f, 0x42, 0x55, 0x59, 0x52, 0x45, 0x43, 0x54, 0x49, 0x47, 0x5f, 0x41, 0x55, 0x44, 0x49, 0x45, 0x4e, 0x43, 0x45, 0x53, 0x49, 0x54, 0x10, 0xe3, 0x08,
0x4d, 0x45, 0x49, 0x54, 0x45, 0x4d, 0x10, 0x90, 0x0c, 0x12, 0x19, 0x0a, 0x14, 0x50, 0x41, 0x43, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f, 0x52, 0x45,
0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x6b, 0x69, 0x43, 0x48, 0x41, 0x52, 0x47, 0x45, 0x10, 0xe4, 0x08, 0x12, 0x19, 0x0a, 0x14, 0x50, 0x41, 0x43,
0x6e, 0x10, 0x91, 0x0c, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x50, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f, 0x53, 0x43, 0x45, 0x4e, 0x45, 0x53, 0x54, 0x41, 0x54,
0x6c, 0x61, 0x79, 0x65, 0x72, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x45, 0x10, 0xe5, 0x08, 0x12, 0x21, 0x0a, 0x1c, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57,
0x10, 0x92, 0x0c, 0x42, 0x26, 0x5a, 0x24, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x2e, 0x67, 0x61, 0x6d, 0x47, 0x5f, 0x47, 0x52, 0x41, 0x43, 0x45, 0x5f, 0x44, 0x45, 0x53, 0x54, 0x52, 0x4f, 0x59, 0x53,
0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x61, 0x6d, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x43, 0x45, 0x4e, 0x45, 0x10, 0xe6, 0x08, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45,
0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x54, 0x5f, 0x47, 0x57, 0x5f, 0x53, 0x43, 0x45, 0x4e, 0x45, 0x45, 0x4e, 0x44, 0x10, 0xe7, 0x08,
0x74, 0x6f, 0x33, 0x12, 0x19, 0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f, 0x46, 0x49,
0x53, 0x48, 0x52, 0x45, 0x43, 0x4f, 0x52, 0x44, 0x10, 0xe8, 0x08, 0x12, 0x1f, 0x0a, 0x1a, 0x50,
0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x46,
0x4f, 0x52, 0x43, 0x45, 0x4c, 0x45, 0x41, 0x56, 0x45, 0x10, 0xe9, 0x08, 0x12, 0x1e, 0x0a, 0x19,
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52,
0x57, 0x49, 0x4e, 0x53, 0x4f, 0x43, 0x4f, 0x52, 0x45, 0x10, 0xea, 0x08, 0x12, 0x19, 0x0a, 0x14,
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52,
0x44, 0x41, 0x54, 0x41, 0x10, 0xeb, 0x08, 0x12, 0x21, 0x0a, 0x1c, 0x50, 0x41, 0x43, 0x4b, 0x45,
0x54, 0x5f, 0x44, 0x57, 0x5f, 0x54, 0x68, 0x69, 0x72, 0x64, 0x52, 0x65, 0x62, 0x61, 0x74, 0x65,
0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x10, 0xec, 0x08, 0x12, 0x24, 0x0a, 0x1f, 0x50, 0x41,
0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x44, 0x5f, 0x41, 0x43, 0x4b, 0x54, 0x68, 0x69, 0x72, 0x64,
0x52, 0x65, 0x62, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x10, 0xed, 0x08,
0x12, 0x20, 0x0a, 0x1b, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x44, 0x57, 0x5f, 0x54, 0x68,
0x69, 0x72, 0x64, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x10,
0xee, 0x08, 0x12, 0x1f, 0x0a, 0x1a, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x52, 0x5f,
0x49, 0x4e, 0x56, 0x49, 0x54, 0x45, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x52, 0x4f, 0x4f, 0x4d,
0x10, 0xef, 0x08, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x52,
0x5f, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x63, 0x10, 0xf0, 0x08, 0x12, 0x19, 0x0a, 0x14,
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x52, 0x5f, 0x47, 0x61, 0x6d, 0x65, 0x44, 0x65,
0x74, 0x61, 0x69, 0x6c, 0x10, 0xf1, 0x08, 0x12, 0x19, 0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45,
0x54, 0x5f, 0x57, 0x52, 0x5f, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x10,
0xf2, 0x08, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f,
0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4c, 0x45, 0x41, 0x56, 0x45, 0x10, 0xf3, 0x08, 0x12, 0x18,
0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f, 0x57, 0x42, 0x43, 0x74,
0x72, 0x6c, 0x43, 0x66, 0x67, 0x10, 0xf4, 0x08, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b,
0x45, 0x54, 0x5f, 0x47, 0x4e, 0x5f, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x43, 0x41, 0x52, 0x44,
0x53, 0x10, 0xdc, 0x0b, 0x12, 0x1b, 0x0a, 0x16, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47,
0x57, 0x5f, 0x52, 0x45, 0x42, 0x55, 0x49, 0x4c, 0x44, 0x53, 0x43, 0x45, 0x4e, 0x45, 0x10, 0xdd,
0x0b, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f, 0x50,
0x4c, 0x41, 0x59, 0x45, 0x52, 0x53, 0x54, 0x41, 0x54, 0x45, 0x10, 0xde, 0x0b, 0x12, 0x18, 0x0a,
0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f, 0x4e, 0x45, 0x57, 0x4e, 0x4f,
0x54, 0x49, 0x43, 0x45, 0x10, 0xdf, 0x0b, 0x12, 0x1b, 0x0a, 0x16, 0x50, 0x41, 0x43, 0x4b, 0x45,
0x54, 0x5f, 0x47, 0x57, 0x5f, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x53, 0x54, 0x41, 0x54, 0x49,
0x43, 0x10, 0xe0, 0x0b, 0x12, 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57,
0x47, 0x5f, 0x43, 0x4f, 0x49, 0x4e, 0x50, 0x4f, 0x4f, 0x4c, 0x53, 0x45, 0x54, 0x54, 0x49, 0x4e,
0x47, 0x10, 0xe1, 0x0b, 0x12, 0x22, 0x0a, 0x1d, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57,
0x47, 0x5f, 0x53, 0x45, 0x54, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x42, 0x4c, 0x41, 0x43, 0x4b,
0x4c, 0x45, 0x56, 0x45, 0x4c, 0x10, 0xe2, 0x0b, 0x12, 0x21, 0x0a, 0x1c, 0x50, 0x41, 0x43, 0x4b,
0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f, 0x41, 0x55, 0x54, 0x4f, 0x52, 0x45, 0x4c, 0x49, 0x45, 0x56,
0x45, 0x57, 0x42, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x10, 0xe3, 0x0b, 0x12, 0x1a, 0x0a, 0x15, 0x50,
0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x4e, 0x5f, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x50,
0x41, 0x52, 0x41, 0x4d, 0x10, 0xe4, 0x0b, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45,
0x54, 0x5f, 0x47, 0x57, 0x5f, 0x53, 0x43, 0x45, 0x4e, 0x45, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52,
0x4c, 0x4f, 0x47, 0x10, 0xe5, 0x0b, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54,
0x5f, 0x47, 0x57, 0x5f, 0x53, 0x59, 0x4e, 0x43, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x43, 0x4f,
0x49, 0x4e, 0x10, 0xe6, 0x0b, 0x12, 0x20, 0x0a, 0x1b, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f,
0x57, 0x47, 0x5f, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4f, 0x6e, 0x47, 0x61, 0x6d, 0x65, 0x43,
0x6f, 0x75, 0x6e, 0x74, 0x10, 0xea, 0x0b, 0x12, 0x1b, 0x0a, 0x16, 0x50, 0x41, 0x43, 0x4b, 0x45,
0x54, 0x5f, 0x47, 0x52, 0x5f, 0x47, 0x61, 0x6d, 0x65, 0x46, 0x72, 0x65, 0x65, 0x44, 0x61, 0x74,
0x61, 0x10, 0xeb, 0x0b, 0x12, 0x24, 0x0a, 0x1f, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57,
0x47, 0x5f, 0x53, 0x79, 0x6e, 0x63, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x53, 0x61, 0x66, 0x65,
0x42, 0x6f, 0x78, 0x43, 0x6f, 0x69, 0x6e, 0x10, 0xec, 0x0b, 0x12, 0x1c, 0x0a, 0x17, 0x50, 0x41,
0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f, 0x52, 0x45, 0x53, 0x45, 0x54, 0x43, 0x4f, 0x49,
0x4e, 0x50, 0x4f, 0x4f, 0x4c, 0x10, 0xed, 0x0b, 0x12, 0x1b, 0x0a, 0x16, 0x50, 0x41, 0x43, 0x4b,
0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f, 0x43, 0x4c, 0x55, 0x42, 0x5f, 0x4d, 0x45, 0x53, 0x53, 0x41,
0x47, 0x45, 0x10, 0xee, 0x0b, 0x12, 0x1b, 0x0a, 0x16, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f,
0x47, 0x57, 0x5f, 0x47, 0x41, 0x4d, 0x45, 0x53, 0x54, 0x41, 0x54, 0x45, 0x4c, 0x4f, 0x47, 0x10,
0xef, 0x0b, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f,
0x47, 0x41, 0x4d, 0x45, 0x53, 0x54, 0x41, 0x54, 0x45, 0x10, 0xf0, 0x0b, 0x12, 0x1a, 0x0a, 0x15,
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f, 0x4a, 0x41, 0x43, 0x4b, 0x50, 0x4f,
0x54, 0x4c, 0x49, 0x53, 0x54, 0x10, 0xf1, 0x0b, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b,
0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f, 0x4a, 0x41, 0x43, 0x4b, 0x50, 0x4f, 0x54, 0x43, 0x4f, 0x49,
0x4e, 0x10, 0xf2, 0x0b, 0x12, 0x1b, 0x0a, 0x16, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47,
0x57, 0x5f, 0x4e, 0x49, 0x43, 0x45, 0x49, 0x44, 0x52, 0x45, 0x42, 0x49, 0x4e, 0x44, 0x10, 0xf3,
0x0b, 0x12, 0x1c, 0x0a, 0x17, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f, 0x50,
0x4c, 0x41, 0x59, 0x45, 0x52, 0x57, 0x49, 0x4e, 0x43, 0x4f, 0x49, 0x4e, 0x10, 0xf4, 0x0b, 0x12,
0x20, 0x0a, 0x1b, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f, 0x50, 0x4c, 0x41,
0x59, 0x45, 0x52, 0x41, 0x55, 0x54, 0x4f, 0x4d, 0x41, 0x52, 0x4b, 0x54, 0x41, 0x47, 0x10, 0xf5,
0x0b, 0x12, 0x2b, 0x0a, 0x26, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f, 0x49,
0x4e, 0x56, 0x49, 0x54, 0x45, 0x52, 0x4f, 0x42, 0x45, 0x4e, 0x54, 0x45, 0x52, 0x43, 0x4f, 0x49,
0x4e, 0x53, 0x43, 0x45, 0x4e, 0x45, 0x51, 0x55, 0x45, 0x55, 0x45, 0x10, 0xf6, 0x0b, 0x12, 0x1d,
0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f, 0x47, 0x41, 0x4d, 0x45,
0x46, 0x4f, 0x52, 0x43, 0x45, 0x53, 0x54, 0x41, 0x52, 0x54, 0x10, 0xf7, 0x0b, 0x12, 0x24, 0x0a,
0x1f, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f, 0x50, 0x52, 0x4f, 0x46, 0x49,
0x54, 0x43, 0x4f, 0x4e, 0x54, 0x52, 0x4f, 0x4c, 0x5f, 0x43, 0x4f, 0x52, 0x52, 0x45, 0x43, 0x54,
0x10, 0xf8, 0x0b, 0x12, 0x1f, 0x0a, 0x1a, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x57,
0x5f, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x53, 0x43, 0x45, 0x4e, 0x45, 0x45, 0x56, 0x45, 0x4e,
0x54, 0x10, 0xf9, 0x0b, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57,
0x54, 0x5f, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x50, 0x41, 0x59, 0x10, 0xfa, 0x0b, 0x12, 0x20,
0x0a, 0x1b, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f, 0x50, 0x4c, 0x41, 0x59,
0x45, 0x52, 0x4d, 0x41, 0x54, 0x43, 0x48, 0x42, 0x49, 0x4c, 0x4c, 0x45, 0x44, 0x10, 0xfb, 0x0b,
0x12, 0x1f, 0x0a, 0x1a, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f, 0x50, 0x4c,
0x41, 0x59, 0x45, 0x52, 0x4d, 0x41, 0x54, 0x43, 0x48, 0x47, 0x52, 0x41, 0x44, 0x45, 0x10, 0xfc,
0x0b, 0x12, 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f, 0x50,
0x4c, 0x41, 0x59, 0x45, 0x52, 0x51, 0x55, 0x49, 0x54, 0x4d, 0x41, 0x54, 0x43, 0x48, 0x10, 0xfd,
0x0b, 0x12, 0x23, 0x0a, 0x1e, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f, 0x53,
0x43, 0x45, 0x4e, 0x45, 0x4d, 0x41, 0x54, 0x43, 0x48, 0x42, 0x41, 0x53, 0x45, 0x43, 0x48, 0x41,
0x4e, 0x47, 0x45, 0x10, 0xfe, 0x0b, 0x12, 0x1f, 0x0a, 0x1a, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54,
0x5f, 0x53, 0x53, 0x5f, 0x52, 0x45, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x54, 0x4f, 0x50, 0x4c,
0x41, 0x59, 0x45, 0x52, 0x10, 0xff, 0x0b, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45,
0x54, 0x5f, 0x57, 0x47, 0x5f, 0x49, 0x4e, 0x56, 0x49, 0x54, 0x45, 0x4d, 0x41, 0x54, 0x43, 0x48,
0x52, 0x4f, 0x42, 0x10, 0x80, 0x0c, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54,
0x5f, 0x57, 0x47, 0x5f, 0x47, 0x41, 0x4d, 0x45, 0x4a, 0x41, 0x43, 0x4b, 0x50, 0x4f, 0x54, 0x10,
0x83, 0x0c, 0x12, 0x23, 0x0a, 0x1e, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f,
0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x45, 0x4e, 0x54, 0x45, 0x52, 0x5f, 0x4d, 0x49, 0x4e, 0x49,
0x47, 0x41, 0x4d, 0x45, 0x10, 0x85, 0x0c, 0x12, 0x23, 0x0a, 0x1e, 0x50, 0x41, 0x43, 0x4b, 0x45,
0x54, 0x5f, 0x57, 0x47, 0x5f, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x4c, 0x45, 0x41, 0x56, 0x45,
0x5f, 0x4d, 0x49, 0x4e, 0x49, 0x47, 0x41, 0x4d, 0x45, 0x10, 0x86, 0x0c, 0x12, 0x23, 0x0a, 0x1e,
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52,
0x4c, 0x45, 0x41, 0x56, 0x45, 0x5f, 0x4d, 0x49, 0x4e, 0x49, 0x47, 0x41, 0x4d, 0x45, 0x10, 0x87,
0x0c, 0x12, 0x1f, 0x0a, 0x1a, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f, 0x44,
0x45, 0x53, 0x54, 0x52, 0x4f, 0x59, 0x4d, 0x49, 0x4e, 0x49, 0x53, 0x43, 0x45, 0x4e, 0x45, 0x10,
0x88, 0x0c, 0x12, 0x1b, 0x0a, 0x16, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x52, 0x5f,
0x44, 0x45, 0x53, 0x54, 0x52, 0x4f, 0x59, 0x53, 0x43, 0x45, 0x4e, 0x45, 0x10, 0x89, 0x0c, 0x12,
0x19, 0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f, 0x44, 0x54, 0x52,
0x4f, 0x4f, 0x4d, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0x8a, 0x0c, 0x12, 0x19, 0x0a, 0x14, 0x50, 0x41,
0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f, 0x44, 0x54, 0x52, 0x4f, 0x4f, 0x4d, 0x49, 0x4e,
0x46, 0x4f, 0x10, 0x8b, 0x0c, 0x12, 0x1c, 0x0a, 0x17, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f,
0x57, 0x47, 0x5f, 0x44, 0x54, 0x52, 0x4f, 0x4f, 0x4d, 0x52, 0x45, 0x53, 0x55, 0x4c, 0x54, 0x53,
0x10, 0x8c, 0x0c, 0x12, 0x1c, 0x0a, 0x17, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x57,
0x5f, 0x44, 0x54, 0x52, 0x4f, 0x4f, 0x4d, 0x52, 0x45, 0x53, 0x55, 0x4c, 0x54, 0x53, 0x10, 0x8d,
0x0c, 0x12, 0x1b, 0x0a, 0x16, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f, 0x53,
0x49, 0x4e, 0x47, 0x4c, 0x45, 0x41, 0x44, 0x4a, 0x55, 0x53, 0x54, 0x10, 0x8e, 0x0c, 0x12, 0x1e,
0x0a, 0x19, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x57, 0x5f, 0x41, 0x44, 0x44, 0x53,
0x49, 0x4e, 0x47, 0x4c, 0x45, 0x41, 0x44, 0x4a, 0x55, 0x53, 0x54, 0x10, 0x8f, 0x0c, 0x12, 0x1d,
0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f, 0x42, 0x55, 0x59, 0x52,
0x45, 0x43, 0x54, 0x49, 0x4d, 0x45, 0x49, 0x54, 0x45, 0x4d, 0x10, 0x90, 0x0c, 0x12, 0x19, 0x0a,
0x14, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x57, 0x47, 0x5f, 0x55, 0x70, 0x64, 0x61, 0x74,
0x65, 0x53, 0x6b, 0x69, 0x6e, 0x10, 0x91, 0x0c, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b,
0x45, 0x54, 0x5f, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x49,
0x74, 0x65, 0x6d, 0x73, 0x10, 0x92, 0x0c, 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, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
@ -10311,11 +10321,12 @@ var file_server_proto_depIdxs = []int32{
97, // 32: server.WGGameJackpot.Info:type_name -> server.GameInfo 97, // 32: server.WGGameJackpot.Info:type_name -> server.GameInfo
108, // 33: server.GWDTRoomInfo.Players:type_name -> server.PlayerDTCoin 108, // 33: server.GWDTRoomInfo.Players:type_name -> server.PlayerDTCoin
109, // 34: server.GWDTRoomInfo.Results:type_name -> server.EResult 109, // 34: server.GWDTRoomInfo.Results:type_name -> server.EResult
35, // [35:35] is the sub-list for method output_type 10, // 35: server.PlayerChangeItems.Items:type_name -> server.Item
35, // [35:35] is the sub-list for method input_type 36, // [36:36] is the sub-list for method output_type
35, // [35:35] is the sub-list for extension type_name 36, // [36:36] is the sub-list for method input_type
35, // [35:35] is the sub-list for extension extendee 36, // [36:36] is the sub-list for extension type_name
0, // [0:35] is the sub-list for field type_name 36, // [36:36] is the sub-list for extension extendee
0, // [0:36] is the sub-list for field type_name
} }
func init() { file_server_proto_init() } func init() { file_server_proto_init() }

View File

@ -1021,5 +1021,6 @@ message WGUpdateSkin{
// PACKET_PlayerChangeItems // PACKET_PlayerChangeItems
message PlayerChangeItems{ message PlayerChangeItems{
bytes Data = 1; int32 SnId = 1;
repeated Item Items = 2; //
} }

View File

@ -71,18 +71,11 @@ func CSUpBagInfo(s *netlib.Session, packetid int, data interface{}, sid int64) e
if common.Config.IsDevMode { if common.Config.IsDevMode {
if msg.GetOpt() == -1 { if msg.GetOpt() == -1 {
items := []*model.Item{{ items := []*Item{{
ItemId: msg.ItemId, ItemId: msg.ItemId,
ItemNum: int64(msg.ItemNum), ItemNum: int64(msg.ItemNum),
}} }}
BagMgrSingleton.AddItems(&model.AddItemParam{ BagMgrSingleton.AddItems(p, items, 0, common.GainWay_ItemUse, "system", "测试", 0, 0, false)
Platform: p.Platform,
SnId: p.SnId,
Change: items,
GainWay: common.GainWay_ItemUse,
Operator: "system",
Remark: "测试",
})
return nil return nil
} }
} }
@ -118,7 +111,7 @@ func CSUpBagInfo(s *netlib.Session, packetid int, data interface{}, sid int64) e
case ItemCanUse: case ItemCanUse:
logger.Logger.Trace("道具使用", msg.ItemId) logger.Logger.Trace("道具使用", msg.ItemId)
items := map[int32]*model.Item{} items := map[int32]*Item{}
var useFunc func() var useFunc func()
saleFunc := func(gainWay int32, oper, remark string) { saleFunc := func(gainWay int32, oper, remark string) {
if gainWay == 0 { if gainWay == 0 {
@ -131,19 +124,7 @@ func CSUpBagInfo(s *netlib.Session, packetid int, data interface{}, sid int64) e
remark = "道具使用" remark = "道具使用"
} }
// 使用道具,减少道具 // 使用道具,减少道具
BagMgrSingleton.AddItems(&model.AddItemParam{ BagMgrSingleton.AddItem(p, int64(item.ItemId), int64(-msg.ItemNum), 0, gainWay, oper, remark, 0, 0, false)
Platform: p.Platform,
SnId: p.SnId,
Change: []*model.Item{
{
ItemId: item.ItemId,
ItemNum: int64(-msg.ItemNum),
},
},
GainWay: gainWay,
Operator: oper,
Remark: remark,
})
pack.RetCode = bag.OpResultCode_OPRC_Sucess pack.RetCode = bag.OpResultCode_OPRC_Sucess
pack.NowItemId = item.ItemId pack.NowItemId = item.ItemId
pack.NowItemNum = item.ItemNum pack.NowItemNum = item.ItemNum
@ -162,18 +143,11 @@ func CSUpBagInfo(s *netlib.Session, packetid int, data interface{}, sid int64) e
remark = "道具使用" remark = "道具使用"
} }
if len(items) > 0 { if len(items) > 0 {
var itemArr []*model.Item var itemArr []*Item
for _, v := range items { for _, v := range items {
itemArr = append(itemArr, v) itemArr = append(itemArr, v)
} }
BagMgrSingleton.AddItems(&model.AddItemParam{ BagMgrSingleton.AddItems(p, itemArr, 0, gainWay, oper, remark, 0, 0, false)
Platform: p.Platform,
SnId: p.SnId,
Change: itemArr,
GainWay: gainWay,
Operator: oper,
Remark: remark,
})
for _, v := range itemArr { for _, v := range itemArr {
pack.Infos = append(pack.Infos, &bag.ItemInfo{ pack.Infos = append(pack.Infos, &bag.ItemInfo{
ItemId: v.ItemId, ItemId: v.ItemId,
@ -216,7 +190,7 @@ func CSUpBagInfo(s *netlib.Session, packetid int, data interface{}, sid int64) e
if vv > 0 { if vv > 0 {
item, ok := items[int32(k)] item, ok := items[int32(k)]
if !ok { if !ok {
items[int32(k)] = &model.Item{ items[int32(k)] = &Item{
ItemId: int32(k), ItemId: int32(k),
ItemNum: vv, ItemNum: vv,
ObtainTime: ts, ObtainTime: ts,
@ -250,7 +224,7 @@ func CSUpBagInfo(s *netlib.Session, packetid int, data interface{}, sid int64) e
if vv > 0 { if vv > 0 {
item, ok := items[int32(k)] item, ok := items[int32(k)]
if !ok { if !ok {
items[int32(k)] = &model.Item{ items[int32(k)] = &Item{
ItemId: int32(k), ItemId: int32(k),
ItemNum: vv, ItemNum: vv,
ObtainTime: ts, ObtainTime: ts,
@ -278,19 +252,8 @@ func CSUpBagInfo(s *netlib.Session, packetid int, data interface{}, sid int64) e
logger.Logger.Trace("道具赠送成功", msg.ItemId) logger.Logger.Trace("道具赠送成功", msg.ItemId)
remark := fmt.Sprintf("赠送给玩家(%v)", msg.AcceptSnId) remark := fmt.Sprintf("赠送给玩家(%v)", msg.AcceptSnId)
BagMgrSingleton.AddMailByItem(p.Platform, p.SnId, p.Name, msg.AcceptSnId, msg.ShowId, []int32{msg.ItemId, msg.ItemNum}) BagMgrSingleton.AddMailByItem(p.Platform, p.SnId, p.Name, msg.AcceptSnId, msg.ShowId, []int32{msg.ItemId, msg.ItemNum})
BagMgrSingleton.AddItems(&model.AddItemParam{ BagMgrSingleton.AddItem(p, int64(item.ItemId), int64(-msg.ItemNum), 0, common.GainWay_ItemMove,
Platform: p.Platform, "player", remark, 0, 0, false)
SnId: p.SnId,
Change: []*model.Item{
{
ItemId: item.ItemId,
ItemNum: int64(-msg.ItemNum),
},
},
GainWay: common.GainWay_ItemMove,
Operator: "player",
Remark: remark,
})
pack.RetCode = bag.OpResultCode_OPRC_Sucess pack.RetCode = bag.OpResultCode_OPRC_Sucess
pack.NowItemId = msg.ItemId pack.NowItemId = msg.ItemId
pack.NowItemNum = item.ItemNum pack.NowItemNum = item.ItemNum
@ -303,19 +266,8 @@ func CSUpBagInfo(s *netlib.Session, packetid int, data interface{}, sid int64) e
logger.Logger.Trace("道具赠送成功", msg.ItemId) logger.Logger.Trace("道具赠送成功", msg.ItemId)
remark := fmt.Sprintf("赠送给玩家(%v)", msg.AcceptSnId) remark := fmt.Sprintf("赠送给玩家(%v)", msg.AcceptSnId)
BagMgrSingleton.AddMailByItem(p.Platform, p.SnId, p.Name, msg.AcceptSnId, msg.ShowId, []int32{msg.ItemId, msg.ItemNum}) BagMgrSingleton.AddMailByItem(p.Platform, p.SnId, p.Name, msg.AcceptSnId, msg.ShowId, []int32{msg.ItemId, msg.ItemNum})
BagMgrSingleton.AddItems(&model.AddItemParam{ BagMgrSingleton.AddItem(p, int64(item.ItemId), int64(-msg.ItemNum), 0, common.GainWay_ItemMove,
Platform: p.Platform, "player", remark, 0, 0, false)
SnId: p.SnId,
Change: []*model.Item{
{
ItemId: item.ItemId,
ItemNum: int64(-msg.ItemNum),
},
},
GainWay: common.GainWay_ItemMove,
Operator: "player",
Remark: remark,
})
pack.RetCode = bag.OpResultCode_OPRC_Sucess pack.RetCode = bag.OpResultCode_OPRC_Sucess
pack.NowItemId = msg.ItemId pack.NowItemId = msg.ItemId
pack.NowItemNum = item.ItemNum pack.NowItemNum = item.ItemNum
@ -331,19 +283,7 @@ func CSUpBagInfo(s *netlib.Session, packetid int, data interface{}, sid int64) e
logger.Logger.Trace("道具出售", msg.ItemId) logger.Logger.Trace("道具出售", msg.ItemId)
if msg.ItemNum > 0 { if msg.ItemNum > 0 {
remark := "道具出售" + fmt.Sprintf("%v-%v", msg.ItemId, msg.ItemNum) remark := "道具出售" + fmt.Sprintf("%v-%v", msg.ItemId, msg.ItemNum)
_, _, isF := BagMgrSingleton.AddItems(&model.AddItemParam{ _, _, isF := BagMgrSingleton.AddItem(p, int64(msg.ItemId), int64(-msg.ItemNum), 0, common.GainWay_Item_Sale, "sys", remark, 0, 0, false)
Platform: p.Platform,
SnId: p.SnId,
Change: []*model.Item{
{
ItemId: item.ItemId,
ItemNum: int64(-msg.ItemNum),
},
},
GainWay: common.GainWay_Item_Sale,
Operator: "player",
Remark: remark,
})
if isF { if isF {
pack.RetCode = bag.OpResultCode_OPRC_Sucess pack.RetCode = bag.OpResultCode_OPRC_Sucess
if item.SaleGold > 0 { if item.SaleGold > 0 {
@ -369,9 +309,8 @@ func CSUpBagInfo(s *netlib.Session, packetid int, data interface{}, sid int64) e
send() send()
return nil return nil
} }
bagInfo, _, isF := BagMgrSingleton.AddItems(&model.AddItemParam{ bagInfo, _, isF := BagMgrSingleton.AddItemsV2(&model.AddItemParam{
Platform: p.Platform, P: p.PlayerData,
SnId: p.SnId,
Change: []*model.Item{ Change: []*model.Item{
{ {
ItemId: msg.GetItemId(), ItemId: msg.GetItemId(),
@ -381,6 +320,7 @@ func CSUpBagInfo(s *netlib.Session, packetid int, data interface{}, sid int64) e
GainWay: common.GainWayItemChange, GainWay: common.GainWayItemChange,
Operator: "system", Operator: "system",
Remark: "背包内使用兑换", Remark: "背包内使用兑换",
NoLog: false,
}) })
if isF { if isF {
pack.RetCode = bag.OpResultCode_OPRC_Sucess pack.RetCode = bag.OpResultCode_OPRC_Sucess
@ -394,9 +334,8 @@ func CSUpBagInfo(s *netlib.Session, packetid int, data interface{}, sid int64) e
logger.Logger.Trace("道具分解", msg.ItemId) logger.Logger.Trace("道具分解", msg.ItemId)
itemInfo := srvdata.GameItemMgr.Get(p.Platform, msg.ItemId) itemInfo := srvdata.GameItemMgr.Get(p.Platform, msg.ItemId)
if msg.ItemNum > 0 && itemInfo != nil { if msg.ItemNum > 0 && itemInfo != nil {
_, _, isF := BagMgrSingleton.AddItems(&model.AddItemParam{ _, _, isF := BagMgrSingleton.AddItemsV2(&model.AddItemParam{
Platform: p.Platform, P: p.PlayerData,
SnId: p.SnId,
Change: []*model.Item{ Change: []*model.Item{
{ {
ItemId: msg.GetItemId(), ItemId: msg.GetItemId(),
@ -406,6 +345,7 @@ func CSUpBagInfo(s *netlib.Session, packetid int, data interface{}, sid int64) e
GainWay: common.GainWayItemFen, GainWay: common.GainWayItemFen,
Operator: "system", Operator: "system",
Remark: fmt.Sprintf("道具分解%v", msg.GetItemId()), Remark: fmt.Sprintf("道具分解%v", msg.GetItemId()),
NoLog: false,
}) })
if isF { if isF {
pack.RetCode = bag.OpResultCode_OPRC_Sucess pack.RetCode = bag.OpResultCode_OPRC_Sucess
@ -418,10 +358,9 @@ func CSUpBagInfo(s *netlib.Session, packetid int, data interface{}, sid int64) e
}) })
} }
} }
BagMgrSingleton.AddItems(&model.AddItemParam{ BagMgrSingleton.AddItemsV2(&model.AddItemParam{
Platform: p.Platform, P: p.PlayerData,
SnId: p.SnId, Change: changeItems,
Change: changeItems,
Cost: []*model.Item{ Cost: []*model.Item{
{ {
ItemId: msg.GetItemId(), ItemId: msg.GetItemId(),
@ -513,8 +452,8 @@ func CSPropExchange(s *netlib.Session, packetid int, data interface{}, sid int64
return nil return nil
} }
// 检查背包是否足够 // 检查背包是否足够
var items []*model.Item var items []*Item
var costItems []*model.Item var costItems []*Item
for k, v := range info.GetCost() { for k, v := range info.GetCost() {
item := BagMgrSingleton.GetItem(p.SnId, int32(k)) item := BagMgrSingleton.GetItem(p.SnId, int32(k))
if item == nil || item.ItemNum < v { if item == nil || item.ItemNum < v {
@ -523,46 +462,29 @@ func CSPropExchange(s *netlib.Session, packetid int, data interface{}, sid int64
} }
info := srvdata.GameItemMgr.Get(p.Platform, int32(k)) info := srvdata.GameItemMgr.Get(p.Platform, int32(k))
if info != nil { if info != nil {
costItems = append(costItems, &model.Item{ costItems = append(costItems, &Item{
ItemId: int32(k), ItemId: int32(k),
ItemNum: v, ItemNum: v,
Name: info.Name,
}) })
} }
} }
for k, v := range info.GetGain() { for k, v := range info.GetGain() {
info := srvdata.GameItemMgr.Get(p.Platform, int32(k)) info := srvdata.GameItemMgr.Get(p.Platform, int32(k))
if info != nil { if info != nil {
items = append(items, &model.Item{ items = append(items, &Item{
ItemId: int32(k), ItemId: int32(k),
ItemNum: v, ItemNum: v,
Name: info.Name,
}) })
} }
} }
// 扣除背包物品 // 扣除背包物品
for _, item := range costItems { for _, item := range costItems {
BagMgrSingleton.AddItems(&model.AddItemParam{ BagMgrSingleton.AddItem(p, int64(item.ItemId), -item.ItemNum, 0, common.GainWayItemCollectExchange, "system", "集卡活动兑换", 0, 0, false)
Platform: p.Platform,
SnId: p.SnId,
Change: []*model.Item{
{
ItemId: item.ItemId,
ItemNum: -item.ItemNum,
},
},
GainWay: common.GainWayItemCollectExchange,
Operator: "system",
Remark: "集卡活动兑换",
})
} }
// 增加背包物品 // 增加背包物品
BagMgrSingleton.AddItems(&model.AddItemParam{ BagMgrSingleton.AddItems(p, items, 0, common.GainWayItemCollectExchange, "system", "集卡活动兑换", 0, 0, false)
Platform: p.Platform,
SnId: p.SnId,
Change: items,
GainWay: common.GainWayItemCollectExchange,
Operator: "system",
Remark: "集卡活动兑换",
})
for _, v := range items { for _, v := range items {
pack.Items = append(pack.Items, &bag.PropInfo{ pack.Items = append(pack.Items, &bag.PropInfo{
ItemId: v.ItemId, ItemId: v.ItemId,
@ -608,9 +530,8 @@ func CSDollChange(s *netlib.Session, packetid int, data interface{}, sid int64)
return nil return nil
} }
bagInfo, rest, isF := BagMgrSingleton.AddItems(&model.AddItemParam{ bagInfo, rest, isF := BagMgrSingleton.AddItemsV2(&model.AddItemParam{
Platform: p.Platform, P: p.PlayerData,
SnId: p.SnId,
Change: []*model.Item{ Change: []*model.Item{
{ {
ItemId: item.GetItemId(), ItemId: item.GetItemId(),
@ -620,6 +541,7 @@ func CSDollChange(s *netlib.Session, packetid int, data interface{}, sid int64)
GainWay: common.GainWayItemBagChangeDoll, GainWay: common.GainWayItemBagChangeDoll,
Operator: "system", Operator: "system",
Remark: "背包内使用兑换娃娃卡", Remark: "背包内使用兑换娃娃卡",
NoLog: false,
}) })
logger.Logger.Trace("背包内使用兑换娃娃卡 bagInfo = ", bagInfo) logger.Logger.Trace("背包内使用兑换娃娃卡 bagInfo = ", bagInfo)
pack.RetCode = rest pack.RetCode = rest

View File

@ -143,28 +143,14 @@ func (this *CSRisingStarHandler) Process(s *netlib.Session, packetid int, data i
return nil return nil
} }
} }
if role == nil {
logger.Logger.Tracef("人物不存在")
return nil
}
//背包数据处理 //背包数据处理
item := BagMgrSingleton.GetItem(p.SnId, role.Fragment) item := BagMgrSingleton.GetItem(p.SnId, role.Fragment)
if item != nil && item.ItemNum >= int64(role.Amount) { if item != nil {
// item.ItemNum -= role.Amount
role.HaveAmount -= role.Amount role.HaveAmount -= role.Amount
remark := role.Name + "升星" remark := role.Name + "升星"
BagMgrSingleton.AddItems(&model.AddItemParam{ BagMgrSingleton.AddItem(p, int64(item.ItemId), int64(-role.Amount), 0, common.GainWay_RoleUpgrade,
Platform: p.Platform, "player", remark, 0, 0, false)
SnId: p.SnId,
Change: []*model.Item{
{
ItemId: item.ItemId,
ItemNum: int64(-role.Amount),
},
},
GainWay: common.GainWay_RoleUpgrade,
Operator: "player",
Remark: remark,
})
//人物模型状态处理 //人物模型状态处理
p.Roles.ModUnlock[msg.RisingModId]++ p.Roles.ModUnlock[msg.RisingModId]++
FriendMgrSington.UpdateInfo(p.Platform, p.SnId) FriendMgrSington.UpdateInfo(p.Platform, p.SnId)
@ -191,27 +177,15 @@ func (this *CSRisingStarHandler) Process(s *netlib.Session, packetid int, data i
return nil return nil
} }
} }
if pet == nil {
logger.Logger.Tracef("宠物不存在")
return nil
}
//背包数据处理 //背包数据处理
item := BagMgrSingleton.GetItem(p.SnId, pet.Fragment) item := BagMgrSingleton.GetItem(p.SnId, pet.Fragment)
if item != nil && item.ItemNum >= int64(pet.Amount) { if item != nil {
// item.ItemNum -= pet.Amount
pet.HaveAmount -= pet.Amount pet.HaveAmount -= pet.Amount
remark := pet.Name + "升星" remark := pet.Name + "升星"
BagMgrSingleton.AddItems(&model.AddItemParam{ BagMgrSingleton.AddItem(p, int64(item.ItemId), int64(-pet.Amount), 0, common.GainWay_PetUpgrade,
Platform: p.Platform, "player", remark, 0, 0, false)
Change: []*model.Item{
{
ItemId: item.ItemId,
ItemNum: int64(-pet.Amount),
},
},
GainWay: common.GainWay_PetUpgrade,
Operator: "player",
Remark: remark,
})
p.Pets.ModUnlock[msg.RisingModId]++ p.Pets.ModUnlock[msg.RisingModId]++
FriendMgrSington.UpdateInfo(p.Platform, p.SnId) FriendMgrSington.UpdateInfo(p.Platform, p.SnId)
p.dirty = true p.dirty = true
@ -219,6 +193,7 @@ func (this *CSRisingStarHandler) Process(s *netlib.Session, packetid int, data i
SendInfoPet(pets.OpResultCode_OPRC_Sucess, PetMgrSington.GetPetInfo(p, msg.RisingModId)) SendInfoPet(pets.OpResultCode_OPRC_Sucess, PetMgrSington.GetPetInfo(p, msg.RisingModId))
} }
} }
} }
return nil return nil
} }
@ -326,19 +301,9 @@ func (this *CSRolePetUnlockHandler) Process(s *netlib.Session, packetid int, dat
item := BagMgrSingleton.GetItem(p.SnId, roleInfo.Fragment) item := BagMgrSingleton.GetItem(p.SnId, roleInfo.Fragment)
if item != nil && item.ItemNum >= int64(roleInfo.Amount) { if item != nil && item.ItemNum >= int64(roleInfo.Amount) {
remark := roleInfo.Name + "解锁" remark := roleInfo.Name + "解锁"
BagMgrSingleton.AddItems(&model.AddItemParam{ BagMgrSingleton.AddItem(p, int64(item.ItemId), int64(-roleInfo.Amount), 0, common.GainWay_RoleUpgrade,
Platform: p.Platform, "player", remark, 0, 0, false)
SnId: p.SnId,
Change: []*model.Item{
{
ItemId: item.ItemId,
ItemNum: int64(-roleInfo.Amount),
},
},
GainWay: common.GainWay_RoleUpgrade,
Operator: "player",
Remark: remark,
})
p.Roles.ModUnlock[msg.UseModId] = 1 p.Roles.ModUnlock[msg.UseModId] = 1
if p.Roles.Mod[msg.UseModId] == nil { if p.Roles.Mod[msg.UseModId] == nil {
p.Roles.Mod[msg.UseModId] = &model.ModEx{} p.Roles.Mod[msg.UseModId] = &model.ModEx{}
@ -361,19 +326,9 @@ func (this *CSRolePetUnlockHandler) Process(s *netlib.Session, packetid int, dat
item := BagMgrSingleton.GetItem(p.SnId, petInfo.Fragment) item := BagMgrSingleton.GetItem(p.SnId, petInfo.Fragment)
if item != nil && item.ItemNum >= int64(petInfo.Amount) { if item != nil && item.ItemNum >= int64(petInfo.Amount) {
remark := petInfo.Name + "解锁" remark := petInfo.Name + "解锁"
BagMgrSingleton.AddItems(&model.AddItemParam{ BagMgrSingleton.AddItem(p, int64(item.ItemId), int64(-petInfo.Amount), 0, common.GainWay_PetUpgrade,
Platform: p.Platform, "player", remark, 0, 0, false)
SnId: p.SnId,
Change: []*model.Item{
{
ItemId: item.ItemId,
ItemNum: int64(-petInfo.Amount),
},
},
GainWay: common.GainWay_PetUpgrade,
Operator: "player",
Remark: remark,
})
p.Pets.ModUnlock[msg.UseModId] = 1 p.Pets.ModUnlock[msg.UseModId] = 1
if p.Pets.Mod[msg.UseModId] == nil { if p.Pets.Mod[msg.UseModId] == nil {
p.Pets.Mod[msg.UseModId] = &model.ModEx{} p.Pets.Mod[msg.UseModId] = &model.ModEx{}
@ -440,24 +395,17 @@ func (this *CSPetSkillLevelUpHandler) Process(s *netlib.Session, packetid int, d
} }
//消耗道具 //消耗道具
itemCon := SkillInfo.ItemConsum itemCon := SkillInfo.ItemConsum
var items []*model.Item var items []*Item
for itemId, itemNum := range itemCon { for itemId, itemNum := range itemCon {
if itemNum <= 0 { if itemNum == 0 {
return nil return nil
} }
items = append(items, &model.Item{ items = append(items, &Item{
ItemId: int32(itemId), ItemId: int32(itemId),
ItemNum: -itemNum, ItemNum: -itemNum,
}) })
} }
_, _, isF := BagMgrSingleton.AddItems(&model.AddItemParam{ _, _, isF := BagMgrSingleton.AddItems(p, items, 0, common.GainWayPetSkillLevelUp, "system", "宠物技能升级消耗", 0, 0, false)
Platform: p.Platform,
SnId: p.SnId,
Change: items,
GainWay: common.GainWayPetSkillLevelUp,
Operator: "system",
Remark: "宠物技能升级消耗",
})
if isF { if isF {
p.Pets.SkillInfo[petId][skillId] = level + 1 p.Pets.SkillInfo[petId][skillId] = level + 1
if level == 0 { if level == 0 {
@ -595,14 +543,14 @@ func CSSkinUpgrade(s *netlib.Session, packetid int, data interface{}, sid int64)
ItemNum: -v.GetN(), ItemNum: -v.GetN(),
}) })
} }
_, _, ok = BagMgrSingleton.AddItems(&model.AddItemParam{ _, _, ok = BagMgrSingleton.AddItemsV2(&model.AddItemParam{
Platform: p.Platform, P: p.PlayerData,
SnId: p.SnId,
Change: change, Change: change,
Add: 0, Add: 0,
GainWay: common.GainWaySkinUpGrade, GainWay: common.GainWaySkinUpGrade,
Operator: "system", Operator: "system",
Remark: "皮肤升级消耗", Remark: "皮肤升级消耗",
NoLog: false,
}) })
if !ok { if !ok {
logger.Logger.Errorf("CSSkinUpgrade upgrade error") logger.Logger.Errorf("CSSkinUpgrade upgrade error")
@ -649,14 +597,14 @@ func SkinUnLock(p *Player, id int32) (*pets.SkinInfo, pets.OpResultCode) {
ItemNum: -v.GetN(), ItemNum: -v.GetN(),
}) })
} }
_, _, ok := BagMgrSingleton.AddItems(&model.AddItemParam{ _, _, ok := BagMgrSingleton.AddItemsV2(&model.AddItemParam{
Platform: p.Platform, P: p.PlayerData,
SnId: p.SnId,
Change: change, Change: change,
Add: 0, Add: 0,
GainWay: common.GainWaySkinUnLock, GainWay: common.GainWaySkinUnLock,
Operator: "system", Operator: "system",
Remark: "皮肤解锁消耗", Remark: "皮肤解锁消耗",
NoLog: false,
}) })
if !ok { if !ok {
logger.Logger.Errorf("CSSKinUnLock Unlock error") logger.Logger.Errorf("CSSKinUnLock Unlock error")

View File

@ -99,7 +99,7 @@ func (this *CSPhoneLotteryHandler) Process(s *netlib.Session, packetid int, data
p.addLotteryCount(-count) p.addLotteryCount(-count)
pool := srvdata.PBDB_PhoneLotteryMgr.Datas.GetArr() pool := srvdata.PBDB_PhoneLotteryMgr.Datas.GetArr()
pack := &player_proto.SCPhoneLottery{} pack := &player_proto.SCPhoneLottery{}
items := make([]*model.Item, 0) items := make([]*Item, 0)
for i := 1; i <= int(count); i++ { for i := 1; i <= int(count); i++ {
//抽奖 //抽奖
rate := 0 rate := 0
@ -167,7 +167,7 @@ func (this *CSPhoneLotteryHandler) Process(s *netlib.Session, packetid int, data
itemArr.ItemId = lottery.Item_Id itemArr.ItemId = lottery.Item_Id
itemArr.ItemNum = int64(lottery.Grade) itemArr.ItemNum = int64(lottery.Grade)
itemArr.Id = lottery.Id itemArr.Id = lottery.Id
items = append(items, &model.Item{ items = append(items, &Item{
ItemId: lottery.Item_Id, // 物品id ItemId: lottery.Item_Id, // 物品id
ItemNum: int64(lottery.Grade), // 数量 ItemNum: int64(lottery.Grade), // 数量
}) })
@ -178,14 +178,7 @@ func (this *CSPhoneLotteryHandler) Process(s *netlib.Session, packetid int, data
} }
} }
//增加到玩家背包 //增加到玩家背包
BagMgrSingleton.AddItems(&model.AddItemParam{ BagMgrSingleton.AddItems(p, items, 0, common.GainWay_PhoneScore, "system", "玩游戏积分", 0, 0, false)
Platform: p.Platform,
SnId: p.SnId,
Change: items,
GainWay: common.GainWay_PhoneScore,
Operator: "system",
Remark: "玩游戏积分",
})
pack.Count = p.LotteryCount pack.Count = p.LotteryCount
pack.PhoneScore = p.PhoneScore pack.PhoneScore = p.PhoneScore
logger.Logger.Tracef("获取玩家抽奖权重 score = %d,抽奖获得的物品:%v", p.PhoneScore, pack) logger.Logger.Tracef("获取玩家抽奖权重 score = %d,抽奖获得的物品:%v", p.PhoneScore, pack)
@ -396,10 +389,9 @@ func (this *CSDiamondLotteryHandler) Process(s *netlib.Session, packetid int, da
} }
} }
} }
BagMgrSingleton.AddItems(&model.AddItemParam{ BagMgrSingleton.AddItemsV2(&model.AddItemParam{
Platform: p.Platform, P: p.PlayerData,
SnId: p.SnId, Change: items,
Change: items,
Cost: []*model.Item{ Cost: []*model.Item{
{ {
ItemId: common.ItemIDDiamond, ItemId: common.ItemIDDiamond,
@ -412,6 +404,7 @@ func (this *CSDiamondLotteryHandler) Process(s *netlib.Session, packetid int, da
Remark: "钻石抽奖", Remark: "钻石抽奖",
GameId: 0, GameId: 0,
GameFreeId: 0, GameFreeId: 0,
NoLog: false,
}) })
pack.LuckyScore = p.DiamondLotteryScore pack.LuckyScore = p.DiamondLotteryScore
p.SendToClient(int(player_proto.PlayerPacketID_PACKET_SC_DiamondLottery), pack) p.SendToClient(int(player_proto.PlayerPacketID_PACKET_SC_DiamondLottery), pack)
@ -469,8 +462,8 @@ func (this *CSDiamondLotteryLuckyAwardHandler) Process(s *netlib.Session, packet
//获取奖励 //获取奖励
for _, lotteryInfo := range config.Info { for _, lotteryInfo := range config.Info {
if lotteryInfo.Type == 2 { if lotteryInfo.Type == 2 {
var items []*model.Item var items []*Item
items = append(items, &model.Item{ items = append(items, &Item{
ItemId: lotteryInfo.ItemId, // 物品id ItemId: lotteryInfo.ItemId, // 物品id
ItemNum: int64(lotteryInfo.Grade), // 数量 ItemNum: int64(lotteryInfo.Grade), // 数量
}) })
@ -479,14 +472,7 @@ func (this *CSDiamondLotteryLuckyAwardHandler) Process(s *netlib.Session, packet
ItemId: lotteryInfo.ItemId, ItemId: lotteryInfo.ItemId,
ItemNum: int64(lotteryInfo.Grade), ItemNum: int64(lotteryInfo.Grade),
} }
BagMgrSingleton.AddItems(&model.AddItemParam{ BagMgrSingleton.AddItems(p, items, 0, common.GainWayDiamondLottery, "system", "钻石抽奖保底奖励", 0, 0, false)
Platform: p.Platform,
SnId: p.SnId,
Change: items,
GainWay: common.GainWayDiamondLottery,
Operator: "system",
Remark: "钻石抽奖保底奖励",
})
pack.Item = append(pack.Item, itemData) pack.Item = append(pack.Item, itemData)
break break
} }

View File

@ -1691,15 +1691,15 @@ func (this *CSPlayerVIPBuyPacketFactory) CreatePacket() interface{} {
func (this *CSPlayerVIPBuyHandler) Process(s *netlib.Session, packetid int, data interface{}, sid int64) error { func (this *CSPlayerVIPBuyHandler) Process(s *netlib.Session, packetid int, data interface{}, sid int64) error {
logger.Logger.Trace("CSVIPBuy Process recv ", data) logger.Logger.Trace("CSVIPBuy Process recv ", data)
//if msg, ok := data.(*player_proto.CSVIPBuy); ok { if msg, ok := data.(*player_proto.CSVIPBuy); ok {
// p := PlayerMgrSington.GetPlayer(sid) p := PlayerMgrSington.GetPlayer(sid)
// if p == nil { if p == nil {
// logger.Logger.Warn("CSPlayerVIPBuyHandler p == nil") logger.Logger.Warn("CSPlayerVIPBuyHandler p == nil")
// return nil return nil
// } }
//
// p.SCVIPBuy(int64(msg.GetMoney())) p.SCVIPBuy(int64(msg.GetMoney()))
//} }
return nil return nil
} }
@ -1722,7 +1722,7 @@ func (this *CSPlayerVIPInfoHandler) Process(s *netlib.Session, packetid int, dat
logger.Logger.Warn("CSPlayerVIPInfoHandler p == nil") logger.Logger.Warn("CSPlayerVIPInfoHandler p == nil")
return nil return nil
} }
p.GetVIPLevel() p.SCVIPInfo()
} }
return nil return nil
} }
@ -3124,9 +3124,8 @@ func CSUpdateAttribute(s *netlib.Session, packetId int, data interface{}, sid in
send() send()
// 获得10v卡 // 获得10v卡
if p.GuideStep == 2 { if p.GuideStep == 2 {
BagMgrSingleton.AddItems(&model.AddItemParam{ BagMgrSingleton.AddItemsV2(&model.AddItemParam{
Platform: p.Platform, P: p.PlayerData,
SnId: p.SnId,
Change: []*model.Item{ Change: []*model.Item{
{ {
ItemId: common.ItemIDVCard, ItemId: common.ItemIDVCard,
@ -3177,9 +3176,8 @@ func CSClawdollItemLog(s *netlib.Session, packetId int, data interface{}, sid in
ItemNum: 3, ItemNum: 3,
}) })
BagMgrSingleton.AddItems(&model.AddItemParam{ BagMgrSingleton.AddItemsV2(&model.AddItemParam{
Platform: p.Platform, P: p.PlayerData,
SnId: p.SnId,
Change: change, Change: change,
Add: 0, Add: 0,
GainWay: common.GainWayItemShopChangeDoll, GainWay: common.GainWayItemShopChangeDoll,
@ -3187,6 +3185,7 @@ func CSClawdollItemLog(s *netlib.Session, packetId int, data interface{}, sid in
Remark: "商城兑换娃娃", Remark: "商城兑换娃娃",
GameId: 0, GameId: 0,
GameFreeId: 0, GameFreeId: 0,
NoLog: false,
}) })
msg, ok := data.(*player_proto.CSClawdollItemLog) msg, ok := data.(*player_proto.CSClawdollItemLog)

View File

@ -251,22 +251,11 @@ func CSRMAward(s *netlib.Session, packetId int, data interface{}, sid int64) err
} }
default: default:
//道具 //道具
BagMgrSingleton.AddItems(&model.AddItemParam{ item := &Item{
Platform: p.Platform, ItemId: v.Id,
SnId: p.SnId, ItemNum: int64(v.Num),
Change: []*model.Item{ }
{ BagMgrSingleton.AddItems(p, []*Item{item}, 0, common.GainWay_RankMatch, "system", "段位奖励", 0, 0, false)
ItemId: v.Id,
ItemNum: int64(v.Num),
},
},
Add: 0,
GainWay: common.GainWay_RankMatch,
Operator: "system",
Remark: "段位奖励",
GameId: 0,
GameFreeId: 0,
})
} }
} }
} }

View File

@ -615,6 +615,37 @@ func init() {
} }
return nil return nil
})) }))
// 同步道具数量
netlib.Register(int(serverproto.SSPacketID_PACKET_PlayerChangeItems), &serverproto.PlayerChangeItems{}, HandlePlayerChangeItems)
}
func HandlePlayerChangeItems(session *netlib.Session, packetId int, data interface{}) error {
logger.Logger.Tracef("HandlePlayerChangeItems recv %v", data)
msg, ok := data.(*serverproto.PlayerChangeItems)
if !ok {
return nil
}
p := PlayerMgrSington.GetPlayerBySnId(msg.GetSnId())
if p == nil {
return nil
}
var items []*model.Item
for _, v := range msg.GetItems() {
items = append(items, &model.Item{
ItemId: v.GetId(),
ItemNum: v.GetNum(),
})
}
_, _, ok = BagMgrSingleton.AddItemsV2(&model.AddItemParam{
P: p.PlayerData,
Change: items,
NoLog: true,
})
if !ok {
logger.Logger.Errorf("HandlePlayerChangeItems add item failed %v", msg)
}
return nil
} }
// 机器人服务器向worldsrv发送 // 机器人服务器向worldsrv发送
@ -755,31 +786,3 @@ func init() {
common.RegisterHandler(int(loginproto.LoginPacketID_PACKET_CS_ACCOUNTINVALID), &CSAccountInvalidHandler{}) common.RegisterHandler(int(loginproto.LoginPacketID_PACKET_CS_ACCOUNTINVALID), &CSAccountInvalidHandler{})
netlib.RegisterFactory(int(loginproto.LoginPacketID_PACKET_CS_ACCOUNTINVALID), &CSAccountInvalidPacketFactory{}) netlib.RegisterFactory(int(loginproto.LoginPacketID_PACKET_CS_ACCOUNTINVALID), &CSAccountInvalidPacketFactory{})
} }
func init() {
// 同步道具数量
netlib.Register(int(serverproto.SSPacketID_PACKET_PlayerChangeItems), &serverproto.PlayerChangeItems{}, HandlePlayerChangeItems)
}
func HandlePlayerChangeItems(session *netlib.Session, packetId int, data interface{}) error {
logger.Logger.Tracef("HandlePlayerChangeItems recv %v", data)
msg, ok := data.(*serverproto.PlayerChangeItems)
if !ok {
return nil
}
param := model.AddItemParam{}
if err := netlib.Gob.Unmarshal(msg.GetData(), &param); err != nil {
logger.Logger.Errorf("HandlePlayerChangeItems 游戏道具变更同步失败 %v", err)
return err
}
p := PlayerMgrSington.GetPlayerBySnId(param.SnId)
if p == nil {
logger.Logger.Errorf("HandlePlayerChangeItems player is nil")
return nil
}
_, _, ok = BagMgrSingleton.AddItems(&param)
if !ok {
logger.Logger.Errorf("HandlePlayerChangeItems add item failed %+v", param)
}
return nil
}

View File

@ -82,7 +82,7 @@ func IsTaskReward(p *Player, id int32) bool {
func SendReward(p *Player, m map[int64]int64, tp int32) { func SendReward(p *Player, m map[int64]int64, tp int32) {
isPermit := p.GetIsPermit() isPermit := p.GetIsPermit()
add := p.GetSkillAdd(common.SkillIdTask) add := p.GetSkillAdd(common.SkillIdTask)
var items []*model.Item var items []*Item
for k, v := range m { for k, v := range m {
if k == common.ItemIDPermit && isPermit { if k == common.ItemIDPermit && isPermit {
v += int64(float64(v) * common.PermitAdd) v += int64(float64(v) * common.PermitAdd)
@ -91,7 +91,7 @@ func SendReward(p *Player, m map[int64]int64, tp int32) {
if tp == common.TaskActivityTypeEveryDay && add > 0 && k == common.ItemIDCoin { if tp == common.TaskActivityTypeEveryDay && add > 0 && k == common.ItemIDCoin {
v += int64((float64(v) * float64(add)) / 100.0) v += int64((float64(v) * float64(add)) / 100.0)
} }
items = append(items, &model.Item{ items = append(items, &Item{
ItemId: int32(k), ItemId: int32(k),
ItemNum: v, ItemNum: v,
}) })
@ -118,17 +118,7 @@ func SendReward(p *Player, m map[int64]int64, tp int32) {
gain = common.GainWayItemTaskPermit gain = common.GainWayItemTaskPermit
giveType = model.SystemFreeGive_GiveType_TaskPermit giveType = model.SystemFreeGive_GiveType_TaskPermit
} }
BagMgrSingleton.AddItems(&model.AddItemParam{ BagMgrSingleton.AddItems(p, items, 0, gain, "system", "任务奖励", 0, 0, false)
Platform: p.Platform,
SnId: p.SnId,
Change: items,
Add: 0,
GainWay: gain,
Operator: "system",
Remark: "任务奖励",
GameId: 0,
GameFreeId: 0,
})
for _, v := range items { for _, v := range items {
tp := int32(-1) tp := int32(-1)
if v.ItemId == common.ItemIDCoin { if v.ItemId == common.ItemIDCoin {

View File

@ -542,9 +542,9 @@ func IsPermitCanReward(p *Player, id int32) bool {
// SendPermitReward 发赛季通行证奖励 // SendPermitReward 发赛季通行证奖励
// tp 1普通2典藏 // tp 1普通2典藏
func SendPermitReward(p *Player, m map[int64]int64, tp int32) { func SendPermitReward(p *Player, m map[int64]int64, tp int32) {
var items []*model.Item var items []*Item
for k, v := range m { for k, v := range m {
items = append(items, &model.Item{ items = append(items, &Item{
ItemId: int32(k), ItemId: int32(k),
ItemNum: v, ItemNum: v,
}) })
@ -559,17 +559,7 @@ func SendPermitReward(p *Player, m map[int64]int64, tp int32) {
gain = common.GainWayPermitAward gain = common.GainWayPermitAward
giveType = model.SystemFreeGive_GiveType_PermitAward giveType = model.SystemFreeGive_GiveType_PermitAward
} }
BagMgrSingleton.AddItems(&model.AddItemParam{ BagMgrSingleton.AddItems(p, items, 0, gain, "system", "通行证奖励", 0, 0, false)
Platform: p.Platform,
SnId: p.SnId,
Change: items,
Add: 0,
GainWay: gain,
Operator: "system",
Remark: "通行证奖励",
GameId: 0,
GameFreeId: 0,
})
for _, v := range items { for _, v := range items {
tp1 := int32(-1) tp1 := int32(-1)
if v.ItemId == common.ItemIDCoin { if v.ItemId == common.ItemIDCoin {
@ -1061,8 +1051,9 @@ func CSPermitExchange(s *netlib.Session, packetid int, data interface{}, sid int
if exchangeConfig != nil { if exchangeConfig != nil {
// 检查背包是否足够 // 检查背包是否足够
var items []*model.Item var items []*model.Item
var costItems, cost1 []*model.Item var costItems []*Item
var cost, gain []model.AwardItem var cost, gain []model.AwardItem
var cost1 []*model.Item
for _, v := range exchangeConfig.GetCost() { for _, v := range exchangeConfig.GetCost() {
item := BagMgrSingleton.GetItem(p.SnId, v.GetItemId()) item := BagMgrSingleton.GetItem(p.SnId, v.GetItemId())
if item == nil || item.ItemNum < v.GetItemNum() { if item == nil || item.ItemNum < v.GetItemNum() {
@ -1071,9 +1062,10 @@ func CSPermitExchange(s *netlib.Session, packetid int, data interface{}, sid int
} }
info := srvdata.GameItemMgr.Get(p.Platform, v.GetItemId()) info := srvdata.GameItemMgr.Get(p.Platform, v.GetItemId())
if info != nil { if info != nil {
costItems = append(costItems, &model.Item{ costItems = append(costItems, &Item{
ItemId: v.GetItemId(), ItemId: v.GetItemId(),
ItemNum: -v.GetItemNum(), ItemNum: v.GetItemNum(),
Name: info.Name,
}) })
cost = append(cost, model.AwardItem{ cost = append(cost, model.AwardItem{
Id: v.GetItemId(), Id: v.GetItemId(),
@ -1099,18 +1091,13 @@ func CSPermitExchange(s *netlib.Session, packetid int, data interface{}, sid int
} }
} }
// 扣除背包物品 // 扣除背包物品
BagMgrSingleton.AddItems(&model.AddItemParam{ for _, item := range costItems {
Platform: p.Platform, BagMgrSingleton.AddItem(p, int64(item.ItemId), -item.ItemNum, 0,
SnId: p.SnId, common.GainWayPermitExchangeCost, "system", "赛季通行证兑换消耗", 0, 0, false)
Change: costItems, }
GainWay: common.GainWayPermitExchangeCost,
Operator: "system",
Remark: "赛季通行证兑换消耗",
})
// 增加背包物品 // 增加背包物品
BagMgrSingleton.AddItems(&model.AddItemParam{ BagMgrSingleton.AddItemsV2(&model.AddItemParam{
Platform: p.Platform, P: p.PlayerData,
SnId: p.SnId,
Change: items, Change: items,
Cost: cost1, Cost: cost1,
Add: 0, Add: 0,
@ -1119,6 +1106,7 @@ func CSPermitExchange(s *netlib.Session, packetid int, data interface{}, sid int
Remark: "赛季通行证兑换获得", Remark: "赛季通行证兑换获得",
GameId: 0, GameId: 0,
GameFreeId: 0, GameFreeId: 0,
NoLog: false,
}) })
p.WelfData.PermitExchange[msg.GetId()] = append(p.WelfData.PermitExchange[msg.GetId()], now.Unix()) p.WelfData.PermitExchange[msg.GetId()] = append(p.WelfData.PermitExchange[msg.GetId()], now.Unix())
// 兑换记录 // 兑换记录

File diff suppressed because it is too large Load Diff

View File

@ -34,6 +34,7 @@ import (
"mongo.games.com/game/protocol/rankmatch" "mongo.games.com/game/protocol/rankmatch"
serverproto "mongo.games.com/game/protocol/server" serverproto "mongo.games.com/game/protocol/server"
shopproto "mongo.games.com/game/protocol/shop" shopproto "mongo.games.com/game/protocol/shop"
webapiproto "mongo.games.com/game/protocol/webapi"
"mongo.games.com/game/srvdata" "mongo.games.com/game/srvdata"
"mongo.games.com/game/worldsrv/internal" "mongo.games.com/game/worldsrv/internal"
) )
@ -263,7 +264,7 @@ func (this *Player) LoadAfter() {
} }
v.CallbackAfter(replays[k]) v.CallbackAfter(replays[k])
} }
})).StartByExecutor(fmt.Sprintf("Player%v", this.SnId)) })).StartByFixExecutor(fmt.Sprintf("Player%v", this.SnId))
} }
func (this *Player) OnLogined() { func (this *Player) OnLogined() {
@ -309,7 +310,13 @@ func (this *Player) OnLogined() {
this.SetOnline() this.SetOnline()
//测试用 //测试用
if this.IsRob { if !this.IsRob {
old := this.VIP
this.VIP = this.GetVIPLevel()
if old != this.VIP {
this.dirty = true
}
} else {
this.VIP = rand.Int31n(6) + 1 this.VIP = rand.Int31n(6) + 1
//机器人随机vip和头像 //机器人随机vip和头像
this.RobRandVip() this.RobRandVip()
@ -1109,8 +1116,9 @@ func (this *Player) GetMessageAttach(id string) {
} }
return gift return gift
}), task.CompleteNotifyWrapper(func(data interface{}, tt task.Task) { }), task.CompleteNotifyWrapper(func(data interface{}, tt task.Task) {
attachMsg, ok := data.(*model.Message) attach_msg, ok := data.(*model.Message)
if ok && attachMsg != nil { dirtyCoin := int64(0)
if ok && attach_msg != nil {
msg.AttachState = model.MSGATTACHSTATE_GOT msg.AttachState = model.MSGATTACHSTATE_GOT
notifyClient := true notifyClient := true
var remark string var remark string
@ -1118,10 +1126,10 @@ func (this *Player) GetMessageAttach(id string) {
// 领取道具 // 领取道具
addItem := func() { addItem := func() {
items := make([]*model.Item, 0) items := make([]*Item, 0)
if num := len(msg.Params); num > 0 && num%2 == 0 { if num := len(msg.Params); num > 0 && num%2 == 0 {
for i := 0; i < num; i += 2 { for i := 0; i < num; i += 2 {
items = append(items, &model.Item{ items = append(items, &Item{
ItemId: msg.Params[i], // 物品id ItemId: msg.Params[i], // 物品id
ItemNum: int64(msg.Params[i+1]), // 数量 ItemNum: int64(msg.Params[i+1]), // 数量
ObtainTime: time.Now().Unix(), ObtainTime: time.Now().Unix(),
@ -1140,14 +1148,14 @@ func (this *Player) GetMessageAttach(id string) {
} }
} }
} }
BagMgrSingleton.AddItems(&model.AddItemParam{ if _, code, _ := BagMgrSingleton.AddItems(this, items, 0, gainWay, "mail", remark, 0, 0, false); code != bag.OpResultCode_OPRC_Sucess { // 领取失败
Platform: this.Platform, logger.Logger.Errorf("CSPlayerSettingHandler AddItems err", code)
SnId: this.SnId, pack := &msgproto.SCGetMessageAttach{
Change: items, Id: proto.String(""),
GainWay: gainWay, }
Operator: "mail", proto.SetDefaults(pack)
Remark: remark, this.SendToClient(int(msgproto.MSGPacketID_PACKET_SC_GETMESSAGEATTACH), pack)
}) }
this.dirty = true this.dirty = true
} }
} }
@ -1156,24 +1164,29 @@ func (this *Player) GetMessageAttach(id string) {
case model.MSGTYPE_ITEM: case model.MSGTYPE_ITEM:
remark = "领取道具" remark = "领取道具"
gainWay = common.GainWay_MAIL_MTEM gainWay = common.GainWay_MAIL_MTEM
dirtyCoin = msg.Coin
addItem() addItem()
case model.MSGTYPE_IOSINSTALLSTABLE: case model.MSGTYPE_IOSINSTALLSTABLE:
remark = "IOS下载稳定版本" remark = "IOS下载稳定版本"
gainWay = common.GainWay_IOSINSTALLSTABLE gainWay = common.GainWay_IOSINSTALLSTABLE
dirtyCoin = msg.Coin
case model.MSGTYPE_GIFT: case model.MSGTYPE_GIFT:
remark = "礼物" remark = "礼物"
case model.MSGTYPE_GOLDCOMERANK: case model.MSGTYPE_GOLDCOMERANK:
remark = "财神降临奖励" remark = "财神降临奖励"
gainWay = common.GainWay_GoldCome gainWay = common.GainWay_GoldCome
notifyClient = false notifyClient = false
dirtyCoin = msg.Coin
case model.MSGTYPE_RANDCOIN: case model.MSGTYPE_RANDCOIN:
remark = "红包雨" remark = "红包雨"
gainWay = common.GainWay_OnlineRandCoin gainWay = common.GainWay_OnlineRandCoin
notifyClient = false notifyClient = false
dirtyCoin = msg.Coin
case model.MSGTYPE_REBATE: case model.MSGTYPE_REBATE:
remark = "流水返利" remark = "流水返利"
gainWay = common.GainWay_RebateTask gainWay = common.GainWay_RebateTask
notifyClient = false notifyClient = false
dirtyCoin = msg.Coin
//邮件领取 添加日志 //邮件领取 添加日志
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} { task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
return model.InsertRebateLog(this.Platform, &model.Rebate{ return model.InsertRebateLog(this.Platform, &model.Rebate{
@ -1221,6 +1234,8 @@ func (this *Player) GetMessageAttach(id string) {
} }
if msg.Coin > 0 { if msg.Coin > 0 {
this.AddCoin(msg.Coin, 0, gainWay, msg.Id.Hex(), remark) this.AddCoin(msg.Coin, 0, gainWay, msg.Id.Hex(), remark)
//增加泥码
this.AddDirtyCoin(0, dirtyCoin)
//俱乐部获取不算系统赠送 //俱乐部获取不算系统赠送
if msg.MType != model.MSGTYPE_ClubGet { if msg.MType != model.MSGTYPE_ClubGet {
this.ReportSystemGiveEvent(int32(msg.Coin), gainWay, notifyClient) //邮件附件算是系统赠送 this.ReportSystemGiveEvent(int32(msg.Coin), gainWay, notifyClient) //邮件附件算是系统赠送
@ -1263,6 +1278,182 @@ func (this *Player) GetMessageAttach(id string) {
} }
} }
// 一键领取
func (this *Player) GetMessageAttachs(ids []string) {
var msgs []*model.Message
var Ids []string // 可以领取的邮件
var platform string
for _, id := range ids {
if msg, exist := this.msgs[id]; exist {
if msg.AttachState == model.MSGATTACHSTATE_DEFAULT && (msg.Coin > 0 || msg.Ticket > 0 ||
msg.Grade > 0 || len(msg.Params) > 0 || msg.Diamond > 0) {
Ids = append(Ids, id)
platform = msg.Platform
}
}
}
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
magids, err := model.GetMessageAttachs(Ids, platform)
if err != nil {
logger.Logger.Trace("GetMessageAttachs err ", err)
}
return magids
}), task.CompleteNotifyWrapper(func(data interface{}, tt task.Task) {
magids, ok := data.(*[]string)
if ok && magids != nil {
for _, id := range *magids {
if msg, exist := this.msgs[id]; exist {
if msg.AttachState == model.MSGATTACHSTATE_DEFAULT && (msg.Coin > 0 || msg.Ticket > 0 ||
msg.Grade > 0 || len(msg.Params) > 0 || msg.Diamond > 0) {
msgs = append(msgs, msg)
platform = msg.Platform
}
}
}
pack := &msgproto.SCGetMessageAttach{
// Id: proto.String(id),
}
for _, msg := range msgs {
pack.Ids = append(pack.Ids, msg.Id.Hex())
dirtyCoin := int64(0)
msg.AttachState = model.MSGATTACHSTATE_GOT
notifyClient := true
var remark string
var gainWay int32 = common.GainWay_MessageAttach
switch msg.MType {
case model.MSGTYPE_ITEM:
remark = "领取道具"
gainWay = common.GainWay_MAIL_MTEM
dirtyCoin = msg.Coin
items := make([]*Item, 0)
if num := len(msg.Params); num > 0 && num%2 == 0 {
for i := 0; i < num; i += 2 {
items = append(items, &Item{
ItemId: msg.Params[i], // 物品id
ItemNum: int64(msg.Params[i+1]), // 数量
ObtainTime: time.Now().Unix(),
})
}
if _, code, _ := BagMgrSingleton.AddItems(this, items, 0, gainWay, "mail", remark, 0, 0, false); code != bag.OpResultCode_OPRC_Sucess { // 领取失败
logger.Logger.Errorf("CSPlayerSettingHandler AddItems err", code)
/*
pack := &msg_proto.SCGetMessageAttach{
Id: proto.String(""),
}
proto.SetDefaults(pack)
this.SendToClient(int(msg_proto.MSGPacketID_PACKET_SC_GETMESSAGEATTACH), pack)
*/
}
this.dirty = true
}
case model.MSGTYPE_IOSINSTALLSTABLE:
remark = "IOS下载稳定版本"
gainWay = common.GainWay_IOSINSTALLSTABLE
dirtyCoin = msg.Coin
case model.MSGTYPE_GIFT:
remark = "礼物"
case model.MSGTYPE_GOLDCOMERANK:
remark = "财神降临奖励"
gainWay = common.GainWay_GoldCome
notifyClient = false
dirtyCoin = msg.Coin
case model.MSGTYPE_RANDCOIN:
remark = "红包雨"
gainWay = common.GainWay_OnlineRandCoin
notifyClient = false
dirtyCoin = msg.Coin
case model.MSGTYPE_REBATE:
remark = "流水返利"
gainWay = common.GainWay_RebateTask
notifyClient = false
dirtyCoin = msg.Coin
//邮件领取 添加日志
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
return model.InsertRebateLog(this.Platform, &model.Rebate{
SnId: this.SnId,
RebateCoin: msg.Coin,
ReceiveType: 1,
CodeCoin: 0,
})
}), nil, "InsertRebateLog").StartByFixExecutor("ReceiveCodeCoin")
case model.MSGTYPE_ClubGet:
//if len(msg.Params) != 0 {
// //如果俱乐部解散 就存msg.Params[0]
// remark = fmt.Sprintf("%v", msg.Params[0])
//}
//gainWay = common.GainWay_ClubGetCoin
//dirtyCoin = msg.Coin
case model.MSGTYPE_ClubPump:
//if len(msg.Params) != 0 {
// remark = fmt.Sprintf("%v", msg.Params[0])
//}
//gainWay = common.GainWay_ClubPumpCoin
//notifyClient = false
//dirtyCoin = msg.Coin
case model.MSGTYPE_MATCH_SIGNUPFEE:
gainWay = common.GainWay_MatchBreakBack
notifyClient = false
case model.MSGTYPE_MATCH_TICKETREWARD:
gainWay = common.GainWay_MatchSystemSupply
notifyClient = false
this.TicketTotal += msg.Ticket
case model.MSGTYPE_MATCH_SHOPEXCHANGE:
remark = "积分商城兑换"
gainWay = common.GainWay_Exchange
case model.MSGTYPE_MATCH_SHOPERETURN:
remark = "撤单返还"
gainWay = common.GainWay_GradeShopReturn
}
if msg.Coin > 0 {
this.AddCoin(msg.Coin, 0, gainWay, msg.Id.Hex(), remark)
//增加泥码
this.AddDirtyCoin(0, dirtyCoin)
//俱乐部获取不算系统赠送
if msg.MType != model.MSGTYPE_ClubGet {
this.ReportSystemGiveEvent(int32(msg.Coin), gainWay, notifyClient) //邮件附件算是系统赠送
} else { //俱乐部获取算充值
this.AddCoinGiveLog(msg.Coin, 0, 0, gainWay, model.COINGIVETYPE_PAY, "club", "club")
}
this.AddPayCoinLog(msg.Coin, model.PayCoinLogType_Coin, "mail")
if msg.Oper == 0 { //系统赠送
if !this.IsRob {
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(this.SnId, this.Name, this.Platform, this.Channel, model.SystemFreeGive_GiveType_MailSystemGive,
model.SystemFreeGive_CoinType_Coin, int64(msg.Coin)))
}
}
}
if msg.Ticket > 0 {
//增加报名券
this.AddTicket(msg.Ticket, gainWay, msg.Id.Hex(), remark)
}
if msg.Grade > 0 {
//增加积分
this.AddGrade(msg.Grade, gainWay, msg.Id.Hex(), remark)
}
if msg.Diamond > 0 {
this.AddDiamond(msg.Diamond, 0, gainWay, msg.Id.Hex(), remark)
if msg.Oper == 0 { //系统赠送
if !this.IsRob {
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(this.SnId, this.Name, this.Platform, this.Channel, model.SystemFreeGive_GiveType_MailSystemGive,
model.SystemFreeGive_CoinType_Diamond, int64(msg.Diamond)))
}
}
}
}
proto.SetDefaults(pack)
this.SendToClient(int(msgproto.MSGPacketID_PACKET_SC_GETMESSAGEATTACH), pack)
}
}), "GetMessageAttach").StartByFixExecutor("logic_message")
}
func (this *Player) GetMessageByGiftId(id string) *model.Message { func (this *Player) GetMessageByGiftId(id string) *model.Message {
for _, msg := range this.msgs { for _, msg := range this.msgs {
if msg.GiftId == id && msg.State != model.MSGSTATE_REMOVEED { if msg.GiftId == id && msg.State != model.MSGSTATE_REMOVEED {
@ -1663,7 +1854,7 @@ func (this *Player) Save(force bool) {
} }
} }
}), "SavePlayerTask") }), "SavePlayerTask")
if b := t.StartByExecutor(fmt.Sprintf("Player%v", this.SnId)); b { if b := t.StartByExecutor(strconv.Itoa(int(this.SnId))); b {
this.lastSaved = time.Now() this.lastSaved = time.Now()
} }
} }
@ -1707,46 +1898,55 @@ func (this *Player) AddDiamond(num, add int64, gainWay int32, oper, remark strin
return return
} }
logger.Logger.Tracef("snid(%v) AddDiamond(%v)", this.SnId, num) logger.Logger.Tracef("snid(%v) AddDiamond(%v)", this.SnId, num)
this.dirty = true //async := false
if num > 0 { //if num > 0 && this.scene != nil && !this.scene.IsTestScene() && this.scene.sceneMode != common.SceneMode_Thr { //游戏场中加币,需要同步到gamesrv上
this.Diamond += num // if StartAsyncAddCoinTransact(this, num, gainWay, oper, remark, true, 0, true) {
} else { // async = true
if -num > this.Diamond { // }
logger.Logger.Errorf("Player.AddCoin exception!!! num(%v) oper(%v)", num, oper) //}
num = -this.Diamond
this.Diamond = 0
} else {
this.Diamond += num
}
switch gainWay {
case common.GainWay_MatchSignup: // 排除的
default:
TaskSubjectSingleton.Touch(common.TaskTypeCostDiamond, &TaskData{
SnId: this.SnId,
Num: -num,
})
}
}
this.SendDiffData() if num != 0 /*&& !async*/ {
if !this.IsRob { this.dirty = true
log := model.NewCoinLogEx(&model.CoinLogParam{ if num > 0 {
Platform: this.Platform, this.Diamond += num
SnID: this.SnId, } else {
Channel: this.Channel, if -num > this.Diamond {
ChangeType: common.BillTypeDiamond, logger.Logger.Errorf("Player.AddCoin exception!!! num(%v) oper(%v)", num, oper)
ChangeNum: num, num = -this.Diamond
RemainNum: this.Diamond, this.Diamond = 0
Add: add, } else {
LogType: gainWay, this.Diamond += num
GameID: 0, }
GameFreeID: 0, switch gainWay {
BaseCoin: 0, case common.GainWay_MatchSignup: // 排除的
Operator: oper, default:
Remark: remark, TaskSubjectSingleton.Touch(common.TaskTypeCostDiamond, &TaskData{
}) SnId: this.SnId,
if log != nil { Num: -num,
LogChannelSingleton.WriteLog(log) })
}
}
this.SendDiffData()
if !this.IsRob {
log := model.NewCoinLogEx(&model.CoinLogParam{
Platform: this.Platform,
SnID: this.SnId,
Channel: this.Channel,
ChangeType: common.BillTypeDiamond,
ChangeNum: num,
RemainNum: this.Diamond,
Add: add,
LogType: gainWay,
GameID: 0,
GameFreeID: 0,
BaseCoin: 0,
Operator: oper,
Remark: remark,
})
if log != nil {
LogChannelSingleton.WriteLog(log)
}
} }
} }
} }
@ -1883,6 +2083,45 @@ func (this *Player) AddCoinAsync(num, add int64, gainWay int32, oper, remark str
// } // }
//} //}
// 增加泥码
func (this *Player) AddDirtyCoin(paycoin, givecoin int64) {
if this.IsRob {
return
}
//if cfg, ok := ProfitControlMgrSington.GetCfg(this.Platform); ok && cfg != nil && paycoin >= 0 {
// //洗码折算率=(玩家剩余泥码*洗码折算率+期望营收)/(充值额+赠送额+泥码余额)
// this.RecalcuWashingCoinConvRate(cfg.Rate, paycoin, givecoin)
//}
//
//this.DirtyCoin += paycoin + givecoin
//if this.DirtyCoin < 0 {
// this.DirtyCoin = 0
//}
this.dirty = true
}
// 洗码
func (this *Player) WashingCoin(coin int64) int64 {
if this.IsRob {
return 0
}
if coin <= 0 {
return 0
}
//if this.DirtyCoin > coin {
// this.DirtyCoin -= coin
// this.dirty = true
// return coin
//}
//
////剩余多少泥码,清洗多少
//coin = this.DirtyCoin
//this.DirtyCoin = 0
return coin
}
func (this *Player) AddTicket(num int64, gainWay int32, oper, remark string) { func (this *Player) AddTicket(num int64, gainWay int32, oper, remark string) {
if num == 0 { if num == 0 {
return return
@ -2204,14 +2443,23 @@ func (this *Player) BackDiffData() {
this.diffData.SafeBoxCoin = this.SafeBoxCoin this.diffData.SafeBoxCoin = this.SafeBoxCoin
} }
func (this *Player) UpdateVip() {
if this.IsRob {
return
}
this.VIP = this.GetVIPLevel()
//clubManager.UpdateVip(this)
}
func (this *Player) AddMoneyPayTotal(amount int64) { func (this *Player) AddMoneyPayTotal(amount int64) {
if amount > 0 { if amount > 0 {
this.MoneyPayTotal += amount this.MoneyPayTotal += amount
this.GetVIPLevel() this.SendDiffData() //更新vip
} }
} }
func (this *Player) SendDiffData() { func (this *Player) SendDiffData() {
this.UpdateVip()
var dirty bool var dirty bool
pack := &playerproto.SCPlayerDataUpdate{} pack := &playerproto.SCPlayerDataUpdate{}
pack.UpdateField = 0 pack.UpdateField = 0
@ -2697,6 +2945,7 @@ func (this *Player) GetPromoterKey() (string, error) {
//} //}
func (this *Player) SendPlayerInfo() { func (this *Player) SendPlayerInfo() {
this.UpdateVip()
scPlayerData := &playerproto.SCPlayerData{ scPlayerData := &playerproto.SCPlayerData{
OpRetCode: playerproto.OpResultCode_OPRC_Sucess, OpRetCode: playerproto.OpResultCode_OPRC_Sucess,
Data: &playerproto.PlayerData{ Data: &playerproto.PlayerData{
@ -2808,8 +3057,6 @@ func (this *Player) SendPlayerInfo() {
this.SendGameConfig(int32(this.scene.gameId), this.Platform, this.Channel) this.SendGameConfig(int32(this.scene.gameId), this.Platform, this.Channel)
} }
//this.SendJackpotInfo() //this.SendJackpotInfo()
// 更新vip
this.GetVIPLevel()
// 后台道具配置 // 后台道具配置
this.SCItems() this.SCItems()
// 引导配置 // 引导配置
@ -3451,17 +3698,17 @@ func (this *Player) SendShowRed(showType hallproto.ShowRedCode, showChild, isSho
this.SendToClient(int(hallproto.HallPacketID_PACKET_SC_SHOWRED), pack) this.SendToClient(int(hallproto.HallPacketID_PACKET_SC_SHOWRED), pack)
} }
//func (this *Player) SCVIPBuy(buy int64) { func (this *Player) SCVIPBuy(buy int64) {
// //buy *= 10000 //buy *= 10000
// //this.AddMoneyPayTotal(buy) //this.AddMoneyPayTotal(buy)
// //this.GetVIPLevel(0) // 更新下vip等级 //this.GetVIPLevel(0) // 更新下vip等级
// pack := &playerproto.SCVIPBuy{ pack := &playerproto.SCVIPBuy{
// OpRetCode: playerproto.OpResultCode_OPRC_Sucess, OpRetCode: playerproto.OpResultCode_OPRC_Sucess,
// } }
// pack.TolVipExp, pack.Money = this.GetCurrentVIPExp() // 获取经验会更新vip等级 pack.TolVipExp, pack.Money = this.GetCurrentVIPExp() // 获取经验会更新vip等级
// pack.Vip = this.VIP pack.Vip = this.VIP
// this.SendToClient(int(playerproto.PlayerPacketID_PACKET_SC_VIPBUY), pack) this.SendToClient(int(playerproto.PlayerPacketID_PACKET_SC_VIPBUY), pack)
//} }
func (this *Player) SCVIPInfo() { func (this *Player) SCVIPInfo() {
if this.IsRob { if this.IsRob {
@ -3535,9 +3782,11 @@ func (this *Player) SCVIPInfo() {
pack.List = append(pack.List, data) pack.List = append(pack.List, data)
} }
pack.TolVipExp, pack.Money = this.GetCurrentVIPExp() pack.TolVipExp, pack.Money = this.GetCurrentVIPExp(vips)
pack.Vip = this.VIP pack.Vip = this.VIP
pack.OpRetCode = playerproto.OpResultCode_OPRC_Sucess pack.OpRetCode = playerproto.OpResultCode_OPRC_Sucess
//WelfareMgrSington.MonitorWelfData(this)
//pack.VipId = append(pack.VipId, this.WelfData.VIPGift...)
} }
this.SendToClient(int(playerproto.PlayerPacketID_PACKET_SC_VIPINFO), pack) this.SendToClient(int(playerproto.PlayerPacketID_PACKET_SC_VIPINFO), pack)
logger.Logger.Tracef("send vipinfo to client:%v", pack) logger.Logger.Tracef("send vipinfo to client:%v", pack)
@ -3613,9 +3862,8 @@ func (this *Player) VIPDraw(id, vip int32) {
this.AddMoneyPayTotal(addVipExp) this.AddMoneyPayTotal(addVipExp)
pack.Award[common.ItemIDVipExp] = addVipExp pack.Award[common.ItemIDVipExp] = addVipExp
default: default:
BagMgrSingleton.AddItems(&model.AddItemParam{ BagMgrSingleton.AddItemsV2(&model.AddItemParam{
Platform: this.Platform, P: this.PlayerData,
SnId: this.SnId,
Change: []*model.Item{ Change: []*model.Item{
{ {
ItemId: int32(k), ItemId: int32(k),
@ -3647,9 +3895,8 @@ func (this *Player) VIPDraw(id, vip int32) {
itemInfo = append(itemInfo, model.ItemInfo{ItemId: int32(k), ItemNum: v}) itemInfo = append(itemInfo, model.ItemInfo{ItemId: int32(k), ItemNum: v})
pack.Award[k] = v pack.Award[k] = v
} }
BagMgrSingleton.AddItems(&model.AddItemParam{ BagMgrSingleton.AddItemsV2(&model.AddItemParam{
Platform: this.Platform, P: this.PlayerData,
SnId: this.SnId,
Change: items, Change: items,
GainWay: common.GainWayVipGift9, GainWay: common.GainWayVipGift9,
Operator: "system", Operator: "system",
@ -3664,14 +3911,17 @@ func (this *Player) VIPDraw(id, vip int32) {
send() send()
} }
// GetCurrentVIPExp 更新vip等级 func (this *Player) GetCurrentVIPExp(vipcfg ...*webapiproto.VIPcfgDataList) (exp int64, money int64) {
// 返回当前经验和升级需要经验 var vips *webapiproto.VIPcfgDataList
func (this *Player) GetCurrentVIPExp() (exp int64, money int64) { if len(vipcfg) == 0 {
vips := VipMgrSington.GetVIPcfg(this.Platform) vips = VipMgrSington.GetVIPcfg(this.Platform)
} else {
vips = vipcfg[0]
}
exp = int64(float64(this.MoneyPayTotal) * vips.MoneyRatio) exp = int64(float64(this.MoneyPayTotal) * vips.MoneyRatio)
tolexp := int32(0) tolexp := int32(0)
oldVipLevel := this.VIP oldVipLevel := this.VIP
if this.MoneyPayTotal != 0 { if vips != nil && this.MoneyPayTotal != 0 {
allExp := int64(float64(this.MoneyPayTotal) * vips.MoneyRatio) allExp := int64(float64(this.MoneyPayTotal) * vips.MoneyRatio)
for _, v := range vips.List { for _, v := range vips.List {
tolexp = v.VipEx tolexp = v.VipEx
@ -3688,12 +3938,14 @@ func (this *Player) GetCurrentVIPExp() (exp int64, money int64) {
money = 0 money = 0
} }
if oldVipLevel != this.VIP { if oldVipLevel != this.VIP {
this.GetVIPLevel() //玩家VIP升级
this.SCVIPInfo()
PetMgrSington.CheckSkinRed(this)
logger.Logger.Trace("VIP升级")
} }
return // 默认 return // 默认
} }
// GetVIPLevel 更新vip等级返回vip等级
func (this *Player) GetVIPLevel() int32 { func (this *Player) GetVIPLevel() int32 {
if this.IsRob { if this.IsRob {
return 0 return 0
@ -3711,16 +3963,14 @@ func (this *Player) GetVIPLevel() int32 {
} }
} }
} }
var b bool var b bool
if vip != this.VIP { if vip != this.VIP {
this.dirty = true
b = true b = true
//玩家VIP升级
this.SCVIPInfo()
logger.Logger.Trace("VIP升级") logger.Logger.Trace("VIP升级")
} }
this.VIP = vip this.VIP = vip
//玩家VIP升级
this.SCVIPInfo()
if b { if b {
PetMgrSington.CheckSkinRed(this) PetMgrSington.CheckSkinRed(this)
} }
@ -3773,7 +4023,7 @@ func (this *Player) GetPayGoodsInfo() {
logger.Logger.Tracef("GetPayGoodsInfo ShopPageBackend %+v", *info) logger.Logger.Tracef("GetPayGoodsInfo ShopPageBackend %+v", *info)
default: default:
var itemInfo []*playerproto.PayItem var itemInfo []*playerproto.PayItem
var items []*model.Item var items []*Item
if len(info.Amount) > 0 { if len(info.Amount) > 0 {
this.AddCoin(int64(info.Amount[0]), 0, info.GainWay, "Callback_login", info.Remark) this.AddCoin(int64(info.Amount[0]), 0, info.GainWay, "Callback_login", info.Remark)
this.AddDiamond(int64(info.Amount[1]), 0, info.GainWay, "Callback_login", info.Remark) this.AddDiamond(int64(info.Amount[1]), 0, info.GainWay, "Callback_login", info.Remark)
@ -3782,7 +4032,7 @@ func (this *Player) GetPayGoodsInfo() {
this.MoneyTotal += int64(info.ConsumeTypeNum) this.MoneyTotal += int64(info.ConsumeTypeNum)
if info.ItemInfo != nil { if info.ItemInfo != nil {
for _, v := range info.ItemInfo { for _, v := range info.ItemInfo {
items = append(items, &model.Item{ItemId: v.ItemId, ItemNum: v.ItemNum}) items = append(items, &Item{ItemId: v.ItemId, ItemNum: v.ItemNum})
itemInfo = append(itemInfo, &playerproto.PayItem{ itemInfo = append(itemInfo, &playerproto.PayItem{
ItemId: v.ItemId, ItemId: v.ItemId,
ItemNum: v.ItemNum, ItemNum: v.ItemNum,
@ -3838,14 +4088,7 @@ func (this *Player) GetPayGoodsInfo() {
info.Amount[2] = int32(this.GetVIPExpByPay(int64(info.ConsumeNum))) info.Amount[2] = int32(this.GetVIPExpByPay(int64(info.ConsumeNum)))
BagMgrSingleton.AddItems(&model.AddItemParam{ BagMgrSingleton.AddItems(this, items, 0, info.GainWay, info.Operator, info.Remark, 0, 0, false)
Platform: this.Platform,
SnId: this.SnId,
Change: items,
GainWay: info.GainWay,
Operator: info.Operator,
Remark: info.Remark,
})
PayGoodsInfo := &playerproto.SCPayGoodsInfo{ PayGoodsInfo := &playerproto.SCPayGoodsInfo{
Gold: info.Amount, Gold: info.Amount,
@ -4212,37 +4455,27 @@ func (this *Player) BindTelReward() {
// 发送奖励 // 发送奖励
plt := PlatformMgrSingleton.GetPlatform(this.Platform) plt := PlatformMgrSingleton.GetPlatform(this.Platform)
if plt != nil { if plt != nil {
var items []*model.Item var items []*Item
for k, v := range plt.BindTelReward { for k, v := range plt.BindTelReward {
switch k { switch k {
case 1: case 1:
items = append(items, &model.Item{ items = append(items, &Item{
ItemId: common.ItemIDCoin, ItemId: common.ItemIDCoin,
ItemNum: v, ItemNum: v,
}) })
case 2: case 2:
items = append(items, &model.Item{ items = append(items, &Item{
ItemId: common.ItemIDDiamond, ItemId: common.ItemIDDiamond,
ItemNum: v, ItemNum: v,
}) })
default: default:
items = append(items, &model.Item{ items = append(items, &Item{
ItemId: k, ItemId: k,
ItemNum: v, ItemNum: v,
}) })
} }
} }
BagMgrSingleton.AddItems(&model.AddItemParam{ BagMgrSingleton.AddItems(this, items, 0, common.GainWay_BindTel, "system", "绑定手机号", 0, 0, false)
Platform: this.Platform,
SnId: this.SnId,
Change: items,
Add: 0,
GainWay: common.GainWay_BindTel,
Operator: "system",
Remark: "绑定手机号奖励",
GameId: 0,
GameFreeId: 0,
})
} }
} }
@ -4275,7 +4508,7 @@ func (this *Player) addLotteryCount(count int32) {
} }
// AddPhoneScore 增加手机积分 // 增加手机积分
func (this *Player) AddPhoneScore(num, add int64, gainWay int32, oper, remark string) { func (this *Player) AddPhoneScore(num, add int64, gainWay int32, oper, remark string) {
if num == 0 { if num == 0 {
return return
@ -4284,20 +4517,22 @@ func (this *Player) AddPhoneScore(num, add int64, gainWay int32, oper, remark st
return return
} }
logger.Logger.Tracef("snid(%v) AddPhoneScore(%v)", this.SnId, num) logger.Logger.Tracef("snid(%v) AddPhoneScore(%v)", this.SnId, num)
if num != 0 /*&& !async*/ {
this.dirty = true this.dirty = true
if num > 0 { if num > 0 {
this.PhoneScore += num
} else {
if -num > this.PhoneScore {
logger.Logger.Errorf("Player.AddPhoneScore exception!!! num(%v) oper(%v)", num, oper)
num = -this.PhoneScore
this.PhoneScore = 0
} else {
this.PhoneScore += num this.PhoneScore += num
} else {
if -num > this.PhoneScore {
logger.Logger.Errorf("Player.AddPhoneScore exception!!! num(%v) oper(%v)", num, oper)
num = -this.PhoneScore
this.PhoneScore = 0
} else {
this.PhoneScore += num
}
} }
this.SendDiffData()
} }
this.SendDiffData()
} }
// 抽奖任务 // 抽奖任务
@ -4421,20 +4656,14 @@ func (this *Player) CollectTask(taskId int32, num int64) {
// 每日转盘抽奖赠送一个 // 每日转盘抽奖赠送一个
switch taskId { switch taskId {
case common.TaskTypeTurnplate, common.TaskTypeFirstLogin: case common.TaskTypeTurnplate, common.TaskTypeFirstLogin:
BagMgrSingleton.AddItems(&model.AddItemParam{ oper := fmt.Sprintf("集卡活动%v", taskId)
Platform: this.Platform, var items []*Item
SnId: this.SnId, items = append(items, &Item{
Change: []*model.Item{ ItemId: common.ItemIDCollectBox,
{ ItemNum: num,
ItemId: common.ItemIDCollectBox, ObtainTime: time.Now().Unix(),
ItemNum: num,
ObtainTime: time.Now().Unix(),
},
},
GainWay: common.GainWayItemCollectLogin,
Operator: "system",
Remark: fmt.Sprintf("集卡活动%v", taskId),
}) })
BagMgrSingleton.AddItems(this, items, 0, common.GainWayItemCollectLogin, "system", oper, 0, 0, false)
default: default:
} }
} }
@ -4523,23 +4752,16 @@ func (this *Player) GetWeekCardAwary(id int32) {
if !this.WeekCardAward[id] { if !this.WeekCardAward[id] {
//获取周卡奖励 //获取周卡奖励
items := data.GetDayRewards() items := data.GetDayRewards()
var addItem []*model.Item addItem := []*Item{}
for itemId, itemNum := range items { for itemId, itemNum := range items {
item := &model.Item{ItemId: int32(itemId), ItemNum: itemNum, ObtainTime: time.Now().Unix()} item := &Item{ItemId: int32(itemId), ItemNum: itemNum, ObtainTime: time.Now().Unix()}
addItem = append(addItem, item) addItem = append(addItem, item)
itemInfo := &playerproto.PayItem{} itemInfo := &playerproto.PayItem{}
itemInfo.ItemId = int32(itemId) itemInfo.ItemId = int32(itemId)
itemInfo.ItemNum = itemNum itemInfo.ItemNum = itemNum
ret.Items = append(ret.Items, itemInfo) ret.Items = append(ret.Items, itemInfo)
} }
BagMgrSingleton.AddItems(&model.AddItemParam{ BagMgrSingleton.AddItems(this, addItem, 0, common.GainWay_WeekCardAward, "system", "周卡每日奖励", 0, 0, false)
Platform: this.Platform,
SnId: this.SnId,
Change: addItem,
GainWay: common.GainWay_WeekCardAward,
Operator: "system",
Remark: "周卡每日奖励",
})
//返回消息 //返回消息
this.WeekCardAward[id] = true this.WeekCardAward[id] = true
ret.WeekCardAward = this.WeekCardAward[id] ret.WeekCardAward = this.WeekCardAward[id]
@ -4575,34 +4797,43 @@ func (this *Player) GetWeekCardPrivilege(typeId int32) bool {
// 增加记牌器道具时限 // 增加记牌器道具时限
func (this *Player) AddItemRecExpireTime(itemId int32, num, add int64, gainWay int32, oper, remark string) { func (this *Player) AddItemRecExpireTime(itemId int32, num, add int64, gainWay int32, oper, remark string) {
if num <= 0 { if num == 0 {
return return
} }
logger.Logger.Tracef("snid(%v) AddItemRecExpireTime, itemId:(%v), num:(%v)", this.SnId, itemId, num) logger.Logger.Tracef("snid(%v) AddItemRecExpireTime, itemId:(%v), num:(%v)", this.SnId, itemId, num)
this.dirty = true if num != 0 /*&& !async*/ {
itemData := srvdata.GameItemMgr.Get(this.Platform, itemId) this.dirty = true
if itemData == nil { if num > 0 {
return itemData := srvdata.GameItemMgr.Get(this.Platform, itemId)
} if itemData == nil {
return
}
if this.ItemRecExpireTime == 0 { if this.ItemRecExpireTime == 0 {
this.ItemRecExpireTime = time.Now().Unix() + int64(itemData.Time)*3600*num this.ItemRecExpireTime = time.Now().Unix() + int64(itemData.Time)*3600*num
} else { } else {
if this.ItemRecExpireTime >= time.Now().Unix() { if this.ItemRecExpireTime >= time.Now().Unix() {
this.ItemRecExpireTime += int64(itemData.Time) * 3600 * num this.ItemRecExpireTime += int64(itemData.Time) * 3600 * num
} else { } else {
this.ItemRecExpireTime = time.Now().Unix() + int64(itemData.Time)*3600*num this.ItemRecExpireTime = time.Now().Unix() + int64(itemData.Time)*3600*num
} }
} }
if this.scene != nil && this.scene.gameSess != nil { if this.scene != nil && this.scene.gameSess != nil {
msg := &serverproto.WGBuyRecTimeItem{ msg := &serverproto.WGBuyRecTimeItem{
SnId: this.SnId, SnId: this.SnId,
ExpireTime: this.ItemRecExpireTime, ExpireTime: this.ItemRecExpireTime,
Diamond: this.Diamond, Diamond: this.Diamond,
}
proto.SetDefaults(msg)
this.SendToGame(int(serverproto.SSPacketID_PACKET_WG_BUYRECTIMEITEM), msg)
}
} }
this.SendToGame(int(serverproto.SSPacketID_PACKET_WG_BUYRECTIMEITEM), msg)
this.SendDiffData()
} }
} }

View File

@ -1,7 +1,7 @@
package main package main
import ( import (
"fmt" "strconv"
"time" "time"
"mongo.games.com/goserver/core" "mongo.games.com/goserver/core"
@ -153,7 +153,7 @@ func (c *PlayerCacheMgr) Get(plt string, snid int32, cb func(*PlayerCacheItem, b
} }
} }
})).StartByExecutor(fmt.Sprintf("Player%v", snid)) }), "PlayerCacheMgr.Get").StartByExecutor(strconv.Itoa(int(snid)))
} }
func (c *PlayerCacheMgr) GetMore(plt string, snid []int32, cb func([]*PlayerCacheItem, bool)) { func (c *PlayerCacheMgr) GetMore(plt string, snid []int32, cb func([]*PlayerCacheItem, bool)) {

View File

@ -146,9 +146,8 @@ func (spd *ScenePolicyData) CostPayment(s *Scene, p *Player) bool {
for _, v := range items { for _, v := range items {
v.ItemNum = -v.ItemNum v.ItemNum = -v.ItemNum
} }
BagMgrSingleton.AddItems(&model.AddItemParam{ BagMgrSingleton.AddItemsV2(&model.AddItemParam{
Platform: p.Platform, P: p.PlayerData,
SnId: p.SnId,
Change: items, Change: items,
GainWay: common.GainWayRoomCost, GainWay: common.GainWayRoomCost,
Operator: "system", Operator: "system",
@ -181,31 +180,22 @@ func (spd *ScenePolicyData) GiveCostPayment(s *Scene, snid int32) bool {
p := PlayerMgrSington.GetPlayerBySnId(snid) p := PlayerMgrSington.GetPlayerBySnId(snid)
if p != nil { if p != nil {
BagMgrSingleton.AddItems(&model.AddItemParam{ BagMgrSingleton.AddItemsV2(&model.AddItemParam{
Platform: p.Platform, P: p.PlayerData,
SnId: p.SnId,
Change: items, Change: items,
GainWay: common.GainWayRoomCost, GainWay: common.GainWayRoomCost,
Operator: "system", Operator: "system",
Remark: "竞技场房间费用返还", Remark: "竞技场房间费用返还",
GameId: int64(s.gameId), GameId: int64(s.gameId),
GameFreeId: int64(s.dbGameFree.GetId()), GameFreeId: int64(s.dbGameFree.GetId()),
NoLog: false,
RoomConfigId: roomConfig.GetId(), RoomConfigId: roomConfig.GetId(),
}) })
} else { } else {
BagMgrSingleton.AddItemsOffline(&model.AddItemParam{ BagMgrSingleton.AddItemsOffline(s.limitPlatform.IdStr, snid, items, common.GainWayRoomCost, "system",
Platform: s.limitPlatform.IdStr, "竞技场费用返还", int64(s.gameId), int64(s.dbGameFree.GetId()), false, func(err error) {
SnId: snid, logger.Logger.Errorf("竞技场房间费用返还失败, err: %v", err)
Change: items, })
GainWay: common.GainWayRoomCost,
Operator: "system",
Remark: "竞技场房间费用返还",
GameId: int64(s.gameId),
GameFreeId: int64(s.dbGameFree.GetId()),
RoomConfigId: roomConfig.GetId(),
}, func(err error) {
logger.Logger.Errorf("竞技场房间费用返还失败, err: %v", err)
})
} }
return false return false
} }

View File

@ -4,6 +4,8 @@ import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"math/rand" "math/rand"
"mongo.games.com/game/protocol/bag"
"mongo.games.com/game/srvdata"
"slices" "slices"
"time" "time"
@ -19,7 +21,6 @@ import (
hall_proto "mongo.games.com/game/protocol/gamehall" hall_proto "mongo.games.com/game/protocol/gamehall"
"mongo.games.com/game/protocol/shop" "mongo.games.com/game/protocol/shop"
webapi_proto "mongo.games.com/game/protocol/webapi" webapi_proto "mongo.games.com/game/protocol/webapi"
"mongo.games.com/game/srvdata"
"mongo.games.com/game/webapi" "mongo.games.com/game/webapi"
) )
@ -540,19 +541,8 @@ func (this *ShopMgr) shopAddItem(p *Player, shopInfo *model.ShopInfo, vipShopId
} }
for _, info := range shopInfo.GetItems() { for _, info := range shopInfo.GetItems() {
BagMgrSingleton.AddItems(&model.AddItemParam{ item := &Item{ItemId: info.ItemId, ItemNum: info.ItemNum, ObtainTime: time.Now().Unix()}
Platform: p.Platform, BagMgrSingleton.AddItems(p, []*Item{item}, 0, int32(gainWay), "system", name, 0, 0, false)
SnId: p.SnId,
Change: []*model.Item{
{
ItemId: info.ItemId,
ItemNum: info.ItemNum,
},
},
GainWay: int32(gainWay),
Operator: "system",
Remark: name,
})
} }
} }
@ -702,19 +692,12 @@ func (this *ShopMgr) GainShop(shopInfo *model.ShopInfo, p *Player, vipShopId, po
case ShopConsumePhoneScore: case ShopConsumePhoneScore:
p.AddPhoneScore(-costNum, 0, gainWay, "sys", shopName) p.AddPhoneScore(-costNum, 0, gainWay, "sys", shopName)
case ShopConsumeDiamondScore: case ShopConsumeDiamondScore:
BagMgrSingleton.AddItems(&model.AddItemParam{ var items []*Item
Platform: p.Platform, items = append(items, &Item{
SnId: p.SnId, ItemId: common.ItemDiamondScore, // 物品id
Change: []*model.Item{ ItemNum: int64(-costNum), // 数量
{
ItemId: common.ItemDiamondScore,
ItemNum: -costNum,
},
},
GainWay: common.GainWayBuyItem,
Operator: "system",
Remark: "商城购买消耗钻石积分",
}) })
BagMgrSingleton.AddItems(p, items, 0, common.GainWayBuyItem, "system", "商城购买消耗钻石积分", 0, 0, false)
default: default:
logger.Logger.Errorf("GainShop ConstType[%v] err", shopInfo.ConstType) logger.Logger.Errorf("GainShop ConstType[%v] err", shopInfo.ConstType)
return shop.OpResultCode_OPRC_Error return shop.OpResultCode_OPRC_Error
@ -866,90 +849,51 @@ func (this *ShopMgr) Exchange(p *Player, goodsId int32, username, mobile, commen
return false return false
} }
var itemInfo []*model.Item var itemInfo []model.ItemInfo
// TODO 服务器处理 减劵 成功后调后台生成订单 // TODO 服务器处理 减劵 成功后调后台生成订单
// 判断p.VCoin是否足够 不足返回错误 足够扣掉 另外需从后台操作回执成功生成扣除V卡的订单 回执失败 // 判断p.VCoin是否足够 不足返回错误 足够扣掉 另外需从后台操作回执成功生成扣除V卡的订单 回执失败
//扣除V卡 //扣除V卡
if info.Price > 0 { if info.Price > 0 {
item := BagMgrSingleton.GetItem(p.SnId, common.ItemIDVCard) item := model.ItemInfo{
n := int64(info.Price * num) ItemId: common.ItemIDVCard,
if item != nil && item.ItemNum >= n { ItemNum: int64(info.Price * num),
BagMgrSingleton.AddItems(&model.AddItemParam{ }
Platform: p.Platform, _, code, _ := BagMgrSingleton.AddItem(p, int64(item.ItemId), -item.ItemNum, 0, common.GainWay_Exchange,
SnId: p.SnId, "sys", fmt.Sprintf("兑换扣除%v", item.ItemId), 0, 0, false)
Change: []*model.Item{ if code != bag.OpResultCode_OPRC_Sucess { // 扣掉V卡
{
ItemId: item.ItemId,
ItemNum: -n,
},
},
GainWay: common.GainWay_Exchange,
Operator: "system",
Remark: fmt.Sprintf("兑换扣除%v", item.ItemId),
})
} else {
p.SendToClient(int(shop.SPacketID_PACKET_SC_SHOP_EXCHANGE), pack) p.SendToClient(int(shop.SPacketID_PACKET_SC_SHOP_EXCHANGE), pack)
return false return false
} }
itemInfo = append(itemInfo, &model.Item{ itemInfo = append(itemInfo, item)
ItemId: item.ItemId,
ItemNum: n,
})
} }
//扣除金券 //扣除金券
if info.JPrice > 0 { if info.JPrice > 0 {
item := BagMgrSingleton.GetItem(p.SnId, common.ItemIDJCard) item := model.ItemInfo{
n := int64(info.JPrice * num) ItemId: common.ItemIDJCard,
if item != nil && item.ItemNum >= n { ItemNum: int64(info.JPrice * num),
BagMgrSingleton.AddItems(&model.AddItemParam{ }
Platform: p.Platform, _, _, isF := BagMgrSingleton.AddItem(p, int64(item.ItemId), -item.ItemNum, 0, common.GainWay_Exchange,
SnId: p.SnId, "sys", fmt.Sprintf("兑换扣除%v", item.ItemId), 0, 0, false)
Change: []*model.Item{ if !isF { // 扣掉金券
{
ItemId: item.ItemId,
ItemNum: -n,
},
},
GainWay: common.GainWay_Exchange,
Operator: "system",
Remark: fmt.Sprintf("兑换扣除%v", item.ItemId),
})
} else {
pack.RetCode = shop.OpResultCode_OPRC_JCoinNotEnough pack.RetCode = shop.OpResultCode_OPRC_JCoinNotEnough
p.SendToClient(int(shop.SPacketID_PACKET_SC_SHOP_EXCHANGE), pack) p.SendToClient(int(shop.SPacketID_PACKET_SC_SHOP_EXCHANGE), pack)
return false return false
} }
itemInfo = append(itemInfo, &model.Item{ itemInfo = append(itemInfo, item)
ItemId: item.ItemId,
ItemNum: n,
})
} }
if info.DPrice > 0 { if info.DPrice > 0 {
n := int64(info.DPrice * num) item := model.ItemInfo{
item := BagMgrSingleton.GetItem(p.SnId, common.ItemIDJCard) ItemId: common.ItemDollCard,
if item != nil && item.ItemNum >= n { ItemNum: int64(info.JPrice * num),
BagMgrSingleton.AddItems(&model.AddItemParam{ }
Platform: p.Platform, _, _, isF := BagMgrSingleton.AddItem(p, int64(item.ItemId), -item.ItemNum, 0, common.GainWayItemShopChangeDoll,
SnId: p.SnId, "sys", fmt.Sprintf("兑换娃娃扣除%v", item.ItemId), 0, 0, false)
Change: []*model.Item{ if !isF { // 扣掉金券
{
ItemId: item.ItemId,
ItemNum: -n,
},
},
GainWay: common.GainWayItemShopChangeDoll,
Operator: "system",
Remark: fmt.Sprintf("兑换娃娃扣除%v", item.ItemId),
})
} else {
pack.RetCode = shop.OpResultCode_OPRC_DCoinNotEnough pack.RetCode = shop.OpResultCode_OPRC_DCoinNotEnough
p.SendToClient(int(shop.SPacketID_PACKET_SC_SHOP_EXCHANGE), pack) p.SendToClient(int(shop.SPacketID_PACKET_SC_SHOP_EXCHANGE), pack)
return false return false
} }
itemInfo = append(itemInfo, &model.Item{ itemInfo = append(itemInfo, item)
ItemId: common.ItemDollCard,
ItemNum: n,
})
} }
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} { task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
pack := &webapi_proto.ASCreateExchangeOrder{ pack := &webapi_proto.ASCreateExchangeOrder{
@ -983,15 +927,8 @@ func (this *ShopMgr) Exchange(p *Player, goodsId int32, username, mobile, commen
} }
var amount [ShopParamMax]int32 var amount [ShopParamMax]int32
//保存db //保存db
var items []model.ItemInfo
for _, v := range itemInfo {
items = append(items, model.ItemInfo{
ItemId: v.ItemId,
ItemNum: v.ItemNum,
})
}
dbShop := this.NewDbShop(p, 0, amount[:], ExchangeConsumeCash, info.Cash*num, dbShop := this.NewDbShop(p, 0, amount[:], ExchangeConsumeCash, info.Cash*num,
common.GainWay_ShopBuy, items, cdata.Id, cdata.Name, 0, "", []int32{}) common.GainWay_ShopBuy, itemInfo, cdata.Id, cdata.Name, 0, "", []int32{})
err = model.InsertDbShopLog(dbShop) err = model.InsertDbShopLog(dbShop)
if err != nil { if err != nil {
logger.Logger.Errorf("model.InsertDbShopLog err:", err) logger.Logger.Errorf("model.InsertDbShopLog err:", err)
@ -1058,16 +995,16 @@ func (this *ShopMgr) Exchange(p *Player, goodsId int32, username, mobile, commen
} }
} }
logger.Logger.Trace("API_CreateExchange: ", as.Tag, as.GetReturnCPO()) logger.Logger.Trace("API_CreateExchange: ", as.Tag, as.GetReturnCPO())
if len(itemInfo) > 0 { var items []*Item
BagMgrSingleton.AddItems(&model.AddItemParam{ for _, v := range itemInfo {
Platform: p.Platform, items = append(items, &Item{
SnId: p.SnId, ItemId: v.ItemId,
Change: itemInfo, ItemNum: v.ItemNum,
GainWay: common.GainWay_Exchange,
Operator: "system",
Remark: "兑换返还",
}) })
} }
if len(items) > 0 {
BagMgrSingleton.AddItems(p, items, 0, common.GainWay_Exchange, "system", "返还物品", 0, 0, false) // 后台订单创建失败 返回物品
}
} }
p.SendToClient(int(shop.SPacketID_PACKET_SC_SHOP_EXCHANGE), pack) p.SendToClient(int(shop.SPacketID_PACKET_SC_SHOP_EXCHANGE), pack)

View File

@ -609,38 +609,12 @@ func (this *Tournament) signUpCost(p *Player, tmId int32, cost bool) (bool, int3
logger.Logger.Trace("道具不足") logger.Logger.Trace("道具不足")
return false, int32(tournament.SignRaceCode_OPRC_NoItem) return false, int32(tournament.SignRaceCode_OPRC_NoItem)
} else { } else {
BagMgrSingleton.AddItems(&model.AddItemParam{ BagMgrSingleton.AddItem(p, int64(item.ItemId), -gmd.SignupCostItem.ItemNum, 0, common.GainWay_MatchSignup,
Platform: p.Platform, "player", gmd.MatchName+"-报名消耗", gameId, int64(gmd.GameFreeId), false)
SnId: p.SnId,
Change: []*model.Item{
{
ItemId: item.ItemId,
ItemNum: -gmd.SignupCostItem.ItemNum,
},
},
GainWay: common.GainWay_MatchSignup,
Operator: "player",
Remark: gmd.MatchName + "-报名消耗",
GameId: gameId,
GameFreeId: int64(gmd.GameFreeId),
})
} }
} else { } else {
BagMgrSingleton.AddItems(&model.AddItemParam{ BagMgrSingleton.AddItem(p, int64(item.ItemId), gmd.SignupCostItem.ItemNum, 0, common.GainWay_MatchSignup,
Platform: p.Platform, "player", gmd.MatchName+"-报名退还", gameId, int64(gmd.GameFreeId), false)
SnId: p.SnId,
Change: []*model.Item{
{
ItemId: item.ItemId,
ItemNum: gmd.SignupCostItem.ItemNum,
},
},
GainWay: common.GainWay_MatchSignup,
Operator: "player",
Remark: gmd.MatchName + "-报名退还",
GameId: gameId,
GameFreeId: int64(gmd.GameFreeId),
})
} }
} else { } else {
logger.Logger.Trace("道具不足") logger.Logger.Trace("道具不足")
@ -1419,21 +1393,11 @@ func (this *Tournament) sendPromotionInfo(mc *PlayerMatchContext, sortId int64,
if info.ItemNum <= 0 { if info.ItemNum <= 0 {
continue continue
} }
BagMgrSingleton.AddItems(&model.AddItemParam{ item := &Item{
Platform: mc.p.Platform, ItemId: info.ItemId,
SnId: mc.p.SnId, ItemNum: int64(info.ItemNum),
Change: []*model.Item{ }
{ BagMgrSingleton.AddItems(mc.p, []*Item{item}, 0, common.GainWay_MatchSystemSupply, "system", mc.tm.gmd.MatchName+"排名奖励", 0, 0, false)
ItemId: info.ItemId,
ItemNum: int64(info.ItemNum),
},
},
GainWay: common.GainWay_MatchSystemSupply,
Operator: "system",
Remark: mc.tm.gmd.MatchName + "排名奖励",
GameId: int64(mc.tm.dbGameFree.GetGameId()),
GameFreeId: int64(mc.tm.dbGameFree.GetId()),
})
} }
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -568,20 +568,11 @@ func DrawWelfareDate(dates []*webapi_proto.WelfareDate, p *Player, gainWay int32
} }
case 3: //道具 case 3: //道具
if v.Grade > 0 { if v.Grade > 0 {
BagMgrSingleton.AddItems(&model.AddItemParam{ item := &Item{
Platform: p.Platform, ItemId: v.Item_Id,
SnId: p.SnId, ItemNum: int64(v.Grade),
Change: []*model.Item{ }
{ BagMgrSingleton.AddItems(p, []*Item{item}, 0, gainWay, oper, remark, 0, 0, false)
ItemId: v.Item_Id,
ItemNum: int64(v.Grade),
},
},
Add: 0,
GainWay: gainWay,
Operator: oper,
Remark: remark,
})
} }
} }
} }
@ -896,9 +887,8 @@ func (this *WelfareMgr) GetAddUp2Award(p *Player, day int32) {
items = append(items, item) items = append(items, item)
} }
} }
BagMgrSingleton.AddItems(&model.AddItemParam{ BagMgrSingleton.AddItemsV2(&model.AddItemParam{
Platform: p.Platform, P: p.PlayerData,
SnId: p.SnId,
Change: items, Change: items,
Cost: cost, Cost: cost,
Add: 0, Add: 0,
@ -907,6 +897,7 @@ func (this *WelfareMgr) GetAddUp2Award(p *Player, day int32) {
Remark: "累计签到进阶奖励获得", Remark: "累计签到进阶奖励获得",
GameId: 0, GameId: 0,
GameFreeId: 0, GameFreeId: 0,
NoLog: false,
}) })
} }
//通知客户端 //通知客户端