コード例 #1
0
ファイル: MainFilterscript.cs プロジェクト: Guad/GTACoop
        public static void Ban(this Client client, string Reason, Client IssuedBy = null)
        {
            Ban ban = new Ban()
            {
                Address = client.NetConnection.RemoteEndPoint.Address.ToString(),
                BannedBy = IssuedBy == null ? "Server" : IssuedBy.DisplayName,
                Reason = Reason,
                TimeIssued = DateTime.Now,
                Name = client.DisplayName
            };

            lock (Lists._banned.BannedIps) Lists._banned.BannedIps.Add(ban);
            try {
                client.GetAccount().Ban = ban;
            } catch (Exception ex) {
                Console.WriteLine(string.Format("Ban of player \"{0}\" failed!", client.DisplayName ));
            }
        }
コード例 #2
0
ファイル: MainFilterscript.cs プロジェクト: butich/GTACoop
        public static void Ban(this Client client, string Reason, Client IssuedBy = null)
        {
            Ban ban = new Ban()
            {
                Address = client.NetConnection.RemoteEndPoint.Address.ToString(),
                BannedBy = IssuedBy == null ? "Server" : IssuedBy.DisplayName,
                Reason = Reason,
                TimeIssued = DateTime.Now,
                Name = client.DisplayName,
            };

            lock (Lists._banned.BannedIps) Lists._banned.BannedIps.Add(ban);

            client.GetAccount().Ban = ban;
        }