예제 #1
0
        /// <summary>
        /// Send the netbuffer in the specified mode.
        /// Highly recommended that you don't use the buffered rpc modes, as this is kind of a manual buffering solution anyway.
        /// </summary>
        /// <param name="mode"></param>
        /// <param name="buffer"></param>
        public void SendBuffer(RPCMode mode, NetBuffer buffer)
        {
            var message = PNetServer.peer.CreateMessage(buffer.LengthBytes);

            buffer.Clone(message);
            FinishRPCSend(mode, message);
        }
예제 #2
0
        //don't need to keep track of the mode, because the clients don't care about it,
        //and technically, neither do we (everyone new needs it anyway, so 'all' and 'other' are identical)
        internal void Buffer(NetBuffer msg)
        {
            var toBuffer = new NetBuffer();

            msg.Clone(toBuffer);
            buffer.Add(toBuffer);
        }
예제 #3
0
        internal void Send(NetBuffer msg, RPCMode mode, NetConnection originalSender = null)
        {
            var message = PNetServer.peer.CreateMessage();

            msg.Clone(message);

            SendMessage(message, mode, originalSender);
        }
예제 #4
0
        /// <summary>
        /// Send the netbuffer to the specified player
        /// </summary>
        /// <param name="player"></param>
        /// <param name="buffer"></param>
        public void SendBuffer(Player player, NetBuffer buffer)
        {
            var message = PNetServer.peer.CreateMessage(buffer.LengthBytes);

            buffer.Clone(message);

            FinishRPCSend(player, message);
        }
예제 #5
0
        //fields are basically treated like OthersBuffered
        internal void SendField(NetBuffer msg, NetConnection originalSender = null)
        {
            var message = PNetServer.peer.CreateMessage();

            msg.Clone(message);

            var conns = _connections.Where(c => c != originalSender).ToList();

            if (conns.Count != 0)
            {
                PNetServer.peer.SendMessage(message, conns, NetDeliveryMethod.ReliableOrdered, Channels.SYNCHED_FIELD);
            }
        }