Пример #1
0
 public void BroadcastMessage(HaProtoImpl.Opcode type, HaProtoImpl.HaProtoPacket packet, Client exempt = null)
 {
     byte[] data = packet.Build();
     lock (clients)
     {
         for (int i = 0; i < clients.Count; i++)
         {
             Client c = clients[i];
             if (c == exempt)
             {
                 continue;
             }
             HaProtoImpl.Send(c.Socket, type, data);
         }
     }
 }
Пример #2
0
 public static void Send(Socket s, Opcode type, HaProtoImpl.HaProtoPacket x)
 {
     Send(s, type, x.Build());
 }
Пример #3
0
 public void Send(HaProtoImpl.Opcode type, HaProtoImpl.HaProtoPacket packet)
 {
     Send(type, packet.Build());
 }
Пример #4
0
 public static async Task SendAsync(NetworkStream stream, Opcode type, HaProtoImpl.HaProtoPacket x)
 {
     await SendAsync(stream, type, x.Build());
 }