protected override void WriteAmf3(IExternalWriter writer) { writer.WriteKey(m_playerEx.Name); writer.WriteIDictionary(m_playerEx.Value); writer.WriteKey("ID"); writer.WriteUTF(m_playerEx.PlayerID); }
protected override void WriteAmf3(IExternalWriter writer) { if (m_style == 3 && m_keys != null) { foreach (string key in m_keys) { PlayerEx v = m_player.Value.GetValue<PlayerEx>(key); writer.WriteKey(key); writer.WriteIDictionary(v.Value); } writer.WriteKey("ID"); writer.WriteUTF(m_player.ID); return; } m_player.WriteBase(writer); m_player.WriteShape(writer); m_player.WritePet(writer); //组队时用 if (m_style == 0) { writer.WriteKey("TeamJob"); writer.WriteInt((int)(m_player.TeamJob)); writer.WriteKey("JingYan"); MVPair.WritePair(writer, m_player.MaxExp, m_player.Experience); writer.WriteKey("ShengMing"); MVPair.WritePair(writer, m_player.Life.ShengMing, m_player.HP); writer.WriteKey("MoFa"); MVPair.WritePair(writer, m_player.Life.MoFa, m_player.MP); } //取玩家详细信息 else if (m_style == 1) { if (m_player.Pet != null) { writer.WriteKey("PetID"); writer.WriteUTF(m_player.Pet.ID); } m_player.WriteFightProperty(writer); m_player.WriteOther(writer); writer.WriteKey("Equips"); writer.WriteIDictionary(m_player.Equips.Value); } //玩家登录成功时取自己的信息 else if (m_style == 2) { m_player.WriteScene(writer); m_player.WriteFinance(writer); m_player.WritePlayerEx(writer); m_player.WriteFightProperty(writer); m_player.WriteOther(writer); writer.WriteKey("PID"); writer.WriteInt(m_player.PID); } }
private void WriteLife(IExternalWriter writer) { //writer.WriteKey("MoFa"); //Variant mofa = m_pet.Value.GetVariantOrDefault("MoFa"); //MVPair.WritePair(writer, mofa.GetIntOrDefault("M"), mofa.GetIntOrDefault("V")); //writer.WriteKey("ShengMing"); //Variant shengming = m_pet.Value.GetVariantOrDefault("ShengMing"); //MVPair.WritePair(writer, shengming.GetIntOrDefault("M"), shengming.GetIntOrDefault("V")); writer.WriteKey("MoFa"); writer.WriteIDictionary(m_pet.Value.GetVariantOrDefault("MoFa")); writer.WriteKey("ShengMing"); writer.WriteIDictionary(m_pet.Value.GetVariantOrDefault("ShengMing")); }
/// <summary> /// 写战斗奖励 /// </summary> /// <param name="writer"></param> protected override void WriteAmf3(IExternalWriter writer) { if (RoleExp > 0) { writer.WriteKey("PExp"); writer.WriteInt(RoleExp); } if (PetExp > 0) { writer.WriteKey("RExp"); writer.WriteInt(PetExp); } if (Bond > 0) { writer.WriteKey("Bond"); writer.WriteInt(Bond); } if (Score > 0) { writer.WriteKey("Score"); writer.WriteInt(Score); } if (m_goods != null && m_goods.Count > 0) { writer.WriteKey("Goods"); writer.WriteIDictionary(m_goods); } }