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

(EO) T�¡P client-server


23.kraft
 Share

Recommended Posts

1\. Use correct english. This pliz shit is getting annoying
2\. Stop pming me. I'll stop helping. Plus your PM's make no sense what so ever.
3\. Stop changing your code every time you post
4\. The code I'm posting is found on page one in one of your posts.
5\. Start using the code tags.

Server Side
```
'in modEnumerations
'serverpacket
SSendHelloServer
'Client packet
CSendHelloServer

```
```
'in modHandleData

HandleDataSub(CSendHelloServer) = GetAddress(Addressof HandleHelloServer)

Private Sub HandleHelloServer(ByVal index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)
Dim Buffer As clsBuffer
Dim tmpString As String 
Dim tmpStrin As String
Set Buffer = New clsBuffer
Buffer.WriteBytes Data()

tmpString = Buffer.ReadString

If tmpString = "Hello Server!" Then
tmpStrin = tmpString
Call HandleD(index, tmpStrin)
Call PlayerMsg(index, "Hello Client!", Yellow)
Else
Call PlayerMsg(index, "What?", Yellow)
End If
Set Buffer = Nothing
End Sub

``````
'in modServerTCP
Sub HandleD(byval index as long, Byval tmpStrin As String)
Dim Buffer As clsBuffer '
Set Buffer = New clsBuffer
Buffer.WriteLong SSendHelloServer
Buffer.WriteString tmpStrin
SendDataTo index, buffer.ToArray()
Set Buffer = Nothing ' Close the buffer
End Sub

```
```
'in modEnermations
'Server packets
SSendHelloServer
'client packet
CSendHelloServer

``````
'in modHandleData
HandleDataSub (SSendHelloServer) = GetAddress (AddressOf HandleHelloServer)

Sub HandleHelloServer (ByVal index As Long, ByRef Data () As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)
  Dim Buffer As clsBuffer
  Dim tmpString As String
  Dim tmpStrin As String
  Set Buffer = New clsBuffer
  Buffer.WriteBytes Data ()

  tmpString = Buffer.ReadString

  If tmpString = "Hello Server!" Then
  frmMain.Command1.Caption = "Hello Server!"
  End If
  Set Buffer = Nothing
  End Sub
```
This should now work. If you place everything in the right place.
Link to comment
Share on other sites

1)Much thanks to him that you helped me crzyone9584 and SamuGames !!!!!!!!))))

2)You excuse me, I understand that my ignorance of the English language you are nervous, but at this moment I can not do, not what do (

3)I ask pardon of all Cavo disturb their personal messages I just do not like to stay long in one place, and therefore pull the strings behind all that I can, especially since I have no choice (no matter that there was no sense it is important that I tried)

4)about my code editing (thus I want to show that I work on the code, and not dully waiting for an answer I'm trying to find the correct answer but, alas, to no avail because I'm new to VB6)

5)You say that you are not comfortable to read my message please rise and take my place enough that my interpreter did not correctly translate your messages to me, plus I still have to catch them washed order to understand and solve their problem)

6)Once again I apologize if anyone offended.

7)and once again thanks to all who responded and helped me) more to these people) and then hits a lot, but not enough mentors (
Link to comment
Share on other sites

people you can forgive me I was stupid that I can not understand something though:
with a button on the server for some reason this does not work (

Server:
0)
'in modEnumerations
'serverpacket
SSendHelloServer
1)
Private Sub Command1_Click ()
Dim index As Long
  Dim tmpStrin As String
  Call HandleD (index, tmpStrin)
End Sub
2)
Sub HandleD (ByVal index As Long, ByVal tmpStrin As String)
Dim Buffer As clsBuffer '
  Set Buffer = New clsBuffer
  Buffer.WriteLong SSendHelloServer
  Buffer.WriteString tmpStrin
  SendDataTo index, Buffer.ToArray ()
  Set Buffer = Nothing 'Close the buffer
End Sub

Client:
0)
'in modEnumerations
'serverpacket
SSendHelloServer
1)
'in modHandleData
HandleDataSub (SSendHelloServer) = GetAddress (AddressOf HandleHelloServer)
2)
Sub HandleHelloServer (ByVal index As Long, ByRef Data () As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)
  Dim buffer As clsBuffer
  Dim tmpString As String
  Dim tmpStrin As String
  Set buffer = New clsBuffer
  buffer.WriteBytes Data ()

  tmpString = buffer.ReadString

  If tmpString = "Hello Server!" Then
  frmMain.Command3.Caption = "Hello Server!"
  End If
  Set buffer = Nothing
  End Sub

That's why it does not work.
Link to comment
Share on other sites

Server has to have an index. Client doesn't because it sends it after the senddata part. Server needs to know who to send it to. in your button code change it to

```
Private Sub Command1_Click ()
Dim i As Long
  Dim tmpStrin As String

for i = 1 to MAX_PLAYERS
  Call HandleD (i, tmpStrin)
Next

End Sub

```
Link to comment
Share on other sites

Well, here you have 3 days once you have steamed himself, so even how hard it is)
if it was not difficult to do all within 15 minutes you)
if there is a chance to ease the way a novice over to use this opportunity)
me here, for example, was very helpful) and I think not only me)
Link to comment
Share on other sites

I had no knowledge of how things worked. If your determined to create a game you'd take the time, as much as needed, to learn how to do something in that engine you use. I only had minimal knowledge of programming and now I'm able to create multiple things with a few hours of work and searching google for answers when I'm stuck.
Link to comment
Share on other sites

all of which would not have if:
1) VB6 would be in my language)
2) Eclipse would be in my language)
3) all the support site would be on my language)
4) it is easy to speculate when all your language)
5) but they are all in English, but I do not know English) Draw your own conclusions)
Link to comment
Share on other sites

1\. Use the edit post option instead of making 3 different posts
2\. If you don't understand something then get a book or go to a place that uses your languge and learn there.
3\. Google will translate any site. You just need to be smart enough to fill in the words so the sentence or what your reading makes since…

I'm finished hope you have fun learning this engine.
Link to comment
Share on other sites

1)you've seen at least once as he takes a wry Sait?
2)on Russian sites do not support sites (
3)I'm finished hope you have fun learning this engine. (this message here, I just do not understand)
4)I do not want to offend you but given the fact that you blame me, I'll say)
you turn yourself Flooding in the topic, which is closed)
the talk is not on there other topics)
when it comes to that write pm
(but because of my crooked english language thank Google it carries my message here)
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...