private static RethinkUser New(string id, string name) { RethinkUser User = new RethinkUser(id, name); R.Table("Users").Insert(User).RunNoReply(Con); return(User); }
public void Delete() { RethinkUser User = DB.R.Table("Users").Get(ID).RunAtom <RethinkUser>(DB.Con); User.Blacklisted = false; try { DB.R.Table("User_Blacklist").Get(ID).Delete().Run(DB.Con); } catch { } }
public static async Task <RethinkUser> Get(string id, string name, bool gen) { if (Users.TryGetValue(id, out RethinkUser U)) { return(U); } RethinkUser User = await R.Db("Global").Table("Users").Get(id).RunAtomAsync <RethinkUser>(Con); if (!gen && User == null) { return(null); } if (User == null) { User = New(id, name); } Users.Add(id, User); if (User.Name != name) { User.Update(); } return(User); }