예제 #1
0
        /// <summary>
        /// Sending notification email
        /// </summary>
        /// <param name="s">The server the notification is about</param>
        /// <param name="type">The type of notification</param>
        public void SendNotificationEmail(Server s, Enums.NotificationType type)
        {
            //Start creating new notification email
            StringBuilder sb    = new StringBuilder();
            string        title = string.Empty;

            sb.AppendLine("Dear " + Address + ",");
            sb.AppendLine("");
            switch (type)
            {
            case Enums.NotificationType.Online:
                //notify user a server has come back online
                title = "DDOS WATCH NOTIFICATION: SERVER: " + s.IP + ":" + s.PORT + " IS NOW ONLINE";
                sb.AppendLine("DDOS WATCH is happy to inform you that one of your servers has just come back online!");
                sb.AppendLine("Server Information: ");
                sb.AppendLine("IP: " + s.IP);
                sb.AppendLine("PORT: " + s.PORT);
                sb.AppendLine("TIME STAMP: " + DateTime.Now.ToString("HH:mm:ss d/m/y"));
                break;

            case Enums.NotificationType.Offline:
                //notify user that a server has gone offline
                title = "***DDOS WATCH NOTIFICATION: SERVER: " + s.IP + ":" + s.PORT + " IS OFFLINE***";
                sb.AppendLine("DDOS WATCH regrets to inform you that one of your servers has been detected as offline.");
                sb.AppendLine("Server Information: ");
                sb.AppendLine("IP: " + s.IP);
                sb.AppendLine("PORT: " + s.PORT);
                sb.AppendLine("TIME STAMP: " + DateTime.Now.ToString("HH:mm:ss d/m/y"));
                sb.AppendLine("");
                sb.AppendLine("If this downtime was not scheduled by you then your server maybe under attack. Please contact your server administrator immediately for further assistance. If you are the administrator it is reconmended that you check your server settings before assuming that this is a DDOS attack.");
                break;
            }
            sb.AppendLine("");
            sb.AppendLine("---");
            sb.AppendLine("This message was generated by DDOS WATCH, a game server management tool developed by www.jordanhook.com");

            //try to send the email
            notify(title, sb.ToString());
        }
예제 #2
0
        public void Message(string message, Enums.NotificationType notifyType)
        {
            TempData["Notification2"] = message;

            switch (notifyType)
            {
            case Enums.NotificationType.success:
                TempData["NotificationCSS"] = "alert-box success";
                break;

            case Enums.NotificationType.error:
                TempData["NotificationCSS"] = "alert-box errors";
                break;

            case Enums.NotificationType.warning:
                TempData["NotificationCSS"] = "alert-box warning";
                break;

            case Enums.NotificationType.info:
                TempData["NotificationCSS"] = "alert-box notice";
                break;
            }
        }
예제 #3
0
        public void Alert(string title, string message, Enums.NotificationType notificationType)
        {
            var msg = $"<script language='javascript'>swal('{title}','{message}','{notificationType}')" + "</script>";

            TempData["notification"] = msg;
        }
 /// <summary>
 /// Explicit constructor
 /// </summary>
 /// <param name="notifType">identifies notification type, of type Entities.Enums.NotificationType</param>
 /// <param name="notifString">notification message, of type string</param>
 public Notification(Enums.NotificationType notifType, string notifString)
 {
     this.notifType    = notifType;
     this.notifString  = notifString;
     this.wasDisplayed = false;
 }