private void DecodeAndEnqueue(string payload) { ProfilingEvents.OnMessageDecodeStart?.Invoke("Misc"); string sceneId; string message; string messageTag; PB_SendSceneMessage sendSceneMessage; if (!MessageDecoder.DecodePayloadChunk(payload, out sceneId, out message, out messageTag, out sendSceneMessage)) { return; } QueuedSceneMessage_Scene queuedMessage; if (sceneMessagesPool.Count > 0) { queuedMessage = sceneMessagesPool.Dequeue(); } else { queuedMessage = new QueuedSceneMessage_Scene(); } MessageDecoder.DecodeSceneMessage(sceneId, message, messageTag, sendSceneMessage, ref queuedMessage); EnqueueSceneMessage(queuedMessage); ProfilingEvents.OnMessageDecodeEnds?.Invoke("Misc"); }
private string DecodeAndEnqueue(string payload) { OnMessageDecodeStart?.Invoke("Misc"); string sceneId; string message; string messageTag; PB_SendSceneMessage sendSceneMessage; if (!MessageDecoder.DecodePayloadChunk(payload, out sceneId, out message, out messageTag, out sendSceneMessage)) { return(null); } MessagingBus.QueuedSceneMessage_Scene queuedMessage; if (sceneMessagesPool.Count > 0) { queuedMessage = sceneMessagesPool.Dequeue(); } else { queuedMessage = new MessagingBus.QueuedSceneMessage_Scene(); } MessageDecoder.DecodeSceneMessage(sceneId, message, messageTag, sendSceneMessage, ref queuedMessage); EnqueueSceneMessage(queuedMessage); OnMessageDecodeEnds?.Invoke("Misc"); return(""); }