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

Server Client Related


Driocku
 Share

Recommended Posts

Since I've never been good with the server and client connections thing I need help with having it get data, for a roster pokemon thing.

```

If casestring = "rostdata" Then
      n = 1
      If PIP = 0 Then

      ElseIf PIP = 1 Then
      Poke = Val(parse(n))
      Name = Val(parse(n + 1))
      Shiny = Val(parse(n + 2))
      lvl = Val(parse(n + 3))
      Expe = Val(parse(n + 4))
      MHp = Val(parse(n + 5))
      CHp = Val(parse(n + 6))

      ElseIf PIP = 2 Then
      Poke = Val(parse(n))
      Name = Val(parse(n + 1))
      Shiny = Val(parse(n + 2))
      lvl = Val(parse(n + 3))
      Expe = Val(parse(n + 4))
      MHp = Val(parse(n + 5))
      CHp = Val(parse(n + 6))

```
Theres more data but this just for the display when a player clicks the roster, All 6 pokemon in a roster are under the same .INI file and I want to know how to Get the data from under a certain section of the .INI file or would I have to go from Poke to Poke1 to Poke 2, also is that code so far correct
(has no Idea what hes talking about anymore
Link to comment
Share on other sites

example:
Call SendData("driocku" & SEP_CHAR & "test" & END_CHAR)

Server:
modHandleData:
Case "driocku"
    If parse(1) = "test" Then
          Call SendDataTo(Index, "driocku2" & END_CHAR)
    End If
    Exit Sub

Client:
modHandleData:
If parse(0) = "driocku2" Then
    frm_Driocku.Show
    Exit Sub
End If

If you'd like another example, check my threat in Tutorials –> A code newbies can learn of (page 2)
Link to comment
Share on other sites

Thank you anasky, and I noticed you closed down your pokemon game, also that only answered part of my question
this is what My .INI file looks like , I need to know if I can get data from both without having to change the seconds variable names
```
[Pok1]
Poke=001
Name=Leafy
Shiny=0
Lvl=15
Nature=0
Bound=0
Expe=2000
Item=009
@@@@@@@@@@@@
@@@@MOVE@@@@
@@@@@@@@@@@@
Move1=001
Move2=001
Move3=001
Move4=001
@@@@@@@@@@@@
@@@@STAT@@@@
@@@@@@@@@@@@
SE=
MHp=90
CHp=90
Atk=130
Def=130
Sp.Atk=180
Sp.Def=180
Spd=150
Points=
[Pok2]
Poke=
Name=
Shiny=
Lvl=
Nature=
Bound=
Expe=
Item=
@@@@@@@@@@@@
@@@@MOVE@@@@
@@@@@@@@@@@@
Move1=
Move2=
Move3=
Move4=
@@@@@@@@@@@@
@@@@STAT@@@@
@@@@@@@@@@@@
SE=
MHp=
CHp=
Atk=
Def=
Sp.Atk=
Sp.Def=
Spd=
Points=

```
Link to comment
Share on other sites

Data = GetVar(File As String, Header As String, Var As String)

Dim Packet as string

Packet = "" & sep_char & index & sep_char & data & sep_char & end_char

call senddatato(index, Packet)
Link to comment
Share on other sites

Data = GetVar(File As String, Header As String, Var As String)
Data1 = GetVar(File As String, Header As String, Var As String)

Dim Packet as string

Packet = "" & Sep_Char & index & Sep_Char & Data & Sep_Char & Data1 & Sep_Char & End_Char

Call SendDataTo(index, Packet)

all u got 2 do iz use Sep_Char to seperate the data/variables
Link to comment
Share on other sites

Can I use parse or something instead of data
Client Send thing-
```
Private Sub btnParty_Click()
    Call SendData("rostrequest" & END_CHAR)
    frmRoster.Show
End Sub

```
Client recieve-
```
    If casestring = "Packet_Roster" Then
        Dim Data0, Data1, Data2, Data3, Data4, Data5, Data6, Data7, Data8, Data9, Data10, Data11 As String
        If Data6 = 1 Then
            frmRoster.ripOmegaImage1 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Shiny\" & Data0 & ".png")
        Else
            frmRoster.ripOmegaImage1 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Normal\" & Data0 & ".png")
        End If

        If Data7 = 1 Then
            frmRoster.ripOmegaImage2 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Shiny\" & Data1 & ".png")
        Else
            frmRoster.ripOmegaImage2 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Normal\" & Data1 & ".png")
        End If

        If Data8 = 1 Then
            frmRoster.ripOmegaImage3 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Shiny\" & Data2 & ".png")
        Else
            frmRoster.ripOmegaImage3 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Normal\" & Data2 & ".png")
        End If

        If Data9 = 1 Then
            frmRoster.ripOmegaImage4 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Shiny\" & Data3 & ".png")
        Else
            frmRoster.ripOmegaImage4 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Normal\" & Data3 & ".png")
        End If

        If Data10 = 1 Then
            frmRoster.ripOmegaImage5 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Shiny\" & Data4 & ".png")
        Else
            frmRoster.ripOmegaImage5 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Normal\" & Data4 & ".png")
        End If

        If Data11 = 1 Then
            frmRoster.ripOmegaImage6 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Shiny\" & Data5 & ".png")
        Else
            frmRoster.ripOmegaImage6 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Normal\" & Data5 & ".png")
        End If

```
Server code-
```
        Case "rostrequest"
            Dim Packet_Roster As String
            Dim Data0, Data1, Data2, Data3, Data4, Data5, Data6, Data7, Data8, Data9, Data10, Data11 As String
            Data0 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok1", "Poke")
            Data1 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok2", "Poke")
            Data2 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok3", "Poke")
            Data3 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok4", "Poke")
            Data4 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok5", "Poke")
            Data5 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok6", "Poke")
            Data6 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok1", "Shiny")
            Data7 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok2", "Shiny")
            Data8 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok3", "Shiny")
            Data9 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok4", "Shiny")
            Data10 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok5", "Shiny")
            Data11 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok6", "Shiny")
            Packet_Roster = "" & SEP_CHAR & Index & SEP_CHAR & Data & SEP_CHAR & Data1 & SEP_CHAR & Data2 & SEP_CHAR & Data3 & SEP_CHAR & Data4 & SEP_CHAR & Data5 & SEP_CHAR & Data6 & SEP_CHAR & Data7 & SEP_CHAR & Data8 & SEP_CHAR & Data9 & SEP_CHAR & Data10 & SEP_CHAR & Data11 & SEP_CHAR & END_CHAR
            Call SendDataTo(Index, Packet_Roster)
            Exit Sub

```
Link to comment
Share on other sites

and the above code doesn't work properly, its supposed to get the data from a ini on the server and send it over, after which the client takes the data and gets an image from a file then it should display it ina picture box but it won't for some reason
Link to comment
Share on other sites

Packet_Roster = "Packet_Roster" & SEP_CHAR & Index & SEP_CHAR & Data & SEP_CHAR & Data1 & SEP_CHAR & Data2 & SEP_CHAR & Data3 & SEP_CHAR & Data4 & SEP_CHAR & Data5 & SEP_CHAR & Data6 & SEP_CHAR & Data7 & SEP_CHAR & Data8 & SEP_CHAR & Data9 & SEP_CHAR & Data10 & SEP_CHAR & Data11 & SEP_CHAR & END_CHAR
Link to comment
Share on other sites

Yea I figured that out and the only way to use png is with Reeaaaallly long code

Server side code-
```
        Case "rostrequest"
            Dim Packet_Roster As String
            Dim Data0, Data1, Data2, Data3, Data4, Data5, Data6, Data7, Data8, Data9, Data10, Data11 As String
            Data0 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok1", "Poke")
            Data1 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok2", "Poke")
            Data2 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok3", "Poke")
            Data3 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok4", "Poke")
            Data4 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok5", "Poke")
            Data5 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok6", "Poke")
            Data6 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok1", "Shiny")
            Data7 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok2", "Shiny")
            Data8 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok3", "Shiny")
            Data9 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok4", "Shiny")
            Data10 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok5", "Shiny")
            Data11 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok6", "Shiny")
            Data0 = Parse(1)
            Data1 = Parse(2)
            Data2 = Parse(3)
            Data3 = Parse(4)
            Data4 = Parse(5)
            Data5 = Parse(6)
            Data6 = Parse(7)
            Data7 = Parse(8)
            Data8 = Parse(9)
            Data9 = Parse(10)
            Data10 = Parse(11)
            Data11 = Parse(12)
            Packet_Roster = "Packet_Roster" & SEP_CHAR & Index & SEP_CHAR & Data & SEP_CHAR & Data1 & SEP_CHAR & Data2 & SEP_CHAR & Data3 & SEP_CHAR & Data4 & SEP_CHAR & Data5 & SEP_CHAR & Data6 & SEP_CHAR & Data7 & SEP_CHAR & Data8 & SEP_CHAR & Data9 & SEP_CHAR & Data10 & SEP_CHAR & Data11 & SEP_CHAR & END_CHAR
            Call SendDataTo(Index, Packet_Roster)
            Exit Sub

```

Current Client side code-(not all are bmp since I'm a bit lazy and I'm only using 1st as test)
```
    If casestring = "Packet_Roster" Then
        If Parse(7) = 1 Then
            frmRoster.ripOmegaImage1.Picture = LoadPicture(App.Path & "\DKData\Pokemon\Front\Shiny\" & Parse(1) & ".bmp")
        Else
            frmRoster.ripOmegaImage1.Picture = LoadPicture(App.Path & "\DKData\Pokemon\Front\Normal\" & Parse(1) & ".bmp")
        End If

        If Parse(8) = 1 Then
            frmRoster.ripOmegaImage2 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Shiny\" & Parse(2) & ".png")
        Else
            frmRoster.ripOmegaImage2 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Normal\" & Parse(2) & ".png")
        End If

        If Parse(9) = 1 Then
            frmRoster.ripOmegaImage3 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Shiny\" & Parse(3) & ".png")
        Else
            frmRoster.ripOmegaImage3 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Normal\" & Parse(3) & ".png")
        End If

        If Parse(10) = 1 Then
            frmRoster.ripOmegaImage4 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Shiny\" & Parse(4) & ".png")
        Else
            frmRoster.ripOmegaImage4 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Normal\" & Parse(4) & ".png")
        End If

        If Parse(11) = 1 Then
            frmRoster.ripOmegaImage5 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Shiny\" & Parse(5) & ".png")
        Else
            frmRoster.ripOmegaImage5 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Normal\" & Parse(5) & ".png")
        End If

        If Parse(12) = 1 Then
            frmRoster.ripOmegaImage6 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Shiny\" & Parse(6) & ".png")
        Else
            frmRoster.ripOmegaImage6 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Normal\" & Parse(6) & ".png")
        End If

    End If

```
Ok I've gotten past most of the problems the one I'm currentely facing is a script out of range rte #9
It has trouble reading more then Parse(0); I will post again if I can't fix by myself
Link to comment
Share on other sites

try dis

```
        Case "rostrequest"
            Dim Packet_Roster As String
            Dim Data0, Data1, Data2, Data3, Data4, Data5, Data6, Data7, Data8, Data9, Data10, Data11 As String
            Data0 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok1", "Poke")
            Data1 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok2", "Poke")
            Data2 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok3", "Poke")
            Data3 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok4", "Poke")
            Data4 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok5", "Poke")
            Data5 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok6", "Poke")
            Data6 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok1", "Shiny")
            Data7 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok2", "Shiny")
            Data8 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok3", "Shiny")
            Data9 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok4", "Shiny")
            Data10 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok5", "Shiny")
            Data11 = GetVar(App.Path & "\Player\" & GetPlayerName(Index) & ".ini", "Pok6", "Shiny")
            Packet_Roster = "Packet_Roster" & SEP_CHAR & Index & SEP_CHAR & Data0 & SEP_CHAR & Data1 & SEP_CHAR & Data2 & SEP_CHAR & Data3 & SEP_CHAR & Data4 & SEP_CHAR & Data5 & SEP_CHAR & Data6 & SEP_CHAR & Data7 & SEP_CHAR & Data8 & SEP_CHAR & Data9 & SEP_CHAR & Data10 & SEP_CHAR & Data11 & SEP_CHAR & END_CHAR
            Call SendDataTo(Index, Packet_Roster)
            Exit Sub

```
```
  If casestring = "Packet_Roster" Then
Dim Data0, Data1, Data2, Data3, Data4, Data5, Data6, Data7, Data8, Data9, Data10, Data11 As String

Data0 = parse(1)
Data1 = parse(2)
Data2 = parse(3)
Data3 = parse(4)
Data4 = parse(5)
Data5 = parse(6)
Data6 = parse(7)
Data7 = parse(8)
Data8 = parse(9)
Data9 = parse(10)
Data10 = parse(11)
Data11 = parse(12)

        If Data7 = 1 Then
            frmRoster.ripOmegaImage1.Picture = LoadPicture(App.Path & "\DKData\Pokemon\Front\Shiny\" & Parse(1) & ".bmp")
        Else
            frmRoster.ripOmegaImage1.Picture = LoadPicture(App.Path & "\DKData\Pokemon\Front\Normal\" & Parse(1) & ".bmp")
        End If

        If Data8  = 1 Then
            frmRoster.ripOmegaImage2 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Shiny\" & Parse(2) & ".png")
        Else
            frmRoster.ripOmegaImage2 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Normal\" & Parse(2) & ".png")
        End If

        If Data9 = 1 Then
            frmRoster.ripOmegaImage3 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Shiny\" & Parse(3) & ".png")
        Else
            frmRoster.ripOmegaImage3 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Normal\" & Parse(3) & ".png")
        End If

        If Data10 = 1 Then
            frmRoster.ripOmegaImage4 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Shiny\" & Parse(4) & ".png")
        Else
            frmRoster.ripOmegaImage4 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Normal\" & Parse(4) & ".png")
        End If

        If Data11 = 1 Then
            frmRoster.ripOmegaImage5 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Shiny\" & Parse(5) & ".png")
        Else
            frmRoster.ripOmegaImage5 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Normal\" & Parse(5) & ".png")
        End If

        If Data12 = 1 Then
            frmRoster.ripOmegaImage6 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Shiny\" & Parse(6) & ".png")
        Else
            frmRoster.ripOmegaImage6 = LoadPicture(App.Path & "\DKData\Pokemon\Front\Normal\" & Parse(6) & ".png")
        End If

    End If

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