Ejemplo n.º 1
0
        void AnnounceMove(NetworkUser user, TeamPicker.StateType state)
        {
            string  teamText  = "Unassigned";
            Color32 teamColor = new Color32(209, 209, 209, 255);

            switch (state)
            {
            case TeamPicker.StateType.Team1:
                teamText  = "Team 1";
                teamColor = new Color32(57, 255, 58, 255);
                break;

            case TeamPicker.StateType.Team2:
                teamText  = "Team 2";
                teamColor = new Color32(255, 75, 57, 255);
                break;

            default:
                break;
            }

            Chat.SendBroadcastChat(new Chat.SimpleChatMessage
            {
                baseToken = Util.GenerateColoredString(user.GetNetworkPlayerName().GetResolvedName(), new Color32(146, 222, 255, 255)) + " is moved to " + Util.GenerateColoredString(teamText, teamColor)
            });
        }
        private static PermissionLevel GetPermissionLevel(this NetworkUser networkUser)
        {
            var adminList = _adminList.Value.Split(',');

            if (adminList.Contains(networkUser.GetNetworkPlayerName().steamId.value.ToString()))
            {
                return(PermissionLevel.Admin);
            }

            var subAdminList = _subAdminList.Value.Split(',');

            if (subAdminList.Contains(networkUser.GetNetworkPlayerName().steamId.value.ToString()))
            {
                return(PermissionLevel.SubAdmin);
            }

            return(PermissionLevel.None);
        }
Ejemplo n.º 3
0
        private static Level GetPermissionLevel(this NetworkUser networkUser)
        {
            var userSteamId = networkUser.GetNetworkPlayerName().steamId.value;

            if (AdminSteamIdList.Contains(userSteamId))
            {
                return(Level.Admin);
            }

            if (SubAdminSteamIdList.Contains(userSteamId))
            {
                return(Level.SubAdmin);
            }

            return(Level.None);
        }
Ejemplo n.º 4
0
        // Token: 0x0600245A RID: 9306 RVA: 0x000AA828 File Offset: 0x000A8A28
        public void UpdateElements()
        {
            int num = 0;

            if (this.voteController)
            {
                num = this.voteController.GetVoteCount();
            }
            this.AllocateIndicators(num);
            for (int i = 0; i < num; i++)
            {
                VoteController.UserVote vote = this.voteController.GetVote(i);
                this.indicators[i].image.sprite = (vote.receivedVote ? this.hasVotedSprite : this.hasNotVotedSprite);
                string userName;
                if (vote.networkUserObject)
                {
                    NetworkUser component = vote.networkUserObject.GetComponent <NetworkUser>();
                    if (component)
                    {
                        userName = component.GetNetworkPlayerName().GetResolvedName();
                    }
                    else
                    {
                        userName = Language.GetString("PLAYER_NAME_UNAVAILABLE");
                    }
                }
                else
                {
                    userName = Language.GetString("PLAYER_NAME_DISCONNECTED");
                }
                this.indicators[i].tooltipProvider.SetContent(TooltipProvider.GetPlayerNameTooltipContent(userName));
            }
            bool flag = this.voteController && this.voteController.timerStartCondition != VoteController.TimerStartCondition.Never;

            this.timerPanelObject.SetActive(flag);
            if (flag)
            {
                float num2 = this.voteController.timer;
                if (num2 < 0f)
                {
                    num2 = 0f;
                }
                int num3 = Mathf.FloorToInt(num2 * 0.016666668f);
                int num4 = (int)num2 - num3 * 60;
                this.timerLabel.text = string.Format("{0}:{1:00}", num3, num4);
            }
        }
Ejemplo n.º 5
0
        void Start()
        {
            //Bind
            PlayerNameText = transform.Find("Player Name Mask/Player Name Text").GetComponent <TextMeshProUGUI>();
            LeftButton     = transform.Find("Left Button").GetComponent <Button>();
            RightButton    = transform.Find("Right Button").GetComponent <Button>();
            UITransform    = GetComponent <RectTransform>();

            if (Slot)
            {
                PlayerNameText.text = Slot.GetNetworkPlayerName().GetResolvedName();

                //Set listeners
                LeftButton.onClick.AddListener(MoveLeft);
                RightButton.onClick.AddListener(MoveRight);
            }
            else
            {
                Debug.LogWarning("Warning! Player slot was created but slot is null @RoR2PVP");
            }
        }
Ejemplo n.º 6
0
 public void CompleteQuest()
 {
     Server.CompletedQuest(networkUser);
     complete = true;
     completionTime = Run.instance.GetRunStopwatch();
     foreach (var player in PlayerCharacterMasterController.instances) {
         if (player.networkUser == networkUser) {
             player.master.inventory.GiveItem(PickupCatalog.GetPickupDef(reward).itemIndex);
             Announcement message = new Announcement(
                 String.Format("Good work <b><color=orange>{0}</color></b>, you have been rewarded.", networkUser.GetNetworkPlayerName().GetResolvedName())
             );
             Networking.SendAnnouncement(message, networkUser.connectionToClient.connectionId);
         }
     }
 }