Ejemplo n.º 1
0
        public void OnPlayerSelect(AdminPlayerEntryData playerData)
        {
            selectedPlayer = playerData;
            ClientGetUnreadAdminPlayerMessages(playerData.uid);
            if (!clientAdminPlayerChatLogs.ContainsKey(playerData.uid))
            {
                clientAdminPlayerChatLogs.Add(playerData.uid, new List <AdminChatMessage>());
            }

            chatScroll.LoadChatEntries(clientAdminPlayerChatLogs[playerData.uid].Cast <ChatEntryData>().ToList());
        }
Ejemplo n.º 2
0
        public void UpdateButton(AdminPlayerEntryData playerEntryData, Action <AdminPlayerEntry> onClickEvent, GUI_Notification masterNotification = null,
                                 bool disableInteract = false, bool hideSensitiveFields = false)
        {
            parentNotification = masterNotification;
            OnClickEvent       = onClickEvent;
            PlayerData         = playerEntryData;
            if (!hideSensitiveFields)
            {
                displayName.text = $"{playerEntryData.name} - {playerEntryData.currentJob}. ACC: {playerEntryData.accountName} {playerEntryData.ipAddress} UUID { playerEntryData.uid}";
            }
            else
            {
                displayName.text = $"{playerEntryData.accountName}";
            }
            if (PlayerData.isAntag && !hideSensitiveFields)
            {
                displayName.color = antagTextColor;
            }
            else
            {
                displayName.color = Color.white;
            }

            if (PlayerData.isAdmin)
            {
                displayName.fontStyle = FontStyle.Bold;
            }
            else
            {
                displayName.fontStyle = FontStyle.Normal;
            }

            if (PlayerData.ipAddress == "")
            {
                offlineNot.SetActive(true);
            }
            else
            {
                offlineNot.SetActive(false);
            }

            if (disableInteract)
            {
                button.interactable = false;
                bg.color            = selectedColor;
            }
            else
            {
                button.interactable = true;
            }

            RefreshNotification();
        }
Ejemplo n.º 3
0
        public void UpdateButton(AdminPlayerEntryData playerEntryData, GUI_AdminTools adminTools)
        {
            pendingMessages.AddRange(playerEntryData.newMessages);
            this.adminTools  = adminTools;
            PlayerData       = playerEntryData;
            displayName.text = $"{playerEntryData.name} - {playerEntryData.currentJob}. ACC: {playerEntryData.accountName} {playerEntryData.ipAddress}";

            if (PlayerData.newMessages.Count > 0)
            {
                msgPendingNot.SetActive(true);
                msgPendingCount.text = PlayerData.newMessages.Count.ToString();
            }
            else
            {
                msgPendingNot.SetActive(false);
            }

            if (PlayerData.isAntag)
            {
                displayName.color = antagTextColor;
            }
            else
            {
                displayName.color = Color.white;
            }

            if (PlayerData.isAdmin)
            {
                displayName.fontStyle = FontStyle.Bold;
            }
            else
            {
                displayName.fontStyle = FontStyle.Normal;
            }

            if (adminTools.SelectedPlayer == playerEntryData.uid)
            {
                adminTools.AddPendingMessagesToLogs(playerEntryData.uid, GetPendingMessage());
            }
        }
Ejemplo n.º 4
0
        public void SetPage(bool isBan, AdminPlayerEntryData playerToKick)
        {
            playerToKickCache          = playerToKick;
            UIManager.IsInputFocus     = true;
            UIManager.PreventChatInput = true;
            if (!isBan)
            {
                kickPage.SetActive(true);
                kickTitle.text       = $"Kick Player: {playerToKick.name}";
                kickReasonField.text = "";
                kickReasonField.ActivateInputField();
            }
            else
            {
                banPage.SetActive(true);
                banTitle.text       = $"Ban Player: {playerToKick.name}";
                banReasonField.text = "";
                banReasonField.ActivateInputField();
                minutesField.text = "";
            }

            gameObject.SetActive(true);
        }
Ejemplo n.º 5
0
        public void SetPage(bool isBan, AdminPlayerEntryData playerToKick, bool isJobBan)
        {
            playerToKickCache          = playerToKick;
            UIManager.IsInputFocus     = true;
            UIManager.PreventChatInput = true;
            if (!isBan && !isJobBan)
            {
                kickPage.SetActive(true);
                kickTitle.text       = $"Kick Player: {playerToKick.name}";
                kickReasonField.text = "";
                kickReasonField.ActivateInputField();
            }
            else if (!isJobBan)
            {
                banPage.SetActive(true);
                banTitle.text       = $"Ban Player: {playerToKick.name}";
                banReasonField.text = "";
                banReasonField.ActivateInputField();
                minutesField.text = "";
            }
            else
            {
                jobBanPage.SetActive(true);
                jobBanTitle.text       = $"Job Ban Player: {playerToKick.name}";
                jobBanReasonField.text = "";
                jobBanReasonField.ActivateInputField();
                jobBanMinutesField.text   = "";
                jobBanPermaBanToggle.isOn = false;

                ClientJobBanDataAdminMessage.Send(DatabaseAPI.ServerData.UserID, PlayerList.Instance.AdminToken, playerToKick.uid);

                jobBanActionAfterDropDown.value = 0;
            }

            gameObject.SetActive(true);
        }