Beispiel #1
0
        public virtual void SendNot(NetOutgoingMessage m, IPEndPoint ep)
        {
            if (server.ConnectionsCount == 0 && Root.Instance.Recorder == null)
            {
                return;
            }
            if (ep == null)
            {
                throw new Exception("ep==null");
            }

            if (Root.Instance.Recorder != null)
            {
                byte[] buf = m.PeekDataBuffer();
                Root.Instance.Recorder.WritePacket((int)(Root.Instance.Time * 1000), buf, buf.Length);
            }

            List <NetConnection> list = new List <NetConnection>();

            foreach (NetConnection s in Clients)
            {
                if (s != null)
                {
                    if (ep.ToString() != s.RemoteEndpoint.ToString())
                    {
                        list.Add(s);
                    }
                }
            }
            server.SendMessage(compress?NetCompressor.Compress(m):m, list, NetDeliveryMethod.Unreliable, 0);
        }
Beispiel #2
0
        public virtual void Send(NetOutgoingMessage m, IPEndPoint ep)
        {
            NetConnection c = FindConnection(ep);

            if (c != null && c.Status == NetConnectionStatus.Connected)
            {
                server.SendMessage(compress?NetCompressor.Compress(m):m, c, NetDeliveryMethod.Unreliable);
            }
        }
Beispiel #3
0
 public virtual void Send(NetOutgoingMessage m)
 {
     client.SendMessage(compress?NetCompressor.Compress(m):m, NetDeliveryMethod.Unreliable);
 }
Beispiel #4
0
 public virtual void Send(NetOutgoingMessage m)
 {
     server.SendMessage(compress?NetCompressor.Compress(m):m, server.Connections, NetDeliveryMethod.Unreliable, 0);
 }