Example #1
0
        public void InitUserDB()
        {
            userdb = UserDB.Load();

            this.UserJoinedChannel += new EventHandler<UserJoinEventArgs>(UserDB_UserJoined);
            this.UserPartedChannel += new EventHandler<UserPartEventArgs>(UserDB_UserPart);
            this.ChannelListRecieved += new EventHandler<ChannelListEventArgs>(PS2StatBot_ChannelListRecieved);
        }
Example #2
0
 public static UserDB Load()
 {
     if (!File.Exists(Filename))
     {
         UserDB b = new UserDB();
         b.Save();
     }
     UserDB db;
     JsonSerializer ser = new JsonSerializer();
     using (StreamReader r = new StreamReader(Filename))
     using (JsonTextReader reader = new JsonTextReader(r))
     {
         db = ser.Deserialize<UserDB>(reader);
     }
     return db;
 }