コード例 #1
0
        /// <summary>
        ///     Send a message to all connected clients.
        /// </summary>
        /// <param name="messageId">Message type/id</param>
        /// <param name="message">The actual message</param>
        public void SendToClients(byte messageId, CommandBase message)
        {
            if (Status != ServerStatus.Running)
            {
                return;
            }

            _netServer.SendToAll(ArrayHelpers.PrependByte(messageId, message.Serialize()), SendOptions.ReliableOrdered);
        }
コード例 #2
0
        /// <summary>
        ///     Send a message to all connected clients.
        /// </summary>
        /// <param name="messageId">Message type/id</param>
        /// <param name="message">The actual message</param>
        public void SendToClients(CommandBase message)
        {
            if (Status != ServerStatus.Running)
            {
                return;
            }

            _netServer.SendToAll(message.Serialize(), DeliveryMethod.ReliableOrdered);

            _logger.Debug($"Sending {message.GetType().Name} to all clients");
        }
コード例 #3
0
ファイル: Server.cs プロジェクト: nzgamer41/Tango
        /// <summary>
        ///     Send a message to all connected clients.
        /// </summary>
        /// <param name="messageId">Message type/id</param>
        /// <param name="message">The actual message</param>
        public void SendToClients(byte messageId, CommandBase message)
        {
            if (Status != ServerStatus.Running)
            {
                return;
            }

            _netServer.SendToAll(ArrayHelpers.PrependByte(messageId, message.Serialize()), DeliveryMethod.ReliableOrdered);

            _logger.Debug($"Sending message id of {messageId} to all clients");
        }