| | 1 | | using DCL; |
| | 2 | | using System; |
| | 3 | | using System.Collections.Generic; |
| | 4 | | using static DCL.SettingsCommon.GeneralSettings; |
| | 5 | |
|
| | 6 | | namespace SocialFeaturesAnalytics |
| | 7 | | { |
| | 8 | | public class SocialAnalytics : ISocialAnalytics |
| | 9 | | { |
| | 10 | | private const string PLAYER_MUTED = "user_muted"; |
| | 11 | | private const string PLAYER_UNMUTED = "user_unmuted"; |
| | 12 | | private const string VOICE_MESSAGE_STARTED_BY_FIRST_TIME = "voice_chat_start_recording"; |
| | 13 | | private const string VOICE_MESSAGE_SENT = "voice_message_sent"; |
| | 14 | | private const string VOICE_CHANNEL_CONNECTION = "voice_channel_connection"; |
| | 15 | | private const string VOICE_CHANNEL_DISCONNECTION = "voice_channel_disconnection"; |
| | 16 | | private const string VOICE_CHAT_PREFERENCES_CHANGED = "voice_chat_preferences_changed"; |
| | 17 | | private const string FRIEND_REQUEST_SENT = "friend_request_sent"; |
| | 18 | | private const string FRIEND_REQUEST_APPROVED = "friend_request_approved"; |
| | 19 | | private const string FRIEND_REQUEST_REJECTED = "friend_request_rejected"; |
| | 20 | | private const string FRIEND_REQUEST_CANCELLED = "friend_request_cancelled"; |
| | 21 | | private const string FRIEND_REQUEST_ERROR = "friend_request_error"; |
| | 22 | | private const string FRIEND_DELETED = "friend_deleted"; |
| | 23 | | private const string PASSPORT_OPENED = "passport_opened"; |
| | 24 | | private const string PASSPORT_CLOSED = "passport_closed"; |
| | 25 | | private const string PASSPORT_CLICKED_ON_COLLECTIONS = "passport_collections_click"; |
| | 26 | | private const string PASSPORT_STARTED_CONVERSATION = "passport_started_conversation"; |
| | 27 | | private const string PASSPORT_INSPECT_AVATAR = "passport_inspect_avatar"; |
| | 28 | | private const string PASSPORT_CLICK_LINK = "passport_clicked_link"; |
| | 29 | | private const string PASSPORT_WALLET_COPY = "passport_wallet_copy"; |
| | 30 | | private const string PASSPORT_USERNAME_COPY = "passport_username_copy"; |
| | 31 | | private const string PASSPORT_JUMP_IN = "passport_jump_in"; |
| | 32 | | private const string PASSPORT_EDIT_PROFILE = "passport_edit_profile"; |
| | 33 | | private const string PASSPORT_BUY_NFT = "passport_buy_nft"; |
| | 34 | | private const string PLAYER_BLOCKED = "user_blocked"; |
| | 35 | | private const string PLAYER_UNBLOCKED = "user_unblocked"; |
| | 36 | | private const string PLAYER_REPORT = "player_report"; |
| | 37 | | private const string PLAYER_JOIN = "player_join"; |
| | 38 | | private const string PLAY_EMOTE = "used_emote"; |
| | 39 | | private const string EMPTY_CHANNEL_CREATED = "chat_channel_created"; |
| | 40 | | private const string POPULATED_CHANNEL_JOINED = "player_joins_channel"; |
| | 41 | | private const string CHANNEL_LEAVE = "player_leaves_channel"; |
| | 42 | | private const string CHANNEL_SEARCH = "player_search_channel"; |
| | 43 | | private const string CHANNEL_LINK_CLICK = "player_clicks_channel_link"; |
| | 44 | |
|
| 389 | 45 | | public static SocialAnalytics i { get; private set; } |
| | 46 | |
|
| | 47 | | private readonly IAnalytics analytics; |
| | 48 | | private readonly IUserProfileBridge userProfileBridge; |
| | 49 | |
|
| 388 | 50 | | public SocialAnalytics(IAnalytics analytics, IUserProfileBridge userProfileBridge) |
| | 51 | | { |
| 388 | 52 | | this.analytics = analytics; |
| 388 | 53 | | this.userProfileBridge = userProfileBridge; |
| 388 | 54 | | i ??= this; |
| 388 | 55 | | } |
| | 56 | |
|
| | 57 | | public void SendPlayerMuted(string toUserId) |
| | 58 | | { |
| 0 | 59 | | PlayerType? toPlayerType = GetPlayerTypeByUserId(toUserId); |
| | 60 | |
|
| 0 | 61 | | if (toPlayerType == null) |
| 0 | 62 | | return; |
| | 63 | |
|
| 0 | 64 | | Dictionary<string, string> data = new Dictionary<string, string>(); |
| 0 | 65 | | data.Add("to", toPlayerType.ToString()); |
| | 66 | |
|
| 0 | 67 | | analytics.SendAnalytic(PLAYER_MUTED, data); |
| 0 | 68 | | } |
| | 69 | |
|
| | 70 | | public void SendPlayerUnmuted(string toUserId) |
| | 71 | | { |
| 0 | 72 | | PlayerType? toPlayerType = GetPlayerTypeByUserId(toUserId); |
| | 73 | |
|
| 0 | 74 | | if (toPlayerType == null) |
| 0 | 75 | | return; |
| | 76 | |
|
| 0 | 77 | | Dictionary<string, string> data = new Dictionary<string, string>(); |
| 0 | 78 | | data.Add("to", toPlayerType.ToString()); |
| | 79 | |
|
| 0 | 80 | | analytics.SendAnalytic(PLAYER_UNMUTED, data); |
| 0 | 81 | | } |
| | 82 | |
|
| 0 | 83 | | public void SendVoiceMessageStartedByFirstTime() { analytics.SendAnalytic(VOICE_MESSAGE_STARTED_BY_FIRST_TIME, n |
| | 84 | |
|
| | 85 | | public void SendVoiceMessage(double messageLength, VoiceMessageSource source, string fromUserId) |
| | 86 | | { |
| 0 | 87 | | PlayerType? fromPlayerType = GetPlayerTypeByUserId(fromUserId); |
| | 88 | |
|
| 0 | 89 | | if (fromPlayerType == null) |
| 0 | 90 | | return; |
| | 91 | |
|
| 0 | 92 | | Dictionary<string, string> data = new Dictionary<string, string>(); |
| 0 | 93 | | data.Add("from", fromPlayerType.ToString()); |
| 0 | 94 | | data.Add("length", messageLength.ToString()); |
| 0 | 95 | | data.Add("source", source.ToString()); |
| | 96 | |
|
| 0 | 97 | | analytics.SendAnalytic(VOICE_MESSAGE_SENT, data); |
| 0 | 98 | | } |
| | 99 | |
|
| | 100 | | public void SendVoiceChannelConnection(int numberOfPeers) |
| | 101 | | { |
| 0 | 102 | | Dictionary<string, string> data = new Dictionary<string, string>(); |
| 0 | 103 | | data.Add("numberOfPeers", numberOfPeers.ToString()); |
| | 104 | |
|
| 0 | 105 | | analytics.SendAnalytic(VOICE_CHANNEL_CONNECTION, data); |
| 0 | 106 | | } |
| | 107 | |
|
| 0 | 108 | | public void SendVoiceChannelDisconnection() { analytics.SendAnalytic(VOICE_CHANNEL_DISCONNECTION, new Dictionary |
| | 109 | |
|
| | 110 | | public void SendClickedOnCollectibles() |
| | 111 | | { |
| 0 | 112 | | analytics.SendAnalytic(PASSPORT_CLICKED_ON_COLLECTIONS, new Dictionary<string, string>()); |
| 0 | 113 | | } |
| | 114 | |
|
| | 115 | | public void SendStartedConversation(PlayerActionSource source) |
| | 116 | | { |
| 0 | 117 | | Dictionary<string, string> data = new Dictionary<string, string>(); |
| 0 | 118 | | data.Add("source", source.ToString()); |
| | 119 | |
|
| 0 | 120 | | analytics.SendAnalytic(PASSPORT_STARTED_CONVERSATION, data); |
| 0 | 121 | | } |
| | 122 | |
|
| | 123 | | public void SendNftBuy(PlayerActionSource source) |
| | 124 | | { |
| 0 | 125 | | Dictionary<string, string> data = new Dictionary<string, string>(); |
| 0 | 126 | | data.Add("source", source.ToString()); |
| | 127 | |
|
| 0 | 128 | | analytics.SendAnalytic(PASSPORT_BUY_NFT, data); |
| 0 | 129 | | } |
| | 130 | |
|
| | 131 | | public void SendInspectAvatar(double timeSpent) |
| | 132 | | { |
| 0 | 133 | | Dictionary<string, string> data = new Dictionary<string, string>(); |
| 0 | 134 | | data.Add("timeSpent", timeSpent.ToString()); |
| | 135 | |
|
| 0 | 136 | | analytics.SendAnalytic(PASSPORT_INSPECT_AVATAR, data); |
| 0 | 137 | | } |
| | 138 | |
|
| | 139 | | public void SendLinkClick(PlayerActionSource source) |
| | 140 | | { |
| 0 | 141 | | Dictionary<string, string> data = new Dictionary<string, string>(); |
| 0 | 142 | | data.Add("source", source.ToString()); |
| | 143 | |
|
| 0 | 144 | | analytics.SendAnalytic(PASSPORT_CLICK_LINK, data); |
| 0 | 145 | | } |
| | 146 | |
|
| | 147 | | public void SendCopyWallet(PlayerActionSource source) |
| | 148 | | { |
| 0 | 149 | | Dictionary<string, string> data = new Dictionary<string, string>(); |
| 0 | 150 | | data.Add("source", source.ToString()); |
| | 151 | |
|
| 0 | 152 | | analytics.SendAnalytic(PASSPORT_WALLET_COPY, data); |
| 0 | 153 | | } |
| | 154 | |
|
| | 155 | | public void SendCopyUsername(PlayerActionSource source) |
| | 156 | | { |
| 0 | 157 | | Dictionary<string, string> data = new Dictionary<string, string>(); |
| 0 | 158 | | data.Add("source", source.ToString()); |
| | 159 | |
|
| 0 | 160 | | analytics.SendAnalytic(PASSPORT_USERNAME_COPY, data); |
| 0 | 161 | | } |
| | 162 | |
|
| | 163 | | public void SendJumpInToPlayer(PlayerActionSource source) |
| | 164 | | { |
| 0 | 165 | | Dictionary<string, string> data = new Dictionary<string, string>(); |
| 0 | 166 | | data.Add("source", source.ToString()); |
| | 167 | |
|
| 0 | 168 | | analytics.SendAnalytic(PASSPORT_JUMP_IN, data); |
| 0 | 169 | | } |
| | 170 | |
|
| | 171 | | public void SendProfileEdit(int descriptionLength, bool hasLinks, PlayerActionSource source) |
| | 172 | | { |
| 0 | 173 | | var data = new Dictionary<string, string> |
| | 174 | | { |
| | 175 | | ["source"] = source.ToString(), |
| | 176 | | ["descriptionLength"] = descriptionLength.ToString(), |
| | 177 | | ["hasLinks"] = hasLinks.ToString(), |
| | 178 | | }; |
| | 179 | |
|
| 0 | 180 | | analytics.SendAnalytic(PASSPORT_EDIT_PROFILE, data); |
| 0 | 181 | | } |
| | 182 | |
|
| | 183 | | public void SendVoiceChatPreferencesChanged(VoiceChatAllow preference) |
| | 184 | | { |
| 0 | 185 | | Dictionary<string, string> data = new Dictionary<string, string>(); |
| 0 | 186 | | data.Add("allow", preference.ToString()); |
| | 187 | |
|
| 0 | 188 | | analytics.SendAnalytic(VOICE_CHAT_PREFERENCES_CHANGED, data); |
| 0 | 189 | | } |
| | 190 | |
|
| | 191 | | public void SendFriendRequestError(string senderId, string recipientId, string source, string errorDescription) |
| | 192 | | { |
| 0 | 193 | | var data = new Dictionary<string, string> |
| | 194 | | { |
| | 195 | | ["source"] = source, |
| | 196 | | ["from"] = senderId, |
| | 197 | | ["to"] = recipientId, |
| | 198 | | ["description"] = errorDescription, |
| | 199 | | }; |
| 0 | 200 | | analytics.SendAnalytic(FRIEND_REQUEST_ERROR, data); |
| 0 | 201 | | } |
| | 202 | |
|
| | 203 | | public void SendFriendRequestSent(string fromUserId, string toUserId, double messageLength, PlayerActionSource s |
| | 204 | | { |
| 0 | 205 | | PlayerType? fromPlayerType = GetPlayerTypeByUserId(fromUserId); |
| 0 | 206 | | PlayerType? toPlayerType = GetPlayerTypeByUserId(toUserId); |
| | 207 | |
|
| 0 | 208 | | if (fromPlayerType == null || toPlayerType == null) |
| 0 | 209 | | return; |
| | 210 | |
|
| 0 | 211 | | Dictionary<string, string> data = new Dictionary<string, string>(); |
| 0 | 212 | | data.Add("from", fromPlayerType.ToString()); |
| 0 | 213 | | data.Add("to", toPlayerType.ToString()); |
| | 214 | | // TODO (FRIEND REQUESTS): retro-compatibility, remove this param in the future |
| 0 | 215 | | data.Add("text_length", messageLength.ToString()); |
| 0 | 216 | | data.Add("attached_message_length", messageLength.ToString()); |
| 0 | 217 | | data.Add("attached_message", messageLength > 0 ? "true" : "false"); |
| 0 | 218 | | data.Add("source", source.ToString()); |
| | 219 | |
|
| 0 | 220 | | analytics.SendAnalytic(FRIEND_REQUEST_SENT, data); |
| 0 | 221 | | } |
| | 222 | |
|
| | 223 | | public void SendFriendRequestApproved(string fromUserId, string toUserId, string source, bool hasBodyMessage) |
| | 224 | | { |
| 0 | 225 | | PlayerType? fromPlayerType = GetPlayerTypeByUserId(fromUserId); |
| 0 | 226 | | PlayerType? toPlayerType = GetPlayerTypeByUserId(toUserId); |
| | 227 | |
|
| 0 | 228 | | if (fromPlayerType == null || toPlayerType == null) |
| 0 | 229 | | return; |
| | 230 | |
|
| 0 | 231 | | Dictionary<string, string> data = new Dictionary<string, string>(); |
| 0 | 232 | | data.Add("from", fromPlayerType.ToString()); |
| 0 | 233 | | data.Add("to", toPlayerType.ToString()); |
| 0 | 234 | | data.Add("source", source); |
| 0 | 235 | | data.Add("has_body_message", hasBodyMessage ? "true" : "false"); |
| | 236 | |
|
| 0 | 237 | | analytics.SendAnalytic(FRIEND_REQUEST_APPROVED, data); |
| 0 | 238 | | } |
| | 239 | |
|
| | 240 | | public void SendFriendRequestRejected(string fromUserId, string toUserId, string source, bool hasBodyMessage) |
| | 241 | | { |
| 0 | 242 | | PlayerType? fromPlayerType = GetPlayerTypeByUserId(fromUserId); |
| 0 | 243 | | PlayerType? toPlayerType = GetPlayerTypeByUserId(toUserId); |
| | 244 | |
|
| 0 | 245 | | if (fromPlayerType == null || toPlayerType == null) |
| 0 | 246 | | return; |
| | 247 | |
|
| 0 | 248 | | Dictionary<string, string> data = new Dictionary<string, string>(); |
| 0 | 249 | | data.Add("from", fromPlayerType.ToString()); |
| 0 | 250 | | data.Add("to", toPlayerType.ToString()); |
| 0 | 251 | | data.Add("source", source); |
| 0 | 252 | | data.Add("has_body_message", hasBodyMessage ? "true" : "false"); |
| | 253 | |
|
| 0 | 254 | | analytics.SendAnalytic(FRIEND_REQUEST_REJECTED, data); |
| 0 | 255 | | } |
| | 256 | |
|
| | 257 | | public void SendFriendRequestCancelled(string fromUserId, string toUserId, string source) |
| | 258 | | { |
| 0 | 259 | | PlayerType? fromPlayerType = GetPlayerTypeByUserId(fromUserId); |
| 0 | 260 | | PlayerType? toPlayerType = GetPlayerTypeByUserId(toUserId); |
| | 261 | |
|
| 0 | 262 | | if (fromPlayerType == null || toPlayerType == null) |
| 0 | 263 | | return; |
| | 264 | |
|
| 0 | 265 | | Dictionary<string, string> data = new Dictionary<string, string>(); |
| 0 | 266 | | data.Add("from", fromPlayerType.ToString()); |
| 0 | 267 | | data.Add("to", toPlayerType.ToString()); |
| 0 | 268 | | data.Add("source", source); |
| | 269 | |
|
| 0 | 270 | | analytics.SendAnalytic(FRIEND_REQUEST_CANCELLED, data); |
| 0 | 271 | | } |
| | 272 | |
|
| | 273 | | public void SendFriendDeleted(string fromUserId, string toUserId, PlayerActionSource source) |
| | 274 | | { |
| 0 | 275 | | PlayerType? fromPlayerType = GetPlayerTypeByUserId(fromUserId); |
| 0 | 276 | | PlayerType? toPlayerType = GetPlayerTypeByUserId(toUserId); |
| | 277 | |
|
| 0 | 278 | | if (fromPlayerType == null || toPlayerType == null) |
| 0 | 279 | | return; |
| | 280 | |
|
| 0 | 281 | | Dictionary<string, string> data = new Dictionary<string, string>(); |
| 0 | 282 | | data.Add("from", fromPlayerType.ToString()); |
| 0 | 283 | | data.Add("to", toPlayerType.ToString()); |
| 0 | 284 | | data.Add("source", source.ToString()); |
| | 285 | |
|
| 0 | 286 | | analytics.SendAnalytic(FRIEND_DELETED, data); |
| 0 | 287 | | } |
| | 288 | |
|
| | 289 | | public void SendPassportOpen() |
| | 290 | | { |
| 0 | 291 | | analytics.SendAnalytic(PASSPORT_OPENED, new Dictionary<string, string>()); |
| 0 | 292 | | } |
| | 293 | |
|
| | 294 | | public void SendPassportClose(double timeSpent) |
| | 295 | | { |
| 0 | 296 | | Dictionary<string, string> data = new Dictionary<string, string>(); |
| 0 | 297 | | data.Add("time_spent", timeSpent.ToString()); |
| | 298 | |
|
| 0 | 299 | | analytics.SendAnalytic(PASSPORT_CLOSED, data); |
| 0 | 300 | | } |
| | 301 | |
|
| | 302 | | public void SendPlayerBlocked(bool isFriend, PlayerActionSource source) |
| | 303 | | { |
| 0 | 304 | | Dictionary<string, string> data = new Dictionary<string, string>(); |
| 0 | 305 | | data.Add("friend", isFriend.ToString()); |
| 0 | 306 | | data.Add("source", source.ToString()); |
| | 307 | |
|
| 0 | 308 | | analytics.SendAnalytic(PLAYER_BLOCKED, data); |
| 0 | 309 | | } |
| | 310 | |
|
| | 311 | | public void SendPlayerUnblocked(bool isFriend, PlayerActionSource source) |
| | 312 | | { |
| 0 | 313 | | Dictionary<string, string> data = new Dictionary<string, string>(); |
| 0 | 314 | | data.Add("friend", isFriend.ToString()); |
| 0 | 315 | | data.Add("source", source.ToString()); |
| | 316 | |
|
| 0 | 317 | | analytics.SendAnalytic(PLAYER_UNBLOCKED, data); |
| 0 | 318 | | } |
| | 319 | |
|
| | 320 | | public void SendPlayerReport(PlayerReportIssueType issueType, double messageLength, PlayerActionSource source) |
| | 321 | | { |
| 0 | 322 | | Dictionary<string, string> data = new Dictionary<string, string>(); |
| 0 | 323 | | data.Add("issue_type", issueType.ToString()); |
| 0 | 324 | | data.Add("text_length", messageLength.ToString()); |
| 0 | 325 | | data.Add("source", source.ToString()); |
| | 326 | |
|
| 0 | 327 | | analytics.SendAnalytic(PLAYER_REPORT, data); |
| 0 | 328 | | } |
| | 329 | |
|
| | 330 | | public void SendPlayerJoin(PlayerActionSource source) |
| | 331 | | { |
| 0 | 332 | | Dictionary<string, string> data = new Dictionary<string, string>(); |
| 0 | 333 | | data.Add("source", source.ToString()); |
| | 334 | |
|
| 0 | 335 | | analytics.SendAnalytic(PLAYER_JOIN, data); |
| 0 | 336 | | } |
| | 337 | |
|
| | 338 | | public void SendPlayEmote(string emoteId, string emoteName, string rarity, bool isBaseEmote, UserProfile.EmoteSo |
| | 339 | | { |
| 0 | 340 | | Dictionary<string, string> data = new Dictionary<string, string>(); |
| 0 | 341 | | data.Add("id", emoteId); |
| 0 | 342 | | data.Add("name", emoteName); |
| 0 | 343 | | data.Add("rarity", rarity); |
| 0 | 344 | | data.Add("isBase", isBaseEmote.ToString()); |
| 0 | 345 | | data.Add("source", source.ToString()); |
| 0 | 346 | | data.Add("parcel_location", parcelLocation); |
| | 347 | |
|
| 0 | 348 | | analytics.SendAnalytic(PLAY_EMOTE, data); |
| 0 | 349 | | } |
| | 350 | |
|
| | 351 | | public void SendEmptyChannelCreated(string channelName, ChannelJoinedSource source) |
| | 352 | | { |
| 0 | 353 | | var data = new Dictionary<string, string> |
| | 354 | | { |
| | 355 | | ["source"] = source switch |
| | 356 | | { |
| 0 | 357 | | ChannelJoinedSource.Command => "command", |
| 0 | 358 | | ChannelJoinedSource.Link => "link", |
| 0 | 359 | | ChannelJoinedSource.Search => "create_search", |
| 0 | 360 | | _ => "" |
| | 361 | | }, |
| | 362 | | ["channel"] = channelName |
| | 363 | | }; |
| 0 | 364 | | analytics.SendAnalytic(EMPTY_CHANNEL_CREATED, data); |
| 0 | 365 | | } |
| | 366 | |
|
| | 367 | | public void SendPopulatedChannelJoined(string channelName, ChannelJoinedSource source, string method) |
| | 368 | | { |
| 0 | 369 | | var data = new Dictionary<string, string> |
| | 370 | | { |
| | 371 | | ["source"] = source switch |
| | 372 | | { |
| 0 | 373 | | ChannelJoinedSource.Command => "command", |
| 0 | 374 | | ChannelJoinedSource.Link => "link", |
| 0 | 375 | | ChannelJoinedSource.Search => "search", |
| 0 | 376 | | ChannelJoinedSource.ConversationList => "conversation_list", |
| 0 | 377 | | _ => "" |
| | 378 | | }, |
| | 379 | | ["channel"] = channelName, |
| | 380 | | ["method"] = method |
| | 381 | | }; |
| 0 | 382 | | analytics.SendAnalytic(POPULATED_CHANNEL_JOINED, data); |
| 0 | 383 | | } |
| | 384 | |
|
| | 385 | | public void SendLeaveChannel(string channelId, ChannelLeaveSource source) |
| | 386 | | { |
| 0 | 387 | | var data = new Dictionary<string, string> |
| | 388 | | { |
| | 389 | | ["source"] = source switch |
| | 390 | | { |
| 0 | 391 | | ChannelLeaveSource.Chat => "chat", |
| 0 | 392 | | ChannelLeaveSource.Command => "command", |
| 0 | 393 | | ChannelLeaveSource.Search => "search", |
| 0 | 394 | | ChannelLeaveSource.ConversationList => "conversation_list", |
| 0 | 395 | | _ => "" |
| | 396 | | }, |
| | 397 | | ["channel"] = channelId |
| | 398 | | }; |
| 0 | 399 | | analytics.SendAnalytic(CHANNEL_LEAVE, data); |
| 0 | 400 | | } |
| | 401 | |
|
| | 402 | | public void SendChannelSearch(string text) |
| | 403 | | { |
| 0 | 404 | | var data = new Dictionary<string, string> |
| | 405 | | { |
| | 406 | | ["search"] = text |
| | 407 | | }; |
| 0 | 408 | | analytics.SendAnalytic(CHANNEL_SEARCH, data); |
| 0 | 409 | | } |
| | 410 | |
|
| | 411 | | public void SendChannelLinkClicked(string channel, bool joinAccepted, ChannelLinkSource source) |
| | 412 | | { |
| 0 | 413 | | var data = new Dictionary<string, string> |
| | 414 | | { |
| | 415 | | ["source"] = source switch |
| | 416 | | { |
| 0 | 417 | | ChannelLinkSource.Chat => "chat", |
| 0 | 418 | | ChannelLinkSource.Event => "event", |
| 0 | 419 | | ChannelLinkSource.Place => "place", |
| 0 | 420 | | ChannelLinkSource.Profile => "profile", |
| 0 | 421 | | _ => "" |
| | 422 | | }, |
| | 423 | | ["channel"] = channel, |
| | 424 | | ["result"] = joinAccepted ? "joined" : "cancel" |
| | 425 | | }; |
| 0 | 426 | | analytics.SendAnalytic(CHANNEL_LINK_CLICK, data); |
| 0 | 427 | | } |
| | 428 | |
|
| | 429 | | private PlayerType? GetPlayerTypeByUserId(string userId) |
| | 430 | | { |
| 0 | 431 | | if (string.IsNullOrEmpty(userId)) |
| 0 | 432 | | return null; |
| | 433 | |
|
| 0 | 434 | | UserProfile userProfile = userProfileBridge.Get(userId); |
| | 435 | |
|
| 0 | 436 | | if (userProfile == null) |
| 0 | 437 | | return null; |
| 0 | 438 | | return userProfile.isGuest ? PlayerType.Guest : PlayerType.Wallet; |
| | 439 | | } |
| | 440 | | } |
| | 441 | | } |