Beispiel #1
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"));
        }
Beispiel #2
0
        protected override void WriteAmf3(IExternalWriter writer)
        {
            writer.WriteKey("M");
            writer.WriteInt(M);

            writer.WriteKey("V");
            writer.WriteInt(V);
        }
Beispiel #3
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"));
            }
        }
Beispiel #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);
        }
Beispiel #5
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);
 }
Beispiel #6
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);
            }
        }
Beispiel #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);
        }
Beispiel #8
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);
        }
Beispiel #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);
        }
Beispiel #10
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
            //    );
        }
Beispiel #11
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);
        }
Beispiel #12
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);
        }
Beispiel #13
0
 public override void WriteProperty(IExternalWriter writer)
 {
     base.WriteProperty(writer);
     writer.WriteKey("LiLiang");
     writer.WriteInt(LiLiang);
     writer.WriteKey("TiZhi");
     writer.WriteInt(TiZhi);
     writer.WriteKey("ZhiLi");
     writer.WriteInt(ZhiLi);
     writer.WriteKey("JingShen");
     writer.WriteInt(JingShen);
 }
Beispiel #14
0
 /// <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);
     }
 }
Beispiel #15
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);
        }
Beispiel #16
0
        protected override void WriteAmf3(IExternalWriter writer)
        {
            writer.WriteKey("ID");
            writer.WriteUTF(m_id);

            var cap = m_members[0];
            writer.WriteKey("Captain");
            writer.WriteUTF(cap.ID);

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

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

            writer.WriteKey("Num");
            writer.WriteInt(Count);

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

            writer.WriteKey("Explain");
            writer.WriteUTF(Explain);
        }
Beispiel #17
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);
        }
Beispiel #18
0
        /// <summary>
        /// 只写用户登录时需要的信息..
        /// </summary>
        /// <param name="writer"></param>
        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);
            writer.WriteKey("IsBind");
            writer.WriteInt(IsBind);
        }
Beispiel #19
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);
            }
        }
Beispiel #20
0
        protected override void WriteAmf3(IExternalWriter writer)
        {
            WriteBase(writer);
            WriteScene(writer);
            WriteShape(writer);
            WriteOther(writer);
            WritePet(writer);

            writer.WriteKey("ActionState");
            writer.WriteInt((int)AState);

            //writer.WriteKey("ShiZhuangSkin");
            //writer.WriteUTF(ShiZhuangSkin);
            //writer.WriteKey("SZSkin");
            //writer.WriteUTF("SZSkin");
            //writer.WriteKey("PID");
            //writer.WriteInt(this.PID);

            if (m_teamJob != TeamJob.NoTeam)
            {
                if (m_team != null)
                {
                    writer.WriteKey("TeamJob");
                    writer.WriteInt((int)m_teamJob);
                    writer.WriteKey("TeamID");
                    writer.WriteUTF(m_team.TeamID);
                }
            }
            if (m_yellowTime > DateTime.UtcNow)
            {
                writer.WriteKey("Yellow");
                writer.WriteDateTime(m_yellowTime);
            }
            if (m_redTime > DateTime.UtcNow)
            {
                writer.WriteKey("Red");
                writer.WriteDateTime(m_redTime);
            }
        }
Beispiel #21
0
        protected override void WriteAmf3(IExternalWriter writer)
        {
            writer.WriteKey("Target");
            writer.WriteUTF(Target);

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

            base.WriteAmf3(writer);
        }
Beispiel #22
0
Datei: Box.cs Projekt: abel/sinan
        protected override void WriteAmf3(IExternalWriter writer)
        {
            writer.WriteKey("ID");
            writer.WriteUTF(this.ID);

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

            writer.WriteKey("GoodsID");
            writer.WriteUTF(this.GoodsID);

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

            writer.WriteKey("Skin");
            writer.WriteUTF(this.Skin);
        }
Beispiel #23
0
        /// <summary>
        /// ������Ϣ
        /// ID/RoleID/Name/Level/Sex
        /// </summary>
        /// <param name="writer"></param>
        public void WriteBase(IExternalWriter writer)
        {
            writer.WriteKey("ID");
            writer.WriteUTF(ID);
            writer.WriteKey("UID");
            writer.WriteUTF(m_userID);

            writer.WriteKey("Name");
            writer.WriteUTF(Name);
            writer.WriteKey("RoleID");
            writer.WriteUTF(RoleID);
            writer.WriteKey("Sex");
            writer.WriteInt(Sex);
            writer.WriteKey("Level");
            writer.WriteInt(Level);
            writer.WriteKey("VIP");
            writer.WriteInt(VIP);
            writer.WriteKey("FightValue");
            writer.WriteInt(FightValue);

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

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

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

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

            writer.WriteKey("CZD");
            writer.WriteInt(CZD);
        }
Beispiel #24
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);
            }
        }
Beispiel #25
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);
        }
Beispiel #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);
 }
Beispiel #27
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);
        }