diff --git a/modules/moonfantasy/api_ask.go b/modules/moonfantasy/api_ask.go index daad73ca4..cfae50ff6 100644 --- a/modules/moonfantasy/api_ask.go +++ b/modules/moonfantasy/api_ask.go @@ -88,7 +88,7 @@ func (this *apiComp) Ask(session comm.IUserSession, req *pb.MoonfantasyAskReq) ( code = pb.ErrorCode_DBError return } - mdata.Join = append(mdata.Join, &pb.UserInfo{Uid: user.Uid, Name: user.Name, Avatar: user.Avatar}) + mdata.Join = append(mdata.Join, &pb.UserInfo{Uid: user.Uid, Name: user.Name, Avatar: user.Avatar, Lv: user.Lv}) this.module.modelDream.Change(mdata.Id, map[string]interface{}{ "join": mdata.Join, }) diff --git a/modules/moonfantasy/modelDream.go b/modules/moonfantasy/modelDream.go index b8a410181..e9d124f7e 100644 --- a/modules/moonfantasy/modelDream.go +++ b/modules/moonfantasy/modelDream.go @@ -114,7 +114,7 @@ func (this *modelDreamComp) trigger(session comm.IUserSession, source *pb.Battle return } - if mdata, err = this.module.modelDream.addDreamData(&pb.UserInfo{Uid: user.Uid, Name: user.Name, Avatar: user.Avatar}, boss); err != nil { + if mdata, err = this.module.modelDream.addDreamData(&pb.UserInfo{Uid: user.Uid, Name: user.Name, Avatar: user.Avatar, Lv: user.Lv}, boss); err != nil { return } umfantasy.Mfantasys = append(umfantasy.Mfantasys, mdata.Id) diff --git a/pb/moonfantasy_db.pb.go b/pb/moonfantasy_db.pb.go index 0f9c55d1f..249128ca9 100644 --- a/pb/moonfantasy_db.pb.go +++ b/pb/moonfantasy_db.pb.go @@ -25,9 +25,10 @@ type UserInfo struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid"` //用户id - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name"` //昵称 - Avatar string `protobuf:"bytes,12,opt,name=avatar,proto3" json:"avatar"` // 头像 + Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid"` //用户id + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name"` //昵称 + Avatar string `protobuf:"bytes,3,opt,name=avatar,proto3" json:"avatar"` // 头像 + Lv int32 `protobuf:"varint,4,opt,name=lv,proto3" json:"lv"` //等级 } func (x *UserInfo) Reset() { @@ -83,6 +84,13 @@ func (x *UserInfo) GetAvatar() string { return "" } +func (x *UserInfo) GetLv() int32 { + if x != nil { + return x.Lv + } + return 0 +} + //月之秘境 type DBMoonFantasy struct { state protoimpl.MessageState @@ -288,11 +296,12 @@ var File_moonfantasy_moonfantasy_db_proto protoreflect.FileDescriptor var file_moonfantasy_moonfantasy_db_proto_rawDesc = []byte{ 0x0a, 0x20, 0x6d, 0x6f, 0x6f, 0x6e, 0x66, 0x61, 0x6e, 0x74, 0x61, 0x73, 0x79, 0x2f, 0x6d, 0x6f, 0x6f, 0x6e, 0x66, 0x61, 0x6e, 0x74, 0x61, 0x73, 0x79, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0x48, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x10, + 0x74, 0x6f, 0x22, 0x58, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x0c, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x22, 0x9f, 0x02, 0x0a, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x0e, 0x0a, 0x02, + 0x6c, 0x76, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x6c, 0x76, 0x22, 0x9f, 0x02, 0x0a, 0x0d, 0x44, 0x42, 0x4d, 0x6f, 0x6f, 0x6e, 0x46, 0x61, 0x6e, 0x74, 0x61, 0x73, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64,