Bonsoir,
d'habitude j'aime pas trop poster deux topic a la suite sur le fofo mais vu que ya peu d'ambiance en ce moment voila tout :)
Je recoi un GameMapNoMovementMessage -> SANS RAISON !
Prenons un personnage, Il est a la cellid 241, il veut se déplacer a la 242:
Public Sub MoveOnMap(ByVal CellToGo As Integer)
Dim Path As New Pathfinding.Pathfinding
Path.FindPath(MapInfo.Cells, CharacterInfo.CellId, CellToGo)
If Not Path.chemin.Count = 0 Then
Dim GMMRM As New Network.Game.Map.Movement.Request.GameMapMovementRequestMessage
GMMRM.init(Path.chemin, MapInfo.MapId)
GMMRM.pack(ServerSock)
Dim TimeToWait As Integer
If Path.chemin.Count <= 2 Then
TimeToWait = Path.chemin.Count * 500
Else
TimeToWait = Path.chemin.Count * 300
End If
pause(TimeToWait)
Dim GMMCM As New Network.Game.Map.Movement.GameMapMovementConfirmMessage
GMMCM.pack(ServerSock)
End If
End Sub
Donc mon Path.Chemin = 241 et 242.
Map id Ok.
Mais WTF ?!?
Si c'est les informations sont bonnes, sa viendrai de l'envoi du paquet ?
Voilà ma classe qui est tout a fait normal:
Cliquez pour révéler
Cliquez pour masquer
Imports FullBot.Utils.SocketManager.Parsing
Namespace Network.Game.Map.Movement.Request
Public Class GameMapMovementRequestMessage
Public keyMovements As New List(Of UInteger)
Public mapId As UInteger = 0
Public Const protocolId As UInteger = 950
Public Function init(param1 As List(Of UInteger), param2 As UInteger) As GameMapMovementRequestMessage
Me.keyMovements = param1
Me.mapId = param2
Return Me
End Function
Public Function deserialize(param1 As DofusReader)
Dim _loc_4 As UInteger = 0
Dim _loc_2 = param1.ReadUnSignedshort()
Dim _loc_3 As UInteger = 0
While (_loc_3 < _loc_2)
_loc_4 = param1.ReadShort()
Me.keyMovements.Add(_loc_4)
_loc_3 = _loc_3 + 1
End While
Me.mapId = param1.ReadInt()
Return Me
End Function
Public Function pack(ByVal sock As Object)
Dim _Writer As New DofusWriter()
Me.serialize(_Writer)
DofusWriter.Send(GameMapMovementRequestMessage.protocolId, sock)
Return Me
End Function
Public Function serialize(param1 As DofusWriter)
param1.WriteShort(Me.keyMovements.Count)
Dim _loc_2 As UInteger = 0
While (_loc_2 < Me.keyMovements.Count)
param1.WriteShort(Me.keyMovements(_loc_2))
_loc_2 = _loc_2 + 1
End While
param1.WriteInt16(Me.mapId)
Return Me
End Function
End Class
End Namespace
Donc a priori rien d'étonnant jusqu'ici.
Cliquez pour révéler
Cliquez pour masquer
Friend Shared Function Send(ByVal PacketID As Integer, ByVal sock As Object)
Dim MessageLenghtType As Integer = ComputeTypeLen(m_Bytes.Count)
Dim Header As Short = ComputeStaticHeader(PacketID, MessageLenghtType)
Dim BytesToWrite(2 + MessageLenghtType + m_Bytes.Count - 1) As Byte
BytesToWrite(0) = Header >> 8
BytesToWrite(1) = Header - 256 * BytesToWrite(0)
Dim index As Integer
Select Case MessageLenghtType
Case 1
BytesToWrite(2) = m_Bytes.Count
index = 3
Case 2
BytesToWrite(2) = m_Bytes.Count >> 8
BytesToWrite(3) = m_Bytes.Count - 256 * BytesToWrite(2)
index = 4
Case 3
BytesToWrite(2) = m_Bytes.Count >> 16
BytesToWrite(3) = m_Bytes.Count >> 8
BytesToWrite(4) = m_Bytes.Count - 256 * BytesToWrite(3) - 256 * 256 * BytesToWrite(2)
index = 5
End Select
Dim send_debug As String = Nothing
For i As Integer = index To m_Bytes.Count + index - 1
BytesToWrite(i) = m_Bytes(i - index)
Next
m_Bytes.Clear()
sock.Send(BytesToWrite)
Console.WriteLine("envoie : id -> " & PacketID & " len -> " & MessageLenghtType)
Console.WriteLine()
Return (BytesToWrite)
End Function
Je ne pense pas que sa vienne de mon send puisque c'est celui de ToOnS et c'est celui que j'ai utilisé pour XX de mes projets.
Mais la seul chose qui me parait louche est que Mon 950 -> GameMapMovementMessage -> Lenght -> 1
O_o ? Nan ?
J'attend vos avis