Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ _sendMsg()

void ReLogic.Peripherals.RGB.SteelSeries.GameSenseConnection._sendMsg ( QueueMsg msg)
inlineprivate

Definition at line 313 of file GameSenseConnection.cs.

314 {
315 //IL_007c: Unknown result type (might be due to invalid IL or missing references)
316 //IL_0070: Unknown result type (might be due to invalid IL or missing references)
317 string text = _toJSON(msg.data);
318 JsonMsg jsonMsg = (JsonMsg)(object)((msg is JsonMsg) ? msg : null);
319 if (jsonMsg != null)
320 {
321 text = jsonMsg.JsonText;
322 }
324 try
325 {
326 _sendServer(msg.uri, text);
327 }
328 catch (WebException ex)
329 {
330 switch (ex.Status)
331 {
332 case WebExceptionStatus.ProtocolError:
333 if (msg.IsCritical())
334 {
335 Stream responseStream = ex.Response.GetResponseStream();
336 string text2 = new StreamReader(responseStream, Encoding.UTF8).ReadToEnd();
337 responseStream.Close();
338 throw new CriticalMessageIllFormedException(text2);
339 }
340 break;
341 case WebExceptionStatus.ConnectFailure:
342 throw new ServerDownException(ex.Message);
343 default:
344 _logException("Unexpected status", ex);
345 break;
346 }
347 }
348 }
virtual string Message
Definition Exception.cs:100
override string ReadToEnd()
virtual void Close()
Definition Stream.cs:644
WebExceptionStatus Status
virtual Stream GetResponseStream()
static Encoding UTF8
Definition Encoding.cs:526

References ReLogic.Peripherals.RGB.SteelSeries.GameSenseConnection._logDbgMsg(), ReLogic.Peripherals.RGB.SteelSeries.GameSenseConnection._logException(), ReLogic.Peripherals.RGB.SteelSeries.GameSenseConnection._sendServer(), System.IO.Stream.Close(), System.Net.WebResponse.GetResponseStream(), System.Exception.Message, System.IO.StreamReader.ReadToEnd(), System.Net.WebException.Response, System.Net.WebException.Status, System.text, and System.Text.Encoding.UTF8.

Referenced by ReLogic.Peripherals.RGB.SteelSeries.GameSenseConnection._gamesenseWrk().