21-08-2008, 08:16 PM
Okay, so I've been playing with this a little more today. Right now, I'm just trying to get everything displaying on plain old labels. Here is what I've done so far code-wise:
Sub HandleData - Client Side
modGeneral - Server Side
It works just fine when I have only 2 people in a party. This is what it looks like when I have 3 people in a party:
![[Image: partyss.png]](http://i146.photobucket.com/albums/r255/sonire/partyss.png)
As you can see, the third party member's stats are all out of order, and the name doesn't show up at all. I can't tell if the For statement client side is just spitting out random stuff, or if those numbers that do show up are actually representing the third party member.
By the way Asrrin, you're missing some SEP_CHARs in SubSendPartyStats. Look between GetPlayerHP & GetPlayerMaxHP. Missing it for the Leader and Group Members.
Does anyone see where this code is flawed? Because I don't :?
Sub HandleData - Client Side
Code:
' :::::::::::::::::
' :: Party Stats ::
' :::::::::::::::::
If (LCase(Parse(0)) = "partystats") Then
X = Val(Parse(1)) ' Total Group Members
frmMirage.lblLeaderName.Caption = Trim$(Parse(2)) & " " & Val(Parse(4)) ' Leader Name & Level
frmMirage.lblLeaderClass.Caption = Trim$(Parse(3)) ' Leader Class
frmMirage.lblLeaderHP = Val(Parse(6)) & "/" & Val(Parse(5)) ' Leader HP
frmMirage.lblLeaderMP.Caption = Val(Parse(8)) & "/" & Val(Parse(7)) ' Leader MP
n = 9 ' Next Parse In Line
For i = 1 To X ' MAX_GROUP_NUMBER
frmMirage.lblGroupName(i - 1).Caption = Trim$(Parse(n)) & " " & Val(Parse(n + 2)) ' Member i Name & Level
frmMirage.lblGroupClass(i - 1).Caption = Trim$(Parse(n + 1)) ' Member i Class
frmMirage.lblGroupHP(i - 1).Caption = Val(Parse(n + 4)) & "/" & Val(Parse(n + 3)) ' Member i HP
frmMirage.lblGroupMP(i - 1).Caption = Val(Parse(n + 6)) & "/" & Val(Parse(n + 5)) ' Member i MP
n = n + 1
Next i
End If
Exit Sub
modGeneral - Server Side
Code:
Sub SendPartyStats(ByVal GroupID As Long)
Dim Packet As String, party As Long, I As Long, GroupNum As Long
party = FindPlayer(Group(GroupID).GroupLeader)
' Subtracted 1 becuase the GroupLeader is handled seperately
GroupNum = (Group(Player(party).GroupID).GroupNum - 1)
Packet = GetPlayerName(party) & SEP_CHAR & Class(GetPlayerClass(party)).Name & SEP_CHAR & GetPlayerLevel(party) & SEP_CHAR & GetPlayerMaxHP(party) & SEP_CHAR & GetPlayerHP(party) & SEP_CHAR & GetPlayerMaxMP(party) & SEP_CHAR & GetPlayerMP(party) & SEP_CHAR
For I = 1 To GroupNum
party = FindPlayer(Group(GroupID).GroupMember(I))
Packet = Packet & GetPlayerName(party) & SEP_CHAR & Class(GetPlayerClass(party)).Name & SEP_CHAR & GetPlayerLevel(party) & SEP_CHAR & GetPlayerMaxHP(party) & SEP_CHAR & GetPlayerHP(party) & SEP_CHAR & GetPlayerMaxMP(party) & SEP_CHAR & GetPlayerMP(party) & SEP_CHAR
Next
Packet = "PARTYSTATS" & SEP_CHAR & GroupNum & SEP_CHAR & Packet & SEP_CHAR & END_CHAR
Call SendDataToParty(GroupID, Packet)
End Sub
It works just fine when I have only 2 people in a party. This is what it looks like when I have 3 people in a party:
![[Image: partyss.png]](http://i146.photobucket.com/albums/r255/sonire/partyss.png)
As you can see, the third party member's stats are all out of order, and the name doesn't show up at all. I can't tell if the For statement client side is just spitting out random stuff, or if those numbers that do show up are actually representing the third party member.
By the way Asrrin, you're missing some SEP_CHARs in SubSendPartyStats. Look between GetPlayerHP & GetPlayerMaxHP. Missing it for the Leader and Group Members.
Does anyone see where this code is flawed? Because I don't :?