From ffb8513fdebe7011983bb5b989d266b8c7d1b4c5 Mon Sep 17 00:00:00 2001 From: wdvxdr Date: Sat, 10 Oct 2020 23:57:02 +0800 Subject: [PATCH] feature support showpic --- client/pb/msg/msg.pb.go | 173 +++++++++++++++++++++++++++++++++++++--- client/pb/msg/msg.proto | 10 +++ message/elements.go | 5 ++ message/pack.go | 26 +++++- 4 files changed, 201 insertions(+), 13 deletions(-) diff --git a/client/pb/msg/msg.pb.go b/client/pb/msg/msg.pb.go index d8685f1d..2f3caac2 100644 --- a/client/pb/msg/msg.pb.go +++ b/client/pb/msg/msg.pb.go @@ -6073,6 +6073,116 @@ func (x *MsgElemInfoServtype3) GetFlashC2CPic() *NotOnlineImage { return nil } +type ResvAttr struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ImageShow *AnimationImageShow `protobuf:"bytes,7,opt,name=image_show,json=imageShow,proto3" json:"image_show,omitempty"` +} + +func (x *ResvAttr) Reset() { + *x = ResvAttr{} + if protoimpl.UnsafeEnabled { + mi := &file_msg_proto_msgTypes[57] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ResvAttr) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResvAttr) ProtoMessage() {} + +func (x *ResvAttr) ProtoReflect() protoreflect.Message { + mi := &file_msg_proto_msgTypes[57] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResvAttr.ProtoReflect.Descriptor instead. +func (*ResvAttr) Descriptor() ([]byte, []int) { + return file_msg_proto_rawDescGZIP(), []int{57} +} + +func (x *ResvAttr) GetImageShow() *AnimationImageShow { + if x != nil { + return x.ImageShow + } + return nil +} + +type AnimationImageShow struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + EffectId int32 `protobuf:"varint,1,opt,name=effect_id,json=effectId,proto3" json:"effect_id,omitempty"` + AnimationParam []byte `protobuf:"bytes,2,opt,name=animation_param,json=animationParam,proto3" json:"animation_param,omitempty"` + Unkown int32 `protobuf:"varint,3,opt,name=unkown,proto3" json:"unkown,omitempty"` +} + +func (x *AnimationImageShow) Reset() { + *x = AnimationImageShow{} + if protoimpl.UnsafeEnabled { + mi := &file_msg_proto_msgTypes[58] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AnimationImageShow) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AnimationImageShow) ProtoMessage() {} + +func (x *AnimationImageShow) ProtoReflect() protoreflect.Message { + mi := &file_msg_proto_msgTypes[58] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AnimationImageShow.ProtoReflect.Descriptor instead. +func (*AnimationImageShow) Descriptor() ([]byte, []int) { + return file_msg_proto_rawDescGZIP(), []int{58} +} + +func (x *AnimationImageShow) GetEffectId() int32 { + if x != nil { + return x.EffectId + } + return 0 +} + +func (x *AnimationImageShow) GetAnimationParam() []byte { + if x != nil { + return x.AnimationParam + } + return nil +} + +func (x *AnimationImageShow) GetUnkown() int32 { + if x != nil { + return x.Unkown + } + return 0 +} + var File_msg_proto protoreflect.FileDescriptor var file_msg_proto_rawDesc = []byte{ @@ -7032,11 +7142,23 @@ var file_msg_proto_rawDesc = []byte{ 0x73, 0x68, 0x54, 0x72, 0x6f, 0x6f, 0x70, 0x50, 0x69, 0x63, 0x12, 0x33, 0x0a, 0x0d, 0x66, 0x6c, 0x61, 0x73, 0x68, 0x5f, 0x63, 0x32, 0x63, 0x5f, 0x70, 0x69, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x4e, 0x6f, 0x74, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x49, 0x6d, 0x61, - 0x67, 0x65, 0x52, 0x0b, 0x66, 0x6c, 0x61, 0x73, 0x68, 0x43, 0x32, 0x63, 0x50, 0x69, 0x63, 0x2a, - 0x2e, 0x0a, 0x08, 0x53, 0x79, 0x6e, 0x63, 0x46, 0x6c, 0x61, 0x67, 0x12, 0x09, 0x0a, 0x05, 0x53, - 0x54, 0x41, 0x52, 0x54, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x4f, 0x4e, 0x54, 0x49, 0x4e, - 0x55, 0x4d, 0x45, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x54, 0x4f, 0x50, 0x10, 0x02, 0x42, - 0x07, 0x5a, 0x05, 0x2e, 0x3b, 0x6d, 0x73, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x67, 0x65, 0x52, 0x0b, 0x66, 0x6c, 0x61, 0x73, 0x68, 0x43, 0x32, 0x63, 0x50, 0x69, 0x63, 0x22, + 0x3e, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x76, 0x41, 0x74, 0x74, 0x72, 0x12, 0x32, 0x0a, 0x0a, 0x69, + 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x68, 0x6f, 0x77, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x13, 0x2e, 0x41, 0x6e, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6d, 0x61, 0x67, 0x65, + 0x53, 0x68, 0x6f, 0x77, 0x52, 0x09, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x53, 0x68, 0x6f, 0x77, 0x22, + 0x72, 0x0a, 0x12, 0x41, 0x6e, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6d, 0x61, 0x67, + 0x65, 0x53, 0x68, 0x6f, 0x77, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, + 0x49, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x61, 0x6e, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x61, 0x6e, 0x69, + 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x75, + 0x6e, 0x6b, 0x6f, 0x77, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x75, 0x6e, 0x6b, + 0x6f, 0x77, 0x6e, 0x2a, 0x2e, 0x0a, 0x08, 0x53, 0x79, 0x6e, 0x63, 0x46, 0x6c, 0x61, 0x67, 0x12, + 0x09, 0x0a, 0x05, 0x53, 0x54, 0x41, 0x52, 0x54, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x4f, + 0x4e, 0x54, 0x49, 0x4e, 0x55, 0x4d, 0x45, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x54, 0x4f, + 0x50, 0x10, 0x02, 0x42, 0x07, 0x5a, 0x05, 0x2e, 0x3b, 0x6d, 0x73, 0x67, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -7052,7 +7174,7 @@ func file_msg_proto_rawDescGZIP() []byte { } var file_msg_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 57) +var file_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 59) var file_msg_proto_goTypes = []interface{}{ (SyncFlag)(0), // 0: SyncFlag (*GetMessageRequest)(nil), // 1: GetMessageRequest @@ -7112,6 +7234,8 @@ var file_msg_proto_goTypes = []interface{}{ (*PbMultiMsgNew)(nil), // 55: PbMultiMsgNew (*PbMultiMsgTransmit)(nil), // 56: PbMultiMsgTransmit (*MsgElemInfoServtype3)(nil), // 57: MsgElemInfo_servtype3 + (*ResvAttr)(nil), // 58: ResvAttr + (*AnimationImageShow)(nil), // 59: AnimationImageShow } var file_msg_proto_depIdxs = []int32{ 0, // 0: GetMessageRequest.syncFlag:type_name -> SyncFlag @@ -7175,11 +7299,12 @@ var file_msg_proto_depIdxs = []int32{ 54, // 58: PbMultiMsgTransmit.pbItemList:type_name -> PbMultiMsgItem 41, // 59: MsgElemInfo_servtype3.flash_troop_pic:type_name -> CustomFace 31, // 60: MsgElemInfo_servtype3.flash_c2c_pic:type_name -> NotOnlineImage - 61, // [61:61] is the sub-list for method output_type - 61, // [61:61] is the sub-list for method input_type - 61, // [61:61] is the sub-list for extension type_name - 61, // [61:61] is the sub-list for extension extendee - 0, // [0:61] is the sub-list for field type_name + 59, // 61: ResvAttr.image_show:type_name -> AnimationImageShow + 62, // [62:62] is the sub-list for method output_type + 62, // [62:62] is the sub-list for method input_type + 62, // [62:62] is the sub-list for extension type_name + 62, // [62:62] is the sub-list for extension extendee + 0, // [0:62] is the sub-list for field type_name } func init() { file_msg_proto_init() } @@ -7872,6 +7997,30 @@ func file_msg_proto_init() { return nil } } + file_msg_proto_msgTypes[57].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResvAttr); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_msg_proto_msgTypes[58].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AnimationImageShow); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -7879,7 +8028,7 @@ func file_msg_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_msg_proto_rawDesc, NumEnums: 1, - NumMessages: 57, + NumMessages: 59, NumExtensions: 0, NumServices: 0, }, diff --git a/client/pb/msg/msg.proto b/client/pb/msg/msg.proto index ceda05e1..7763467a 100644 --- a/client/pb/msg/msg.proto +++ b/client/pb/msg/msg.proto @@ -707,4 +707,14 @@ enum SyncFlag { START = 0; CONTINUME = 1; STOP = 2; +} + +message ResvAttr { + AnimationImageShow image_show = 7; +} + +message AnimationImageShow { + int32 effect_id = 1; + bytes animation_param = 2; + int32 unkown = 3; } \ No newline at end of file diff --git a/message/elements.go b/message/elements.go index d1593d17..90ba660e 100644 --- a/message/elements.go +++ b/message/elements.go @@ -111,6 +111,11 @@ type GroupFlashPicElement struct { GroupImageElement } +type GroupShowPicElement struct { + GroupImageElement + EffectId int32 +} + type FriendFlashPicElement struct{ FriendImageElement } diff --git a/message/pack.go b/message/pack.go index 1da01041..936397b5 100644 --- a/message/pack.go +++ b/message/pack.go @@ -208,4 +208,28 @@ func (e *GroupFlashPicElement) Pack() (r []*msg.Elem) { }, }) return -} \ No newline at end of file +} + +func (e *GroupShowPicElement) Pack() (r []*msg.Elem) { + r = []*msg.Elem{} + res := &msg.ResvAttr{ImageShow: &msg.AnimationImageShow{ + EffectId: e.EffectId, + AnimationParam: []byte("{}"), + }} + reserve, _ := proto.Marshal(res) + r = append(r, &msg.Elem{ + CustomFace: &msg.CustomFace{ + FileType: 0, + Useful: 1, + ImageType: 1001, + FileId: int32(e.FileId), + FilePath: e.ImageId, + Size: e.Size, + Md5: e.Md5[:], + Flag: []byte{0x11,0x00,0x00,0x00}, + //OldData: imgOld, + PbReserve: reserve, + }, + }) + return +}