Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Maplesolaxia hiredmerchant bug

Elite Diviner
Joined
Dec 10, 2012
Messages
475
Reaction score
9
Hello guys , recently just found out the hiredmerchant is not working properly
Sometimes it works just fine but sometimes the item are not given back properly ..

Sometimes it says lack of service tax but it will work after awhile
Then sometimes the items like...I have put 99 pcs of scrolls into my shop . There's a chance that after a day, you talk to Fredrick and it will only you give back 1pcs of scroll .
No one bought anything . There's no mesos to retrieve back.

Any help ??
 
Custom Title Activated
Loyal Member
Joined
Jan 18, 2010
Messages
3,109
Reaction score
1,139
i wouldn't trust moople's hired merchants... someone told me they were buggy, forgot who.

as for your problem, fredrick retrieves that information from database. you should check to see if it saves quantity or overwrites it somewhere when saving.
 
Upvote 0
Elite Diviner
Joined
Dec 10, 2012
Messages
475
Reaction score
9
I tested it by myself actually..Sometimes it works just fine..but sometimes it doesnt..

I looked around the forum ..And I noticed
post by sunnyboy
change
PHP:
mplew.writeInt(chr.getMeso());
to
PHP:
mplew.writeInt(chr.getMerchantMeso());

Maybe that could be the problem? im not sure..

Updated*
It happens when the shop closed after a day ( with scrolls like 30 left for example)
when i retrieve from Fredrick. it will become 1 scroll left..

*Updated
i notice if I used !shutdownnow , and it saves perfectly.
my question now. Which function is to check hiredmerchant save when the world is shutting down?
 
Last edited:
Upvote 0
Elite Diviner
Joined
Dec 10, 2012
Messages
475
Reaction score
9
Bump.
Where do I check when the hiredmerchant is closed after using !shutdownnow?
Any idea?
 
Upvote 0
Elite Diviner
Joined
Dec 10, 2012
Messages
475
Reaction score
9
Thanks eshays, I've tried your method and ended up the merchant is bugged..
Anyone can help?
 
Upvote 0
Junior Spellweaver
Joined
Apr 5, 2008
Messages
152
Reaction score
65
The issue you are having is because hired merchants are not getting closed properly on server shutdown. You either need to fix the !shutdownnow command, or add a command to close all merchants before you shut the server down.

Edit: I just re-read your original post and realized you said when the shop closes after 24 hours. Check to see if its closing the same way it would on a server shutdown, because it needs to. I thought I had fixed this issue back in Solaxia.
 
Upvote 0
not a programmer
Joined
Mar 30, 2015
Messages
532
Reaction score
62
The issue you are having is because hired merchants are not getting closed properly on server shutdown. You either need to fix the !shutdownnow command, or add a command to close all merchants before you shut the server down.
it's not saving bundles sometimes or quantity is overwriting unless shutdown before exit merchant?
"i notice if I used !shutdownnow , and it saves perfectly"
 
Upvote 0
Elite Diviner
Joined
Dec 10, 2012
Messages
475
Reaction score
9
Notice, Sorry if I din make it clear at the prev post.
When I used !shutdownnow , the merchant will save perfectly fine.
I went and research for abit..
In HiredMerchant.java
if it's timeout = means after a day, then saveitems(false)
What if i make it saveItems(true)?

Thank you guys for the reply



All items that go to fredrick after 1 day became 1 item only..
That's why I also noticed

PHP:
if (shutdown) {
                newItem.setQuantity((short) (pItems.getItem().getQuantity() * pItems.getBundles()));
            } else {
                newItem.setQuantity(pItems.getItem().getQuantity());
            }
I changed
newItem.setQuantity(pItems.getItem().getQuantity());
to
newItem.setQuantity((short) (pItems.getItem().getQuantity() * pItems.getBundles()));

Ended up the merchant got bugged.. it duplicates the item when I bought it.
 
Upvote 0
not a programmer
Joined
Mar 30, 2015
Messages
532
Reaction score
62
So they are saying this?
find
Code:
next.closeShop(true, false);
replace with:
Code:
          if (next.getMCOwner() != null && next.getMCOwner().getPlayerShop() == next) {
            next.getMCOwner().setPlayerShop(null);
          }
          next.closeShop(true, false);
but that is not the problem . Bump.
 
Last edited:
Upvote 0
Back
Top