| | 1 | | using DCL.Browser; |
| | 2 | | using DCL.Providers; |
| | 3 | | using DCL.Tasks; |
| | 4 | | using DCLServices.PlacesAPIService; |
| | 5 | | using System.Threading; |
| | 6 | |
|
| | 7 | | namespace DCL.ContentModeration |
| | 8 | | { |
| | 9 | | public class ContentModerationPlugin : IPlugin |
| | 10 | | { |
| 0 | 11 | | private readonly CancellationTokenSource cts = new (); |
| | 12 | |
|
| | 13 | | private ContentModerationHUDController contentModerationHUDController; |
| | 14 | |
|
| 0 | 15 | | public ContentModerationPlugin() |
| | 16 | | { |
| 0 | 17 | | Initialize(cts.Token); |
| 0 | 18 | | } |
| | 19 | |
|
| | 20 | | private async void Initialize(CancellationToken ct) |
| | 21 | | { |
| 0 | 22 | | var adultContentSceneWarningComponentView = await Environment.i.serviceLocator.Get<IAddressableResourceProvi |
| | 23 | | .Instantiate<AdultContentSceneWarningComponentV |
| | 24 | |
|
| 0 | 25 | | var adultContentAgeConfirmationComponentView = await Environment.i.serviceLocator.Get<IAddressableResourcePr |
| | 26 | | .Instantiate<AdultContentAgeConfirmationCom |
| | 27 | |
|
| 0 | 28 | | var adultContentEnabledNotificationComponentView = await Environment.i.serviceLocator.Get<IAddressableResour |
| | 29 | | .Instantiate<AdultContentEnabledNotific |
| | 30 | |
|
| 0 | 31 | | var contentModerationReportingComponentView = await Environment.i.serviceLocator.Get<IAddressableResourcePro |
| | 32 | | .Instantiate<ContentModerationReportingComponentView>(" |
| | 33 | |
|
| 0 | 34 | | var contentModerationReportingButtonForWorldsComponentView = await Environment.i.serviceLocator.Get<IAddress |
| | 35 | | .Instantiate<ContentModeration |
| | 36 | |
|
| 0 | 37 | | contentModerationHUDController = new ContentModerationHUDController( |
| | 38 | | adultContentSceneWarningComponentView, |
| | 39 | | adultContentAgeConfirmationComponentView, |
| | 40 | | adultContentEnabledNotificationComponentView, |
| | 41 | | contentModerationReportingComponentView, |
| | 42 | | contentModerationReportingButtonForWorldsComponentView, |
| | 43 | | Environment.i.world.state, |
| | 44 | | DataStore.i.common, |
| | 45 | | DataStore.i.settings, |
| | 46 | | DataStore.i.contentModeration, |
| | 47 | | new WebInterfaceBrowserBridge(), |
| | 48 | | Environment.i.serviceLocator.Get<IPlacesAPIService>(), |
| | 49 | | new UserProfileWebInterfaceBridge(), |
| | 50 | | new ContentModerationAnalytics(), |
| | 51 | | NotificationsController.i); |
| 0 | 52 | | } |
| | 53 | |
|
| | 54 | | public void Dispose() |
| | 55 | | { |
| 0 | 56 | | cts.SafeCancelAndDispose(); |
| 0 | 57 | | contentModerationHUDController.Dispose(); |
| 0 | 58 | | } |
| | 59 | | } |
| | 60 | | } |