protected virtual void SocketMessageHandler(MySocket sender, ChatComuneMessageEventArgs e) { foreach (IComponent c in _components) { if (c is ChatComune) { c.Input(e); } } }
protected virtual void MessageHandler(Utility.IComponent sender, GiocatoreKickedMessageEventArgs e) { Utility.MySocket toRemove = null; foreach (Utility.IComponent c in _components) { if (c is MySocket && (c as MySocket).RemoteAddress == e.Argomento) { toRemove = (c as MySocket); if (sender is GestoreSchedeMaster) { this.MessageForwarder(sender, new ChatComuneMessageEventArgs("Il giocatore " + (sender as GestoreSchedeMaster).getNomeGiocatore(e.Argomento) + " è stato espulso")); } } } toRemove.Dispose(); _components.Remove(toRemove); }
protected virtual void SocketMessageHandler(MySocket sender, SocketClosedMessageEventArgs e) { sender.Dispose(); _components.Remove(sender); }
protected void Draw(MySocket mySocket) { mySocket.Output += SocketForwarder; _components.Add(mySocket); }