Exemple #1
0
        void Update()
        {
#if UNITY_EDITOR
            lock (WSSController.queuedMessages)
            {
                if (queuedMessagesDirty)
                {
                    while (queuedMessages.Count > 0)
                    {
                        DCLWebSocketService.Message msg = queuedMessages.Dequeue();

                        if (VERBOSE)
                        {
                            Debug.Log(
                                "<b><color=#0000FF>WSSController</color></b> >>> Got it! passing message of type " +
                                msg.type);
                        }

                        switch (msg.type)
                        {
                        case "SetDebug":
                            DCL.Environment.i.platform.debugController.SetDebug();
                            break;

                        case "SetSceneDebugPanel":
                            DCL.Environment.i.platform.debugController.SetSceneDebugPanel();
                            break;

                        case "ShowFPSPanel":
                            DCL.Environment.i.platform.debugController.ShowFPSPanel();
                            break;

                        case "HideFPSPanel":
                            DCL.Environment.i.platform.debugController.HideFPSPanel();
                            break;

                        case "SetEngineDebugPanel":
                            DCL.Environment.i.platform.debugController.SetEngineDebugPanel();
                            break;

                        case "SendSceneMessage":
                            DCL.Environment.i.world.sceneController.SendSceneMessage(msg.payload);
                            break;

                        case "LoadParcelScenes":
                            DCL.Environment.i.world.sceneController.LoadParcelScenes(msg.payload);
                            break;

                        case "UnloadScene":
                            DCL.Environment.i.world.sceneController.UnloadScene(msg.payload);
                            break;

                        case "Reset":
                            DCL.Environment.i.world.sceneController.UnloadAllScenesQueued();
                            break;

                        case "CreateGlobalScene":
                            DCL.Environment.i.world.sceneController.CreateGlobalScene(msg.payload);
                            break;

                        case "BuilderReady":
                            Main.i.BuilderReady();
                            break;

                        case "UpdateParcelScenes":
                            DCL.Environment.i.world.sceneController.UpdateParcelScenes(msg.payload);
                            break;

                        case "Teleport":
                            characterController.Teleport(msg.payload);
                            break;

                        case "SetRotation":
                            cameraController.SetRotation(msg.payload);
                            break;

                        case "LoadProfile":
                            UserProfileController.i?.LoadProfile(msg.payload);
                            break;

                        case "AddUserProfileToCatalog":
                            UserProfileController.i.AddUserProfileToCatalog(msg.payload);
                            break;

                        case "AddUserProfilesToCatalog":
                            UserProfileController.i.AddUserProfilesToCatalog(msg.payload);
                            break;

                        case "RemoveUserProfilesFromCatalog":
                            UserProfileController.i.RemoveUserProfilesFromCatalog(msg.payload);
                            break;

                        case "ActivateRendering":
                            renderingController.ActivateRendering();
                            break;

                        case "DeactivateRendering":
                            renderingController.DeactivateRendering();
                            break;

                        case "ReportFocusOn":
                            bridgesGameObject.SendMessage(msg.type, msg.payload);
                            break;

                        case "ReportFocusOff":
                            bridgesGameObject.SendMessage(msg.type, msg.payload);
                            break;

                        case "ForceActivateRendering":
                            renderingController.ForceActivateRendering();
                            break;

                        case "ShowNotificationFromJson":
                            NotificationsController.i.ShowNotificationFromJson(msg.payload);
                            break;

                        case "GetMousePosition":
                            GetBuilderBridge()?.GetMousePosition(msg.payload);
                            break;

                        case "SelectGizmo":
                            GetBuilderBridge()?.SelectGizmo(msg.payload);
                            break;

                        case "ResetObject":
                            GetBuilderBridge()?.ResetObject();
                            break;

                        case "ZoomDelta":
                            GetBuilderBridge()?.ZoomDelta(msg.payload);
                            break;

                        case "SetPlayMode":
                            GetBuilderBridge()?.SetPlayMode(msg.payload);
                            break;

                        case "TakeScreenshot":
                            GetBuilderBridge()?.TakeScreenshot(msg.payload);
                            break;

                        case "ResetBuilderScene":
                            GetBuilderBridge()?.ResetBuilderScene();
                            break;

                        case "SetBuilderCameraPosition":
                            GetBuilderBridge()?.SetBuilderCameraPosition(msg.payload);
                            break;

                        case "SetBuilderCameraRotation":
                            GetBuilderBridge()?.SetBuilderCameraRotation(msg.payload);
                            break;

                        case "ResetBuilderCameraZoom":
                            GetBuilderBridge()?.ResetBuilderCameraZoom();
                            break;

                        case "SetGridResolution":
                            GetBuilderBridge()?.SetGridResolution(msg.payload);
                            break;

                        case "OnBuilderKeyDown":
                            GetBuilderBridge()?.OnBuilderKeyDown(msg.payload);
                            break;

                        case "UnloadBuilderScene":
                            GetBuilderBridge()?.UnloadBuilderScene(msg.payload);
                            break;

                        case "SetSelectedEntities":
                            GetBuilderBridge()?.SetSelectedEntities(msg.payload);
                            break;

                        case "GetCameraTargetBuilder":
                            GetBuilderBridge()?.GetCameraTargetBuilder(msg.payload);
                            break;

                        case "PreloadFile":
                            GetBuilderBridge()?.PreloadFile(msg.payload);
                            break;

                        case "SetBuilderConfiguration":
                            GetBuilderBridge()?.SetBuilderConfiguration(msg.payload);
                            break;

                        case "AddWearablesToCatalog":
                            CatalogController.i?.AddWearablesToCatalog(msg.payload);
                            break;

                        case "WearablesRequestFailed":
                            CatalogController.i?.WearablesRequestFailed(msg.payload);
                            break;

                        case "RemoveWearablesFromCatalog":
                            CatalogController.i?.RemoveWearablesFromCatalog(msg.payload);
                            break;

                        case "ClearWearableCatalog":
                            CatalogController.i?.ClearWearableCatalog();
                            break;

                        case "ConfigureHUDElement":
                            HUDController.i?.ConfigureHUDElement(msg.payload);
                            break;

                        case "InitializeFriends":
                            FriendsController.i?.InitializeFriends(msg.payload);
                            break;

                        case "UpdateFriendshipStatus":
                            FriendsController.i?.UpdateFriendshipStatus(msg.payload);
                            break;

                        case "UpdateUserPresence":
                            FriendsController.i?.UpdateUserPresence(msg.payload);
                            break;

                        case "FriendNotFound":
                            FriendsController.i?.FriendNotFound(msg.payload);
                            break;

                        case "AddMessageToChatWindow":
                            ChatController.i?.AddMessageToChatWindow(msg.payload);
                            break;

                        case "UpdateMinimapSceneInformation":
                            MinimapMetadataController.i?.UpdateMinimapSceneInformation(msg.payload);
                            break;

                        case "SetTutorialEnabled":
                            DCL.Tutorial.TutorialController.i?.SetTutorialEnabled(msg.payload);
                            break;

                        case "SetTutorialEnabledForUsersThatAlreadyDidTheTutorial":
                            DCL.Tutorial.TutorialController.i?.SetTutorialEnabledForUsersThatAlreadyDidTheTutorial();
                            break;

                        case "TriggerSelfUserExpression":
                            HUDController.i.TriggerSelfUserExpression(msg.payload);
                            break;

                        case "AirdroppingRequest":
                            HUDController.i.AirdroppingRequest(msg.payload);
                            break;

                        case "ShowWelcomeNotification":
                            NotificationsController.i.ShowWelcomeNotification();
                            break;

                        case "ShowTermsOfServices":
                            HUDController.i.ShowTermsOfServices(msg.payload);
                            break;

                        case "RequestTeleport":
                            HUDController.i.RequestTeleport(msg.payload);
                            break;

                        case "UpdateHotScenesList":
                            HotScenesController.i.UpdateHotScenesList(msg.payload);
                            break;

                        case "UpdateBalanceOfMANA":
                            HUDController.i.UpdateBalanceOfMANA(msg.payload);
                            break;

                        case "SetPlayerTalking":
                            HUDController.i.SetPlayerTalking(msg.payload);
                            break;

                        case "SetVoiceChatEnabledByScene":
                            if (int.TryParse(msg.payload, out int value))
                            {
                                HUDController.i.SetVoiceChatEnabledByScene(value);
                            }

                            break;

                        case "SetRenderProfile":
                            RenderProfileBridge.i.SetRenderProfile(msg.payload);
                            break;

                        case "ShowAvatarEditorInSignUp":
                            HUDController.i.ShowAvatarEditorInSignUp();
                            break;

                        case "SetUserTalking":
                            HUDController.i.SetUserTalking(msg.payload);
                            break;

                        case "SetUsersMuted":
                            HUDController.i.SetUsersMuted(msg.payload);
                            break;

                        case "SetKernelConfiguration":
                        case "UpdateRealmsInfo":
                        case "InitializeQuests":
                        case "UpdateQuestProgress":
                        case "SetENSOwnerQueryResult":
                            bridgesGameObject.SendMessage(msg.type, msg.payload);
                            break;

                        case "SetDisableAssetBundles":
                        case "DumpRendererLockersInfo":
                            //TODO(Brian): Move this to bridges
                            Main.i.SendMessage(msg.type);
                            break;

                        case "PublishSceneResult":
                            GetBuilderInWorldBridge()?.PublishSceneResult(msg.payload);
                            break;

                        default:
                            Debug.Log(
                                "<b><color=#FF0000>WSSController:</color></b> received an unknown message from kernel to renderer: " +
                                msg.type);
                            break;
                        }
                    }

                    queuedMessagesDirty = false;
                }
            }
#endif
        }
Exemple #2
0
        void Update()
        {
#if UNITY_EDITOR
            lock (WSSController.queuedMessages)
            {
                if (queuedMessagesDirty)
                {
                    while (queuedMessages.Count > 0)
                    {
                        DCLWebSocketService.Message msg = queuedMessages.Dequeue();

                        if (VERBOSE)
                        {
                            Debug.Log(
                                "<b><color=#0000FF>WSSController</color></b> >>> Got it! passing message of type " +
                                msg.type);
                        }

                        switch (msg.type)
                        {
                        case "SetDebug":
                            sceneController.SetDebug();
                            break;

                        case "SetSceneDebugPanel":
                            sceneController.SetSceneDebugPanel();
                            break;

                        case "ShowFPSPanel":
                            sceneController.ShowFPSPanel();
                            break;

                        case "HideFPSPanel":
                            sceneController.HideFPSPanel();
                            break;

                        case "SetEngineDebugPanel":
                            sceneController.SetEngineDebugPanel();
                            break;

                        case "SendSceneMessage":
                            sceneController.SendSceneMessage(msg.payload);
                            break;

                        case "LoadParcelScenes":
                            sceneController.LoadParcelScenes(msg.payload);
                            break;

                        case "UnloadScene":
                            sceneController.UnloadScene(msg.payload);
                            break;

                        case "Teleport":
                            characterController.Teleport(msg.payload);
                            break;

                        case "SetRotation":
                            cameraController.SetRotation(msg.payload);
                            break;

                        case "Reset":
                            sceneController.UnloadAllScenesQueued();
                            break;

                        case "CreateUIScene":
                            sceneController.CreateUIScene(msg.payload);
                            break;

                        case "LoadProfile":
                            UserProfileController.i?.LoadProfile(msg.payload);
                            break;

                        case "AddUserProfileToCatalog":
                            UserProfileController.i.AddUserProfileToCatalog(msg.payload);
                            break;

                        case "AddUserProfilesToCatalog":
                            UserProfileController.i.AddUserProfilesToCatalog(msg.payload);
                            break;

                        case "RemoveUserProfilesFromCatalog":
                            UserProfileController.i.RemoveUserProfilesFromCatalog(msg.payload);
                            break;

                        case "DeactivateRendering":
                            renderingController.DeactivateRendering();
                            break;

                        case "ActivateRendering":
                            renderingController.ActivateRendering();
                            break;

                        case "ShowNotificationFromJson":
                            NotificationsController.i.ShowNotificationFromJson(msg.payload);
                            break;

                        case "BuilderReady":
                            sceneController.BuilderReady();
                            break;

                        case "UpdateParcelScenes":
                            sceneController.UpdateParcelScenes(msg.payload);
                            break;

                        case "GetMousePosition":
                            GetBuilderBridge()?.GetMousePosition(msg.payload);
                            break;

                        case "SelectGizmo":
                            GetBuilderBridge()?.SelectGizmo(msg.payload);
                            break;

                        case "ResetObject":
                            GetBuilderBridge()?.ResetObject();
                            break;

                        case "ZoomDelta":
                            GetBuilderBridge()?.ZoomDelta(msg.payload);
                            break;

                        case "SetPlayMode":
                            GetBuilderBridge()?.SetPlayMode(msg.payload);
                            break;

                        case "TakeScreenshot":
                            GetBuilderBridge()?.TakeScreenshot(msg.payload);
                            break;

                        case "ResetBuilderScene":
                            GetBuilderBridge()?.ResetBuilderScene();
                            break;

                        case "SetBuilderCameraPosition":
                            GetBuilderBridge()?.SetBuilderCameraPosition(msg.payload);
                            break;

                        case "SetBuilderCameraRotation":
                            GetBuilderBridge()?.SetBuilderCameraRotation(msg.payload);
                            break;

                        case "ResetBuilderCameraZoom":
                            GetBuilderBridge()?.ResetBuilderCameraZoom();
                            break;

                        case "SetGridResolution":
                            GetBuilderBridge()?.SetGridResolution(msg.payload);
                            break;

                        case "OnBuilderKeyDown":
                            GetBuilderBridge()?.OnBuilderKeyDown(msg.payload);
                            break;

                        case "UnloadBuilderScene":
                            GetBuilderBridge()?.UnloadBuilderScene(msg.payload);
                            break;

                        case "SetSelectedEntities":
                            GetBuilderBridge()?.SetSelectedEntities(msg.payload);
                            break;

                        case "GetCameraTargetBuilder":
                            GetBuilderBridge()?.GetCameraTargetBuilder(msg.payload);
                            break;

                        case "PreloadFile":
                            GetBuilderBridge()?.PreloadFile(msg.payload);
                            break;

                        case "SetBuilderConfiguration":
                            GetBuilderBridge()?.SetBuilderConfiguration(msg.payload);
                            break;

                        case "AddWearableToCatalog":
                            CatalogController.i?.AddWearableToCatalog(msg.payload);
                            break;

                        case "AddWearablesToCatalog":
                            CatalogController.i?.AddWearablesToCatalog(msg.payload);
                            break;

                        case "RemoveWearablesFromCatalog":
                            CatalogController.i?.RemoveWearablesFromCatalog(msg.payload);
                            break;

                        case "ClearWearableCatalog":
                            CatalogController.i?.ClearWearableCatalog();
                            break;

                        case "ConfigureHUDElement":
                            HUDController.i?.ConfigureHUDElement(msg.payload);
                            break;

                        case "InitializeFriends":
                            FriendsController.i?.InitializeFriends(msg.payload);
                            break;

                        case "UpdateFriendshipStatus":
                            FriendsController.i?.UpdateFriendshipStatus(msg.payload);
                            break;

                        case "UpdateUserPresence":
                            FriendsController.i?.UpdateUserPresence(msg.payload);
                            break;

                        case "FriendNotFound":
                            FriendsController.i?.FriendNotFound(msg.payload);
                            break;

                        case "AddMessageToChatWindow":
                            ChatController.i?.AddMessageToChatWindow(msg.payload);
                            break;

                        case "UpdateMinimapSceneInformation":
                            MinimapMetadataController.i?.UpdateMinimapSceneInformation(msg.payload);
                            break;

                        case "SetTutorialEnabled":
                            DCL.Tutorial.TutorialController.i?.SetTutorialEnabled(msg.payload);
                            break;

                        case "TriggerSelfUserExpression":
                            HUDController.i.TriggerSelfUserExpression(msg.payload);
                            break;

                        case "AirdroppingRequest":
                            HUDController.i.AirdroppingRequest(msg.payload);
                            break;

                        case "ShowWelcomeNotification":
                            NotificationsController.i.ShowWelcomeNotification();
                            break;

                        case "ShowTermsOfServices":
                            HUDController.i.ShowTermsOfServices(msg.payload);
                            break;

                        case "RequestTeleport":
                            HUDController.i.RequestTeleport(msg.payload);
                            break;

                        case "SetDisableAssetBundles":
                            SceneController.i.SetDisableAssetBundles();
                            break;

                        case "UpdateHotScenesList":
                            HotScenesController.i.UpdateHotScenesList(msg.payload);
                            break;

                        case "UpdateBalanceOfMANA":
                            HUDController.i.UpdateBalanceOfMANA(msg.payload);
                            break;

                        case "SetPlayerTalking":
                            HUDController.i.SetPlayerTalking(msg.payload);
                            break;

                        case "SetRenderProfile":
                            RenderProfileBridge.i.SetRenderProfile(msg.payload);
                            break;

                        case "SetUserTalking":
                            HUDController.i.SetUserTalking(msg.payload);
                            break;

                        case "SetUsersMuted":
                            HUDController.i.SetUsersMuted(msg.payload);
                            break;

                        default:
                            Debug.Log(
                                "<b><color=#FF0000>WSSController:</color></b> received an unknown message from kernel to renderer: " +
                                msg.type);
                            break;
                        }
                    }

                    queuedMessagesDirty = false;
                }
            }
#endif
        }