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


C# PacketOut.WriteUInt16方法代码示例

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


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

示例1: SendAbilities

        public void SendAbilities()
        {
            if (!HasPlayer())
                return;

            Log.Info("AbilityInterface", "Sending " + Abilities.Count + " Abilities");

            PacketOut Out = new PacketOut((byte)Opcodes.F_CHARACTER_INFO);
            Out.WriteByte(1); // Action
            Out.WriteByte((byte)Abilities.Count);
            Out.WriteUInt16(0x300);

            foreach (Ability_Info Info in Abilities)
            {
                Out.WriteUInt16(Info.Entry);
                Out.WriteByte(Info.Level);
            }

            GetPlayer().SendPacket(Out);

            PacketOut AutoAttack = new PacketOut((byte)Opcodes.F_CHARACTER_INFO);
            AutoAttack.WriteByte(1); // Action
            AutoAttack.WriteByte(1); // Count
            AutoAttack.WriteUInt16(0x300);
            AutoAttack.WriteUInt16(245);
            AutoAttack.WriteByte(1);
            GetPlayer().SendPacket(AutoAttack);
        }
开发者ID:Necrosummon,项目名称:WarEmu,代码行数:28,代码来源:AbilityInterface.cs

示例2: SendAbilityDone

        public void SendAbilityDone(ushort TargetOID)
        {
            Log.Success("Ability", "Send Done :" + Info.Entry);

            Player player = this.Caster.GetPlayer();
            PacketOut Out1 = new PacketOut((byte)Opcodes.F_USE_ABILITY);
            Out1.WriteUInt16(0);
            Out1.WriteUInt16(Info.Entry);
            Out1.WriteUInt16(Caster.Oid);
            Out1.WriteHexStringBytes("061022730601000001E601000000");
            player.DispatchPacket(Out1, true);

            PacketOut Out2 = new PacketOut((byte)Opcodes.F_USE_ABILITY);
            Out2.WriteUInt16(0);
            Out2.WriteUInt16(Info.Entry);
            Out2.WriteUInt16(Caster.Oid);
            Out2.WriteHexStringBytes("0610227302010000000001000000");
            player.DispatchPacket(Out2, true);

            PacketOut Out3 = new PacketOut((byte)Opcodes.F_SWITCH_ATTACK_MODE);
            Out3.WriteByte(1);
            Out3.Fill(0, 3);
            player.SendPacket(Out3);

            PacketOut Out4 = new PacketOut((byte)Opcodes.F_SET_ABILITY_TIMER);
            Out4.WriteUInt16(Info.Entry);
            Out4.Fill(0, 10);
            player.SendPacket(Out4);
        }
开发者ID:Necrosummon,项目名称:WarEmu,代码行数:29,代码来源:Ability.cs

示例3: SendMeTo

        public override void SendMeTo(Player Plr)
        {
            PacketOut Out = new PacketOut((byte)Opcodes.F_CREATE_STATIC);
            Out.WriteUInt16(Oid);
            Out.WriteUInt16(0);

            Out.WriteUInt16((UInt16)Spawn.WorldO);
            Out.WriteUInt16((UInt16)Spawn.WorldZ);
            Out.WriteUInt32((UInt32)Spawn.WorldX);
            Out.WriteUInt32((UInt32)Spawn.WorldY);
            Out.WriteUInt16((ushort)Spawn.DisplayID);

            Out.WriteUInt16(Spawn.Proto.GetUnk(0));
            Out.WriteUInt16(Spawn.Proto.GetUnk(1));
            Out.WriteUInt16(Spawn.Proto.GetUnk(2));
            Out.WriteByte(0);
            Out.WriteUInt16(Spawn.Proto.GetUnk(3));
            Out.Fill(0, 5);
            Out.WriteUInt16(Spawn.Proto.GetUnk(4));
            Out.WriteUInt16(Spawn.Proto.GetUnk(5));

            Out.WriteUInt32(0);

            Out.WritePascalString(Name);
            Out.WriteByte(0);

            Plr.SendPacket(Out);

            base.SendMeTo(Plr);
        }
开发者ID:Necrosummon,项目名称:WarEmu,代码行数:30,代码来源:GameObject.cs

示例4: BuildQuestComplete

 public static void BuildQuestComplete(PacketOut Out, Quest Q, bool Particular)
 {
     Out.WritePascalString(Q.Name);
     Out.WriteUInt16((UInt16)Q.OnCompletionQuest.Length);
     Out.WriteStringBytes(Q.OnCompletionQuest);
     if (Particular)
     {
         Out.WriteUInt16((UInt16)Q.Particular.Length);
         Out.WriteStringBytes(Q.Particular);
     }
     Out.WriteByte(1);
     Out.WriteUInt32(Q.Gold);
     Out.WriteUInt32(Q.Xp);
 }
开发者ID:Necrosummon,项目名称:WarEmu,代码行数:14,代码来源:QuestsInterface.cs

示例5: SendReinitTime

 public void SendReinitTime(Player Plr, ushort Time)
 {
     PacketOut Out = new PacketOut((byte)Opcodes.F_OBJECTIVE_INFO);
     Out.WriteUInt32(Info.Entry);
     Out.WriteByte(1);
     Out.WriteByte(2);
     Out.WriteByte(1);
     Out.WriteUInt16(0);
     Out.WritePascalString(Info.Name);
     Out.WriteUInt16(0);
     Out.WriteUInt16(Time); // Time in seconds
     Out.WriteUInt16(0);
     Out.WriteUInt16(0);
     Plr.SendPacket(Out);
 }
开发者ID:dzikun,项目名称:WarEmu,代码行数:15,代码来源:PQuestObject.cs

示例6: F_EMOTE

        public static void F_EMOTE(BaseClient client, PacketIn packet)
        {
            GameClient cclient = client as GameClient;

            if (cclient.Plr == null)
                return;

            UInt32 emote = packet.GetUint32();

            PacketOut Out = new PacketOut((byte)Opcodes.F_EMOTE);
            Out.WriteUInt16(cclient.Plr.Oid);
            Out.WriteUInt16((UInt16)emote);
            if (cclient.Plr.CbtInterface.HasTarget())
                Out.WriteUInt16(cclient.Plr.CbtInterface.CurrentTarget.Target.Oid);
            cclient.Plr.DispatchPacket(Out, false);
            cclient.Plr.SendPacket(Out);
        }
开发者ID:Necrosummon,项目名称:WarEmu,代码行数:17,代码来源:TchatHandlers.cs

示例7: F_EMOTE

        static public void F_EMOTE(BaseClient client, PacketIn packet)
        {
            GameClient cclient = client as GameClient;

            if (cclient.Plr == null)
                return;

            UInt32 emote = packet.GetUint32();

            PacketOut Out = new PacketOut((byte)Opcodes.F_EMOTE);
            Out.WriteUInt16(cclient.Plr.Oid);
            Out.WriteUInt16((UInt16)emote);
            if (cclient.Plr.CbtInterface.HasTarget(GameData.TargetTypes.TARGETTYPES_TARGET_ALLY))
                Out.WriteUInt16(cclient.Plr.CbtInterface.Targets[(int)GameData.TargetTypes.TARGETTYPES_TARGET_ALLY]);
            cclient.Plr.DispatchPacket(Out, false);
            cclient.Plr.SendPacket(Out);
        }
开发者ID:dzikun,项目名称:WarEmu,代码行数:17,代码来源:TchatHandlers.cs

示例8: BuildStats

 public void BuildStats(ref PacketOut Out)
 {
     Out.WriteByte(0);
     for (byte i = 0; i < _BaseStats.Length; ++i)
     {
         Out.WriteByte(i);
         Out.WriteUInt16(_BaseStats[i]);
     }
 }
开发者ID:Necrosummon,项目名称:WarEmu,代码行数:9,代码来源:StatsInterface.cs

示例9: SendTok

 public void SendTok(ushort Entry, bool Print)
 {
     PacketOut Out = new PacketOut((byte)Opcodes.F_TOK_ENTRY_UPDATE);
     Out.WriteUInt32(1);
     Out.WriteUInt16((UInt16)Entry);
     Out.WriteByte(1);
     Out.WriteByte((byte)(Print ? 1 : 0));
     Out.WriteByte(1);
     GetPlayer().SendPacket(Out);
 }
开发者ID:nalgol,项目名称:WarEmu,代码行数:10,代码来源:TokInterface.cs

示例10: BuildPlayerInfo

        public static void BuildPlayerInfo(ref PacketOut Out,uint CharId, string Name, bool Online, byte Level, UInt16 Career, UInt16 Zone)
        {
            Out.WriteUInt32(CharId);
            Out.WriteByte(0);
            Out.WritePascalString(Name);
            Out.WriteByte(0);

            Out.WriteByte((byte)(Online ? 1 : 0));
            Out.WriteByte((byte)(Online ? 1 : 0));

            if (!Online)
                return;

            Out.WriteByte(Level);
            Out.WriteUInt16(0);
            Out.WriteUInt16(Career);
            Out.WriteUInt16(Zone);
            Out.WriteUInt16(1); // Guild Size
            Out.WriteByte(0);
        }
开发者ID:Necrosummon,项目名称:WarEmu,代码行数:20,代码来源:SocialInterface.cs

示例11: BuildObjectives

        // Change "Character_Objectives" for "Character_InProgressObjectives" for show Quest Objectives in F_QUEST_LIST
        public static void BuildObjectives(PacketOut Out, List<Character_InProgressObjectives> Objs)
        {
            Out.WriteByte((byte)Objs.Count);

            foreach (Character_InProgressObjectives Objective in Objs)
            {
                Out.WriteByte((byte)Objective.Count);
                Out.WriteByte((byte)Objective.Objective.ObjCount);
                Out.WriteUInt16(0);
                Out.WritePascalString(Objective.Objective.Description);
            }
        }
开发者ID:Necrosummon,项目名称:WarEmu,代码行数:13,代码来源:QuestsInterface.cs

示例12: F_CONNECT

        static public void F_CONNECT(BaseClient client, PacketIn packet)
        {
            GameClient cclient = client as GameClient;

            packet.Skip(8);
            UInt32 Tag = packet.GetUint32();
            string Token = packet.GetString(80);
            packet.Skip(21);
            string Username = packet.GetString(23);

            // TODO
            AuthResult Result = Program.AcctMgr.CheckToken(Username, Token);
            if (Result != AuthResult.AUTH_SUCCESS)
            {
                Log.Error("F_CONNECT", "Invalid Token =" + Username);
                cclient.Disconnect();
            }
            else
            {
                cclient._Account = Program.AcctMgr.GetAccount(Username);
                if (cclient._Account == null)
                {
                    Log.Error("F_CONNECT", "Invalid Account =" + Username);
                    cclient.Disconnect();
                }
                else
                {
                    //Log.Success("F_CONNECT", "MeId=" + cclient.Id);

                    GameClient Other = (cclient.Server as TCPServer).GetClientByAccount(cclient, cclient._Account.AccountId);
                    if (Other != null)
                        Other.Disconnect();

                    {
                        PacketOut Out = new PacketOut((byte)Opcodes.S_CONNECTED);
                        Out.WriteUInt32(0);
                        Out.WriteUInt32(Tag);
                        Out.WriteByte(Program.Rm.RealmId);
                        Out.WriteUInt32(1);
                        Out.WritePascalString(Username);
                        Out.WritePascalString(Program.Rm.Name);
                        Out.WriteByte(0);
                        Out.WriteUInt16(0);
                        cclient.SendPacket(Out);
                    }
                }
            }
        }
开发者ID:dzikun,项目名称:WarEmu,代码行数:48,代码来源:AuthentificationHandlers.cs

示例13: SendMount

        public void SendMount(Player Plr)
        {
            PacketOut Out = new PacketOut((byte)Opcodes.F_MOUNT_UPDATE);
            Out.WriteUInt16(Owner.Oid);

            if (CurrentMountInfo == null)
                Out.WriteUInt32(0);
            else
                Out.WriteUInt32(CurrentMountInfo.Entry);

            Out.Fill(0, 14);

            if (Plr == null)
                Owner.DispatchPacket(Out, true);
            else
                Plr.SendPacket(Out);
        }
开发者ID:dzikun,项目名称:WarEmu,代码行数:17,代码来源:Mount.cs

示例14: SendMeTo

        /*
         * |00 3D 71 
06 90 
00 00 
00 00 
1F E3 
00 0C E3 29 
00 0E 59 90 
FF FF 
1E 00 00 00 35 F3 00 03 04 00 00
|00 00 64 8B 76 09 CD 00 00 00 00 0F 45 6D 70 69 |..d.v.......Empi|
|72 65 20 42 61 72 20 44 6F 6F 72 04 06 AB DD 00 |re Bar Door.....|                                                
-------------------------------------------------------------------
         * */

        public override void SendMeTo(Player Plr)
        {
            PacketOut Out = new PacketOut((byte)Opcodes.F_CREATE_STATIC);
            Out.WriteUInt16(Oid);
            Out.WriteUInt16(0);

            Out.WriteUInt16((UInt16)Spawn.WorldO);
            Out.WriteUInt16((UInt16)Spawn.WorldZ);
            Out.WriteUInt32((UInt32)Spawn.WorldX);
            Out.WriteUInt32((UInt32)Spawn.WorldY);
            Out.WriteUInt16((ushort)Spawn.DisplayID);

            Out.WriteUInt16(Spawn.GetUnk(0));
            Out.WriteUInt16(Spawn.GetUnk(1));
            Out.WriteUInt16(Spawn.GetUnk(2));
            Out.WriteByte(Spawn.Unk1);

            int flags = Spawn.GetUnk(3);
            Loot Loots = LootsMgr.GenerateLoot(this, Plr);
            if (Loots != null && Loots.IsLootable())
            {
                flags = flags | 4;
            }

            Out.WriteUInt16((ushort)flags);
            Out.WriteByte(Spawn.Unk2);
            Out.WriteUInt32(Spawn.Unk3);
            Out.WriteUInt16(Spawn.GetUnk(4));
            Out.WriteUInt16(Spawn.GetUnk(5));
            Out.WriteUInt32(Spawn.Unk4);

            Out.WritePascalString(Name);
            Out.WriteByte(0);

            Plr.SendPacket(Out);

            base.SendMeTo(Plr);
        }
开发者ID:dzikun,项目名称:WarEmu,代码行数:53,代码来源:GameObject.cs

示例15: BuildItem

        static public void BuildItem(ref PacketOut Out,Item Itm,Item_Info Info,ushort SlotId,ushort Count)
        {
            SlotId = SlotId == 0 ? (Itm == null ? SlotId : Itm.SlotId ) : SlotId;
            Count = Count == 0 ? (Itm == null ? Count : Itm.Count) : Count;
            Info = Info == null ? (Itm == null ? null : Itm.Info) : Info;
            

            if(SlotId != 0)
                Out.WriteUInt16(SlotId);

            Out.WriteByte(0);
            Out.WriteUInt32((uint)(Info != null ? Info.Entry : 0));

            if (Info == null)
                return;

            Out.WriteUInt16((ushort)Info.ModelId);  // Valid 1.4.8
            Out.Fill(0, 7);  // Valid 1.4.8
            Out.WriteUInt16(Info.SlotId);  // Valid 1.4.8
            Out.WriteByte(Info.Type);  // Valid 1.4.8

            Out.WriteByte(Info.MinRank); // Min Level
            Out.WriteByte(Info.ObjectLevel); // 1.3.5, Object Level
            Out.WriteByte(Info.MinRenown); // 1.3.5, Min Renown
            Out.WriteByte(Info.MinRenown); // ?
            Out.WriteByte(Info.UniqueEquiped); // Unique - Equiped

            Out.WriteByte(Info.Rarity);
            Out.WriteByte(Info.Bind);
            Out.WriteByte(Info.Race);

            // Trophys have some extra bytes
            if (Info.Type == (byte)GameData.ItemTypes.ITEMTYPES_TROPHY)
            {
                Out.WriteUInt32(0);
                Out.WriteUInt16(0x0080);
            }

            Out.WriteUInt32(Info.Career);
            Out.WriteUInt32(0);
            Out.WriteUInt32(Info.SellPrice);

            Out.WriteUInt16((UInt16)(Count > 0 ? Count : 1));
            Out.WriteUInt16((UInt16)(Count > 0 ? Count : 1));

            Out.WriteUInt32(0);

            Out.WriteUInt32(Info.Skills);  // Valid 1.4.8
            Out.WriteUInt16(Info.Dps > 0 ? Info.Dps : Info.Armor);  // Valid 1.4.8
            Out.WriteUInt16(Info.Speed);  // Valid 1.4.8
            Out.WritePascalString(Info.Name);  // Valid 1.4.8

            Out.WriteByte((byte)Info._Stats.Count);  // Valid 1.4.8
            foreach (KeyValuePair<byte, UInt16> Key in Info._Stats)
            {
                Out.WriteByte(Key.Key);
                Out.WriteUInt16(Key.Value);
                Out.Fill(0, 5);
            }

            Out.WriteByte(0); // Equip Effects

            Out.WriteByte((byte)Info._Spells.Count); // OK
            foreach (KeyValuePair<UInt32, UInt32> Kp in Info._Spells)
            {
                Out.WriteUInt32(Kp.Key);
                Out.WriteUInt32(Kp.Value);
            }
            // (uint32)Entry, uint16 X, uint16 Y

            Out.WriteByte((byte)Info._Crafts.Count); // OK
            foreach (KeyValuePair<byte, ushort> Kp in Info._Crafts)
            {
                Out.WriteByte(Kp.Key);
                Out.WriteUInt16(Kp.Value);
            }

            Out.WriteByte(0); // ??

            Out.WriteByte(Info.TalismanSlots);
            Item_Info TalismanInfo = null;
            for (int i = 0; i < Info.TalismanSlots; ++i)
            {
                if (Itm != null)
                    TalismanInfo = Itm.GetTalisman((byte)i);
 
                if (TalismanInfo == null)
                    Out.WriteUInt32(0); // Entry;
                else
                {
                    Out.WriteUInt32(TalismanInfo.Entry);
                    Out.WritePascalString(TalismanInfo.Name);
                    Out.Fill(0, 15);
                }
            }

            Out.WritePascalString(Info.Description);

            Out.Write(Info.Unk27);

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


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