protected virtual void MessageHandler(Utility.IComponent sender, Utility.Messages.ModificaCampoSchedaMessageEventArgs e) { foreach (Utility.IComponent c in _components) { if (c is GestoreSchedeMaster) { c.Input(e); } } }
protected virtual void MessageHandler(Utility.IComponent sender, Utility.Messages.NomeAggiornatoMessageEventArgs e) { foreach (Utility.IComponent c in _components) { if (c is MySocket) { c.Input(e); } } }
protected virtual void MessageHandler(Utility.IComponent sender, GestoreGiocatoriMessageEventArgs e) { foreach (Utility.IComponent c in GetComponentsByType(typeof(MySocket))) { if ((c as MySocket).RemoteAddress == e.Argomento) { c.Input(e.Messaggio); } } }
protected override void MessageHandler(Utility.IComponent sender, ChatComuneMessageEventArgs e) { foreach (Utility.IComponent c in _components) { if (c is MySocket || 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); }