![]() |
|
[C#] Modulebot 2 - Plugin based twitchbot - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [C#] Modulebot 2 - Plugin based twitchbot (/showthread.php?tid=4939254) |
Modulebot 2 - Plugin based twitchbot - BahNahNah - Aug 7, 2015 My first attempt at a plugin system was terrible, i had no idea what i was doing, i want using interfaces property ect. So after doing some research on plugin systems i have tried again. Source: Github Example plugin (included in source): Github Gif: Spoiler (Click to View) Any feedback is appreciated. * - SIM-1676753 - Aug 7, 2015 Parameter* It looks nice, I know you've been working on it for a while. * - iNCEPTiON_V - Aug 7, 2015 Code private void Plugin_OnException(LoadedPlugin parent, Exception ex)I really liked what youre doing with your exceptions :) I also store them in a list and then when applications ends i need to log them. Are you logging them to ? * - BahNahNah - Aug 7, 2015 (Aug 7, 2015 12:56 AM)iNCEPTiON_V Wrote: Im not logging to a file, but i might add a context option to export the exceptions. * - iNCEPTiON_V - Aug 7, 2015 Ok makes sense :) If i could i would rep you for your SaveSettings() function! Beatiful code right there :) Exactly like my saveSettings() function ! * - Serux - Aug 7, 2015 (Aug 7, 2015 12:59 AM)iNCEPTiON_V Wrote: Ok makes sense :) If i could i would rep you for your SaveSettings() function! Beatiful code right there :) Exactly like my saveSettings() function ! Uhm, not to shit on anyone's parade or anything, but that SaveSettings function is pretty shit. Why not just use the project settings and have it be stored in the .exe.config? That way you're not having to deal with managed code and is incredibly easy to use. * - BahNahNah - Aug 7, 2015 (Aug 7, 2015 01:06 AM)Serux Wrote: Uhm, not to shit on anyone's parade or anything, but that SaveSettings function is pretty shit. Because arnt the project settings stored in appdata? i prefer my settings to be in the same folder, also i know exactly what its doing. I prefer making my own. * - iNCEPTiON_V - Aug 7, 2015 (Aug 7, 2015 01:06 AM)Serux Wrote: Uhm, not to shit on anyone's parade or anything, but that SaveSettings function is pretty shit. Then Please feel free to explain us why that function is "shit". Our company saves settings like that since ages, never had any problems with that . EDIT: nice answer from StackOverflow The registry is a no-go. You're not sure whether the user which uses your application, has sufficient rights to write to the registry. You can use the app.config file to save application-level settings (that are the same for each user who uses your application). I would store user-specific settings in an XML file, which would be saved in Isolated Storage or in the Application Folder Next to that, as from .NET 2.0, it is possible to store values back to the app.config file. * - kemwelly - Aug 8, 2015 (Aug 7, 2015 01:08 AM)iNCEPTiON_V Wrote: Then Please feel free to explain us why that function is "shit". If you move the file or modify it in anyway, the settings gets cleared. * - BahNahNah - Aug 8, 2015 (Aug 8, 2015 12:36 PM)kemwelly Wrote: If you move the file or modify it in anyway, the settings gets cleared. What? No. If you edit the settings file and make it invalid, then yes, the settings get cleared. But why would you want to edit it anyway? * - kemwelly - Aug 8, 2015 (Aug 8, 2015 03:43 PM)BahNahNah Wrote: What? No. I meant the exe, not the file. Sorry * - BahNahNah - Aug 8, 2015 (Aug 8, 2015 06:23 PM)kemwelly Wrote: I meant the exe, not the file. Sorry So your saying if you move the file the settings get cleared? Why not just move the settings file also? what if i wanted to have the option of multiple saves? This is like saying if you moved the exe without the plugin folder, the plugins wont work. Of course they wont, just move the plugins aswell. |