< Summary

Class:DCL.Interface.WebInterface
Assembly:WebInterface
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/WebInterface/Interface.cs
Covered lines:261
Uncovered lines:228
Coverable lines:489
Total lines:1954
Line coverage:53.3% (261 of 489)
Covered branches:0
Total branches:0

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%
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%
ReportGlobalPointerDownEvent(...)0%110100%
ReportGlobalPointerUpEvent(...)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%
SetDelightedSurveyEnabled(...)0%2100%
SetScenesLoadRadius(...)0%110100%
SendSaveUserDescriptionPayload(...)0%2100%
RequestOwnProfileUpdate()0%110100%
SendSaveAvatar(...)0%110100%
SendAuthentication(...)0%2100%
SendPassport(...)0%110100%
SendSaveUserUnverifiedName(...)0%2100%
SendSaveUserDescription(...)0%2100%
SendRequestUserProfile(...)0%2100%
SendUserAcceptedCollectibles(...)0%110100%
SaveUserTutorialStep(...)0%2100%
SendPerformanceReport(...)0%2100%
SendSystemInfoReport()0%2100%
SendTermsOfServiceResponse(...)0%110100%
OpenURL(...)0%110100%
PublishStatefulScene(...)0%2100%
StartIsolatedMode(...)0%2100%
StopIsolatedMode(...)0%2100%
SendReportScene(...)0%110100%
SetHomeScene(...)0%2100%
SendReportPlayer(...)0%110100%
SendBlockPlayer(...)0%110100%
SendUnblockPlayer(...)0%2100%
RequestScenesInfoAroundParcel(...)0%110100%
SendAudioStreamEvent(...)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%110100%
RequestWearables(...)0%2100%
RequestEmotes(...)0%2100%
SearchENSOwner(...)0%110100%
RequestHomeCoordinates()0%2100%
RequestUserProfile(...)0%110100%
ReportAvatarFatalError(...)0%2100%
UnpublishScene(...)0%2100%
NotifyStatusThroughChat(...)0%2100%
ReportVideoProgressEvent(...)0%110100%
ReportAvatarRemoved(...)0%2100%
ReportAvatarSceneChanged(...)0%2100%
ReportAvatarClick(...)0%2100%
ReportOnPointerHoverEnterEvent(...)0%110100%
ReportOnPointerHoverExitEvent(...)0%110100%
ReportTime(...)0%110100%
GetFriendsWithDirectMessages(...)0%2100%
MarkMessagesAsSeen(...)0%2100%
GetPrivateMessages(...)0%2100%
MarkChannelMessagesAsSeen(...)0%2100%
GetUnseenMessagesByUser()0%2100%
GetUnseenMessagesByChannel()0%2100%
GetFriends(...)0%2100%
GetFriends(...)0%2100%
GetFriendRequests(...)0%2100%
LeaveChannel(...)0%2100%
CreateChannel(...)0%2100%
JoinOrCreateChannel(...)0%2100%
GetChannelMessages(...)0%2100%
GetJoinedChannels(...)0%2100%
GetChannels(...)0%2100%
GetChannelInfo(...)0%2100%
GetChannelMembers(...)0%2100%
MuteChannel(...)0%2100%
UpdateMemoryUsage()0%2100%
RequestAudioDevices()0%2100%
SetInputAudioDevice(...)0%2100%

File(s)

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

#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3using DCL.CameraTool;
 4using DCL.Models;
 5using Newtonsoft.Json;
 6using UnityEngine;
 7using UnityEngine.Serialization;
 8using Ray = UnityEngine.Ray;
 9
 10#if UNITY_WEBGL && !UNITY_EDITOR
 11using System.Runtime.InteropServices;
 12#endif
 13
 14namespace DCL.Interface
 15{
 16    /**
 17     * This class contains the outgoing interface of Decentraland.
 18     * You must call those functions to interact with the WebInterface.
 19     *
 20     * The messages comming from the WebInterface instead, are reported directly to
 21     * the handler GameObject by name.
 22     */
 23    public static class WebInterface
 24    {
 125        public static bool VERBOSE = false;
 26
 27        [System.Serializable]
 28        public class ReportPositionPayload
 29        {
 30            /** Camera position, world space */
 31            public Vector3 position;
 32
 33            /** Character rotation */
 34            public Quaternion rotation;
 35
 36            /** Camera rotation */
 37            public Quaternion cameraRotation;
 38
 39            /** Camera height, relative to the feet of the avatar or ground */
 40            public float playerHeight;
 41
 42            public Vector3 mousePosition;
 43
 44            public string id;
 45        }
 46
 47        [System.Serializable]
 48        public abstract class ControlEvent
 49        {
 50            public string eventType;
 51        }
 52
 53        public abstract class ControlEvent<T> : ControlEvent
 54        {
 55            public T payload;
 56
 57            protected ControlEvent(string eventType, T payload)
 58            {
 59                this.eventType = eventType;
 60                this.payload = payload;
 61            }
 62        }
 63
 64        [System.Serializable]
 65        public class SceneReady : ControlEvent<SceneReady.Payload>
 66        {
 67
 59468            public SceneReady(int sceneNumber) : base("SceneReady", new Payload() { sceneNumber = sceneNumber }) { }
 69
 70            [System.Serializable]
 71            public class Payload
 72            {
 73                public int sceneNumber;
 74            }
 75        }
 76
 77        [System.Serializable]
 78        public class ActivateRenderingACK : ControlEvent<object>
 79        {
 080            public ActivateRenderingACK() : base("ActivateRenderingACK", null) { }
 81        }
 82
 83        [System.Serializable]
 84        public class DeactivateRenderingACK : ControlEvent<object>
 85        {
 086            public DeactivateRenderingACK() : base("DeactivateRenderingACK", null) { }
 87        }
 88
 89        [System.Serializable]
 90        public class SceneEvent<T>
 91        {
 92            public int sceneNumber;
 93            public string eventType;
 94            public T payload;
 95        }
 96
 97        [System.Serializable]
 98        public class AllScenesEvent<T>
 99        {
 100            public string eventType;
 101            public T payload;
 102        }
 103
 104        [System.Serializable]
 105        public class UUIDEvent<TPayload>
 106            where TPayload : class, new()
 107        {
 108            public string uuid;
 109            public TPayload payload = new TPayload();
 110        }
 111
 112        public enum ACTION_BUTTON
 113        {
 114            POINTER = 0,
 115            PRIMARY = 1,
 116            SECONDARY = 2,
 117            ANY = 3,
 118            FORWARD = 4,
 119            BACKWARD = 5,
 120            RIGHT = 6,
 121            LEFT = 7,
 122            JUMP = 8,
 123            WALK = 9,
 124            ACTION_3 = 10,
 125            ACTION_4 = 11,
 126            ACTION_5 = 12,
 127            ACTION_6 = 13
 128        }
 129
 130        [System.Serializable]
 131        public class OnClickEvent : UUIDEvent<OnClickEventPayload> { };
 132
 133        [System.Serializable]
 134        public class CameraModePayload
 135        {
 136            public CameraMode.ModeId cameraMode;
 137        };
 138
 139        [System.Serializable]
 140        public class Web3UseResponsePayload
 141        {
 142            public string id;
 143            public bool result;
 144        };
 145
 146        [System.Serializable]
 147        public class IdleStateChangedPayload
 148        {
 149            public bool isIdle;
 150        };
 151
 152        [System.Serializable]
 153        public class OnPointerDownEvent : UUIDEvent<OnPointerEventPayload> { };
 154
 155        [System.Serializable]
 156        public class OnGlobalPointerEvent
 157        {
 1158            public OnGlobalPointerEventPayload payload = new OnGlobalPointerEventPayload();
 159        };
 160
 161        [System.Serializable]
 162        public class OnPointerUpEvent : UUIDEvent<OnPointerEventPayload> { };
 163
 164        [System.Serializable]
 165        private class OnTextSubmitEvent : UUIDEvent<OnTextSubmitEventPayload> { };
 166
 167        [System.Serializable]
 168        private class OnTextInputChangeEvent : UUIDEvent<OnTextInputChangeEventPayload> { };
 169
 170        [System.Serializable]
 171        private class OnTextInputChangeTextEvent : UUIDEvent<OnTextInputChangeTextEventPayload> { };
 172
 173        [System.Serializable]
 174        private class OnScrollChangeEvent : UUIDEvent<OnScrollChangeEventPayload> { };
 175
 176        [System.Serializable]
 177        private class OnFocusEvent : UUIDEvent<EmptyPayload> { };
 178
 179        [System.Serializable]
 180        private class OnBlurEvent : UUIDEvent<EmptyPayload> { };
 181
 182        [System.Serializable]
 183        public class OnEnterEvent : UUIDEvent<OnEnterEventPayload> { };
 184
 185        [System.Serializable]
 186        public class OnClickEventPayload
 187        {
 188            public ACTION_BUTTON buttonId = ACTION_BUTTON.POINTER;
 189        }
 190
 191        [System.Serializable]
 192        public class SendChatMessageEvent
 193        {
 194            public ChatMessage message;
 195        }
 196
 197        [System.Serializable]
 198        public class RemoveEntityComponentsPayLoad
 199        {
 200            public string entityId;
 201            public string componentId;
 202        };
 203
 204        [System.Serializable]
 205        public class StoreSceneStateEvent
 206        {
 1207            public string type = "StoreSceneState";
 1208            public string payload = "";
 209        };
 210
 211        [System.Serializable]
 212        public class OnPointerEventPayload
 213        {
 214
 215            public ACTION_BUTTON buttonId;
 216            public Vector3 origin;
 217            public Vector3 direction;
 218            public Hit hit;
 219
 220            [System.Serializable]
 221            public class Hit
 222            {
 223                public Vector3 origin;
 224                public float length;
 225                public Vector3 hitPoint;
 226                public Vector3 normal;
 227                public Vector3 worldNormal;
 228                public string meshName;
 229                public string entityId;
 230            }
 231        }
 232
 233        [System.Serializable]
 234        public class OnGlobalPointerEventPayload : OnPointerEventPayload
 235        {
 236            public enum InputEventType
 237            {
 238                DOWN,
 239                UP
 240            }
 241
 242            public InputEventType type;
 243        }
 244
 245        [System.Serializable]
 246        public class OnTextSubmitEventPayload
 247        {
 248            public string id;
 249            public string text;
 250        }
 251
 252        [System.Serializable]
 253        public class OnTextInputChangeEventPayload
 254        {
 255            public string value;
 256        }
 257
 258        [System.Serializable]
 259        public class OnTextInputChangeTextEventPayload
 260        {
 261
 3262            public Payload value = new Payload();
 263
 264            [System.Serializable]
 265            public class Payload
 266            {
 267                public string value;
 268                public bool isSubmit;
 269            }
 270        }
 271
 272        [System.Serializable]
 273        public class OnScrollChangeEventPayload
 274        {
 275            public Vector2 value;
 276            public int pointerId;
 277        }
 278
 279        [System.Serializable]
 280        public class EmptyPayload { }
 281
 282        [System.Serializable]
 283        public class MetricsModel
 284        {
 285            public int meshes;
 286            public int bodies;
 287            public int materials;
 288            public int textures;
 289            public int triangles;
 290            public int entities;
 291
 292            public static MetricsModel operator +(MetricsModel lhs, MetricsModel rhs)
 293            {
 0294                return new MetricsModel()
 295                {
 296                    meshes = lhs.meshes + rhs.meshes,
 297                    bodies = lhs.bodies + rhs.bodies,
 298                    materials = lhs.materials + rhs.materials,
 299                    textures = lhs.textures + rhs.textures,
 300                    triangles = lhs.triangles + rhs.triangles,
 301                    entities = lhs.entities + rhs.entities
 302                };
 303            }
 304        }
 305
 306        [System.Serializable]
 307        private class OnMetricsUpdate
 308        {
 1309            public MetricsModel given = new MetricsModel();
 1310            public MetricsModel limit = new MetricsModel();
 311        }
 312
 313        [System.Serializable]
 314        public class OnEnterEventPayload { }
 315
 316        [System.Serializable]
 317        public class TransformPayload
 318        {
 0319            public Vector3 position = Vector3.zero;
 0320            public Quaternion rotation = Quaternion.identity;
 0321            public Vector3 scale = Vector3.one;
 322        }
 323
 324        public class OnSendScreenshot
 325        {
 326            public string encodedTexture;
 327            public string id;
 328        };
 329
 330        [System.Serializable]
 331        public class GotoEvent
 332        {
 333            public int x;
 334            public int y;
 335        };
 336
 337        [System.Serializable]
 338        public class BaseResolution
 339        {
 340            public int baseResolution;
 341        };
 342
 343        //-----------------------------------------------------
 344        // Raycast
 345        [System.Serializable]
 346        public class RayInfo
 347        {
 348            public Vector3 origin;
 349            public Vector3 direction;
 350            public float distance;
 351        }
 352
 353        [System.Serializable]
 354        public class RaycastHitInfo
 355        {
 356            public bool didHit;
 357            public RayInfo ray;
 358
 359            public Vector3 hitPoint;
 360            public Vector3 hitNormal;
 361        }
 362
 363        [System.Serializable]
 364        public class HitEntityInfo
 365        {
 366            public string entityId;
 367            public string meshName;
 368        }
 369
 370        [System.Serializable]
 371        public class RaycastHitEntity : RaycastHitInfo
 372        {
 373            public HitEntityInfo entity;
 374        }
 375
 376        [System.Serializable]
 377        public class RaycastHitEntities : RaycastHitInfo
 378        {
 379            public RaycastHitEntity[] entities;
 380        }
 381
 382        [System.Serializable]
 383        public class RaycastResponse<T> where T : RaycastHitInfo
 384        {
 385            public string queryId;
 386            public string queryType;
 387            public T payload;
 388        }
 389
 390        // Note (Zak): We need to explicitly define this classes for the JsonUtility to
 391        // be able to serialize them
 392        [System.Serializable]
 393        public class RaycastHitFirstResponse : RaycastResponse<RaycastHitEntity> { }
 394
 395        [System.Serializable]
 396        public class RaycastHitAllResponse : RaycastResponse<RaycastHitEntities> { }
 397
 398        [System.Serializable]
 399        public class UserAcceptedCollectiblesPayload
 400        {
 401            public string id;
 402        }
 403
 404        [System.Serializable]
 405        public class SendBlockPlayerPayload
 406        {
 407            public string userId;
 408        }
 409
 410        [Serializable]
 411        private class SendReportPlayerPayload
 412        {
 413            public string userId;
 414            public string name;
 415        }
 416
 417        [Serializable]
 418        private class SendReportScenePayload
 419        {
 420            public int sceneNumber;
 421        }
 422
 423        [Serializable]
 424        private class SetHomeScenePayload
 425        {
 426            public string sceneCoords;
 427        }
 428
 429        [System.Serializable]
 430        public class SendUnblockPlayerPayload
 431        {
 432            public string userId;
 433        }
 434
 435        [System.Serializable]
 436        public class TutorialStepPayload
 437        {
 438            public int tutorialStep;
 439        }
 440
 441        [System.Serializable]
 442        public class PerformanceReportPayload
 443        {
 444            public string samples;
 445            public bool fpsIsCapped;
 446            public int hiccupsInThousandFrames;
 447            public float hiccupsTime;
 448            public float totalTime;
 449            public int gltfInProgress;
 450            public int gltfFailed;
 451            public int gltfCancelled;
 452            public int gltfLoaded;
 453            public int abInProgress;
 454            public int abFailed;
 455            public int abCancelled;
 456            public int abLoaded;
 457            public int gltfTexturesLoaded;
 458            public int abTexturesLoaded;
 459            public int promiseTexturesLoaded;
 460            public int enqueuedMessages;
 461            public int processedMessages;
 462            public int playerCount;
 463            public int loadRadius;
 464            public object drawCalls; //int *
 465            public object memoryReserved; //long, in total bytes *
 466            public object memoryUsage; //long, in total bytes *
 467            public object totalGCAlloc; //long, in total bytes, its the sum of all GCAllocs per frame over 1000 frames *
 468            public Dictionary<int, long> sceneScores;
 469
 470            //* is NULL if SendProfilerMetrics is false
 471        }
 472
 473        [System.Serializable]
 474        public class SystemInfoReportPayload
 475        {
 0476            public string graphicsDeviceName = SystemInfo.graphicsDeviceName;
 0477            public string graphicsDeviceVersion = SystemInfo.graphicsDeviceVersion;
 0478            public int graphicsMemorySize = SystemInfo.graphicsMemorySize;
 0479            public string processorType = SystemInfo.processorType;
 0480            public int processorCount = SystemInfo.processorCount;
 0481            public int systemMemorySize = SystemInfo.systemMemorySize;
 482
 483            // TODO: remove useBinaryTransform after ECS7 is fully in prod
 0484            public bool useBinaryTransform = true;
 485        }
 486
 487        [System.Serializable]
 488        public class GenericAnalyticPayload
 489        {
 490            public string eventName;
 491            public Dictionary<object, object> data;
 492        }
 493
 494        [System.Serializable]
 495        public class PerformanceHiccupPayload
 496        {
 497            public int hiccupsInThousandFrames;
 498            public float hiccupsTime;
 499            public float totalTime;
 500        }
 501
 502        [System.Serializable]
 503        public class TermsOfServiceResponsePayload
 504        {
 505            public int sceneNumber;
 506            public bool dontShowAgain;
 507            public bool accepted;
 508        }
 509
 510        [System.Serializable]
 511        public class OpenURLPayload
 512        {
 513            public string url;
 514        }
 515
 516        [System.Serializable]
 517        public class GIFSetupPayload
 518        {
 519            public string imageSource;
 520            public string id;
 521            public bool isWebGL1;
 522        }
 523
 524        [System.Serializable]
 525        public class RequestScenesInfoAroundParcelPayload
 526        {
 527            public Vector2 parcel;
 528            public int scenesAround;
 529        }
 530
 531        [System.Serializable]
 532        public class AudioStreamingPayload
 533        {
 534            public string url;
 535            public bool play;
 536            public float volume;
 537        }
 538
 539        [System.Serializable]
 540        public class SetScenesLoadRadiusPayload
 541        {
 542            public float newRadius;
 543        }
 544
 545        [System.Serializable]
 546        public class SetVoiceChatRecordingPayload
 547        {
 548            public bool recording;
 549        }
 550
 551        [System.Serializable]
 552        public class ApplySettingsPayload
 553        {
 554            public float voiceChatVolume;
 555            public int voiceChatAllowCategory;
 556        }
 557
 558        [Serializable]
 559        public class UserRealmPayload
 560        {
 561            public string serverName;
 562            public string layer;
 563        }
 564
 565        [System.Serializable]
 566        public class JumpInPayload
 567        {
 1568            public UserRealmPayload realm = new UserRealmPayload();
 569            public Vector2 gridPosition;
 570        }
 571
 572        [System.Serializable]
 573        public class LoadingFeedbackMessage
 574        {
 575            public string message;
 576            public int loadPercentage;
 577        }
 578
 579        [System.Serializable]
 580        public class AnalyticsPayload
 581        {
 582
 583            public string name;
 584            public Property[] properties;
 585
 586            [System.Serializable]
 587            public class Property
 588            {
 589                public string key;
 590                public string value;
 591
 0592                public Property(string key, string value)
 593                {
 0594                    this.key = key;
 0595                    this.value = value;
 0596                }
 597            }
 598        }
 599
 600        [System.Serializable]
 601        public class DelightedSurveyEnabledPayload
 602        {
 603            public bool enabled;
 604        }
 605
 606        [System.Serializable]
 607        public class ExternalActionSceneEventPayload
 608        {
 609            public string type;
 610            public string payload;
 611        }
 612
 613        [System.Serializable]
 614        public class MuteUserPayload
 615        {
 616            public string[] usersId;
 617            public bool mute;
 618        }
 619
 620        [System.Serializable]
 621        public class CloseUserAvatarPayload
 622        {
 623            public bool isSignUpFlow;
 624        }
 625
 626        [System.Serializable]
 627        public class StringPayload
 628        {
 629            public string value;
 630        }
 631
 632        [System.Serializable]
 633        public class KillPortableExperiencePayload
 634        {
 635            public string portableExperienceId;
 636        }
 637
 638        [System.Serializable]
 639        public class SetDisabledPortableExperiencesPayload
 640        {
 641            public string[] idsToDisable;
 642        }
 643
 644        [System.Serializable]
 645        public class WearablesRequestFiltersPayload
 646        {
 647            public string ownedByUser;
 648            public string[] wearableIds;
 649            public string[] collectionIds;
 650            public string thirdPartyId;
 651        }
 652
 653        [System.Serializable]
 654        public class EmotesRequestFiltersPayload
 655        {
 656            public string ownedByUser;
 657            public string[] emoteIds;
 658            public string[] collectionIds;
 659            public string thirdPartyId;
 660        }
 661
 662        [System.Serializable]
 663        public class RequestWearablesPayload
 664        {
 665            public WearablesRequestFiltersPayload filters;
 666            public string context;
 667        }
 668
 669        [System.Serializable]
 670        public class RequestEmotesPayload
 671        {
 672            public EmotesRequestFiltersPayload filters;
 673            public string context;
 674        }
 675
 676        [System.Serializable]
 677        public class HeadersPayload
 678        {
 679            public string method;
 680            public string url;
 1681            public Dictionary<string, object> metadata = new Dictionary<string, object>();
 682        }
 683
 684        [System.Serializable]
 685        public class SearchENSOwnerPayload
 686        {
 687            public string name;
 688            public int maxResults;
 689        }
 690
 691        [System.Serializable]
 692        public class UnpublishScenePayload
 693        {
 694            public string coordinates;
 695        }
 696
 697        [System.Serializable]
 698        public class AvatarStateBase
 699        {
 700            public string type;
 701            public string avatarShapeId;
 702        }
 703
 704        [System.Serializable]
 705        public class AvatarStateSceneChanged : AvatarStateBase
 706        {
 707            public int sceneNumber;
 708        }
 709
 710        [System.Serializable]
 711        public class AvatarOnClickPayload
 712        {
 713            public string userId;
 1714            public RayInfo ray = new RayInfo();
 715        }
 716
 717        [System.Serializable]
 718        public class TimeReportPayload
 719        {
 720            public float timeNormalizationFactor;
 721            public float cycleTime;
 722            public bool isPaused;
 723            public float time;
 724        }
 725
 726        [System.Serializable]
 727        public class GetFriendsWithDirectMessagesPayload
 728        {
 729            public string userNameOrId;
 730            public int limit;
 731            public int skip;
 732        }
 733
 734        [System.Serializable]
 735        public class MarkMessagesAsSeenPayload
 736        {
 737            public string userId;
 738        }
 739
 740        [System.Serializable]
 741        public class MarkChannelMessagesAsSeenPayload
 742        {
 743            public string channelId;
 744        }
 745
 746        [System.Serializable]
 747        public class GetPrivateMessagesPayload
 748        {
 749            public string userId;
 750            public int limit;
 751            public string fromMessageId;
 752        }
 753
 754        [Serializable]
 755        public class FriendshipUpdateStatusMessage
 756        {
 757            public string userId;
 758            public FriendshipAction action;
 759        }
 760
 761        [Serializable]
 762        public class SetInputAudioDevicePayload
 763        {
 764            public string deviceId;
 765        }
 766
 767        public enum FriendshipAction
 768        {
 769            NONE,
 770            APPROVED,
 771            REJECTED,
 772            CANCELLED,
 773            REQUESTED_FROM,
 774            REQUESTED_TO,
 775            DELETED
 776        }
 777
 778        [Serializable]
 779        private class GetFriendsPayload
 780        {
 781            public string userNameOrId;
 782            public int limit;
 783            public int skip;
 784        }
 785
 786        [Serializable]
 787        private class GetFriendRequestsPayload
 788        {
 789            public int sentLimit;
 790            public int sentSkip;
 791            public int receivedLimit;
 792            public int receivedSkip;
 793        }
 794
 795        [Serializable]
 796        private class LeaveChannelPayload
 797        {
 798            public string channelId;
 799        }
 800
 801        [Serializable]
 802        private class CreateChannelPayload
 803        {
 804            public string channelId;
 805        }
 806
 807        public struct MuteChannelPayload
 808        {
 809            public string channelId;
 810            public bool muted;
 811        }
 812
 813        [Serializable]
 814        private class JoinOrCreateChannelPayload
 815        {
 816            public string channelId;
 817        }
 818
 819        [Serializable]
 820        private class GetChannelMessagesPayload
 821        {
 822            public string channelId;
 823            public int limit;
 824            public string from;
 825        }
 826
 827        [Serializable]
 828        private class GetJoinedChannelsPayload
 829        {
 830            public int limit;
 831            public int skip;
 832        }
 833
 834        [Serializable]
 835        private class GetChannelsPayload
 836        {
 837            public int limit;
 838            public string since;
 839            public string name;
 840        }
 841
 842        [Serializable]
 843        private class GetChannelInfoPayload
 844        {
 845            public string[] channelIds;
 846        }
 847
 848        [Serializable]
 849        private class GetChannelMembersPayload
 850        {
 851            public string channelId;
 852            public int limit;
 853            public int skip;
 854            public string userName;
 855        }
 856
 857        public static event Action<string, byte[]> OnBinaryMessageFromEngine;
 858
 859#if UNITY_WEBGL && !UNITY_EDITOR
 860    /**
 861     * This method is called after the first render. It marks the loading of the
 862     * rest of the JS client.
 863     */
 864    [DllImport("__Internal")] public static extern void StartDecentraland();
 865    [DllImport("__Internal")] public static extern void MessageFromEngine(string type, string message);
 866    [DllImport("__Internal")] public static extern string GetGraphicCard();
 867
 868    public static System.Action<string, string> OnMessageFromEngine;
 869#else
 870        public static Action<string, string> OnMessageFromEngine
 871        {
 872            set
 873            {
 64874                OnMessage = value;
 64875                if (OnMessage != null)
 876                {
 32877                    ProcessQueuedMessages();
 878                }
 64879            }
 4417880            get => OnMessage;
 881        }
 882        private static Action<string, string> OnMessage;
 883
 1884        private static bool hasQueuedMessages = false;
 1885        private static List<(string, string)> queuedMessages = new List<(string, string)>();
 0886        public static void StartDecentraland() { }
 0887        public static bool CheckURLParam(string targetParam) { return false; }
 0888        public static string GetURLParam(string targetParam) { return String.Empty; }
 889
 890        public static void MessageFromEngine(string type, string message)
 891        {
 2893892            if (OnMessageFromEngine != null)
 893            {
 1460894                if (hasQueuedMessages)
 895                {
 0896                    ProcessQueuedMessages();
 897                }
 898
 1460899                OnMessageFromEngine.Invoke(type, message);
 1460900                if (VERBOSE)
 901                {
 0902                    Debug.Log("MessageFromEngine called with: " + type + ", " + message);
 903                }
 904            }
 905            else
 906            {
 1433907                lock (queuedMessages)
 908                {
 1433909                    queuedMessages.Add((type, message));
 1433910                }
 911
 1433912                hasQueuedMessages = true;
 913            }
 2893914        }
 915
 916        private static void ProcessQueuedMessages()
 917        {
 32918            hasQueuedMessages = false;
 32919            lock (queuedMessages)
 920            {
 2876921                foreach ((string type, string payload) in queuedMessages)
 922                {
 1406923                    MessageFromEngine(type, payload);
 924                }
 925
 32926                queuedMessages.Clear();
 32927            }
 32928        }
 929
 1930        public static string GetGraphicCard() => "In Editor Graphic Card";
 931#endif
 932
 933        public static void SendMessage(string type)
 934        {
 935            // sending an empty JSON object to be compatible with other messages
 5936            MessageFromEngine(type, "{}");
 5937        }
 938
 939        public static void SendMessage<T>(string type, T message)
 940        {
 1482941            string messageJson = JsonUtility.ToJson(message);
 1482942            SendJson(type, messageJson);
 1482943        }
 944
 945        public static void SendJson(string type, string json)
 946        {
 1482947            if (VERBOSE)
 948            {
 0949                Debug.Log($"Sending message: " + json);
 950            }
 951
 1482952            MessageFromEngine(type, json);
 1482953        }
 954
 1955        private static ReportPositionPayload positionPayload = new ReportPositionPayload();
 1956        private static CameraModePayload cameraModePayload = new CameraModePayload();
 1957        private static Web3UseResponsePayload web3UseResponsePayload = new Web3UseResponsePayload();
 1958        private static IdleStateChangedPayload idleStateChangedPayload = new IdleStateChangedPayload();
 1959        private static OnMetricsUpdate onMetricsUpdate = new OnMetricsUpdate();
 1960        private static OnClickEvent onClickEvent = new OnClickEvent();
 1961        private static OnPointerDownEvent onPointerDownEvent = new OnPointerDownEvent();
 1962        private static OnPointerUpEvent onPointerUpEvent = new OnPointerUpEvent();
 1963        private static OnTextSubmitEvent onTextSubmitEvent = new OnTextSubmitEvent();
 1964        private static OnTextInputChangeEvent onTextInputChangeEvent = new OnTextInputChangeEvent();
 1965        private static OnTextInputChangeTextEvent onTextInputChangeTextEvent = new OnTextInputChangeTextEvent();
 1966        private static OnScrollChangeEvent onScrollChangeEvent = new OnScrollChangeEvent();
 1967        private static OnFocusEvent onFocusEvent = new OnFocusEvent();
 1968        private static OnBlurEvent onBlurEvent = new OnBlurEvent();
 1969        private static OnEnterEvent onEnterEvent = new OnEnterEvent();
 1970        private static OnSendScreenshot onSendScreenshot = new OnSendScreenshot();
 1971        private static OnPointerEventPayload onPointerEventPayload = new OnPointerEventPayload();
 1972        private static OnGlobalPointerEventPayload onGlobalPointerEventPayload = new OnGlobalPointerEventPayload();
 1973        private static OnGlobalPointerEvent onGlobalPointerEvent = new OnGlobalPointerEvent();
 1974        private static AudioStreamingPayload onAudioStreamingEvent = new AudioStreamingPayload();
 1975        private static SetVoiceChatRecordingPayload setVoiceChatRecordingPayload = new SetVoiceChatRecordingPayload();
 1976        private static SetScenesLoadRadiusPayload setScenesLoadRadiusPayload = new SetScenesLoadRadiusPayload();
 1977        private static ApplySettingsPayload applySettingsPayload = new ApplySettingsPayload();
 1978        private static GIFSetupPayload gifSetupPayload = new GIFSetupPayload();
 1979        private static JumpInPayload jumpInPayload = new JumpInPayload();
 1980        private static GotoEvent gotoEvent = new GotoEvent();
 1981        private static SendChatMessageEvent sendChatMessageEvent = new SendChatMessageEvent();
 1982        private static BaseResolution baseResEvent = new BaseResolution();
 1983        private static AnalyticsPayload analyticsEvent = new AnalyticsPayload();
 1984        private static DelightedSurveyEnabledPayload delightedSurveyEnabled = new DelightedSurveyEnabledPayload();
 1985        private static ExternalActionSceneEventPayload sceneExternalActionEvent = new ExternalActionSceneEventPayload();
 1986        private static MuteUserPayload muteUserEvent = new MuteUserPayload();
 1987        private static StoreSceneStateEvent storeSceneState = new StoreSceneStateEvent();
 1988        private static CloseUserAvatarPayload closeUserAvatarPayload = new CloseUserAvatarPayload();
 1989        private static StringPayload stringPayload = new StringPayload();
 1990        private static KillPortableExperiencePayload killPortableExperiencePayload = new KillPortableExperiencePayload()
 1991        private static SetDisabledPortableExperiencesPayload setDisabledPortableExperiencesPayload = new SetDisabledPort
 1992        private static RequestWearablesPayload requestWearablesPayload = new RequestWearablesPayload();
 1993        private static RequestEmotesPayload requestEmotesPayload = new RequestEmotesPayload();
 1994        private static SearchENSOwnerPayload searchEnsOwnerPayload = new SearchENSOwnerPayload();
 1995        private static HeadersPayload headersPayload = new HeadersPayload();
 1996        private static AvatarStateBase avatarStatePayload = new AvatarStateBase();
 1997        private static AvatarStateSceneChanged avatarSceneChangedPayload = new AvatarStateSceneChanged();
 1998        public static AvatarOnClickPayload avatarOnClickPayload = new AvatarOnClickPayload();
 1999        private static UUIDEvent<EmptyPayload> onPointerHoverEnterEvent = new UUIDEvent<EmptyPayload>();
 11000        private static UUIDEvent<EmptyPayload> onPointerHoverExitEvent = new UUIDEvent<EmptyPayload>();
 11001        private static TimeReportPayload timeReportPayload = new TimeReportPayload();
 11002        private static GetFriendsWithDirectMessagesPayload getFriendsWithDirectMessagesPayload = new GetFriendsWithDirec
 11003        private static MarkMessagesAsSeenPayload markMessagesAsSeenPayload = new MarkMessagesAsSeenPayload();
 11004        private static MarkChannelMessagesAsSeenPayload markChannelMessagesAsSeenPayload = new MarkChannelMessagesAsSeen
 11005        private static GetPrivateMessagesPayload getPrivateMessagesPayload = new GetPrivateMessagesPayload();
 1006
 1007        public static void SendSceneEvent<T> (int sceneNumber, string eventType, T payload)
 1008        {
 5161009            SceneEvent<T> sceneEvent = new SceneEvent<T>();
 5161010            sceneEvent.sceneNumber = sceneNumber;
 5161011            sceneEvent.eventType = eventType;
 5161012            sceneEvent.payload = payload;
 1013
 5161014            SendMessage("SceneEvent", sceneEvent);
 5161015        }
 1016
 1017        private static void SendAllScenesEvent<T>(string eventType, T payload)
 1018        {
 4861019            AllScenesEvent<T> allScenesEvent = new AllScenesEvent<T>();
 4861020            allScenesEvent.eventType = eventType;
 4861021            allScenesEvent.payload = payload;
 1022
 4861023            SendMessage("AllScenesEvent", allScenesEvent);
 4861024        }
 1025
 1026        public static void ReportPosition(Vector3 position, Quaternion rotation, float playerHeight, Quaternion cameraRo
 1027        {
 521028            positionPayload.position = position;
 521029            positionPayload.rotation = rotation;
 521030            positionPayload.playerHeight = playerHeight;
 521031            positionPayload.cameraRotation = cameraRotation;
 1032
 521033            SendMessage("ReportPosition", positionPayload);
 521034        }
 1035
 9701036        public static void ReportCameraChanged(CameraMode.ModeId cameraMode) { ReportCameraChanged(cameraMode, -1); }
 1037
 1038        public static void ReportCameraChanged(CameraMode.ModeId cameraMode, int targetSceneNumber)
 1039        {
 7821040            cameraModePayload.cameraMode = cameraMode;
 7821041            if (targetSceneNumber > 0)
 1042            {
 2971043                SendSceneEvent(targetSceneNumber, "cameraModeChanged", cameraModePayload);
 1044            }
 1045            else
 1046            {
 4851047                SendAllScenesEvent("cameraModeChanged", cameraModePayload);
 1048            }
 4851049        }
 1050
 1051        public static void Web3UseResponse(string id, bool result)
 1052        {
 01053            web3UseResponsePayload.id = id;
 01054            web3UseResponsePayload.result = result;
 01055            SendMessage("Web3UseResponse", web3UseResponsePayload);
 01056        }
 1057
 1058        public static void ReportIdleStateChanged(bool isIdle)
 1059        {
 11060            idleStateChangedPayload.isIdle = isIdle;
 11061            SendAllScenesEvent("idleStateChanged", idleStateChangedPayload);
 11062        }
 1063
 5941064        public static void ReportControlEvent<T>(T controlEvent) where T : ControlEvent { SendMessage("ControlEvent", co
 1065
 1066        public static void SendRequestHeadersForUrl(string eventName, string method, string url, Dictionary<string, obje
 1067        {
 01068            headersPayload.method = method;
 01069            headersPayload.url = url;
 01070            if (metadata != null)
 01071                headersPayload.metadata = metadata;
 01072            SendMessage(eventName, headersPayload);
 01073        }
 1074
 01075        public static void BuilderInWorldMessage(string type, string message) { MessageFromEngine(type, message); }
 1076
 1077        public static void ReportOnClickEvent(int sceneNumber, string uuid)
 1078        {
 61079            if (string.IsNullOrEmpty(uuid))
 1080            {
 01081                return;
 1082            }
 1083
 61084            onClickEvent.uuid = uuid;
 1085
 61086            SendSceneEvent(sceneNumber, "uuidEvent", onClickEvent);
 61087        }
 1088
 1089        // TODO: Add sceneNumber to this response
 1090        private static void ReportRaycastResult<T, P>(int sceneNumber, string queryId, string queryType, P payload) wher
 1091        {
 01092            T response = new T();
 01093            response.queryId = queryId;
 01094            response.queryType = queryType;
 01095            response.payload = payload;
 1096
 01097            SendSceneEvent<T>(sceneNumber, "raycastResponse", response);
 01098        }
 1099
 01100        public static void ReportRaycastHitFirstResult(int sceneNumber, string queryId, RaycastType raycastType, Raycast
 1101
 01102        public static void ReportRaycastHitAllResult(int sceneNumber, string queryId, RaycastType raycastType, RaycastHi
 1103
 1104        private static OnPointerEventPayload.Hit CreateHitObject(string entityId, string meshName, Vector3 point,
 1105            Vector3 normal, float distance)
 1106        {
 191107            OnPointerEventPayload.Hit hit = new OnPointerEventPayload.Hit();
 1108
 191109            hit.hitPoint = point;
 191110            hit.length = distance;
 191111            hit.normal = normal;
 191112            hit.worldNormal = normal;
 191113            hit.meshName = meshName;
 191114            hit.entityId = entityId;
 1115
 191116            return hit;
 1117        }
 1118
 1119        private static void SetPointerEventPayload(OnPointerEventPayload pointerEventPayload, ACTION_BUTTON buttonId,
 1120            string entityId, string meshName, Ray ray, Vector3 point, Vector3 normal, float distance,
 1121            bool isHitInfoValid)
 1122        {
 201123            pointerEventPayload.origin = ray.origin;
 201124            pointerEventPayload.direction = ray.direction;
 201125            pointerEventPayload.buttonId = buttonId;
 1126
 201127            if (isHitInfoValid)
 191128                pointerEventPayload.hit = CreateHitObject(entityId, meshName, point, normal, distance);
 1129            else
 11130                pointerEventPayload.hit = null;
 11131        }
 1132
 1133        public static void ReportGlobalPointerDownEvent(ACTION_BUTTON buttonId, Ray ray, Vector3 point, Vector3 normal,
 1134            float distance, int sceneNumber, string entityId = "0", string meshName = null, bool isHitInfoValid = false)
 1135        {
 111136            SetPointerEventPayload((OnPointerEventPayload) onGlobalPointerEventPayload, buttonId,
 1137                entityId, meshName, ray, point, normal, distance,
 1138                isHitInfoValid);
 111139            onGlobalPointerEventPayload.type = OnGlobalPointerEventPayload.InputEventType.DOWN;
 1140
 111141            onGlobalPointerEvent.payload = onGlobalPointerEventPayload;
 1142
 111143            SendSceneEvent(sceneNumber, "actionButtonEvent", onGlobalPointerEvent);
 111144        }
 1145
 1146        public static void ReportGlobalPointerUpEvent(ACTION_BUTTON buttonId, Ray ray, Vector3 point, Vector3 normal,
 1147            float distance, int sceneNumber, string entityId = "0", string meshName = null, bool isHitInfoValid = false)
 1148        {
 31149            SetPointerEventPayload((OnPointerEventPayload) onGlobalPointerEventPayload, buttonId,
 1150                entityId, meshName, ray, point, normal, distance,
 1151                isHitInfoValid);
 31152            onGlobalPointerEventPayload.type = OnGlobalPointerEventPayload.InputEventType.UP;
 1153
 31154            onGlobalPointerEvent.payload = onGlobalPointerEventPayload;
 1155
 31156            SendSceneEvent(sceneNumber, "actionButtonEvent", onGlobalPointerEvent);
 31157        }
 1158
 1159        public static void ReportOnPointerDownEvent(ACTION_BUTTON buttonId, int sceneNumber, string uuid,
 1160            string entityId, string meshName, Ray ray, Vector3 point, Vector3 normal, float distance)
 1161        {
 41162            if (string.IsNullOrEmpty(uuid))
 1163            {
 01164                return;
 1165            }
 1166
 41167            onPointerDownEvent.uuid = uuid;
 41168            SetPointerEventPayload(onPointerEventPayload, buttonId, entityId, meshName, ray, point,
 1169                normal, distance, isHitInfoValid: true);
 41170            onPointerDownEvent.payload = onPointerEventPayload;
 1171
 41172            SendSceneEvent(sceneNumber, "uuidEvent", onPointerDownEvent);
 41173        }
 1174
 1175        public static void ReportOnPointerUpEvent(ACTION_BUTTON buttonId, int sceneNumber, string uuid, string entityId,
 1176            string meshName, Ray ray, Vector3 point, Vector3 normal, float distance)
 1177        {
 21178            if (string.IsNullOrEmpty(uuid))
 1179            {
 01180                return;
 1181            }
 1182
 21183            onPointerUpEvent.uuid = uuid;
 21184            SetPointerEventPayload(onPointerEventPayload, buttonId, entityId, meshName, ray, point,
 1185                normal, distance, isHitInfoValid: true);
 21186            onPointerUpEvent.payload = onPointerEventPayload;
 1187
 21188            SendSceneEvent(sceneNumber, "uuidEvent", onPointerUpEvent);
 21189        }
 1190
 1191        public static void ReportOnTextSubmitEvent(int sceneNumber, string uuid, string text)
 1192        {
 21193            if (string.IsNullOrEmpty(uuid))
 1194            {
 01195                return;
 1196            }
 1197
 21198            onTextSubmitEvent.uuid = uuid;
 21199            onTextSubmitEvent.payload.text = text;
 1200
 21201            SendSceneEvent(sceneNumber, "uuidEvent", onTextSubmitEvent);
 21202        }
 1203
 1204        public static void ReportOnTextInputChangedEvent(int sceneNumber, string uuid, string text)
 1205        {
 171206            if (string.IsNullOrEmpty(uuid))
 1207            {
 171208                return;
 1209            }
 1210
 01211            onTextInputChangeEvent.uuid = uuid;
 01212            onTextInputChangeEvent.payload.value = text;
 1213
 01214            SendSceneEvent(sceneNumber, "uuidEvent", onTextInputChangeEvent);
 01215        }
 1216
 1217        public static void ReportOnTextInputChangedTextEvent(int sceneNumber, string uuid, string text, bool isSubmit)
 1218        {
 191219            if (string.IsNullOrEmpty(uuid))
 1220            {
 161221                return;
 1222            }
 1223
 31224            onTextInputChangeTextEvent.uuid = uuid;
 31225            onTextInputChangeTextEvent.payload.value.value = text;
 31226            onTextInputChangeTextEvent.payload.value.isSubmit = isSubmit;
 1227
 31228            SendSceneEvent(sceneNumber, "uuidEvent", onTextInputChangeTextEvent);
 31229        }
 1230
 1231        public static void ReportOnFocusEvent(int sceneNumber, string uuid)
 1232        {
 21233            if (string.IsNullOrEmpty(uuid))
 1234            {
 21235                return;
 1236            }
 1237
 01238            onFocusEvent.uuid = uuid;
 01239            SendSceneEvent(sceneNumber, "uuidEvent", onFocusEvent);
 01240        }
 1241
 1242        public static void ReportOnBlurEvent(int sceneNumber, string uuid)
 1243        {
 21244            if (string.IsNullOrEmpty(uuid))
 1245            {
 21246                return;
 1247            }
 1248
 01249            onBlurEvent.uuid = uuid;
 01250            SendSceneEvent(sceneNumber, "uuidEvent", onBlurEvent);
 01251        }
 1252
 1253        public static void ReportOnScrollChange(int sceneNumber, string uuid, Vector2 value, int pointerId)
 1254        {
 151255            if (string.IsNullOrEmpty(uuid))
 1256            {
 131257                return;
 1258            }
 1259
 21260            onScrollChangeEvent.uuid = uuid;
 21261            onScrollChangeEvent.payload.value = value;
 21262            onScrollChangeEvent.payload.pointerId = pointerId;
 1263
 21264            SendSceneEvent(sceneNumber, "uuidEvent", onScrollChangeEvent);
 21265        }
 1266
 01267        public static void ReportEvent<T>(int sceneNumber, T @event) { SendSceneEvent(sceneNumber, "uuidEvent", @event);
 1268
 1269        public static void ReportOnMetricsUpdate(int sceneNumber, MetricsModel current,
 1270            MetricsModel limit)
 1271        {
 1791272            onMetricsUpdate.given = current;
 1791273            onMetricsUpdate.limit = limit;
 1274
 1791275            SendSceneEvent(sceneNumber, "metricsUpdate", onMetricsUpdate);
 1791276        }
 1277
 1278        public static void ReportOnEnterEvent(int sceneNumber, string uuid)
 1279        {
 01280            if (string.IsNullOrEmpty(uuid))
 01281                return;
 1282
 01283            onEnterEvent.uuid = uuid;
 1284
 01285            SendSceneEvent(sceneNumber, "uuidEvent", onEnterEvent);
 01286        }
 1287
 01288        public static void LogOut() { SendMessage("LogOut"); }
 1289
 01290        public static void RedirectToSignUp() { SendMessage("RedirectToSignUp"); }
 1291
 01292        public static void PreloadFinished(int sceneNumber) { SendMessage("PreloadFinished", sceneNumber); }
 1293
 1294        public static void ReportMousePosition(Vector3 mousePosition, string id)
 1295        {
 01296            positionPayload.mousePosition = mousePosition;
 01297            positionPayload.id = id;
 01298            SendMessage("ReportMousePosition", positionPayload);
 01299        }
 1300
 1301        public static void SendScreenshot(string encodedTexture, string id)
 1302        {
 01303            onSendScreenshot.encodedTexture = encodedTexture;
 01304            onSendScreenshot.id = id;
 01305            SendMessage("SendScreenshot", onSendScreenshot);
 01306        }
 1307
 1308        public static void SetDelightedSurveyEnabled(bool enabled)
 1309        {
 01310            delightedSurveyEnabled.enabled = enabled;
 01311            SendMessage("SetDelightedSurveyEnabled", delightedSurveyEnabled);
 01312        }
 1313
 1314        public static void SetScenesLoadRadius(float newRadius)
 1315        {
 11316            setScenesLoadRadiusPayload.newRadius = newRadius;
 11317            SendMessage("SetScenesLoadRadius", setScenesLoadRadiusPayload);
 11318        }
 1319
 1320        [System.Serializable]
 1321        public class SaveAvatarPayload
 1322        {
 1323            public string face256;
 1324            public string body;
 1325            public bool isSignUpFlow;
 1326            public AvatarModel avatar;
 1327        }
 1328
 1329        public static class RendererAuthenticationType
 1330        {
 01331            public static string Guest => "guest";
 01332            public static string WalletConnect => "wallet_connect";
 1333        }
 1334
 1335        [System.Serializable]
 1336        public class SendAuthenticationPayload
 1337        {
 1338            public string rendererAuthenticationType;
 1339        }
 1340
 1341        [System.Serializable]
 1342        public class SendPassportPayload
 1343        {
 1344            public string name;
 1345            public string email;
 1346        }
 1347
 1348        [System.Serializable]
 1349        public class SendSaveUserUnverifiedNamePayload
 1350        {
 1351            public string newUnverifiedName;
 1352        }
 1353
 1354        [System.Serializable]
 1355        public class SendSaveUserDescriptionPayload
 1356        {
 1357            public string description;
 1358
 01359            public SendSaveUserDescriptionPayload(string description) { this.description = description; }
 1360        }
 1361
 1362        [System.Serializable]
 1363        public class SendRequestUserProfilePayload
 1364        {
 1365            public string value;
 1366        }
 1367
 1368        [Serializable]
 1369        public class SendVideoProgressEvent
 1370        {
 1371            public string componentId;
 1372            public int sceneNumber;
 1373            public string videoTextureId;
 1374            public int status;
 1375            public float currentOffset;
 1376            public float videoLength;
 1377        }
 1378
 21379        public static void RequestOwnProfileUpdate() { SendMessage("RequestOwnProfileUpdate"); }
 1380
 1381        public static void SendSaveAvatar(AvatarModel avatar, Texture2D face256Snapshot, Texture2D bodySnapshot, bool is
 1382        {
 11383            var payload = new SaveAvatarPayload()
 1384            {
 1385                avatar = avatar,
 1386                face256 = System.Convert.ToBase64String(face256Snapshot.EncodeToPNG()),
 1387                body = System.Convert.ToBase64String(bodySnapshot.EncodeToPNG()),
 1388                isSignUpFlow = isSignUpFlow
 1389            };
 11390            SendMessage("SaveUserAvatar", payload);
 11391        }
 1392
 01393        public static void SendAuthentication(string rendererAuthenticationType) { SendMessage("SendAuthentication", new
 1394
 21395        public static void SendPassport(string name, string email) { SendMessage("SendPassport", new SendPassportPayload
 1396
 1397        public static void SendSaveUserUnverifiedName(string newName)
 1398        {
 01399            var payload = new SendSaveUserUnverifiedNamePayload()
 1400            {
 1401                newUnverifiedName = newName
 1402            };
 1403
 01404            SendMessage("SaveUserUnverifiedName", payload);
 01405        }
 1406
 01407        public static void SendSaveUserDescription(string about) { SendMessage("SaveUserDescription", new SendSaveUserDe
 1408
 01409        public static void SendRequestUserProfile(string userId) { SendMessage("RequestUserProfile", new SendRequestUser
 1410
 21411        public static void SendUserAcceptedCollectibles(string airdropId) { SendMessage("UserAcceptedCollectibles", new 
 1412
 01413        public static void SaveUserTutorialStep(int newTutorialStep) { SendMessage("SaveUserTutorialStep", new TutorialS
 1414
 01415        public static void SendPerformanceReport(string performanceReportPayload) { SendJson("PerformanceReport", perfor
 1416
 01417        public static void SendSystemInfoReport() { SendMessage("SystemInfoReport", new SystemInfoReportPayload()); }
 1418
 1419        public static void SendTermsOfServiceResponse(int sceneNumber, bool accepted, bool dontShowAgain)
 1420        {
 21421            var payload = new TermsOfServiceResponsePayload()
 1422            {
 1423                sceneNumber = sceneNumber,
 1424                accepted = accepted,
 1425                dontShowAgain = dontShowAgain
 1426            };
 21427            SendMessage("TermsOfServiceResponse", payload);
 21428        }
 1429
 1430        public static void OpenURL(string url)
 1431        {
 1432#if UNITY_WEBGL
 31433            SendMessage("OpenWebURL", new OpenURLPayload { url = url });
 1434#else
 1435            Application.OpenURL(url);
 1436#endif
 31437        }
 1438
 01439        public static void PublishStatefulScene(ProtocolV2.PublishPayload payload) { MessageFromEngine("PublishSceneStat
 1440
 01441        public static void StartIsolatedMode(IsolatedConfig config) { MessageFromEngine("StartIsolatedMode", JsonConvert
 1442
 01443        public static void StopIsolatedMode(IsolatedConfig config) { MessageFromEngine("StopIsolatedMode", JsonConvert.S
 1444
 1445        public static void SendReportScene(int sceneNumber)
 1446        {
 11447            SendMessage("ReportScene", new SendReportScenePayload
 1448            {
 1449                sceneNumber = sceneNumber
 1450            });
 11451        }
 1452
 1453        public static void SetHomeScene(string sceneCoords)
 1454        {
 01455            SendMessage("SetHomeScene", new SetHomeScenePayload
 1456            {
 1457                sceneCoords = sceneCoords
 1458            });
 01459        }
 1460
 1461        public static void SendReportPlayer(string playerId, string playerName)
 1462        {
 11463            SendMessage("ReportPlayer", new SendReportPlayerPayload
 1464            {
 1465                userId = playerId,
 1466                name = playerName
 1467            });
 11468        }
 1469
 1470        public static void SendBlockPlayer(string userId)
 1471        {
 11472            SendMessage("BlockPlayer", new SendBlockPlayerPayload()
 1473            {
 1474                userId = userId
 1475            });
 11476        }
 1477
 1478        public static void SendUnblockPlayer(string userId)
 1479        {
 01480            SendMessage("UnblockPlayer", new SendUnblockPlayerPayload()
 1481            {
 1482                userId = userId
 1483            });
 01484        }
 1485
 1486        public static void RequestScenesInfoAroundParcel(Vector2 parcel, int maxScenesArea)
 1487        {
 51488            SendMessage("RequestScenesInfoInArea", new RequestScenesInfoAroundParcelPayload()
 1489            {
 1490                parcel = parcel,
 1491                scenesAround = maxScenesArea
 1492            });
 51493        }
 1494
 1495        public static void SendAudioStreamEvent(string url, bool play, float volume)
 1496        {
 201497            onAudioStreamingEvent.url = url;
 201498            onAudioStreamingEvent.play = play;
 201499            onAudioStreamingEvent.volume = volume;
 201500            SendMessage("SetAudioStream", onAudioStreamingEvent);
 201501        }
 1502
 21503        public static void JoinVoiceChat() { SendMessage("JoinVoiceChat"); }
 1504
 21505        public static void LeaveVoiceChat() { SendMessage("LeaveVoiceChat"); }
 1506
 1507        public static void SendSetVoiceChatRecording(bool recording)
 1508        {
 01509            setVoiceChatRecordingPayload.recording = recording;
 01510            SendMessage("SetVoiceChatRecording", setVoiceChatRecordingPayload);
 01511        }
 1512
 01513        public static void ToggleVoiceChatRecording() { SendMessage("ToggleVoiceChatRecording"); }
 1514
 1515        public static void ApplySettings(float voiceChatVolume, int voiceChatAllowCategory)
 1516        {
 61517            applySettingsPayload.voiceChatVolume = voiceChatVolume;
 61518            applySettingsPayload.voiceChatAllowCategory = voiceChatAllowCategory;
 61519            SendMessage("ApplySettings", applySettingsPayload);
 61520        }
 1521
 1522        public static void RequestGIFProcessor(string gifURL, string gifId, bool isWebGL1)
 1523        {
 01524            gifSetupPayload.imageSource = gifURL;
 01525            gifSetupPayload.id = gifId;
 01526            gifSetupPayload.isWebGL1 = isWebGL1;
 1527
 01528            SendMessage("RequestGIFProcessor", gifSetupPayload);
 01529        }
 1530
 1531        public static void DeleteGIF(string id)
 1532        {
 01533            stringPayload.value = id;
 01534            SendMessage("DeleteGIF", stringPayload);
 01535        }
 1536
 1537        public static void GoTo(int x, int y)
 1538        {
 01539            gotoEvent.x = x;
 01540            gotoEvent.y = y;
 01541            SendMessage("GoTo", gotoEvent);
 01542        }
 1543
 1544        public static void GoToCrowd()
 1545        {
 01546            SendMessage("GoToCrowd");
 01547        }
 1548
 1549        public static void GoToMagic()
 1550        {
 01551            SendMessage("GoToMagic");
 01552        }
 1553
 1554        public static void LoadingHUDReadyForTeleport(int x, int y)
 1555        {
 01556            gotoEvent.x = x;
 01557            gotoEvent.y = y;
 01558            SendMessage("LoadingHUDReadyForTeleport", gotoEvent);
 01559        }
 1560
 1561        public static void JumpIn(int x, int y, string serverName, string layerName)
 1562        {
 01563            jumpInPayload.realm.serverName = serverName;
 01564            jumpInPayload.realm.layer = layerName;
 1565
 01566            jumpInPayload.gridPosition.x = x;
 01567            jumpInPayload.gridPosition.y = y;
 1568
 01569            SendMessage("JumpIn", jumpInPayload);
 01570        }
 1571
 1572        public static void JumpInHome(string mostPopulatedRealm)
 1573        {
 01574            jumpInPayload.realm.serverName = mostPopulatedRealm;
 01575            SendMessage("JumpInHome", jumpInPayload);
 01576        }
 1577
 1578        public static void SendChatMessage(ChatMessage message)
 1579        {
 01580            sendChatMessageEvent.message = message;
 01581            SendMessage("SendChatMessage", sendChatMessageEvent);
 01582        }
 1583
 01584        public static void UpdateFriendshipStatus(FriendshipUpdateStatusMessage message) { SendMessage("UpdateFriendship
 1585
 01586        public static void ScenesLoadingFeedback(LoadingFeedbackMessage message) { SendMessage("ScenesLoadingFeedback", 
 1587
 01588        public static void FetchHotScenes() { SendMessage("FetchHotScenes"); }
 1589
 1590        public static void SetBaseResolution(int resolution)
 1591        {
 21592            baseResEvent.baseResolution = resolution;
 21593            SendMessage("SetBaseResolution", baseResEvent);
 21594        }
 1595
 01596        public static void ReportAnalyticsEvent(string eventName) { ReportAnalyticsEvent(eventName, null); }
 1597
 1598        public static void ReportAnalyticsEvent(string eventName, AnalyticsPayload.Property[] eventProperties)
 1599        {
 01600            analyticsEvent.name = eventName;
 01601            analyticsEvent.properties = eventProperties;
 01602            SendMessage("Track", analyticsEvent);
 01603        }
 1604
 41605        public static void FetchBalanceOfMANA() { SendMessage("FetchBalanceOfMANA"); }
 1606
 1607        public static void SendSceneExternalActionEvent(int sceneNumber, string type, string payload)
 1608        {
 01609            sceneExternalActionEvent.type = type;
 01610            sceneExternalActionEvent.payload = payload;
 01611            SendSceneEvent(sceneNumber, "externalAction", sceneExternalActionEvent);
 01612        }
 1613
 1614        public static void SetMuteUsers(string[] usersId, bool mute)
 1615        {
 41616            muteUserEvent.usersId = usersId;
 41617            muteUserEvent.mute = mute;
 41618            SendMessage("SetMuteUsers", muteUserEvent);
 41619        }
 1620
 1621        public static void SendCloseUserAvatar(bool isSignUpFlow)
 1622        {
 01623            closeUserAvatarPayload.isSignUpFlow = isSignUpFlow;
 01624            SendMessage("CloseUserAvatar", closeUserAvatarPayload);
 01625        }
 1626
 1627        // Warning: Use this method only for PEXs non-associated to smart wearables.
 1628        //          For PEX associated to smart wearables use 'SetDisabledPortableExperiences'.
 1629        public static void KillPortableExperience(string portableExperienceId)
 1630        {
 01631            killPortableExperiencePayload.portableExperienceId = portableExperienceId;
 01632            SendMessage("KillPortableExperience", killPortableExperiencePayload);
 01633        }
 1634
 1635        public static void RequestThirdPartyWearables(
 1636            string ownedByUser,
 1637            string thirdPartyCollectionId,
 1638            string context)
 1639        {
 11640            requestWearablesPayload.filters = new WearablesRequestFiltersPayload
 1641            {
 1642                ownedByUser = ownedByUser,
 1643                thirdPartyId = thirdPartyCollectionId,
 1644                collectionIds = null,
 1645                wearableIds = null
 1646            };
 1647
 11648            requestWearablesPayload.context = context;
 1649
 11650            SendMessage("RequestWearables", requestWearablesPayload);
 11651        }
 1652
 1653        public static void SetDisabledPortableExperiences(string[] idsToDisable)
 1654        {
 71655            setDisabledPortableExperiencesPayload.idsToDisable = idsToDisable;
 71656            SendMessage("SetDisabledPortableExperiences", setDisabledPortableExperiencesPayload);
 71657        }
 1658
 1659        public static void RequestWearables(
 1660            string ownedByUser,
 1661            string[] wearableIds,
 1662            string[] collectionIds,
 1663            string context)
 1664        {
 01665            requestWearablesPayload.filters = new WearablesRequestFiltersPayload
 1666            {
 1667                ownedByUser = ownedByUser,
 1668                wearableIds = wearableIds,
 1669                collectionIds = collectionIds,
 1670                thirdPartyId = null
 1671            };
 1672
 01673            requestWearablesPayload.context = context;
 1674
 01675            SendMessage("RequestWearables", requestWearablesPayload);
 01676        }
 1677
 1678        public static void RequestEmotes(
 1679            string ownedByUser,
 1680            string[] emoteIds,
 1681            string[] collectionIds,
 1682            string context)
 1683        {
 01684            requestEmotesPayload.filters = new EmotesRequestFiltersPayload()
 1685            {
 1686                ownedByUser = ownedByUser,
 1687                emoteIds = emoteIds,
 1688                collectionIds = collectionIds,
 1689                thirdPartyId = null
 1690            };
 1691
 01692            requestEmotesPayload.context = context;
 1693
 01694            SendMessage("RequestEmotes", requestEmotesPayload);
 01695        }
 1696
 1697        public static void SearchENSOwner(string name, int maxResults)
 1698        {
 61699            searchEnsOwnerPayload.name = name;
 61700            searchEnsOwnerPayload.maxResults = maxResults;
 1701
 61702            SendMessage("SearchENSOwner", searchEnsOwnerPayload);
 61703        }
 1704
 01705        public static void RequestHomeCoordinates() { SendMessage("RequestHomeCoordinates"); }
 1706
 1707        public static void RequestUserProfile(string userId)
 1708        {
 161709            stringPayload.value = userId;
 161710            SendMessage("RequestUserProfile", stringPayload);
 161711        }
 1712
 01713        public static void ReportAvatarFatalError(string payload) { SendJson("ReportAvatarFatalError", payload); }
 1714
 1715        public static void UnpublishScene(Vector2Int sceneCoordinates)
 1716        {
 01717            var payload = new UnpublishScenePayload() { coordinates = $"{sceneCoordinates.x},{sceneCoordinates.y}" };
 01718            SendMessage("UnpublishScene", payload);
 01719        }
 1720
 1721        public static void NotifyStatusThroughChat(string message)
 1722        {
 01723            stringPayload.value = message;
 01724            SendMessage("NotifyStatusThroughChat", stringPayload);
 01725        }
 1726
 1727        public static void ReportVideoProgressEvent(
 1728            string componentId,
 1729            int sceneNumber,
 1730            string videoClipId,
 1731            int videoStatus,
 1732            float currentOffset,
 1733            float length)
 1734        {
 451735            SendVideoProgressEvent progressEvent = new SendVideoProgressEvent()
 1736            {
 1737                componentId = componentId,
 1738                sceneNumber = sceneNumber,
 1739                videoTextureId = videoClipId,
 1740                status = videoStatus,
 1741                currentOffset = currentOffset,
 1742                videoLength = length
 1743            };
 1744
 451745            SendMessage("VideoProgressEvent", progressEvent);
 451746        }
 1747
 1748        public static void ReportAvatarRemoved(string avatarId)
 1749        {
 01750            avatarStatePayload.type = "Removed";
 01751            avatarStatePayload.avatarShapeId = avatarId;
 01752            SendMessage("ReportAvatarState", avatarStatePayload);
 01753        }
 1754
 1755        public static void ReportAvatarSceneChanged(string avatarId, int sceneNumber)
 1756        {
 01757            avatarSceneChangedPayload.type = "SceneChanged";
 01758            avatarSceneChangedPayload.avatarShapeId = avatarId;
 01759            avatarSceneChangedPayload.sceneNumber = sceneNumber;
 01760            SendMessage("ReportAvatarState", avatarSceneChangedPayload);
 01761        }
 1762
 1763        public static void ReportAvatarClick(int sceneNumber, string userId, Vector3 rayOrigin, Vector3 rayDirection, fl
 1764        {
 01765            avatarOnClickPayload.userId = userId;
 01766            avatarOnClickPayload.ray.origin = rayOrigin;
 01767            avatarOnClickPayload.ray.direction = rayDirection;
 01768            avatarOnClickPayload.ray.distance = distance;
 1769
 01770            SendSceneEvent(sceneNumber, "playerClicked", avatarOnClickPayload);
 01771        }
 1772
 1773        public static void ReportOnPointerHoverEnterEvent(int sceneNumber, string uuid)
 1774        {
 41775            onPointerHoverEnterEvent.uuid = uuid;
 41776            SendSceneEvent(sceneNumber, "uuidEvent", onPointerHoverEnterEvent);
 41777        }
 1778
 1779        public static void ReportOnPointerHoverExitEvent(int sceneNumber, string uuid)
 1780        {
 11781            onPointerHoverExitEvent.uuid = uuid;
 11782            SendSceneEvent(sceneNumber, "uuidEvent", onPointerHoverExitEvent);
 11783        }
 1784
 1785        public static void ReportTime(float time, bool isPaused, float timeNormalizationFactor, float cycleTime)
 1786        {
 61787            timeReportPayload.time = time;
 61788            timeReportPayload.isPaused = isPaused;
 61789            timeReportPayload.timeNormalizationFactor = timeNormalizationFactor;
 61790            timeReportPayload.cycleTime = cycleTime;
 61791            SendMessage("ReportDecentralandTime", timeReportPayload);
 61792        }
 1793
 1794        public static void GetFriendsWithDirectMessages(string userNameOrId, int limit, int skip)
 1795        {
 01796            getFriendsWithDirectMessagesPayload.userNameOrId = userNameOrId;
 01797            getFriendsWithDirectMessagesPayload.limit = limit;
 01798            getFriendsWithDirectMessagesPayload.skip = skip;
 01799            SendMessage("GetFriendsWithDirectMessages", getFriendsWithDirectMessagesPayload);
 01800        }
 1801
 1802        public static void MarkMessagesAsSeen(string userId)
 1803        {
 01804            markMessagesAsSeenPayload.userId = userId;
 01805            SendMessage("MarkMessagesAsSeen", markMessagesAsSeenPayload);
 01806        }
 1807
 1808        public static void GetPrivateMessages(string userId, int limit, string fromMessageId)
 1809        {
 01810            getPrivateMessagesPayload.userId = userId;
 01811            getPrivateMessagesPayload.limit = limit;
 01812            getPrivateMessagesPayload.fromMessageId = fromMessageId;
 01813            SendMessage("GetPrivateMessages", getPrivateMessagesPayload);
 01814        }
 1815
 1816        public static void MarkChannelMessagesAsSeen(string channelId)
 1817        {
 01818            markChannelMessagesAsSeenPayload.channelId = channelId;
 01819            SendMessage("MarkChannelMessagesAsSeen", markChannelMessagesAsSeenPayload);
 01820        }
 1821
 01822        public static void GetUnseenMessagesByUser() { SendMessage("GetUnseenMessagesByUser"); }
 1823
 1824        public static void GetUnseenMessagesByChannel()
 1825        {
 01826            SendMessage("GetUnseenMessagesByChannel");
 01827        }
 1828
 1829        public static void GetFriends(int limit, int skip)
 1830        {
 01831            SendMessage("GetFriends", new GetFriendsPayload
 1832            {
 1833                limit = limit,
 1834                skip = skip
 1835            });
 01836        }
 1837
 1838        public static void GetFriends(string usernameOrId, int limit)
 1839        {
 01840            SendMessage("GetFriends", new GetFriendsPayload
 1841            {
 1842                userNameOrId = usernameOrId,
 1843                limit = limit
 1844            });
 01845        }
 1846
 1847        public static void GetFriendRequests(int sentLimit, int sentSkip, int receivedLimit, int receivedSkip)
 1848        {
 01849            SendMessage("GetFriendRequests", new GetFriendRequestsPayload
 1850            {
 1851                receivedSkip = receivedSkip,
 1852                receivedLimit = receivedLimit,
 1853                sentSkip = sentSkip,
 1854                sentLimit = sentLimit
 1855            });
 01856        }
 1857
 1858        public static void LeaveChannel(string channelId)
 1859        {
 01860            SendMessage("LeaveChannel", new LeaveChannelPayload
 1861            {
 1862                channelId = channelId
 1863            });
 01864        }
 1865
 1866        public static void CreateChannel(string channelId)
 1867        {
 01868            SendMessage("CreateChannel", new CreateChannelPayload
 1869            {
 1870                channelId = channelId
 1871            });
 01872        }
 1873
 1874        public static void JoinOrCreateChannel(string channelId)
 1875        {
 01876            SendMessage("JoinOrCreateChannel", new JoinOrCreateChannelPayload
 1877            {
 1878                channelId = channelId
 1879            });
 01880        }
 1881
 1882        public static void GetChannelMessages(string channelId, int limit, string fromMessageId)
 1883        {
 01884            SendMessage("GetChannelMessages", new GetChannelMessagesPayload
 1885            {
 1886                channelId = channelId,
 1887                limit = limit,
 1888                from = fromMessageId
 1889            });
 01890        }
 1891
 1892        public static void GetJoinedChannels(int limit, int skip)
 1893        {
 01894            SendMessage("GetJoinedChannels", new GetJoinedChannelsPayload
 1895            {
 1896                limit = limit,
 1897                skip = skip
 1898            });
 01899        }
 1900
 1901        public static void GetChannels(int limit, string since, string name)
 1902        {
 01903            SendMessage("GetChannels", new GetChannelsPayload
 1904            {
 1905                limit = limit,
 1906                since = since,
 1907                name = name
 1908            });
 01909        }
 1910
 1911        public static void GetChannelInfo(string[] channelIds)
 1912        {
 01913            SendMessage("GetChannelInfo", new GetChannelInfoPayload
 1914            {
 1915                channelIds = channelIds
 1916            });
 01917        }
 1918
 1919        public static void GetChannelMembers(string channelId, int limit, int skip, string name)
 1920        {
 01921            SendMessage("GetChannelMembers", new GetChannelMembersPayload
 1922            {
 1923                channelId = channelId,
 1924                limit = limit,
 1925                skip = skip,
 1926                userName = name
 1927            });
 01928        }
 1929
 1930        public static void MuteChannel(string channelId, bool muted)
 1931        {
 01932            SendMessage("MuteChannel", new MuteChannelPayload
 1933            {
 1934                channelId = channelId,
 1935                muted = muted
 1936            });
 01937        }
 1938
 1939        public static void UpdateMemoryUsage()
 1940        {
 01941            SendMessage("UpdateMemoryUsage");
 01942        }
 1943
 01944        public static void RequestAudioDevices() => SendMessage("RequestAudioDevices");
 1945
 1946        public static void SetInputAudioDevice(string inputDeviceId)
 1947        {
 01948            SendMessage(nameof(SetInputAudioDevice), new SetInputAudioDevicePayload()
 1949            {
 1950                deviceId = inputDeviceId
 1951            });
 01952        }
 1953    }
 1954}

Methods/Properties

WebInterface()
SceneReady(System.Int32)
ActivateRenderingACK()
DeactivateRenderingACK()
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)
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)
ReportGlobalPointerDownEvent(DCL.Interface.WebInterface/ACTION_BUTTON, UnityEngine.Ray, UnityEngine.Vector3, UnityEngine.Vector3, System.Single, System.Int32, System.String, System.String, System.Boolean)
ReportGlobalPointerUpEvent(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)
SetDelightedSurveyEnabled(System.Boolean)
SetScenesLoadRadius(System.Single)
Guest()
WalletConnect()
SendSaveUserDescriptionPayload(System.String)
RequestOwnProfileUpdate()
SendSaveAvatar(AvatarModel, UnityEngine.Texture2D, UnityEngine.Texture2D, System.Boolean)
SendAuthentication(System.String)
SendPassport(System.String, System.String)
SendSaveUserUnverifiedName(System.String)
SendSaveUserDescription(System.String)
SendRequestUserProfile(System.String)
SendUserAcceptedCollectibles(System.String)
SaveUserTutorialStep(System.Int32)
SendPerformanceReport(System.String)
SendSystemInfoReport()
SendTermsOfServiceResponse(System.Int32, System.Boolean, System.Boolean)
OpenURL(System.String)
PublishStatefulScene(ProtocolV2/PublishPayload)
StartIsolatedMode(IsolatedConfig)
StopIsolatedMode(IsolatedConfig)
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)
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)
GetFriendRequests(System.Int32, System.Int32, System.Int32, 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)