Example #1
0
        /// <summary>
        /// Check whether the player given as playerId should make use of the here defined override values
        /// </summary>
        /// <param name="playerId"></param>
        /// <returns>true if the player should be affected</returns>
        public bool IsAffected(VRCPlayerApi player)
        {
            if (!udonDebug.Assert(playerList, "playerList invalid", this))
            {
                return(false);
            }

            if (!udonDebug.Assert(Utilities.IsValid(player), "Player to remove invalid", this))
            {
                return(false);
            }

            return(playerList.Contains(player));
        }
Example #2
0
        public void AddPlayerToGroup(string playerID)
        {
            if (!PlayerList.Contains(playerID))
            {
                InformPlayersInGroup(MySockets.Server.GetAUser(playerID).Player.FullName + " has joined the group.");

                PlayerList.Add(playerID);
                MySockets.Server.GetAUser(playerID).GroupName = GroupName;
                if (PendingInvitations.Contains(playerID))
                {
                    PendingInvitations.Remove(playerID);
                }
                if (PendingRequests.Contains(playerID))
                {
                    PendingRequests.Remove(playerID);
                }

                InformPlayerInGroup("You have joined '" + GroupName + "'.", playerID);
            }

            if (GroupRuleForLooting == GroupLootRule.Master_Looter && string.IsNullOrEmpty(MasterLooter))
            {
                MySockets.Server.GetAUser(LeaderID).MessageHandler("You have not yet assigned someone in the group as the master looter.");
            }
        }
Example #3
0
 public void AssignMasterLooter(string leaderID, string playerID)
 {
     if (GroupRuleForLooting == GroupLootRule.Master_Looter)
     {
         if (string.Equals(leaderID, LeaderID))
         {
             playerID = MySockets.Server.GetAUserByFullName(playerID).UserID;
             if (PlayerList.Contains(playerID))
             {
                 MasterLooter = playerID;
                 InformPlayersInGroup(string.Format("{0} has been assigned by {1} as the group Master looter.", MySockets.Server.GetAUser(playerID).Player.FullName, MySockets.Server.GetAUser(LeaderID).Player.FullName), new List <string>()
                 {
                     playerID
                 });
                 InformPlayerInGroup(string.Format("You have been designated the group Master Looter by {0}.", MySockets.Server.GetAUser(LeaderID).Player.FullName), playerID);
             }
         }
         else
         {
             MySockets.Server.GetAUser(leaderID).MessageHandler("Only the group leader can assign a master looter.");
         }
     }
     else
     {
         MySockets.Server.GetAUser(leaderID).MessageHandler("You can only assign a master looter if the group looting rule is set to master looter.");
     }
 }
Example #4
0
 public void PromoteToLeader(string newLeaderID)
 {
     if (PlayerList.Contains(newLeaderID))
     {
         LeaderID = newLeaderID;
         InformPlayersInGroup(MySockets.Server.GetAUser(LeaderID).Player.FullName + " has been promoted to group leader.", new List <string>()
         {
             LeaderID
         });
         InformGroupLeader("You have been promoted to group leader of " + GroupName);
     }
 }
Example #5
0
 public void RemovePlayerFromGroup(string playerID)
 {
     if (PlayerList.Contains(playerID))
     {
         PlayerList.Remove(playerID);
         InformPlayersInGroup(MySockets.Server.GetAUser(playerID).Player.FullName + " has left the group.", new List <string>()
         {
             playerID
         });
         InformPlayerInGroup("You have left '" + GroupName + "'.", playerID);
     }
 }
Example #6
0
 /// <summary>
 /// プライヤー追加コマンド実行可否判定
 /// </summary>
 /// <returns>true=実行可/false=実行不可</returns>
 private bool CanAddPlayer()
 {
     // プレイヤー名の入力があるかどうか
     return(!string.IsNullOrEmpty(AddPlayerName) && !PlayerList.Contains(AddPlayerName) && !IsGamePlaying);
 }
Example #7
0
 public bool HasPlayer(string playerID)
 {
     return(PlayerList.Contains(playerID));
 }