Advertisement
Guest User

Untitled

a guest
May 5th, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.69 KB | None | 0 0
  1. Proposed Schema for SQL Tables - TeldraIRC
  2.  
  3. Propposed prefix: tirc_
  4.  
  5. \\\\\\\\\\\\\
  6. \\ Servers \\
  7. \\\\\\\\\\\\\
  8.  
  9. Description: Contains a listing of all the servers tirc can connect.
  10. Table Name: servers
  11. Table Structure: UID|Name|Host1|Host2|Host3|nickname|username|password|auth_string|module_id
  12.  
  13. Structure Explanation:
  14.  
  15. - UID - (Pkey, Unique, auto-increment): Unique identifies each server this bot will connect to. Used for identifying various settings throughout the database.
  16. - Name - (Not Null): The name that Identifies this server to the user.
  17. - host1 - (Not Null): The IP or DNS name of the server.
  18. - host2: The secondary IP or DNS Name of the server. Used if the primary host fails.
  19. - host3: The territary IP or DNS Name of the server. Used if the secondary host fails. Depending on server settings, gives up connecting once this host is reached.
  20. - nickname - (Not Null): The Nick the bot uses to connect to the server.
  21. - username: The username used to identify with this server. Seperate from nickname (Although can be the same) to maintain NickName transparency.
  22. - password: Encrtyped password used to identify with this server.
  23. - auth_string(Not Null): Specified if a seperate module isn't used to connect to the server, or there was an error loading the module. Can contain the variables %u and %p used place where the username and password go (highly recommended).
  24. - module_id: Identifies the module used for authentication with this server. If no module is found and username and password aren't blank, auth_string is used to authenticate with the service.
  25.  
  26. \\\\\\\\\\\\\\\\\\\\\
  27. \\ Server Settings \\
  28. \\\\\\\\\\\\\\\\\\\\\
  29.  
  30. Description: Stores per server configuration information.
  31. Table Name: server_Settings
  32.  
  33. \\\\\\\\\\\\\\\\\\
  34. \\ Server Users \\
  35. \\\\\\\\\\\\\\\\\\
  36.  
  37. Description: Contains a listing of users the bot can identify and are assigned to channels on various servers.
  38. Table Name: channel_users
  39. table Structure: UID|Server_ID|nickname|hostmask|email|username|password|password_salt|secret_question|secret_answer|cookie|creation_date|last_login
  40.  
  41. Structure Explanation:
  42.  
  43. - Index - (Pkey, Unique, Auto-increment): Unique identity for users per server.
  44. - server_id - (not null): identifies the server that this user was added under.
  45. - nickname - (not null): The last known nickname of the user.
  46. - hostmask - (Not Null): The last known good HostName of the user.
  47. - email: A registered email for the user. Used for accessing account in-case of hostmask change.
  48. - username: A seperate username from the nickname that can be used to authenticate with the bot.
  49. - password: MD5 hashed Password used for additional authentication with the bot (Aside from hostmask).
  50. - password_salt: USed for prevetion of birthday attacks.
  51. - secret_question: A Challenge question for recovering a lost account.
  52. - Secret_answer: A Reply to the challenge question for recovering a lost account.
  53. - cookie: Used for verifying a new hostmask.
  54. - creation_date (Not Null): When the account was first created.
  55. - last_login - (not null): Last time the user was logged into the bot. Used for sorting out old accounts.
  56.  
  57. \\\\\\\\\\\\\\
  58. \\ Channels \\
  59. \\\\\\\\\\\\\\
  60.  
  61. Description: Contains a listing of all the channels the bot joins
  62. Table Name: channels
  63. Table Structure: uid|server_id (not null)|name (not null)|key|module_id
  64.  
  65. Structure Explanation:
  66.  
  67. - UID - (Pkey, Unique, Auto-Increment): Unique Identifies each channel. Used to tie in user permissions with each channel.
  68. - server_id - (Not Null): the UID of the server this channel belongs to.
  69. - name - (Not Null): The name of the channel to join. Must start with #.
  70. - key: The password used to join the channel.
  71. - module_id: Optional module ID used to handle channel duties (i.e user authenication, spam protection, etc etc etc).
  72.  
  73. \\\\\\\\\\\\\\\\\\\\\\\\\
  74. \\ Channel Permissions \\
  75. \\\\\\\\\\\\\\\\\\\\\\\\\
  76.  
  77. Description: Contains user permissions for each channel. Their Access Level
  78. Table Name: channel_permissions
  79. Table Structure: index|channel_id|user_id|access_level|immunity_level
  80.  
  81. Structure Explanation:
  82.  
  83. - index - (Pkey, unique, auto-increment): Unique identifier for the permissions.
  84. - channel_id - (Not NUll): the channel ID this user has permission for.
  85. - user_id - (Not Null): the ID of the user that is assigned permission for that channel.
  86. - access_level - (Not Null): The permissions level number. Can be negative. Used to see if can use a command.
  87. - immunity_level - (Not Null): The immunity level number. Can be negative. Used to see if a command can be used against this user.
  88.  
  89. \\\\\\\\\\\\\\\\\\\\\\\\\\
  90. \\ Module Configuration \\
  91. \\\\\\\\\\\\\\\\\\\\\\\\\\
  92.  
  93. Description: Holds information about various modules like module name, module id, and load state.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement