当前位置: 首页>>代码示例>>C#>>正文


C# PacketWriter.Float方法代码示例

本文整理汇总了C#中CLFramework.PacketWriter.Float方法的典型用法代码示例。如果您正苦于以下问题:C# PacketWriter.Float方法的具体用法?C# PacketWriter.Float怎么用?C# PacketWriter.Float使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CLFramework.PacketWriter的用法示例。


在下文中一共展示了PacketWriter.Float方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: StopMovement

 public static byte[] StopMovement(ObjData.vektor p)
 {
     PacketWriter Writer = new PacketWriter();
     Writer.Create(OperationCode.SERVER_PICKUPITEM_MOVE);
     Writer.DWord(p.ID);
     Writer.Byte(p.xSec);
     Writer.Byte(p.ySec);
     Writer.Float(p.x);
     Writer.Float(p.z);
     Writer.Float(p.y);
     Writer.Word(0/*p.Angle*/); // Angle
     return Writer.GetBytes();
 }
开发者ID:ManhHaHY,项目名称:ClowenEmulationOpenSourceProject,代码行数:13,代码来源:MovementPackets.cs

示例2: SetSpeed

 public static byte[] SetSpeed(int id, float speed1, float speed2)
 {
     PacketWriter Writer = new PacketWriter();
     Writer.Create(OperationCode.SERVER_SETSPEED);
     Writer.DWord(id);
     Writer.Float(speed1);
     Writer.Float(speed2);
     return Writer.GetBytes();
 }
开发者ID:ManhHaHY,项目名称:ClowenEmulationOpenSourceProject,代码行数:9,代码来源:PlayerActionPackets.cs

示例3: CharacterDataLoad


//.........这里部分代码省略.........
            /////////////////////////////////////////////////////// Skills
            #region Skill
            Writer.Byte(2);
            Writer.Byte(0);
                for (int i = 1; i <= c.Stat.Skill.AmountSkill; i++)
                {
                    Writer.Byte(1);
                    Writer.DWord(c.Stat.Skill.Skill[i]);
                    Writer.Byte(1);
                }
            Writer.Byte(2);
            #endregion
            /////////////////////////////////////////////////////// Quests
            #region Quest
            Writer.Word(1); // how many Quest ids completed/aborted
            Writer.DWord(1);// Quest id
            Writer.Byte(0);//number of Quests that are live
            #endregion
            Writer.Byte(0);//? for now
            /////////////////////////////////////////////////////// Talisman
            #region Talisman
            Writer.DWord(1);//new
            Writer.DWord(1);//new
            Writer.DWord(0);//? for now
            Writer.DWord(0x0C);//new
            #endregion
            /////////////////////////////////////////////////////// Position + id + speed
            #region Character id / Position / Speed
            Writer.DWord(c.Information.UniqueID);
            Writer.Byte(c.Position.xSec);
            Writer.Byte(c.Position.ySec);
            if (!FileDB.CheckCave(c.Position.xSec, c.Position.ySec))
            {
                Writer.Float(Formule.packetx(c.Position.x, c.Position.xSec));
                Writer.Float(c.Position.z);
                Writer.Float(Formule.packety(c.Position.y, c.Position.ySec));
            }
            else
            {
                Writer.Float(Formule.cavepacketx(c.Position.x));// Added for cave Coords
                Writer.Float(c.Position.z);
                Writer.Float(Formule.cavepackety(c.Position.y));// Added for cave Coords

            }
            Writer.Word(0);							// Angle
            Writer.Byte(0);
            Writer.Byte(1);
            Writer.Byte(0);
            Writer.Word(0);							// Angle
            Writer.Word(0);
            Writer.Byte(0);
            Writer.Bool(false); //berserk

            Writer.Byte(0);//new ?

            Writer.Float(c.Speed.WalkSpeed);
            Writer.Float(c.Speed.RunSpeed);
            Writer.Float(c.Speed.BerserkSpeed);
            #endregion
            /////////////////////////////////////////////////////// Premium Tickets
            #region Premium ticket
            Writer.Byte(0); //ITEM_MALL_GOLD_TIME_SERVICE_TICKET_4W
            #endregion
            /////////////////////////////////////////////////////// GM Check + Name
            #region GM Check + Name
            Writer.Text(c.Information.Name);
开发者ID:ManhHaHY,项目名称:ClowenEmulationOpenSourceProject,代码行数:67,代码来源:CharacterPackets.cs

示例4: ObjectSpawnJob

        public static byte[] ObjectSpawnJob(WorldMgr.character c)
        {
            PacketWriter Writer = new PacketWriter();
            Writer.Create(OperationCode.SERVER_SOLO_SPAWN);

            /////////////////////////////////////////////////////// Character basic info
            #region Basic info
            Writer.DWord(c.Information.Model);
            Writer.Byte(c.Information.Volume);                      //Char Volume
            Writer.Byte(c.Information.Title);                       //Char Title
            Writer.Byte(c.Information.Pvpstate);                    //Pvp state
            if (c.Information.Pvpstate != 0) c.Information.PvP = true;
            Writer.Bool((c.Information.Level < 20 ? true : false)); //Beginners Icon

            Writer.Byte(c.Information.Slots);                       // Amount of items
            #endregion
            /////////////////////////////////////////////////////// Item info
            #region Item info
            Function.Items.PrivateItemPacket(Writer, c.Information.CharacterID, 8, 0, true);
            Writer.Byte(5);
            Function.Items.PrivateItemPacket(Writer, c.Information.CharacterID, 5, 1, true);
            Writer.Byte(0);
            #endregion
            /////////////////////////////////////////////////////// Character Location / id
            #region Location info / state
            Writer.DWord(c.Information.UniqueID);
            Writer.Byte(c.Position.xSec);
            Writer.Byte(c.Position.ySec);
            Writer.Float(Formule.packetx(c.Position.x, c.Position.xSec));
            Writer.Float(c.Position.z);
            Writer.Float(Formule.packety(c.Position.y, c.Position.ySec));
            Writer.Word(0);//angle
            Writer.Bool(c.Position.Walking);
            Writer.Byte(1); // walk:0 run:1 ;)

            if (c.Position.Walking)
            {
                Writer.Byte(c.Position.packetxSec);
                Writer.Byte(c.Position.packetySec);

                if (!FileDB.CheckCave(c.Position.packetxSec, c.Position.packetySec))
                {
                    Writer.Word(c.Position.packetX);
                    Writer.Word(c.Position.packetZ);
                    Writer.Word(c.Position.packetY);
                }
                else
                {
                    if (c.Position.packetX < 0)
                    {
                        Writer.Word(c.Position.packetX);
                        Writer.Word(0xFFFF);
                    }
                    else
                    {
                        Writer.DWord(c.Position.packetX);
                    }

                    Writer.DWord(c.Position.packetZ);

                    if (c.Position.packetY < 0)
                    {
                        Writer.Word(c.Position.packetY);
                        Writer.Word(0xFFFF);
                    }
                    else
                    {
                        Writer.DWord(c.Position.packetY);
                    }
                }
            }
            else
            {
                Writer.Byte(1);
                Writer.Word(0);//angle
            }

            Writer.Byte((byte)(c.State.LastState == 128 ? 2 : 1));
            Writer.Byte(0);
            Writer.Byte(3);
            Writer.Byte((byte)(c.Information.Berserking ? 1 : 0));

            Writer.Float(c.Speed.WalkSpeed);
            Writer.Float(c.Speed.RunSpeed);
            Writer.Float(c.Speed.BerserkSpeed);

            Writer.Byte(c.Action.Buff.count);
            for (byte b = 0; b < c.Action.Buff.SkillID.Length; b++)
            {
                if (c.Action.Buff.SkillID[b] != 0)
                {
                    Writer.DWord(c.Action.Buff.SkillID[b]);
                    Writer.DWord(c.Action.Buff.OverID[b]);
                }
            }
            #endregion
            /////////////////////////////////////////////////////// Character Job information / name
            #region Job information & name
            Writer.Text(c.Job.Jobname);
            Writer.Byte(1);
//.........这里部分代码省略.........
开发者ID:ManhHaHY,项目名称:ClowenEmulationOpenSourceProject,代码行数:101,代码来源:SpawnPackets.cs

示例5: SpawnPortal

 public static byte[] SpawnPortal(WorldMgr.Monsters o, WorldMgr.character c, int itemid)
 {
     PacketWriter Writer = new PacketWriter();
     Writer.Create(OperationCode.SERVER_SOLO_SPAWN);
     Writer.DWord(o.ID);
     Writer.DWord(o.UniqueID);
     Writer.Byte(o.xSec);
     Writer.Byte(o.ySec);
     Writer.Float(Formule.packetx((float)o.x, o.xSec));
     Writer.Float(o.z);
     Writer.Float(Formule.packety((float)o.y, o.ySec));
     Writer.Word(0);
     Writer.Byte(1);
     Writer.Byte(0);
     Writer.Byte(1);
     Writer.Byte(6);
     Writer.Text(c.Information.Name);
     Writer.DWord(itemid);
     Writer.Byte(1);
     return Writer.GetBytes();
 }
开发者ID:ManhHaHY,项目名称:ClowenEmulationOpenSourceProject,代码行数:21,代码来源:SpawnPackets.cs

示例6: ObjectSpawn

        public static byte[] ObjectSpawn(WorldMgr.character c)
        {
            PacketWriter Writer = new PacketWriter();
            Writer.Create(OperationCode.SERVER_SOLO_SPAWN);
            /////////////////////////////////////////////////////// Character basic info
            #region Basic info
            Writer.DWord(c.Information.Model);
            Writer.Byte(c.Information.Volume);                      //Char Volume
            Writer.Byte(c.Information.Title);                       //Char Title
            Writer.Byte(c.Information.Pvpstate);                    //Pvp state
            if (c.Information.Pvpstate != 0) c.Information.PvP = true;
            Writer.Bool((c.Information.Level < 20 ? true : false)); //Beginners Icon

            Writer.Byte(c.Information.Slots);                       // Amount of items
            #endregion
            /////////////////////////////////////////////////////// Item info
            #region Item info
            Function.Items.PrivateItemPacket(Writer, c.Information.CharacterID, 8, 0, true);
            Writer.Byte(5);
            Function.Items.PrivateItemPacket(Writer, c.Information.CharacterID, 5, 1, true);
            Writer.Byte(0);
            #endregion
            /////////////////////////////////////////////////////// Character Location / id
            #region Location info / state
            Writer.DWord(c.Information.UniqueID);
            Writer.Byte(c.Position.xSec);
            Writer.Byte(c.Position.ySec);
            Writer.Float(Formule.packetx(c.Position.x, c.Position.xSec));
            Writer.Float(c.Position.z);
            Writer.Float(Formule.packety(c.Position.y, c.Position.ySec));
            Writer.Word(0);//angle
            Writer.Bool(c.Position.Walking);
            Writer.Byte(1); // walk:0 run:1 ;)
            //This should send the location information while moving. and where we moving
            if (c.Position.Walking)
            {
                Writer.Byte(c.Position.packetxSec);
                Writer.Byte(c.Position.packetySec);
                if (!FileDB.CheckCave(c.Position.packetxSec, c.Position.packetySec))
                {
                    Writer.Word(c.Position.packetX);
                    Writer.Word(c.Position.packetZ);
                    Writer.Word(c.Position.packetY);
                }
                else
                {
                    if (c.Position.packetX < 0)
                    {
                        Writer.Word(c.Position.packetX);
                        Writer.Word(0xFFFF);
                    }
                    else
                    {
                        Writer.DWord(c.Position.packetX);
                    }

                    Writer.DWord(c.Position.packetZ);

                    if (c.Position.packetY < 0)
                    {
                        Writer.Word(c.Position.packetY);
                        Writer.Word(0xFFFF);
                    }
                    else
                    {
                        Writer.DWord(c.Position.packetY);
                    }
                }
                /*byte[] x = BitConverter.GetBytes(c.Position.packetX);
                Array.Reverse(x);
                Writer.Buffer(x);

                Writer.Word(c.Position.packetZ);

                byte[] y = BitConverter.GetBytes(c.Position.packetY);
                Array.Reverse(y);
                Writer.Buffer(y);*/

            }
            else
            {
                Writer.Byte(1);
                Writer.Word(0);//angle
            }

            Writer.Byte((byte)(c.State.LastState == 128 ? 2 : 1));

            Writer.Byte(0);
            //Info : If a player spawns at your location and is walking it send byte 3, else 0 byte.
            if (c.Transport.Right)
                Writer.Byte(c.Transport.Horse.Walking == true ? 3 : 0);
            else
                Writer.Byte(c.Position.Walking == true ? 3 : 0);

            Writer.Byte((byte)(c.Information.Berserking ? 1 : 0));
            Writer.Byte(0);
            Writer.Float(c.Speed.WalkSpeed);
            Writer.Float(c.Speed.RunSpeed);
            Writer.Float(c.Speed.BerserkSpeed);

//.........这里部分代码省略.........
开发者ID:ManhHaHY,项目名称:ClowenEmulationOpenSourceProject,代码行数:101,代码来源:SpawnPackets.cs


注:本文中的CLFramework.PacketWriter.Float方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。