public void SendOperation <TParams>(byte operationCode, TParams parameters, MessageSendOptions messageSendOptions) where TParams : struct, IParameters { if (!IsConnected()) { return; } var code = (TOperationCode)Enum.ToObject(typeof(TOperationCode), operationCode); operationRequestSender.Send(code, parameters, messageSendOptions); }
public void SendOperation <TParams>(byte operationCode, TParams parameters) where TParams : struct, IParameters { var code = (TOperationCode)Enum.ToObject(typeof(TOperationCode), operationCode); if (!IsConnected()) { LogUtils.Log($"Failed to send {code} operation because there is no connection with a server."); return; } operationRequestSender.Send(code, parameters, MessageSendOptions.DefaultReliable()); }