娃娃机娃娃卡获取明细
This commit is contained in:
parent
e7e08755a4
commit
be57df77a1
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
@ -113,6 +113,17 @@ func (svc *ItemLogSvc) UpdateState(req *model.UpdateParam, res *model.UpdateRes)
|
|||
return err
|
||||
}
|
||||
|
||||
func (svc *ItemLogSvc) GetClawdollItemLog(args *model.ClawdollItemLogReq, ret *[]model.CoinWAL) (err error) {
|
||||
cond := bson.M{"snid": args.Snid, "typeid": common.GainWayClawdollCostItem}
|
||||
c := ItemLogsCollection(args.Platform)
|
||||
if c == nil {
|
||||
return
|
||||
}
|
||||
|
||||
err = c.Find(cond).All(&ret)
|
||||
return
|
||||
}
|
||||
|
||||
func init() {
|
||||
rpc.Register(new(ItemLogSvc))
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ import (
|
|||
var (
|
||||
ItemLogDBName = "log"
|
||||
ItemLogCollName = "log_itemlog"
|
||||
ClawDollItemIds = []int32{40003, 40004, 80001, 80002}
|
||||
)
|
||||
|
||||
type ItemLog struct {
|
||||
|
@ -118,3 +119,37 @@ func UpdateItemState(param *UpdateParam) error {
|
|||
|
||||
return err
|
||||
}
|
||||
|
||||
type ClawdollItemLogReq struct {
|
||||
Platform string
|
||||
Snid int32 // 玩家id
|
||||
ItemIds []int32 // 道具id
|
||||
}
|
||||
|
||||
func GetClawdollItemLog(plt string, snid int32) (logs []ItemLog, err error) {
|
||||
|
||||
if rpcCli == nil {
|
||||
logger.Logger.Error("model.GetClawdollItemLog rpcCli == nil")
|
||||
return
|
||||
}
|
||||
|
||||
args := &ClawdollItemLogReq{
|
||||
Platform: plt,
|
||||
Snid: snid,
|
||||
}
|
||||
|
||||
args.ItemIds = append(args.ItemIds, ClawDollItemIds...)
|
||||
|
||||
var ret []ItemLog
|
||||
|
||||
//var ret ClawdollItemLogRet
|
||||
err = rpcCli.CallWithTimeout("ItemLogSvc.GetClawdollItemLog", args, &ret, time.Second*30)
|
||||
if err != nil {
|
||||
logger.Logger.Warnf("GetClawdollItemLog err:%v", err)
|
||||
return
|
||||
}
|
||||
|
||||
logs = ret
|
||||
|
||||
return
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -232,6 +232,8 @@ enum PlayerPacketID {
|
|||
PACKET_SCUpdateAttribute = 2841;//返回更新属性
|
||||
PACKET_SCGuideConfig = 2842;//返回引导配置
|
||||
PACKET_SCDataConfig = 2843;//通知配置更新
|
||||
PACKET_CSClawdollItemLog = 2844;//请求娃娃卡道具记录
|
||||
PACKET_SCClawdollItemLog = 2845;//返回娃娃卡道具记录
|
||||
}
|
||||
|
||||
// 账变记录
|
||||
|
@ -344,7 +346,6 @@ message PlayerData {
|
|||
int32 UseSkinId = 50; // 皮肤id
|
||||
string ChannelID = 51; // 渠道ID
|
||||
int32 GuideStep = 52; // 引导步骤; 最小为0,-1表示跳过引导了
|
||||
int64 ClawdollCard = 53; // 娃娃卡数量
|
||||
}
|
||||
|
||||
//周卡数据
|
||||
|
@ -1368,4 +1369,23 @@ message Config{
|
|||
//PACKET_SCDataConfig
|
||||
message SCDataConfig{
|
||||
repeated Config Cfg = 1;
|
||||
}
|
||||
}
|
||||
|
||||
//娃娃卡记录
|
||||
//PACKET_CSClawdollItemLog
|
||||
message CSClawdollItemLog{
|
||||
int32 typeId = 1; //1-娃娃卡记录 2-充值记录
|
||||
}
|
||||
//PACKET_SCClawdollItemLog
|
||||
message SCClawdollItemLog{
|
||||
int32 typeId = 1; //1-娃娃卡记录 2-充值记录
|
||||
repeated ClawdollItemLogData ItemLogs = 2;
|
||||
}
|
||||
|
||||
message ClawdollItemLogData{
|
||||
int32 ItemLogType = 1; //道具记录类型
|
||||
int32 ItemId = 2; //道具ID
|
||||
int64 Num = 3; //数量
|
||||
int64 Time = 4; //时间
|
||||
}
|
||||
|
||||
|
|
|
@ -3156,6 +3156,47 @@ func CSUpdateAttribute(s *netlib.Session, packetId int, data interface{}, sid in
|
|||
return nil
|
||||
}
|
||||
|
||||
// 获取获奖记录
|
||||
func CSClawdollItemLog(s *netlib.Session, packetId int, data interface{}, sid int64) error {
|
||||
logger.Logger.Tracef("CSClawdollItemLog Process %v", data)
|
||||
p := PlayerMgrSington.GetPlayer(sid)
|
||||
if p == nil {
|
||||
return nil
|
||||
}
|
||||
msg, ok := data.(*player_proto.CSClawdollItemLog)
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
|
||||
ret := &player_proto.SCClawdollItemLog{}
|
||||
ret.TypeId = msg.TypeId
|
||||
|
||||
var err error
|
||||
var ItemUseLogs []model.ItemLog
|
||||
|
||||
//娃娃机道具使用日志
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
ItemUseLogs, err = model.GetClawdollItemLog(p.Platform, p.SnId)
|
||||
return err
|
||||
}), task.CompleteNotifyWrapper(func(data interface{}, t task.Task) {
|
||||
for _, logInfo := range ItemUseLogs {
|
||||
infoData := &player_proto.ClawdollItemLogData{}
|
||||
|
||||
infoData.ItemId = logInfo.ItemId
|
||||
infoData.Time = logInfo.CreateTs
|
||||
infoData.Num = logInfo.Count
|
||||
infoData.ItemLogType = logInfo.LogType
|
||||
|
||||
ret.ItemLogs = append(ret.ItemLogs, infoData)
|
||||
}
|
||||
|
||||
p.SendToClient(int(player_proto.PlayerPacketID_PACKET_SCClawdollItemLog), ret)
|
||||
logger.Logger.Tracef("SCClawdollItemLog:%v", ret)
|
||||
}), "GetClawdollItemLog").Start()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
// 用户信息
|
||||
common.Register(int(player_proto.PlayerPacketID_PACKET_CS_PLAYERDATA), player_proto.CSPlayerData{}, CSPlayerData)
|
||||
|
@ -3189,4 +3230,6 @@ func init() {
|
|||
common.Register(int(player_proto.PlayerPacketID_PACKET_CSPopUpWindowsConfig), player_proto.CSPopUpWindowsConfig{}, CSPopUpWindowsConfig)
|
||||
// 更新属性;新手引导阶段
|
||||
common.Register(int(player_proto.PlayerPacketID_PACKET_CSUpdateAttribute), player_proto.CSUpdateAttribute{}, CSUpdateAttribute)
|
||||
//娃娃卡道具记录
|
||||
common.Register(int(player_proto.PlayerPacketID_PACKET_CSClawdollItemLog), player_proto.CSClawdollItemLog{}, CSClawdollItemLog)
|
||||
}
|
||||
|
|
|
@ -3001,10 +3001,6 @@ func (this *Player) SendPlayerInfo() {
|
|||
scPlayerData.Data.VCoin = item.ItemNum //V卡
|
||||
}
|
||||
|
||||
if item := BagMgrSingleton.GetItem(this.SnId, common.ItemIDClawdoll); item != nil {
|
||||
scPlayerData.Data.ClawdollCard = item.ItemNum //娃娃卡
|
||||
}
|
||||
|
||||
// 排位积分
|
||||
scPlayerData.Data.RankScore = RankMgrSingleton.GetPlayerRankScore(this.SnId)
|
||||
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue