예제 #1
0
 void IPhraseSender.Send(NetworkPhrase phrase, PhraseSender sender)
 {
     foreach (var client in this.Clients)
     {
         client.Network.Send(phrase, sender);
     }
 }
예제 #2
0
 void IPhraseSender.Send(NetworkPhrase phrase, PhraseSender sender)
 {
     foreach (var client in this.server.Clients)
     {
         if (client == this)
         {
             continue;
         }
         client.network.Send(phrase, sender);
     }
 }
예제 #3
0
 public void Send(NetworkPhrase phrase, PhraseSender sender)
 {
     lock (this.writer)
     {
         try
         {
             this.writer.Write((int)phrase);
             this.writer.Flush();
             sender(this.writer);
         }
         catch (IOException ex) when(ex.HResult == -2146232800)  // Connection closed
         {
             // just ignore the exception
         }
     }
 }
예제 #4
0
 public void Send(NetworkPhrase phrase, PhraseSender sender)
 {
     lock (this.writer)
     {
         try
         {
             this.writer.Write((int)phrase);
             this.writer.Flush();
             sender(this.writer);
         }
         catch (IOException ex) when (ex.HResult == -2146232800) // Connection closed
         {
             // just ignore the exception
         }
     }
 }
예제 #5
0
		void IPhraseSender.Send(NetworkPhrase phrase, PhraseSender sender)
		{
			foreach (var client in this.Clients)
			{
				client.Network.Send(phrase, sender);
			}
		}