public void SendToServer(byte messageId, CommandBase message) { if (Status == ClientStatus.Disconnected) { return; } _netClient.GetFirstPeer().Send(ArrayHelpers.PrependByte(messageId, message.Serialize()), SendOptions.ReliableOrdered); }
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); }