RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Auction System

ditmar

Wanderer
Small feature request

Thanks a lot Arya, good your back!

I have a small feature which i would like to implement on my shard. I have a dontated tag attached to the playermobile and would like to allow up to 3 auctions allowed to an account if they have this boolean set to true. If it is false it should be only 1. For another script i did it like this :

Code:
         Mobile from = e.Mobile; 
		ABCMobile player = (ABCMobile)from;
		
     if (player.TheTag==true) 
     {
          from.SendMessage("Blabla");
     }

However i would not know how and where to implement this feature in the Auction system. Could you help me with that?

And would it mean re-initiating the auction system ?

Thanks!
 

Arya

Wanderer
Ditmar, you need to edit the CanAuction() method in AuctionSystem.cs. In the default system line 551 is:

Code:
return count <= MaxAuctions;

You need to change that line to something like this:

Code:
ABCMobile player = m as ABCMobile;
if ( player.TheTag )
    return count <= MaxAuctions + 3; // Add bonus you want to give them for donating
else
     return count <= MaxAuctions;

It will take only a server reboot to introduce this change, you will not need to reinitialize the system.
 

ditmar

Wanderer
Thank you Arya. I was wondering another thing, will this not cause problems if the Tag gets set to false again after it has been True and 3 auctions are active?
 

Arya

Wanderer
No it won't cause any problems. The player will not be able to place any further auctions untill they get under the general shard limit again.
 

ditmar

Wanderer
Shit it does not work.

For some kind of reason the People with true can add up to 5 auctions and the people with false can add 2.

So it does add 3 but maxauctions is set to 1.

*Update*

When i set the maxauctions to 0, people can add 1 auction with the false tag. The message however says after trying to add another one "You cannot have more then 0 active auctions".

People with the tag set to true can add up to 4 auctions before the "You cannot have more then 0 active auctions" appears.
 

Arya

Wanderer
That's a silly mistake in my code which in fact is wrong. Replace each <= with a simple <. This will give donators 4 auctions and normal players 1.
 
S

shaDoze

Guest
Another bug, that for some reason occurs:

When some (container type) items with items in it are auctioned, sometimes they appear to have 0 as amount and 0 weight when returned to the owner (while there are items inside).

Removing items from the container item reduces the amount, so it gets negative. So it ended up with a bag with -10 items (where this -10 was added to the backpack, so effectively increases your backpack size). This happened with a bookshelve, filled with other bookshelves and a bag of potions (2 seperate cases).
 

coldrake

Wanderer
I posted this twice now, but I don't know where my posts are going... the are bing inserted in crazy places in this thread. Anyhow...

Arya -

Can you please post the readme.html file again, it is not included in the latest release.

Thanks!
 

Arya

Wanderer
I posted another small update that fixed the number of auctions problem, the weight/item count for containers and reintroduced the readme file which happened to be left out at some point.
 

Arya

Wanderer
For the record, I think I have isolated the problem with pets going wild in the system. This happens only when staff uses the "Get item to backpack" command from the staff panel and then puts the pet back into the system. I'm going to fix this of course soon, in the meantime avoid using that function on pets and your auctions will be safe.
 

infra001

Wanderer
Well I put the system back on my shard the other night.
Last night:

Code:
Exception:
System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
   at System.Collections.HashtableEnumerator.MoveNext()
   at Server.World.SaveItems()
   at Server.World.Save(Boolean message)
   at Server.Misc.AutoSave.Save()
   at Server.DelayCallTimer.OnTick()
   at Server.Timer.Slice()
   at Server.Core.Main(String[] args)

So it looks like your save fix didn't work :/
 

Arya

Wanderer
I wonder if I missed some other threaded operation, I will definitely check it out. Are you sure you have no other script that might add/delete items in a different thread?
 

Morgan

Sorceror
RunUO 1.0RC0
Auction ver. 1.7.7

Exception:
System.Runtime.InteropServices.SEHException: Składnik zewnętrzny zgłosił wyjątek. (External component notified about exception) ( or something like that :p )
at Server.ObjectEnumerator.MoveNext()
at Server.Mobile.SetLocation(Point3D newLocation, Boolean isTeleport)
at Server.Mobiles.PlayerMobile.SetLocation(Point3D loc, Boolean isTeleport)
at Server.Mobile.Move(Direction d)
at Server.Mobiles.PlayerMobile.Move(Direction d)
at Server.Network.PacketHandlers.MovementReq(NetState state, PacketReader pvSrc)
at Server.Network.MessagePump.HandleReceive(NetState ns)
at Server.Network.MessagePump.Slice()
at Server.Core.Main(String[] args)

I was unable to reproduce this error becouse it was triggered by a player.
 
Top