private bool HandlePopBalloon(PopBalloonMessage pbm) { lock(m_bubbles) { ServerBalloon b = GetBubble(pbm.BalloonID); if(m_bubbles.Remove(pbm.BalloonID) && b.Screen != null) { b.Screen.EnqueueMessage(pbm, this); // Notify Screen } } return true; }
private bool HandlePopBalloon(PopBalloonMessage pbm) { if(m_bubbles.ContainsKey(pbm.BalloonID)) { ServerBalloon b = GetBalloon(pbm.BalloonID); if((b != null) && (b.Screen != null)) { b.Screen.Balloons.Remove(pbm.BalloonID); if (!(pbm.Sender is Screen)) { b.Screen.Connection.SendMessage(pbm); } else { if (m_bubbles.Count <= (Configuration.MinBalloonsPerScreen * m_screens.Count)) { m_feed.Refresh(); } } } m_bubbles.Remove(pbm.BalloonID); } return true; }
/// <summary> /// Handles the case where the server forces us to pop a balloon /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void OnPopBalloon(PopBalloonMessage m) { if (balloons.ContainsKey(m.BalloonID)) { PopBalloon(m.BalloonID); } }
public void OnPopBalloon(PopBalloonMessage m) { Console.WriteLine("Pop balloon!"); }