|
-
Aug 25th, 2005, 03:53 PM
#1
Thread Starter
Frenzied Member
[Winsock] Send a packet to a server
Well, I really have no clue how to go about doing this. Anyways, I have a packet sniffer. What I want to do is get the packet that is sent out when you press the "play" button on a flash game. So after some sniffing, I found the right packet. Now I have the data saved, and I want to know how to send this packet through Vb? I already have a winsock control, and am connected to the website where the flash game is, now just need to actually send the packet. Is this possible?
Age - 15 ::: Level - Advanced
If you find my post useful please ::Rate It::

-
Aug 25th, 2005, 05:29 PM
#2
Member
Re: [Winsock] Send a packet to a server
well what id do is make the packet you have, make a function with it then just call on it like so
VB Code:
If Winsock.State = 7 Then Winsock.SendData (FunctionName Here)
thats pretty much it
-
Aug 25th, 2005, 11:27 PM
#3
Thread Starter
Frenzied Member
Re: [Winsock] Send a packet to a server
So basicly I am just sending the text of the packet?
Age - 15 ::: Level - Advanced
If you find my post useful please ::Rate It::

-
Aug 26th, 2005, 04:25 AM
#4
Member
Re: [Winsock] Send a packet to a server
yeah like when yah send the stuff you want to send you could do something like
VB Code:
If Not SockChat.State = sckClosed Then SockChat.SendData TxtGeneral(2).Text
TxtGeneral(2).Text is the text you would be sending here in this case
then you would need to set up a data arival so when yah send the text you will get have to recieve as well
as for me i prewrite handles in mods makes my form code look clean and using handles to me is the way i would go and in your data arrival you just call on the handle and it takes care of all your stuff for you
example
VB Code:
' data arrival in your form would be like this
Private Sub SockChat_DataArrival(ByVal bytesTotal&)
Dim Data$
SockChat.GetData Data
Debug.Print Data
Call Handle (Data, SockChat)
End Sub
'example of what a handle looks like if ah dont know
Public Sub ChatHandle(Data$, YahooYcht As Winsock)
'handles the data
Select Case Mid(Data, 12, 1)
Case Chr(&H1)
With FrmMain
.CmdGeneral(0).Caption = "Logout"
.StatusBar.SimpleText = "Logined In..Ready to join chat.."
End With
Case Chr(&H11)
If InStr(1, Data, "vcauth=") > 0 And InStr(1, Data, "rmspace=") > 0 Then
If Mid(Data, 17, 11) = "Join Failed" And Mid(Split(Data, "À€")(3), 1, 11) = "/c/ad.html?" Then
ChatRoom = Split(Data, "À€")(1)
Else
ChatRoom = Mid(Data, 17, Len(Data) - 16)
ChatRoom = Split(ChatRoom, "À€")(0)
End If
VoiceToken = Split(Data, "vcauth=")(1)
VoiceToken = Split(VoiceToken, "&" & Chr(&H2E))(0)
RoomSpace = Split(Data, "rmspace=")(1)
RoomSpace = Split(RoomSpace, "À€")(0)
End If
Case Chr(&H2)
With FrmMain
.SockAuth.Close
YahooYcht.Close
.CmdGeneral(0).Caption = "Login"
End With
End Select
End Sub
well i hope this kinda helps you out maybe if you have a source post it and ill have a look at it for yah and maybe comment in it and explain it better
-
Aug 26th, 2005, 07:51 AM
#5
Fanatic Member
Re: [Winsock] Send a packet to a server
Hello
I got my server and client talking to each other using winsock. Right now I am sending 1 word back and forth. The client says "Hi", the server replies with "Greetings". Simple stuff like that so I can get it working correctly.
I am using this for my game, i have a central server everyone connects to to get information. There is not constant contact between the two. Just a signal going back and forth every couple of minutes to update and give status of things.
My question is how much data can be sent in a single "Socket(Index).SendData strOutData" command? How much data can I put in the strOutData variable?
I have planned on sending keywords and such "username,buy,computer,units" from the client to the server and the server returns roughly the same. The server needs to send out more though, somtimes I need it to send out about 20 things to each player when they ask for it. How much text and integers can i put in that variable before it takes to long for winsock? Thank you.
-
Aug 27th, 2005, 03:13 PM
#6
Member
Re: [Winsock] Send a packet to a server
well you say you have one word try putting the text you like to be sending to poeple in there and see if work or not i wish i could be more helpful and tell yah but i my self dont know exactly how much but trial and error is what helps me figure out what i can do and what i cant give it a shot and see what happens
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|