Bonjour,
j'ai une erreur lorsque la Deserialize de la paquet 226.
Erreur : The given key was not present in the dictionary.
paquet 226
j'ai une erreur lorsque la Deserialize de la paquet 226.
Erreur : The given key was not present in the dictionary.
paquet 226
Code:
Namespace Dofus.Network.Messages.Game.Context.Roleplay
Public Class MapComplementaryInformationsDataMessage
Inherits NetworkMessage
Public Overrides Property ProtocolID As UInteger = 226
Private m_subAreaId As UShort
Public Overridable Property SubAreaId() As UShort
Get
Return m_subAreaId
End Get
Set(ByVal value As UShort)
m_subAreaId = value
End Set
End Property
Private m_mapId As Integer
Public Overridable Property MapId() As Integer
Get
Return m_mapId
End Get
Set(ByVal value As Integer)
m_mapId = value
End Set
End Property
Private m_houses As List(Of HouseInformations)
Public Overridable Property Houses() As List(Of HouseInformations)
Get
Return m_houses
End Get
Set(ByVal value As List(Of HouseInformations))
m_houses = value
End Set
End Property
Private m_actors As List(Of GameRolePlayActorInformations)
Public Overridable Property Actors() As List(Of GameRolePlayActorInformations)
Get
Return m_actors
End Get
Set(ByVal value As List(Of GameRolePlayActorInformations))
m_actors = value
End Set
End Property
Private m_interactiveElements As List(Of InteractiveElement)
Public Overridable Property InteractiveElements() As List(Of InteractiveElement)
Get
Return m_interactiveElements
End Get
Set(ByVal value As List(Of InteractiveElement))
m_interactiveElements = value
End Set
End Property
Private m_statedElements As List(Of StatedElement)
Public Overridable Property StatedElements() As List(Of StatedElement)
Get
Return m_statedElements
End Get
Set(ByVal value As List(Of StatedElement))
m_statedElements = value
End Set
End Property
Private m_obstacles As List(Of MapObstacle)
Public Overridable Property Obstacles() As List(Of MapObstacle)
Get
Return m_obstacles
End Get
Set(ByVal value As List(Of MapObstacle))
m_obstacles = value
End Set
End Property
Private m_fights As List(Of FightCommonInformations)
Public Overridable Property Fights() As List(Of FightCommonInformations)
Get
Return m_fights
End Get
Set(ByVal value As List(Of FightCommonInformations))
m_fights = value
End Set
End Property
Public Sub Initiate(ByVal subAreaId As UShort, ByVal mapId As Integer, ByVal houses As List(Of HouseInformations), ByVal actors As List(Of GameRolePlayActorInformations), ByVal interactiveElements As List(Of InteractiveElement), ByVal statedElements As List(Of StatedElement), _
ByVal obstacles As List(Of MapObstacle), ByVal fights As List(Of FightCommonInformations))
m_subAreaId = subAreaId
m_mapId = mapId
m_houses = houses
m_actors = actors
m_interactiveElements = interactiveElements
m_statedElements = statedElements
m_obstacles = obstacles
m_fights = fights
End Sub
Public Overrides Sub Serialize(ByVal writer As DofusMessage)
writer.WriteVarShort(m_subAreaId)
writer.WriteInt(m_mapId)
writer.WriteShort((CType((m_houses.Count), Short)))
Dim housesIndex As Integer
housesIndex = 0
While (housesIndex < m_houses.Count)
Dim objectToSend As HouseInformations = m_houses(housesIndex)
writer.WriteUShort((CType((objectToSend.ProtocolId), UShort)))
objectToSend.Serialize(writer)
housesIndex = (housesIndex + 1)
End While
writer.WriteShort((CType((m_actors.Count), Short)))
Dim actorsIndex As Integer
actorsIndex = 0
While (actorsIndex < m_actors.Count)
Dim objectToSend As GameRolePlayActorInformations = m_actors(actorsIndex)
writer.WriteUShort((CType((objectToSend.ProtocolId), UShort)))
objectToSend.Serialize(writer)
actorsIndex = (actorsIndex + 1)
End While
writer.WriteShort((CType((m_interactiveElements.Count), Short)))
Dim interactiveElementsIndex As Integer
interactiveElementsIndex = 0
While (interactiveElementsIndex < m_interactiveElements.Count)
Dim objectToSend As InteractiveElement = m_interactiveElements(interactiveElementsIndex)
writer.WriteUShort((CType((objectToSend.ProtocolId), UShort)))
objectToSend.Serialize(writer)
interactiveElementsIndex = (interactiveElementsIndex + 1)
End While
writer.WriteShort((CType((m_statedElements.Count), Short)))
Dim statedElementsIndex As Integer
statedElementsIndex = 0
While (statedElementsIndex < m_statedElements.Count)
Dim objectToSend As StatedElement = m_statedElements(statedElementsIndex)
objectToSend.Serialize(writer)
statedElementsIndex = (statedElementsIndex + 1)
End While
writer.WriteShort((CType((m_obstacles.Count), Short)))
Dim obstaclesIndex As Integer
obstaclesIndex = 0
While (obstaclesIndex < m_obstacles.Count)
Dim objectToSend As MapObstacle = m_obstacles(obstaclesIndex)
objectToSend.Serialize(writer)
obstaclesIndex = (obstaclesIndex + 1)
End While
writer.WriteShort((CType((m_fights.Count), Short)))
Dim fightsIndex As Integer
fightsIndex = 0
While (fightsIndex < m_fights.Count)
Dim objectToSend As FightCommonInformations = m_fights(fightsIndex)
objectToSend.Serialize(writer)
fightsIndex = (fightsIndex + 1)
End While
End Sub
Public Overrides Sub Deserialize(ByVal reader As DofusReader)
m_subAreaId = reader.ReadVarUhShort()
m_mapId = reader.ReadInt()
Dim housesCount As Integer = reader.ReadUShort()
Dim housesIndex As Integer
m_houses = New System.Collections.Generic.List(Of HouseInformations)()
housesIndex = 0
While (housesIndex < housesCount)
Dim objectToAdd As HouseInformations = ProtocolTypeManager.GetInstance(reader.ReadUShort)
objectToAdd.Deserialize(reader)
m_houses.Add(objectToAdd)
housesIndex = (housesIndex + 1)
End While
Dim actorsCount As Integer = reader.ReadUShort()
Dim actorsIndex As Integer
m_actors = New System.Collections.Generic.List(Of GameRolePlayActorInformations)()
actorsIndex = 0
While (actorsIndex < actorsCount)
Dim objectToAdd As GameRolePlayActorInformations = ProtocolTypeManager.GetInstance(reader.ReadUShort)
objectToAdd.Deserialize(reader)
m_actors.Add(objectToAdd)
actorsIndex = (actorsIndex + 1)
End While
Dim interactiveElementsCount As Integer = reader.ReadUShort()
Dim interactiveElementsIndex As Integer
m_interactiveElements = New System.Collections.Generic.List(Of InteractiveElement)()
interactiveElementsIndex = 0
While (interactiveElementsIndex < interactiveElementsCount)
Dim objectToAdd As InteractiveElement = ProtocolTypeManager.GetInstance(reader.ReadUShort)
objectToAdd.Deserialize(reader)
m_interactiveElements.Add(objectToAdd)
interactiveElementsIndex = (interactiveElementsIndex + 1)
End While
Dim statedElementsCount As Integer = reader.ReadUShort()
Dim statedElementsIndex As Integer
m_statedElements = New System.Collections.Generic.List(Of StatedElement)()
statedElementsIndex = 0
While (statedElementsIndex < statedElementsCount)
Dim objectToAdd As New StatedElement()
objectToAdd.Deserialize(reader)
m_statedElements.Add(objectToAdd)
statedElementsIndex = (statedElementsIndex + 1)
End While
Dim obstaclesCount As Integer = reader.ReadUShort()
Dim obstaclesIndex As Integer
m_obstacles = New System.Collections.Generic.List(Of MapObstacle)()
obstaclesIndex = 0
While (obstaclesIndex < obstaclesCount)
Dim objectToAdd As New MapObstacle()
objectToAdd.Deserialize(reader)
m_obstacles.Add(objectToAdd)
obstaclesIndex = (obstaclesIndex + 1)
End While
Dim fightsCount As Integer = reader.ReadUShort()
Dim fightsIndex As Integer
m_fights = New System.Collections.Generic.List(Of FightCommonInformations)()
fightsIndex = 0
While (fightsIndex < fightsCount)
Dim objectToAdd As New FightCommonInformations()
objectToAdd.Deserialize(reader)
m_fights.Add(objectToAdd)
fightsIndex = (fightsIndex + 1)
End While
End Sub
End Class
End Namespace
Dernière édition par un modérateur: