]> jfr.im git - z_archive/kelsier.git/blob - Info.cs
Adding auth
[z_archive/kelsier.git] / Info.cs
1 using System;
2 using System.IO;
3 using System.Collections.Generic;
4 using System.Linq;
5 using System.Text;
6
7 namespace Kelsier.Common {
8 static public class Info {
9 static public Database db;
10 static public Logger log;
11
12 static public string moduledir;
13
14 static private Dictionary<string, IModule> _modules = new Dictionary<string,IModule>();
15 static private Dictionary<string, Hook> _hooks = new Dictionary<string,Hook>();
16 static private Dictionary<int, Bot> _bots = new Dictionary<int,Bot>();
17
18 static public Dictionary<string, IModule> modules { get { return _modules; } }
19 static public Dictionary<string, Hook> hooks { get { return _hooks; } }
20 static public Dictionary<int, Bot> bots { get { return _bots; } }
21
22
23 static public void refreshmods() {
24 foreach (string name in Info.modules.Keys)
25 unloadmod(name);
26
27 string[] modulefiles;
28 modulefiles = Directory.GetFiles(moduledir + @"\autoload");
29
30 foreach (string file in modulefiles)
31 loadmodfile(file);
32 }
33
34 static public void loadmodfile(string file) {
35
36 }
37 static public void loadmod(string name) {
38 string filename = name + ".kel.dll";
39 if (File.Exists(moduledir + @"\autoload\" + filename))
40 loadmodfile(moduledir + @"\autoload\" + filename);
41 else if (File.Exists(moduledir + @"\" + filename))
42 loadmodfile(moduledir + @"\" + filename);
43 else
44 throw new FileNotFoundException();
45 }
46 static public void unloadmod(string name) {
47 }
48 static public void reloadmod(string name) {
49 }
50 }
51 }