LandSandBoat / server

:sailboat: LandSandBoat - a server emulator for Final Fantasy XI. Just an X-34 landspeeder out for a drive.

Home Page:https://landsandboat.github.io/server/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

πŸ› AH Announcement module needs an update.

UmeboshiXI opened this issue Β· comments

I affirm:

  • I understand that if I do not agree to the following points by completing the checkboxes my issue will be ignored.
  • I have read and understood the Contributing Guide and the Code of Conduct.
  • I have searched existing issues to see if the issue has already been opened, and I have checked the commit log to see if the issue has been resolved since my server was last updated.

OS / platform the server is running (if known)

Windows 10

Branch affected by issue

base

Steps to reproduce

AH Announcement module has not been updated for latest builds with changes in packet_system and the recent sql changes.

Expected behavior

Player should be able to buy/sell etc on AH. Message should be sent to buyer if they are online on the details of the sale.

AH Announcement module has not been updated for latest builds with changes in packet_system and the recent sql changes.

Is it not building, or not working?

Message wasn't displaying(Saw you opened another issue just now) but didn't have time to look into it much further this morning. I just noticed from a quick comparison between the module and the core the differences (sql-> vs _sql->).

Seems to compile fine and am able to buy.

When cpp modules are created, they have an alias to the global SQL handle (_sql) forwarded to them and renamed to sql internally:

extern std::unique_ptr<SqlConnection> _sql;

// Forward declare
class CPPModule;
namespace moduleutils
{
    void RegisterCPPModule(CPPModule* ptr);
}

class CPPModule
{
public:
    CPPModule()
    : lua(::lua)
    , sql(::_sql) // Here
    {
        moduleutils::RegisterCPPModule(this);
    }

If the SQL handle was empty, or it was unavailable during compilation - everything would explode or fail to compile

That makes sense. Thanks for clarification.

I also saw:

Also saw:
if (gil != nullptr && gil->isType(ITEM_CURRENCY) && gil->getQuantity() >= price) (AH Module)
vs
if (gil != nullptr && gil->isType(ITEM_CURRENCY) && gil->getQuantity() >= price && gil->getReserve() == 0) (packet_system).

Was unsure what getReserve() does specifically. On my phone so its kind of a pain look up/browse. Not related to the issue but saw it was different as well.