Пример #1
0
        protected override void WriteAmf3(IExternalWriter writer)
        {
            writer.WriteKey(m_playerEx.Name);
            writer.WriteIDictionary(m_playerEx.Value);

            writer.WriteKey("ID");
            writer.WriteUTF(m_playerEx.PlayerID);
        }
Пример #2
0
        protected override void WriteAmf3(IExternalWriter writer)
        {
            writer.WriteKey("M");
            writer.WriteInt(M);

            writer.WriteKey("V");
            writer.WriteInt(V);
        }
Пример #3
0
        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);
            }
        }
Пример #4
0
        protected override void WriteAmf3(IExternalWriter writer)
        {
            writer.WriteKey("X");
            writer.WriteInt(X);
            writer.WriteKey("Y");
            writer.WriteInt(Y);

            writer.WriteKey("ID");
            writer.WriteInt(ID);
        }
Пример #5
0
        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"));
        }
Пример #6
0
 /// <summary>
 /// 以最大值/当前值的方式写入数据
 /// </summary>
 /// <param name="writer"></param>
 /// <param name="m"></param>
 /// <param name="v"></param>
 public static void WritePair(IExternalWriter writer, int m, int v)
 {
     writer.WriteByte(Amf3Type.Object);
     writer.WriteByte(0x0b); //动态对象方式.
     writer.WriteByte(0x01);
     writer.WriteKey("M");
     writer.WriteInt(m);
     writer.WriteKey("V");
     writer.WriteInt(v);
     writer.WriteByte(0x01);
 }
Пример #7
0
        protected override void WriteAmf3(IExternalWriter writer)
        {
            m_player.WriteBase(writer);

            writer.WriteKey("WinCount");
            writer.WriteInt(m_winCount);

            writer.WriteKey("FamilyName");
            writer.WriteUTF(m_player.FamilyName);
            writer.WriteKey("FamilyJob");
            writer.WriteUTF(m_player.FamilyJob);
        }
Пример #8
0
        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"));
            }
        }
Пример #9
0
        protected override void WriteAmf3(IExternalWriter writer)
        {
            foreach (var v in m_buffer)
            {
                writer.WriteKey(v.Key);
                writer.WriteInt(v.Value);
            }
            writer.WriteKey("HP");
            writer.WriteInt(HP);

            writer.WriteKey("MP");
            writer.WriteInt(MP);

            writer.WriteKey("ID");
            writer.WriteUTF(m_fighter.ID);
        }
Пример #10
0
        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);
        }
Пример #11
0
        protected override void WriteAmf3(IExternalWriter writer)
        {
            writer.WriteKey("ID");
            writer.WriteUTF(m_box.ID);
            writer.WriteKey("Name");
            writer.WriteUTF(m_box.Name);

            writer.WriteKey("GoodsID");
            writer.WriteUTF(m_box.GoodsID);
            writer.WriteKey("OpenMS");
            writer.WriteInt(m_box.OpenMS);
            writer.WriteKey("Skin");
            writer.WriteUTF(m_box.Skin);

            writer.WriteKey("X");
            writer.WriteInt(m_point.X);
            writer.WriteKey("Y");
            writer.WriteInt(m_point.Y);
        }
Пример #12
0
        protected override void WriteAmf3(IExternalWriter writer)
        {
            writer.WriteKey("Ranking");
            writer.WriteInt(m_model.Ranking);

            writer.WriteKey("GroupName");
            writer.WriteUTF(m_model.GroupName);

            writer.WriteKey("PlayerName");
            writer.WriteUTF(m_model.PlayerName);

            writer.WriteKey("WinFight");//击杀获得战绩
            writer.WriteInt(m_model.WinFight);
            writer.WriteKey("TotalWin");//击杀数
            writer.WriteInt(m_model.TotalWin);

            writer.WriteKey("LossFight");//损失战绩
            writer.WriteInt(m_model.LossFight);
            writer.WriteKey("TotalLoss");//被杀数
            writer.WriteInt(m_model.TotalLoss);

            writer.WriteKey("OtherFight");//附加战绩
            writer.WriteInt(m_model.OtherFight);

            writer.WriteKey("TotalFight");//总战绩值
            writer.WriteInt(m_model.TotalFight);

            writer.WriteKey("ResultType");//输赢0输,1赢,2平
            writer.WriteInt(m_model.ResultType);

            //Console.WriteLine(
            //    "Ranking:" + m_model.Ranking +
            //    ",GroupName:" + m_model.GroupName +
            //    ",PlayerName:" + m_model.PlayerName +
            //    ",WinFight:" + m_model.WinFight +
            //    ",TotalWin:" + m_model.TotalWin +
            //    ",TotalLoss:" + m_model.TotalLoss +
            //    ",LossFight:" + m_model.LossFight +
            //    ",OtherFight:" + m_model.OtherFight +
            //    ",TotalFight:" + m_model.TotalFight +
            //    ",ResultType:" + m_model.ResultType
            //    );
        }
Пример #13
0
 /// <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);
         }
     }
 }
Пример #14
0
        protected override void WriteAmf3(IExternalWriter writer)
        {
            writer.WriteKey("ID");
            writer.WriteUTF(ID);

            writer.WriteKey("Name");
            writer.WriteUTF(Name);

            writer.WriteKey("Total");
            writer.WriteInt(Total);

            writer.WriteKey("Level");
            writer.WriteInt(Level);

            writer.WriteKey("PetsType");
            writer.WriteUTF(PetsType);

            writer.WriteKey("PlayerName");
            writer.WriteUTF(PlayerName);
        }
Пример #15
0
        protected override void WriteAmf3(IExternalWriter writer)
        {
            m_player.WriteBase(writer);
            if (m_style == 0)
            {
                writer.WriteKey("Coat");
                writer.WriteUTF(m_player.Coat);
                writer.WriteKey("Weapon");
                writer.WriteUTF(m_player.Weapon);
                writer.WriteKey("Body");
                writer.WriteUTF(m_player.Body);
                writer.WriteKey("Mount");
                writer.WriteUTF(m_player.Mount);

                writer.WriteKey("SceneID");
                writer.WriteUTF(m_player.SceneID);

                writer.WriteKey("State");
                writer.WriteInt(m_player.State);
                if (m_player.State == 2)
                {
                    writer.WriteKey("DelTime");
                    writer.WriteDateTime(m_player.Modified.AddSeconds(GetRetainSecond(m_player.Level)));
                }
                return;
            }

            if (m_style == 2)
            {
                writer.WriteKey("Dian");
                writer.WriteInt(m_player.Dian);
            }

            writer.WriteKey("FamilyName");
            writer.WriteUTF(m_player.FamilyName);
            writer.WriteKey("FamilyJob");
            writer.WriteUTF(m_player.FamilyJob);

            writer.WriteKey("Online");
            writer.WriteBoolean(m_player.Online);
        }
Пример #16
0
        protected override void WriteAmf3(IExternalWriter writer)
        {
            writer.WriteKey("X");
            writer.WriteInt(X);
            writer.WriteKey("Y");
            writer.WriteInt(Y);

            writer.WriteKey("Say");
            writer.WriteInt(Say);

            writer.WriteKey("Batch");
            writer.WriteInt(Batch);

            writer.WriteKey("Name");
            writer.WriteUTF(m_apc.Name);

            writer.WriteKey("Skin");
            writer.WriteUTF(m_apc.Skin);

            writer.WriteKey("ID");
            writer.WriteInt(ID);
        }
Пример #17
0
 protected override void WriteAmf3(IExternalWriter writer)
 {
     writer.WriteKey("Values");
     writer.WriteValue(Values);
 }
Пример #18
0
        protected override void WriteAmf3(IExternalWriter writer)
        {
            writer.WriteKey("FType");
            writer.WriteInt((int)FType);

            writer.WriteKey("P");
            writer.WriteInt(P);

            writer.WriteKey("ID");
            writer.WriteUTF(ID);

            writer.WriteKey("Name");
            writer.WriteUTF(Name);

            writer.WriteKey("ShengMing");
            MVPair.WritePair(writer, Life.ShengMing, m_hp);
            writer.WriteKey("MoFa");
            MVPair.WritePair(writer, Life.MoFa, m_mp);

            writer.WriteKey("Skin");
            writer.WriteUTF(Skin);

            writer.WriteKey("Level");
            writer.WriteInt(this.Level);

            if (Talk > 0)
            {
                writer.WriteKey("Say");
                writer.WriteInt(Talk);
            }
        }
Пример #19
0
        protected override void WriteAmf3(IExternalWriter writer)
        {
            writer.WriteKey("ID");
            writer.WriteUTF(m_part.ID);

            writer.WriteKey("Start");
            writer.WriteDateTime(m_start);

            writer.WriteKey("End");
            writer.WriteDateTime(m_end);
        }
Пример #20
0
 /// <summary>
 /// 外形信息:
 /// Mount/Body/Weapon/Coat/IsCoat
 /// </summary>
 /// <param name="writer"></param>
 public void WriteShape(IExternalWriter writer)
 {
     writer.WriteKey("Nicename");
     writer.WriteUTF(Nicename);
     writer.WriteKey("Mount");
     writer.WriteUTF(Mount);
     writer.WriteKey("Body");
     writer.WriteUTF(Body);
     writer.WriteKey("Weapon");
     writer.WriteUTF(Weapon);
     writer.WriteKey("Coat");
     writer.WriteUTF(Coat);
     writer.WriteKey("IsCoat");
     writer.WriteBoolean(IsCoat);
 }
Пример #21
0
 /// <summary>
 /// FamilyName/FamilyJob/Marriage
 /// </summary>
 /// <param name="writer"></param>
 public void WriteOther(IExternalWriter writer)
 {
     writer.WriteKey("FamilyName");
     writer.WriteUTF(FamilyName);
     writer.WriteKey("FamilyJob");
     writer.WriteUTF(FamilyJob);
     writer.WriteKey("Marriage");
     writer.WriteUTF(Marriage);
 }
Пример #22
0
Файл: Pet.cs Проект: abel/sinan
 protected override void WriteAmf3(IExternalWriter writer)
 {
     base.WriteAmf3(writer);
     writer.WriteKey("ID");
     writer.WriteUTF(ID);
     writer.WriteKey("Name");
     writer.WriteUTF(Name);
     writer.WriteKey("PlayerID");
     writer.WriteUTF(PlayerID);
 }
Пример #23
0
        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);
            }
        }
Пример #24
0
        protected override void WriteAmf3(IExternalWriter writer)
        {
            writer.WriteKey("Target");
            writer.WriteUTF(Target);

            writer.WriteKey("ActionFlag");
            writer.WriteInt((int)(this.ActionFlag));

            base.WriteAmf3(writer);
        }
Пример #25
0
        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);
        }
Пример #26
0
 /// <summary>
 /// �ڳ����е���Ϣ:
 /// SceneID/Walk/X/Y/ActionState
 /// </summary>
 /// <param name="writer"></param>
 public void WriteScene(IExternalWriter writer)
 {
     writer.WriteKey("SceneID");
     writer.WriteUTF(SceneID);
     writer.WriteKey("Walk");
     writer.WriteDouble(Point);
     writer.WriteKey("X");
     writer.WriteInt(X);
     writer.WriteKey("Y");
     writer.WriteInt(Y);
     writer.WriteKey("ActionState");
     writer.WriteInt((int)AState);
 }
Пример #27
0
        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);
        }
Пример #28
0
        public virtual void WriteProperty(IExternalWriter writer)
        {
            writer.WriteKey("SuDu");
            writer.WriteInt(SuDu);
            writer.WriteKey("BaoJi");
            writer.WriteInt(BaoJi);
            writer.WriteKey("MingZhong");
            writer.WriteInt(MingZhong);
            writer.WriteKey("ShanBi");
            writer.WriteInt(ShanBi);

            writer.WriteKey("GongJi");
            writer.WriteInt(GongJi);
            writer.WriteKey("MoFaGongJi");
            writer.WriteInt(MoFaGongJi);
            writer.WriteKey("FangYu");
            writer.WriteInt(FangYu);
            writer.WriteKey("MoFaFangYu");
            writer.WriteInt(MoFaFangYu);

            writer.WriteKey("WuLiXiShou");
            writer.WriteDouble(WuLiXiShou);
            writer.WriteKey("MoFaXiShou");
            writer.WriteDouble(MoFaXiShou);

            //writer.WriteKey("ShengMing");
            //MVPair.WritePair(writer, ShengMing, HP);
            //writer.WriteKey("MoFa");
            //MVPair.WritePair(writer, MoFa, MP);
        }
Пример #29
0
 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);
     }
 }
Пример #30
0
        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"));
        }