コード例 #1
0
        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);
        }
コード例 #2
0
        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());
        }