Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        public void UpdateMainPlayer(LiteDatabase db, MainPlayer mp)
        {
            var collection = db.GetCollection <MainPlayer>("players");

            collection.Update(mp);
        }