< Summary

Class:DCL.Interface.WebInterface
Assembly:WebInterface
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/WebInterface/Interface.cs
Covered lines:273
Uncovered lines:246
Coverable lines:519
Total lines:2074
Line coverage:52.6% (273 of 519)
Covered branches:0
Total branches:0
Covered methods:65
Total methods:159
Method coverage:40.8% (65 of 159)

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
WebInterface()0%110100%
SceneReady(...)0%110100%
ActivateRenderingACK()0%2100%
DeactivateRenderingACK()0%2100%
OnGlobalPointerEvent()0%110100%
StoreSceneStateEvent()0%110100%
OnTextInputChangeTextEventPayload()0%110100%
operator+(...)0%2100%
OnMetricsUpdate()0%110100%
TransformPayload()0%2100%
SystemInfoReportPayload()0%2100%
JumpInPayload()0%110100%
Property(...)0%2100%
HeadersPayload()0%110100%
AvatarOnClickPayload()0%110100%
StartDecentraland()0%2100%
CheckURLParam(...)0%2100%
GetURLParam(...)0%2100%
MessageFromEngine(...)0%5.155081.82%
ProcessQueuedMessages()0%330100%
GetGraphicCard()0%110100%
SendMessage(...)0%110100%
SendMessage[T](...)0%110100%
SendJson(...)0%2.062075%
SendSceneEvent[T](...)0%110100%
SendAllScenesEvent[T](...)0%110100%
ReportPosition(...)0%110100%
ReloadScene(...)0%2100%
ReportCameraChanged(...)0%110100%
ReportCameraChanged(...)0%220100%
Web3UseResponse(...)0%2100%
ReportIdleStateChanged(...)0%110100%
ReportControlEvent[T](...)0%110100%
SendRequestHeadersForUrl(...)0%6200%
BuilderInWorldMessage(...)0%2100%
ReportOnClickEvent(...)0%2.032080%
ReportRaycastResult[T, P](...)0%2100%
ReportRaycastHitFirstResult(...)0%2100%
ReportRaycastHitAllResult(...)0%2100%
CreateHitObject(...)0%110100%
SetPointerEventPayload(...)0%220100%
ReportGlobalPointerEvent(...)0%110100%
ReportOnPointerDownEvent(...)0%2.012085.71%
ReportOnPointerUpEvent(...)0%2.012085.71%
ReportOnTextSubmitEvent(...)0%2.022083.33%
ReportOnTextInputChangedEvent(...)0%3.192033.33%
ReportOnTextInputChangedTextEvent(...)0%220100%
ReportOnFocusEvent(...)0%2.862040%
ReportOnBlurEvent(...)0%2.862040%
ReportOnScrollChange(...)0%220100%
ReportEvent[T](...)0%2100%
ReportOnMetricsUpdate(...)0%110100%
ReportOnEnterEvent(...)0%6200%
LogOut()0%2100%
RedirectToSignUp()0%2100%
PreloadFinished(...)0%2100%
ReportMousePosition(...)0%2100%
SendScreenshot(...)0%2100%
SetScenesLoadRadius(...)0%110100%
SendSaveUserDescriptionPayload(...)0%2100%
RequestOwnProfileUpdate()0%2100%
SendSaveAvatar(...)0%2100%
SaveUserOutfits(...)0%2100%
SendAuthentication(...)0%2100%
SendPassport(...)0%110100%
SendSaveUserVerifiedName(...)0%2100%
SendSaveUserUnverifiedName(...)0%2100%
SendSaveUserDescription(...)0%2100%
SendRequestUserProfile(...)0%2100%
SaveUserTutorialStep(...)0%2100%
SendPerformanceReport(...)0%2100%
SendSystemInfoReport()0%2100%
SendTermsOfServiceResponse(...)0%110100%
OpenURL(...)0%2100%
PublishStatefulScene(...)0%2100%
SendReportScene(...)0%110100%
SetHomeScene(...)0%2100%
SendReportPlayer(...)0%110100%
SendBlockPlayer(...)0%110100%
SendUnblockPlayer(...)0%2100%
RequestScenesInfoAroundParcel(...)0%2100%
SendAudioStreamEvent(...)0%110100%
SendAudioStreamEventForEntity(...)0%110100%
KillAudioStream(...)0%110100%
JoinVoiceChat()0%110100%
LeaveVoiceChat()0%110100%
SendSetVoiceChatRecording(...)0%2100%
ToggleVoiceChatRecording()0%2100%
ApplySettings(...)0%110100%
RequestGIFProcessor(...)0%2100%
DeleteGIF(...)0%2100%
GoTo(...)0%2100%
GoToCrowd()0%2100%
GoToMagic()0%2100%
LoadingHUDReadyForTeleport(...)0%2100%
JumpIn(...)0%2100%
JumpInHome(...)0%2100%
SendChatMessage(...)0%2100%
UpdateFriendshipStatus(...)0%2100%
ScenesLoadingFeedback(...)0%2100%
FetchHotScenes()0%2100%
SetBaseResolution(...)0%110100%
ReportAnalyticsEvent(...)0%2100%
ReportAnalyticsEvent(...)0%2100%
FetchBalanceOfMANA()0%110100%
SendSceneExternalActionEvent(...)0%2100%
SetMuteUsers(...)0%110100%
SendCloseUserAvatar(...)0%2100%
KillPortableExperience(...)0%2100%
RequestThirdPartyWearables(...)0%110100%
SetDisabledPortableExperiences(...)0%2100%
RequestWearables(...)0%110100%
RequestEmotes(...)0%2100%
SearchENSOwner(...)0%110100%
RequestHomeCoordinates()0%2100%
RequestUserProfile(...)0%2100%
ReportAvatarFatalError(...)0%2100%
UnpublishScene(...)0%2100%
NotifyStatusThroughChat(...)0%2100%
ReportVideoProgressEvent(...)0%330100%
ReportAvatarRemoved(...)0%2100%
ReportAvatarSceneChanged(...)0%2100%
ReportAvatarClick(...)0%2100%
ReportOnPointerHoverEnterEvent(...)0%110100%
ReportOnPointerHoverExitEvent(...)0%110100%
ReportTime(...)0%110100%
GetFriendsWithDirectMessages(...)0%2100%
MarkMessagesAsSeen(...)0%110100%
GetPrivateMessages(...)0%2100%
MarkChannelMessagesAsSeen(...)0%110100%
GetUnseenMessagesByUser()0%2100%
GetUnseenMessagesByChannel()0%2100%
GetFriends(...)0%2100%
GetFriends(...)0%2100%
LeaveChannel(...)0%2100%
CreateChannel(...)0%2100%
JoinOrCreateChannel(...)0%2100%
GetChannelMessages(...)0%2100%
GetJoinedChannels(...)0%2100%
GetChannels(...)0%110100%
GetChannelInfo(...)0%110100%
GetChannelMembers(...)0%110100%
MuteChannel(...)0%2100%
UpdateMemoryUsage()0%2100%
RequestAudioDevices()0%2100%
SetInputAudioDevice(...)0%2100%
SendToSPopupAccepted()0%2100%
SendToSPopupRejected()0%2100%
SendGoToTos()0%2100%
SaveProfileLinks(...)0%2100%
SaveAdditionalInfo(...)0%2100%
GetWithCollectionsUrlParam()0%2100%
GetWithItemsUrlParam()0%2100%
FetchRealmsInfo()0%2100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/WebInterface/Interface.cs

#LineLine coverage
 1using DCL.Backpack;
 2using System;
 3using System.Collections.Generic;
 4using DCL.CameraTool;
 5using DCL.Models;
 6using Newtonsoft.Json;
 7using System.Linq;
 8using UnityEngine;
 9using Ray = UnityEngine.Ray;
 10
 11#if UNITY_WEBGL && !UNITY_EDITOR
 12using System.Runtime.InteropServices;
 13#endif
 14
 15namespace DCL.Interface
 16{
 17    /**
 18     * This class contains the outgoing interface of Decentraland.
 19     * You must call those functions to interact with the WebInterface.
 20     *
 21     * The messages comming from the WebInterface instead, are reported directly to
 22     * the handler GameObject by name.
 23     */
 24    public static class WebInterface
 25    {
 126        public static bool VERBOSE = false;
 27
 28        [System.Serializable]
 29        public class ReportPositionPayload
 30        {
 31            /** Camera position, world space */
 32            public Vector3 position;
 33
 34            /** Character rotation */
 35            public Quaternion rotation;
 36
 37            /** Camera rotation */
 38            public Quaternion cameraRotation;
 39
 40            public float playerHeight;
 41
 42            public Vector3 mousePosition;
 43
 44            public string id;
 45        }
 46
 47        [Serializable]
 48        public class ReloadScenePayload
 49        {
 50            public Vector2 coords;
 51        }
 52
 53        [System.Serializable]
 54        public abstract class ControlEvent
 55        {
 56            public string eventType;
 57        }
 58
 59        public abstract class ControlEvent<T> : ControlEvent
 60        {
 61            public T payload;
 62
 63            protected ControlEvent(string eventType, T payload)
 64            {
 65                this.eventType = eventType;
 66                this.payload = payload;
 67            }
 68        }
 69
 70        [System.Serializable]
 71        public class SceneReady : ControlEvent<SceneReady.Payload>
 72        {
 73
 48274            public SceneReady(int sceneNumber) : base("SceneReady", new Payload() { sceneNumber = sceneNumber }) { }
 75
 76            [System.Serializable]
 77            public class Payload
 78            {
 79                public int sceneNumber;
 80            }
 81        }
 82
 83        [System.Serializable]
 84        public class ActivateRenderingACK : ControlEvent<object>
 85        {
 086            public ActivateRenderingACK() : base("ActivateRenderingACK", null) { }
 87        }
 88
 89        [System.Serializable]
 90        public class DeactivateRenderingACK : ControlEvent<object>
 91        {
 092            public DeactivateRenderingACK() : base("DeactivateRenderingACK", null) { }
 93        }
 94
 95        [System.Serializable]
 96        public class SceneEvent<T>
 97        {
 98            public int sceneNumber;
 99            public string eventType;
 100            public T payload;
 101        }
 102
 103        [System.Serializable]
 104        public class AllScenesEvent<T>
 105        {
 106            public string eventType;
 107            public T payload;
 108        }
 109
 110        [System.Serializable]
 111        public class UUIDEvent<TPayload>
 112            where TPayload : class, new()
 113        {
 114            public string uuid;
 115            public TPayload payload = new TPayload();
 116        }
 117
 118        private static IEnumerable<ACTION_BUTTON> concreteActionButtons;
 119        public static IEnumerable<ACTION_BUTTON> ConcreteActionButtons =>
 170120            concreteActionButtons ??= Enum.GetValues(typeof(ACTION_BUTTON)).Cast<ACTION_BUTTON>()
 2380121                                          .Where(actionButton => actionButton != ACTION_BUTTON.ANY);
 122
 123        public enum ACTION_BUTTON
 124        {
 125            POINTER = 0,
 126            PRIMARY = 1,
 127            SECONDARY = 2,
 128            ANY = 3,
 129            FORWARD = 4,
 130            BACKWARD = 5,
 131            RIGHT = 6,
 132            LEFT = 7,
 133            JUMP = 8,
 134            WALK = 9,
 135            ACTION_3 = 10,
 136            ACTION_4 = 11,
 137            ACTION_5 = 12,
 138            ACTION_6 = 13
 139        }
 140
 141        [System.Serializable]
 142        public class OnClickEvent : UUIDEvent<OnClickEventPayload> { };
 143
 144        [System.Serializable]
 145        public class CameraModePayload
 146        {
 147            public CameraMode.ModeId cameraMode;
 148        };
 149
 150        [System.Serializable]
 151        public class Web3UseResponsePayload
 152        {
 153            public string id;
 154            public bool result;
 155        };
 156
 157        [System.Serializable]
 158        public class IdleStateChangedPayload
 159        {
 160            public bool isIdle;
 161        };
 162
 163        [System.Serializable]
 164        public class OnPointerDownEvent : UUIDEvent<OnPointerEventPayload> { };
 165
 166        [System.Serializable]
 167        public class OnGlobalPointerEvent
 168        {
 1169            public OnGlobalPointerEventPayload payload = new OnGlobalPointerEventPayload();
 170        };
 171
 172        [System.Serializable]
 173        public class OnPointerUpEvent : UUIDEvent<OnPointerEventPayload> { };
 174
 175        [System.Serializable]
 176        private class OnTextSubmitEvent : UUIDEvent<OnTextSubmitEventPayload> { };
 177
 178        [System.Serializable]
 179        private class OnTextInputChangeEvent : UUIDEvent<OnTextInputChangeEventPayload> { };
 180
 181        [System.Serializable]
 182        private class OnTextInputChangeTextEvent : UUIDEvent<OnTextInputChangeTextEventPayload> { };
 183
 184        [System.Serializable]
 185        private class OnScrollChangeEvent : UUIDEvent<OnScrollChangeEventPayload> { };
 186
 187        [System.Serializable]
 188        private class OnFocusEvent : UUIDEvent<EmptyPayload> { };
 189
 190        [System.Serializable]
 191        private class OnBlurEvent : UUIDEvent<EmptyPayload> { };
 192
 193        [System.Serializable]
 194        public class OnEnterEvent : UUIDEvent<OnEnterEventPayload> { };
 195
 196        [System.Serializable]
 197        public class OnClickEventPayload
 198        {
 199            public ACTION_BUTTON buttonId = ACTION_BUTTON.POINTER;
 200        }
 201
 202        [System.Serializable]
 203        public class SendChatMessageEvent
 204        {
 205            public ChatMessage message;
 206        }
 207
 208        [System.Serializable]
 209        public class RemoveEntityComponentsPayLoad
 210        {
 211            public string entityId;
 212            public string componentId;
 213        };
 214
 215        [System.Serializable]
 216        public class StoreSceneStateEvent
 217        {
 1218            public string type = "StoreSceneState";
 1219            public string payload = "";
 220        };
 221
 222        [System.Serializable]
 223        public class OnPointerEventPayload
 224        {
 225
 226            public ACTION_BUTTON buttonId;
 227            public Vector3 origin;
 228            public Vector3 direction;
 229            public Hit hit;
 230
 231            [System.Serializable]
 232            public class Hit
 233            {
 234                public Vector3 origin;
 235                public float length;
 236                public Vector3 hitPoint;
 237                public Vector3 normal;
 238                public Vector3 worldNormal;
 239                public string meshName;
 240                public string entityId;
 241            }
 242        }
 243
 244        [System.Serializable]
 245        public class OnGlobalPointerEventPayload : OnPointerEventPayload
 246        {
 247            public enum InputEventType
 248            {
 249                DOWN,
 250                UP
 251            }
 252
 253            public InputEventType type;
 254        }
 255
 256        [System.Serializable]
 257        public class OnTextSubmitEventPayload
 258        {
 259            public string id;
 260            public string text;
 261        }
 262
 263        [System.Serializable]
 264        public class OnTextInputChangeEventPayload
 265        {
 266            public string value;
 267        }
 268
 269        [System.Serializable]
 270        public class OnTextInputChangeTextEventPayload
 271        {
 272
 3273            public Payload value = new Payload();
 274
 275            [System.Serializable]
 276            public class Payload
 277            {
 278                public string value;
 279                public bool isSubmit;
 280            }
 281        }
 282
 283        [System.Serializable]
 284        public class OnScrollChangeEventPayload
 285        {
 286            public Vector2 value;
 287            public int pointerId;
 288        }
 289
 290        [System.Serializable]
 291        public class EmptyPayload { }
 292
 293        [System.Serializable]
 294        public class MetricsModel
 295        {
 296            public int meshes;
 297            public int bodies;
 298            public int materials;
 299            public int textures;
 300            public int triangles;
 301            public int entities;
 302
 303            public static MetricsModel operator +(MetricsModel lhs, MetricsModel rhs)
 304            {
 0305                return new MetricsModel()
 306                {
 307                    meshes = lhs.meshes + rhs.meshes,
 308                    bodies = lhs.bodies + rhs.bodies,
 309                    materials = lhs.materials + rhs.materials,
 310                    textures = lhs.textures + rhs.textures,
 311                    triangles = lhs.triangles + rhs.triangles,
 312                    entities = lhs.entities + rhs.entities
 313                };
 314            }
 315        }
 316
 317        [System.Serializable]
 318        private class OnMetricsUpdate
 319        {
 1320            public MetricsModel given = new MetricsModel();
 1321            public MetricsModel limit = new MetricsModel();
 322        }
 323
 324        [System.Serializable]
 325        public class OnEnterEventPayload { }
 326
 327        [System.Serializable]
 328        public class TransformPayload
 329        {
 0330            public Vector3 position = Vector3.zero;
 0331            public Quaternion rotation = Quaternion.identity;
 0332            public Vector3 scale = Vector3.one;
 333        }
 334
 335        public class OnSendScreenshot
 336        {
 337            public string encodedTexture;
 338            public string id;
 339        };
 340
 341        [System.Serializable]
 342        public class GotoEvent
 343        {
 344            public int x;
 345            public int y;
 346        };
 347
 348        [System.Serializable]
 349        public class BaseResolution
 350        {
 351            public int baseResolution;
 352        };
 353
 354        //-----------------------------------------------------
 355        // Raycast
 356        [System.Serializable]
 357        public class RayInfo
 358        {
 359            public Vector3 origin;
 360            public Vector3 direction;
 361            public float distance;
 362        }
 363
 364        [System.Serializable]
 365        public class RaycastHitInfo
 366        {
 367            public bool didHit;
 368            public RayInfo ray;
 369
 370            public Vector3 hitPoint;
 371            public Vector3 hitNormal;
 372        }
 373
 374        [System.Serializable]
 375        public class HitEntityInfo
 376        {
 377            public string entityId;
 378            public string meshName;
 379        }
 380
 381        [System.Serializable]
 382        public class RaycastHitEntity : RaycastHitInfo
 383        {
 384            public HitEntityInfo entity;
 385        }
 386
 387        [System.Serializable]
 388        public class RaycastHitEntities : RaycastHitInfo
 389        {
 390            public RaycastHitEntity[] entities;
 391        }
 392
 393        [System.Serializable]
 394        public class RaycastResponse<T> where T : RaycastHitInfo
 395        {
 396            public string queryId;
 397            public string queryType;
 398            public T payload;
 399        }
 400
 401        // Note (Zak): We need to explicitly define this classes for the JsonUtility to
 402        // be able to serialize them
 403        [System.Serializable]
 404        public class RaycastHitFirstResponse : RaycastResponse<RaycastHitEntity> { }
 405
 406        [System.Serializable]
 407        public class RaycastHitAllResponse : RaycastResponse<RaycastHitEntities> { }
 408
 409        [System.Serializable]
 410        public class SendBlockPlayerPayload
 411        {
 412            public string userId;
 413        }
 414
 415        [Serializable]
 416        private class SendReportPlayerPayload
 417        {
 418            public string userId;
 419            public string name;
 420        }
 421
 422        [Serializable]
 423        private class SendReportScenePayload
 424        {
 425            public int sceneNumber;
 426        }
 427
 428        [Serializable]
 429        private class SetHomeScenePayload
 430        {
 431            public string sceneCoords;
 432        }
 433
 434        [System.Serializable]
 435        public class SendUnblockPlayerPayload
 436        {
 437            public string userId;
 438        }
 439
 440        [System.Serializable]
 441        public class TutorialStepPayload
 442        {
 443            public int tutorialStep;
 444        }
 445
 446        [System.Serializable]
 447        public class PerformanceReportPayload
 448        {
 449            public string samples;
 450            public bool fpsIsCapped;
 451            public int hiccupsInThousandFrames;
 452            public float hiccupsTime;
 453            public float totalTime;
 454            public int gltfInProgress;
 455            public int gltfFailed;
 456            public int gltfCancelled;
 457            public int gltfLoaded;
 458            public int abInProgress;
 459            public int abFailed;
 460            public int abCancelled;
 461            public int abLoaded;
 462            public int gltfTexturesLoaded;
 463            public int abTexturesLoaded;
 464            public int promiseTexturesLoaded;
 465            public int enqueuedMessages;
 466            public int processedMessages;
 467            public int playerCount;
 468            public int loadRadius;
 469            public object drawCalls; //int *
 470            public object memoryReserved; //long, in total bytes *
 471            public object memoryUsage; //long, in total bytes *
 472            public object totalGCAlloc; //long, in total bytes, its the sum of all GCAllocs per frame over 1000 frames *
 473            public Dictionary<int, long> sceneScores;
 474
 475            //* is NULL if SendProfilerMetrics is false
 476        }
 477
 478        [System.Serializable]
 479        public class SystemInfoReportPayload
 480        {
 0481            public string graphicsDeviceName = SystemInfo.graphicsDeviceName;
 0482            public string graphicsDeviceVersion = SystemInfo.graphicsDeviceVersion;
 0483            public int graphicsMemorySize = SystemInfo.graphicsMemorySize;
 0484            public string processorType = SystemInfo.processorType;
 0485            public int processorCount = SystemInfo.processorCount;
 0486            public int systemMemorySize = SystemInfo.systemMemorySize;
 487
 488            // TODO: remove useBinaryTransform after ECS7 is fully in prod
 0489            public bool useBinaryTransform = true;
 490        }
 491
 492        [System.Serializable]
 493        public class GenericAnalyticPayload
 494        {
 495            public string eventName;
 496            public Dictionary<object, object> data;
 497        }
 498
 499        [System.Serializable]
 500        public class PerformanceHiccupPayload
 501        {
 502            public int hiccupsInThousandFrames;
 503            public float hiccupsTime;
 504            public float totalTime;
 505        }
 506
 507        [System.Serializable]
 508        public class TermsOfServiceResponsePayload
 509        {
 510            public int sceneNumber;
 511            public bool dontShowAgain;
 512            public bool accepted;
 513        }
 514
 515        [System.Serializable]
 516        public class OpenURLPayload
 517        {
 518            public string url;
 519        }
 520
 521        [System.Serializable]
 522        public class GIFSetupPayload
 523        {
 524            public string imageSource;
 525            public string id;
 526            public bool isWebGL1;
 527        }
 528
 529        [System.Serializable]
 530        public class RequestScenesInfoAroundParcelPayload
 531        {
 532            public Vector2 parcel;
 533            public int scenesAround;
 534        }
 535
 536        [System.Serializable]
 537        public class AudioStreamingPayload
 538        {
 539            public string url;
 540            public bool play;
 541            public float volume;
 542        }
 543
 544        [System.Serializable]
 545        public class AudioStreamingForEntityPayload : AudioStreamingPayload
 546        {
 547            public int sceneNumber;
 548            public long entityId;
 549        }
 550
 551        [System.Serializable]
 552        public class AudioStreamingKillPayload
 553        {
 554            public int sceneNumber;
 555            public long entityId;
 556        }
 557
 558        [System.Serializable]
 559        public class SetScenesLoadRadiusPayload
 560        {
 561            public float newRadius;
 562        }
 563
 564        [System.Serializable]
 565        public class SetVoiceChatRecordingPayload
 566        {
 567            public bool recording;
 568        }
 569
 570        [System.Serializable]
 571        public class ApplySettingsPayload
 572        {
 573            public float voiceChatVolume;
 574            public int voiceChatAllowCategory;
 575        }
 576
 577        [Serializable]
 578        public class UserRealmPayload
 579        {
 580            public string serverName;
 581            public string layer;
 582        }
 583
 584        [System.Serializable]
 585        public class JumpInPayload
 586        {
 1587            public UserRealmPayload realm = new UserRealmPayload();
 588            public Vector2 gridPosition;
 589        }
 590
 591        [System.Serializable]
 592        public class LoadingFeedbackMessage
 593        {
 594            public string message;
 595            public int loadPercentage;
 596        }
 597
 598        [System.Serializable]
 599        public class AnalyticsPayload
 600        {
 601
 602            public string name;
 603            public Property[] properties;
 604
 605            [System.Serializable]
 606            public class Property
 607            {
 608                public string key;
 609                public string value;
 610
 0611                public Property(string key, string value)
 612                {
 0613                    this.key = key;
 0614                    this.value = value;
 0615                }
 616            }
 617        }
 618
 619        [System.Serializable]
 620        public class DelightedSurveyEnabledPayload
 621        {
 622            public bool enabled;
 623        }
 624
 625        [System.Serializable]
 626        public class ExternalActionSceneEventPayload
 627        {
 628            public string type;
 629            public string payload;
 630        }
 631
 632        [System.Serializable]
 633        public class MuteUserPayload
 634        {
 635            public string[] usersId;
 636            public bool mute;
 637        }
 638
 639        [System.Serializable]
 640        public class CloseUserAvatarPayload
 641        {
 642            public bool isSignUpFlow;
 643        }
 644
 645        [System.Serializable]
 646        public class StringPayload
 647        {
 648            public string value;
 649        }
 650
 651        [System.Serializable]
 652        public class KillPortableExperiencePayload
 653        {
 654            public string portableExperienceId;
 655        }
 656
 657        [System.Serializable]
 658        public class SetDisabledPortableExperiencesPayload
 659        {
 660            public string[] idsToDisable;
 661        }
 662
 663        [System.Serializable]
 664        public class WearablesRequestFiltersPayload
 665        {
 666            public string ownedByUser;
 667            public string[] wearableIds;
 668            public string[] collectionIds;
 669            public string thirdPartyId;
 670        }
 671
 672        [System.Serializable]
 673        public class EmotesRequestFiltersPayload
 674        {
 675            public string ownedByUser;
 676            public string[] emoteIds;
 677            public string[] collectionIds;
 678            public string thirdPartyId;
 679        }
 680
 681        [System.Serializable]
 682        public class RequestWearablesPayload
 683        {
 684            public WearablesRequestFiltersPayload filters;
 685            public string context;
 686        }
 687
 688        [System.Serializable]
 689        public class RequestEmotesPayload
 690        {
 691            public EmotesRequestFiltersPayload filters;
 692            public string context;
 693        }
 694
 695        [System.Serializable]
 696        public class HeadersPayload
 697        {
 698            public string method;
 699            public string url;
 1700            public Dictionary<string, object> metadata = new Dictionary<string, object>();
 701        }
 702
 703        [System.Serializable]
 704        public class SearchENSOwnerPayload
 705        {
 706            public string name;
 707            public int maxResults;
 708        }
 709
 710        [System.Serializable]
 711        public class UnpublishScenePayload
 712        {
 713            public string coordinates;
 714        }
 715
 716        [System.Serializable]
 717        public class AvatarStateBase
 718        {
 719            public string type;
 720            public string avatarShapeId;
 721        }
 722
 723        [System.Serializable]
 724        public class AvatarStateSceneChanged : AvatarStateBase
 725        {
 726            public int sceneNumber;
 727        }
 728
 729        [System.Serializable]
 730        public class AvatarOnClickPayload
 731        {
 732            public string userId;
 1733            public RayInfo ray = new RayInfo();
 734        }
 735
 736        [System.Serializable]
 737        public class TimeReportPayload
 738        {
 739            public float timeNormalizationFactor;
 740            public float cycleTime;
 741            public bool isPaused;
 742            public float time;
 743        }
 744
 745        [System.Serializable]
 746        public class GetFriendsWithDirectMessagesPayload
 747        {
 748            public string userNameOrId;
 749            public int limit;
 750            public int skip;
 751        }
 752
 753        [System.Serializable]
 754        public class MarkMessagesAsSeenPayload
 755        {
 756            public string userId;
 757        }
 758
 759        [System.Serializable]
 760        public class MarkChannelMessagesAsSeenPayload
 761        {
 762            public string channelId;
 763        }
 764
 765        [System.Serializable]
 766        public class GetPrivateMessagesPayload
 767        {
 768            public string userId;
 769            public int limit;
 770            public string fromMessageId;
 771        }
 772
 773        [Serializable]
 774        public class FriendshipUpdateStatusMessage
 775        {
 776            public string userId;
 777            public FriendshipAction action;
 778        }
 779
 780        [Serializable]
 781        public class SetInputAudioDevicePayload
 782        {
 783            public string deviceId;
 784        }
 785
 786        public enum FriendshipAction
 787        {
 788            NONE,
 789            APPROVED,
 790            REJECTED,
 791            CANCELLED,
 792            REQUESTED_FROM,
 793            REQUESTED_TO,
 794            DELETED
 795        }
 796
 797        [Serializable]
 798        private class GetFriendsPayload
 799        {
 800            public string userNameOrId;
 801            public int limit;
 802            public int skip;
 803        }
 804
 805        [Serializable]
 806        private class LeaveChannelPayload
 807        {
 808            public string channelId;
 809        }
 810
 811        [Serializable]
 812        private class CreateChannelPayload
 813        {
 814            public string channelId;
 815        }
 816
 817        public struct MuteChannelPayload
 818        {
 819            public string channelId;
 820            public bool muted;
 821        }
 822
 823        [Serializable]
 824        private class JoinOrCreateChannelPayload
 825        {
 826            public string channelId;
 827        }
 828
 829        [Serializable]
 830        private class GetChannelMessagesPayload
 831        {
 832            public string channelId;
 833            public int limit;
 834            public string from;
 835        }
 836
 837        [Serializable]
 838        private class GetJoinedChannelsPayload
 839        {
 840            public int limit;
 841            public int skip;
 842        }
 843
 844        [Serializable]
 845        private class GetChannelsPayload
 846        {
 847            public int limit;
 848            public string since;
 849            public string name;
 850        }
 851
 852        [Serializable]
 853        private class GetChannelInfoPayload
 854        {
 855            public string[] channelIds;
 856        }
 857
 858        [Serializable]
 859        private class GetChannelMembersPayload
 860        {
 861            public string channelId;
 862            public int limit;
 863            public int skip;
 864            public string userName;
 865        }
 866
 867        [Serializable]
 868        private class ErrorPayload
 869        {
 870            public string error;
 871        }
 872
 873        [Serializable]
 874        public class SaveLinksPayload
 875        {
 876            [Serializable]
 877            public class Link
 878            {
 879                public string title;
 880                public string url;
 881            }
 882
 883            public List<Link> links;
 884        }
 885
 886        [Serializable]
 887        public class SaveAdditionalInfoPayload
 888        {
 889            public string country;
 890            public string employmentStatus;
 891            public string gender;
 892            public string pronouns;
 893            public string relationshipStatus;
 894            public string sexualOrientation;
 895            public string language;
 896            public string profession;
 897            public long birthdate;
 898            public string realName;
 899            public string hobbies;
 900        }
 901
 902        public static event Action<string, byte[]> OnBinaryMessageFromEngine;
 903
 904#if UNITY_WEBGL && !UNITY_EDITOR
 905    /**
 906     * This method is called after the first render. It marks the loading of the
 907     * rest of the JS client.
 908     */
 909    [DllImport("__Internal")] public static extern void StartDecentraland();
 910    [DllImport("__Internal")] public static extern void MessageFromEngine(string type, string message);
 911    [DllImport("__Internal")] public static extern string GetGraphicCard();
 912    [DllImport("__Internal")] public static extern bool CheckURLParam(string targetParam);
 913    [DllImport("__Internal")] public static extern string GetURLParam(string targetParam);
 914
 915    public static System.Action<string, string> OnMessageFromEngine;
 916#else
 917        public static Action<string, string> OnMessageFromEngine
 918        {
 919            set
 920            {
 62921                OnMessage = value;
 62922                if (OnMessage != null)
 923                {
 31924                    ProcessQueuedMessages();
 925                }
 62926            }
 3646927            get => OnMessage;
 928        }
 929        private static Action<string, string> OnMessage;
 930
 1931        private static bool hasQueuedMessages = false;
 1932        private static List<(string, string)> queuedMessages = new List<(string, string)>();
 0933        public static void StartDecentraland() { }
 934
 935        // CheckURLParam() is only available on web builds.
 0936        public static bool CheckURLParam(string targetParam) { return false; }
 937
 938        // GetURLParam() is only available on web builds.
 0939        public static string GetURLParam(string targetParam) { return String.Empty; }
 940
 941        public static void MessageFromEngine(string type, string message)
 942        {
 2379943            if (OnMessageFromEngine != null)
 944            {
 1205945                if (hasQueuedMessages)
 946                {
 0947                    ProcessQueuedMessages();
 948                }
 949
 1205950                OnMessageFromEngine.Invoke(type, message);
 1205951                if (VERBOSE)
 952                {
 0953                    Debug.Log("MessageFromEngine called with: " + type + ", " + message);
 954                }
 955            }
 956            else
 957            {
 1174958                lock (queuedMessages)
 959                {
 1174960                    queuedMessages.Add((type, message));
 1174961                }
 962
 1174963                hasQueuedMessages = true;
 964            }
 2379965        }
 966
 967        private static void ProcessQueuedMessages()
 968        {
 31969            hasQueuedMessages = false;
 31970            lock (queuedMessages)
 971            {
 2360972                foreach ((string type, string payload) in queuedMessages)
 973                {
 1149974                    MessageFromEngine(type, payload);
 975                }
 976
 31977                queuedMessages.Clear();
 31978            }
 31979        }
 980
 1981        public static string GetGraphicCard() => "In Editor Graphic Card";
 982#endif
 983
 984        public static void SendMessage(string type)
 985        {
 986            // sending an empty JSON object to be compatible with other messages
 3987            MessageFromEngine(type, "{}");
 3988        }
 989
 990        public static void SendMessage<T>(string type, T message)
 991        {
 1227992            string messageJson = JsonUtility.ToJson(message);
 1227993            SendJson(type, messageJson);
 1227994        }
 995
 996        public static void SendJson(string type, string json)
 997        {
 1227998            if (VERBOSE)
 999            {
 01000                Debug.Log($"Sending message: " + json);
 1001            }
 1002
 12271003            MessageFromEngine(type, json);
 12271004        }
 1005
 11006        private static ReportPositionPayload positionPayload = new ReportPositionPayload();
 11007        private static ReloadScenePayload reloadScenePayload = new ReloadScenePayload();
 11008        private static CameraModePayload cameraModePayload = new CameraModePayload();
 11009        private static Web3UseResponsePayload web3UseResponsePayload = new Web3UseResponsePayload();
 11010        private static IdleStateChangedPayload idleStateChangedPayload = new IdleStateChangedPayload();
 11011        private static OnMetricsUpdate onMetricsUpdate = new OnMetricsUpdate();
 11012        private static OnClickEvent onClickEvent = new OnClickEvent();
 11013        private static OnPointerDownEvent onPointerDownEvent = new OnPointerDownEvent();
 11014        private static OnPointerUpEvent onPointerUpEvent = new OnPointerUpEvent();
 11015        private static OnTextSubmitEvent onTextSubmitEvent = new OnTextSubmitEvent();
 11016        private static OnTextInputChangeEvent onTextInputChangeEvent = new OnTextInputChangeEvent();
 11017        private static OnTextInputChangeTextEvent onTextInputChangeTextEvent = new OnTextInputChangeTextEvent();
 11018        private static OnScrollChangeEvent onScrollChangeEvent = new OnScrollChangeEvent();
 11019        private static OnFocusEvent onFocusEvent = new OnFocusEvent();
 11020        private static OnBlurEvent onBlurEvent = new OnBlurEvent();
 11021        private static OnEnterEvent onEnterEvent = new OnEnterEvent();
 11022        private static OnSendScreenshot onSendScreenshot = new OnSendScreenshot();
 11023        private static OnPointerEventPayload onPointerEventPayload = new OnPointerEventPayload();
 11024        private static OnGlobalPointerEventPayload onGlobalPointerEventPayload = new OnGlobalPointerEventPayload();
 11025        private static OnGlobalPointerEvent onGlobalPointerEvent = new OnGlobalPointerEvent();
 11026        private static AudioStreamingPayload onAudioStreamingEvent = new AudioStreamingPayload();
 11027        private static AudioStreamingForEntityPayload onAudioStreamingEventForEntity = new AudioStreamingForEntityPayloa
 11028        private static AudioStreamingKillPayload onAudioStreamingKillEvent = new AudioStreamingKillPayload();
 11029        private static SetVoiceChatRecordingPayload setVoiceChatRecordingPayload = new SetVoiceChatRecordingPayload();
 11030        private static SetScenesLoadRadiusPayload setScenesLoadRadiusPayload = new SetScenesLoadRadiusPayload();
 11031        private static ApplySettingsPayload applySettingsPayload = new ApplySettingsPayload();
 11032        private static GIFSetupPayload gifSetupPayload = new GIFSetupPayload();
 11033        private static JumpInPayload jumpInPayload = new JumpInPayload();
 11034        private static GotoEvent gotoEvent = new GotoEvent();
 11035        private static SendChatMessageEvent sendChatMessageEvent = new SendChatMessageEvent();
 11036        private static BaseResolution baseResEvent = new BaseResolution();
 11037        private static AnalyticsPayload analyticsEvent = new AnalyticsPayload();
 11038        private static DelightedSurveyEnabledPayload delightedSurveyEnabled = new DelightedSurveyEnabledPayload();
 11039        private static ExternalActionSceneEventPayload sceneExternalActionEvent = new ExternalActionSceneEventPayload();
 11040        private static MuteUserPayload muteUserEvent = new MuteUserPayload();
 11041        private static StoreSceneStateEvent storeSceneState = new StoreSceneStateEvent();
 11042        private static CloseUserAvatarPayload closeUserAvatarPayload = new CloseUserAvatarPayload();
 11043        private static StringPayload stringPayload = new StringPayload();
 11044        private static KillPortableExperiencePayload killPortableExperiencePayload = new KillPortableExperiencePayload()
 11045        private static SetDisabledPortableExperiencesPayload setDisabledPortableExperiencesPayload = new SetDisabledPort
 11046        private static RequestWearablesPayload requestWearablesPayload = new RequestWearablesPayload();
 11047        private static RequestEmotesPayload requestEmotesPayload = new RequestEmotesPayload();
 11048        private static SearchENSOwnerPayload searchEnsOwnerPayload = new SearchENSOwnerPayload();
 11049        private static HeadersPayload headersPayload = new HeadersPayload();
 11050        private static AvatarStateBase avatarStatePayload = new AvatarStateBase();
 11051        private static AvatarStateSceneChanged avatarSceneChangedPayload = new AvatarStateSceneChanged();
 11052        public static AvatarOnClickPayload avatarOnClickPayload = new AvatarOnClickPayload();
 11053        private static UUIDEvent<EmptyPayload> onPointerHoverEnterEvent = new UUIDEvent<EmptyPayload>();
 11054        private static UUIDEvent<EmptyPayload> onPointerHoverExitEvent = new UUIDEvent<EmptyPayload>();
 11055        private static TimeReportPayload timeReportPayload = new TimeReportPayload();
 11056        private static GetFriendsWithDirectMessagesPayload getFriendsWithDirectMessagesPayload = new GetFriendsWithDirec
 11057        private static MarkMessagesAsSeenPayload markMessagesAsSeenPayload = new MarkMessagesAsSeenPayload();
 11058        private static MarkChannelMessagesAsSeenPayload markChannelMessagesAsSeenPayload = new MarkChannelMessagesAsSeen
 11059        private static GetPrivateMessagesPayload getPrivateMessagesPayload = new GetPrivateMessagesPayload();
 1060
 1061        public static void SendSceneEvent<T> (int sceneNumber, string eventType, T payload)
 1062        {
 4561063            SceneEvent<T> sceneEvent = new SceneEvent<T>();
 4561064            sceneEvent.sceneNumber = sceneNumber;
 4561065            sceneEvent.eventType = eventType;
 4561066            sceneEvent.payload = payload;
 1067
 4561068            SendMessage("SceneEvent", sceneEvent);
 4561069        }
 1070
 1071        private static void SendAllScenesEvent<T>(string eventType, T payload)
 1072        {
 3331073            AllScenesEvent<T> allScenesEvent = new AllScenesEvent<T>();
 3331074            allScenesEvent.eventType = eventType;
 3331075            allScenesEvent.payload = payload;
 1076
 3331077            SendMessage("AllScenesEvent", allScenesEvent);
 3331078        }
 1079
 1080        public static void ReportPosition(Vector3 position, Quaternion rotation, float playerHeight, Quaternion cameraRo
 1081        {
 771082            positionPayload.position = position;
 771083            positionPayload.rotation = rotation;
 771084            positionPayload.playerHeight = playerHeight;
 771085            positionPayload.cameraRotation = cameraRotation;
 1086
 771087            SendMessage("ReportPosition", positionPayload);
 771088        }
 1089
 1090        public static void ReloadScene(Vector2 coords)
 1091        {
 01092            reloadScenePayload.coords = coords;
 01093            SendMessage("ReloadScene", reloadScenePayload);
 01094        }
 1095
 6641096        public static void ReportCameraChanged(CameraMode.ModeId cameraMode) { ReportCameraChanged(cameraMode, -1); }
 1097
 1098        public static void ReportCameraChanged(CameraMode.ModeId cameraMode, int targetSceneNumber)
 1099        {
 5731100            cameraModePayload.cameraMode = cameraMode;
 5731101            if (targetSceneNumber > 0)
 1102            {
 2411103                SendSceneEvent(targetSceneNumber, "cameraModeChanged", cameraModePayload);
 1104            }
 1105            else
 1106            {
 3321107                SendAllScenesEvent("cameraModeChanged", cameraModePayload);
 1108            }
 3321109        }
 1110
 1111        public static void Web3UseResponse(string id, bool result)
 1112        {
 01113            web3UseResponsePayload.id = id;
 01114            web3UseResponsePayload.result = result;
 01115            SendMessage("Web3UseResponse", web3UseResponsePayload);
 01116        }
 1117
 1118        public static void ReportIdleStateChanged(bool isIdle)
 1119        {
 11120            idleStateChangedPayload.isIdle = isIdle;
 11121            SendAllScenesEvent("idleStateChanged", idleStateChangedPayload);
 11122        }
 1123
 4821124        public static void ReportControlEvent<T>(T controlEvent) where T : ControlEvent { SendMessage("ControlEvent", co
 1125
 1126        public static void SendRequestHeadersForUrl(string eventName, string method, string url, Dictionary<string, obje
 1127        {
 01128            headersPayload.method = method;
 01129            headersPayload.url = url;
 01130            if (metadata != null)
 01131                headersPayload.metadata = metadata;
 01132            SendMessage(eventName, headersPayload);
 01133        }
 1134
 01135        public static void BuilderInWorldMessage(string type, string message) { MessageFromEngine(type, message); }
 1136
 1137        public static void ReportOnClickEvent(int sceneNumber, string uuid)
 1138        {
 61139            if (string.IsNullOrEmpty(uuid))
 1140            {
 01141                return;
 1142            }
 1143
 61144            onClickEvent.uuid = uuid;
 1145
 61146            SendSceneEvent(sceneNumber, "uuidEvent", onClickEvent);
 61147        }
 1148
 1149        // TODO: Add sceneNumber to this response
 1150        private static void ReportRaycastResult<T, P>(int sceneNumber, string queryId, string queryType, P payload) wher
 1151        {
 01152            T response = new T();
 01153            response.queryId = queryId;
 01154            response.queryType = queryType;
 01155            response.payload = payload;
 1156
 01157            SendSceneEvent<T>(sceneNumber, "raycastResponse", response);
 01158        }
 1159
 01160        public static void ReportRaycastHitFirstResult(int sceneNumber, string queryId, RaycastType raycastType, Raycast
 1161
 01162        public static void ReportRaycastHitAllResult(int sceneNumber, string queryId, RaycastType raycastType, RaycastHi
 1163
 1164        private static OnPointerEventPayload.Hit CreateHitObject(string entityId, string meshName, Vector3 point,
 1165            Vector3 normal, float distance)
 1166        {
 191167            OnPointerEventPayload.Hit hit = new OnPointerEventPayload.Hit();
 1168
 191169            hit.hitPoint = point;
 191170            hit.length = distance;
 191171            hit.normal = normal;
 191172            hit.worldNormal = normal;
 191173            hit.meshName = meshName;
 191174            hit.entityId = entityId;
 1175
 191176            return hit;
 1177        }
 1178
 1179        private static void SetPointerEventPayload(OnPointerEventPayload pointerEventPayload, ACTION_BUTTON buttonId,
 1180            string entityId, string meshName, Ray ray, Vector3 point, Vector3 normal, float distance,
 1181            bool isHitInfoValid)
 1182        {
 201183            pointerEventPayload.origin = ray.origin;
 201184            pointerEventPayload.direction = ray.direction;
 201185            pointerEventPayload.buttonId = buttonId;
 1186
 201187            if (isHitInfoValid)
 191188                pointerEventPayload.hit = CreateHitObject(entityId, meshName, point, normal, distance);
 1189            else
 11190                pointerEventPayload.hit = null;
 11191        }
 1192
 1193
 1194        public static void ReportGlobalPointerEvent(OnGlobalPointerEventPayload.InputEventType pointerDirection, ACTION_
 1195            float distance, int sceneNumber, string entityId = "0", string meshName = null, bool isHitInfoValid = false)
 1196        {
 141197            SetPointerEventPayload(onGlobalPointerEventPayload, buttonId, entityId, meshName, ray, point, normal, distan
 141198            onGlobalPointerEventPayload.type = pointerDirection;
 1199
 141200            onGlobalPointerEvent.payload = onGlobalPointerEventPayload;
 1201
 141202            SendSceneEvent(sceneNumber, "actionButtonEvent", onGlobalPointerEvent);
 141203        }
 1204
 1205        public static void ReportOnPointerDownEvent(ACTION_BUTTON buttonId, int sceneNumber, string uuid,
 1206            string entityId, string meshName, Ray ray, Vector3 point, Vector3 normal, float distance)
 1207        {
 41208            if (string.IsNullOrEmpty(uuid))
 1209            {
 01210                return;
 1211            }
 1212
 41213            onPointerDownEvent.uuid = uuid;
 41214            SetPointerEventPayload(onPointerEventPayload, buttonId, entityId, meshName, ray, point,
 1215                normal, distance, isHitInfoValid: true);
 41216            onPointerDownEvent.payload = onPointerEventPayload;
 1217
 41218            SendSceneEvent(sceneNumber, "uuidEvent", onPointerDownEvent);
 41219        }
 1220
 1221        public static void ReportOnPointerUpEvent(ACTION_BUTTON buttonId, int sceneNumber, string uuid, string entityId,
 1222            string meshName, Ray ray, Vector3 point, Vector3 normal, float distance)
 1223        {
 21224            if (string.IsNullOrEmpty(uuid))
 1225            {
 01226                return;
 1227            }
 1228
 21229            onPointerUpEvent.uuid = uuid;
 21230            SetPointerEventPayload(onPointerEventPayload, buttonId, entityId, meshName, ray, point,
 1231                normal, distance, isHitInfoValid: true);
 21232            onPointerUpEvent.payload = onPointerEventPayload;
 1233
 21234            SendSceneEvent(sceneNumber, "uuidEvent", onPointerUpEvent);
 21235        }
 1236
 1237        public static void ReportOnTextSubmitEvent(int sceneNumber, string uuid, string text)
 1238        {
 21239            if (string.IsNullOrEmpty(uuid))
 1240            {
 01241                return;
 1242            }
 1243
 21244            onTextSubmitEvent.uuid = uuid;
 21245            onTextSubmitEvent.payload.text = text;
 1246
 21247            SendSceneEvent(sceneNumber, "uuidEvent", onTextSubmitEvent);
 21248        }
 1249
 1250        public static void ReportOnTextInputChangedEvent(int sceneNumber, string uuid, string text)
 1251        {
 171252            if (string.IsNullOrEmpty(uuid))
 1253            {
 171254                return;
 1255            }
 1256
 01257            onTextInputChangeEvent.uuid = uuid;
 01258            onTextInputChangeEvent.payload.value = text;
 1259
 01260            SendSceneEvent(sceneNumber, "uuidEvent", onTextInputChangeEvent);
 01261        }
 1262
 1263        public static void ReportOnTextInputChangedTextEvent(int sceneNumber, string uuid, string text, bool isSubmit)
 1264        {
 191265            if (string.IsNullOrEmpty(uuid))
 1266            {
 161267                return;
 1268            }
 1269
 31270            onTextInputChangeTextEvent.uuid = uuid;
 31271            onTextInputChangeTextEvent.payload.value.value = text;
 31272            onTextInputChangeTextEvent.payload.value.isSubmit = isSubmit;
 1273
 31274            SendSceneEvent(sceneNumber, "uuidEvent", onTextInputChangeTextEvent);
 31275        }
 1276
 1277        public static void ReportOnFocusEvent(int sceneNumber, string uuid)
 1278        {
 21279            if (string.IsNullOrEmpty(uuid))
 1280            {
 21281                return;
 1282            }
 1283
 01284            onFocusEvent.uuid = uuid;
 01285            SendSceneEvent(sceneNumber, "uuidEvent", onFocusEvent);
 01286        }
 1287
 1288        public static void ReportOnBlurEvent(int sceneNumber, string uuid)
 1289        {
 21290            if (string.IsNullOrEmpty(uuid))
 1291            {
 21292                return;
 1293            }
 1294
 01295            onBlurEvent.uuid = uuid;
 01296            SendSceneEvent(sceneNumber, "uuidEvent", onBlurEvent);
 01297        }
 1298
 1299        public static void ReportOnScrollChange(int sceneNumber, string uuid, Vector2 value, int pointerId)
 1300        {
 151301            if (string.IsNullOrEmpty(uuid))
 1302            {
 131303                return;
 1304            }
 1305
 21306            onScrollChangeEvent.uuid = uuid;
 21307            onScrollChangeEvent.payload.value = value;
 21308            onScrollChangeEvent.payload.pointerId = pointerId;
 1309
 21310            SendSceneEvent(sceneNumber, "uuidEvent", onScrollChangeEvent);
 21311        }
 1312
 01313        public static void ReportEvent<T>(int sceneNumber, T @event) { SendSceneEvent(sceneNumber, "uuidEvent", @event);
 1314
 1315        public static void ReportOnMetricsUpdate(int sceneNumber, MetricsModel current,
 1316            MetricsModel limit)
 1317        {
 1771318            onMetricsUpdate.given = current;
 1771319            onMetricsUpdate.limit = limit;
 1320
 1771321            SendSceneEvent(sceneNumber, "metricsUpdate", onMetricsUpdate);
 1771322        }
 1323
 1324        public static void ReportOnEnterEvent(int sceneNumber, string uuid)
 1325        {
 01326            if (string.IsNullOrEmpty(uuid))
 01327                return;
 1328
 01329            onEnterEvent.uuid = uuid;
 1330
 01331            SendSceneEvent(sceneNumber, "uuidEvent", onEnterEvent);
 01332        }
 1333
 01334        public static void LogOut() { SendMessage("LogOut"); }
 1335
 01336        public static void RedirectToSignUp() { SendMessage("RedirectToSignUp"); }
 1337
 01338        public static void PreloadFinished(int sceneNumber) { SendMessage("PreloadFinished", sceneNumber); }
 1339
 1340        public static void ReportMousePosition(Vector3 mousePosition, string id)
 1341        {
 01342            positionPayload.mousePosition = mousePosition;
 01343            positionPayload.id = id;
 01344            SendMessage("ReportMousePosition", positionPayload);
 01345        }
 1346
 1347        public static void SendScreenshot(string encodedTexture, string id)
 1348        {
 01349            onSendScreenshot.encodedTexture = encodedTexture;
 01350            onSendScreenshot.id = id;
 01351            SendMessage("SendScreenshot", onSendScreenshot);
 01352        }
 1353
 1354        public static void SetScenesLoadRadius(float newRadius)
 1355        {
 11356            setScenesLoadRadiusPayload.newRadius = newRadius;
 11357            SendMessage("SetScenesLoadRadius", setScenesLoadRadiusPayload);
 11358        }
 1359
 1360        [System.Serializable]
 1361        public class SaveAvatarPayload
 1362        {
 1363            public string face256;
 1364            public string body;
 1365            public bool isSignUpFlow;
 1366            public AvatarModelDTO avatar;
 1367        }
 1368
 1369        [System.Serializable]
 1370        public class SaveUserOutfitsPayload
 1371        {
 1372            public OutfitItem[] outfits;
 1373            public string[] namesForExtraSlots;
 1374        }
 1375
 1376        public static class RendererAuthenticationType
 1377        {
 01378            public static string Guest => "guest";
 01379            public static string WalletConnect => "wallet_connect";
 1380        }
 1381
 1382        [System.Serializable]
 1383        public class SendAuthenticationPayload
 1384        {
 1385            public string rendererAuthenticationType;
 1386        }
 1387
 1388        [System.Serializable]
 1389        public class SendPassportPayload
 1390        {
 1391            public string name;
 1392            public string email;
 1393        }
 1394
 1395        [System.Serializable]
 1396        public class SendSaveUserVerifiedNamePayload
 1397        {
 1398            public string newVerifiedName;
 1399        }
 1400
 1401        [System.Serializable]
 1402        public class SendSaveUserUnverifiedNamePayload
 1403        {
 1404            public string newUnverifiedName;
 1405        }
 1406
 1407        [System.Serializable]
 1408        public class SendSaveUserDescriptionPayload
 1409        {
 1410            public string description;
 1411
 01412            public SendSaveUserDescriptionPayload(string description) { this.description = description; }
 1413        }
 1414
 1415        [System.Serializable]
 1416        public class SendRequestUserProfilePayload
 1417        {
 1418            public string value;
 1419        }
 1420
 1421        [Serializable]
 1422        public class SendVideoProgressEvent
 1423        {
 1424            public string componentId;
 1425            public int sceneNumber;
 1426            public string videoTextureId;
 1427            public int status;
 1428            public float currentOffset;
 1429            public float videoLength;
 1430        }
 1431
 01432        public static void RequestOwnProfileUpdate() { SendMessage("RequestOwnProfileUpdate"); }
 1433
 1434        public static void SendSaveAvatar(AvatarModel avatar, Texture2D face256Snapshot, Texture2D bodySnapshot, bool is
 1435        {
 01436            var payload = new SaveAvatarPayload
 1437            {
 1438                avatar = AvatarModelDTO.FromAvatarModel(avatar),
 1439                face256 = System.Convert.ToBase64String(face256Snapshot.EncodeToPNG()),
 1440                body = System.Convert.ToBase64String(bodySnapshot.EncodeToPNG()),
 1441                isSignUpFlow = isSignUpFlow
 1442            };
 01443            SendMessage("SaveUserAvatar", payload);
 01444        }
 1445
 1446        public static void SaveUserOutfits(OutfitItem[] outfits)
 1447        {
 01448            var payload = new SaveUserOutfitsPayload()
 1449            {
 1450                outfits = outfits,
 1451                namesForExtraSlots = new string[]{}
 1452            };
 1453
 01454            SendMessage("SaveUserOutfits", payload);
 01455        }
 1456
 01457        public static void SendAuthentication(string rendererAuthenticationType) { SendMessage("SendAuthentication", new
 1458
 21459        public static void SendPassport(string name, string email) { SendMessage("SendPassport", new SendPassportPayload
 1460
 1461        public static void SendSaveUserVerifiedName(string newName)
 1462        {
 01463            var payload = new SendSaveUserVerifiedNamePayload()
 1464            {
 1465                newVerifiedName = newName
 1466            };
 1467
 01468            SendMessage("SaveUserVerifiedName", payload);
 01469        }
 1470
 1471        public static void SendSaveUserUnverifiedName(string newName)
 1472        {
 01473            var payload = new SendSaveUserUnverifiedNamePayload()
 1474            {
 1475                newUnverifiedName = newName
 1476            };
 1477
 01478            SendMessage("SaveUserUnverifiedName", payload);
 01479        }
 1480
 01481        public static void SendSaveUserDescription(string about) { SendMessage("SaveUserDescription", new SendSaveUserDe
 1482
 01483        public static void SendRequestUserProfile(string userId) { SendMessage("RequestUserProfile", new SendRequestUser
 1484
 01485        public static void SaveUserTutorialStep(int newTutorialStep) { SendMessage("SaveUserTutorialStep", new TutorialS
 1486
 01487        public static void SendPerformanceReport(string performanceReportPayload) { SendJson("PerformanceReport", perfor
 1488
 01489        public static void SendSystemInfoReport() { SendMessage("SystemInfoReport", new SystemInfoReportPayload()); }
 1490
 1491        public static void SendTermsOfServiceResponse(int sceneNumber, bool accepted, bool dontShowAgain)
 1492        {
 21493            var payload = new TermsOfServiceResponsePayload()
 1494            {
 1495                sceneNumber = sceneNumber,
 1496                accepted = accepted,
 1497                dontShowAgain = dontShowAgain
 1498            };
 21499            SendMessage("TermsOfServiceResponse", payload);
 21500        }
 1501
 1502        public static void OpenURL(string url)
 1503        {
 1504#if UNITY_WEBGL
 1505            SendMessage("OpenWebURL", new OpenURLPayload { url = url });
 1506#else
 01507            Application.OpenURL(url);
 1508#endif
 01509        }
 1510
 01511        public static void PublishStatefulScene(ProtocolV2.PublishPayload payload) { MessageFromEngine("PublishSceneStat
 1512
 1513        public static void SendReportScene(int sceneNumber)
 1514        {
 11515            SendMessage("ReportScene", new SendReportScenePayload
 1516            {
 1517                sceneNumber = sceneNumber
 1518            });
 11519        }
 1520
 1521        public static void SetHomeScene(string sceneCoords)
 1522        {
 01523            SendMessage("SetHomeScene", new SetHomeScenePayload
 1524            {
 1525                sceneCoords = sceneCoords
 1526            });
 01527        }
 1528
 1529        public static void SendReportPlayer(string playerId, string playerName)
 1530        {
 11531            SendMessage("ReportPlayer", new SendReportPlayerPayload
 1532            {
 1533                userId = playerId,
 1534                name = playerName
 1535            });
 11536        }
 1537
 1538        public static void SendBlockPlayer(string userId)
 1539        {
 11540            SendMessage("BlockPlayer", new SendBlockPlayerPayload()
 1541            {
 1542                userId = userId
 1543            });
 11544        }
 1545
 1546        public static void SendUnblockPlayer(string userId)
 1547        {
 01548            SendMessage("UnblockPlayer", new SendUnblockPlayerPayload()
 1549            {
 1550                userId = userId
 1551            });
 01552        }
 1553
 1554        public static void RequestScenesInfoAroundParcel(Vector2 parcel, int maxScenesArea)
 1555        {
 01556            SendMessage("RequestScenesInfoInArea", new RequestScenesInfoAroundParcelPayload()
 1557            {
 1558                parcel = parcel,
 1559                scenesAround = maxScenesArea
 1560            });
 01561        }
 1562
 1563        public static void SendAudioStreamEvent(string url, bool play, float volume)
 1564        {
 111565            onAudioStreamingEvent.url = url;
 111566            onAudioStreamingEvent.play = play;
 111567            onAudioStreamingEvent.volume = volume;
 111568            SendMessage("SetAudioStream", onAudioStreamingEvent);
 111569        }
 1570
 1571        public static void SendAudioStreamEventForEntity(string url, bool play, float volume, int sceneNumber, long enti
 1572        {
 31573            onAudioStreamingEventForEntity.url = url;
 31574            onAudioStreamingEventForEntity.play = play;
 31575            onAudioStreamingEventForEntity.volume = volume;
 31576            onAudioStreamingEventForEntity.sceneNumber = sceneNumber;
 31577            onAudioStreamingEventForEntity.entityId = entityId;
 31578            SendMessage("SetAudioStreamForEntity", onAudioStreamingEventForEntity);
 31579        }
 1580
 1581        public static void KillAudioStream(int sceneNumber, long entityId)
 1582        {
 71583            onAudioStreamingKillEvent.sceneNumber = sceneNumber;
 71584            onAudioStreamingKillEvent.entityId = entityId;
 71585            SendMessage("KillAudioStream", onAudioStreamingKillEvent);
 71586        }
 1587
 21588        public static void JoinVoiceChat() { SendMessage("JoinVoiceChat"); }
 1589
 21590        public static void LeaveVoiceChat() { SendMessage("LeaveVoiceChat"); }
 1591
 1592        public static void SendSetVoiceChatRecording(bool recording)
 1593        {
 01594            setVoiceChatRecordingPayload.recording = recording;
 01595            SendMessage("SetVoiceChatRecording", setVoiceChatRecordingPayload);
 01596        }
 1597
 01598        public static void ToggleVoiceChatRecording() { SendMessage("ToggleVoiceChatRecording"); }
 1599
 1600        public static void ApplySettings(float voiceChatVolume, int voiceChatAllowCategory)
 1601        {
 61602            applySettingsPayload.voiceChatVolume = voiceChatVolume;
 61603            applySettingsPayload.voiceChatAllowCategory = voiceChatAllowCategory;
 61604            SendMessage("ApplySettings", applySettingsPayload);
 61605        }
 1606
 1607        public static void RequestGIFProcessor(string gifURL, string gifId, bool isWebGL1)
 1608        {
 01609            gifSetupPayload.imageSource = gifURL;
 01610            gifSetupPayload.id = gifId;
 01611            gifSetupPayload.isWebGL1 = isWebGL1;
 1612
 01613            SendMessage("RequestGIFProcessor", gifSetupPayload);
 01614        }
 1615
 1616        public static void DeleteGIF(string id)
 1617        {
 01618            stringPayload.value = id;
 01619            SendMessage("DeleteGIF", stringPayload);
 01620        }
 1621
 1622        public static void GoTo(int x, int y)
 1623        {
 01624            gotoEvent.x = x;
 01625            gotoEvent.y = y;
 01626            SendMessage("GoTo", gotoEvent);
 01627        }
 1628
 1629        public static void GoToCrowd()
 1630        {
 01631            SendMessage("GoToCrowd");
 01632        }
 1633
 1634        public static void GoToMagic()
 1635        {
 01636            SendMessage("GoToMagic");
 01637        }
 1638
 1639        public static void LoadingHUDReadyForTeleport(int x, int y)
 1640        {
 01641            gotoEvent.x = x;
 01642            gotoEvent.y = y;
 01643            SendMessage("LoadingHUDReadyForTeleport", gotoEvent);
 01644        }
 1645
 1646        public static void JumpIn(int x, int y, string serverName, string layerName)
 1647        {
 01648            jumpInPayload.realm.serverName = serverName;
 01649            jumpInPayload.realm.layer = layerName;
 1650
 01651            jumpInPayload.gridPosition.x = x;
 01652            jumpInPayload.gridPosition.y = y;
 1653
 01654            SendMessage("JumpIn", jumpInPayload);
 01655        }
 1656
 1657        public static void JumpInHome(string mostPopulatedRealm)
 1658        {
 01659            jumpInPayload.realm.serverName = mostPopulatedRealm;
 01660            SendMessage("JumpInHome", jumpInPayload);
 01661        }
 1662
 1663        public static void SendChatMessage(ChatMessage message)
 1664        {
 01665            sendChatMessageEvent.message = message;
 01666            SendMessage("SendChatMessage", sendChatMessageEvent);
 01667        }
 1668
 01669        public static void UpdateFriendshipStatus(FriendshipUpdateStatusMessage message) { SendMessage("UpdateFriendship
 1670
 01671        public static void ScenesLoadingFeedback(LoadingFeedbackMessage message) { SendMessage("ScenesLoadingFeedback", 
 1672
 01673        public static void FetchHotScenes() { SendMessage("FetchHotScenes"); }
 1674
 1675        public static void SetBaseResolution(int resolution)
 1676        {
 21677            baseResEvent.baseResolution = resolution;
 21678            SendMessage("SetBaseResolution", baseResEvent);
 21679        }
 1680
 01681        public static void ReportAnalyticsEvent(string eventName) { ReportAnalyticsEvent(eventName, null); }
 1682
 1683        public static void ReportAnalyticsEvent(string eventName, AnalyticsPayload.Property[] eventProperties)
 1684        {
 01685            analyticsEvent.name = eventName;
 01686            analyticsEvent.properties = eventProperties;
 01687            SendMessage("Track", analyticsEvent);
 01688        }
 1689
 21690        public static void FetchBalanceOfMANA() { SendMessage("FetchBalanceOfMANA"); }
 1691
 1692        public static void SendSceneExternalActionEvent(int sceneNumber, string type, string payload)
 1693        {
 01694            sceneExternalActionEvent.type = type;
 01695            sceneExternalActionEvent.payload = payload;
 01696            SendSceneEvent(sceneNumber, "externalAction", sceneExternalActionEvent);
 01697        }
 1698
 1699        public static void SetMuteUsers(string[] usersId, bool mute)
 1700        {
 41701            muteUserEvent.usersId = usersId;
 41702            muteUserEvent.mute = mute;
 41703            SendMessage("SetMuteUsers", muteUserEvent);
 41704        }
 1705
 1706        public static void SendCloseUserAvatar(bool isSignUpFlow)
 1707        {
 01708            closeUserAvatarPayload.isSignUpFlow = isSignUpFlow;
 01709            SendMessage("CloseUserAvatar", closeUserAvatarPayload);
 01710        }
 1711
 1712        // Warning: Use this method only for PEXs non-associated to smart wearables.
 1713        //          For PEX associated to smart wearables use 'SetDisabledPortableExperiences'.
 1714        public static void KillPortableExperience(string portableExperienceId)
 1715        {
 01716            killPortableExperiencePayload.portableExperienceId = portableExperienceId;
 01717            SendMessage("KillPortableExperience", killPortableExperiencePayload);
 01718        }
 1719
 1720        public static void RequestThirdPartyWearables(
 1721            string ownedByUser,
 1722            string thirdPartyCollectionId,
 1723            string context)
 1724        {
 21725            requestWearablesPayload.filters = new WearablesRequestFiltersPayload
 1726            {
 1727                ownedByUser = ownedByUser,
 1728                thirdPartyId = thirdPartyCollectionId,
 1729                collectionIds = null,
 1730                wearableIds = null
 1731            };
 1732
 21733            requestWearablesPayload.context = context;
 1734
 21735            SendMessage("RequestWearables", requestWearablesPayload);
 21736        }
 1737
 1738        public static void SetDisabledPortableExperiences(string[] idsToDisable)
 1739        {
 01740            setDisabledPortableExperiencesPayload.idsToDisable = idsToDisable;
 01741            SendMessage("SetDisabledPortableExperiences", setDisabledPortableExperiencesPayload);
 01742        }
 1743
 1744        public static void RequestWearables(
 1745            string ownedByUser,
 1746            string[] wearableIds,
 1747            string[] collectionIds,
 1748            string context)
 1749        {
 61750            requestWearablesPayload.filters = new WearablesRequestFiltersPayload
 1751            {
 1752                ownedByUser = ownedByUser,
 1753                wearableIds = wearableIds,
 1754                collectionIds = collectionIds,
 1755                thirdPartyId = null
 1756            };
 1757
 61758            requestWearablesPayload.context = context;
 1759
 61760            SendMessage("RequestWearables", requestWearablesPayload);
 61761        }
 1762
 1763        public static void RequestEmotes(
 1764            string ownedByUser,
 1765            string[] emoteIds,
 1766            string[] collectionIds,
 1767            string context)
 1768        {
 01769            requestEmotesPayload.filters = new EmotesRequestFiltersPayload()
 1770            {
 1771                ownedByUser = ownedByUser,
 1772                emoteIds = emoteIds,
 1773                collectionIds = collectionIds,
 1774                thirdPartyId = null
 1775            };
 1776
 01777            requestEmotesPayload.context = context;
 1778
 01779            SendMessage("RequestEmotes", requestEmotesPayload);
 01780        }
 1781
 1782        public static void SearchENSOwner(string name, int maxResults)
 1783        {
 41784            searchEnsOwnerPayload.name = name;
 41785            searchEnsOwnerPayload.maxResults = maxResults;
 1786
 41787            SendMessage("SearchENSOwner", searchEnsOwnerPayload);
 41788        }
 1789
 01790        public static void RequestHomeCoordinates() { SendMessage("RequestHomeCoordinates"); }
 1791
 1792        public static void RequestUserProfile(string userId)
 1793        {
 01794            stringPayload.value = userId;
 01795            SendMessage("RequestUserProfile", stringPayload);
 01796        }
 1797
 1798        public static void ReportAvatarFatalError(string payload)
 1799        {
 01800            ErrorPayload errorPayload = new ErrorPayload() { error = payload };
 01801            SendMessage("ReportAvatarFatalError", errorPayload);
 01802        }
 1803
 1804        public static void UnpublishScene(Vector2Int sceneCoordinates)
 1805        {
 01806            var payload = new UnpublishScenePayload() { coordinates = $"{sceneCoordinates.x},{sceneCoordinates.y}" };
 01807            SendMessage("UnpublishScene", payload);
 01808        }
 1809
 1810        public static void NotifyStatusThroughChat(string message)
 1811        {
 01812            stringPayload.value = message;
 01813            SendMessage("NotifyStatusThroughChat", stringPayload);
 01814        }
 1815
 1816        public static void ReportVideoProgressEvent(
 1817            string componentId,
 1818            int sceneNumber,
 1819            string videoClipId,
 1820            int videoStatus,
 1821            float currentOffset,
 1822            float length)
 1823        {
 541824            SendVideoProgressEvent progressEvent = new SendVideoProgressEvent()
 1825            {
 1826                componentId = componentId,
 1827                sceneNumber = sceneNumber,
 1828                videoTextureId = videoClipId,
 1829                status = videoStatus,
 1830                currentOffset = currentOffset,
 1831                videoLength = float.IsInfinity(length) ? float.MaxValue : length
 1832            };
 1833
 541834            SendMessage("VideoProgressEvent", progressEvent);
 541835        }
 1836
 1837        public static void ReportAvatarRemoved(string avatarId)
 1838        {
 01839            avatarStatePayload.type = "Removed";
 01840            avatarStatePayload.avatarShapeId = avatarId;
 01841            SendMessage("ReportAvatarState", avatarStatePayload);
 01842        }
 1843
 1844        public static void ReportAvatarSceneChanged(string avatarId, int sceneNumber)
 1845        {
 01846            avatarSceneChangedPayload.type = "SceneChanged";
 01847            avatarSceneChangedPayload.avatarShapeId = avatarId;
 01848            avatarSceneChangedPayload.sceneNumber = sceneNumber;
 01849            SendMessage("ReportAvatarState", avatarSceneChangedPayload);
 01850        }
 1851
 1852        public static void ReportAvatarClick(int sceneNumber, string userId, Vector3 rayOrigin, Vector3 rayDirection, fl
 1853        {
 01854            avatarOnClickPayload.userId = userId;
 01855            avatarOnClickPayload.ray.origin = rayOrigin;
 01856            avatarOnClickPayload.ray.direction = rayDirection;
 01857            avatarOnClickPayload.ray.distance = distance;
 1858
 01859            SendSceneEvent(sceneNumber, "playerClicked", avatarOnClickPayload);
 01860        }
 1861
 1862        public static void ReportOnPointerHoverEnterEvent(int sceneNumber, string uuid)
 1863        {
 41864            onPointerHoverEnterEvent.uuid = uuid;
 41865            SendSceneEvent(sceneNumber, "uuidEvent", onPointerHoverEnterEvent);
 41866        }
 1867
 1868        public static void ReportOnPointerHoverExitEvent(int sceneNumber, string uuid)
 1869        {
 11870            onPointerHoverExitEvent.uuid = uuid;
 11871            SendSceneEvent(sceneNumber, "uuidEvent", onPointerHoverExitEvent);
 11872        }
 1873
 1874        public static void ReportTime(float time, bool isPaused, float timeNormalizationFactor, float cycleTime)
 1875        {
 61876            timeReportPayload.time = time;
 61877            timeReportPayload.isPaused = isPaused;
 61878            timeReportPayload.timeNormalizationFactor = timeNormalizationFactor;
 61879            timeReportPayload.cycleTime = cycleTime;
 61880            SendMessage("ReportDecentralandTime", timeReportPayload);
 61881        }
 1882
 1883        public static void GetFriendsWithDirectMessages(string userNameOrId, int limit, int skip)
 1884        {
 01885            getFriendsWithDirectMessagesPayload.userNameOrId = userNameOrId;
 01886            getFriendsWithDirectMessagesPayload.limit = limit;
 01887            getFriendsWithDirectMessagesPayload.skip = skip;
 01888            SendMessage("GetFriendsWithDirectMessages", getFriendsWithDirectMessagesPayload);
 01889        }
 1890
 1891        public static void MarkMessagesAsSeen(string userId)
 1892        {
 11893            markMessagesAsSeenPayload.userId = userId;
 11894            SendMessage("MarkMessagesAsSeen", markMessagesAsSeenPayload);
 11895        }
 1896
 1897        public static void GetPrivateMessages(string userId, int limit, string fromMessageId)
 1898        {
 01899            getPrivateMessagesPayload.userId = userId;
 01900            getPrivateMessagesPayload.limit = limit;
 01901            getPrivateMessagesPayload.fromMessageId = fromMessageId;
 01902            SendMessage("GetPrivateMessages", getPrivateMessagesPayload);
 01903        }
 1904
 1905        public static void MarkChannelMessagesAsSeen(string channelId)
 1906        {
 41907            markChannelMessagesAsSeenPayload.channelId = channelId;
 41908            SendMessage("MarkChannelMessagesAsSeen", markChannelMessagesAsSeenPayload);
 41909        }
 1910
 01911        public static void GetUnseenMessagesByUser() { SendMessage("GetUnseenMessagesByUser"); }
 1912
 1913        public static void GetUnseenMessagesByChannel()
 1914        {
 01915            SendMessage("GetUnseenMessagesByChannel");
 01916        }
 1917
 1918        public static void GetFriends(int limit, int skip)
 1919        {
 01920            SendMessage("GetFriends", new GetFriendsPayload
 1921            {
 1922                limit = limit,
 1923                skip = skip
 1924            });
 01925        }
 1926
 1927        public static void GetFriends(string usernameOrId, int limit)
 1928        {
 01929            SendMessage("GetFriends", new GetFriendsPayload
 1930            {
 1931                userNameOrId = usernameOrId,
 1932                limit = limit
 1933            });
 01934        }
 1935
 1936        public static void LeaveChannel(string channelId)
 1937        {
 01938            SendMessage("LeaveChannel", new LeaveChannelPayload
 1939            {
 1940                channelId = channelId
 1941            });
 01942        }
 1943
 1944        public static void CreateChannel(string channelId)
 1945        {
 01946            SendMessage("CreateChannel", new CreateChannelPayload
 1947            {
 1948                channelId = channelId
 1949            });
 01950        }
 1951
 1952        public static void JoinOrCreateChannel(string channelId)
 1953        {
 01954            SendMessage("JoinOrCreateChannel", new JoinOrCreateChannelPayload
 1955            {
 1956                channelId = channelId
 1957            });
 01958        }
 1959
 1960        public static void GetChannelMessages(string channelId, int limit, string fromMessageId)
 1961        {
 01962            SendMessage("GetChannelMessages", new GetChannelMessagesPayload
 1963            {
 1964                channelId = channelId,
 1965                limit = limit,
 1966                from = fromMessageId
 1967            });
 01968        }
 1969
 1970        public static void GetJoinedChannels(int limit, int skip)
 1971        {
 01972            SendMessage("GetJoinedChannels", new GetJoinedChannelsPayload
 1973            {
 1974                limit = limit,
 1975                skip = skip
 1976            });
 01977        }
 1978
 1979        public static void GetChannels(int limit, string since, string name)
 1980        {
 11981            SendMessage("GetChannels", new GetChannelsPayload
 1982            {
 1983                limit = limit,
 1984                since = since,
 1985                name = name
 1986            });
 11987        }
 1988
 1989        public static void GetChannelInfo(string[] channelIds)
 1990        {
 11991            SendMessage("GetChannelInfo", new GetChannelInfoPayload
 1992            {
 1993                channelIds = channelIds
 1994            });
 11995        }
 1996
 1997        public static void GetChannelMembers(string channelId, int limit, int skip, string name)
 1998        {
 11999            SendMessage("GetChannelMembers", new GetChannelMembersPayload
 2000            {
 2001                channelId = channelId,
 2002                limit = limit,
 2003                skip = skip,
 2004                userName = name
 2005            });
 12006        }
 2007
 2008        public static void MuteChannel(string channelId, bool muted)
 2009        {
 02010            SendMessage("MuteChannel", new MuteChannelPayload
 2011            {
 2012                channelId = channelId,
 2013                muted = muted
 2014            });
 02015        }
 2016
 2017        public static void UpdateMemoryUsage()
 2018        {
 02019            SendMessage("UpdateMemoryUsage");
 02020        }
 2021
 02022        public static void RequestAudioDevices() => SendMessage("RequestAudioDevices");
 2023
 2024        public static void SetInputAudioDevice(string inputDeviceId)
 2025        {
 02026            SendMessage(nameof(SetInputAudioDevice), new SetInputAudioDevicePayload()
 2027            {
 2028                deviceId = inputDeviceId
 2029            });
 02030        }
 2031
 2032
 2033        // After A/B test seamless login this should be removed and implement a proper renderer<>browser-interface servi
 2034        public static void SendToSPopupAccepted()
 2035        {
 02036            SendMessage("ToSPopupAccepted");
 02037        }
 2038
 2039        public static void SendToSPopupRejected()
 2040        {
 02041            SendMessage("ToSPopupRejected");
 02042        }
 2043
 2044        public static void SendGoToTos()
 2045        {
 02046            SendMessage("ToSPopupGoToToS");
 02047        }
 2048
 2049        public static void SaveProfileLinks(SaveLinksPayload payload)
 2050        {
 02051            SendMessage("SaveProfileLinks", payload);
 02052        }
 2053
 2054        public static void SaveAdditionalInfo(SaveAdditionalInfoPayload payload)
 2055        {
 02056            SendMessage("SaveProfileAdditionalInfo", payload);
 02057        }
 2058
 2059        public static void GetWithCollectionsUrlParam()
 2060        {
 02061            SendMessage("GetWithCollectionsUrlParam");
 02062        }
 2063
 2064        public static void GetWithItemsUrlParam()
 2065        {
 02066            SendMessage("GetWithItemsUrlParam");
 02067        }
 2068
 2069        public static void FetchRealmsInfo()
 2070        {
 02071            SendMessage("FetchRealmsInfo");
 02072        }
 2073    }
 2074}

Methods/Properties

WebInterface()
SceneReady(System.Int32)
ActivateRenderingACK()
DeactivateRenderingACK()
ConcreteActionButtons()
OnGlobalPointerEvent()
StoreSceneStateEvent()
OnTextInputChangeTextEventPayload()
operator+(DCL.Interface.WebInterface/MetricsModel, DCL.Interface.WebInterface/MetricsModel)
OnMetricsUpdate()
TransformPayload()
SystemInfoReportPayload()
JumpInPayload()
Property(System.String, System.String)
HeadersPayload()
AvatarOnClickPayload()
OnMessageFromEngine(System.Action[String,String])
OnMessageFromEngine()
StartDecentraland()
CheckURLParam(System.String)
GetURLParam(System.String)
MessageFromEngine(System.String, System.String)
ProcessQueuedMessages()
GetGraphicCard()
SendMessage(System.String)
SendMessage[T](System.String, T)
SendJson(System.String, System.String)
SendSceneEvent[T](System.Int32, System.String, T)
SendAllScenesEvent[T](System.String, T)
ReportPosition(UnityEngine.Vector3, UnityEngine.Quaternion, System.Single, UnityEngine.Quaternion)
ReloadScene(UnityEngine.Vector2)
ReportCameraChanged(DCL.CameraTool.CameraMode/ModeId)
ReportCameraChanged(DCL.CameraTool.CameraMode/ModeId, System.Int32)
Web3UseResponse(System.String, System.Boolean)
ReportIdleStateChanged(System.Boolean)
ReportControlEvent[T](T)
SendRequestHeadersForUrl(System.String, System.String, System.String, System.Collections.Generic.Dictionary[String,Object])
BuilderInWorldMessage(System.String, System.String)
ReportOnClickEvent(System.Int32, System.String)
ReportRaycastResult[T, P](System.Int32, System.String, System.String, P)
ReportRaycastHitFirstResult(System.Int32, System.String, DCL.Models.RaycastType, DCL.Interface.WebInterface/RaycastHitEntity)
ReportRaycastHitAllResult(System.Int32, System.String, DCL.Models.RaycastType, DCL.Interface.WebInterface/RaycastHitEntities)
CreateHitObject(System.String, System.String, UnityEngine.Vector3, UnityEngine.Vector3, System.Single)
SetPointerEventPayload(DCL.Interface.WebInterface/OnPointerEventPayload, DCL.Interface.WebInterface/ACTION_BUTTON, System.String, System.String, UnityEngine.Ray, UnityEngine.Vector3, UnityEngine.Vector3, System.Single, System.Boolean)
ReportGlobalPointerEvent(DCL.Interface.WebInterface/OnGlobalPointerEventPayload/InputEventType, DCL.Interface.WebInterface/ACTION_BUTTON, UnityEngine.Ray, UnityEngine.Vector3, UnityEngine.Vector3, System.Single, System.Int32, System.String, System.String, System.Boolean)
ReportOnPointerDownEvent(DCL.Interface.WebInterface/ACTION_BUTTON, System.Int32, System.String, System.String, System.String, UnityEngine.Ray, UnityEngine.Vector3, UnityEngine.Vector3, System.Single)
ReportOnPointerUpEvent(DCL.Interface.WebInterface/ACTION_BUTTON, System.Int32, System.String, System.String, System.String, UnityEngine.Ray, UnityEngine.Vector3, UnityEngine.Vector3, System.Single)
ReportOnTextSubmitEvent(System.Int32, System.String, System.String)
ReportOnTextInputChangedEvent(System.Int32, System.String, System.String)
ReportOnTextInputChangedTextEvent(System.Int32, System.String, System.String, System.Boolean)
ReportOnFocusEvent(System.Int32, System.String)
ReportOnBlurEvent(System.Int32, System.String)
ReportOnScrollChange(System.Int32, System.String, UnityEngine.Vector2, System.Int32)
ReportEvent[T](System.Int32, T)
ReportOnMetricsUpdate(System.Int32, DCL.Interface.WebInterface/MetricsModel, DCL.Interface.WebInterface/MetricsModel)
ReportOnEnterEvent(System.Int32, System.String)
LogOut()
RedirectToSignUp()
PreloadFinished(System.Int32)
ReportMousePosition(UnityEngine.Vector3, System.String)
SendScreenshot(System.String, System.String)
SetScenesLoadRadius(System.Single)
Guest()
WalletConnect()
SendSaveUserDescriptionPayload(System.String)
RequestOwnProfileUpdate()
SendSaveAvatar(AvatarModel, UnityEngine.Texture2D, UnityEngine.Texture2D, System.Boolean)
SaveUserOutfits(DCL.Backpack.OutfitItem[])
SendAuthentication(System.String)
SendPassport(System.String, System.String)
SendSaveUserVerifiedName(System.String)
SendSaveUserUnverifiedName(System.String)
SendSaveUserDescription(System.String)
SendRequestUserProfile(System.String)
SaveUserTutorialStep(System.Int32)
SendPerformanceReport(System.String)
SendSystemInfoReport()
SendTermsOfServiceResponse(System.Int32, System.Boolean, System.Boolean)
OpenURL(System.String)
PublishStatefulScene(ProtocolV2/PublishPayload)
SendReportScene(System.Int32)
SetHomeScene(System.String)
SendReportPlayer(System.String, System.String)
SendBlockPlayer(System.String)
SendUnblockPlayer(System.String)
RequestScenesInfoAroundParcel(UnityEngine.Vector2, System.Int32)
SendAudioStreamEvent(System.String, System.Boolean, System.Single)
SendAudioStreamEventForEntity(System.String, System.Boolean, System.Single, System.Int32, System.Int64)
KillAudioStream(System.Int32, System.Int64)
JoinVoiceChat()
LeaveVoiceChat()
SendSetVoiceChatRecording(System.Boolean)
ToggleVoiceChatRecording()
ApplySettings(System.Single, System.Int32)
RequestGIFProcessor(System.String, System.String, System.Boolean)
DeleteGIF(System.String)
GoTo(System.Int32, System.Int32)
GoToCrowd()
GoToMagic()
LoadingHUDReadyForTeleport(System.Int32, System.Int32)
JumpIn(System.Int32, System.Int32, System.String, System.String)
JumpInHome(System.String)
SendChatMessage(DCL.Interface.ChatMessage)
UpdateFriendshipStatus(DCL.Interface.WebInterface/FriendshipUpdateStatusMessage)
ScenesLoadingFeedback(DCL.Interface.WebInterface/LoadingFeedbackMessage)
FetchHotScenes()
SetBaseResolution(System.Int32)
ReportAnalyticsEvent(System.String)
ReportAnalyticsEvent(System.String, DCL.Interface.WebInterface/AnalyticsPayload/Property[])
FetchBalanceOfMANA()
SendSceneExternalActionEvent(System.Int32, System.String, System.String)
SetMuteUsers(System.String[], System.Boolean)
SendCloseUserAvatar(System.Boolean)
KillPortableExperience(System.String)
RequestThirdPartyWearables(System.String, System.String, System.String)
SetDisabledPortableExperiences(System.String[])
RequestWearables(System.String, System.String[], System.String[], System.String)
RequestEmotes(System.String, System.String[], System.String[], System.String)
SearchENSOwner(System.String, System.Int32)
RequestHomeCoordinates()
RequestUserProfile(System.String)
ReportAvatarFatalError(System.String)
UnpublishScene(UnityEngine.Vector2Int)
NotifyStatusThroughChat(System.String)
ReportVideoProgressEvent(System.String, System.Int32, System.String, System.Int32, System.Single, System.Single)
ReportAvatarRemoved(System.String)
ReportAvatarSceneChanged(System.String, System.Int32)
ReportAvatarClick(System.Int32, System.String, UnityEngine.Vector3, UnityEngine.Vector3, System.Single)
ReportOnPointerHoverEnterEvent(System.Int32, System.String)
ReportOnPointerHoverExitEvent(System.Int32, System.String)
ReportTime(System.Single, System.Boolean, System.Single, System.Single)
GetFriendsWithDirectMessages(System.String, System.Int32, System.Int32)
MarkMessagesAsSeen(System.String)
GetPrivateMessages(System.String, System.Int32, System.String)
MarkChannelMessagesAsSeen(System.String)
GetUnseenMessagesByUser()
GetUnseenMessagesByChannel()
GetFriends(System.Int32, System.Int32)
GetFriends(System.String, System.Int32)
LeaveChannel(System.String)
CreateChannel(System.String)
JoinOrCreateChannel(System.String)
GetChannelMessages(System.String, System.Int32, System.String)
GetJoinedChannels(System.Int32, System.Int32)
GetChannels(System.Int32, System.String, System.String)
GetChannelInfo(System.String[])
GetChannelMembers(System.String, System.Int32, System.Int32, System.String)
MuteChannel(System.String, System.Boolean)
UpdateMemoryUsage()
RequestAudioDevices()
SetInputAudioDevice(System.String)
SendToSPopupAccepted()
SendToSPopupRejected()
SendGoToTos()
SaveProfileLinks(DCL.Interface.WebInterface/SaveLinksPayload)
SaveAdditionalInfo(DCL.Interface.WebInterface/SaveAdditionalInfoPayload)
GetWithCollectionsUrlParam()
GetWithItemsUrlParam()
FetchRealmsInfo()