private void LogOutgoingPacket(BattleNetPacket packet, bool wasMetered) { if (this.m_logSource == null) { LogAdapter.Log(LogLevel.Warning, "tried to log with null log source, skipping"); return; } bool flag = false; IProtoBuf protoBuf = (IProtoBuf)packet.GetBody(); Header header = packet.GetHeader(); uint serviceId = header.ServiceId; uint methodId = header.MethodId; string text = (!wasMetered) ? "QueueRequest" : "QueueRequest (METERED)"; if (!string.IsNullOrEmpty(protoBuf.ToString())) { ServiceDescriptor importedServiceById = this.serviceHelper.GetImportedServiceById(serviceId); string text2 = (importedServiceById != null) ? importedServiceById.GetMethodName(methodId) : "null"; if (!text2.Contains("KeepAlive")) { this.m_logSource.LogDebug("{0}: type = {1}, header = {2}, request = {3}", new object[] { text, text2, header.ToString(), protoBuf.ToString() }); } } else { ServiceDescriptor importedServiceById2 = this.serviceHelper.GetImportedServiceById(serviceId); string text3 = (importedServiceById2 != null) ? importedServiceById2.GetMethodName(methodId) : null; if (text3 != "bnet.protocol.connection.ConnectionService.KeepAlive" && text3 != null) { this.m_logSource.LogDebug("{0}: type = {1}, header = {2}", new object[] { text, text3, header.ToString() }); } else { flag = true; } } if (!flag) { this.m_logSource.LogDebugStackTrace("LogOutgoingPacket: ", 32, 1); } }
private void LogOutgoingPacket(BattleNetPacket packet, bool wasMetered) { string methodName; if (this.m_logSource == null) { LogAdapter.Log(LogLevel.Warning, "tried to log with null log source, skipping"); return; } bool flag = false; IProtoBuf body = (IProtoBuf)packet.GetBody(); Header header = packet.GetHeader(); uint serviceId = header.ServiceId; uint methodId = header.MethodId; string str = (!wasMetered ? "QueueRequest" : "QueueRequest (METERED)"); if (string.IsNullOrEmpty(body.ToString())) { ServiceDescriptor importedServiceById = this.serviceHelper.GetImportedServiceById(serviceId); if (importedServiceById != null) { methodName = importedServiceById.GetMethodName(methodId); } else { methodName = null; } string str1 = methodName; if (!(str1 != "bnet.protocol.connection.ConnectionService.KeepAlive") || str1 == null) { flag = true; } else { this.m_logSource.LogDebug("{0}: type = {1}, header = {2}", new object[] { str, str1, header.ToString() }); } } else { ServiceDescriptor serviceDescriptor = this.serviceHelper.GetImportedServiceById(serviceId); string str2 = (serviceDescriptor != null ? serviceDescriptor.GetMethodName(methodId) : "null"); if (!str2.Contains("KeepAlive")) { this.m_logSource.LogDebug("{0}: type = {1}, header = {2}, request = {3}", new object[] { str, str2, header.ToString(), body.ToString() }); } } if (!flag) { this.m_logSource.LogDebugStackTrace("LogOutgoingPacket: ", 32, 1); } }
private void LogOutgoingPacket(BattleNetPacket packet, bool wasMetered) { if (this.m_logSource == null) { UnityEngine.Debug.LogWarning("tried to log with null log source, skipping"); } else { bool flag = false; IProtoBuf body = (IProtoBuf)packet.GetBody(); bnet.protocol.Header header = packet.GetHeader(); uint serviceId = header.ServiceId; uint methodId = header.MethodId; string str = !wasMetered ? "QueueRequest" : "QueueRequest (METERED)"; if (!string.IsNullOrEmpty(body.ToString())) { ServiceDescriptor importedServiceById = this.serviceHelper.GetImportedServiceById(serviceId); object[] args = new object[] { str, (importedServiceById != null) ? importedServiceById.GetMethodName(methodId) : "null", header.ToString(), body.ToString() }; this.m_logSource.LogDebug("{0}: type = {1}, header = {2}, request = {3}", args); } else { ServiceDescriptor descriptor2 = this.serviceHelper.GetImportedServiceById(serviceId); string str2 = (descriptor2 != null) ? descriptor2.GetMethodName(methodId) : null; if ((str2 != "bnet.protocol.connection.ConnectionService.KeepAlive") && (str2 != null)) { object[] objArray2 = new object[] { str, str2, header.ToString() }; this.m_logSource.LogDebug("{0}: type = {1}, header = {2}", objArray2); } else { flag = true; } } if (!flag) { this.m_logSource.LogDebugStackTrace("LogOutgoingPacket: ", 0x20, 1); } } }