capadocius
Initiate
So here the deal: I must add a new stat (experience points) to the playerMobile. So i got an Experience class that look like this for now:
public class Experience
{
public int pointXP { get; set; }
public Experience()
{
pointXP = 0;
}
}
so a get; set; and something to initialize when it's called. after that i placed it in playerMobile like this
public PlayerMobile(){
blablabla;
blablabla;
blabalala;
Experience m_exp=New Experience(); //around line 3950 of playerMobile
after i call the serialize/deserialize
public override void Deserialize(GenericReader reader)
{
blablablabala;
blablalbablal;
case 1:
{
m_LongTermElapse = reader.ReadTimeSpan();
m_ShortTermElapse = reader.ReadTimeSpan();
m_GameTime = reader.ReadTimeSpan();
m_exp.pointXP = reader.ReadInt(); //supose to read the IO stream for m_exp.PointXP
goto case 0;
}
}
public override void Serialize(GenericWriter writer)
{
blablabla;
blablabla;
blabla;
writer.Write(m_LongTermElapse);
writer.Write(m_ShortTermElapse);
writer.Write(GameTime);
writer.Write(m_exp.pointXP);
}
So here the problem, there must be something wrong in the way I use the writer and the reader because when i shut down the server i have to erase created PlayerMobile because it Say it can't read the IOstream to the end. Ideas on what I did wrong?
public class Experience
{
public int pointXP { get; set; }
public Experience()
{
pointXP = 0;
}
}
so a get; set; and something to initialize when it's called. after that i placed it in playerMobile like this
public PlayerMobile(){
blablabla;
blablabla;
blabalala;
Experience m_exp=New Experience(); //around line 3950 of playerMobile
after i call the serialize/deserialize
public override void Deserialize(GenericReader reader)
{
blablablabala;
blablalbablal;
case 1:
{
m_LongTermElapse = reader.ReadTimeSpan();
m_ShortTermElapse = reader.ReadTimeSpan();
m_GameTime = reader.ReadTimeSpan();
m_exp.pointXP = reader.ReadInt(); //supose to read the IO stream for m_exp.PointXP
goto case 0;
}
}
public override void Serialize(GenericWriter writer)
{
blablabla;
blablabla;
blabla;
writer.Write(m_LongTermElapse);
writer.Write(m_ShortTermElapse);
writer.Write(GameTime);
writer.Write(m_exp.pointXP);
}
So here the problem, there must be something wrong in the way I use the writer and the reader because when i shut down the server i have to erase created PlayerMobile because it Say it can't read the IOstream to the end. Ideas on what I did wrong?