public void RegisterPlayerToDB(LiteDatabase db, MainPlayer mp) { var collection = db.GetCollection <MainPlayer>("players"); collection.Insert(mp); collection.EnsureIndex(x => x.ID); collection.EnsureIndex(x => x.DiscordID); }
public MainPlayer GetMainPlayer(LiteDatabase db, ulong user_disc_id) { var collection = db.GetCollection <MainPlayer>("players"); MainPlayer o = collection.FindOne(x => x.DiscordID == user_disc_id); if (o != null) { return(o); } return(null); }
public void UpdateMainPlayer(LiteDatabase db, MainPlayer mp) { var collection = db.GetCollection <MainPlayer>("players"); collection.Update(mp); }