Matt Posted September 13, 2012 Author Share Posted September 13, 2012 I don't know if many people have had this problem, but i know i have.Whenever there is a laggy connection between the host and the player and two people are trading, if one of them hits decline, there's a bit of lag before the trade screen closes. If the person hits decline again, it makes the server get a RTE. My fix for this is to place```frmMain.picTrade.Visible = False```right under```DeclineTrade```in client side```Private Sub imgDeclineTrade_Click()' If debug mode, handle error then exit outIf Options.Debug = 1 Then On Error GoTo errorhandlerDeclineTrade' Error handlerExit Suberrorhandler:HandleError "imgDeclineTrade_Click", "frmMain", Err.Number, Err.Description, Err.Source, Err.HelpContextErr.ClearExit SubEnd Sub``` Link to comment Share on other sites More sharing options...
Alerd Posted October 22, 2012 Share Posted October 22, 2012 Sorry for the questions but I know English poorly or under DeclineTrade I givefrmMain.picTrade.Visible = False Link to comment Share on other sites More sharing options...
Matt Posted October 22, 2012 Author Share Posted October 22, 2012 That's pretty much what the tutorial tells you to do. Link to comment Share on other sites More sharing options...
Alerd Posted October 22, 2012 Share Posted October 22, 2012 I know this because I asked the English … The problem was a yes or no answer ..? Link to comment Share on other sites More sharing options...
Valentine90 Posted October 22, 2012 Share Posted October 22, 2012 The delay is a normal thing, this procedure may not be necessary. Link to comment Share on other sites More sharing options...
Matt Posted November 5, 2012 Author Share Posted November 5, 2012 > The delay is a normal thing, this procedure may not be necessary.I understand the delay is normal, but if a player hits decline more than once, the server crashes. Link to comment Share on other sites More sharing options...
Valentine90 Posted November 9, 2012 Share Posted November 9, 2012 That's why I created tutorials to fix this problemhttp://www.touchofdeathforums.com/community/index.php?/topic/129445-bug-fix-fixing-serious-errors-in-trade/Still, I appreciate you trying to help your shape Link to comment Share on other sites More sharing options...
Richy420Rich Posted November 9, 2012 Share Posted November 9, 2012 Or in the server HandleDeclineTrade, try adding check to make sure the .InTrade for player and target is greater than 0.Place the close trade calls after the end if.No need to try fixing server errors from the client.```Sub HandleDeclineTrade(ByVal index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)Dim i As LongDim tradeTarget As Long tradeTarget = TempPlayer(index).target If tradeTarget > 0 And TempPlayer(index).InTrade > 0 And TempPlayer(tradeTarget).InTrade > 0 Then For i = 1 To MAX_INV TempPlayer(index).TradeOffer(i).Num = 0 TempPlayer(index).TradeOffer(i).value = 0 TempPlayer(tradeTarget).TradeOffer(i).Num = 0 TempPlayer(tradeTarget).TradeOffer(i).value = 0 Next PlayerMsg index, "You declined the trade.", brightred PlayerMsg tradeTarget, GetPlayerName(index) & " has declined the trade.", brightred End If TempPlayer(index).InTrade = 0 TempPlayer(tradeTarget).InTrade = 0 TempPlayer(index).AcceptTrade = False TempPlayer(tradeTarget).AcceptTrade = False SendCloseTrade index SendCloseTrade tradeTargetEnd Sub```Could try something like this. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now