Transfere de donnée Dramen

tonyledragon Messages postés 173 Date d'inscription lundi 2 mai 2011 Statut Membre Dernière intervention 13 décembre 2012 - 10 oct. 2011 à 21:04
tonyledragon Messages postés 173 Date d'inscription lundi 2 mai 2011 Statut Membre Dernière intervention 13 décembre 2012 - 12 oct. 2011 à 15:06
Salut,voila je revien avec un probleme de taille toujours le meme mais j'ai plus d'information voici
Donc voici le protocole :

1 un client se connecte
2 le client envoye les donnée de login
3 le serveur l'identifie puis renvoie les donnée complete du compte voici le code ci dessous
If Right(rsck, 6) = "/login" Then
cdc = Split(rsck, "|")
If Dir$(App.Path & "\Accounts" & cdc(0) & ".ini") = vbNullString Then
'fichier existe pas
Winsock1(Index).SendData "/errlog"
Else
'fichier existe
ergt = String(255, 0)
a = GetPrivateProfileString(App.Title, "mot de passe", "default", ergt, 255, App.Path & "\Accounts" & cdc(0) & ".ini")
Label3.Caption = cdc(1)
Label4.Caption = ergt
If Label3.Caption <> Label4.Caption Then
Winsock1(Index).SendData "/errlog"
Else
ergt1 = String(255, 0)
ergt2 = String(255, 0)
ergt3 = String(255, 0)
ergt4 = String(255, 0)
ergt5 = String(255, 0)
ergt6 = String(255, 0)
ergt7 = String(255, 0)
ergt8 = String(255, 0)
ergt9 = String(255, 0)
ergt10 = String(255, 0)
ergt11 = String(255, 0)
ergt12 = String(255, 0)
ergt13 = String(255, 0)
ergt14 = String(255, 0)
ergt15 = String(255, 0)
a = GetPrivateProfileString(App.Title, "slot", "default", ergt1, 255, App.Path & "\Accounts" & cdc(0) & ".ini")
a = GetPrivateProfileString(App.Title, "nom dragon", "default", ergt2, 255, App.Path & "\Accounts" & cdc(0) & ".ini")
a = GetPrivateProfileString(App.Title, "force", "default", ergt3, 255, App.Path & "\Accounts" & cdc(0) & ".ini")
a = GetPrivateProfileString(App.Title, "défence", "default", ergt4, 255, App.Path & "\Accounts" & cdc(0) & ".ini")
a = GetPrivateProfileString(App.Title, "pv", "default", ergt5, 255, App.Path & "\Accounts" & cdc(0) & ".ini")
a = GetPrivateProfileString(App.Title, "pm", "default", ergt6, 255, App.Path & "\Accounts" & cdc(0) & ".ini")
a = GetPrivateProfileString(App.Title, "pa", "default", ergt7, 255, App.Path & "\Accounts" & cdc(0) & ".ini")
a = GetPrivateProfileString(App.Title, "lvl", "default", ergt8, 255, App.Path & "\Accounts" & cdc(0) & ".ini")
a = GetPrivateProfileString(App.Title, "xp", "default", ergt9, 255, App.Path & "\Accounts" & cdc(0) & ".ini")
a = GetPrivateProfileString(App.Title, "apparence", "default", ergt10, 255, App.Path & "\Accounts" & cdc(0) & ".ini")
a = GetPrivateProfileString(App.Title, "inscrit", "default", ergt11, 255, App.Path & "\Accounts" & cdc(0) & ".ini")
a = GetPrivateProfileString(App.Title, "connexion", "default", ergt12, 255, App.Path & "\Accounts" & cdc(0) & ".ini")
a = GetPrivateProfileString(App.Title, "dramas", "default", ergt13, 255, App.Path & "\Accounts" & cdc(0) & ".ini")
a = GetPrivateProfileString(App.Title, "sexe", "default", ergt14, 255, App.Path & "\Accounts" & cdc(0) & ".ini")
a = GetPrivateProfileString(App.Title, "element", "default", ergt15, 255, App.Path & "\Accounts" & cdc(0) & ".ini")
Winsock1(Index).SendData cdc(0) & "|" & Winsock1(Index).Index & "|" & ergt1 & "|" & ergt2 & "|" & ergt3 & "|" & ergt4 & "|" & ergt5 & "|" & ergt6 & "|" & ergt7 & "|" & ergt8 & "|" & ergt9 & "|" & ergt10 & "|" & ergt11 & "|" & ergt12 & "|" & ergt13 & "|" & ergt14 & "|" & ergt15 & "|" & "/login"
End If
End If
End If

4 le client recoi c'est donnée est les traite (code ci dessous )
If Right(rsck, 6) = "/login" Then
cdc = Split(rsck, "|")
pseudo = cdc(0)
id = cdc(1)
slot = cdc(2)
dragon = cdc(3)
force = cdc(4)
defence = cdc(5)
MsgBox "debug1"
pv = cdc(6)
pm = cdc(7)
pa = cdc(8)
lvl = cdc(9)
xp = cdc(10)
MsgBox "debug2"
apparence = cdc(11)
inscrit = cdc(12)
connexion = cdc(13)
dramas = cdc(14)
sexe = cdc(15)
MsgBox "debug3"
element = cdc(16)
Form3.Label22.Caption = pseudo
If apparence = "1" Then
Form3.Image10.Visible = True
ElseIf apparence = "0" Then
Form3.Image11.Visible = True
ElseIf apparence = "2" Then
Form3.Image7.Visible = True
ElseIf apparence = "3" Then
Form3.Image6.Visible = True
ElseIf apparence = "4" Then
Form3.Image9.Visible = True
ElseIf apparence = "5" Then
Form3.Image8.Visible = True
End If
If sexe = "1" Then
Form3.Image4.Visible = True
ElseIf sexe = "2" Then
Form3.Image5.Visible = True
End If
If element = "1" Then
Form3.Image13.Visible = True
ElseIf element = "2" Then
Form3.Image12.Visible = True
ElseIf element = "3" Then
Form3.Image14.Visible = True
ElseIf element = "4" Then
Form3.Image15.Visible = True
ElseIf element = "5" Then
Form3.Image16.Visible = True
End If
Form3.Label13.Caption = force
Form3.Label14.Caption = defence
Form3.Label15.Caption = pv
Form3.Label16.Caption = pa
Form3.Label17.Caption = pm
Form3.Label18.Caption = lvl
Form3.Label19.Caption = xp
Form3.Label20.Caption = dramas

Form3.Show
Form1.Visible = False
End If

5 Le client chez moi marche je me connecte
6 les autre qui n'appartienne pas a mon réseaux n'arrive pas a se connecte il on erreur 9 Indice hors de la plage .

Voila pouvez vous m'aider ?

4 réponses

tonyledragon Messages postés 173 Date d'inscription lundi 2 mai 2011 Statut Membre Dernière intervention 13 décembre 2012 1
10 oct. 2011 à 21:09
debug 1 2 3 sont pas dans le code c'était un test pour voir d'ou sa vien .
0
cs_Jack Messages postés 14006 Date d'inscription samedi 29 décembre 2001 Statut Modérateur Dernière intervention 28 août 2015 79
11 oct. 2011 à 01:04
Salut

Code mal présenté.
Code sans rapport direct avec le problème.
Ou se trouve la gestion des indes des Sockets ?
Comment sont dimensionnés tes sockets ?
Sur quelle ligne apparait l'erreur ?

Vala
Jack, MVP VB
NB : Je ne répondrai pas aux messages privés

Le savoir est la seule matière qui s'accroit quand on la partage (Socrate)
0
tonyledragon Messages postés 173 Date d'inscription lundi 2 mai 2011 Statut Membre Dernière intervention 13 décembre 2012 1
12 oct. 2011 à 14:53
Salut désolé de tout sa bon voila j'ai plus d'erreur mais par contre on dirait que mes donnée n'arrivant pas pour tous a leur destination.
voici le code du serveur :
'---------------------------------------Login-------------
If Left(rsck, 6) = "/login" Then
cdc = Split(rsck, "|")
If Right(rsck, 6) = "/login" Then
If Dir$(App.Path & "\Accounts" & cdc(1) & ".ini") = vbNullString Then
'fichier existe pas
Winsock1(Index).SendData "/errlog"
Else
'fichier existe
ergt = String(255, 0)
ergt1 = String(225, 0)
ergt2 = String(225, 0)
ergt3 = String(225, 0)
ergt4 = String(225, 0)
ergt5 = String(225, 0)
ergt6 = String(225, 0)
ergt7 = String(225, 0)
ergt8 = String(225, 0)
ergt9 = String(225, 0)
ergt10 = String(225, 0)
ergt11 = String(225, 0)
ergt12 = String(225, 0)
ergt13 = String(225, 0)
ergt14 = String(225, 0)
ergt15 = String(225, 0)

a = GetPrivateProfileString(App.Title, "mot de passe", "default", ergt, 255, App.Path & "\Accounts" & cdc(1) & ".ini")
Label3.Caption = cdc(2)
Label4.Caption = ergt
If Label3.Caption <> Label4.Caption Then
Winsock1(Index).SendData "/errlog"
Else
txtbox.Text = Label1.Caption & "|" & Label2.Caption & " ::" & Winsock1(Index).Index & cdc(1) & " Vien de ce connecté sur dramen" & vbCrLf & txtbox.Text
a = GetPrivateProfileString(App.Title, "dragon", "default", ergt1, 255, App.Path & "\Accounts" & cdc(1) & ".ini")
a = GetPrivateProfileString(App.Title, "apparence", "default", ergt2, 255, App.Path & "\Accounts" & cdc(1) & ".ini")
a = GetPrivateProfileString(App.Title, "element", "default", ergt3, 255, App.Path & "\Accounts" & cdc(1) & ".ini")
a = GetPrivateProfileString(App.Title, "force", "default", ergt4, 255, App.Path & "\Accounts" & cdc(1) & ".ini")
a = GetPrivateProfileString(App.Title, "defence", "default", ergt5, 255, App.Path & "\Accounts" & cdc(1) & ".ini")
a = GetPrivateProfileString(App.Title, "lvl", "default", ergt6, 255, App.Path & "\Accounts" & cdc(1) & ".ini")
a = GetPrivateProfileString(App.Title, "xp", "default", ergt7, 255, App.Path & "\Accounts" & cdc(1) & ".ini")
a = GetPrivateProfileString(App.Title, "pa", "default", ergt8, 255, App.Path & "\Accounts" & cdc(1) & ".ini")
a = GetPrivateProfileString(App.Title, "pm", "default", ergt9, 255, App.Path & "\Accounts" & cdc(1) & ".ini")
a = GetPrivateProfileString(App.Title, "dramas", "default", ergt10, 255, App.Path & "\Accounts" & cdc(1) & ".ini")
a = GetPrivateProfileString(App.Title, "inscrit", "default", ergt11, 255, App.Path & "\Accounts" & cdc(1) & ".ini")
a = GetPrivateProfileString(App.Title, "connexion", "default", ergt12, 255, App.Path & "\Accounts" & cdc(1) & ".ini")
Winsock1(Index).SendData "/login" & "|" & ergt1 & "|" & ergt2 & "|" & ergt3 & "|" & ergt4 & "|" & ergt5 & "|" & ergt6 & "|" & ergt7 & "|" & ergt8 & "|" & ergt9 & "|" & ergt10 & "|" & ergt11 & "|" & ergt12 & "|" & "/login"
End If
End If
End If
End If



Du coter client ca se présente comme ceci :

'--------------login reussi--
If Left(rsck, 6) = "/login" Then
cdc = Split(rsck, "|")
If right(rsck,6) = "/login" Then
pseudo = Text1.Text
dragon = cdc(1)
apparence = cdc(2)
element = cdc(3)
force = cdc(4)
defence = cdc(5)
lvl = cdc(6)
xp = cdc(7)
pa = cdc(8)
pm = cdc(9)
dramas = cdc(10)
inscrit = cdc(11)
connexion = cdc(12)
Form3.Show
Form1.Visible = False
End If
End If


Voila donc je vais expliquer le problème 1 client sur 2 arrive a se connecter correctement. lui qui n'arrive pas a se connecté correctement reste figer sur la page pendant des heure sans etre redirection née sur le form suivant comme indique le code donc je pense que les dernier donnée sont pas envoyé pour sa qu'il exécute aucune commande comme pui-je faire ?? Pour l'erreur ben il y a na pas tout simplement le client ne peut jouée vue que les donnée ne sont pas encore réceptionnée.


Donc j'aimerez savoir si il et possible de faire un moyen pour que le chargement continué jusqu'a qu'il recoi la dernier donnée ??
0
tonyledragon Messages postés 173 Date d'inscription lundi 2 mai 2011 Statut Membre Dernière intervention 13 décembre 2012 1
12 oct. 2011 à 15:06
Re,voila j'ai vue sur un autre poste que vous conseillez les réception des donnée comme ceci :
Winsock1.GetData rsck, vbString, bytesTotal

mas recepetion de donnée sont dans cette etat la :
winsock1.getdata rsck

est t'il possible que mon problème bonne réception complet des messages vienne de la ?
0
Rejoignez-nous