• Welcome to Valhalla Legends Archive.
 

Constructing a Descent Packetbuffer

Started by TheNewOne, March 06, 2005, 08:45 PM

Previous topic - Next topic

TheNewOne

Ok first off ive just finished reading a few tutorials on win32 socket programming. And ive gotten my bot to just connect. Now im wanting to send packets ect.  Ive read up on send() and ect. but how would i go about sending just a single byte, an array of bytes, words and dwords. Thanks for any suggestions, help and refrences.

Kp

send() can send any of the types you describe.  I have to ask, what is your Descent bot going to do?  Deathmatch is probably easier than coop, but even that's going to need to do quite a lot of wall modeling I think.  Also, which Descent are you building for?
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

TheNewOne

Hmm ive tried using send() but since im posting this I obviously dont know how to use it for such things.

LordVader

DarkMinnions DynBuffer probably would give you some good idea's on how to model/create your own Packet buffer.

If you have specific questions about DynBuffer feel free to PM me.

Mephisto

#4
Quote from: Kp on March 06, 2005, 11:08 PM
send() can send any of the types you describe.  I have to ask, what is your Descent bot going to do?  Deathmatch is probably easier than coop, but even that's going to need to do quite a lot of wall modeling I think.  Also, which Descent are you building for?

You shouldn't mock clueless "newbies" like that, Kp.  :)

To whoever this is again: After you connect you're going to have to create a set of functions which can copy data (DWORDs, WORDs, QWORDs, BYTEs, CONST CHARs, etc.) into a persistant buffer (preferably through a class) and after copying the data into the buffer you then call send() to send that buffer (packet) on the connected associated socket.  Then you wait until the server sends back a reseponse which you catch with recv() (assuming you're using blocking sockets).  There are dozens of examples on the public WWW so go on Google or MSN and fill in a search and you're bound to find one.  On a side note though, it's highly recommended that you learn to write your own packet buffer as it's an essential thing to know in C++ as it helps you understand buffers and how to handle/manipulate them.  :)  Also, in addition to a packet buffer you may want to consider creating a packet reader so you don't have to manually read from a buffer, you can just call functions.  :)

Kp

Quote from: SoR-Mephisto on March 07, 2005, 10:57 PM
Quote from: Kp on March 06, 2005, 11:08 PM
send() can send any of the types you describe.  I have to ask, what is your Descent bot going to do?  Deathmatch is probably easier than coop, but even that's going to need to do quite a lot of wall modeling I think.  Also, which Descent are you building for?
You shouldn't mock clueless "newbies" like that, Kp.  :)

He said it was a Descent packetbuffer!  The Descent series were good games, so I took an interest. :)
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

Soul Taker

Oh man, first I didn't even notice it said Descent and I thought it said decent.  I read Kp's response and got confused.  Then I re-read the subject and, after reading Kp's reply, thought he really did mean Descent.  I'm so confused!

Kp

Quote from: Soul Taker on March 10, 2005, 01:28 PMOh man, first I didn't even notice it said Descent and I thought it said decent.  I read Kp's response and got confused.  Then I re-read the subject and, after reading Kp's reply, thought he really did mean Descent.  I'm so confused!

I meant Descent.  I think the original poster may have meant "decent", but it's much more fun to answer what's asked, not what was probably intended.  It teaches them to ask better questions.
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

Adron

Besides, putting an interesting subject like that, and then asking a boring question is just like what spammers do...