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

◆ SendJson()

void ReLogic.Peripherals.RGB.SteelSeries.GameSenseConnection.SendJson ( Uri uri,
string data,
bool isCritical )
inlineprivate

Definition at line 350 of file GameSenseConnection.cs.

351 {
352 //IL_0051: Unknown result type (might be due to invalid IL or missing references)
353 //IL_0045: Unknown result type (might be due to invalid IL or missing references)
354 _logDbgMsg(data);
355 try
356 {
357 _sendServer(uri, data);
358 }
359 catch (WebException ex)
360 {
361 switch (ex.Status)
362 {
363 case WebExceptionStatus.ProtocolError:
364 if (isCritical)
365 {
366 Stream responseStream = ex.Response.GetResponseStream();
367 string text = new StreamReader(responseStream, Encoding.UTF8).ReadToEnd();
368 responseStream.Close();
369 throw new CriticalMessageIllFormedException(text);
370 }
371 break;
372 case WebExceptionStatus.ConnectFailure:
373 throw new ServerDownException(ex.Message);
374 default:
375 _logException("Unexpected status", ex);
376 throw;
377 }
378 }
379 }
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.