Example #1
0
        private void Send(ReferenceCountedMessage m, EmulatorQueue from)
        {
            if (connected)
            {
                BufferedMessage b;
                b.msg             = m;
                b.timeToRecieveOn = time.gameTime + TimeManager.FromSeconds(latency);

                Profiler.BeginSample("Enqueue");
                foreach (var item in queues)
                {
                    if (item != from)
                    {
                        m.Acquire();
                        item.messages.Enqueue(b);
                    }
                }
                m.Release();
                Profiler.EndSample();
            }
            else
            {
                m.Release();
            }
        }