Exemplo n.º 1
0
        private void Disappear(BasePlayer player)
        {
            if (Interface.CallHook("OnVanishDisappear", player) != null)
            {
                return;
            }

            if (config.AntiFlyHack)
            {
                player.PauseFlyHackDetection();
            }
            //Mute Player Effects
            player.fallDamageEffect = new GameObjectRef();
            player.drownEffect      = new GameObjectRef();
            AntiHack.ShouldIgnore(player);
            if (_hiddenPlayers.Count == 0)
            {
                SubscribeToHooks();
            }
            player._limitedNetworking = true;
            //player.UpdatePlayerCollider(false);
            var connections = Net.sv.connections.Where(con => con.connected && con.isAuthenticated && con.player is BasePlayer && con.player != player).ToList();

            player.OnNetworkSubscribersLeave(connections);
            player.gameObject.AddComponent <GroupSwitchTimer>();
            _hiddenPlayers.Add(player);

            if (config.EnableSound)
            {
                if (config.PublicSound)
                {
                    Effect.server.Run(config.VanishSoundEffect, player.transform.position);
                }
                else
                {
                    SendEffect(player, config.VanishSoundEffect);
                }
            }
            if (config.NoClipOnVanish && !player.IsFlying)
            {
                player.SendConsoleCommand("noclip");
            }

            if (config.EnableGUI)
            {
                VanishGui(player);
            }

            if (config.EnableNotifications)
            {
                Message(player.IPlayer, "Vanished");
            }
        }
Exemplo n.º 2
0
            void PlayerControllerSpawn()
            {
                if (player == null)
                {
                    Vector3 spawnloc = new Vector3(searchlight.transform.position.x, searchlight.transform.position.y - 1.8f, searchlight.transform.position.z);
                    player = GameManager.server.CreateEntity("assets/prefabs/player/player.prefab", spawnloc, new Quaternion()).ToPlayer();
                    player.Spawn();
                    player.displayName = "SearchLight Driver";
                    AntiHack.ShouldIgnore(player);
                    player._limitedNetworking = true;
                    player.EnablePlayerCollider();
                    var connections = Net.sv.connections.Where(con => con.connected && con.isAuthenticated && con.player is BasePlayer && con.player != player).ToList();
                    player.OnNetworkSubscribersLeave(connections);
                }

                searchlight.PlayerEnter(player);
            }
Exemplo n.º 3
0
        private void BypassCommand(IPlayer IPlayer, string command, string[] args)
        {
            BasePlayer player = (BasePlayer)IPlayer;

            if (!bypassing.Contains(IPlayer))
            {
                AntiHack.ShouldIgnore(player);
                bypassing.Add(IPlayer);
                IPlayer.Message("You are now bypassing anticheat!");
            }
            else
            {
                bypassing.Remove(IPlayer);
                //Add reset anti hack here. TODO
                IPlayer.Message("You are no longer bypassing anticheat!");
            }
        }
Exemplo n.º 4
0
        private void Disappear(BasePlayer player)
        {
            if (Interface.CallHook("OnVanishDisappear", player) != null)
            {
                return;
            }

            if (config.AntiFlyHack)
            {
                player.PauseFlyHackDetection();
            }
            //Mute Player Effects
            player.fallDamageEffect = new GameObjectRef();
            player.drownEffect      = new GameObjectRef();
            AntiHack.ShouldIgnore(player);
            if (_hiddenPlayers.Count == 0)
            {
                SubscribeToHooks();
            }

            //player._limitedNetworking = true;

            player.UpdatePlayerCollider(false);


            var connections = Net.sv.connections.Where(con => con.connected && con.isAuthenticated && con.player is BasePlayer && con.player != player).ToList();

            player.OnNetworkSubscribersLeave(connections);


            //HeldEntity heldEntity = player.GetHeldEntity();
            //if (heldEntity != null)
            //{
            //    heldEntity.SetHeld(false);
            //    heldEntity.UpdateVisiblity_Invis();
            //    heldEntity.SendNetworkUpdate();
            //}

            //if (Net.sv.write.Start())
            //{
            //    Net.sv.write.PacketID(Network.Message.Type.EntityDestroy);
            //    Net.sv.write.EntityID(player.net.ID);
            //    Net.sv.write.UInt8((byte)BaseNetworkable.DestroyMode.None);
            //    Net.sv.write.Send(new SendInfo(connections));
            //}

            _hiddenPlayers.Add(player);

            if (config.EnableSound)
            {
                if (config.PublicSound)
                {
                    Effect.server.Run(config.VanishSoundEffect, player.transform.position);
                }
                else
                {
                    SendEffect(player, config.VanishSoundEffect);
                }
            }

            if (config.EnableGUI)
            {
                VanishGui(player);
            }

            if (config.EnableNotifications)
            {
                Message(player.IPlayer, "Vanished");
            }
        }