コード例 #1
0
        public virtual void OutPacket(Packet NewPack)
        {
            QueItem item = new QueItem();

            item.Packet   = NewPack;
            item.Incoming = false;
            this.PacketQueue.Enqueue(item);
        }
コード例 #2
0
 public override void SetUIRoot(UnityEngine.GameObject root)
 {
     base.SetUIRoot(root);
     queItems    = new QueItem[4];
     queItems[0] = new QueItem(root.transform.Find("Que0"));
     queItems[1] = new QueItem(root.transform.Find("Que/Que1"));
     queItems[2] = new QueItem(root.transform.Find("Que/Que2"));
     queItems[3] = new QueItem(root.transform.Find("Que/Que3"));
 }
コード例 #3
0
ファイル: PhotoUploader.cs プロジェクト: mamasha/tests
        void IPhotoUploader.PhotoIsReady(int uploadId, FbPhoto photo)
        {
            var item = new QueItem {
                uploadId = uploadId,
                photo    = photo
            };

            _que.Add(item);
        }
コード例 #4
0
 protected virtual void ClientLoop()
 {
     OpenSim.Framework.Console.MainConsole.Instance.WriteLine("OpenSimClient.cs:ClientLoop() - Entered loop");
     while (true)
     {
         QueItem nextPacket = PacketQueue.Dequeue();
         if (nextPacket.Incoming)
         {
             //is a incoming packet
             ProcessInPacket(nextPacket.Packet);
         }
         else
         {
             //is a out going packet
             ProcessOutPacket(nextPacket.Packet);
         }
     }
 }
コード例 #5
0
        public virtual void InPacket(Packet NewPack)
        {
            // Handle appended ACKs
            if (NewPack.Header.AppendedAcks)
            {
                lock (NeedAck)
                {
                    foreach (uint ack in NewPack.Header.AckList)
                    {
                        NeedAck.Remove(ack);
                    }
                }
            }

            // Handle PacketAck packets
            if (NewPack.Type == PacketType.PacketAck)
            {
                PacketAckPacket ackPacket = (PacketAckPacket)NewPack;

                lock (NeedAck)
                {
                    foreach (PacketAckPacket.PacketsBlock block in ackPacket.Packets)
                    {
                        NeedAck.Remove(block.ID);
                    }
                }
            }
            else if ((NewPack.Type == PacketType.StartPingCheck))
            {
                //reply to pingcheck
                libsecondlife.Packets.StartPingCheckPacket    startPing = (libsecondlife.Packets.StartPingCheckPacket)NewPack;
                libsecondlife.Packets.CompletePingCheckPacket endPing   = new CompletePingCheckPacket();
                endPing.PingID.PingID = startPing.PingID.PingID;
                OutPacket(endPing);
            }
            else
            {
                QueItem item = new QueItem();
                item.Packet   = NewPack;
                item.Incoming = true;
                this.PacketQueue.Enqueue(item);
            }
        }
コード例 #6
0
 public virtual void OutPacket(Packet NewPack)
 {
     QueItem item = new QueItem();
     item.Packet = NewPack;
     item.Incoming = false;
     this.PacketQueue.Enqueue(item);
 }
コード例 #7
0
        public virtual void InPacket(Packet NewPack)
        {
            // Handle appended ACKs
            if (NewPack.Header.AppendedAcks)
            {
                lock (NeedAck)
                {
                    foreach (uint ack in NewPack.Header.AckList)
                    {
                        NeedAck.Remove(ack);
                    }
                }
            }

            // Handle PacketAck packets
            if (NewPack.Type == PacketType.PacketAck)
            {
                PacketAckPacket ackPacket = (PacketAckPacket)NewPack;

                lock (NeedAck)
                {
                    foreach (PacketAckPacket.PacketsBlock block in ackPacket.Packets)
                    {
                        NeedAck.Remove(block.ID);
                    }
                }
            }
            else if ((NewPack.Type == PacketType.StartPingCheck))
            {
                //reply to pingcheck
                libsecondlife.Packets.StartPingCheckPacket startPing = (libsecondlife.Packets.StartPingCheckPacket)NewPack;
                libsecondlife.Packets.CompletePingCheckPacket endPing = new CompletePingCheckPacket();
                endPing.PingID.PingID = startPing.PingID.PingID;
                OutPacket(endPing);
            }
            else
            {
                QueItem item = new QueItem();
                item.Packet = NewPack;
                item.Incoming = true;
                this.PacketQueue.Enqueue(item);
            }
        }