Пример #1
0
        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("");
        }
Пример #2
0
        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");
        }
Пример #3
0
        public void ParseQuery(string queryId, string payload, string sceneId)
        {
            QueryMessage query = new QueryMessage();

            MessageDecoder.DecodeQueryMessage(queryId, payload, ref query);

            ParcelScene scene = loadedScenes[sceneId];

            Vector3 worldOrigin = query.payload.ray.origin + Utils.GridToWorldPosition(scene.sceneData.basePosition.x, scene.sceneData.basePosition.y);

            query.payload.ray.unityOrigin = DCLCharacterController.i.characterPosition.WorldToUnityPosition(worldOrigin);

            switch (query.queryId)
            {
            case "raycast":
                query.payload.sceneId = sceneId;
                PhysicsCast.i.Query(query.payload);
                break;
            }
        }