Escanor Posted February 17, 2016 Author Share Posted February 17, 2016 Hi,I'm trying to send a value to the server but the value remains 0.I have any error. i don’t uderstand what i did wrong.Can you help me please ? Link to comment Share on other sites More sharing options...
Growlith1223 Posted February 17, 2016 Share Posted February 17, 2016 If you're sending it as an integer it needs to be read as an integer, etc. Link to comment Share on other sites More sharing options...
Escanor Posted February 18, 2016 Author Share Posted February 18, 2016 Yes I know, the error doesn't comme from there Link to comment Share on other sites More sharing options...
Lavos Posted February 18, 2016 Share Posted February 18, 2016 @'Ging':> Yes I know, the error doesn't comme from therePlease use screenshots to explain your error, it would help the community to better understand what you are asking for. Link to comment Share on other sites More sharing options...
Escanor Posted February 19, 2016 Author Share Posted February 19, 2016 @'Lavos':> @'Ging':> > > Yes I know, the error doesn't comme from there> > Please use screenshots to explain your error, it would help the community to better understand what you are asking for.I am bad to express. I have no error but when I send a value of the client to the server the value stays in 0 Link to comment Share on other sites More sharing options...
Mohenjo Daro Posted February 19, 2016 Share Posted February 19, 2016 Care to share the code you used? Link to comment Share on other sites More sharing options...
Escanor Posted February 19, 2016 Author Share Posted February 19, 2016 Of courseIn Client , modClientTCP```Public Sub SendSetPerso(ByVal name As String, ByVal CharacNume As Long)Dim buffer As clsBuffer ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler Set buffer = New clsBuffer buffer.WriteLong CSetPerso buffer.WriteString name buffer.WriteLong CharacNume SendData buffer.ToArray() Set buffer = Nothing ' Error handler Exit Suberrorhandler: HandleError "SendSetPerso", "modClientTCP", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd Sub```In Server modHandleData```Sub HandleSetPerso(ByVal index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)Dim i As String Dim n As Long Dim buffer As clsBuffer Set buffer = New clsBuffer buffer.WriteBytes Data() ' The sprite i = FindPlayer(buffer.ReadString) n = buffer.ReadLong '(CLng(Parse(1))) Set buffer = Nothing ' Prevent hacking 'If GetPlayerPerso(i) = GetPlayerPerso(index) Then 'Call PlayerMsg(index, "Tu es déjà ce personnage", Red) ' Exit Sub ' End If If GetPlayerPerso(n) > MAX_CHARACTERE Then Call PlayerMsg(index, "Erreur", Red) Exit Sub End If Call PlayerMsg(index, "Tu as changé de personnage !", Green) Call SetPlayerPerso(i, n) Call PlayerMsg(index, "De : " & GetPlayerPerso(index) & " à " & GetPlayerPerso(n), Blue) Call SendPlayerData(i) Exit SubEnd Sub```I have add CSetPerso in client enumeration and server enumeration Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now