/// <summary>请求自己这里的天气预报 /// Gets the weather. /// </summary> public void GetWeather() { WeatherOpPacket packet = new WeatherOpPacket(QQClient); packet.IP = QQUser.IP; QQClient.PacketManager.SendPacket(packet, QQPort.Main.Name); }
/// <summary>处理天气预报操作回复包 /// Processes the weather op reply. /// </summary> /// <param name="inPacket">The in packet.</param> /// <param name="outPacket">The out packet.</param> private void ProcessWeatherOpReply(WeatherOpReplyPacket inPacket, WeatherOpPacket outPacket) { QQEventArgs<WeatherOpReplyPacket, WeatherOpPacket> e = new QQEventArgs<WeatherOpReplyPacket, WeatherOpPacket>(client, inPacket, outPacket); if (inPacket.ReplyCode == ReplyCode.OK) { if (!string.IsNullOrEmpty(inPacket.Province)) { client.PrivateManager.OnGetWeatherSuccessed(e); } else { client.PrivateManager.OnGetWeatherFailed(e); } } else { client.PrivateManager.OnGetWeatherFailed(e); } }