public static void SendFriendAudio(long thisQQ, long sendQQ, byte[] AudioBytes) { using (var audioStream = new MemoryStream(AudioBytes)) { AudioBytes = audioStream.ToArray(); } API.FileHash = API.MD5Hash(AudioBytes); SendAudioMsgStruct AudioInfo = new SendAudioMsgStruct { AudioType = 500, Field2 = 0, AudioInfo = new AudioInfos { thisQQ = thisQQ, SendQQ = sendQQ, StartFlag = 2, AudioSize = AudioBytes.Length, AudioName = API.HashMD5(AudioBytes) + ".amr", AudioHash = API.FileHash }, Field101 = 17, Field102 = 104, AudioOtherInfo = new AudioOtherInfos { Field1 = 3, Field2 = 0, Field90300 = 1, Field90500 = 3, Field90600 = 2, Field90800 = 5 } }; using (var ms = new MemoryStream()) { Serializer.Serialize(ms, AudioInfo); var bytes = API.PackCmdHeader("PttCenterSvr.pb_pttCenter_CMD_REQ_APPLY_UPLOAD-500", ms.ToArray()); API.TClient.SendData(API.PackAllHeader(bytes)); } }
public static void SendFriendPic(long thisQQ, long sendQQ, byte[] picBytes) { var picMd5 = API.MD5Hash(picBytes); API.FileHash = picMd5; API.FileBytes = picBytes; SendPicMsgStruct PicInfo = new SendPicMsgStruct { Amount = 1, PicType = 3, PicInfo = new PicInfos { SendQQ = sendQQ, StartFlag = 0, PicHash = picMd5, PicLengh = picBytes.Length, PicName = API.HashMD5(picBytes) + ".jpg", Field7 = 5, Field8 = 9, Field10 = 0, Field12 = 1, Field13 = 0, PicWidth = 647, PicHeigh = 980, PicPix = 1000, PicVer = "7.9.8.999", Field21 = 0, Field22 = 0 } }; using (var ms = new MemoryStream()) { Serializer.Serialize(ms, PicInfo); var bytes = API.PackCmdHeader("LongConn.OffPicUp", ms.ToArray()); API.TClient.SendData(API.PackAllHeader(bytes)); } }
public static void SendGroupAudio(long thisQQ, long sendQQ, long groupId, byte[] AudioBytes) { using (var audioStream = new MemoryStream(AudioBytes)) { AudioBytes = audioStream.ToArray(); } API.FileHash = API.MD5Hash(AudioBytes); SendGroupAudioMsgStruct AudioInfo = new SendGroupAudioMsgStruct { AudioType = 3, Field2 = 3, GroupAudioInfo = new GroupAudioInfos { GroupId = groupId, SendQQ = sendQQ, StartFlag = 0, AudioHash = API.FileHash, AudioSize = AudioBytes.Length, AudioName = API.HashMD5(AudioBytes) + ".amr", Field7 = 5, Field8 = 9, Field9 = 3, AudioVer = "7.9.8.999", Field12 = 1, Field13 = 1, Field14 = 1, Field15 = 1 } }; using (var ms = new MemoryStream()) { Serializer.Serialize(ms, AudioInfo); var bytes = API.PackCmdHeader("PttStore.GroupPttUp", ms.ToArray()); API.TClient.SendData(API.PackAllHeader(bytes)); } }
public static void SendGroupPic(long thisQQ, long sendQQ, long groupId, byte[] picBytes) { var picMd5 = API.MD5Hash(picBytes); API.FileHash = picMd5; API.FileBytes = picBytes; SendGroupPicMsgStruct PicInfo = new SendGroupPicMsgStruct { Amount = 1, PicType = 3, GroupPicInfo = new GroupPicInfos { GroupId = groupId, SendQQ = sendQQ, StartFlag = 0, PicHash = picMd5, PicSize = picBytes.Length, PicName = API.HashMD5(picBytes) + ".jpg", Field7 = 5, Field8 = 9, Field9 = 1, PicWidth = 647, PicHeigh = 980, PicPix = 1000, PicVer = "7.9.8.999", Field15 = 1007, Field19 = 0 } }; using (var ms = new MemoryStream()) { Serializer.Serialize(ms, PicInfo); var bytes = API.PackCmdHeader("ImgStore.GroupPicUp", ms.ToArray()); API.TClient.SendData(API.PackAllHeader(bytes)); } }