Example #1
0
        public void Send(Packets.Packet i)
        {
            NetOutgoingMessage msg = _client.CreateMessage(4);

            i.Write(msg);
            _client.SendMessage(msg, i.Method.ToNetDeliveryMethod());
        }
Example #2
0
        private void Sender_Send(object sender, Packets.Packet packet)
        {
            NetOutgoingMessage msg = _server.CreateMessage(4);

            packet.Write(msg);
            _server.SendMessage(msg, Connector.GetConnection(packet.Connection), packet.Method.ToNetDeliveryMethod());
        }
Example #3
0
        public void Connect(string ip, int port, Packets.Packet p)
        {
            NetOutgoingMessage msg = _client.CreateMessage();

            p.Write(msg);
            _client.Connect(ip, port, msg);
        }
Example #4
0
        private void Sender_Broadcast(Packets.Packet packet, long[] recipients)
        {
            var connections = new System.Collections.Generic.List <NetConnection>(recipients.Length);

            foreach (var rec in recipients)
            {
                var con = Connector.GetConnection(rec);
                if (con != null)
                {
                    connections.Add(con);
                }
            }
            NetOutgoingMessage msg = _server.CreateMessage(4);

            packet.Write(msg);
            _server.SendMessage(msg, connections, packet.Method.ToNetDeliveryMethod(), 0);
        }