示例#1
0
文件: Client.cs 项目: slimlime/Tango
        public void SendToServer(byte messageId, CommandBase message)
        {
            if (Status == ClientStatus.Disconnected)
            {
                return;
            }

            _netClient.GetFirstPeer().Send(ArrayHelpers.PrependByte(messageId, message.Serialize()), SendOptions.ReliableOrdered);
        }
示例#2
0
文件: Client.cs 项目: steffalon/Tango
        public void SendToServer(byte messageId, CommandBase message)
        {
            if (Status == ClientStatus.Disconnected)
            {
                _logger.Error("Attempted to send message to server, but the client is disconnected");
                return;
            }

            var server = _netClient.GetFirstPeer();

            _logger.Info($"Sending message id of {messageId} to server at {server.EndPoint.Host}:{server.EndPoint.Port}");
            _logger.Debug(message.Serialize());

            server.Send(ArrayHelpers.PrependByte(messageId, message.Serialize()), SendOptions.ReliableOrdered);
        }