Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Laggy Game Trade Fix


Matt
 Share

Recommended Posts

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 out

If Options.Debug = 1 Then On Error GoTo errorhandler

DeclineTrade

' Error handler

Exit Sub

errorhandler:

HandleError "imgDeclineTrade_Click", "frmMain", Err.Number, Err.Description, Err.Source, Err.HelpContext

Err.Clear

Exit Sub

End Sub

```
Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...
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 Long

Dim 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 tradeTarget

End Sub

```

Could try something like this.
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...