Esempio n. 1
0
        public static void LoadItems()
        {
            var reader = DatabaseManager.Provider.ExecuteReader("SELECT * FROM bidhouse_items");
            int nbr    = 0;
            var BItems = new List <BidHouseItem>();

            while (reader.Read())
            {
                //TODO Load item after consulting HDV .. but i think not good idea
                BidHouse bHouse       = null;
                var      ItemToDelete = new List <long>();
                if (!Cache.TryGetValue(reader.GetInt16("map"), out bHouse))
                {
                    continue;
                }

                var BItem = new BidHouseItem()
                {
                    Price    = reader.GetInt64("price"),
                    Quantity = reader.GetInt32("count"),
                    Owner    = reader.GetInt32("owner"),
                    ItemID   = reader.GetInt64("item"),
                    BH       = bHouse
                };

                BItems.Add(BItem);

                nbr++;
            }
            reader.Close();
            BItems.ForEach(x => x.Initialize());

            Logger.Info("Loaded @'" + nbr + "'@ BidHouse Items");
        }
Esempio n. 2
0
        public async void OnCommand(IAccount account, string[] args)
        {
            try
            {
                if (args.Length < 1)
                {
                    Logger.Default.Log("Vous devez spécifier l'id de l'item à chercher", LogMessageType.Error);
                }
                else
                {
                    var itemid = Convert.ToUInt32(args[0]);

                    var hdv = new BidHouse(account);
                    if (!await hdv.StartBidHouseDialog())
                    {
                        return;
                    }
                    if (!await hdv.LoadItemData(itemid))
                    {
                        return;
                    }

                    var prices = hdv.ItemPricesList.FirstOrDefault();
                    Logger.Default.Log(
                        $" Prix de {D2OParsing.GetItemName(itemid)} => 1:{prices[0]}-  10:{prices[1]} - 100:{prices[2]} - Mean:{hdv.MeanPrice}");

                    hdv.ExitBidHouseDialog();
                }
            }
            catch (Exception ex)
            {
                Logger.Default.Log($"{CommandSufix} Error : {ex.Message}", LogMessageType.Error);
                Logger.Default.Log($"{CommandSufix} StackTrace : {ex.StackTrace}", LogMessageType.Error);
            }
        }
Esempio n. 3
0
        public Character(IAccount account)
        {
            Account       = account;
            Stats         = new CharacterCharacteristicsInformations();
            Look          = new EntityLook();
            Restrictions  = new ActorRestrictionsInformations();
            Spells        = new List <SpellItem>();
            Status        = CharacterStatus.Disconnected;
            Jobs          = new List <JobExperience>();
            GatherManager = new GatherManager(Account);
            PathManager   = new PathManager(Account);

            Achievement = new Achievement(Account);
            Alliance    = new Alliance(Account);
            BidHouse    = new BidHouse(Account);
            Chat        = new Chat(Account);
            Map         = new Map(Account);
            Fight       = new Fight(Account);
            Friend      = new Friend(Account);
            Guild       = new Guild(Account);
            Inventory   = new Inventory(Account);
            Party       = new Party(Account);

            #region Choice Handler

            account.Network.RegisterPacket <BasicCharactersListMessage>(HandleBasicCharactersListMessage,
                                                                        MessagePriority.VeryHigh);
            account.Network.RegisterPacket <CharactersListMessage>(HandleCharactersListMessage,
                                                                   MessagePriority.VeryHigh);
            account.Network.RegisterPacket <CharacterSelectedSuccessMessage>(HandleCharacterSelectedSuccessMessage,
                                                                             MessagePriority.VeryHigh);

            #endregion Choice Handler

            #region Creation Handler

            account.Network.RegisterPacket <CharacterCanBeCreatedResultMessage>(HandleCharacterCanBeCreatedResultMessage,
                                                                                MessagePriority.VeryHigh);
            account.Network.RegisterPacket <CharacterCreationResultMessage>(HandleCharacterCreationResultMessage,
                                                                            MessagePriority.VeryHigh);
            account.Network.RegisterPacket <CharacterNameSuggestionFailureMessage>(
                HandleCharacterNameSuggestionFailureMessage, MessagePriority.VeryHigh);
            account.Network.RegisterPacket <CharacterNameSuggestionSuccessMessage>(
                HandleCharacterNameSuggestionSuccessMessage, MessagePriority.VeryHigh);

            #endregion Creation Handler

            #region Deletion Handler

            account.Network.RegisterPacket <CharacterDeletionErrorMessage>(HandleCharacterDeletionErrorMessage,
                                                                           MessagePriority.VeryHigh);

            #endregion Deletion Handler

            #region Stats Handler

            account.Network.RegisterPacket <CharacterStatsListMessage>(HandleCharacterStatsListMessage,
                                                                       MessagePriority.VeryHigh);
            account.Network.RegisterPacket <CharacterExperienceGainMessage>(HandleCharacterExperienceGainMessage,
                                                                            MessagePriority.VeryHigh);
            account.Network.RegisterPacket <CharacterLevelUpInformationMessage>(HandleCharacterLevelUpInformationMessage,
                                                                                MessagePriority.VeryHigh);
            account.Network.RegisterPacket <CharacterLevelUpMessage>(HandleCharacterLevelUpMessage,
                                                                     MessagePriority.VeryHigh);
            account.Network.RegisterPacket <LifePointsRegenEndMessage>(HandleLifePointsRegenEndMessage,
                                                                       MessagePriority.VeryHigh);
            account.Network.RegisterPacket <UpdateLifePointsMessage>(HandleUpdateLifePointsMessage,
                                                                     MessagePriority.VeryHigh);

            #endregion Stats Handler

            #region Initialization Handler

            account.Network.RegisterPacket <CharacterLoadingCompleteMessage>(HandleCharacterLoadingCompleteMessage,
                                                                             MessagePriority.VeryHigh);
            account.Network.RegisterPacket <OnConnectionEventMessage>(HandleOnConnectionEventMessage,
                                                                      MessagePriority.VeryHigh);
            account.Network.RegisterPacket <SetCharacterRestrictionsMessage>(HandleSetCharacterRestrictionsMessage,
                                                                             MessagePriority.VeryHigh);

            #endregion Initialization Handler

            Account.Network.RegisterPacket <MapComplementaryInformationsDataMessage>(
                HandleMapComplementaryInformationsDataMessage, MessagePriority.Normal);
            Account.Network.RegisterPacket <GameContextRefreshEntityLookMessage>(
                HandleGameContextRefreshEntityLookMessage, MessagePriority.Normal);
        }
Esempio n. 4
0
 public MarketBuyExchange(WorldClient Client, BidHouse BH)
 {
     this.myClient     = Client;
     this.Market       = BH;
     this.ExchangeType = (int)ExchangeTypeEnum.EXCHANGE_BIGSTORE_BUY;
 }