Exemplo n.º 1
0
        public async Task DynastyUpgrade(SocketReaction reaction, IUserMessage msg)
        {
            switch (reaction.Emote.ToString())
            {
            case EUI.ok:
                _ = await Dynasty.Load(player);

                if (player.dynasty == null)
                {
                    if (Dynasty.Exist(data))
                    {
                        await reaction.Channel.SendMessageAsync(
                            $"Dyansty name {data} is already in use");

                        return;
                    }
                    Dynasty dan = await Dynasty.CreateDynasty(player, data);

                    await DynastyCommands.DynastyHub(player, dan, null, reaction.Channel);
                }
                else
                {
                    //Upgrade
                }
                break;

            case EUI.cancel:
                await TryMSGDel(msg);

                break;
            }
        }
Exemplo n.º 2
0
        public async Task DynastyInvite(SocketReaction reaction, IUserMessage msg)
        {
            switch (reaction.Emote.ToString())
            {
            case EUI.ok:
                if (data != null)
                {
                    Guid    id  = Guid.Parse(data);
                    Dynasty dan = await Dynasty.Load(id);

                    var mem = await dan.AddMemeber(player);

                    await DynastyCommands.DynastyHub(player, dan, mem, reaction.Channel);
                }
                else
                {
                    (Dynasty dan, DynastyMember _, string _) = await Dynasty.Load(player);

                    if (player.dynasty != null)
                    {
                        await dan.RemoveMember(player);

                        await reaction.Channel.SendMessageAsync($"You've left the {dan.name} Dynasty");
                    }
                }
                break;

            case EUI.cancel:
                await TryMSGDel(msg);

                break;
            }
        }
Exemplo n.º 3
0
        internal async Task DeleteFileMongo()
        {
            //Clear data
            EndEncounter();
            if (Party != null)
            {
                Party.RemoveAllPets(this);
                if (IsSolo)
                {
                    if (AreaInfo.TempAreaType)
                    {
                        await AMYPrototype.Program.data.database.DeleteRecord <Areas.AreaPartials.Area>("Dungeons",
                                                                                                        AreaInfo.path, "AreaId");
                    }

                    for (int i = 0; i < Party.NPCMembers.Count; i++)
                    {
                        Party.Remove(i, Area);
                    }
                    await PartyKey.Delete();
                }
                else
                {
                    await Party.Remove(this);
                }
            }
            if (ui?.type == MsgType.ConfirmTransaction)
            {
                Shopping.PendingTransaction.Cancel(this, ui.data);
            }

            ToolsKey?.Delete();
            EggPocketKey?.Delete();
            PetListKey?.Delete();
            ProgressDataKey?.Delete();
            FaithKey?.Delete();
            AdventureKey?.Delete();

            var dynastyData = await Dynasty.Load(this);

            if (dynasty != null)
            {
                await dynastyData.Item1.RemoveMember(this);
            }

            //Delete entries
            await AMYPrototype.Program.data.database.DeleteRecord <Player>("Character", _id, "_id");
        }