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

Index definition of the player when send a packet to the client


iHero
 Share

Recommended Posts

**Introduction**

In some packages, the index value of the player, which is sent from Sub HandleData, is always 1.

**Client~Side**

> modHandleData

Find:

```
CallWindowProc HandleDataSub(MsgType), 1, Buffer.ReadBytes(Buffer.Length), 0, 0
```

Replace for:

```
CallWindowProc HandleDataSub(MsgType), MyIndex, Buffer.ReadBytes(Buffer.Length), 0, 0
```

**Credits**

Ricardo
Link to comment
Share on other sites

Actually has:

```
Private Sub HandlePlayerExp(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)

Dim Buffer As clsBuffer

Dim i As Long

Dim TNL As Long

' If debug mode, handle error then exit out

If Options.Debug = 1 Then On Error GoTo errorhandler

Set Buffer = New clsBuffer

Buffer.WriteBytes Data()

SetPlayerExp Index, Buffer.ReadLong

TNL = Buffer.ReadLong

frmMain.lblEXP.Caption = GetPlayerExp(Index) & "/" & TNL

' mp bar

frmMain.imgEXPBar.width = ((GetPlayerExp(MyIndex) / EXPBar_Width) / (TNL / EXPBar_Width)) * EXPBar_Width

' Error handler

Exit Sub

errorhandler:

HandleError "HandlePlayerExp", "modHandleData", Err.Number, Err.Description, Err.Source, Err.HelpContext

Err.Clear

Exit Sub

End Sub
```

```

Private Sub HandlePlayerStats(ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)

Dim Buffer As clsBuffer

Dim i As Long

' If debug mode, handle error then exit out

If Options.Debug = 1 Then On Error GoTo errorhandler

Set Buffer = New clsBuffer

Buffer.WriteBytes Data()

For i = 1 To Stats.Stat_Count - 1

SetPlayerStat Index, i, Buffer.ReadLong

frmMain.lblCharStat(i).Caption = GetPlayerStat(MyIndex, i)

Next

' Error handler

Exit Sub

errorhandler:

HandleError "HandlePlayerStats", "modHandleData", Err.Number, Err.Description, Err.Source, Err.HelpContext

Err.Clear

Exit Sub

End Sub

```
Link to comment
Share on other sites

  • 4 months later...

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...