Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
247912afd3
@ -286,6 +286,8 @@ type (
|
||||
UseAssistHero(uid, friendId string) (*pb.DBHero, error)
|
||||
// 切磋结束通知
|
||||
QiecuoFinishNotify(redUid, matchId string) error
|
||||
// 创角 更新玩家的基本信息
|
||||
ChangeUInfo(uid string, uinfo *pb.BaseUserInfo) (err error)
|
||||
// 红点
|
||||
IGetReddot
|
||||
IUpdateUserBaseInfo
|
||||
|
@ -61,7 +61,7 @@ func (this *apiComp) List(session comm.IUserSession, req *pb.FriendListReq) (err
|
||||
list = append(list, base)
|
||||
}
|
||||
update = make(map[string]interface{}, 0)
|
||||
if configure.Now().Unix() >= self.CleanTime || self.CleanTime == 0 {
|
||||
if configure.Now().Unix() > self.CleanTime || self.CleanTime == 0 {
|
||||
self.CleanTime = configure.Now().Unix() + 3*24*3600
|
||||
self.Weapplyids = []string{}
|
||||
update["weapplyids"] = self.Weapplyids
|
||||
|
@ -6,6 +6,7 @@ import (
|
||||
"go_dreamfactory/lego/sys/mgo"
|
||||
"go_dreamfactory/modules"
|
||||
"go_dreamfactory/pb"
|
||||
"go_dreamfactory/sys/configure"
|
||||
"go_dreamfactory/sys/db"
|
||||
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
@ -48,9 +49,7 @@ func (this *ModelFriend) GetFriend(uid string) (info *pb.DBFriend, err error) {
|
||||
this.moduole.Errorln(err)
|
||||
return
|
||||
}
|
||||
if !user.Created {
|
||||
return
|
||||
}
|
||||
|
||||
info = &pb.DBFriend{
|
||||
Id: primitive.NewObjectID().Hex(),
|
||||
Uid: uid,
|
||||
@ -61,6 +60,8 @@ func (this *ModelFriend) GetFriend(uid string) (info *pb.DBFriend, err error) {
|
||||
GetZandIds: make([]string, 0),
|
||||
Record: make([]*pb.AssistRecord, 0),
|
||||
Beblackids: make([]string, 0),
|
||||
CleanTime: configure.Now().Unix() + 3*3600*24,
|
||||
UpdateTime: configure.Now().Unix(),
|
||||
}
|
||||
err = this.Add(uid, info)
|
||||
}
|
||||
@ -82,9 +83,7 @@ func (this *ModelFriend) GetFriend(uid string) (info *pb.DBFriend, err error) {
|
||||
this.moduole.Errorln(err)
|
||||
return
|
||||
}
|
||||
if !user.Created {
|
||||
return
|
||||
}
|
||||
|
||||
info = &pb.DBFriend{
|
||||
Id: primitive.NewObjectID().Hex(),
|
||||
Uid: uid,
|
||||
@ -95,6 +94,8 @@ func (this *ModelFriend) GetFriend(uid string) (info *pb.DBFriend, err error) {
|
||||
GetZandIds: make([]string, 0),
|
||||
Record: make([]*pb.AssistRecord, 0),
|
||||
Beblackids: make([]string, 0),
|
||||
CleanTime: configure.Now().Unix() + 3*3600*24,
|
||||
UpdateTime: configure.Now().Unix(),
|
||||
}
|
||||
err = model.Add(uid, info)
|
||||
}
|
||||
@ -124,3 +125,13 @@ func (this *ModelFriend) GetFriends(uids []string) (friends []*pb.DBFriend, err
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// 更新玩家的基本信息
|
||||
func (this *ModelFriend) ChangeUInfo(uid string, uinfo *pb.BaseUserInfo) (err error) {
|
||||
if uinfo != nil {
|
||||
err = this.Change(uid, map[string]interface{}{
|
||||
"uinfo": uinfo,
|
||||
})
|
||||
}
|
||||
return
|
||||
}
|
||||
|
@ -284,3 +284,7 @@ func (this *Friend) UpdateUserBaseInfo(session comm.IUserSession, info *pb.BaseU
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func (this *Friend) ChangeUInfo(uid string, uinfo *pb.BaseUserInfo) (err error) {
|
||||
return this.modelFriend.ChangeUInfo(uid, uinfo)
|
||||
}
|
||||
|
@ -141,7 +141,7 @@ func (this *apiComp) Create(session comm.IUserSession, req *pb.UserCreateReq) (e
|
||||
this.module.modelUser.ResAutoReplies(session, user.Resreplies)
|
||||
this.module.plunder.InitPlunderByUser(session)
|
||||
// 初始好友信息
|
||||
this.module.ModuleFriend.GetFriendList(session.GetUserId())
|
||||
this.module.ModuleFriend.ChangeUInfo(session.GetUserId(), comm.GetUserBaseInfo(user))
|
||||
})
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user