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

            collection.Update(mp);
        }