示例#1
0
 protected virtual void SocketMessageHandler(MySocket sender, ChatComuneMessageEventArgs e)
 {
     foreach (IComponent c in _components)
     {
         if (c is ChatComune)
         {
             c.Input(e);
         }
     }
 }
示例#2
0
 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);
 }
示例#3
0
 protected virtual void SocketMessageHandler(MySocket sender, SocketClosedMessageEventArgs e)
 {
     sender.Dispose();
     _components.Remove(sender);
 }
示例#4
0
 protected void Draw(MySocket mySocket)
 {
     mySocket.Output += SocketForwarder;
     _components.Add(mySocket);
 }