14-02-2007, 10:59 PM
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: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:With:That shall fix it!
Code:
Data = PrefixBuffer(Data, VarPtr(CByte(pType)), 1)
Data = PrefixBuffer(Data, VarPtr(aLen(Data)), 2)To fix, inside SendDataToNew, replace:
Code:
Data = PrefixBuffer(Data, VarPtr(CByte(pType)), 1)
Data = PrefixBuffer(Data, VarPtr(aLen(Data)), 2)
GameServer.Sockets(Index).WriteBytes DataCode:
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