18-01-2009, 09:25 AM
Parsing for the item editor? This is a sub here.
Then for receiving it in the client.
Or are you talking about sending the data to the client so you can have it displayed as like a 10 + (2) sort of thing?
Code:
Sub SendUpdateItemToAll(ByVal ItemNum As Long)
Dim Packet As String, i As Byte
With Item(ItemNum)
Packet = SUpdateItem & SEP_CHAR & ItemNum & SEP_CHAR & Trim$(.Name) & SEP_CHAR & .Pic & SEP_CHAR & .Type
For i = 1 To Stats.Stat_Count - 1
Packet = Packet & SEP_CHAR & .Stat(i)
Next i
Packet = Packet & SEP_CHAR & .Exp & SEP_CHAR & .Gold & END_CHAR
End With
Call SendDataToAll(Packet)
End Sub
Then for receiving it in the client.
Code:
Sub HandleUpdateItem(ByRef Parse() As String)
Dim n As Long, ItemNum As Long, i As Byte
ItemNum = Val(Parse(1))
' Update the item
Item(ItemNum).Name = Parse(2)
Item(ItemNum).Pic = Val(Parse(3))
Item(ItemNum).Type = Val(Parse(4))
Item(ItemNum).Data1 = 0
Item(ItemNum).Data2 = 0
Item(ItemNum).Data3 = 0
n = 5
For i = 1 To Stats.Stat_Count - 1
Item(ItemNum).Stat(i) = Val(Parse(n))
n = n + 1
Next i
End Sub
Or are you talking about sending the data to the client so you can have it displayed as like a 10 + (2) sort of thing?