This commit is contained in:
meixiongfeng 2023-07-11 17:28:37 +08:00
commit 29e0cdda57
6 changed files with 27 additions and 18 deletions

View File

@ -66,6 +66,7 @@ type IUserSession interface {
Push() (err error) //警告 api传递过来的会话禁用此接口 Push() (err error) //警告 api传递过来的会话禁用此接口
Close() (err error) Close() (err error)
Reset() Reset()
Clone() (clone *UserSession) //克隆
ToString() string ToString() string
} }

View File

@ -159,7 +159,15 @@ func (this *UserSession) Push() (err error) {
// 克隆 // 克隆
func (this *UserSession) Clone() (clone *UserSession) { func (this *UserSession) Clone() (clone *UserSession) {
clone = &UserSession{
msgqueue: make([]*pb.UserMessage, 0),
service: this.service,
IP: this.IP,
SessionId: this.SessionId,
GatewayServiceId: this.GatewayServiceId,
ServiceTag: this.ServiceTag,
UserId: this.UserId,
}
return return
} }

View File

@ -46,7 +46,7 @@ func (this *apiComp) ChallengeReward(session comm.IUserSession, req *pb.ArenaCha
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
Code: pb.ErrorCode_BattleValidationFailed, Code: pb.ErrorCode_BattleValidationFailed,
Title: pb.ErrorCode_BattleValidationFailed.ToString(), Title: pb.ErrorCode_BattleValidationFailed.ToString(),
Message: err.Error(), Message: "battle iswin fail",
} }
return return
} }

View File

@ -48,7 +48,6 @@ func (this *apiComp) Info(session comm.IUserSession, req *pb.ArenaInfoReq) (errd
info = &pb.DBArenaUser{ info = &pb.DBArenaUser{
Uid: session.GetUserId(), Uid: session.GetUserId(),
Name: user.Name, Name: user.Name,
// Avatar: user.Avatar,
Lv: user.Lv, Lv: user.Lv,
Sex: user.Gender, Sex: user.Gender,
Skin: user.CurSkin, Skin: user.CurSkin,

View File

@ -57,6 +57,7 @@ func (this *modelPasson) getUserPasson(uid string) (results *pb.DBPasson, err er
func (this *modelPasson) updateUserPasson(uid string, data *pb.DBPasson) (err error) { func (this *modelPasson) updateUserPasson(uid string, data *pb.DBPasson) (err error) {
if err = this.Change(uid, map[string]interface{}{ if err = this.Change(uid, map[string]interface{}{
"passonlv": data.Passonlv,
"teacher": data.Teacher, "teacher": data.Teacher,
"student": data.Student, "student": data.Student,
}); err != nil { }); err != nil {