< Summary

Class:DCL.Interface.WebInterface
Assembly:WebInterface
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/WebInterface/Interface.cs
Covered lines:254
Uncovered lines:107
Coverable lines:361
Total lines:1407
Line coverage:70.3% (254 of 361)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
WebInterface()0%110100%
StartStatefulMode(...)0%110100%
StopStatefulMode(...)0%110100%
SceneReady(...)0%110100%
ActivateRenderingACK()0%110100%
DeactivateRenderingACK()0%110100%
OnGlobalPointerEvent()0%2100%
StoreSceneStateEvent()0%110100%
OnTextInputChangeTextEventPayload()0%110100%
operator+(...)0%2100%
OnMetricsUpdate()0%110100%
TransformPayload()0%2100%
SystemInfoReportPayload()0%110100%
JumpInPayload()0%2100%
Property(...)0%110100%
HeadersPayload()0%110100%
StartDecentraland()0%2100%
CheckURLParam(...)0%2100%
MessageFromEngine(...)0%5.125083.33%
ProcessQueuedMessages()0%330100%
GetGraphicCard()0%2100%
SendMessage(...)0%110100%
SendMessage[T](...)0%2.032080%
SendSceneEvent[T](...)0%110100%
SendAllScenesEvent[T](...)0%110100%
ReportPosition(...)0%110100%
ReportCameraChanged(...)0%110100%
ReportIdleStateChanged(...)0%110100%
ReportControlEvent[T](...)0%110100%
SendRequestHeadersForUrl(...)0%6200%
BuilderInWorldMessage(...)0%110100%
ReportOnClickEvent(...)0%2.032080%
ReportRaycastResult[T, P](...)0%2100%
ReportRaycastHitFirstResult(...)0%2100%
ReportRaycastHitAllResult(...)0%2100%
CreateHitObject(...)0%110100%
SetPointerEventPayload(...)0%2.092071.43%
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%110100%
SetScenesLoadRadius(...)0%110100%
SendSaveUserDescriptionPayload(...)0%2100%
RequestOwnProfileUpdate()0%110100%
SendSaveAvatar(...)0%110100%
SendAuthentication(...)0%2100%
SendPassport(...)0%110100%
SendSaveUserUnverifiedName(...)0%2100%
SendSaveUserDescription(...)0%2100%
SendUserAcceptedCollectibles(...)0%110100%
SaveUserTutorialStep(...)0%110100%
SendPerformanceReport(...)0%2100%
SendSystemInfoReport()0%110100%
SendTermsOfServiceResponse(...)0%110100%
SendExpression(...)0%110100%
ReportMotdClicked()0%2100%
OpenURL(...)0%110100%
SendReportScene(...)0%2100%
SendReportPlayer(...)0%110100%
SendBlockPlayer(...)0%110100%
SendUnblockPlayer(...)0%2100%
RequestScenesInfoAroundParcel(...)0%2100%
SendAudioStreamEvent(...)0%110100%
SendSetVoiceChatRecording(...)0%2100%
ToggleVoiceChatRecording()0%2100%
ApplySettings(...)0%110100%
RequestGIFProcessor(...)0%2100%
DeleteGIF(...)0%2100%
GoTo(...)0%110100%
GoToCrowd()0%2100%
GoToMagic()0%2100%
JumpIn(...)0%110100%
SendChatMessage(...)0%110100%
UpdateFriendshipStatus(...)0%110100%
ScenesLoadingFeedback(...)0%2100%
FetchHotScenes()0%110100%
SetBaseResolution(...)0%110100%
ReportAnalyticsEvent(...)0%2100%
ReportAnalyticsEvent(...)0%110100%
FetchBalanceOfMANA()0%110100%
SendSceneExternalActionEvent(...)0%110100%
SetMuteUsers(...)0%2100%
SendCloseUserAvatar(...)0%2100%
KillPortableExperience(...)0%2100%
RequestWearables(...)0%110100%
SearchENSOwner(...)0%110100%
RequestUserProfile(...)0%110100%
ReportAvatarFatalError()0%110100%
UnpublishScene(...)0%110100%
NotifyStatusThroughChat(...)0%2100%
ReportVideoProgressEvent(...)0%110100%

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.Helpers;
 4using DCL.Models;
 5using UnityEngine;
 6using Ray = UnityEngine.Ray;
 7
 8#if UNITY_WEBGL && !UNITY_EDITOR
 9using System.Runtime.InteropServices;
 10#endif
 11
 12namespace DCL.Interface
 13{
 14    /**
 15     * This class contains the outgoing interface of Decentraland.
 16     * You must call those functions to interact with the WebInterface.
 17     *
 18     * The messages comming from the WebInterface instead, are reported directly to
 19     * the handler GameObject by name.
 20     */
 21    public static class WebInterface
 22    {
 123        public static bool VERBOSE = false;
 24        public static System.Action<string, string> OnMessageFromEngine;
 25
 26        [System.Serializable]
 27        private class ReportPositionPayload
 28        {
 29            /** Camera position, world space */
 30            public Vector3 position;
 31
 32            /** Camera rotation */
 33            public Quaternion rotation;
 34
 35            /** Camera height, relative to the feet of the avatar or ground */
 36            public float playerHeight;
 37
 38            public Vector3 mousePosition;
 39
 40            public string id;
 41        }
 42
 43        [System.Serializable]
 44        public abstract class ControlEvent
 45        {
 46            public string eventType;
 47        }
 48
 49        public abstract class ControlEvent<T> : ControlEvent
 50        {
 51            public T payload;
 52
 53            protected ControlEvent(string eventType, T payload)
 54            {
 55                this.eventType = eventType;
 56                this.payload = payload;
 57            }
 58        }
 59
 60        [System.Serializable]
 61        public class StartStatefulMode : ControlEvent<StartStatefulMode.Payload>
 62        {
 63            [System.Serializable]
 64            public class Payload
 65            {
 66                public string sceneId;
 67            }
 68
 469            public StartStatefulMode(string sceneId) : base("StartStatefulMode", new Payload() { sceneId = sceneId }) { 
 70        }
 71
 72        [System.Serializable]
 73        public class StopStatefulMode : ControlEvent<StopStatefulMode.Payload>
 74        {
 75            [System.Serializable]
 76            public class Payload
 77            {
 78                public string sceneId;
 79            }
 80
 481            public StopStatefulMode(string sceneId) : base("StopStatefulMode", new Payload() { sceneId = sceneId }) { }
 82        }
 83
 84        [System.Serializable]
 85        public class SceneReady : ControlEvent<SceneReady.Payload>
 86        {
 87            [System.Serializable]
 88            public class Payload
 89            {
 90                public string sceneId;
 91            }
 92
 137893            public SceneReady(string sceneId) : base("SceneReady", new Payload() { sceneId = sceneId }) { }
 94        }
 95
 96        [System.Serializable]
 97        public class ActivateRenderingACK : ControlEvent<object>
 98        {
 299            public ActivateRenderingACK() : base("ActivateRenderingACK", null) { }
 100        }
 101
 102        [System.Serializable]
 103        public class DeactivateRenderingACK : ControlEvent<object>
 104        {
 2105            public DeactivateRenderingACK() : base("DeactivateRenderingACK", null) { }
 106        }
 107
 108        [System.Serializable]
 109        public class SceneEvent<T>
 110        {
 111            public string sceneId;
 112            public string eventType;
 113            public T payload;
 114        }
 115
 116        [System.Serializable]
 117        public class AllScenesEvent<T>
 118        {
 119            public string eventType;
 120            public T payload;
 121        }
 122
 123        [System.Serializable]
 124        public class UUIDEvent<TPayload>
 125            where TPayload : class, new()
 126        {
 127            public string uuid;
 128            public TPayload payload = new TPayload();
 129        }
 130
 131        public enum ACTION_BUTTON
 132        {
 133            POINTER,
 134            PRIMARY,
 135            SECONDARY,
 136            ANY,
 137            FORWARD,
 138            BACKWARD,
 139            RIGHT,
 140            LEFT,
 141            JUMP,
 142            WALK,
 143            ACTION_3,
 144            ACTION_4,
 145            ACTION_5,
 146            ACTION_6
 147        }
 148
 149        [System.Serializable]
 150        public class OnClickEvent : UUIDEvent<OnClickEventPayload>
 151        {
 152        };
 153
 154        [System.Serializable]
 155        public class CameraModePayload
 156        {
 157            public CameraMode.ModeId cameraMode;
 158        };
 159
 160        [System.Serializable]
 161        public class IdleStateChangedPayload
 162        {
 163            public bool isIdle;
 164        };
 165
 166        [System.Serializable]
 167        public class OnPointerDownEvent : UUIDEvent<OnPointerEventPayload>
 168        {
 169        };
 170
 171        [System.Serializable]
 172        public class OnGlobalPointerEvent
 173        {
 0174            public OnGlobalPointerEventPayload payload = new OnGlobalPointerEventPayload();
 175        };
 176
 177        [System.Serializable]
 178        public class OnPointerUpEvent : UUIDEvent<OnPointerEventPayload>
 179        {
 180        };
 181
 182        [System.Serializable]
 183        private class OnTextSubmitEvent : UUIDEvent<OnTextSubmitEventPayload>
 184        {
 185        };
 186
 187        [System.Serializable]
 188        private class OnTextInputChangeEvent : UUIDEvent<OnTextInputChangeEventPayload>
 189        {
 190        };
 191
 192        [System.Serializable]
 193        private class OnTextInputChangeTextEvent : UUIDEvent<OnTextInputChangeTextEventPayload> { };
 194
 195        [System.Serializable]
 196        private class OnScrollChangeEvent : UUIDEvent<OnScrollChangeEventPayload>
 197        {
 198        };
 199
 200        [System.Serializable]
 201        private class OnFocusEvent : UUIDEvent<EmptyPayload>
 202        {
 203        };
 204
 205        [System.Serializable]
 206        private class OnBlurEvent : UUIDEvent<EmptyPayload>
 207        {
 208        };
 209
 210        [System.Serializable]
 211        public class OnEnterEvent : UUIDEvent<OnEnterEventPayload>
 212        {
 213        };
 214
 215        [System.Serializable]
 216        public class OnClickEventPayload
 217        {
 218            public ACTION_BUTTON buttonId = ACTION_BUTTON.POINTER;
 219        }
 220
 221        [System.Serializable]
 222        public class SendChatMessageEvent
 223        {
 224            public ChatMessage message;
 225        }
 226
 227        [System.Serializable]
 228        public class RemoveEntityComponentsPayLoad
 229        {
 230            public string entityId;
 231            public string componentId;
 232        };
 233
 234        [System.Serializable]
 235        public class StoreSceneStateEvent
 236        {
 1237            public string type = "StoreSceneState";
 1238            public string payload = "";
 239        };
 240
 241        [System.Serializable]
 242        public class OnPointerEventPayload
 243        {
 244            [System.Serializable]
 245            public class Hit
 246            {
 247                public Vector3 origin;
 248                public float length;
 249                public Vector3 hitPoint;
 250                public Vector3 normal;
 251                public Vector3 worldNormal;
 252                public string meshName;
 253                public string entityId;
 254            }
 255
 256            public ACTION_BUTTON buttonId;
 257            public Vector3 origin;
 258            public Vector3 direction;
 259            public Hit hit;
 260        }
 261
 262        [System.Serializable]
 263        public class OnGlobalPointerEventPayload : OnPointerEventPayload
 264        {
 265            public enum InputEventType
 266            {
 267                DOWN,
 268                UP
 269            }
 270
 271            public InputEventType type;
 272        }
 273
 274        [System.Serializable]
 275        public class OnTextSubmitEventPayload
 276        {
 277            public string id;
 278            public string text;
 279        }
 280
 281        [System.Serializable]
 282        public class OnTextInputChangeEventPayload
 283        {
 284            public string value;
 285        }
 286
 287        [System.Serializable]
 288        public class OnTextInputChangeTextEventPayload
 289        {
 290            [System.Serializable]
 291            public class Payload
 292            {
 293                public string value;
 294                public bool isSubmit;
 295            }
 2296            public Payload value = new Payload();
 297        }
 298
 299        [System.Serializable]
 300        public class OnScrollChangeEventPayload
 301        {
 302            public Vector2 value;
 303            public int pointerId;
 304        }
 305
 306        [System.Serializable]
 307        public class EmptyPayload
 308        {
 309        }
 310
 311        [System.Serializable]
 312        public class MetricsModel
 313        {
 314            public int meshes;
 315            public int bodies;
 316            public int materials;
 317            public int textures;
 318            public int triangles;
 319            public int entities;
 320
 321            public static MetricsModel operator + (MetricsModel lhs, MetricsModel rhs)
 322            {
 0323                return new MetricsModel()
 324                {
 325                    meshes = lhs.meshes + rhs.meshes,
 326                    bodies = lhs.bodies + rhs.bodies,
 327                    materials = lhs.materials + rhs.materials,
 328                    textures = lhs.textures + rhs.textures,
 329                    triangles = lhs.triangles + rhs.triangles,
 330                    entities = lhs.entities + rhs.entities
 331                };
 332            }
 333        }
 334
 335        [System.Serializable]
 336        private class OnMetricsUpdate
 337        {
 1338            public MetricsModel given = new MetricsModel();
 1339            public MetricsModel limit = new MetricsModel();
 340        }
 341
 342        [System.Serializable]
 343        public class OnEnterEventPayload
 344        {
 345        }
 346
 347        [System.Serializable]
 348        public class TransformPayload
 349        {
 0350            public Vector3 position = Vector3.zero;
 0351            public Quaternion rotation = Quaternion.identity;
 0352            public Vector3 scale = Vector3.one;
 353        }
 354
 355        public class OnSendScreenshot
 356        {
 357            public string id;
 358            public string encodedTexture;
 359        };
 360
 361        [System.Serializable]
 362        public class GotoEvent
 363        {
 364            public int x;
 365            public int y;
 366        };
 367
 368        [System.Serializable]
 369        public class BaseResolution
 370        {
 371            public int baseResolution;
 372        };
 373
 374        //-----------------------------------------------------
 375        // Raycast
 376        [System.Serializable]
 377        public class RayInfo
 378        {
 379            public Vector3 origin;
 380            public Vector3 direction;
 381            public float distance;
 382        }
 383
 384        [System.Serializable]
 385        public class RaycastHitInfo
 386        {
 387            public bool didHit;
 388            public RayInfo ray;
 389
 390            public Vector3 hitPoint;
 391            public Vector3 hitNormal;
 392        }
 393
 394        [System.Serializable]
 395        public class HitEntityInfo
 396        {
 397            public string entityId;
 398            public string meshName;
 399        }
 400
 401        [System.Serializable]
 402        public class RaycastHitEntity : RaycastHitInfo
 403        {
 404            public HitEntityInfo entity;
 405        }
 406
 407        [System.Serializable]
 408        public class RaycastHitEntities : RaycastHitInfo
 409        {
 410            public RaycastHitEntity[] entities;
 411        }
 412
 413        [System.Serializable]
 414        public class RaycastResponse<T> where T : RaycastHitInfo
 415        {
 416            public string queryId;
 417            public string queryType;
 418            public T payload;
 419        }
 420
 421        // Note (Zak): We need to explicitly define this classes for the JsonUtility to
 422        // be able to serialize them
 423        [System.Serializable]
 424        public class RaycastHitFirstResponse : RaycastResponse<RaycastHitEntity>
 425        {
 426        }
 427
 428        [System.Serializable]
 429        public class RaycastHitAllResponse : RaycastResponse<RaycastHitEntities>
 430        {
 431        }
 432
 433        [System.Serializable]
 434        public class SendExpressionPayload
 435        {
 436            public string id;
 437            public long timestamp;
 438        }
 439
 440        [System.Serializable]
 441        public class UserAcceptedCollectiblesPayload
 442        {
 443            public string id;
 444        }
 445
 446        [System.Serializable]
 447        public class SendBlockPlayerPayload
 448        {
 449            public string userId;
 450        }
 451
 452        [System.Serializable]
 453        public class SendUnblockPlayerPayload
 454        {
 455            public string userId;
 456        }
 457
 458        [System.Serializable]
 459        public class TutorialStepPayload
 460        {
 461            public int tutorialStep;
 462        }
 463
 464        [System.Serializable]
 465        public class PerformanceReportPayload
 466        {
 467            public string samples;
 468            public bool fpsIsCapped;
 469            public int hiccupsInThousandFrames;
 470            public float hiccupsTime;
 471            public float totalTime;
 472        }
 473
 474        [System.Serializable]
 475        public class SystemInfoReportPayload
 476        {
 125477            public string graphicsDeviceName = SystemInfo.graphicsDeviceName;
 125478            public string graphicsDeviceVersion = SystemInfo.graphicsDeviceVersion;
 125479            public int graphicsMemorySize = SystemInfo.graphicsMemorySize;
 125480            public string processorType = SystemInfo.processorType;
 125481            public int processorCount = SystemInfo.processorCount;
 125482            public int systemMemorySize = SystemInfo.systemMemorySize;
 483        }
 484
 485        [System.Serializable]
 486        public class GenericAnalyticPayload
 487        {
 488            public string eventName;
 489            public Dictionary<object, object> data;
 490        }
 491
 492        [System.Serializable]
 493        public class PerformanceHiccupPayload
 494        {
 495            public int hiccupsInThousandFrames;
 496            public float hiccupsTime;
 497            public float totalTime;
 498        }
 499
 500        [System.Serializable]
 501        public class TermsOfServiceResponsePayload
 502        {
 503            public string sceneId;
 504            public bool dontShowAgain;
 505            public bool accepted;
 506        }
 507
 508        [System.Serializable]
 509        public class OpenURLPayload
 510        {
 511            public string url;
 512        }
 513
 514        [System.Serializable]
 515        public class GIFSetupPayload
 516        {
 517            public string imageSource;
 518            public string id;
 519            public bool isWebGL1;
 520        }
 521
 522        [System.Serializable]
 523        public class RequestScenesInfoAroundParcelPayload
 524        {
 525            public Vector2 parcel;
 526            public int scenesAround;
 527        }
 528
 529        [System.Serializable]
 530        public class AudioStreamingPayload
 531        {
 532            public string url;
 533            public bool play;
 534            public float volume;
 535        }
 536
 537        [System.Serializable]
 538        public class SetScenesLoadRadiusPayload
 539        {
 540            public float newRadius;
 541        }
 542
 543        [System.Serializable]
 544        public class SetVoiceChatRecordingPayload
 545        {
 546            public bool recording;
 547        }
 548
 549        [System.Serializable]
 550        public class ApplySettingsPayload
 551        {
 552            public float voiceChatVolume;
 553            public int voiceChatAllowCategory;
 554        }
 555
 556        [System.Serializable]
 557        public class JumpInPayload
 558        {
 0559            public FriendsController.UserStatus.Realm realm = new FriendsController.UserStatus.Realm();
 560            public Vector2 gridPosition;
 561        }
 562
 563        [System.Serializable]
 564        public class LoadingFeedbackMessage
 565        {
 566            public string message;
 567            public int loadPercentage;
 568        }
 569
 570        [System.Serializable]
 571        public class AnalyticsPayload
 572        {
 573            [System.Serializable]
 574            public class Property
 575            {
 576                public string key;
 577                public string value;
 578
 105579                public Property(string key, string value)
 580                {
 105581                    this.key = key;
 105582                    this.value = value;
 105583                }
 584            }
 585
 586            public string name;
 587            public Property[] properties;
 588        }
 589
 590        [System.Serializable]
 591        public class DelightedSurveyEnabledPayload
 592        {
 593            public bool enabled;
 594        }
 595
 596        [System.Serializable]
 597        public class ExternalActionSceneEventPayload
 598        {
 599            public string type;
 600            public string payload;
 601        }
 602
 603        [System.Serializable]
 604        public class MuteUserPayload
 605        {
 606            public string[] usersId;
 607            public bool mute;
 608        }
 609
 610        [System.Serializable]
 611        public class CloseUserAvatarPayload
 612        {
 613            public bool isSignUpFlow;
 614        }
 615
 616        [System.Serializable]
 617        public class StringPayload
 618        {
 619            public string value;
 620        }
 621
 622        [System.Serializable]
 623        public class KillPortableExperiencePayload
 624        {
 625            public string portableExperienceId;
 626        }
 627
 628        [System.Serializable]
 629        public class WearablesRequestFiltersPayload
 630        {
 631            public string ownedByUser;
 632            public string[] wearableIds;
 633            public string[] collectionIds;
 634        }
 635
 636        [System.Serializable]
 637        public class RequestWearablesPayload
 638        {
 639            public WearablesRequestFiltersPayload filters;
 640            public string context;
 641        }
 642
 643        [System.Serializable]
 644        public class HeadersPayload
 645        {
 646            public string method;
 647            public string url;
 1648            public Dictionary<string, object> metadata = new Dictionary<string, object>();
 649        }
 650
 651        [System.Serializable]
 652        public class SearchENSOwnerPayload
 653        {
 654            public string name;
 655            public int maxResults;
 656        }
 657
 658        [System.Serializable]
 659        public class UnpublishScenePayload
 660        {
 661            public string coordinates;
 662        }
 663
 664#if UNITY_WEBGL && !UNITY_EDITOR
 665    /**
 666     * This method is called after the first render. It marks the loading of the
 667     * rest of the JS client.
 668     */
 669    [DllImport("__Internal")] public static extern void StartDecentraland();
 670    [DllImport("__Internal")] public static extern void MessageFromEngine(string type, string message);
 671    [DllImport("__Internal")] public static extern string GetGraphicCard();
 672    [DllImport("__Internal")] public static extern bool CheckURLParam(string targetParam);
 673#else
 1674        private static bool hasQueuedMessages = false;
 1675        private static List<(string, string)> queuedMessages = new List<(string, string)>();
 0676        public static void StartDecentraland() { }
 0677        public static bool CheckURLParam(string targetParam) { return false; }
 678
 679        public static void MessageFromEngine(string type, string message)
 680        {
 5036681            if (OnMessageFromEngine != null)
 682            {
 2551683                if (hasQueuedMessages)
 684                {
 32685                    ProcessQueuedMessages();
 686                }
 687
 2551688                OnMessageFromEngine.Invoke(type, message);
 2551689                if (VERBOSE)
 690                {
 0691                    Debug.Log("MessageFromEngine called with: " + type + ", " + message);
 692                }
 0693            }
 694            else
 695            {
 2485696                lock (queuedMessages)
 697                {
 2485698                    queuedMessages.Add((type, message));
 2485699                }
 700
 2485701                hasQueuedMessages = true;
 702            }
 5036703        }
 704
 705        private static void ProcessQueuedMessages()
 706        {
 32707            hasQueuedMessages = false;
 32708            lock (queuedMessages)
 709            {
 5030710                foreach ((string type, string payload) in queuedMessages)
 711                {
 2483712                    MessageFromEngine(type, payload);
 713                }
 714
 32715                queuedMessages.Clear();
 32716            }
 32717        }
 718
 0719        public static string GetGraphicCard() => "In Editor Graphic Card";
 720#endif
 721
 722        public static void SendMessage(string type)
 723        {
 724            // sending an empty JSON object to be compatible with other messages
 12725            MessageFromEngine(type, "{}");
 12726        }
 727
 728        public static void SendMessage<T>(string type, T message)
 729        {
 2515730            string messageJson = JsonUtility.ToJson(message);
 731
 2515732            if (VERBOSE)
 733            {
 0734                Debug.Log($"Sending message: " + messageJson);
 735            }
 736
 2515737            MessageFromEngine(type, messageJson);
 2515738        }
 739
 1740        private static ReportPositionPayload positionPayload = new ReportPositionPayload();
 1741        private static CameraModePayload cameraModePayload = new CameraModePayload();
 1742        private static IdleStateChangedPayload idleStateChangedPayload = new IdleStateChangedPayload();
 1743        private static OnMetricsUpdate onMetricsUpdate = new OnMetricsUpdate();
 1744        private static OnClickEvent onClickEvent = new OnClickEvent();
 1745        private static OnPointerDownEvent onPointerDownEvent = new OnPointerDownEvent();
 1746        private static OnPointerUpEvent onPointerUpEvent = new OnPointerUpEvent();
 1747        private static OnTextSubmitEvent onTextSubmitEvent = new OnTextSubmitEvent();
 1748        private static OnTextInputChangeEvent onTextInputChangeEvent = new OnTextInputChangeEvent();
 1749        private static OnTextInputChangeTextEvent onTextInputChangeTextEvent = new OnTextInputChangeTextEvent();
 1750        private static OnScrollChangeEvent onScrollChangeEvent = new OnScrollChangeEvent();
 1751        private static OnFocusEvent onFocusEvent = new OnFocusEvent();
 1752        private static OnBlurEvent onBlurEvent = new OnBlurEvent();
 1753        private static OnEnterEvent onEnterEvent = new OnEnterEvent();
 1754        private static OnSendScreenshot onSendScreenshot = new OnSendScreenshot();
 1755        private static OnPointerEventPayload onPointerEventPayload = new OnPointerEventPayload();
 1756        private static OnGlobalPointerEventPayload onGlobalPointerEventPayload = new OnGlobalPointerEventPayload();
 1757        private static OnGlobalPointerEvent onGlobalPointerEvent = new OnGlobalPointerEvent();
 1758        private static AudioStreamingPayload onAudioStreamingEvent = new AudioStreamingPayload();
 1759        private static SetVoiceChatRecordingPayload setVoiceChatRecordingPayload = new SetVoiceChatRecordingPayload();
 1760        private static SetScenesLoadRadiusPayload setScenesLoadRadiusPayload = new SetScenesLoadRadiusPayload();
 1761        private static ApplySettingsPayload applySettingsPayload = new ApplySettingsPayload();
 1762        private static GIFSetupPayload gifSetupPayload = new GIFSetupPayload();
 1763        private static JumpInPayload jumpInPayload = new JumpInPayload();
 1764        private static GotoEvent gotoEvent = new GotoEvent();
 1765        private static SendChatMessageEvent sendChatMessageEvent = new SendChatMessageEvent();
 1766        private static BaseResolution baseResEvent = new BaseResolution();
 1767        private static AnalyticsPayload analyticsEvent = new AnalyticsPayload();
 1768        private static DelightedSurveyEnabledPayload delightedSurveyEnabled = new DelightedSurveyEnabledPayload();
 1769        private static ExternalActionSceneEventPayload sceneExternalActionEvent = new ExternalActionSceneEventPayload();
 1770        private static MuteUserPayload muteUserEvent = new MuteUserPayload();
 1771        private static StoreSceneStateEvent storeSceneState = new StoreSceneStateEvent();
 1772        private static CloseUserAvatarPayload closeUserAvatarPayload = new CloseUserAvatarPayload();
 1773        private static StringPayload stringPayload = new StringPayload();
 1774        private static KillPortableExperiencePayload killPortableExperiencePayload = new KillPortableExperiencePayload()
 1775        private static RequestWearablesPayload requestWearablesPayload = new RequestWearablesPayload();
 1776        private static SearchENSOwnerPayload searchEnsOwnerPayload = new SearchENSOwnerPayload();
 1777        private static HeadersPayload headersPayload = new HeadersPayload();
 778
 779        public static void SendSceneEvent<T>(string sceneId, string eventType, T payload)
 780        {
 279781            SceneEvent<T> sceneEvent = new SceneEvent<T>();
 279782            sceneEvent.sceneId = sceneId;
 279783            sceneEvent.eventType = eventType;
 279784            sceneEvent.payload = payload;
 785
 279786            SendMessage("SceneEvent", sceneEvent);
 279787        }
 788
 789        private static void SendAllScenesEvent<T>(string eventType, T payload)
 790        {
 627791            AllScenesEvent<T> allScenesEvent = new AllScenesEvent<T>();
 627792            allScenesEvent.eventType = eventType;
 627793            allScenesEvent.payload = payload;
 794
 627795            SendMessage("AllScenesEvent", allScenesEvent);
 627796        }
 797
 798        public static void ReportPosition(Vector3 position, Quaternion rotation, float playerHeight)
 799        {
 557800            positionPayload.position = position;
 557801            positionPayload.rotation = rotation;
 557802            positionPayload.playerHeight = playerHeight;
 803
 557804            SendMessage("ReportPosition", positionPayload);
 557805        }
 806
 807        public static void ReportCameraChanged(CameraMode.ModeId cameraMode)
 808        {
 150809            cameraModePayload.cameraMode = cameraMode;
 150810            SendAllScenesEvent("cameraModeChanged", cameraModePayload);
 150811        }
 812
 813        public static void ReportIdleStateChanged(bool isIdle)
 814        {
 477815            idleStateChangedPayload.isIdle = isIdle;
 477816            SendAllScenesEvent("idleStateChanged", idleStateChangedPayload);
 477817        }
 818
 1390819        public static void ReportControlEvent<T>(T controlEvent) where T : ControlEvent { SendMessage("ControlEvent", co
 820
 821        public static void SendRequestHeadersForUrl(string eventName, string method, string url, Dictionary<string, obje
 822        {
 0823            headersPayload.method = method;
 0824            headersPayload.url = url;
 0825            if(metadata != null)
 0826                headersPayload.metadata = metadata;
 0827            SendMessage(eventName, headersPayload );
 0828        }
 829
 52830        public static void BuilderInWorldMessage(string type, string message) { MessageFromEngine(type, message); }
 831
 832        public static void ReportOnClickEvent(string sceneId, string uuid)
 833        {
 6834            if (string.IsNullOrEmpty(uuid))
 835            {
 0836                return;
 837            }
 838
 6839            onClickEvent.uuid = uuid;
 840
 6841            SendSceneEvent(sceneId, "uuidEvent", onClickEvent);
 6842        }
 843
 844        private static void ReportRaycastResult<T, P>(string sceneId, string queryId, string queryType, P payload) where
 845        {
 0846            T response = new T();
 0847            response.queryId = queryId;
 0848            response.queryType = queryType;
 0849            response.payload = payload;
 850
 0851            SendSceneEvent<T>(sceneId, "raycastResponse", response);
 0852        }
 853
 0854        public static void ReportRaycastHitFirstResult(string sceneId, string queryId, RaycastType raycastType, RaycastH
 855
 0856        public static void ReportRaycastHitAllResult(string sceneId, string queryId, RaycastType raycastType, RaycastHit
 857
 858        private static OnPointerEventPayload.Hit CreateHitObject(string entityId, string meshName, Vector3 point, Vector
 859        {
 20860            OnPointerEventPayload.Hit hit = new OnPointerEventPayload.Hit();
 861
 20862            hit.hitPoint = point;
 20863            hit.length = distance;
 20864            hit.normal = normal;
 20865            hit.worldNormal = normal;
 20866            hit.meshName = meshName;
 20867            hit.entityId = entityId;
 868
 20869            return hit;
 870        }
 871
 872        private static void SetPointerEventPayload(OnPointerEventPayload pointerEventPayload, ACTION_BUTTON buttonId, st
 873        {
 20874            pointerEventPayload.origin = ray.origin;
 20875            pointerEventPayload.direction = ray.direction;
 20876            pointerEventPayload.buttonId = buttonId;
 877
 20878            if (isHitInfoValid)
 20879                pointerEventPayload.hit = CreateHitObject(entityId, meshName, point, normal, distance);
 880            else
 0881                pointerEventPayload.hit = null;
 0882        }
 883
 884        public static void ReportGlobalPointerDownEvent(ACTION_BUTTON buttonId, Ray ray, Vector3 point, Vector3 normal, 
 885        {
 11886            SetPointerEventPayload((OnPointerEventPayload) onGlobalPointerEventPayload, buttonId, entityId, meshName, ra
 11887            onGlobalPointerEventPayload.type = OnGlobalPointerEventPayload.InputEventType.DOWN;
 888
 11889            onGlobalPointerEvent.payload = onGlobalPointerEventPayload;
 890
 11891            SendSceneEvent(sceneId, "actionButtonEvent", onGlobalPointerEvent);
 11892        }
 893
 894        public static void ReportGlobalPointerUpEvent(ACTION_BUTTON buttonId, Ray ray, Vector3 point, Vector3 normal, fl
 895        {
 3896            SetPointerEventPayload((OnPointerEventPayload) onGlobalPointerEventPayload, buttonId, entityId, meshName, ra
 3897            onGlobalPointerEventPayload.type = OnGlobalPointerEventPayload.InputEventType.UP;
 898
 3899            onGlobalPointerEvent.payload = onGlobalPointerEventPayload;
 900
 3901            SendSceneEvent(sceneId, "actionButtonEvent", onGlobalPointerEvent);
 3902        }
 903
 904        public static void ReportOnPointerDownEvent(ACTION_BUTTON buttonId, string sceneId, string uuid, string entityId
 905        {
 4906            if (string.IsNullOrEmpty(uuid))
 907            {
 0908                return;
 909            }
 910
 4911            onPointerDownEvent.uuid = uuid;
 4912            SetPointerEventPayload(onPointerEventPayload, buttonId, entityId, meshName, ray, point, normal, distance, is
 4913            onPointerDownEvent.payload = onPointerEventPayload;
 914
 4915            SendSceneEvent(sceneId, "uuidEvent", onPointerDownEvent);
 4916        }
 917
 918        public static void ReportOnPointerUpEvent(ACTION_BUTTON buttonId, string sceneId, string uuid, string entityId, 
 919        {
 2920            if (string.IsNullOrEmpty(uuid))
 921            {
 0922                return;
 923            }
 924
 2925            onPointerUpEvent.uuid = uuid;
 2926            SetPointerEventPayload(onPointerEventPayload, buttonId, entityId, meshName, ray, point, normal, distance, is
 2927            onPointerUpEvent.payload = onPointerEventPayload;
 928
 2929            SendSceneEvent(sceneId, "uuidEvent", onPointerUpEvent);
 2930        }
 931
 932        public static void ReportOnTextSubmitEvent(string sceneId, string uuid, string text)
 933        {
 2934            if (string.IsNullOrEmpty(uuid))
 935            {
 0936                return;
 937            }
 938
 2939            onTextSubmitEvent.uuid = uuid;
 2940            onTextSubmitEvent.payload.text = text;
 941
 2942            SendSceneEvent(sceneId, "uuidEvent", onTextSubmitEvent);
 2943        }
 944
 945        public static void ReportOnTextInputChangedEvent(string sceneId, string uuid, string text)
 946        {
 16947            if (string.IsNullOrEmpty(uuid))
 948            {
 16949                return;
 950            }
 951
 0952            onTextInputChangeEvent.uuid = uuid;
 0953            onTextInputChangeEvent.payload.value = text;
 954
 0955            SendSceneEvent(sceneId, "uuidEvent", onTextInputChangeEvent);
 0956        }
 957
 958        public static void ReportOnTextInputChangedTextEvent(string sceneId, string uuid, string text, bool isSubmit)
 959        {
 18960            if (string.IsNullOrEmpty(uuid))
 961            {
 15962                return;
 963            }
 964
 3965            onTextInputChangeTextEvent.uuid = uuid;
 3966            onTextInputChangeTextEvent.payload.value.value = text;
 3967            onTextInputChangeTextEvent.payload.value.isSubmit = isSubmit;
 968
 3969            SendSceneEvent(sceneId, "uuidEvent", onTextInputChangeTextEvent);
 3970        }
 971
 972        public static void ReportOnFocusEvent(string sceneId, string uuid)
 973        {
 2974            if (string.IsNullOrEmpty(uuid))
 975            {
 2976                return;
 977            }
 978
 0979            onFocusEvent.uuid = uuid;
 0980            SendSceneEvent(sceneId, "uuidEvent", onFocusEvent);
 0981        }
 982
 983        public static void ReportOnBlurEvent(string sceneId, string uuid)
 984        {
 1985            if (string.IsNullOrEmpty(uuid))
 986            {
 1987                return;
 988            }
 989
 0990            onBlurEvent.uuid = uuid;
 0991            SendSceneEvent(sceneId, "uuidEvent", onBlurEvent);
 0992        }
 993
 994        public static void ReportOnScrollChange(string sceneId, string uuid, Vector2 value, int pointerId)
 995        {
 15996            if (string.IsNullOrEmpty(uuid))
 997            {
 13998                return;
 999            }
 1000
 21001            onScrollChangeEvent.uuid = uuid;
 21002            onScrollChangeEvent.payload.value = value;
 21003            onScrollChangeEvent.payload.pointerId = pointerId;
 1004
 21005            SendSceneEvent(sceneId, "uuidEvent", onScrollChangeEvent);
 21006        }
 1007
 01008        public static void ReportEvent<T>(string sceneId, T @event) { SendSceneEvent(sceneId, "uuidEvent", @event); }
 1009
 1010        public static void ReportOnMetricsUpdate(string sceneId, MetricsModel current,
 1011            MetricsModel limit)
 1012        {
 1471013            onMetricsUpdate.given = current;
 1471014            onMetricsUpdate.limit = limit;
 1015
 1471016            SendSceneEvent(sceneId, "metricsUpdate", onMetricsUpdate);
 1471017        }
 1018
 1019        public static void ReportOnEnterEvent(string sceneId, string uuid)
 1020        {
 01021            if (string.IsNullOrEmpty(uuid))
 01022                return;
 1023
 01024            onEnterEvent.uuid = uuid;
 1025
 01026            SendSceneEvent(sceneId, "uuidEvent", onEnterEvent);
 01027        }
 1028
 01029        public static void LogOut() { SendMessage("LogOut"); }
 1030
 01031        public static void RedirectToSignUp() { SendMessage("RedirectToSignUp"); }
 1032
 01033        public static void PreloadFinished(string sceneId) { SendMessage("PreloadFinished", sceneId); }
 1034
 1035        public static void ReportMousePosition(Vector3 mousePosition, string id)
 1036        {
 01037            positionPayload.mousePosition = mousePosition;
 01038            positionPayload.id = id;
 01039            SendMessage("ReportMousePosition", positionPayload);
 01040        }
 1041
 1042        public static void SendScreenshot(string encodedTexture, string id)
 1043        {
 01044            onSendScreenshot.encodedTexture = encodedTexture;
 01045            onSendScreenshot.id = id;
 01046            SendMessage("SendScreenshot", onSendScreenshot);
 01047        }
 1048
 1049        public static void SetDelightedSurveyEnabled(bool enabled)
 1050        {
 781051            delightedSurveyEnabled.enabled = enabled;
 781052            SendMessage("SetDelightedSurveyEnabled", delightedSurveyEnabled);
 781053        }
 1054
 1055        public static void SetScenesLoadRadius(float newRadius)
 1056        {
 11057            setScenesLoadRadiusPayload.newRadius = newRadius;
 11058            SendMessage("SetScenesLoadRadius", setScenesLoadRadiusPayload);
 11059        }
 1060
 1061        [System.Serializable]
 1062        public class SaveAvatarPayload
 1063        {
 1064            public string face;
 1065            public string face128;
 1066            public string face256;
 1067            public string body;
 1068            public bool isSignUpFlow;
 1069            public AvatarModel avatar;
 1070        }
 1071
 1072        public static class RendererAuthenticationType
 1073        {
 01074            public static string Guest => "guest";
 01075            public static string WalletConnect => "wallet_connect";
 1076        }
 1077
 1078        [System.Serializable]
 1079        public class SendAuthenticationPayload
 1080        {
 1081            public string rendererAuthenticationType;
 1082        }
 1083
 1084        [System.Serializable]
 1085        public class SendPassportPayload
 1086        {
 1087            public string name;
 1088            public string email;
 1089        }
 1090
 1091        [System.Serializable]
 1092        public class SendSaveUserUnverifiedNamePayload
 1093        {
 1094            public string newUnverifiedName;
 1095        }
 1096
 1097        [System.Serializable]
 1098        public class SendSaveUserDescriptionPayload
 1099        {
 1100            public string description;
 1101
 01102            public SendSaveUserDescriptionPayload(string description)
 1103            {
 01104                this.description = description;
 01105            }
 1106        }
 1107
 1108        [Serializable]
 1109        public class SendVideoProgressEvent
 1110        {
 1111            public string componentId;
 1112            public string sceneId;
 1113            public string videoTextureId;
 1114            public int status;
 1115            public float currentOffset;
 1116            public float videoLength;
 1117        }
 1118
 21119        public static void RequestOwnProfileUpdate() { SendMessage("RequestOwnProfileUpdate"); }
 1120
 1121        public static void SendSaveAvatar(AvatarModel avatar, Texture2D faceSnapshot, Texture2D face128Snapshot, Texture
 1122        {
 11123            var payload = new SaveAvatarPayload()
 1124            {
 1125                avatar = avatar,
 1126                face = System.Convert.ToBase64String(faceSnapshot.EncodeToPNG()),
 1127                face128 = System.Convert.ToBase64String(face128Snapshot.EncodeToPNG()),
 1128                face256 = System.Convert.ToBase64String(face256Snapshot.EncodeToPNG()),
 1129                body = System.Convert.ToBase64String(bodySnapshot.EncodeToPNG()),
 1130                isSignUpFlow = isSignUpFlow
 1131            };
 11132            SendMessage("SaveUserAvatar", payload);
 11133        }
 1134
 01135        public static void SendAuthentication(string rendererAuthenticationType) { SendMessage("SendAuthentication", new
 1136
 21137        public static void SendPassport(string name, string email) { SendMessage("SendPassport", new SendPassportPayload
 1138
 1139        public static void SendSaveUserUnverifiedName(string newName)
 1140        {
 01141            var payload = new SendSaveUserUnverifiedNamePayload()
 1142            {
 1143                newUnverifiedName = newName
 1144            };
 1145
 01146            SendMessage("SaveUserUnverifiedName", payload);
 01147        }
 1148
 1149        public static void SendSaveUserDescription(string about)
 1150        {
 01151            SendMessage("SaveUserDescription", new SendSaveUserDescriptionPayload(about));
 01152        }
 1153
 21154        public static void SendUserAcceptedCollectibles(string airdropId) { SendMessage("UserAcceptedCollectibles", new 
 1155
 521156        public static void SaveUserTutorialStep(int newTutorialStep) { SendMessage("SaveUserTutorialStep", new TutorialS
 1157
 1158        public static void SendPerformanceReport(string encodedFrameTimesInMS, bool usingFPSCap, int hiccupsInThousandFr
 1159        {
 01160            SendMessage("PerformanceReport", new PerformanceReportPayload()
 1161            {
 1162                samples = encodedFrameTimesInMS,
 1163                fpsIsCapped = usingFPSCap,
 1164                hiccupsInThousandFrames = hiccupsInThousandFrames,
 1165                hiccupsTime = hiccupsTime,
 1166                totalTime = totalTime
 1167            });
 01168        }
 1169
 2501170        public static void SendSystemInfoReport() { SendMessage("SystemInfoReport", new SystemInfoReportPayload()); }
 1171
 1172        public static void SendTermsOfServiceResponse(string sceneId, bool accepted, bool dontShowAgain)
 1173        {
 21174            var payload = new TermsOfServiceResponsePayload()
 1175            {
 1176                sceneId = sceneId,
 1177                accepted = accepted,
 1178                dontShowAgain = dontShowAgain
 1179            };
 21180            SendMessage("TermsOfServiceResponse", payload);
 21181        }
 1182
 1183        public static void SendExpression(string expressionID, long timestamp)
 1184        {
 21185            SendMessage("TriggerExpression", new SendExpressionPayload()
 1186            {
 1187                id = expressionID,
 1188                timestamp = timestamp
 1189            });
 21190        }
 1191
 01192        public static void ReportMotdClicked() { SendMessage("MotdConfirmClicked"); }
 1193
 61194        public static void OpenURL(string url) { SendMessage("OpenWebURL", new OpenURLPayload { url = url }); }
 1195
 01196        public static void SendReportScene(string sceneID) { SendMessage("ReportScene", sceneID); }
 1197
 41198        public static void SendReportPlayer(string playerName) { SendMessage("ReportPlayer", playerName); }
 1199
 1200        public static void SendBlockPlayer(string userId)
 1201        {
 11202            SendMessage("BlockPlayer", new SendBlockPlayerPayload()
 1203            {
 1204                userId = userId
 1205            });
 11206        }
 1207
 1208        public static void SendUnblockPlayer(string userId)
 1209        {
 01210            SendMessage("UnblockPlayer", new SendUnblockPlayerPayload()
 1211            {
 1212                userId = userId
 1213            });
 01214        }
 1215
 1216        public static void RequestScenesInfoAroundParcel(Vector2 parcel, int maxScenesArea)
 1217        {
 01218            SendMessage("RequestScenesInfoInArea", new RequestScenesInfoAroundParcelPayload()
 1219            {
 1220                parcel = parcel,
 1221                scenesAround = maxScenesArea
 1222            });
 01223        }
 1224
 1225        public static void SendAudioStreamEvent(string url, bool play, float volume)
 1226        {
 31227            onAudioStreamingEvent.url = url;
 31228            onAudioStreamingEvent.play = play;
 31229            onAudioStreamingEvent.volume = volume;
 31230            SendMessage("SetAudioStream", onAudioStreamingEvent);
 31231        }
 1232
 1233        public static void SendSetVoiceChatRecording(bool recording)
 1234        {
 01235            setVoiceChatRecordingPayload.recording = recording;
 01236            SendMessage("SetVoiceChatRecording", setVoiceChatRecordingPayload);
 01237        }
 1238
 01239        public static void ToggleVoiceChatRecording() { SendMessage("ToggleVoiceChatRecording"); }
 1240
 1241        public static void ApplySettings(float voiceChatVolume, int voiceChatAllowCategory)
 1242        {
 61243            applySettingsPayload.voiceChatVolume = voiceChatVolume;
 61244            applySettingsPayload.voiceChatAllowCategory = voiceChatAllowCategory;
 61245            SendMessage("ApplySettings", applySettingsPayload);
 61246        }
 1247
 1248        public static void RequestGIFProcessor(string gifURL, string gifId, bool isWebGL1)
 1249        {
 01250            gifSetupPayload.imageSource = gifURL;
 01251            gifSetupPayload.id = gifId;
 01252            gifSetupPayload.isWebGL1 = isWebGL1;
 1253
 01254            SendMessage("RequestGIFProcessor", gifSetupPayload);
 01255        }
 1256
 1257        public static void DeleteGIF(string id)
 1258        {
 01259            stringPayload.value = id;
 01260            SendMessage("DeleteGIF", stringPayload);
 01261        }
 1262
 1263        public static void GoTo(int x, int y)
 1264        {
 31265            gotoEvent.x = x;
 31266            gotoEvent.y = y;
 31267            SendMessage("GoTo", gotoEvent);
 31268        }
 1269
 01270        public static void GoToCrowd() { SendMessage("GoToCrowd"); }
 1271
 01272        public static void GoToMagic() { SendMessage("GoToMagic"); }
 1273
 1274        public static void JumpIn(int x, int y, string serverName, string layerName)
 1275        {
 21276            jumpInPayload.realm.serverName = serverName;
 21277            jumpInPayload.realm.layer = layerName;
 1278
 21279            jumpInPayload.gridPosition.x = x;
 21280            jumpInPayload.gridPosition.y = y;
 1281
 21282            SendMessage("JumpIn", jumpInPayload);
 21283        }
 1284
 1285        public static void SendChatMessage(ChatMessage message)
 1286        {
 51287            sendChatMessageEvent.message = message;
 51288            SendMessage("SendChatMessage", sendChatMessageEvent);
 51289        }
 1290
 81291        public static void UpdateFriendshipStatus(FriendsController.FriendshipUpdateStatusMessage message) { SendMessage
 1292
 01293        public static void ScenesLoadingFeedback(LoadingFeedbackMessage message) { SendMessage("ScenesLoadingFeedback", 
 1294
 61295        public static void FetchHotScenes() { SendMessage("FetchHotScenes"); }
 1296
 1297        public static void SetBaseResolution(int resolution)
 1298        {
 21299            baseResEvent.baseResolution = resolution;
 21300            SendMessage("SetBaseResolution", baseResEvent);
 21301        }
 1302
 01303        public static void ReportAnalyticsEvent(string eventName) { ReportAnalyticsEvent(eventName, null); }
 1304
 1305        public static void ReportAnalyticsEvent(string eventName, AnalyticsPayload.Property[] eventProperties)
 1306        {
 251307            analyticsEvent.name = eventName;
 251308            analyticsEvent.properties = eventProperties;
 251309            SendMessage("Track", analyticsEvent);
 251310        }
 1311
 41312        public static void FetchBalanceOfMANA() { SendMessage("FetchBalanceOfMANA"); }
 1313
 1314        public static void SendSceneExternalActionEvent(string sceneId, string type, string payload)
 1315        {
 781316            sceneExternalActionEvent.type = type;
 781317            sceneExternalActionEvent.payload = payload;
 781318            SendSceneEvent(sceneId, "externalAction", sceneExternalActionEvent);
 781319        }
 1320
 1321        public static void SetMuteUsers(string[] usersId, bool mute)
 1322        {
 01323            muteUserEvent.usersId = usersId;
 01324            muteUserEvent.mute = mute;
 01325            SendMessage("SetMuteUsers", muteUserEvent);
 01326        }
 1327
 1328        public static void SendCloseUserAvatar(bool isSignUpFlow)
 1329        {
 01330            closeUserAvatarPayload.isSignUpFlow = isSignUpFlow;
 01331            SendMessage("CloseUserAvatar", closeUserAvatarPayload);
 01332        }
 1333
 1334        public static void KillPortableExperience(string portableExperienceId)
 1335        {
 01336            killPortableExperiencePayload.portableExperienceId = portableExperienceId;
 01337            SendMessage("KillPortableExperience", killPortableExperiencePayload);
 01338        }
 1339
 1340        public static void RequestWearables(
 1341            string ownedByUser,
 1342            string[] wearableIds,
 1343            string[] collectionIds,
 1344            string context)
 1345        {
 11346            requestWearablesPayload.filters = new WearablesRequestFiltersPayload
 1347            {
 1348                ownedByUser = ownedByUser,
 1349                wearableIds = wearableIds,
 1350                collectionIds = collectionIds
 1351            };
 1352
 11353            requestWearablesPayload.context = context;
 1354
 11355            SendMessage("RequestWearables", requestWearablesPayload);
 11356        }
 1357
 1358        public static void SearchENSOwner(string name, int maxResults)
 1359        {
 61360            searchEnsOwnerPayload.name = name;
 61361            searchEnsOwnerPayload.maxResults = maxResults;
 1362
 61363            SendMessage("SearchENSOwner", searchEnsOwnerPayload);
 61364        }
 1365
 1366        public static void RequestUserProfile(string userId)
 1367        {
 161368            stringPayload.value = userId;
 161369            SendMessage("RequestUserProfile", stringPayload);
 161370        }
 1371
 121372        public static void ReportAvatarFatalError() { SendMessage("ReportAvatarFatalError"); }
 1373
 1374        public static void UnpublishScene(Vector2Int sceneCoordinates)
 1375        {
 21376            var payload = new UnpublishScenePayload() { coordinates = $"{sceneCoordinates.x},{sceneCoordinates.y}" };
 21377            SendMessage("UnpublishScene", payload);
 21378        }
 1379
 1380        public static void NotifyStatusThroughChat(string message)
 1381        {
 01382            stringPayload.value = message;
 01383            SendMessage("NotifyStatusThroughChat", stringPayload);
 01384        }
 1385
 1386        public static void ReportVideoProgressEvent(
 1387            string componentId,
 1388            string sceneId,
 1389            string videoClipId,
 1390            int videoStatus,
 1391            float currentOffset,
 1392            float length)
 1393        {
 381394            SendVideoProgressEvent progressEvent = new SendVideoProgressEvent()
 1395            {
 1396                componentId = componentId,
 1397                sceneId = sceneId,
 1398                videoTextureId = videoClipId,
 1399                status = videoStatus,
 1400                currentOffset =  currentOffset,
 1401                videoLength = length
 1402            };
 1403
 381404            SendMessage("VideoProgressEvent", progressEvent);
 381405        }
 1406    }
 1407}

Methods/Properties

WebInterface()
StartStatefulMode(System.String)
StopStatefulMode(System.String)
SceneReady(System.String)
ActivateRenderingACK()
DeactivateRenderingACK()
OnGlobalPointerEvent()
StoreSceneStateEvent()
OnTextInputChangeTextEventPayload()
operator+(DCL.Interface.WebInterface/MetricsModel, DCL.Interface.WebInterface/MetricsModel)
OnMetricsUpdate()
TransformPayload()
SystemInfoReportPayload()
JumpInPayload()
Property(System.String, System.String)
HeadersPayload()
StartDecentraland()
CheckURLParam(System.String)
MessageFromEngine(System.String, System.String)
ProcessQueuedMessages()
GetGraphicCard()
SendMessage(System.String)
SendMessage[T](System.String, T)
SendSceneEvent[T](System.String, System.String, T)
SendAllScenesEvent[T](System.String, T)
ReportPosition(UnityEngine.Vector3, UnityEngine.Quaternion, System.Single)
ReportCameraChanged(CameraMode/ModeId)
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.String, System.String)
ReportRaycastResult[T, P](System.String, System.String, System.String, P)
ReportRaycastHitFirstResult(System.String, System.String, DCL.Models.RaycastType, DCL.Interface.WebInterface/RaycastHitEntity)
ReportRaycastHitAllResult(System.String, 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.String, System.String, System.String, System.Boolean)
ReportGlobalPointerUpEvent(DCL.Interface.WebInterface/ACTION_BUTTON, UnityEngine.Ray, UnityEngine.Vector3, UnityEngine.Vector3, System.Single, System.String, System.String, System.String, System.Boolean)
ReportOnPointerDownEvent(DCL.Interface.WebInterface/ACTION_BUTTON, System.String, System.String, System.String, System.String, UnityEngine.Ray, UnityEngine.Vector3, UnityEngine.Vector3, System.Single)
ReportOnPointerUpEvent(DCL.Interface.WebInterface/ACTION_BUTTON, System.String, System.String, System.String, System.String, UnityEngine.Ray, UnityEngine.Vector3, UnityEngine.Vector3, System.Single)
ReportOnTextSubmitEvent(System.String, System.String, System.String)
ReportOnTextInputChangedEvent(System.String, System.String, System.String)
ReportOnTextInputChangedTextEvent(System.String, System.String, System.String, System.Boolean)
ReportOnFocusEvent(System.String, System.String)
ReportOnBlurEvent(System.String, System.String)
ReportOnScrollChange(System.String, System.String, UnityEngine.Vector2, System.Int32)
ReportEvent[T](System.String, T)
ReportOnMetricsUpdate(System.String, DCL.Interface.WebInterface/MetricsModel, DCL.Interface.WebInterface/MetricsModel)
ReportOnEnterEvent(System.String, System.String)
LogOut()
RedirectToSignUp()
PreloadFinished(System.String)
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, UnityEngine.Texture2D, UnityEngine.Texture2D, System.Boolean)
SendAuthentication(System.String)
SendPassport(System.String, System.String)
SendSaveUserUnverifiedName(System.String)
SendSaveUserDescription(System.String)
SendUserAcceptedCollectibles(System.String)
SaveUserTutorialStep(System.Int32)
SendPerformanceReport(System.String, System.Boolean, System.Int32, System.Single, System.Single)
SendSystemInfoReport()
SendTermsOfServiceResponse(System.String, System.Boolean, System.Boolean)
SendExpression(System.String, System.Int64)
ReportMotdClicked()
OpenURL(System.String)
SendReportScene(System.String)
SendReportPlayer(System.String)
SendBlockPlayer(System.String)
SendUnblockPlayer(System.String)
RequestScenesInfoAroundParcel(UnityEngine.Vector2, System.Int32)
SendAudioStreamEvent(System.String, System.Boolean, System.Single)
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()
JumpIn(System.Int32, System.Int32, System.String, System.String)
SendChatMessage(DCL.Interface.ChatMessage)
UpdateFriendshipStatus(FriendsController/FriendshipUpdateStatusMessage)
ScenesLoadingFeedback(DCL.Interface.WebInterface/LoadingFeedbackMessage)
FetchHotScenes()
SetBaseResolution(System.Int32)
ReportAnalyticsEvent(System.String)
ReportAnalyticsEvent(System.String, DCL.Interface.WebInterface/AnalyticsPayload/Property[])
FetchBalanceOfMANA()
SendSceneExternalActionEvent(System.String, System.String, System.String)
SetMuteUsers(System.String[], System.Boolean)
SendCloseUserAvatar(System.Boolean)
KillPortableExperience(System.String)
RequestWearables(System.String, System.String[], System.String[], System.String)
SearchENSOwner(System.String, System.Int32)
RequestUserProfile(System.String)
ReportAvatarFatalError()
UnpublishScene(UnityEngine.Vector2Int)
NotifyStatusThroughChat(System.String)
ReportVideoProgressEvent(System.String, System.String, System.String, System.Int32, System.Single, System.Single)