コード例 #1
0
 public void Invoke(ShPlayer player, ShPlayer target, string reason)
 {
     target.AddWarn(player, reason);
     ChatUtils.SendToAllEnabledChatT("all_warned", player.username.CleanerMessage(), target.username.CleanerMessage(), reason.CleanerMessage());
     player.TS("player_warn", target.username.CleanerMessage(), reason.CleanerMessage());
     target.TS("target_warn", player.username.CleanerMessage(), reason.CleanerMessage());
 }
コード例 #2
0
        public void Invoke(ShPlayer player, string target, string reason)
        {
            if (EntityCollections.TryGetPlayerByNameOrID(target, out var shTarget))
            {
                shTarget.AddWarn(player, reason);
                ChatUtils.SendToAllEnabledChatT("all_warned", player.username.CleanerMessage(), shTarget.username.CleanerMessage(), reason.CleanerMessage());
                player.TS("player_warn", shTarget.username.CleanerMessage(), reason.CleanerMessage());
                shTarget.TS("target_warn", shTarget.username.CleanerMessage(), reason.CleanerMessage());
                return;
            }

            if (Core.Instance.SvManager.TryGetUserData(target, out var user))
            {
                user.AddWarn(player, reason);
                ChatUtils.SendToAllEnabledChatT("all_warned", player.username.CleanerMessage(), target.CleanerMessage(), reason.CleanerMessage());
                player.TS("player_warn", target.CleanerMessage(), reason.CleanerMessage());
                Core.Instance.SvManager.database.Users.Upsert(user);
                return;
            }

            player.TS("user_not_found", target.CleanerMessage());
        }
コード例 #3
0
ファイル: Kick.cs プロジェクト: potatomantiger/Core
 public void Invoke(ShPlayer player, ShPlayer target, string reason = "No reason provided.")
 {
     ChatUtils.SendToAllEnabledChatT("all_kick", player.username.CleanerMessage(), target.username.CleanerMessage(), reason.CleanerMessage());
     player.TS("player_kick", target.username.CleanerMessage(), reason.CleanerMessage());
     player.svPlayer.SvKick(target, reason);
 }
コード例 #4
0
 public void Invoke(ShPlayer player, ShPlayer target, string reason = "No reason provided.")
 {
     ChatUtils.SendToAllEnabledChatT("all_ban", player.username.SanitizeString(), target.username.SanitizeString(), reason.SanitizeString());
     player.TS("player_banned", target.username.SanitizeString(), reason.SanitizeString());
     player.svPlayer.SvBan(target.ID, reason);
 }