private static void OnMessage(string message, string stacktrace, UnityEngine.LogType type) { if (RCon.isInput || RCon.listenerNew == null) { return; } RCon.Response response = new RCon.Response(); response.Identifier = RCon.responseIdentifier; response.Message = message; response.Stacktrace = stacktrace; response.Type = RCon.LogType.Generic; if (type == null || type == 4) { response.Type = RCon.LogType.Error; } if (type == 1 || type == 2) { response.Type = RCon.LogType.Warning; } if (string.IsNullOrEmpty(RCon.responseConnection)) { RCon.listenerNew.BroadcastMessage(JsonConvert.SerializeObject((object)response, (Formatting)1)); } else { RCon.listenerNew.SendMessage(RCon.responseConnection, JsonConvert.SerializeObject((object)response, (Formatting)1)); } }
private static void OnMessage(string message, string stacktrace, UnityEngine.LogType type) { if (RCon.isInput) { return; } if (RCon.listenerNew != null) { RCon.Response response = new RCon.Response() { Identifier = RCon.responseIdentifier, Message = message, Stacktrace = stacktrace, Type = RCon.LogType.Generic }; if (type == UnityEngine.LogType.Error || type == UnityEngine.LogType.Exception) { response.Type = RCon.LogType.Error; } if (type == UnityEngine.LogType.Assert || type == UnityEngine.LogType.Warning) { response.Type = RCon.LogType.Warning; } if (string.IsNullOrEmpty(RCon.responseConnection)) { RCon.listenerNew.BroadcastMessage(JsonConvert.SerializeObject(response, Formatting.Indented)); return; } RCon.listenerNew.SendMessage(RCon.responseConnection, JsonConvert.SerializeObject(response, Formatting.Indented)); } }
public static void Broadcast(RCon.LogType type, object obj) { if (RCon.listenerNew == null) { return; } RCon.Response response = new RCon.Response() { Identifier = -1, Message = JsonConvert.SerializeObject(obj, Formatting.Indented), Type = type }; if (string.IsNullOrEmpty(RCon.responseConnection)) { RCon.listenerNew.BroadcastMessage(JsonConvert.SerializeObject(response, Formatting.Indented)); return; } RCon.listenerNew.SendMessage(RCon.responseConnection, JsonConvert.SerializeObject(response, Formatting.Indented)); }
public static void Broadcast(RCon.LogType type, object obj) { if (RCon.listenerNew == null) { return; } RCon.Response response = new RCon.Response(); response.Identifier = -1; response.Message = JsonConvert.SerializeObject(obj, (Formatting)1); response.Type = type; if (string.IsNullOrEmpty(RCon.responseConnection)) { RCon.listenerNew.BroadcastMessage(JsonConvert.SerializeObject((object)response, (Formatting)1)); } else { RCon.listenerNew.SendMessage(RCon.responseConnection, JsonConvert.SerializeObject((object)response, (Formatting)1)); } }