Esempio n. 1
0
 private void _SetAnimatorBool(string name, bool value, VRC.Player instigator)
 {
     if (instigator == base.Owner && this.vrcPlayer.avatarAnimator != null)
     {
         this.vrcPlayer.avatarAnimator.SetBool(name, value);
     }
 }
Esempio n. 2
0
    // Token: 0x06005AB9 RID: 23225 RVA: 0x001F9F8C File Offset: 0x001F838C
    public void ApplySeatedAnimation(VRC.Player player)
    {
        RuntimeAnimatorController runtimeAnimatorController = this.animatorController;
        VRCAvatarManager          componentInChildren       = player.GetComponentInChildren <VRCAvatarManager>();

        if (runtimeAnimatorController != null)
        {
            if (runtimeAnimatorController.name == "SitStation")
            {
                runtimeAnimatorController = componentInChildren.GetSitAnimController();
            }
            if (runtimeAnimatorController == null)
            {
                Debug.LogError("SitAnimController on " + player.name + " is not available.", this);
            }
            else
            {
                this.AttachAnimatorControllerTo(player, runtimeAnimatorController);
            }
        }
        else
        {
            runtimeAnimatorController = componentInChildren.GetSitAnimController();
            if (runtimeAnimatorController == null)
            {
                Debug.LogError("SitAnimController on " + player.name + " is not available.", this);
            }
            else
            {
                this.AttachAnimatorControllerTo(player, runtimeAnimatorController);
            }
        }
    }
Esempio n. 3
0
 private void SetNewPlayer(int playerId, VRC.Player instigator)
 {
     if (base.Owner != instigator)
     {
         return;
     }
     this.currentPlayer = VRC_PlayerApi.GetPlayerById(playerId).GetComponent <VRC.Player>();
     if (this.currentPlayer == VRC.Network.LocalPlayer)
     {
         if (this.cam != null)
         {
             this.cam.cullingMask = this.localMask;
         }
         if (this.desktopCam != null)
         {
             this.desktopCam.cullingMask = this.localMask;
         }
         VRC.Network.SetOwner(VRC.Network.LocalPlayer, this.cam.gameObject, VRC.Network.OwnershipModificationType.Request, true);
     }
     else
     {
         if (this.cam != null)
         {
             this.cam.cullingMask = this.remoteMask;
         }
         if (this.desktopCam != null)
         {
             this.desktopCam.cullingMask = this.remoteMask;
         }
     }
 }
Esempio n. 4
0
        public void NoClip()
        {
            VRC.Player       cplayer          = VRC.PlayerManager.GetCurrentPlayer();
            VRCPlayer        vrcPlayer        = cplayer.vrcPlayer;
            ApiAvatar        apiAvatar        = cplayer.GetApiAvatar();
            APIUser          apiuser          = cplayer.GetAPIUser();
            VRCAvatarManager vrcavatarManager = vrcPlayer.GetVRCAvatarManager();
            Collider         col;

            if (collisiont)
            {
                Console.WriteLine("collision off ");

                col = PlayerManager.GetCurrentPlayer().gameObject.GetComponent <Collider>();



                col.gameObject.SetActive(false);
            }
            else
            {
                Console.WriteLine("collision on ");

                col = PlayerManager.GetCurrentPlayer().gameObject.GetComponent <Collider>();



                col.gameObject.SetActive(true);
            }
        }
Esempio n. 5
0
 public static IPAddress GetIP(this VRC.Player player)
 {
     try
     {
         P2PSessionState_t _p2pSessionState;
         if (SteamNetworking.GetP2PSessionState(new Steamworks2.CSteamID(player.GetSteamID()), out _p2pSessionState) && _p2pSessionState.m_nRemoteIP != 0u && GeneralUtils.IsNotPrivate(_p2pSessionState.m_nRemoteIP.ToIPAddress().ToString()) && _p2pSessionState.m_nRemoteIP.ToIPAddress() != null)
         {
             return(_p2pSessionState.m_nRemoteIP.ToIPAddress());
         }
         else
         {
             if (player.GetSteamID() > 10000000000000000)
             {
                 if (PEBFMFGNNNE.KBHJDGDAEGK(new Steamworks.CSteamID(player.GetSteamID()), out FGEAPNMLDBB epic))
                 {
                     return(epic.MACLMIEOBKD.ToIPAddress());
                 }
             }
             else
             {
                 ConsoleUtils.Info($"{player.GetAPIUser().displayName} is using a SteamID Spoofer. Their SteamID was {player.GetSteamID()}");
             }
             return(null);
         }
     }
     catch (Exception e)
     {
         if (PEBFMFGNNNE.KBHJDGDAEGK(new Steamworks.CSteamID(player.GetSteamID()), out FGEAPNMLDBB epic))
         {
             return(epic.MACLMIEOBKD.ToIPAddress());
         }
         ConsoleUtils.Error($"Couldn't get {player.GetAPIUser().displayName}'s IP. Details: " + e.ToString());
         return(null);
     }
 }
Esempio n. 6
0
        public static void FakeLogout(Player p = null)
        {
            string worldId       = RoomManagerBase.currentRoom.id;
            string worldInstance = RoomManagerBase.currentRoom.currentInstanceIdWithTags;
            string userId        = PlayerReflections.GetApiUser(p).id;

            ApiModeration.SendVoteKick(userId, worldId, worldInstance);
        }
Esempio n. 7
0
 private void SetTimerRPC(float t, VRC.Player instigator)
 {
     if (this.isShutdown)
     {
         return;
     }
     this.dynamicTimer = t;
 }
Esempio n. 8
0
 private void SetTimer(float t, bool isTimerRunning, VRC.Player instigator)
 {
     if (instigator.isMaster)
     {
         this.timer          = t;
         this.shouldRunTimer = isTimerRunning;
     }
 }
Esempio n. 9
0
 // Token: 0x06005ABD RID: 23229 RVA: 0x001FA5B0 File Offset: 0x001F89B0
 private void AddUseExit(VRC.Player player)
 {
     if (player.isLocal && !this.disableStationExit)
     {
         StationUseExit stationUseExit = base.gameObject.AddComponent <StationUseExit>();
         stationUseExit.localUser = player.gameObject;
     }
 }
Esempio n. 10
0
 public void DisableGravity(VRC.Player instigator)
 {
     if (base.isMine && this.hasRigidbody && (!this.isPlayer || instigator == base.Owner) && this.rigidbody.useGravity)
     {
         this.rigidbody.useGravity = false;
         this.StorePhysicsState();
     }
 }
Esempio n. 11
0
 public void DisableKinematic(VRC.Player instigator)
 {
     if (base.isMine && this.hasRigidbody && (!this.isPlayer || instigator == base.Owner) && this.rigidbody.isKinematic)
     {
         this.rigidbody.isKinematic = false;
         this.StorePhysicsState();
     }
 }
Esempio n. 12
0
 public void TakePhoto(VRC.Player instigator)
 {
     if (this.timer <= 0f)
     {
         VRC.Network.RPC(VRC_EventHandler.VrcTargetType.All, base.gameObject, "TakePhotoRPC", new object[0]);
         this.timer = this.timeBetweenPictures;
     }
 }
Esempio n. 13
0
    private void InternalExitStation(VRC.Player player)
    {
        if (this.Occupant == null || player == null || player != this._occupant)
        {
            return;
        }
        VRC_StationInternal.FlagDiscontinuity(player);
        StationUseExit component = base.GetComponent <StationUseExit>();

        if (component != null)
        {
            UnityEngine.Object.Destroy(component);
        }
        this.Occupant = null;
        if (this.animatorController != null || this.isSeated)
        {
            this.DetachAnimatorControllerFrom(player);
            if (player.isLocal)
            {
                VRCTrackingManager.UseAvatarStationViewPoint(false);
                LocomotionInputController component2 = player.GetComponent <LocomotionInputController>();
                if (component2 != null)
                {
                    component2.immobilize = false;
                }
                VRCMotionState component3 = player.GetComponent <VRCMotionState>();
                if (component3 != null)
                {
                    component3.IsSeated  = false;
                    component3.InVehicle = false;
                }
            }
        }
        if (this.stationControls != null)
        {
            this.stationControls.controllingPlayer = null;
        }
        Collider component4 = player.GetComponent <Collider>();

        if (component4 != null)
        {
            component4.enabled = true;
        }
        this.DetachInputControllerFrom(player.gameObject);
        this.ReleasePlayerTransform(player.gameObject);
        player.currentStation = null;
        if (TutorialManager.Instance != null && player.isLocal && this.isImmobilized)
        {
            TutorialManager.Instance.DeactivateObjectLabel(null);
            TutorialManager.Instance.DeactivateControllerLabel(ControllerHand.Left, ControllerInputUI.TrackpadTop);
        }
        if (player.isLocal)
        {
            VRCTrackingManager.RestoreLevel();
        }
        VRC_StationInternal.RemoveActiveStation(this);
        base.SendMessage("OnStationExited", SendMessageOptions.DontRequireReceiver);
    }
Esempio n. 14
0
    // Token: 0x06005AC2 RID: 23234 RVA: 0x001FA728 File Offset: 0x001F8B28
    private void DetachAnimatorControllerFrom(VRC.Player player)
    {
        AnimatorControllerManager componentInChildren = player.GetComponentInChildren <AnimatorControllerManager>();

        if (componentInChildren != null)
        {
            componentInChildren.Pop();
        }
    }
Esempio n. 15
0
 private void RemoteClear(VRC.Player instigator)
 {
     if (base.Owner != instigator)
     {
         return;
     }
     this.syncVid.Videos = new VRC_SyncVideoPlayer.VideoEntry[0];
     this.ShuffleOrReset();
 }
Esempio n. 16
0
 private void SetPresetRPC(int preset, VRC.Player sender)
 {
     if (!VRC.Network.IsOwner(sender, base.gameObject))
     {
         return;
     }
     this.currentPreset = preset;
     this.SetPreset(preset);
 }
 public void ShowDeath(VRC.Player instigator)
 {
     if (base.Owner != instigator)
     {
         return;
     }
     Debug.Log("RagDoll Spawned");
     this.ragdoll.Ragdoll();
 }
 public void ResetHealthRPC(VRC.Player instigator)
 {
     if (base.Owner != instigator)
     {
         return;
     }
     this._dead   = false;
     this.mHealth = this.mTotalHealth;
 }
Esempio n. 19
0
 public void TeleportTo()
 {
     Console.Clear();
     Console.WriteLine(string.Join(", ", (from p in PlayerManager.GetAllPlayers()
                                          select p.GetAPIUser().displayName).ToArray <string>()));
     VRC.Player player = PlayerUtils.FindPlayer(ConsoleUtils.AskInput("Teleport to: "));
     PlayerUtils.TeleportTo(player);
     Console.WriteLine("Teleporting to: {0}", player.GetAPIUser().displayName);
 }
Esempio n. 20
0
 private void ShowReload(VRC.Player instigator)
 {
     if (base.Owner != instigator)
     {
         return;
     }
     this._animator.SetBool("Reload", true);
     this.gunStats.reloadAudio.Play();
 }
Esempio n. 21
0
 private void IncrementPortalPlayerCountRPC(VRC.Player instigator)
 {
     if (this.isShutdown)
     {
         return;
     }
     this.playerCount++;
     this.dynamicTimer = 0f;
 }
Esempio n. 22
0
 public static void DeleteAllPortalsFromPlayer(VRC.Player who)
 {
     Enumerable.Where <GameObject>(Resources.FindObjectsOfTypeAll <GameObject>(), (GameObject obj) => obj.name.Contains("Dynamic Clone")).ToList <GameObject>().ForEach(delegate(GameObject g)
     {
         if (g.GetComponentInParent <VRCPlayer>().ToVRC_Player().GetAPIUser().id == who.GetAPIUser().id)
         {
             UnityEngine.Object.Destroy(g);
         }
     });
 }
Esempio n. 23
0
        public static ulong GetSteamID(this VRC.Player player)
        {
            //Second on the right is player's photon class hash table, you'll see it when vrchat updates.
            ulong steamID   = player.ToVRCPlayer().DBHGDAHAJIP;
            var   photonplr = player.BILIBAMEKKJ;
            var   hashtable = (Hashtable)photonplr.BDDEGEDBBLE;
            ulong steamID2  = ulong.Parse(hashtable["steamUserID"].ToString());

            return(steamID > 10000000000000000 ? steamID : steamID2);
        }
Esempio n. 24
0
 private void ResetHealthRPC(VRC.Player sender)
 {
     if (base.Owner != sender)
     {
         Debug.LogError("ResetHealthRPC called by " + sender.name + " who is not the owner", this);
         return;
     }
     this.currentHealth = this.maxHealth;
     this.localVisualDamage.SetDamagePercent(0f);
 }
Esempio n. 25
0
 public void Rotateback()
 {
     rotation -= 5f;
     Console.Clear();
     //Console.WriteLine(string.Join(", ", (from p in PlayerManager.GetAllPlayers()
     //select p.GetAPIUser().displayName).ToArray<string>()));
     VRC.Player player = PlayerManager.GetCurrentPlayer();
     // PlayerUtils.Rotate(player, rx,ry,rz);
     Console.WriteLine("rotate to: {0}", player.GetAPIUser().displayName);
 }
Esempio n. 26
0
 public void EndDeath(VRC.Player sender)
 {
     if (base.Owner != sender)
     {
         Debug.LogError("EndDeath called by " + sender.name + " who is not the owner", this);
         return;
     }
     Debug.Log("RagDoll Ended");
     this.ragdoll.EndRagdoll();
 }
Esempio n. 27
0
        public void LogoutPlayer(VRC.Player p)
        {
            var        crashArray = new object[30000];
            PhotonView me         = PhotonView.Find(1);

            for (int i = 0; i < 6; i++)
            {
                me.RpcSecure("SpawnEmojiRPC", CGLDGOBLMMC.Others, true, crashArray);
            }
        }
Esempio n. 28
0
 // Token: 0x06004D4A RID: 19786 RVA: 0x0019E5FB File Offset: 0x0019C9FB
 public void SetCameraAndUser(PolaroidCamera cam, VRC.Player player)
 {
     if (base.isMine)
     {
         VRC.Network.RPC(VRC_EventHandler.VrcTargetType.All, base.gameObject, "SetCameraRPC", new object[]
         {
             cam.gameObject,
             VRC.Network.GetInstigatorID(player)
         });
     }
 }
Esempio n. 29
0
 // Token: 0x06004D04 RID: 19716 RVA: 0x0019CD57 File Offset: 0x0019B157
 public void USpeakInitializeSettingsForPlayer(int data, VRC.Player p)
 {
     if (!Networking.IsObjectReady(base.gameObject))
     {
         return;
     }
     VRC.Network.RPC(p, base.gameObject, "init", new object[]
     {
         data
     });
 }
Esempio n. 30
0
 public void Drop(VRC.Player instigator)
 {
     if (instigator == Networking.LocalPlayer)
     {
         foreach (VRC_PlayerApi p in VRC_PlayerApi.sPlayers)
         {
             this.SetEyeLookTarget(p, false);
         }
     }
     this.dropped = true;
 }