Compare commits
5 Commits
1c6706d014
...
b5aba457a0
Author | SHA1 | Date |
---|---|---|
|
b5aba457a0 | |
|
b3d95e3512 | |
|
3c910a4ad7 | |
|
8c843ecf0b | |
|
68ca6af923 |
|
@ -1,6 +1,7 @@
|
||||||
package svc
|
package svc
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"github.com/globalsign/mgo"
|
"github.com/globalsign/mgo"
|
||||||
"github.com/globalsign/mgo/bson"
|
"github.com/globalsign/mgo/bson"
|
||||||
"mongo.games.com/game/dbproxy/mongo"
|
"mongo.games.com/game/dbproxy/mongo"
|
||||||
|
@ -113,10 +114,10 @@ func GetMoneyTotal(platform string, snid int32) int64 {
|
||||||
}
|
}
|
||||||
tc := new(m)
|
tc := new(m)
|
||||||
err = c.Pipe([]bson.M{
|
err = c.Pipe([]bson.M{
|
||||||
{"$match": bson.M{"snid": snid, "state": 1, "consumenum": bson.M{"$gt": 0}}},
|
{"$match": bson.M{"snid": snid, "state": 1, "consumetypenum": bson.M{"$gt": 0}}},
|
||||||
{"$group": bson.M{"_id": nil, "total": bson.M{"$sum": "$consumenum"}}},
|
{"$group": bson.M{"_id": nil, "total": bson.M{"$sum": "$consumetypenum"}}},
|
||||||
}).AllowDiskUse().One(tc)
|
}).AllowDiskUse().One(tc)
|
||||||
if err != nil {
|
if err != nil && !errors.Is(err, mgo.ErrNotFound) {
|
||||||
logger.Logger.Error("GetMoneyTotal error:", err)
|
logger.Logger.Error("GetMoneyTotal error:", err)
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package svc
|
package svc
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"net/rpc"
|
"net/rpc"
|
||||||
|
|
||||||
"github.com/globalsign/mgo"
|
"github.com/globalsign/mgo"
|
||||||
|
@ -65,40 +66,43 @@ func GetItemCount(platform string, snid, id int32, tp int) (count int64) {
|
||||||
{"$match": bson.M{"snid": snid, "logtype": 0, "itemid": id, "typeid": common.GainWay_Exchange}},
|
{"$match": bson.M{"snid": snid, "logtype": 0, "itemid": id, "typeid": common.GainWay_Exchange}},
|
||||||
{"$group": bson.M{"_id": nil, "count": bson.M{"$sum": "$count"}}},
|
{"$group": bson.M{"_id": nil, "count": bson.M{"$sum": "$count"}}},
|
||||||
}).AllowDiskUse().One(tc)
|
}).AllowDiskUse().One(tc)
|
||||||
if err != nil {
|
if err != nil && !errors.Is(err, mgo.ErrNotFound) {
|
||||||
logger.Logger.Warn("GetItemCount swapN error:", err)
|
logger.Logger.Warn("GetItemCount swapN error:", err)
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
swapN = tc.Count
|
swapN = tc.Count
|
||||||
|
|
||||||
// 比赛返回
|
// 比赛返回
|
||||||
|
tc = new(m)
|
||||||
err = c.Pipe([]bson.M{
|
err = c.Pipe([]bson.M{
|
||||||
{"$match": bson.M{"snid": snid, "logtype": 0, "itemid": id, "typeid": common.GainWay_MatchSignup}},
|
{"$match": bson.M{"snid": snid, "logtype": 0, "itemid": id, "typeid": common.GainWay_MatchSignup}},
|
||||||
{"$group": bson.M{"_id": nil, "count": bson.M{"$sum": "$count"}}},
|
{"$group": bson.M{"_id": nil, "count": bson.M{"$sum": "$count"}}},
|
||||||
}).AllowDiskUse().One(tc)
|
}).AllowDiskUse().One(tc)
|
||||||
if err != nil {
|
if err != nil && !errors.Is(err, mgo.ErrNotFound) {
|
||||||
logger.Logger.Warn("GetItemCount matchN error:", err)
|
logger.Logger.Warn("GetItemCount matchN error:", err)
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
matchN = tc.Count
|
matchN = tc.Count
|
||||||
|
|
||||||
// 消耗总数量
|
// 消耗总数量
|
||||||
|
tc = new(m)
|
||||||
err = c.Pipe([]bson.M{
|
err = c.Pipe([]bson.M{
|
||||||
{"$match": bson.M{"snid": snid, "logtype": 1, "itemid": id}},
|
{"$match": bson.M{"snid": snid, "logtype": 1, "itemid": id}},
|
||||||
{"$group": bson.M{"_id": nil, "count": bson.M{"$sum": "$count"}}},
|
{"$group": bson.M{"_id": nil, "count": bson.M{"$sum": "$count"}}},
|
||||||
}).AllowDiskUse().One(tc)
|
}).AllowDiskUse().One(tc)
|
||||||
if err != nil {
|
if err != nil && !errors.Is(err, mgo.ErrNotFound) {
|
||||||
logger.Logger.Warn("GetItemCount costN error:", err)
|
logger.Logger.Warn("GetItemCount costN error:", err)
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
costN = tc.Count
|
costN = tc.Count
|
||||||
|
|
||||||
// 获得总数量
|
// 获得总数量
|
||||||
|
tc = new(m)
|
||||||
err = c.Pipe([]bson.M{
|
err = c.Pipe([]bson.M{
|
||||||
{"$match": bson.M{"snid": snid, "logtype": 0, "itemid": id}},
|
{"$match": bson.M{"snid": snid, "logtype": 0, "itemid": id}},
|
||||||
{"$group": bson.M{"_id": nil, "count": bson.M{"$sum": "$count"}}},
|
{"$group": bson.M{"_id": nil, "count": bson.M{"$sum": "$count"}}},
|
||||||
}).AllowDiskUse().One(tc)
|
}).AllowDiskUse().One(tc)
|
||||||
if err != nil {
|
if err != nil && !errors.Is(err, mgo.ErrNotFound) {
|
||||||
logger.Logger.Warn("GetItemCount gainN error:", err)
|
logger.Logger.Warn("GetItemCount gainN error:", err)
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
|
@ -328,6 +328,10 @@ func (svc *PlayerDataSvc) GetPlayerDataBySnId(args *model.GetPlayerDataBySnIdArg
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
defer func() {
|
||||||
|
logger.Logger.Debugf("Player Data: snid:%v VCardCost:%v MoneyTotal:%v", ret.Pd.SnId, ret.Pd.VCardCost, ret.Pd.MoneyTotal)
|
||||||
|
}()
|
||||||
|
|
||||||
f := func(p *model.PlayerData) {
|
f := func(p *model.PlayerData) {
|
||||||
// 更新一下绑定关系
|
// 更新一下绑定关系
|
||||||
if p.PSnId > 0 && p.PCode != "" {
|
if p.PSnId > 0 && p.PCode != "" {
|
||||||
|
@ -410,7 +414,6 @@ func (svc *PlayerDataSvc) GetPlayerDataBySnId(args *model.GetPlayerDataBySnIdArg
|
||||||
if args.CorrectData && ret.Pd != nil {
|
if args.CorrectData && ret.Pd != nil {
|
||||||
CorrectData(ret.Pd)
|
CorrectData(ret.Pd)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -708,6 +708,8 @@ func ConvertPlayerDataToWebData(param *WebPlayerDataParam) *webapi.PlayerData {
|
||||||
pdfw.IsPermit = param.IsPermit
|
pdfw.IsPermit = param.IsPermit
|
||||||
pdfw.PermitScore = param.PermitScore
|
pdfw.PermitScore = param.PermitScore
|
||||||
pdfw.Long = param.Long
|
pdfw.Long = param.Long
|
||||||
|
pdfw.VCardCost = param.VCardCost
|
||||||
|
pdfw.MoneyTotal = param.MoneyTotal
|
||||||
return pdfw
|
return pdfw
|
||||||
}
|
}
|
||||||
func (this *PlayerData) IsMarkFlag(flag int) bool {
|
func (this *PlayerData) IsMarkFlag(flag int) bool {
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -205,6 +205,8 @@ message PlayerData{
|
||||||
bool IsPermit = 56; // 是否已购买典藏通行证
|
bool IsPermit = 56; // 是否已购买典藏通行证
|
||||||
int64 Long = 57; // 龙币数量
|
int64 Long = 57; // 龙币数量
|
||||||
int64 PermitScore = 58; // 赛季通行证积分
|
int64 PermitScore = 58; // 赛季通行证积分
|
||||||
|
int64 VCardCost = 59; // v卡消耗
|
||||||
|
int64 MoneyTotal = 60; // 充值总金额
|
||||||
}
|
}
|
||||||
|
|
||||||
message RoomInfo{
|
message RoomInfo{
|
||||||
|
|
2
public
2
public
|
@ -1 +1 @@
|
||||||
Subproject commit 1869e4641809a14e9e5d025e303bdb56350a801c
|
Subproject commit b99c38049f5744e9eda2860329a72fef4324520e
|
|
@ -376,7 +376,6 @@ func (this *Player) OnLogined() {
|
||||||
this.SendToRepSrv(this.PlayerData)
|
this.SendToRepSrv(this.PlayerData)
|
||||||
//红点检测
|
//红点检测
|
||||||
this.CheckShowRed()
|
this.CheckShowRed()
|
||||||
this.SCItems()
|
|
||||||
|
|
||||||
TaskSubjectSingleton.Touch(common.TaskTypeLogin, &TaskData{SnId: this.SnId, Num: 1}) // 登录游戏
|
TaskSubjectSingleton.Touch(common.TaskTypeLogin, &TaskData{SnId: this.SnId, Num: 1}) // 登录游戏
|
||||||
|
|
||||||
|
@ -3076,6 +3075,7 @@ func (this *Player) SendPlayerInfo() {
|
||||||
if this.scene != nil && this.thrscene == 0 {
|
if this.scene != nil && this.thrscene == 0 {
|
||||||
this.SendGameConfig(int32(this.scene.gameId), this.Platform, this.Channel)
|
this.SendGameConfig(int32(this.scene.gameId), this.Platform, this.Channel)
|
||||||
}
|
}
|
||||||
|
this.SCItems()
|
||||||
//this.SendJackpotInfo()
|
//this.SendJackpotInfo()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue