• Welcome to Valhalla Legends Archive.
 

[Solved]D2 Game Server Packets

Started by Ringo, May 05, 2005, 02:20 PM

Previous topic - Next topic

Ringo

Iv thought of a few things like that, but the only ever time iv had this from useing a dll export was when useing the AlphaBlend export in msimg32.dll
(uses the TransparentBlt function in the GDI32 api witch has a nasty memery leek)
I dont know alot about memery leeks, but it seems to be giving the signs of one.

I might have to end up doing somthing like you said, but im not sure if it could keep up with the speed the data comes in.
Somthing iv never tryed is try useing 2 of the same dll's both in differnt locations in the app path to gain a 2nd set of functioins to optimize speed. Could this psossibly work?

Thanks for the help

UserLoser.

Quote from: laurion on May 08, 2005, 06:01 PM
Quote from: Ringo on May 08, 2005, 05:53 PM
...The problem seems to be when its in the middle of decompressing a packet and another 1 gets put into the function, it causes VB6 to generate a error report.
Create a queue type of thing. Add a listview to your form, or create an array. Everytime new data is received, add it to the array or listview. Create a timer that fires every second, or whatever, and decompress the first item, and remove it. That would solve that problem (if that is your problem, what you said in the quote).

Using a listview (or any object) to store data is the worst idea possible in this case.  VB, use a collection

NetNX

Well, I have tryed everything i know how todo to make this dll work it only partialy returns the decrypted message... Is there any particular reason why it would do this?

Ringo

#48
Quote from: NetNX on May 09, 2005, 05:23 PM
Well, I have tryed everything i know how todo to make this dll work it only partialy returns the decrypted message... Is there any particular reason why it would do this?

Have you tryed adding extra padding to the end of the message before decomressing it?

when testing i found when decomressing, based on the char's and the lengh of the chat packet you decomress,  had a big impackt on the data after decompression

I'v only tryed this on chat packets tho ( 0x0F before decomression ) and it seems to be giving me a good message:

On Error Resume Next
Dim offset As Long
Dim Size As Long
Dim H1 As String
Dim H2 As Integer
Dim outdata As String
Dim maxsize As Long
Dim outsize As Long

'D2GS_DATA = Data from server >

H1 = GamePacketSize(D2GS_DATA, Size, offset)
outdata = String(Size + 6, vbNullChar)
H2 = GamePacketDecode(Mid(D2GS_DATA, 1 + offset), Size + 5, outdata, Size + 5, outsize)

'outdata = decompressed data.


If useing the same dll as this one im useing, do you have much problems with your project crashing in run time?
I think i know what the problem could partly be, if your getting the same problems as what im getting (mainly crashing when trying to decompress to many at once) it might give me more of a specific idea to what the problem could be.

thanks

Ringo

Iv fixed the memery leek in the dll, it was a  __declspec clashing with a __stdcall that was causing the extreamly slow decomression to take place.
I can jam almost anything through it at any speed with out hardly any system resources been taken up, but some shorter packets will still crash it. (guessing because of changes in 1.10)  It only seems to be packets shorter than 16 bytes tho.. but iv currently wrote a handler for these kind of packets and it seems to be working (and gives good packet format after decompression) or seems to be anyway.

Iv changed the link to the dll witch can be downloaded here:  D2GS.dll

Thanks again to everyone who helped with this!
Should beable to have some stable D2GS chatting now :)

NetNX

 :D I'm at school right now ~_^ but i will definitly try that thanks for the suggestion and update can u contact me on AIM later? my SN is Grim Reaper Ice

<3 ~_^

|