• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Framework.PacketWriter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



PacketWriter类属于Framework命名空间,在下文中一共展示了PacketWriter类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GuildLeave

 public static byte[] GuildLeave()
 {
     PacketWriter Writer = new PacketWriter();
     Writer.Create(Systems.SERVER_GUILD_LEAVE);
     Writer.Byte(1);
     return Writer.GetBytes();
 }
开发者ID:CarlosX,项目名称:DarkEmu,代码行数:7,代码来源:GuildSystemPackets.cs


示例2: DisbandGuildMsgEnd

 public static byte[] DisbandGuildMsgEnd()
 {
     PacketWriter Writer = new PacketWriter();
     Writer.Create(Systems.SERVER_GUILD_DISBAND_MSG);
     Writer.Byte(1);
     return Writer.GetBytes();
 }
开发者ID:CarlosX,项目名称:DarkEmu,代码行数:7,代码来源:GuildSystemPackets.cs


示例3: GuildKick

 public static byte[] GuildKick(int memberid)
 {
     PacketWriter Writer = new PacketWriter();
     Writer.Create(Systems.SERVER_GUILD_DISBAND);
     Writer.DWord(memberid);
     return Writer.GetBytes();
 }
开发者ID:CarlosX,项目名称:DarkEmu,代码行数:7,代码来源:GuildSystemPackets.cs


示例4: GuildKickMsg

 public static byte[] GuildKickMsg()
 {
     PacketWriter Writer = new PacketWriter();
     Writer.Create(Systems.SERVER_GUILD_KICK);
     Writer.Byte(1);
     return Writer.GetBytes();
 }
开发者ID:CarlosX,项目名称:DarkEmu,代码行数:7,代码来源:GuildSystemPackets.cs


示例5: FORTRESSNOTE

 public static byte[] FORTRESSNOTE()
 {
     PacketWriter Writer = new PacketWriter();
     Writer.Create(Systems.SERVER_FORTRESS_NOTIFY);
     Writer.Byte(0);
     Writer.Byte(0);
     return Writer.GetBytes();
 }
开发者ID:CarlosX,项目名称:DarkEmu,代码行数:8,代码来源:GuildSystemPackets.cs


示例6: GuildDonateGP

 public static byte[] GuildDonateGP(int donatedgp)
 {
     PacketWriter writer = new PacketWriter();
     writer.Create(Systems.SERVER_GUILD_DONATE_GP);
     writer.Byte(1);
     writer.DWord(donatedgp);
     return writer.GetBytes();
 }
开发者ID:CarlosX,项目名称:DarkEmu,代码行数:8,代码来源:GuildSystemPackets.cs


示例7: GuildCreateLow

 public static byte[] GuildCreateLow()
 {
     PacketWriter Writer = new PacketWriter();
     Writer.Create(Systems.SERVER_GUILD);
     Writer.Byte(2);
     Writer.Byte(0xA);
     Writer.Byte(0x4C);
     return Writer.GetBytes();
 }
开发者ID:CarlosX,项目名称:DarkEmu,代码行数:9,代码来源:GuildSystemPackets.cs


示例8: PrivateItemPacket

        public static void PrivateItemPacket(PacketWriter Writer, int id, byte max, byte avatar, bool mspawn)
        {
            try
            {
                List<byte> slots = new List<byte>();
                Systems.MsSQL ms = new Systems.MsSQL("SELECT * FROM char_items WHERE owner='" + id + "' AND slot >= '0' AND slot <= '" + max + "' AND inavatar='" + avatar + "' AND storagetype='0' AND quantity='1'");
                using (SqlDataReader reader = ms.Read())
                {
                    int count = ms.Count();

                    Writer.Byte(count);

                    while (reader.Read())
                    {
                        byte slot       = reader.GetByte(5);
                        byte plusvalue  = reader.GetByte(4);
                        int itemid      = reader.GetInt32(2);

                        if (itemid != 0)
                        {
                            if (!slots.Exists(delegate(byte bk)
                            {
                                return bk == slot;
                            }))
                            {
                                slots.Add(slot);
                            }
                            Writer.DWord(itemid);
                            Writer.Byte(plusvalue);
                        }
                    }
                }
                ms.Close();
            }
            catch (Exception ex)
            {
                Console.WriteLine("Item Error : {0}", ex);
                Systems.Debugger.Write(ex);
            }
        }
开发者ID:CarlosX,项目名称:DarkEmu,代码行数:40,代码来源:Items.cs


示例9: GuildSetOnline

 public static byte[] GuildSetOnline(guild c, int memberid)
 {
     PacketWriter Writer = new PacketWriter();
     Writer.Create(Systems.SERVER_GUILD_ONLINE);
     Writer.DWord(memberid);
     Writer.DWord(c.Guildid);
     Writer.Text(c.Name);
     Writer.Word(0);
     Writer.DWord(0);
     Writer.DWord(0);
     Writer.DWord(0);
     Writer.Byte(0);
     Writer.Byte(1);
     return Writer.GetBytes();
 }
开发者ID:CarlosX,项目名称:DarkEmu,代码行数:15,代码来源:GuildSystemPackets.cs


示例10: SendGuildStart

 public static byte[] SendGuildStart()
 {
     PacketWriter Writer = new PacketWriter();
     Writer.Create(0x34B3);
     return Writer.GetBytes();
 }
开发者ID:CarlosX,项目名称:DarkEmu,代码行数:6,代码来源:GuildSystemPackets.cs


示例11: UnionInfo

        public static byte[] UnionInfo(Systems c)
        {
            PacketWriter Writer = new PacketWriter();
            Writer.Create(Systems.SERVER_GUILD_UNIONS);
            Writer.DWord(c.Character.Information.CharacterID);                // Union owner id
            Writer.DWord(7);                                                  // ??Need to check
            Writer.DWord(c.Character.Network.Guild.Guildid);                  // Union leader guild id
            Writer.Byte(c.Character.Network.Guild.Unions.Count);              // Count guilds in union
            //Get all guilds details
            foreach (int guild in c.Character.Network.Guild.Unions)
            {
                //Load other guild data
                Systems.MsSQL guild_data = new Systems.MsSQL("SELECT * FROM guild WHERE id='"+ guild +"'");

                using (System.Data.SqlClient.SqlDataReader reader = guild_data.Read())
                {
                    while (reader.Read())
                    {
                        string Guildname        = reader.GetString(1);
                        byte Guildlevel         = reader.GetByte(2);
                        byte Guildmembercount   = reader.GetByte(6);
                        int Ownerid             = reader.GetInt32(9);

                        string Charname = Systems.MsSQL.GetData("SELECT name FROM character WHERE id='" + Ownerid + "'", "name").ToString();
                        int Charmodel   = Convert.ToInt32(Systems.MsSQL.GetData("SELECT chartype FROM character WHERE id='" + Ownerid + "'", "chartype"));

                        Writer.DWord(guild);                        //Guild ID
                        Writer.Text(reader.GetString(1));           //Guildname
                        Writer.Byte(reader.GetByte(2));             //Guildlevel
                        Writer.Text(Charname);                      //Ownername
                        Writer.DWord(Charmodel);                    //Owner model
                        Writer.Byte(reader.GetByte(6));             //Guild member count

                        //Get guild details
                        Systems Guildmembers = Systems.GetGuildPlayer(guild);
                        //Add clients that are online to union list
                        //Null check
                        if (Guildmembers != null)
                        {
                            foreach (int member in Guildmembers.Character.Network.Guild.Members)
                            {
                                //make sure member isnt 0
                                if (member != 0)
                                {
                                    //Get player details
                                    Systems getmember = Systems.GetPlayerMainid(member);
                                    //Make sure that the player is there
                                    if (getmember != null)
                                    {
                                        //Add client to union list
                                        c.Character.Network.Guild.UnionMembers.Add(getmember.Character.Information.CharacterID);
                                        //Add to member
                                        if (c.Character.Information.CharacterID != getmember.Character.Information.CharacterID)
                                        {
                                            getmember.Character.Network.Guild.UnionMembers.Add(c.Character.Information.CharacterID);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            return Writer.GetBytes();
        }
开发者ID:CarlosX,项目名称:DarkEmu,代码行数:65,代码来源:GuildSystemPackets.cs


示例12: SendGuildInfo

 public static byte[] SendGuildInfo(guild guildGlobal)
 {
     PacketWriter Writer = new PacketWriter();
     /////////////////////////////////////////////////////////////////////////
     //Opcode information
     /////////////////////////////////////////////////////////////////////////
     Writer.Create(Systems.SERVER_GUILD_INFO_LOAD);
     /////////////////////////////////////////////////////////////////////////
     //Packet Structure
     /////////////////////////////////////////////////////////////////////////
     //Writer.Byte(1); // Guild update
     Writer.DWord(guildGlobal.Guildid);              // Unique Guild ID
     Writer.Text(guildGlobal.Name);                  // Guild Name
     Writer.Byte(guildGlobal.Level);                 // Guild level
     Writer.DWord(guildGlobal.PointsTotal);          // Guild GP
     Writer.Word(guildGlobal.NewsTitle.Length);      // Guild Message Title Lenght
     Writer.String(guildGlobal.NewsTitle);           // Guild Message Title
     Writer.Word(guildGlobal.NewsMessage.Length);    // Guild Message Lenght
     Writer.String(guildGlobal.NewsMessage);         // Guild Message
     Writer.DWord(0);                                // War on guild id
     Writer.Byte(0);                                 // War status?
     /////////////////////////////////////////////////////////////////////////
     // Write Guild Member information for each excisting member.
     /////////////////////////////////////////////////////////////////////////
     Guild_ListPlayersInfo(guildGlobal.MembersInfo, Writer);
     Writer.Byte(0);
     return Writer.GetBytes();
 }
开发者ID:CarlosX,项目名称:DarkEmu,代码行数:28,代码来源:GuildSystemPackets.cs


示例13: SendGuildInfo2

 public static byte[] SendGuildInfo2(character c)
 {
     PacketWriter Writer = new PacketWriter();
     Writer.Create(Systems.SERVER_GUILD_ONLINE);
     Writer.DWord(c.Information.UniqueID);               // Guildmaster ID
     Writer.DWord(c.Network.Guild.Guildid);              // Guild ID
     Writer.Text(c.Network.Guild.Name);
     if (c.Network.Guild.GrantName != "")
         Writer.Text(c.Network.Guild.GrantName);         // Guildmaster grand name len
     else
         Writer.Word(0);
     Writer.DWord(0);                                    // ?
     Writer.DWord(0);                                    // ?
     Writer.DWord(0);                                    // ? Amount of guilds in union ?
     Writer.Byte(1);                                     // ?
     Writer.Byte(1);
     return Writer.GetBytes();
 }
开发者ID:CarlosX,项目名称:DarkEmu,代码行数:18,代码来源:GuildSystemPackets.cs


示例14: GuildTransferMessage

 public static byte[] GuildTransferMessage()
 {
     PacketWriter Writer = new PacketWriter();
     Writer.Create(Systems.SERVER_GUILD_TRANSFER_MSG);
     Writer.Byte(1);
     return Writer.GetBytes();
 }
开发者ID:CarlosX,项目名称:DarkEmu,代码行数:7,代码来源:GuildSystemPackets.cs


示例15: SendGuildEnd

 public static byte[] SendGuildEnd()
 {
     /////////////////////////////////////////////////////////////////////////
     // Guild end
     /////////////////////////////////////////////////////////////////////////
     PacketWriter Writer = new PacketWriter();
     Writer.Create(0x34B4);
     return Writer.GetBytes();
 }
开发者ID:CarlosX,项目名称:DarkEmu,代码行数:9,代码来源:GuildSystemPackets.cs


示例16: GuildStorageClose

 public static byte[] GuildStorageClose()
 {
     PacketWriter Writer = new PacketWriter();
     Writer.Create(Systems.SERVER_GUILD_STORAGE_CLOSE);
     Writer.Byte(1);
     return Writer.GetBytes();
 }
开发者ID:CarlosX,项目名称:DarkEmu,代码行数:7,代码来源:GuildSystemPackets.cs


示例17: GuildStorageStart

        public static byte[] GuildStorageStart(byte type)
        {
            PacketWriter Writer = new PacketWriter();
            Writer.Create(Systems.SERVER_GUILD_STORAGE);
            switch (type)
            {
                case 1:
                    //Success opening
                    //Need to sniff packet data
                    break;
                case 2:
                    //Level to low
                    Writer.Byte(type);  //Type
                    Writer.Word(0x4C4A);//Message type revert
                    break;

            }
            Writer.Byte(1);
            return Writer.GetBytes();
        }
开发者ID:CarlosX,项目名称:DarkEmu,代码行数:20,代码来源:GuildSystemPackets.cs


示例18: GuildStorageData

 public static byte[] GuildStorageData(character c)
 {
     Systems.MsSQL getstorage = new Systems.MsSQL("SELECT * FROM char_items WHERE guild_storage_id='" + c.Network.Guild.Guildid + "' AND storagetype='3'");
     int itemcount = getstorage.Count();
     PacketWriter Writer = new PacketWriter();
     Writer.Create(Systems.SERVER_GUILD_STORAGE3);
     Writer.Byte(c.Network.Guild.StorageSlots);
     Writer.Byte(itemcount);
     if (itemcount != 0)
     {
         using (System.Data.SqlClient.SqlDataReader reader = getstorage.Read())
         {
             while (reader.Read())
             {
                 Item.AddItemPacket(Writer, reader.GetByte(5), reader.GetInt32(2), reader.GetByte(4), reader.GetInt16(6), reader.GetInt32(7), reader.GetInt32(0), reader.GetInt32(9), reader.GetInt32(30));
             }
         }
     }
     getstorage.Close();
     return Writer.GetBytes();
 }
开发者ID:CarlosX,项目名称:DarkEmu,代码行数:21,代码来源:GuildSystemPackets.cs


示例19: Guild_Create

        public static byte[] Guild_Create(guild guildGlobal)
        {
            PacketWriter Writer = new PacketWriter();
            Writer.Create(Systems.SERVER_GUILD);
            Writer.Byte(1);
            Writer.DWord(guildGlobal.Guildid);
            Writer.Text(guildGlobal.Name);
            Writer.Byte(1);
            Writer.DWord(0);
            if (guildGlobal.NewsTitle != null)
            {
                if (guildGlobal.NewsTitle != "")
                    Writer.Text(guildGlobal.NewsTitle);
                else
                    Writer.Word(0);
            }
            else
                Writer.Word(0);

            if (guildGlobal.NewsMessage != null)
            {
                if (guildGlobal.NewsMessage != "")
                    Writer.Text(guildGlobal.NewsMessage);
                else
                    Writer.Word(0);
            }
            else
                Writer.Word(0);

            Writer.DWord(0);
            Writer.Byte(0);

            Guild_ListPlayersInfo(guildGlobal.MembersInfo, Writer);

            Writer.Byte(0);
            return Writer.GetBytes();
        }
开发者ID:CarlosX,项目名称:DarkEmu,代码行数:37,代码来源:GuildSystemPackets.cs


示例20: GuildWarMsg

 public static byte[] GuildWarMsg(byte type)
 {
     PacketWriter Writer = new PacketWriter();
     Writer.Create(Systems.SERVER_GUILD_WAR_MSG);
     switch (type)
     {
         case 2:
             Writer.Byte(type);
             Writer.Word(0x4C45);
             break;
     }
     return Writer.GetBytes();
 }
开发者ID:CarlosX,项目名称:DarkEmu,代码行数:13,代码来源:GuildSystemPackets.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Packets.PacketReader类代码示例发布时间:2022-05-26
下一篇:
C# WebControls.HeadMenuButtonItem类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap