| | 1 | | using System.Collections.Generic; |
| | 2 | |
|
| | 3 | | namespace DCLServices.PortableExperiences.Analytics |
| | 4 | | { |
| | 5 | | public class PortableExperiencesAnalyticsService : IPortableExperiencesAnalyticsService |
| | 6 | | { |
| | 7 | | private readonly IAnalytics analytics; |
| | 8 | | private readonly IUserProfileBridge userProfileBridge; |
| | 9 | |
|
| 2 | 10 | | private string ownUserId => userProfileBridge.GetOwn().userId; |
| | 11 | |
|
| 425 | 12 | | public PortableExperiencesAnalyticsService(IAnalytics analytics, |
| | 13 | | IUserProfileBridge userProfileBridge) |
| | 14 | | { |
| 425 | 15 | | this.analytics = analytics; |
| 425 | 16 | | this.userProfileBridge = userProfileBridge; |
| 425 | 17 | | } |
| | 18 | |
|
| 425 | 19 | | public void Dispose() { } |
| | 20 | |
|
| 425 | 21 | | public void Initialize() { } |
| | 22 | |
|
| | 23 | | public void Spawn(string pexId) |
| | 24 | | { |
| 2 | 25 | | analytics.SendAnalytic("spawn_portable_experience", new Dictionary<string, string> |
| | 26 | | { |
| | 27 | | { "wallet_id", ownUserId }, |
| | 28 | | { "pex_urn", pexId }, |
| | 29 | | }); |
| 2 | 30 | | } |
| | 31 | |
|
| | 32 | | public void Accept(string pexId, bool dontAskAgain, string source) |
| | 33 | | { |
| 0 | 34 | | analytics.SendAnalytic("player_accept_portable_experience", new Dictionary<string, string> |
| | 35 | | { |
| | 36 | | { "wallet_id", ownUserId }, |
| | 37 | | { "pex_urn", pexId }, |
| | 38 | | { "dont_ask_again_flag", dontAskAgain.ToString().ToLower() }, |
| | 39 | | { "triggered_from", source }, |
| | 40 | | }); |
| 0 | 41 | | } |
| | 42 | |
|
| | 43 | | public void Reject(string pexId, bool dontAskAgain, string source) |
| | 44 | | { |
| 0 | 45 | | analytics.SendAnalytic("player_reject_portable_experience", new Dictionary<string, string> |
| | 46 | | { |
| | 47 | | { "wallet_id", ownUserId }, |
| | 48 | | { "pex_urn", pexId }, |
| | 49 | | { "dont_ask_again_flag", dontAskAgain.ToString().ToLower() }, |
| | 50 | | { "triggered_from", source }, |
| | 51 | | }); |
| 0 | 52 | | } |
| | 53 | | } |
| | 54 | | } |