protected override void ParseBody(ByteBuffer buf) { // 创建contact info ContactInfo = new ContactInfo(buf); // 检查字段数 if (ContactInfo.FieldCount < QQGlobal.QQ_COUNT_GET_USER_INFO_FIELD) { throw new PacketParseException("用户信息字段数少于期望的字段数"); } else { //if(ContactInfo.FieldCount > QQGlobal.QQ_COUNT_GET_USER_INFO_FIELD) // log.warn("用户信息字段数大于期望的字段数,危险,但是继续使用"); } }
private void Initialize() { IP = new byte[4]; ServerIp = new byte[4]; LastLoginIp = new byte[4]; IsLoggedIn = false; LoginMode = QQStatus.我在线上; IsUdp = true; ContactInfo = new ContactInfo(); IsShowFakeCam = false; Friends = new FriendList(this); QQList = new QQList(); ClusterList = new ClusterList(); this.QQKey = new QQKey(this); }
/// <summary>修改个人信息或密码 /// Modifies the info. /// </summary> /// <param name="oldPassword">The old password.老密码,如果不修改密码,设成null</param> /// <param name="newPassword">The new password.新密码,如果不修改密码,设成null</param> /// <param name="contactInfo">The contact info.</param> private void ModifyInfo(string oldPassword, string newPassword, ContactInfo contactInfo) { ModifyInfoPacket packet = new ModifyInfoPacket(QQClient); packet.OldPassword = oldPassword; packet.NewPassword = newPassword; string[] infos = contactInfo.GetInfoArray(); for (int i = 0; i < QQGlobal.QQ_COUNT_MODIFY_USER_INFO_FIELD; i++) { if (infos[i] == "-") { infos[i] = ""; } } packet.ContactInfo = contactInfo; QQClient.PacketManager.SendPacket(packet, QQPort.Main.Name); }
/// <summary>修改个人信息 /// Modifies the info. /// </summary> /// <param name="contactInfo">The contact info.</param> public void ModifyInfo(ContactInfo contactInfo) { ModifyInfo(null, null, contactInfo); }