Jump to content

Interlude Auction Shop


An4rchy

Recommended Posts


-stm = con.prepareStatement("INSERT INTO items VALUES (?,?,?,?,?,?,?,?,?,?,?,?)");

+stm = con.prepareStatement("INSERT INTO items VALUES (?,?,?,?,?,?,?,?,?,?,?)");

stm.setInt(1, playerId);

stm.setInt(2, IdFactory.getInstance().getNextId());

stm.setInt(3, itemId);

stm.setInt(4, count);

stm.setInt(5, 0);

stm.setString(6, "INVENTORY");

stm.setInt(7, 0);

stm.setInt(8, 0);

stm.setInt(9, 0);

stm.setInt(10, 0);

stm.setInt(11, -1);

-stm.setInt(12, 0);

 

Edited by Tony360
Link to comment
Share on other sites

  • 1 month later...

What if exception is thrown in add/delete when trying to update database?
Correct me if I am wrong but shouldn't these operations act as transactions or otherwise you will have possibility of duplicated/lost items?

 

edit:

ah I see it was updated

all fine for me now

 

edit2:

Why is no one complaining about missing IconTable?

Edited by bistabil
Link to comment
Share on other sites

On 7/17/2017 at 11:44 PM, bistabil said:
edit2:

Why is no one complaining about missing IconTable?

 

Because everyone can make IconTable i think...

Edited by Tony360
Link to comment
Share on other sites

I am testing this and reading the code.

 

Seller will lose adena if sum of price and adena he currently owns exceeds max adena amount.

 

Also, way the pagination is implemented worries me.

 

Another feature that this auction should have is expiration otherwise list could get full of trash fast.

 

edit:

 

First I thing that bothered me about pagination was performance but now I see that it wont work because order of inserts is not preserved thus one can't predict end result.

Edited by bistabil
Link to comment
Share on other sites

  • 4 weeks later...

Hello, how would you put it to sell also the weapons with skill of argumets to sell?

 

I can put some of my girlfriends there so you can argument all the day.

Link to comment
Share on other sites

  • 2 years later...


Hi guys.
Sorry for my English.
My Java is bad too.))


I am using 382 aCis.

There is no XMLDocumentFactory.java 

(which, as I understand it, is used for parsing icons for an auction.)

ACis 382 have IXmlReader.java method

is there an option to use IXmlReader.java?.

Pulled with (368)
XMLDocumentFactory.java.  the norm works


And please tell me.
How to limit items allowed for sale at auctions?

Edited by alexmaghym
Link to comment
Share on other sites

Hey.

 

Regarding your XML issue, it's not really used in this code, except for the icon table which I basically don't have anymore in order to provide a fix/help for you. But IXmlReader is much easier and cleaner to use than previous methods for reading xml (on aCis always). Try to see some examples in datatables.xml.

 

As for a limit on the items one can add on the shop, it's quite simple really, you just need to add a method in AuctionTable to read how many items a player has for auction like so:

 

https://pastebin.com/XANukcpm

 

Then just add a check under else if (command.startsWith("addit2"))

to check if player exceeded the limit: if (AuctionTable.getInstance().getNumberOfAuctions(player) >= YOUR_LIMIT

Link to comment
Share on other sites

On 4/8/2020 at 6:44 AM, An4rchy said:

Привет.

 

Что касается вашей проблемы с XML, она не используется в этом коде, за исключением таблицы значков, которая может предоставить вам исправление / помощь. Но IXmlReader гораздо проще, чем предыдущие методы чтения XML (всегда в aCis). Попробуйте увидеть некоторые примеры в datatables.xml.

 

Что касается ограничения на количество предметов, которые можно добавить в магазин, то можно просто добавить метод в AuctionTable, чтобы узнать, сколько предметов у игрока на аукционе, например:

 

https://pastebin.com/XANukcpm

 

Затем просто добавьте проверку в  else if (command.startsWith ("addit2"))

проверить, превысил ли игрок лимит: if (AuctionTable.getInstance (). getNumberOfAuctions (player)> = YOUR_LIMIT

 

 

my English is not very good ((( thanks a lot !!!

but

I want the auction to have only certain items in inventory.

For example - armor weapons jewelry
 

 

 


Error: for (AuctionItem item : items)

Error: Can only iterate over an array or an instance of java.lang.Iterable

 

  1.     public int getNumberOfAuctions(Player player)
  2.     {
  3.         int i = 0;
  4.         for (AuctionItem item : items)
  5.             if (item.getOwnerId() == player.getObjectId())
  6.                 i++;
  7.         return i;
  8.     }

 

 

 

Сan tell me a piece of code: to charge for the services of an auction?

For example, adena

 

 

Edited by alexmaghym
Link to comment
Share on other sites

  • 10 months later...

Everything that @Tryskell cited has not been done yet, I organized a few things and redid AuctionTable, I still need to paginate the pages and optimize the AuctionManager.

 

AuctionManager - https://pastebin.com/YGmT4Uv2

AuctionTable - https://pastebin.com/TnXjWFdi

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • Hello. If you are looking for a reliable writing company that can provide a high level of service and high quality writing, then I recommend you to visit Essay Pro review https://nocramming.com/essaypro-review, where you can make sure for yourself that this company can be the best assistant in your difficult studies. The company's review is objective and easy to understand, which will help any user to quickly understand the information.
    • Why not making hi5 files to support login/play at the client and only make some client parts for the rest? Isnt it more easy?
    • Powerful Spells Caster & Spiritual Healer Web: lovespellsafrika.com Phone: +27780802727 WhatsApp +27789121499 Email: bbaantu@gmail.com Real Magic Spells | How To Get Back Ex-Boyfriend or Ex-Girlfriend. Real Magic Spells for all purpose; Now you can benefit through the use of spells like Love Spells, Money Spells, Talismans, Charms, Prayers, Curses and Chants. Magic Spells can be spell cast for many purposes. Talismans and Charms work as powerful Ingredients. If you need any spiritual knowledge on the power of Spells and Magic you can always Powerful Magic Rings Love Spells                     Casting of Simple and Effective Love Spells Easy Love Spells Spells for Attraction between two Lovers Binding Love Spells Get back Lost Lover Spells Spells to Strengthen Love Relation Lost Love Spells Soul Mate Spells Marriage Spell for a happy Married Life. Retrieve a Lost Love Spells Bring Back Your Love Spells Gay Love Spells, Lesbian Love Spells Anti-Love Spells, Divorce Spells, Break up Spells How to Get Back Ex-Boyfriend, or Ex-Girlfriend Casting Spells to Get Rid of Your Husband, Wife or Partner without Fights or them hating you Magic Rings, Powerful Love Rings Spells to stop a divorce Voodoo Spells for Love Love Return Spells Money & Prosperity Spells Phone: +27780802727 WhatsApp +27789121499 How to Cast Magic Money Spells Lottery Spells or Lotto Spells Voodoo Spells for Money Black Magic Spell for Money Protection & Banishing Spells Black Magic Spells and Curses to Destroy Enemy or Evil People Protection from Black Magic Spells and Curses Dark Magic Spells Voodoo Spells for Revenge Spells to win court cases &legal matters Healing spells for all purpose Stroke Diabetics Lottery Spells Phone: +27780802727 WhatsApp: +27789121499 Web: lovespellsafrika.com
    • Powerful Spells Caster & Spiritual Healer Web: lovespellsafrika.com Phone: +27780802727 WhatsApp +27789121499 Email: bbaantu@gmail.com Real Magic Spells | How To Get Back Ex-Boyfriend or Ex-Girlfriend. Real Magic Spells for all purpose; Now you can benefit through the use of spells like Love Spells, Money Spells, Talismans, Charms, Prayers, Curses and Chants. Magic Spells can be spell cast for many purposes. Talismans and Charms work as powerful Ingredients. If you need any spiritual knowledge on the power of Spells and Magic you can always Powerful Magic Rings Love Spells                     Casting of Simple and Effective Love Spells Easy Love Spells Spells for Attraction between two Lovers Binding Love Spells Get back Lost Lover Spells Spells to Strengthen Love Relation Lost Love Spells Soul Mate Spells Marriage Spell for a happy Married Life. Retrieve a Lost Love Spells Bring Back Your Love Spells Gay Love Spells, Lesbian Love Spells Anti-Love Spells, Divorce Spells, Break up Spells How to Get Back Ex-Boyfriend, or Ex-Girlfriend Casting Spells to Get Rid of Your Husband, Wife or Partner without Fights or them hating you Magic Rings, Powerful Love Rings Spells to stop a divorce Voodoo Spells for Love Love Return Spells Money & Prosperity Spells Phone: +27780802727 WhatsApp +27789121499 How to Cast Magic Money Spells Lottery Spells or Lotto Spells Voodoo Spells for Money Black Magic Spell for Money Protection & Banishing Spells Black Magic Spells and Curses to Destroy Enemy or Evil People Protection from Black Magic Spells and Curses Dark Magic Spells Voodoo Spells for Revenge Spells to win court cases &legal matters Healing spells for all purpose Stroke Diabetics Lottery Spells Phone: +27780802727 WhatsApp: +27789121499 Web: lovespellsafrika.com
  • Topics

×
×
  • Create New...