The easy to use and full featured Irc Bot everyone is talking about!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ServerConfig.cs 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. using System;
  2. using System.Collections.Generic;
  3. namespace Combot.Configurations
  4. {
  5. public class ServerConfig
  6. {
  7. public event Action ModifyEvent;
  8. public string Name { get; set; }
  9. public List<string> Nicknames { get; set; }
  10. public string Realname { get; set; }
  11. public string Username { get; set; }
  12. public string Password { get; set; }
  13. public string Email { get; set; }
  14. public List<string> Owners { get; set; }
  15. public List<string> ChannelBlacklist { get; set; }
  16. public List<string> NickBlacklist { get; set; }
  17. public List<HostConfig> Hosts { get; set; }
  18. public List<ChannelConfig> Channels { get; set; }
  19. public DatabaseConfig Database { get; set; }
  20. public string ModuleLocation { get; set; }
  21. public bool AutoConnect { get; set; }
  22. public bool Reconnect { get; set; }
  23. public bool AutoRegister { get; set; }
  24. public string CommandPrefix { get; set; }
  25. public int JoinDelay { get; set; }
  26. public int MaxMessageLength { get; set; }
  27. public int MessageSendDelay { get; set; }
  28. public ServerConfig()
  29. {
  30. SetDefaults();
  31. }
  32. public void SetDefaults()
  33. {
  34. Name = string.Empty;
  35. Nicknames = new List<string>();
  36. Realname = string.Empty;
  37. Username = string.Empty;
  38. Password = string.Empty;
  39. Email = string.Empty;
  40. AutoConnect = false;
  41. AutoRegister = false;
  42. CommandPrefix = string.Empty;
  43. JoinDelay = 0;
  44. MaxMessageLength = 400;
  45. MessageSendDelay = 0;
  46. ModuleLocation = string.Empty;
  47. Owners = new List<string>();
  48. ChannelBlacklist = new List<string>();
  49. NickBlacklist = new List<string>();
  50. Channels = new List<ChannelConfig>();
  51. Hosts = new List<HostConfig>();
  52. Database = new DatabaseConfig();
  53. }
  54. public void Save()
  55. {
  56. if (ModifyEvent != null)
  57. {
  58. ModifyEvent();
  59. }
  60. }
  61. }
  62. }