SphereCommunity
Trade Window packet problems (Secure Trade) - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: Trade Window packet problems (Secure Trade) (/Thread-Trade-Window-packet-problems-Secure-Trade)

Pages: 1 2


Trade Window packet problems (Secure Trade) - Coruja - 07-28-2013 09:31 AM

Code:
[FUNCTION TradeWindow]
REF3=<ARGS>
FOR 2
  SERV.NEWITEM i_bulletin_board
  NEW.TYPE t_eq_trade_window
  REF<LOCAL._FOR>=<NEW>
ENDFOR
REF1.LINK=<REF2>
REF2.LINK=<REF1>
IF (<REF3>)
  REF3.CONT=<REF1>
ENDIF
SRC.EQUIP <REF1>
EQUIP <REF2>
SRC.SENDPACKET 06F W02F 00 D<UID> D<REF1> D<REF2> 01 <ASCPAD 30,<NAME>>
SENDPACKET 06F W02F 00 D<SRC> D<REF2> D<REF1> 01 <ASCPAD 30,<SRC.NAME>>
usage:
-TradeWindow (just open an empty trade)
-TradeWindow <item uid> (to open a window trading this item)

the problem is, this function used to work fine until some time ago. Suddenly stop working after some sphere builds update, I dont know why

opening the empty trade window will works fine, but if the script tries to open the trade window with some item it will open a "empty" window where the item exists but its not shown

Comparing to the packet guide http://docs.polserver.com/packets/index.php?Packet=0x6F everything is fine (I think). So someone know whats wrong? Any sphere developer could check if the packet match the sphere internal trade window packet plz?


RE: Trade Window packet problems (Secure Trade) - Ben - 07-28-2013 11:52 AM

Possible issue with EF_FixCanSeeInClosedConts maybe?


RE: Trade Window packet problems (Secure Trade) - Rattlehead - 07-28-2013 03:59 PM

coruja, if i may ask

why have you scripted a secure trade, is there something insecure about the default setup that i need to know about?


RE: Trade Window packet problems (Secure Trade) - Coruja - 07-28-2013 05:41 PM

(07-28-2013 11:52 AM)Ben Wrote:  Possible issue with EF_FixCanSeeInClosedConts maybe?
it makes sense, but doesnt work :/
probably theres something wrong just on the packet, maybe a missing byte or letter. Because items are placed fine inside the "container" and the trade behavior works fine too. It only doesnt show the first item that started the trade, but the item exists on trade container and placing more items manually works fine without any problems


(07-28-2013 03:59 PM)Rattlehead Wrote:  coruja, if i may ask

why have you scripted a secure trade, is there something insecure about the default setup that i need to know about?
I doesnt use this function to override the default trade window, lol Big Grin
I'm using it to create the trade window on some situations like pet transfer or house transfer using OSI style (trade window), like this


RE: Trade Window packet problems (Secure Trade) - Rattlehead - 07-28-2013 06:38 PM

ok, ic now, this seems it would be easier to script without sending packets tho

have the house sign make u a scripted deed, and remove all owners

make this deed @dclick make src the new owner of the house

if the trade is good, the new owner simply dclicks the deed, and the house becomes his, if original owner doesnt agree to the trade, then he can dclick the deed and now he owns the house

pets can be shrunk and traded

just seems like alot of work for something so simple to me, unless there are things i am not taking into account of course


RE: Trade Window packet problems (Secure Trade) - Coruja - 07-28-2013 07:09 PM

on my last try before go sleep, I placed a item manually inside the "container" (t_eq_trade_window) using CONT=123456. And the magic works, the item goes to the trade window too. So I just changed "REF3.CONT=<REF1>" to the last line and now the problem is fixed. I dont know if the packet is correct or not, but its working and thats enough lol


RE: Trade Window packet problems (Secure Trade) - Mordaunt - 07-28-2013 10:42 PM

I just added a transfer ownership function honestly, doesn't clear the lists, since that could cause a headache if the new owner needs the current friend's e.t.c.. to still have access. Nothing the new owner can't do with a single click on the sign


RE: Trade Window packet problems (Secure Trade) - Ben - 07-29-2013 12:49 AM

so it's possible that the trade window needs to be equiped before any items be added?

[Edit]
Just looked at the source, and it basically does what you did...
-Create the trade windows
-Link them to one another
-Equip them
-Send the packet
-Add item that was droped on the char

So t looks like items have to be added after the trade window is established by the client Smile


RE: Trade Window packet problems (Secure Trade) - Rattlehead - 07-29-2013 04:09 AM

@mourdaunt

transferring ownership isnt quite the same, as you dont have a trade window up, so i assume coruja is trying to keep them from getting scammed, like say you transfer ownership then the person doesnt give u the items he promised for it, or vice versa, u give items for a house, the owner doesnt transfer ownership. the way hes doing it, there is a viable item for the trade window ensuring that there is a fair and secure trade, rather than relying on trusting someone you may not know.


RE: Trade Window packet problems (Secure Trade) - Mordaunt - 07-29-2013 06:24 AM

oh yeah I see what your saying, I'm just saying I couldn't be chewed on with it, so I have the transfer thing, also if you don't trust the person to give you what you are asking, on mine you can just put the whole house up for sale and the money is deposited in your account as soon as it's bought.

Just different ways of doing it. I always did wonder what the whole secure trade window deal was about when I saw it a long time back, and now I know so there's something Wink