protected override void WriteAmf3(IExternalWriter writer) { writer.WriteKey("ID"); writer.WriteUTF(m_fb.ID); writer.WriteKey("PlayerID"); writer.WriteUTF(m_fb.PlayerID); writer.WriteKey("CurSkill"); writer.WriteUTF(m_fb.CurSkill); writer.WriteKey("FightType"); writer.WriteInt((int)m_fb.FB); writer.WriteKey("RangePet"); writer.WriteUTF(m_fb.RangePet); writer.WriteKey("MPCost"); writer.WriteInt(m_fb.MPCost); writer.WriteKey("HPcost"); writer.WriteInt(m_fb.HPcost); writer.WriteKey("MoFa"); writer.WriteValue(m_fb.MoFa); writer.WriteKey("ShengMing"); writer.WriteValue(m_fb.ShengMing); //Console.WriteLine("Name:"+m_fb.Name+",FightType:" + (int)m_fb.FB + ",RangePet:" + m_fb.RangePet + ",HPcost:" + m_fb.HPcost + ",MPCost:" + m_fb.MPCost + ",MoFa:" + m_fb.MoFa.GetIntOrDefault("V") +",ShengMing:" + m_fb.ShengMing.GetIntOrDefault("V")); }
protected override void WriteAmf3(IExternalWriter writer) { if (m_pet == null) return; writer.WriteKey("ID"); writer.WriteUTF(m_pet.ID); if (m_style == 2) { WriteLife(writer); } else if (m_style == 3) { writer.WriteKey("Name"); writer.WriteUTF(m_pet.Name); writer.WriteKey("PetsID"); writer.WriteUTF(m_pet.Value.GetStringOrDefault("PetsID")); writer.WriteKey("PetsType"); writer.WriteUTF(m_pet.Value.GetStringOrDefault("PetsType")); writer.WriteKey("PetsRank"); writer.WriteUTF(m_pet.Value.GetStringOrDefault("PetsRank")); writer.WriteKey("PetsLevel"); writer.WriteInt(m_pet.Value.GetIntOrDefault("PetsLevel")); writer.WriteKey("Skin"); writer.WriteUTF(m_pet.Value.GetStringOrDefault("Skin")); writer.WriteKey("Skill"); writer.WriteValue(m_pet.Value.GetVariantOrDefault("Skill")); writer.WriteKey("ZiZhi"); writer.WriteInt(m_pet.Value.GetIntOrDefault("ZiZhi")); WriteLife(writer); } else //0,和1 { writer.WriteKey("Name"); writer.WriteUTF(m_pet.Name); writer.WriteKey("Total"); writer.WriteInt(m_pet.Value.GetVariantOrDefault("ChengChangDu").GetIntOrDefault("V")); writer.WriteKey("Level"); writer.WriteInt(m_pet.Value.GetIntOrDefault("PetsLevel")); writer.WriteKey("PetsType"); writer.WriteUTF(m_pet.Value.GetStringOrDefault("PetsType")); writer.WriteKey("PlayerName"); writer.WriteUTF(m_pet.Value.GetStringOrDefault("PlayerName")); } }
/// <summary> /// 写动态部分.. /// </summary> /// <param name="writer"></param> protected virtual void WriteAmf3(IExternalWriter writer) { if (m_value != null) { foreach (var kv in m_value) { writer.WriteKey(kv.Key); writer.WriteValue(kv.Value); } } }
protected override void WriteAmf3(IExternalWriter writer) { writer.WriteKey("ID"); writer.WriteUTF(m_pb.ID); writer.WriteKey("PartID"); writer.WriteUTF(m_pb.PartID); writer.WriteKey("PlayerID"); writer.WriteUTF(m_pb.PlayerID); writer.WriteKey("SubType"); writer.WriteUTF(m_pb.SubType); writer.WriteKey("Value"); writer.WriteValue(m_pb.Value); }
protected override void WriteAmf3(IExternalWriter writer) { if (m_mounts == null) return; writer.WriteKey("ID"); writer.WriteUTF(m_mounts.ID); writer.WriteKey("Experience"); writer.WriteInt(m_mounts.Experience); writer.WriteKey("Level"); writer.WriteInt(m_mounts.Level); writer.WriteKey("Status"); writer.WriteInt(m_mounts.Status); writer.WriteKey("MountsID"); writer.WriteUTF(m_mounts.MountsID); writer.WriteKey("PlayerID"); writer.WriteUTF(m_mounts.PlayerID); writer.WriteKey("Rank"); writer.WriteInt(m_mounts.Rank); if (m_mounts.Value == null) return; Variant skill = m_mounts.Value.GetVariantOrDefault("Skill"); if (skill == null) return; writer.WriteKey("Skill"); writer.WriteValue(skill); writer.WriteKey("FailCount"); writer.WriteInt(m_mounts.FailCount); writer.WriteKey("FailTime"); writer.WriteDateTime(m_mounts.FailTime); writer.WriteKey("ZhuFu"); writer.WriteInt(m_mounts.ZhuFu); }
protected override void WriteAmf3(IExternalWriter writer) { writer.WriteKey("Values"); writer.WriteValue(Values); }
protected override void WriteAmf3(IExternalWriter writer) { base.WriteAmf3(writer); if (this.ActionType != ActionType.TaoPao) { writer.WriteKey("Target"); writer.WriteUTF(Target); writer.WriteKey("Parameter"); writer.WriteUTF(Parameter); writer.WriteKey("ActionID"); writer.WriteInt(ActionID); if (this.ActionType == 0) { writer.WriteKey("SkillLev"); writer.WriteInt(SkillLev); } if (Result != null) { writer.WriteKey("Result"); writer.WriteValue(Result); } } if (Say > 0) { writer.WriteKey("Say"); writer.WriteInt(Say); } writer.WriteKey("fType"); writer.WriteInt((int)(this.ActionType)); writer.WriteKey("ID"); writer.WriteUTF(Sender); }
protected override void WriteAmf3(IExternalWriter writer) { if (m_activeApcs.Count > 0) { writer.WriteKey("ID"); writer.WriteUTF(ID); writer.WriteKey("Name"); writer.WriteUTF(Name); if (m_apc != null) { writer.WriteKey("Skin"); writer.WriteUTF(m_apc.Skin); } writer.WriteKey("Apcs"); writer.WriteValue(m_activeApcs.Values); } }
protected override void WriteAmf3(IExternalWriter writer) { Variant v = m_pet.Value; writer.WriteKey("ID"); writer.WriteUTF(m_pet.ID); if (m_style != 2) { writer.WriteKey("PlayerID"); writer.WriteUTF(m_pet.PlayerID); } if (m_style == 0) { writer.WriteKey("PlayerName"); writer.WriteUTF(m_name); writer.WriteKey("CurSkill"); writer.WriteUTF(m_pet.CurSkill); writer.WriteKey("Name"); writer.WriteUTF(m_pet.Name); writer.WriteKey("Skin"); writer.WriteUTF(v.GetStringOrDefault("Skin")); writer.WriteKey("PetsID"); writer.WriteUTF(v.GetStringOrDefault("PetsID")); writer.WriteKey("IsWar"); writer.WriteBoolean(m_pet.IsWar); writer.WriteKey("X"); writer.WriteInt(m_pet.CurPoint.X); writer.WriteKey("Y"); writer.WriteInt(m_pet.CurPoint.Y); writer.WriteKey("PetsRank"); writer.WriteInt(v.GetIntOrDefault("PetsRank")); writer.WriteKey("PetsLevel"); writer.WriteInt(m_level); writer.WriteKey("MoFa"); writer.WriteValue(v.GetVariantOrDefault("MoFa")); writer.WriteKey("ShengMing"); writer.WriteValue(v.GetVariantOrDefault("ShengMing")); ; writer.WriteKey("SkillList"); writer.WriteValue(v.GetVariantOrDefault("Skill")); writer.WriteKey("GroupName"); writer.WriteUTF(m_pet.GroupName); writer.WriteKey("Fatigue"); writer.WriteValue(m_fatigue); writer.WriteKey("FightDeath"); writer.WriteInt(m_pet.FightDeath.Count); } if (m_style == 2) { writer.WriteKey("FightDeath"); writer.WriteInt(m_pet.FightDeath.Count); } }
public void WritePlayerEx(IExternalWriter writer) { foreach (object v in Value.Values) { PlayerEx ex = v as PlayerEx; if (ex != null) { writer.WriteKey(ex.Name); writer.WriteValue(v); } } }
/// <summary> /// 战宠/溜宠/坐骑 /// </summary> /// <param name="writer"></param> public void WritePet(IExternalWriter writer) { // 写宠物信息 writer.WriteKey("Pet"); var pet = m_pet; if (pet == null) { writer.WriteNull(); } else { writer.WriteValue(new PetSimple(pet, 3)); } // 溜宠信息 writer.WriteKey("SlipPets"); writer.WriteValue(m_slippets); // 写坐骑信息, writer.WriteKey("Mounts"); var mount = m_mounts; if (mount == null) { writer.WriteNull(); } else { writer.WriteValue(new MountsSimple(mount)); } }