K-Relay Problem with making a plugin cancel a trade correctly
So I've been playing around making plugins for k-relay, and ive come across a minor problem, when the tradee cancels the trade, while the trade does get canceled, I'm left looking at the "XXX want to trade accept/reject" menu, and when i cancel the trade myself (using the CancelTradePacket)
I'm left staring at the trade (as if nothing happened) while the tradee does infact get his trade canceled.
Code being used for accepting the trade:
Code being used to cancel the trade:
Now, the proxy does trigger OnTradeDone (proxy.HookPacket(PacketType.TRADEDONE, OnTradeDone); )
But it dosent actually cancel the trade for me, just for the person who is trading me.
I imagine both of these problem occur because im not sending anything to the client itself, but I've not clue how to begin fixing that, using client.SendToClient just crashes me each time, and the default plugins dont do anything with Trades for me to go off of.
Any ideas?
Also, if this isn't the place to ask this, please redirect me.
I'm left staring at the trade (as if nothing happened) while the tradee does infact get his trade canceled.
Code being used for accepting the trade:
Code:
TradeRequestedPacket tradeRequest = (TradeRequestedPacket)packet; PlayerTextPacket playerText = (PlayerTextPacket)Packet.Create(PacketType.PLAYERTEXT); playerText.Text = "/trade " + tradeRequest.Name; client.SendToServer(playerText);
Code:
CancelTradePacket cancelTrade = (CancelTradePacket)Packet.Create(PacketType.CANCELTRADE); client.SendToServer(cancelTrade);
But it dosent actually cancel the trade for me, just for the person who is trading me.
I imagine both of these problem occur because im not sending anything to the client itself, but I've not clue how to begin fixing that, using client.SendToClient just crashes me each time, and the default plugins dont do anything with Trades for me to go off of.
Any ideas?
Also, if this isn't the place to ask this, please redirect me.

