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

            collection.Update(mp);
        }