lolodu93 a dit : "Bonjour,
les objets sont envoyés dans un ordre aléatoire. Le problème vient surement d'un précédent objet qui a dérivé sur une autre classe ayant une erreur dans le deserialize ? Tu as pensé a checker vraiment tout les autres objets ?
Sinon, il y a forcement un décalage quelque part.
Envoi nous toutes tes classes, le problème sera surement rapidement détectable.
D'ou vien ton Reader ? Si on pouvais de même le voir."
Le reader vient de BiM.
Ce qui est bizarre c'est que c'est toujours au même endroit que ça bloque.
Et voici les classes :
InventoryContentMessage
Cliquez pour révéler
Cliquez pour masquer
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FeedThem.Sources_Feed_Them.IO;
using FeedThem.Sources_Protocol.Network.Types.Game.Data.Items;
using FeedThem.Sources_Feed_Them.Types;
namespace FeedThem.Sources_Protocol.Network.Messages.Game.Inventory.Items
{
class InventoryContentMessage : Message
{
#region Attributs
public const uint ID = 3016;
private ObjectItem[] _objects;
private int _kamas;
#endregion
#region Propriétés
public override uint protocol_ID
{
get { return ID; }
}
public ObjectItem[] objects
{
get { return _objects; }
set { _objects = value; }
}
public int kamas
{
get { return _kamas; }
set { _kamas = value; }
}
#endregion
#region Constructeurs
public InventoryContentMessage()
{
}
#endregion
#region Méthodes publiques
public override void Serialize(BigEndianWriter big_Endian_Writer)
{
}
public override void Deserialize(BigEndianReader big_Endian_Reader)
{
ObjectItem local_Object = null;
ushort limite = big_Endian_Reader.ReadUShort();
_objects = new ObjectItem[limite];
for (ushort index = 0; index < limite; index++ )
{
local_Object = new ObjectItem();
local_Object.Deserialize(big_Endian_Reader);
_objects[index] = local_Object;
}
this._kamas = big_Endian_Reader.ReadInt();
if (this._kamas < 0)
{
throw new Exception("Forbidden value (" + this._kamas + ") on element of InventoryContentMessage.kamas.");
}
}
#endregion
}
}
ObjectItem
Cliquez pour révéler
Cliquez pour masquer
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FeedThem.Sources_Feed_Them.IO;
using FeedThem.Sources_Protocol.Network.Types.Game.Data.Items.Effects;
namespace FeedThem.Sources_Protocol.Network.Types.Game.Data.Items
{
class ObjectItem
{
#region Attributs
public const uint ID = 37;
private uint _position;
private short _object_GID;
private ObjectEffect[] _effects;
private int _object_UID;
private int _quantity;
#endregion
#region Propriétés
public uint position
{
get { return _position; }
set { _position = value; }
}
public short object_GID
{
get { return _object_GID; }
set { _object_GID = value; }
}
public ObjectEffect[] effects
{
get { return _effects; }
set { _effects = value; }
}
public int object_UID
{
get { return _object_UID; }
set { _object_UID = value; }
}
public int quantity
{
get { return _quantity; }
set { _quantity = value; }
}
#endregion
#region Constructeurs
public ObjectItem()
{
}
#endregion
#region Méthodes publiques
public void Deserialize(BigEndianReader big_Endian_Reader)
{
ushort instance_ID = 0;
ObjectEffect local_Object_Effect = null;
this._position = (uint)big_Endian_Reader.ReadByte();
if (this._position < 0 || this._position > 255)
{
throw new Exception("Forbidden value (" + this._position + ") on element of ObjectItem.position.");
}
this._object_GID = big_Endian_Reader.ReadShort();
if (this._object_GID < 0)
{
throw new Exception("Forbidden value (" + this._object_GID + ") on element of ObjectItem.objectGID.");
}
ushort limite = big_Endian_Reader.ReadUShort();
_effects = new ObjectEffect[limite];
for (ushort index = 0; index < limite; index++)
{
instance_ID = big_Endian_Reader.ReadUShort();
local_Object_Effect = ProtocolTypeManager.GetInstance<ObjectEffect>((short)instance_ID);
local_Object_Effect.Deserialize(big_Endian_Reader);
_effects[index] = local_Object_Effect;
}
this._object_UID = big_Endian_Reader.ReadInt();
if (this._object_UID < 0)
{
throw new Exception("Forbidden value (" + this._object_UID + ") on element of ObjectItem.objectUID.");
}
this._quantity = big_Endian_Reader.ReadInt();
if (this._quantity < 0)
{
throw new Exception("Forbidden value (" + this._quantity + ") on element of ObjectItem.quantity.");
}
}
#endregion
}
}
ObjectEffect
Cliquez pour révéler
Cliquez pour masquer
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FeedThem.Sources_Feed_Them.IO;
namespace FeedThem.Sources_Protocol.Network.Types.Game.Data.Items.Effects
{
class ObjectEffect
{
#region Attributs
public const uint ID = 76;
private short _action_ID;
#endregion
#region Propriétés
public short action_ID
{
get { return _action_ID; }
set { _action_ID = value; }
}
#endregion
#region Constructeurs
public ObjectEffect()
{
}
#endregion
#region Méthodes publiques
public virtual void Deserialize(BigEndianReader big_Endian_Reader)
{
this._action_ID = big_Endian_Reader.ReadShort();
if (this._action_ID < 0)
{
throw new Exception("Forbidden value (" + this._action_ID + ") on element of ObjectEffect.actionId.");
}
}
#endregion
}
}
ObjectEffectCreature
Cliquez pour révéler
Cliquez pour masquer
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FeedThem.Sources_Feed_Them.IO;
namespace FeedThem.Sources_Protocol.Network.Types.Game.Data.Items.Effects
{
class ObjectEffectCreature : ObjectEffect
{
#region Attributs
public const uint ID = 71;
private short _monster_Family_ID;
#endregion
#region Propriétés
public short monster_Family_ID
{
get { return _monster_Family_ID; }
set { _monster_Family_ID = value; }
}
#endregion
#region Constructeurs
public ObjectEffectCreature()
{
}
#endregion
#region Méthodes publiques
public override void Deserialize(BigEndianReader big_Endian_Reader)
{
base.Deserialize(big_Endian_Reader);
this._monster_Family_ID = big_Endian_Reader.ReadShort();
if (this._monster_Family_ID < 0)
{
throw new Exception("Forbidden value (" + this._monster_Family_ID + ") on element of ObjectEffectCreature.monsterFamilyId.");
}
}
#endregion
}
}
ObjectEffectDate
Cliquez pour révéler
Cliquez pour masquer
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FeedThem.Sources_Feed_Them.IO;
namespace FeedThem.Sources_Protocol.Network.Types.Game.Data.Items.Effects
{
class ObjectEffectDate : ObjectEffect
{
#region Attributs
public const uint ID = 72;
private short _year;
private short _month;
private short _day;
private short _hour;
private short _minute;
#endregion
#region Propriétés
public short year
{
get { return _year; }
set { _year = value; }
}
public short month
{
get { return _month; }
set { _month = value; }
}
public short day
{
get { return _day; }
set { _day = value; }
}
public short hour
{
get { return _hour; }
set { _hour = value; }
}
public short minute
{
get { return _minute; }
set { _minute = value; }
}
#endregion
#region Constructeurs
public ObjectEffectDate()
{
}
#endregion
#region Méthodes publiques
public override void Deserialize(BigEndianReader big_Endian_Reader)
{
base.Deserialize(big_Endian_Reader);
this._year = big_Endian_Reader.ReadShort();
if (this._year < 0)
{
throw new Exception("Forbidden value (" + this._year + ") on element of ObjectEffectInteger.value.");
}
this._month = big_Endian_Reader.ReadShort();
if (this._month < 0)
{
throw new Exception("Forbidden value (" + this._month + ") on element of ObjectEffectDate.month.");
}
this._day = big_Endian_Reader.ReadShort();
if (this._day < 0)
{
throw new Exception("Forbidden value (" + this._day + ") on element of ObjectEffectDate.day.");
}
this._hour = big_Endian_Reader.ReadShort();
if (this._hour < 0)
{
throw new Exception("Forbidden value (" + this._hour + ") on element of ObjectEffectDate.hour.");
}
this._minute = big_Endian_Reader.ReadShort();
if (this._minute < 0)
{
throw new Exception("Forbidden value (" + this._minute + ") on element of ObjectEffectDate.minute.");
}
}
#endregion
}
}
ObjectEffectDice
Cliquez pour révéler
Cliquez pour masquer
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FeedThem.Sources_Feed_Them.IO;
namespace FeedThem.Sources_Protocol.Network.Types.Game.Data.Items.Effects
{
class ObjectEffectDice : ObjectEffect
{
#region Attributs
public const uint ID = 73;
private short _dice_Num;
private short _dice_Side;
private short _dice_Const;
#endregion
#region Propriétés
public short dice_Num
{
get { return _dice_Num; }
set { _dice_Num = value; }
}
public short dice_Side
{
get { return _dice_Side; }
set { _dice_Side = value; }
}
public short dice_Const
{
get { return _dice_Const; }
set { _dice_Const = value; }
}
#endregion
#region Constructeurs
public ObjectEffectDice()
{
}
#endregion
#region Méthodes publiques
public override void Deserialize(BigEndianReader big_Endian_Reader)
{
base.Deserialize(big_Endian_Reader);
this._dice_Num = big_Endian_Reader.ReadShort();
if (this._dice_Num < 0)
{
throw new Exception("Forbidden value (" + this._dice_Num + ") on element of ObjectEffectDice.diceNum.");
}
this._dice_Side = big_Endian_Reader.ReadShort();
if (this._dice_Side < 0)
{
throw new Exception("Forbidden value (" + this._dice_Side + ") on element of ObjectEffectDice.diceSide.");
}
this._dice_Const = big_Endian_Reader.ReadShort();
if (this._dice_Const < 0)
{
throw new Exception("Forbidden value (" + this._dice_Const + ") on element of ObjectEffectDice.diceConst.");
}
}
#endregion
}
}
ObjectEffectDuration
Cliquez pour révéler
Cliquez pour masquer
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FeedThem.Sources_Feed_Them.IO;
namespace FeedThem.Sources_Protocol.Network.Types.Game.Data.Items.Effects
{
class ObjectEffectDuration : ObjectEffect
{
#region Attributs
public const uint ID = 75;
private short _days;
private short _hours;
private short _minutes;
#endregion
#region Propriétés
public short days
{
get { return _days; }
set { _days = value; }
}
public short hours
{
get { return _hours; }
set { _hours = value; }
}
public short minutes
{
get { return _minutes; }
set { _minutes = value; }
}
#endregion
#region Constructeurs
public ObjectEffectDuration()
{
}
#endregion
#region Méthodes publiques
public override void Deserialize(BigEndianReader big_Endian_Reader)
{
base.Deserialize(big_Endian_Reader);
this._days = big_Endian_Reader.ReadShort();
if (this._days < 0)
{
throw new Exception("Forbidden value (" + this._days + ") on element of ObjectEffectDuration.days.");
}
this._hours = big_Endian_Reader.ReadShort();
if (this._hours < 0)
{
throw new Exception("Forbidden value (" + this._hours + ") on element of ObjectEffectDuration.hours.");
}
this._minutes = big_Endian_Reader.ReadShort();
if (this._minutes < 0)
{
throw new Exception("Forbidden value (" + this._minutes + ") on element of ObjectEffectDuration.minutes.");
}
}
#endregion
}
}
ObjectEffectInteger
Cliquez pour révéler
Cliquez pour masquer
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FeedThem.Sources_Feed_Them.IO;
namespace FeedThem.Sources_Protocol.Network.Types.Game.Data.Items.Effects
{
class ObjectEffectInteger : ObjectEffect
{
#region Attributs
public const uint ID = 70;
private short _value;
#endregion
#region Propriétés
public short value
{
get { return _value; }
set { _value = value; }
}
#endregion
#region Constructeurs
public ObjectEffectInteger()
{
}
#endregion
#region Méthodes publiques
public override void Deserialize(BigEndianReader big_Endian_Reader)
{
base.Deserialize(big_Endian_Reader);
this._value = big_Endian_Reader.ReadShort();
if (this._value < 0)
{
throw new Exception("Forbidden value (" + this._value + ") on element of ObjectEffectInteger.value.");
}
}
#endregion
}
}
ObjectEffectLadder
Cliquez pour révéler
Cliquez pour masquer
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FeedThem.Sources_Feed_Them.IO;
namespace FeedThem.Sources_Protocol.Network.Types.Game.Data.Items.Effects
{
class ObjectEffectLadder : ObjectEffectCreature
{
#region Attributs
public const uint ID = 81;
private int _monster_Count;
#endregion
#region Propriétés
public int monster_Count
{
get { return _monster_Count; }
set { _monster_Count = value; }
}
#endregion
#region Constructeurs
public ObjectEffectLadder()
{
}
#endregion
#region Méthodes publiques
public override void Deserialize(BigEndianReader big_Endian_Reader)
{
base.Deserialize(big_Endian_Reader);
this._monster_Count = big_Endian_Reader.ReadInt();
if (this._monster_Count < 0)
{
throw new Exception("Forbidden value (" + this._monster_Count + ") on element of ObjectEffectLadder.monsterCount.");
}
}
#endregion
}
}
ObjectEffectMinMax
Cliquez pour révéler
Cliquez pour masquer
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FeedThem.Sources_Feed_Them.IO;
namespace FeedThem.Sources_Protocol.Network.Types.Game.Data.Items.Effects
{
class ObjectEffectMinMax : ObjectEffect
{
#region Attributs
public const uint ID = 82;
private short _min;
private short _max;
#endregion
#region Propriétés
public short min
{
get { return _min; }
set { _min = value; }
}
public short max
{
get { return _max; }
set { _max = value; }
}
#endregion
#region Constructeurs
public ObjectEffectMinMax()
{
}
#endregion
#region Méthodes publiques
public override void Deserialize(BigEndianReader big_Endian_Reader)
{
base.Deserialize(big_Endian_Reader);
this._min = big_Endian_Reader.ReadShort();
if (this._min < 0)
{
throw new Exception("Forbidden value (" + this._min + ") on element of ObjectEffectMinMax.min.");
}
this._max = big_Endian_Reader.ReadShort();
if (this._max < 0)
{
throw new Exception("Forbidden value (" + this._max + ") on element of ObjectEffectMinMax.max.");
}
}
#endregion
}
}
ObjectEffectMount
Cliquez pour révéler
Cliquez pour masquer
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FeedThem.Sources_Feed_Them.IO;
namespace FeedThem.Sources_Protocol.Network.Types.Game.Data.Items.Effects
{
class ObjectEffectMount : ObjectEffect
{
#region Attributs
public const uint ID = 179;
private int _mount_ID;
private double _date;
private short _model_ID;
#endregion
#region Propriétés
public int mount_ID
{
get { return _mount_ID; }
set { _mount_ID = value; }
}
public double date
{
get { return _date; }
set { _date = value; }
}
public short model_ID
{
get { return _model_ID; }
set { _model_ID = value; }
}
#endregion
#region Constructeurs
public ObjectEffectMount()
{
}
#endregion
#region Méthodes publiques
public override void Deserialize(BigEndianReader big_Endian_Reader)
{
base.Deserialize(big_Endian_Reader);
this._mount_ID = big_Endian_Reader.ReadInt();
if (this._mount_ID < 0)
{
throw new Exception("Forbidden value (" + this._mount_ID + ") on element of ObjectEffectMount.mountId.");
}
this._date = big_Endian_Reader.ReadDouble();
this._model_ID = big_Endian_Reader.ReadShort();
if (this._model_ID < 0)
{
throw new Exception("Forbidden value (" + this._model_ID + ") on element of ObjectEffectMount.modelId.");
}
}
#endregion
}
}
ObjectEffectString
Cliquez pour révéler
Cliquez pour masquer
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FeedThem.Sources_Feed_Them.IO;
namespace FeedThem.Sources_Protocol.Network.Types.Game.Data.Items.Effects
{
class ObjectEffectString : ObjectEffect
{
#region Attributs
public const uint ID = 74;
private string _value_;
#endregion
#region Propriétés
public string value_
{
get { return _value_; }
set { _value_ = value; }
}
#endregion
#region Constructeurs
public ObjectEffectString()
{
}
#endregion
#region Méthodes publiques
public override void Deserialize(BigEndianReader big_Endian_Reader)
{
base.Deserialize(big_Endian_Reader);
this._value_ = big_Endian_Reader.ReadStringUTF8();
}
#endregion
}
}
Si vous voulez d'autres classes, dites le moi, sachant que j'ai pas trop Internet vu que je suis à la montagne (j'arrive à chopper un SFR WiFi Public quand il fait pas trop mauvais !)
Merci d'avance ! :)