Wow that may have been my previous problem as well! I'll have to check that out (and i did have a problem sending any kind of Long Values... but to get around it... i just did a Str$(LONGVAR), and then just did a AddStringToBuffer... then on the recieving end i just got it back as a long and did CLng(W/E). Glad you picked up on it though, i might go back and actually readd byte arrays now).
My only guess would be the method used has become obsolete and theres a new method, but you're right, that is odd and fishy.
i dunno, maybe the sub used to control the long variables for the ComSocketServer.dll had changed? I (thought i) remember verrigan saying he had the source and had changed some of it up. If perhaps it was changed and the functions that you're using for mirage had been altered in the DLL... i dunno....
Dragoons Master
Unregistered
The most weird this is that this working DLL, the ones that work with binary packets, is OLDER than the other one. One is from september/05 and the other one is from august/05... Thats weird...
Dragoons Master
Unregistered
Ok, I found THE bug and I fixed it!!! Finaly, after a month of useless attempts for fixing this I did it. Well, there realy was a bug. For everybody that downloaded Verrigan's modified MSE with BinPackets, the bug is that when you send the same data to a lot of diferent persons, like SendDataToAll, the Buffer get's messy the first time you send this data. Why? Simple! It was being used as ByRef and that way when, inside SendDataToNew, this code executes: Code: Data = PrefixBuffer(Data, VarPtr(CByte(pType)), 1)
Data = PrefixBuffer(Data, VarPtr(aLen(Data)), 2)
it will replace the old data with this one already modified... So you need to do this once or don't edit. My fix will only don't change the Data() variable. It will copy the data inside Data() variable to an other variable, DataB.
To fix, inside SendDataToNew, replace: Code: Data = PrefixBuffer(Data, VarPtr(CByte(pType)), 1)
Data = PrefixBuffer(Data, VarPtr(aLen(Data)), 2)
GameServer.Sockets(Index).WriteBytes Data
With: Code: Dim DataB() As Byte
DataB = Data
DataB = PrefixBuffer(DataB, VarPtr(CByte(pType)), 1)
DataB = PrefixBuffer(DataB, VarPtr(aLen(DataB)), 2)
GameServer.Sockets(Index).WriteBytes Data
That shall fix it!
Thanks! also how much faster is this?
maybe like,
how many players could you fit?
Binary packets isn't as much about speed as it is lowering bandwidth usage.
Posts: 2,742
Threads: 115
Joined: Jun 2006
Reputation:
0
Spodi Wrote:Binary packets isn't as much about speed as it is lowering bandwidth usage.
Still, having the server sending less data means that it will be able to send to a few more people than it could when it was sending a lot of data.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
I wouldn't be surprised if packing strings together holding the same information as the binary is faster (depending on how you do the binary). It really depends how you treat the packets, too. You can easily write crappy binary packets, just like you can string packets. Just like anything else, they're great, if done right. :wink:
Alright  So I converted my packets succesfully from Client to Server, without any problems, using a slightly modified version of modBuffer. Now, I converted all the packets from Server sent to client to byte arrays, and it seems to be having alot of problems. The packets are all done good, I checked those over, but it seems to always totally freeze up the client side and crash VB6. I know this is the Server to Client because I did not have this problem when I had only Client to Server. Does anyone know what could possibly be causing this? :S
Edit: Basically, has anyone succesfully converted Server to Client packets? If so, I'd like to talk to you
Posts: 2,605
Threads: 412
Joined: Nov 2021
Reputation:
0
I suggest you try and reach Grim, he knows what his doing.
Well,I seem to have found where the bug is coming from. It seems that whenever it gets to the MapData packet (in SendMap from server side), it processes the packet and all that, but it prefixes it with the wrong packet length, and that is what is causing the bug.
Does anyone know what could possibly be causing this? o_O It seems to be passing the byte values 34 and 16 (in that order) instead of 34 and 18 for the packet length :S.
Dragoons Master Wrote:Ok, I found THE bug and I fixed it!!! Finaly, after a month of useless attempts for fixing this I did it. Well, there realy was a bug. For everybody that downloaded Verrigan's modified MSE with BinPackets, the bug is that when you send the same data to a lot of diferent persons, like SendDataToAll, the Buffer get's messy the first time you send this data. Why? Simple! It was being used as ByRef and that way when, inside SendDataToNew, this code executes:Code: Data = PrefixBuffer(Data, VarPtr(CByte(pType)), 1)
Data = PrefixBuffer(Data, VarPtr(aLen(Data)), 2)
it will replace the old data with this one already modified... So you need to do this once or don't edit. My fix will only don't change the Data() variable. It will copy the data inside Data() variable to an other variable, DataB.
To fix, inside SendDataToNew, replace:Code: Data = PrefixBuffer(Data, VarPtr(CByte(pType)), 1)
Data = PrefixBuffer(Data, VarPtr(aLen(Data)), 2)
GameServer.Sockets(Index).WriteBytes Data
With:Code: Dim DataB() As Byte
DataB = Data
DataB = PrefixBuffer(DataB, VarPtr(CByte(pType)), 1)
DataB = PrefixBuffer(DataB, VarPtr(aLen(DataB)), 2)
GameServer.Sockets(Index).WriteBytes Data
That shall fix it!
Alright this confused the Hell out of me..
SendDataToNew doesnt exist, and the only thing similar to it that I could find was SendDataNew on the client, which doesn't use GameServer O.O. Soooo.. wth.
Also, does anyone have more bug fixes for mse-verrigan? I'm unfamiliar with binary packets, and looking around I haven't found anything that goes more indepth about the subject.
-edit-
Holy pain in the ass. I didn't realize the editors hardly work. The HandleSave____'s are bugged :[ And the SendEditNpcs crashes the client (occurs in the prefix buffer). Looking at it I'm not sure what went wrong, any help?
|