Exemple #1
0
    public void ServerAGhost()
    {
        var adminId    = DatabaseAPI.ServerData.UserID;
        var adminToken = PlayerList.Instance.AdminToken;

        var admin = PlayerList.Instance.GetAdmin(adminId, adminToken);

        if (admin == null)
        {
            return;
        }

        if (!playerScript.IsGhost)        //admin turns into ghost
        {
            PlayerSpawn.ServerSpawnGhost(playerScript.mind);
        }
        else if (playerScript.IsGhost)        //back to player
        {
            if (playerScript.mind.IsSpectator)
            {
                return;
            }

            GhostEnterBody();
        }
    }
 public void CmdSpawnPlayerGhost()
 {
     if (GetComponent <LivingHealthBehaviour>().IsDead)
     {
         PlayerSpawn.ServerSpawnGhost(playerScript.mind);
     }
 }
    public void ServerSpawnPlayerGhost()
    {
        //Only force to ghost if the mind belongs in to that body
        var currentMobID = GetComponent <LivingHealthBehaviour>().mobID;

        if (GetComponent <LivingHealthBehaviour>().IsDead&& !playerScript.IsGhost && playerScript.mind.bodyMobID == currentMobID)
        {
            PlayerSpawn.ServerSpawnGhost(playerScript.mind);
        }
    }
Exemple #4
0
        private void OnFinishPlayerCremation()
        {
            foreach (var player in serverHeldPlayers)
            {
                var playerScript = player.GetComponent <PlayerScript>();
                PlayerSpawn.ServerSpawnGhost(playerScript.mind);
                _ = Despawn.ServerSingle(player.gameObject);
            }

            serverHeldPlayers = new List <ObjectBehaviour>();
        }
Exemple #5
0
    public void ProcessJobBanRequest(string admin, string userToJobBan, string reason, bool isPerma, int banMinutes, JobType jobType, bool kickAfter = false, bool ghostAfter = false)
    {
        if (!adminUsers.Contains(admin))
        {
            return;
        }

        var players = GetAllByUserID(userToJobBan);

        if (players.Count != 0)
        {
            foreach (var p in players)
            {
                var message = "";

                if (isPerma)
                {
                    message = $"A job ban has been processed by {PlayerList.Instance.GetByUserID(admin).Username}: Username: {p.Username} Player: {p.Name} Job: {jobType} IsPerma: {isPerma} Time: {DateTime.Now}";
                }
                else
                {
                    message = $"A job ban has been processed by {PlayerList.Instance.GetByUserID(admin).Username}: Username: {p.Username} Player: {p.Name} Job: {jobType} BanMinutes: {banMinutes} Time: {DateTime.Now}";
                }

                Logger.Log(message);

                StartCoroutine(JobBanPlayer(p, reason, isPerma, banMinutes, jobType));

                UIManager.Instance.adminChatWindows.adminToAdminChat.ServerAddChatRecord($"{PlayerList.Instance.GetByUserID(admin).Username}: job banned {p.Username} from {jobType}, IsPerma: {isPerma}, BanMinutes: {banMinutes}", null);

                DiscordWebhookMessage.Instance.AddWebHookMessageToQueue(DiscordWebhookURLs.DiscordWebhookAdminLogURL, message + $"\nReason: {reason}", "");

                if (ghostAfter)
                {
                    if (!p.Script.IsGhost)
                    {
                        PlayerSpawn.ServerSpawnGhost(p.Script.mind);
                        p.Script.mind.ghostLocked = true;
                    }
                }

                if (kickAfter)
                {
                    reason = "Player was kicked after job ban process.";
                    StartCoroutine(KickPlayer(p, reason, false));
                }
            }
        }
        else
        {
            Logger.Log($"job ban failed, can't find player: {userToJobBan}. Requested by {admin}");
        }
    }
    public void ServerSpawnPlayerGhost()
    {
        if (alreadyGhosted)
        {
            return;
        }

        if (GetComponent <LivingHealthBehaviour>().IsDead&& !playerScript.IsGhost)
        {
            alreadyGhosted = true;
            PlayerSpawn.ServerSpawnGhost(playerScript.mind);
        }
    }
Exemple #7
0
        private void DestroyContents()
        {
            foreach (var obj in container.GetStoredObjects())
            {
                if (obj.TryGetComponent <PlayerScript>(out var script) && script.mind != null)
                {
                    PlayerSpawn.ServerSpawnGhost(script.mind);
                }

                _ = Despawn.ServerSingle(obj);
                container.RemoveObject(obj);
            }
        }
    public void ServerAGhost()
    {
        if (!playerScript.IsGhost || playerScript.IsPlayerSemiGhost)        //admin turns into ghost
        {
            PlayerSpawn.ServerSpawnGhost(playerScript.mind);
        }
        else if (playerScript.IsGhost)         //back to player
        {
            if (playerScript.mind.IsSpectator)
            {
                return;
            }

            GhostEnterBody();
        }
    }
    public void ServerAGhost(string adminId, string adminToken)
    {
        var admin = PlayerList.Instance.GetAdmin(adminId, adminToken);

        if (admin == null)
        {
            return;
        }

        if (!playerScript.IsGhost || playerScript.IsPlayerSemiGhost)        //admin turns into ghost
        {
            PlayerSpawn.ServerSpawnGhost(playerScript.mind);
        }
        else if (playerScript.IsGhost)         //back to player
        {
            if (playerScript.mind.IsSpectator)
            {
                return;
            }

            GhostEnterBody();
        }
    }
    public void CmdSpectate(string jsonCharSettings)
    {
        var characterSettings = JsonConvert.DeserializeObject <CharacterSettings>(jsonCharSettings);

        PlayerSpawn.ServerSpawnGhost(this, characterSettings);
    }
 public void CmdSpectate()
 {
     PlayerSpawn.ServerSpawnGhost(this);
 }