Git Product home page Git Product logo

mod-auctionator's Introduction

mod-auctionator

This mod is meant to keep a healthy auction house stocked on a low-pop server. It's in it's early phases of building/testing/configuration but keeps a LOT of stuff in the AH. Code is also a little rough right now but I haven't done c++ in 20+ years so I am getting there.

Installation and Setup

  1. Download the code into your source code modules/ folder
  2. Do the Compilation Things as best you can.
  3. Run the database script in mod-auctionator/data/sql/db-world/base/2023-09-18.sql against your acore_world database.
  4. NOTE you may not need to do this, looks like server runs this automatically? Run the database script in modules/mod-auctionator/data/sql/db-characters/updates/2023_11_12_00_marketprice.sql against your acore_characters database.
  5. If you want a fresh start clear you auction house with these SQL commands. Do this ONLY when your server is stopped. The AH is cached in memory and if you do this while your server is running then likely ... things won't go well. Run this against your character database (default of acore_characters).
DELETE FROM `item_instance` WHERE `guid` IN (SELECT `itemguid` FROM `auctionhouse`);
DELETE FROM `auctionhouse`;

GM commands

auctionator add

ItemID can be looked up in the database table item_template.

Add an Iridescent Pearl to the Neutral AH for 1 gold buyout.

.auctionator add 7 5500 10000

auctionator auctionspercycle

Set the number of auctions per cycle that get added to each auction house. This setting is shared by all houses. You should keep this number lower than query limit or else ... I don't know, try it and see.

Also this has a direct impact on how hard each cycle hits your worldserver and your mysql server so if you are running on smaller hardware you might want to tune this and the query limit down to lower numbers.

.auctionator auctionspercycle 45

auctionator bidonown

Enable bidding on the auctions created by the auctionator. There is really no reason to do this other than to test the buyer and make sure it's working. You could use this to potentially have more turnover in your auction houses but I am not sure how well that would work.

Valid values are 1 to enable and 0 to disable.

.auctionator bidonown 1

auctionator disable seller

Disable the seller for a particular faction.

.auctionator disable hordeseller

auctionator enable seller

Enable the seller for a particular faction.

.auctionator enable hordeseller

auctionator expireall

Expire all auctions for the specified house on the next tick.

.auctionator expireall 7

auctionator multiplier

Typetext is either seller or bidder depending on which you want to set.

Set the sell and buy multiplier for a quality. Qualities are:

  • poor
  • normal
  • uncommon
  • rare
  • epic
  • legendary

Multiplier is a decimal value. Defaults are set in the config file.

.auctionator multiplier bidder epic 10

auctionator status

Shows the status of the in memory configs as well as the current auction houses. Useful for checking config values that may have changed or checking on auction counts. Example output below.

.auctionator status

Output:

[Auctionator] Status:

 Enabled: 1

 CharacterGuid: 2
 Horde:
    Seller Enabled: 1
        Max Auctions: 20000
        Auctions: 9319
    Bidder Enabled: 1
        Cycle Time: 2
        Per Cycle: 20
 Alliance:
    Seller Enabled: 1
        Max Auctions: 20000
        Auctions: 8959
    Bidder Enabled: 1
        Cycle Time: 1
        Per Cycle: 20
 Neutral:
    Seller Enabled: 1
        Max Auctions: 20000
        Auctions: 9379
    Bidder Enabled: 1
        Cycle Time: 3
        Per Cycle: 30
 Seller Multipliers:
    Poor: 1.000000
    Normal: 1.000000
    Uncommon: 1.500000
    Rare: 2.000000
    Epic: 6.000000
    Legendary: 10.000000
 Bidder Multipliers:
    Poor: 1.000000
    Normal: 1.000000
    Uncommon: 1.500000
    Rare: 2.000000
    Epic: 6.000000
    Legendary: 10.000000
 Seller settings:
    Auctions per run: 100
    Query Limit: 1000
    Default Price: 10000000

Importing Marketplace Data (v0.6)

There is a helper script in mod-auctionator/apps/marketprices for creating the sql to import the market data from a csv. You need to start the server first to make sure that the mod_auctionator_market_price table has been created. Using a newer version of Node (18+ should do it) you can generate insert queries that you can pipe to mysql something like this:

cd apps/marketprice
cp ~/mypricedata.csv .

# only need to do this the first time
npm install
node index.js mypricedata.csv | mysql -u <dbuser> -p <character_database_name>

The script skips the first line and expects the following columns:

scan_datetime,item_entry,avg_price,minimum_buyout,minimum_bid,item_count

minimum_buyout, minimum_bid, and item_count are currently not used for anything and can be set to 0.

Current limitations

  1. Stacks are acting weird, especially things like enchanter rods. This is now fixed BUT many stacks with the multipler are maxed out now to 20 and way to expensive. Whoopsie.
  2. No control on stack size, it is hard coded to 20 (you can edit and recompile).
  3. No control over item ranges (you can change the query).

mod-auctionator's People

Contributors

icemansparks avatar james-huston avatar rv-jhuston avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mod-auctionator's Issues

chore: Warnings being throw when compiling

I am seeing the following warnings when compiling. It do not see any issues with functionality though, so not urgent.

28.76 [ 18%] Built target dbimport
28.82 /azerothcore/modules/mod-auctionator/src/Auctionator.cpp:372:74: warning: unused parameter 'config' [-Wunused-parameter]
28.82 float Auctionator::GetQualityMultiplier(AuctionatorPriceMultiplierConfig config, uint32 quality)
28.82                                                                          ^
28.82 1 warning generated.
28.84 [ 18%] Building CXX object src/server/scripts/CMakeFiles/scripts.dir/cmake_pch.hxx.pch
28.88 [ 18%] Building CXX object modules/CMakeFiles/modules.dir/mod-auctionator/src/AuctionatorCommands.cpp.o
28.90 [ 18%] Building CXX object modules/CMakeFiles/modules.dir/mod-auctionator/src/AuctionatorSeller.cpp.o
28.90 [ 19%] Building CXX object modules/CMakeFiles/modules.dir/mod-auctionator/src/AuctionatorEvents.cpp.o
28.92 [ 19%] Building CXX object modules/CMakeFiles/modules.dir/mod-auctionator/src/Auctionator_loader.cpp.o
28.93 [ 19%] Building CXX object modules/CMakeFiles/modules.dir/mod-auctionator/src/AuctionatorScript.cpp.o
28.94 [ 19%] Building CXX object modules/CMakeFiles/modules.dir/mod-autobalance/src/AutoBalance.cpp.o
28.95 [ 19%] Building CXX object modules/CMakeFiles/modules.dir/mod-autobalance/src/AB_loader.cpp.o
28.97 [ 19%] Building CXX object modules/CMakeFiles/modules.dir/mod-better-item-reloading/src/BIR_loader.cpp.o
29.02 /azerothcore/modules/mod-auctionator/src/AuctionatorCommands.cpp:19:21: warning: 'ChatCommand' is deprecated: std::vector<ChatCommand> should be ChatCommandTable! (using namespace Acore::ChatCommands) [-Wdeprecated-declarations]
29.02         std::vector<ChatCommand> GetCommands() const override
29.02                     ^
29.02 /azerothcore/src/server/game/Chat/ChatCommands/ChatCommand.h:277:21: note: 'ChatCommand' has been explicitly marked deprecated here
29.02 using ChatCommand [[deprecated("std::vector<ChatCommand> should be ChatCommandTable! (using namespace Acore::ChatCommands)")]] = Acore::ChatCommands::ChatCommandBuilder;
29.02                     ^
29.02 /azerothcore/modules/mod-auctionator/src/AuctionatorCommands.cpp:21:32: warning: 'ChatCommand' is deprecated: std::vector<ChatCommand> should be ChatCommandTable! (using namespace Acore::ChatCommands) [-Wdeprecated-declarations]
29.02             return std::vector<ChatCommand>
29.02                                ^
29.02 /azerothcore/src/server/game/Chat/ChatCommands/ChatCommand.h:277:21: note: 'ChatCommand' has been explicitly marked deprecated here
29.02 using ChatCommand [[deprecated("std::vector<ChatCommand> should be ChatCommandTable! (using namespace Acore::ChatCommands)")]] = Acore::ChatCommands::ChatCommandBuilder;
29.02                     ^
29.02 /azerothcore/modules/mod-auctionator/src/AuctionatorCommands.cpp:23:16: warning: 'ChatCommandBuilder' is deprecated: you are using the old-style command format; convert this to the new format ({ name, handler (not a pointer!), permission, Console::(Yes/No) }) [-Wdeprecated-declarations]
29.02                {
29.02                ^
29.02 /azerothcore/src/server/game/Chat/ChatCommands/ChatCommand.h:257:9: note: 'ChatCommandBuilder' has been explicitly marked deprecated here
29.02         ChatCommandBuilder(char const* name, uint32 securityLevel, bool console, TypedHandler* handler, char const*)
29.02         ^
29.02 3 warnings generated.

Issue Initializing Data Stores

System Information
Windows 11

Issue
When starting worldserver.exe, initialize data stores stops with the following errors:

Initialize Data Stores...

Some required *.dbc files (2 from 110) not found or not compatible: C:\Azerothcore Moduled w AH Build\bin\RelWithDebInfo\Data/dbc/CharStartOutfit.dbc exists, and has 0 field(s) (expected 77). Extracted file might be from wrong client version or a database-update has been forgotten.

C:\Azerothcore Moduled w AH Build\bin\RelWithDebInfo\Data/dbc/SkillRaceClassInfo.dbc exists, and has 0 field(s) (expected 8). Extracted file might be from wrong client version or a database-update has been forgotten.

The files in question have been altered in order to install All Races All Classes, so I'm unsure if this conflict is expected or unintentional.

Expected Behavior
Module loads data stores and works alongside All Races All Classes.

Solution:
.dbc files were not correctly transferred, this was user-error on my part. Setting up Auctionator now, thanks!

v0.3 - Worldserver is not starting up fully after module installation

After installation, new CMake and build, my worldserver now is now closing itself at

AzerothCore rev. c9ab7e7e9678 2023-10-17 08:40:55 +0000 (master branch) (Win64, RelWithDebInfo, Static) (worldserver-daemon) ready... [Auctionator]: Auctionator initializing...

The errorlog is empty but there is a crash file created in /crashes which i will add here as well.
Removing the module solves the problem and the server is running just as before.
c9ab7e7e9678_worldserver.exe_[17-10_20-25-11].txt

[Suggestion] Readme correction

The SQL queries provided in the readme, related to performing a clean setup, are wrong. I don't think I have to explain what I'm talking about but just in case, acore_world.mod_acore_characters.item_instance is not a table.

I also don't think you should include the name of the database in the queries but instead tell the user they have to run it against their characters database. This is something that has been corrected multiple times with AzerothCore because it produces errors for enough people, say if they're not using the "standard" database names.

In case you want to keep it as simple as possible, I would instead suggest doing something like this. There is no reason to use aliases if you have absolutely no use for them.

DELETE FROM `item_instance` WHERE `guid` IN (SELECT `itemguid` FROM `auctionhouse`);
DELETE FROM `auctionhouse`;

Items without market price are posted with squared qualityMultiplier

Quality multiplier is applied here for items without market price

if (price == 0) {
price = 10000000 * qualityMultiplier;
}

and here for all items

newItem.buyout = uint32(price * stackSize * qualityMultiplier);
newItem.bid = uint32(bidPrice * stackSize * qualityMultiplier);

I don't think this is intended; is it a bug? Perhaps the items without market price should just use nator->config->sellerConfig.defaultPrice without qualityMultiplier since it's applied later. Or, maybe don't multiply items that have market prices, i.e.

newItem.buyout = uint32(price * stackSize);
newItem.bid = uint32(bidPrice * stackSize);

I could see either way.

Mod Runs even when disabled in Config

When config is set to disable it still runs in the world server

Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3

[worldserver]

Auctionator configuration

Auctionator.Enable
    Description: Enable my module and print "Hello World" message at server start
    Default:     0 - Disabled
                 1 - Enabled

Auctionator.Enabled = 0

See world server output:

AzerothCore rev. e863873d4c80 2024-04-03 19:36:53 +0000 (master branch) (Win64, RelWithDebInfo, Static) (worldserver-daemon) ready...
Loading account bound templates...

Loaded 205 companion templates
Loaded 1 faction-specific companion templates
Loaded 246 mount templates
Loaded 73 faction-specific mount templates
[Auctionator]: Auctionator initializing...
[Auctionator] Initializing Auctionator Config
[Auctionator] config->isEnabled: 0
[Auctionator] CharacterIds: 2::1
[Auctionator] Auctionator config initialized
[Auctionator] Event init
[AuctionatorEvents] Initializing events
[Auctionator]: Auctionator disabled.
AC> Starting up Auction House Listing thread...
Calendar deletion of old events.
[Auctionator] - - - - - - - - - - - - - - - - - - - -
[Auctionator] Neutral count: 5100
[Auctionator] Alliance count: 5097
[Auctionator] Horde count: 5100
[Auctionator] UpdatingEvents
[AuctionatorEvents] Executing events
[AuctionatorEvents] Executing event: AllianceSeller
[AuctionatorEvents] Alliance count over max: 5097
[AuctionatorEvents] Executing event: HordeSeller
[AuctionatorEvents] Horde count over max: 5100
[AuctionatorEvents] Executing event: NeutralSeller
[AuctionatorEvents] Neutral count over max: 5100
[Auctionator] ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.