Exemplo n.º 1
0
 internal void OnLoginRedirect(QQEventArgs <LoginReplyPacket, LoginPacket> e)
 {
     // 如果是登陆重定向,继续登陆
     QQClient.LoginRedirect = true;
     QQClient.ConnectionManager.ConnectionPool.Release(QQPort.Main.Name);
     QQClient.Login(Utils.Util.GetIpStringFromBytes(e.InPacket.RedirectIP), e.InPacket.RedirectPort);
     if (LoginRedirect != null)
     {
         LoginRedirect(this, e);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        ///     <remark>abu 2008-03-10 </remark>
        /// </summary>
        /// <param name="client">The client.</param>
        internal PacketManager(QQClient client)
        {
            router = new ProcessorRouter(client);
            router.InstallProcessor(new BasicFamilyProcessor(client));

            this.QQClient           = client;
            receiveQueue            = new Queue <InPacket>();
            this.packetIncomTrigger = new PacketIncomeTrigger(client);
            this.resendTrigger      = new ResendTrigger(client);
            keepAliveTrigger        = new KeepAliveTrigger(client);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ConnectionManager"/> class.
 /// </summary>
 /// <param name="client">The client.</param>
 internal ConnectionManager(QQClient client)
 {
     QQClient       = client;
     ConnectionPool = new LumaQQ.NET.Net.Sockets.ConnectionPool();
 }
Exemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PrivateManager"/> class.
 /// </summary>
 /// <param name="client">The client.</param>
 internal PrivateManager(QQClient client)
 {
     this.QQClient = client;
 }
Exemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FriendManager"/> class.
 /// </summary>
 /// <param name="client">The client.</param>
 internal FriendManager(QQClient client)
 {
     this.QQClient = client;
 }
Exemplo n.º 6
0
 internal LoginManager(QQClient client)
 {
     QQClient = client;
 }
Exemplo n.º 7
0
 /// <summary>
 ///     <remark>abu 2008-03-10 </remark>
 /// </summary>
 /// <param name="client">The client.</param>
 internal MessageManager(QQClient client)
 {
     QQClient = client;
 }
Exemplo n.º 8
0
        static void Main(string[] args)
        {
            QQUser user = new QQUser(956625392, "05297crazy");

            LumaQQ.NET.QQClient client = new LumaQQ.NET.QQClient(user);

            #region 代理登录
            //user.IsUdp = false;//如果使用代理必须使用TCP登录
            //client.Proxy.ProxyHost = "192.168.1.100";
            //client.Proxy.ProxyPort = 1100;
            //client.Proxy.ProxyType = ProxyType.Socks5;
            //client.LoginServerHost = "219.133.62.10"; //tcpconn.tencent.com  TCP Server 直接服务器: 219.133.62.10
            //client.LoginPort = 80;
            #endregion

            #region 正常登录
            user.IsUdp             = true;
            client.LoginServerHost = "219.133.49.173"; //UDP Server  直接服务器 219.133.62.8,中转服务器 219.133.49.173
            #endregion

            client.PrivateManager.ModifyInfoFailed             += new EventHandler <QQEventArgs <ModifyInfoReplyPacket, ModifyInfoPacket> >(PrivateManager_ModifyInfoFailed);
            client.PrivateManager.ModifyInfoSuccessed          += new EventHandler <QQEventArgs <ModifyInfoReplyPacket, ModifyInfoPacket> >(PrivateManager_ModifyInfoSuccessed);
            client.PrivateManager.ModifySignatureSuccessed     += new EventHandler <QQEventArgs <SignatureOpReplyPacket, SignatureOpPacket> >(PrivateManager_ModifySignatureSuccessed);
            client.PrivateManager.ModifySignatureFailed        += new EventHandler <QQEventArgs <SignatureOpReplyPacket, SignatureOpPacket> >(PrivateManager_ModifySignatureFailed);
            client.PrivateManager.SetSearchMeByQQOnlyFailed    += new EventHandler <QQEventArgs <PrivacyDataOpReplyPacket, PrivacyDataOpPacket> >(PrivateManager_SetSearchMeByQQOnlyFailed);
            client.PrivateManager.SetSearchMeByQQOnlySuccessed += new EventHandler <QQEventArgs <PrivacyDataOpReplyPacket, PrivacyDataOpPacket> >(PrivateManager_SetSearchMeByQQOnlySuccessed);
            client.PrivateManager.SetShareGeographyFailed      += new EventHandler <QQEventArgs <PrivacyDataOpReplyPacket, PrivacyDataOpPacket> >(PrivateManager_SetShareGeographyFailed);
            client.PrivateManager.SetShareGeographySuccessed   += new EventHandler <QQEventArgs <PrivacyDataOpReplyPacket, PrivacyDataOpPacket> >(PrivateManager_SetShareGeographySuccessed);
            client.PrivateManager.GetWeatherSuccessed          += new EventHandler <QQEventArgs <WeatherOpReplyPacket, WeatherOpPacket> >(PrivateManager_GetWeatherSuccessed);
            client.PrivateManager.GetWeatherFailed             += new EventHandler <QQEventArgs <WeatherOpReplyPacket, WeatherOpPacket> >(PrivateManager_GetWeatherFailed);

            client.FriendManager.SignatureChanged              += new EventHandler <QQEventArgs <ReceiveIMPacket, OutPacket> >(FriendManager_SignatureChanged);
            client.FriendManager.GetSignatureFailed            += new EventHandler <QQEventArgs <SignatureOpReplyPacket, SignatureOpPacket> >(FriendManager_GetSignatureFailed);
            client.FriendManager.GetSignatureSuccessed         += new EventHandler <QQEventArgs <SignatureOpReplyPacket, SignatureOpPacket> >(FriendManager_GetSignatureSuccessed);
            client.FriendManager.UploadFriendRemarkSuccessed   += new EventHandler <QQEventArgs <FriendDataOpReplyPacket, FriendDataOpPacket> >(FriendManager_UploadFriendRemarkSuccessed);
            client.FriendManager.UploadFriendRemarkFailed      += new EventHandler <QQEventArgs <FriendDataOpReplyPacket, FriendDataOpPacket> >(FriendManager_UploadFriendRemarkFailed);
            client.FriendManager.DownloadFriendRemarkSuccessed += new EventHandler <QQEventArgs <FriendDataOpReplyPacket, FriendDataOpPacket> >(FriendManager_DownloadFriendRemarkSuccessed);
            client.FriendManager.DownloadFriendRemarkFailed    += new EventHandler <QQEventArgs <FriendDataOpReplyPacket, FriendDataOpPacket> >(FriendManager_DownloadFriendRemarkFailed);
            client.FriendManager.GetFriendLevelSuccessed       += new EventHandler <QQEventArgs <FriendLevelOpReplyPacket, FriendLevelOpPacket> >(FriendManager_GetFriendLevelSuccessed);
            client.FriendManager.GetUserPropertySuccessed      += new EventHandler <QQEventArgs <UserPropertyOpReplyPacket, UserPropertyOpPacket> >(FriendManager_GetUserPropertySuccessed);
            client.FriendManager.DownloadGroupFriendSuccessed  += new EventHandler <QQEventArgs <DownloadGroupFriendReplyPacket, DownloadGroupFriendPacket> >(FriendManager_DownloadGroupFriendSuccessed);
            client.FriendManager.DownloadGroupFriendFailed     += new EventHandler <QQEventArgs <DownloadGroupFriendReplyPacket, DownloadGroupFriendPacket> >(FriendManager_DownloadGroupFriendFailed);
            client.FriendManager.DownloadGroupNamesFailed      += new EventHandler <QQEventArgs <GroupDataOpReplyPacket, GroupDataOpPacket> >(FriendManager_DownloadGroupNamesFailed);
            client.FriendManager.DownloadGroupNamesSuccessed   += new EventHandler <QQEventArgs <GroupDataOpReplyPacket, GroupDataOpPacket> >(FriendManager_DownloadGroupNamesSuccessed);
            client.FriendManager.UploadGroupNamesSuccessed     += new EventHandler <QQEventArgs <GroupDataOpReplyPacket, GroupDataOpPacket> >(FriendManager_UploadGroupNamesSuccessed);
            client.FriendManager.UploadGroupNamesFailed        += new EventHandler <QQEventArgs <GroupDataOpReplyPacket, GroupDataOpPacket> >(FriendManager_UploadGroupNamesFailed);
            client.FriendManager.SearchUserSuccessed           += new EventHandler <QQEventArgs <SearchUserReplyPacket, SearchUserPacket> >(FriendManager_SearchUserSuccessed);

            client.Error += new EventHandler <LumaQQ.NET.Events.QQEventArgs <LumaQQ.NET.Packets.ErrorPacket, OutPacket> >(client_Error);
            client.ConnectionManager.NetworkError       += new EventHandler <LumaQQ.NET.Events.ErrorEventArgs>(ConnectionManager_NetworkError);
            client.ConnectionManager.ConnectServerError += new EventHandler <LumaQQ.NET.Events.ErrorEventArgs>(ConnectionManager_ConnectServerError);
            client.ConnectionManager.ReceivedKeepAlive  += new EventHandler <LumaQQ.NET.Events.QQEventArgs <LumaQQ.NET.Packets.In.KeepAliveReplyPacket, KeepAlivePacket> >(ConnectionManager_ReceivedKeepAlive);
            client.ConnectionManager.ConnectSuccessed   += new EventHandler(ConnectionManager_ConnectSuccessed);

            client.PacketManager.ReceivedUnknownPacket        += new EventHandler <QQEventArgs <UnknownInPacket, OutPacket> >(PacketManager_ReceivedUnknownPacket);
            client.PacketManager.SendPacketSuccessed          += new EventHandler <QQEventArgs <InPacket, OutPacket> >(PacketManager_SendPacketSuccessed);
            client.PacketManager.SendPacketTimeOut            += new EventHandler <QQEventArgs <InPacket, OutPacket> >(PacketManager_SendPacketTimeOut);
            client.PacketManager.LostConnection               += new EventHandler <QQEventArgs <InPacket, OutPacket> >(PacketManager_LostConnection);
            client.MessageManager.ReceiveNormalIM             += new EventHandler <LumaQQ.NET.Events.QQEventArgs <LumaQQ.NET.Packets.In.ReceiveIMPacket, OutPacket> >(MessageManager_ReceiveNormalIM);
            client.MessageManager.ReceiveDuplicatedIM         += new EventHandler <LumaQQ.NET.Events.QQEventArgs <LumaQQ.NET.Packets.In.ReceiveIMPacket, OutPacket> >(MessageManager_ReceiveDuplicatedIM);
            client.MessageManager.SysAddedByOthers            += new EventHandler <QQEventArgs <SystemNotificationPacket, OutPacket> >(MessageManager_SysAddedByOthers);
            client.MessageManager.SysAdvertisment             += new EventHandler <QQEventArgs <SystemNotificationPacket, OutPacket> >(MessageManager_SysAdvertisment);
            client.MessageManager.SysAddOtherApproved         += new EventHandler <QQEventArgs <SystemNotificationPacket, OutPacket> >(MessageManager_SysAddOtherApproved);
            client.MessageManager.SysAddedByOthersEx          += new EventHandler <QQEventArgs <SystemNotificationPacket, OutPacket> >(MessageManager_SysAddedByOthersEx);
            client.MessageManager.SysApprovedAddOtherAndAddMe += new EventHandler <QQEventArgs <SystemNotificationPacket, OutPacket> >(MessageManager_SysApprovedAddOtherAndAddMe);
            client.MessageManager.SysAddOtherRejected         += new EventHandler <QQEventArgs <SystemNotificationPacket, OutPacket> >(MessageManager_SysAddOtherRejected);
            client.MessageManager.SysRequestAddMe             += new EventHandler <QQEventArgs <SystemNotificationPacket, OutPacket> >(MessageManager_SysRequestAddMe);
            client.MessageManager.SysRequestAddMeEx           += new EventHandler <QQEventArgs <SystemNotificationPacket, OutPacket> >(MessageManager_SysRequestAddMeEx);

            client.FriendManager.GetFriendListSuccessed     += new EventHandler <QQEventArgs <GetFriendListReplyPacket, GetFriendListPacket> >(FriendManager_GetFriendListSuccessed);
            client.FriendManager.GetOnlineFriendSuccessed   += new EventHandler <QQEventArgs <GetOnlineOpReplyPacket, GetOnlineOpPacket> >(FriendManager_GetOnlineFriendSuccessed);
            client.FriendManager.GetUserInfoSuccessed       += new EventHandler <LumaQQ.NET.Events.QQEventArgs <LumaQQ.NET.Packets.In.GetUserInfoReplyPacket, GetUserInfoPacket> >(FriendManager_GetUserInfoSuccessed);
            client.FriendManager.FriendChangeStatus         += new EventHandler <QQEventArgs <FriendChangeStatusPacket, OutPacket> >(FriendManager_FriendChangeStatus);
            client.FriendManager.ChangeStatusSuccessed      += new EventHandler <QQEventArgs <ChangeStatusReplyPacket, ChangeStatusPacket> >(FriendManager_ChangeStatusSuccessed);
            client.FriendManager.ChangeStatusFailed         += new EventHandler <QQEventArgs <ChangeStatusReplyPacket, ChangeStatusPacket> >(FriendManager_ChangeStatusFailed);
            client.FriendManager.AddFriendSuccessed         += new EventHandler <QQEventArgs <AddFriendExReplyPacket, AddFriendExPacket> >(FriendManager_AddFriendSuccessed);
            client.FriendManager.AddFriendNeedAuth          += new EventHandler <QQEventArgs <AddFriendExReplyPacket, AddFriendExPacket> >(FriendManager_AddFriendNeedAuth);
            client.FriendManager.AddFriendDeny              += new EventHandler <QQEventArgs <AddFriendExReplyPacket, AddFriendExPacket> >(FriendManager_AddFriendDeny);
            client.FriendManager.AddFriendFailed            += new EventHandler <QQEventArgs <AddFriendExReplyPacket, AddFriendExPacket> >(FriendManager_AddFriendFailed);
            client.FriendManager.DeleteFriendSuccessed      += new EventHandler <QQEventArgs <DeleteFriendReplyPacket, DeleteFriendPacket> >(FriendManager_DeleteFriendSuccessed);
            client.FriendManager.DeleteFriendFailed         += new EventHandler <QQEventArgs <DeleteFriendReplyPacket, DeleteFriendPacket> >(FriendManager_DeleteFriendFailed);
            client.FriendManager.SendAuthSuccessed          += new EventHandler <QQEventArgs <AuthorizeReplyPacket, AuthorizePacket> >(FriendManager_SendAuthSuccessed);
            client.FriendManager.SendAuthFailed             += new EventHandler <QQEventArgs <AuthorizeReplyPacket, AuthorizePacket> >(FriendManager_SendAuthFailed);
            client.FriendManager.ResponseAuthSuccessed      += new EventHandler <QQEventArgs <AddFriendAuthResponseReplyPacket, AddFriendAuthResponsePacket> >(FriendManager_ResponseAuthSuccessed);
            client.FriendManager.ResponseAuthFailed         += new EventHandler <QQEventArgs <AddFriendAuthResponseReplyPacket, AddFriendAuthResponsePacket> >(FriendManager_ResponseAuthFailed);
            client.FriendManager.UploadGroupFriendFailed    += new EventHandler <QQEventArgs <UploadGroupFriendReplyPacket, UploadGroupFriendPacket> >(FriendManager_UploadGroupFriendFailed);
            client.FriendManager.UploadGroupFriendSuccessed += new EventHandler <QQEventArgs <UploadGroupFriendReplyPacket, UploadGroupFriendPacket> >(FriendManager_UploadGroupFriendSuccessed);
            #region login events
            client.LoginManager.LoginSuccessed += new EventHandler <LumaQQ.NET.Events.QQEventArgs <LumaQQ.NET.Packets.In.LoginReplyPacket, LoginPacket> >(LoginManager_LoginSuccessed);
            client.LoginManager.LoginFailed    += new EventHandler <LumaQQ.NET.Events.QQEventArgs <LumaQQ.NET.Packets.In.LoginReplyPacket, LoginPacket> >(LoginManager_LoginFailed);
            client.LoginManager.LoginRedirect  += new EventHandler <LumaQQ.NET.Events.QQEventArgs <LumaQQ.NET.Packets.In.LoginReplyPacket, LoginPacket> >(LoginManager_LoginRedirect);
            #endregion



            client.Login();
            //Console.WriteLine(LumaQQ.NET.Utils.Util.GetTimeMillis(DateTime.Now));
            Console.WriteLine("回车退出登录:");
            Console.ReadLine();
            client.LoginManager.Logout();
            WL("QQ退出成功!");
        }