Esempio n. 1
0
        public static Player GetPlayer(ulong guildId, ulong id)
        {
            var player = DB.FindOne <Player>($"{guildId}.db", "players", x => x.Id == id);

            if (player == null)
            {
                player = new Player {
                    Id      = id,
                    GuildId = guildId
                };
                DB.Insert($"{guildId}.db", "players", player);
            }

            if (player.Experience == null)
            {
                var characters = Characters.CharacterBase.Characters;
                player.Experience = new ulong[characters.Count()];
            }

            if (player.Items == null)
            {
                player.Items = ItemBase.GetAllItems().ToList();
            }

            return(player);
        }