コード例 #1
0
ファイル: Broadcaster.cs プロジェクト: dacroucher/DogWatch
 public void AddClient(Client client)
 {
     lock (m_dictionary)
     {
         m_dictionary.Add(client.ID,client);
     }
 }
コード例 #2
0
ファイル: PacketBuffer.cs プロジェクト: dacroucher/DogWatch
 public PacketBuffer(Client owner)
 {
     m_owner = owner;
     m_inputQueue = new Queue<byte>();
     m_outputQueue = new Queue<byte[]>();
     m_currentPacket = new ArrayList();
 }
コード例 #3
0
ファイル: Broadcaster.cs プロジェクト: dacroucher/DogWatch
 public void RemoveClient(Client client)
 {
     if (m_dictionary.ContainsKey(client.ID))
     {
         lock (m_dictionary)
             m_dictionary.Remove(client.ID);
     }
 }
コード例 #4
0
 private void Process(Client c)
 {
     c.packetBuffer.working = true;
     PacketHandler handler;
     while (c.packetBuffer.Available)
     {
         byte[] packet = c.packetBuffer.Dequeue();
         handler = Packets.GetHandler(packet[0]);
         if (handler != null)
             handler.onReceieve(packet,c);
     }
     c.packetBuffer.working = false;
 }
コード例 #5
0
ファイル: Network.cs プロジェクト: dacroucher/DogWatch
 public static void NewPacket(Client c)
 {
     m_packetProcessor.Enqueue(c);
 }
コード例 #6
0
 public void Enqueue(Client c)
 {
     lock (m_processQueue)
         m_processQueue.Enqueue(c);
 }
コード例 #7
0
ファイル: Packets.cs プロジェクト: dacroucher/DogWatch
 /* Packet Action */
 private static void DummyPacket(byte[] buffer, Client c)
 {
 }
コード例 #8
0
 private byte[] ProcessFrame(Client c)
 {
     throw new NotImplementedException();
 }
コード例 #9
0
ファイル: ClientHandler.cs プロジェクト: dacroucher/DogWatch
 public void NewClient(Socket s)
 {
     Client c = new Client(s);
     masterList.Add(c.ID, c);
     clientNotifications.AddClient(c);
 }