跨服数据校验

This commit is contained in:
meixiongfeng 2024-01-08 16:47:00 +08:00
parent 5a4c86758c
commit 5930911cf8
2 changed files with 6 additions and 4 deletions

View File

@ -40,7 +40,7 @@ func (this *ModelDragon) CreateDragon(session comm.IUserSession, dragons map[str
)
dragonList := make([]*pb.DBDragon, 0)
uid := session.GetUserId()
if this.module.IsCross() {
if db.IsCross() {
if dbModel, err = this.module.GetDBModelByUid(uid, this.TableName); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
@ -161,7 +161,7 @@ func (this *ModelDragon) CreateDragon(session comm.IUserSession, dragons map[str
// 获取坐骑列表
func (this *ModelDragon) GetDragonList(uid string) (dragon []*pb.DBDragon, err error) {
dragon = make([]*pb.DBDragon, 0)
if this.module.IsCross() {
if db.IsCross() {
if dbModel, err1 := this.module.GetDBModelByUid(uid, this.TableName); err1 == nil {
if err = dbModel.GetList(uid, &dragon); err != nil {
this.module.Errorf("err:%v", err)
@ -180,7 +180,7 @@ func (this *ModelDragon) GetDragonList(uid string) (dragon []*pb.DBDragon, err e
}
func (this *ModelDragon) UpdateDragonData(uid string, oid string, data map[string]interface{}) (err error) {
if this.module.IsCross() {
if db.IsCross() {
if dbModel, err1 := this.module.GetDBModelByUid(uid, this.TableName); err1 == nil {
if err = dbModel.ChangeList(uid, oid, data); err != nil {
this.module.Errorf("err:%v", err)

View File

@ -119,10 +119,12 @@ func (this *apiComp) Login(session comm.IUserSession, req *pb.UserLoginReq) (err
update["globalbuff"] = 0
update["consumPs"] = 0
update["loginContinueCount"] = expand.LoginContinueCount + 1
this.module.modelExpand.Change(user.Uid, update)
//this.module.modelExpand.Change(user.Uid, update)
this.module.modelExpand.ChangeUserExpand(user.Uid, update)
firstLogin = true
}
err = this.module.modelUser.Change(user.Uid, update)
err = this.module.modelUser.updateUserAttr(user.Uid, update)
if err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,