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


C# PacketWriter.DWord方法代码示例

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


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

示例1: PrivateMessageCheck

        public static byte[] PrivateMessageCheck(WorldMgr.character c)
        {
            DB ms = new DB("SELECT * FROM message WHERE receiver='" + c.Information.Name + "'");
            PacketWriter Writer = new PacketWriter();
            int count = ms.Count();

            Writer.Create(OperationCode.SERVER_PM_MESSAGE);
            Writer.Byte(1);//Static
            Writer.Byte(Convert.ToByte(count));//Total count
            using (System.Data.SqlClient.SqlDataReader reader = ms.Read())
            {
                while (reader.Read())
                {
                    string pmfrom       = reader.GetString(1);
                    string pmto         = reader.GetString(2);
                    string pmmessage    = reader.GetString(3);
                    byte pmstatus       = reader.GetByte(4);
                    DateTime pmdate     = Convert.ToDateTime(reader.GetDateTime(5));

                    Writer.Text(pmfrom);            // Message From
                    Writer.DWord(0x8A070000);       // date
                    Writer.DWord(0xC7058401);       // date
                    Writer.Byte(pmstatus);          // Status (0 = Unread) (1 = Read)
                }
                ms.Close();
            }
            return Writer.GetBytes();
        }
开发者ID:ManhHaHY,项目名称:ClowenEmulationOpenSourceProject,代码行数:28,代码来源:PrivateMessagePackets.cs

示例2: AlchemyResponse

        public static byte[] AlchemyResponse(bool isSuccess, ObjData.slotItem sItem, byte type, byte totalblue)
        {
            PacketWriter Writer = new PacketWriter();
            Writer.Create(OperationCode.SERVER_ALCHEMY);
            Writer.Byte(1);
            Writer.Byte(2);
            Writer.Bool(isSuccess);
            Writer.Byte(sItem.Slot);
            if (!isSuccess) { Writer.Byte(0); }
            Writer.DWord(0);
            Writer.DWord(sItem.ID);
            Writer.Byte(sItem.PlusValue);
            Writer.LWord(0);
            Writer.DWord(sItem.Durability);
            Writer.Byte(ObjData.Manager.ItemBlue[sItem.dbID].totalblue);
            for (int i = 0; i <= ObjData.Manager.ItemBlue[sItem.dbID].totalblue - 1; i++)
            {
                Writer.DWord(ObjData.Manager.MagicOptions.Find(mg => (mg.Name == Convert.ToString(ObjData.Manager.ItemBlue[sItem.dbID].blue[i]))).ID);
                Writer.DWord(ObjData.Manager.ItemBlue[sItem.dbID].blueamount[i]);
            }
            Writer.Word(1);
            Writer.Word(2);
            Writer.Word(3);

            return Writer.GetBytes();
        }
开发者ID:ManhHaHY,项目名称:ClowenEmulationOpenSourceProject,代码行数:26,代码来源:AlchemyPackets.cs

示例3: PetSpawn

 ///////////////////////////////////////////////////////////////////////////
 // Despawn Pet
 ///////////////////////////////////////////////////////////////////////////
 public static byte[] PetSpawn(int petid, byte type, CLGameServer.WorldMgr.pet_obj o)
 {
     PacketWriter Writer = new PacketWriter();
     Writer.Create(OperationCode.SERVER_PLAYER_SPAWN_PET);   //Select Opcode
     Writer.DWord(petid);                              //Pet ID
     switch (type)
     {
         case 1:
             //Despawn pet
             Writer.Byte(1);
             break;
         case 2:
             //Rename pet respawn
             Writer.Byte(5);
             Writer.Text(o.Petname);
             break;
         case 3:
             //Attack pet respawn for exp info
             Writer.Byte(3);//Static
             Writer.LWord(o.exp);//New exp
             Writer.DWord(o.OwnerID);//Owner id
             break;
     }
     return Writer.GetBytes();
 }
开发者ID:ManhHaHY,项目名称:ClowenEmulationOpenSourceProject,代码行数:28,代码来源:GrabpetPackets.cs

示例4: InfoUpdate

        public static byte[] InfoUpdate(byte type, int obje, byte bT)
        {
            PacketWriter Writer = new PacketWriter();
            Writer.Create(OperationCode.SERVER_INFO_UPDATE);
            Writer.Byte(type);
            switch (type)
            {
                case 1:
                    Writer.LWord(obje);
                    Writer.Byte(0);
                    break;
                case 2:
                    Writer.DWord(obje);
                    Writer.Byte(0);
                    break;
                case 4:
                    Writer.Byte(bT);
                    Writer.DWord(obje);
                    break;
                default:
                    break;
            }

            return Writer.GetBytes();
        }
开发者ID:ManhHaHY,项目名称:ClowenEmulationOpenSourceProject,代码行数:25,代码来源:PlayerActionPackets.cs

示例5: CreateFormedParty

 public static byte[] CreateFormedParty(WorldMgr.party pt)
 {
     //Create new packet writer
     PacketWriter Writer = new PacketWriter();
     //Add opcode to packet
     Writer.Create(OperationCode.SERVER_FORMED_PARTY_CREATED);
     //Static byte
     Writer.Byte(1);
     //Party id
     Writer.DWord(pt.ptid);
     //0 Dword value
     Writer.DWord(0);
     //Party type
     Writer.Byte(pt.Type);
     //Party purpose
     Writer.Byte(pt.ptpurpose);
     //Party min level required
     Writer.Byte(pt.minlevel);
     //Party max level allowed
     Writer.Byte(pt.maxlevel);
     //Party name
     Writer.Text3(pt.partyname);
     //Return all bytes to send
     return Writer.GetBytes();
 }
开发者ID:ManhHaHY,项目名称:ClowenEmulationOpenSourceProject,代码行数:25,代码来源:Create.cs

示例6: Effects2Dmg

 public static byte[] Effects2Dmg(int id, int dmg)
 {
     PacketWriter Writer = new PacketWriter();
     Writer.Create(OperationCode.SERVER_EFFECT_DAMAGE);
     Writer.DWord(id);
     Writer.DWord(dmg);
     return Writer.GetBytes();
 }
开发者ID:ManhHaHY,项目名称:ClowenEmulationOpenSourceProject,代码行数:8,代码来源:SkillSystemPackets.cs

示例7: BalloonTicket

 public static byte[] BalloonTicket(int charid, int info)
 {
     PacketWriter Writer = new PacketWriter();
     Writer.Create(OperationCode.SERVER_TICKET);
     Writer.Byte(0);
     Writer.DWord(charid);
     Writer.DWord(info);
     return Writer.GetBytes();
 }
开发者ID:ManhHaHY,项目名称:ClowenEmulationOpenSourceProject,代码行数:9,代码来源:CharacterPackets.cs

示例8: Player_UpToHorse

 public static byte[] Player_UpToHorse(int ownerID, bool type, int petID)
 {
     PacketWriter Writer = new PacketWriter();
     Writer.Create(OperationCode.SERVER_PLAYER_UPTOHORSE); //Select opcode
     Writer.Byte(1);                                 //Static byte
     Writer.DWord(ownerID);                          //Horse Owner ID
     Writer.Byte(type);                              //Horse Type
     Writer.DWord(petID);                            //Horse ID
     return Writer.GetBytes();
 }
开发者ID:ManhHaHY,项目名称:ClowenEmulationOpenSourceProject,代码行数:10,代码来源:TransportPackets.cs

示例9: ChangePetSettings

 ///////////////////////////////////////////////////////////////////////////
 // Grab pet settings
 ///////////////////////////////////////////////////////////////////////////
 public static byte[] ChangePetSettings(byte option, int petid, byte type, int settings)
 {
     PacketWriter Writer = new PacketWriter();
     Writer.Create(OperationCode.SERVER_GPET_SETTINGS);
     Writer.Byte(option);
     Writer.DWord(petid);
     Writer.Byte(type);
     Writer.DWord(settings);
     return Writer.GetBytes();
 }
开发者ID:ManhHaHY,项目名称:ClowenEmulationOpenSourceProject,代码行数:13,代码来源:GrabpetPackets.cs

示例10: PasswordFailed

 public static byte[] PasswordFailed(int CurrentAttempts, int MaxAttempts)
 {
     PacketWriter Write = new PacketWriter();
     Write.Create(Opcodes.SERVER.SERVER_GATEWAY_LOGIN_RESPONSE);
     Write.Byte(2);
     Write.Byte(1);
     Write.DWord(MaxAttempts);
     Write.DWord(CurrentAttempts);
     return Write.GetBytes();
 }
开发者ID:ManhHaHY,项目名称:ClowenEmulationOpenSourceProject,代码行数:10,代码来源:Login.cs

示例11: EffectUpdate

 public static byte[] EffectUpdate(int objectid, CLGameServer.Effect.EffectNumbers effectid, bool start)
 {
     PacketWriter Writer = new PacketWriter();
     Writer.Create(OperationCode.SERVER_SKILL_EFFECTS);
     Writer.DWord(objectid);
     Writer.Byte(1);
     Writer.Bool(start);
     Writer.Byte(4); // effect change
     Writer.DWord(effectid);
     return Writer.GetBytes();
 }
开发者ID:ManhHaHY,项目名称:ClowenEmulationOpenSourceProject,代码行数:11,代码来源:SkillSystemPackets.cs

示例12: Pet_Information

 public static byte[] Pet_Information(int id, int model, int hp, int charid, CLGameServer.WorldMgr.pet_obj o)
 {
     PacketWriter Writer = new PacketWriter();
     Writer.Create(OperationCode.SERVER_PET_INFORMATION);  //Select opcode
     Writer.DWord(id);                               //Horse ID
     Writer.DWord(model);                            //Horse Model
     Writer.DWord(hp);                               //Horse HP
     Writer.DWord(hp);                               //Horse SEC HP
     Writer.Byte(0);                                 //Static byte ?
     return Writer.GetBytes();
 }
开发者ID:ManhHaHY,项目名称:ClowenEmulationOpenSourceProject,代码行数:11,代码来源:TransportPackets.cs

示例13: GuildSetTitle2

 public static byte[] GuildSetTitle2(int guildid, int charid, string title)
 {
     PacketWriter Writer = new PacketWriter();
     Writer.Create(OperationCode.SERVER_GUILD_SET_TITLE2);
     Writer.Byte(1);
     Writer.DWord(guildid);
     Writer.DWord(charid);
     Writer.Word(title.Length);
     Writer.String(title);
     return Writer.GetBytes();
 }
开发者ID:ManhHaHY,项目名称:ClowenEmulationOpenSourceProject,代码行数:11,代码来源:Packets.cs

示例14: RenameParty

        public void RenameParty()
        {
            try
            {
                //Create new packet reader
                PacketReader reader = new PacketReader(PacketInformation.buffer);
                //First integer is party id
                int partyid = reader.Int32();
                //Second integer is not needed
                int NotNeeded = reader.Int32();
                //Byte party type
                byte ptype = reader.Byte();
                //Byte party purpose
                byte purpose = reader.Byte();
                //Byte minimum level
                byte minlevel = reader.Byte();
                //Byte max level to enter party
                byte maxlevel = reader.Byte();
                //Party name lenght
                short namel = reader.Int16();
                //Party name each character is a word value using text3
                string pname = reader.Text3();
                //Create new packet writer
                PacketWriter Writer = new PacketWriter();
                //Add opcode to server packet
                Writer.Create(OperationCode.SERVER_PARTY_CHANGENAME);
                //Write static byte 1
                Writer.Byte(1);
                //Write party id
                Writer.DWord(partyid);
                //Write dword 0
                Writer.DWord(0);
                //Write party type
                Writer.Byte(ptype);
                //Write party purpose
                Writer.Byte(purpose);
                //Write party minimum level
                Writer.Byte(minlevel);
                //Write party max level
                Writer.Byte(maxlevel);
                //Write party name
                Writer.Text3(pname);
                //Send bytes to client
                client.Send(Writer.GetBytes());
            }
            //If a error happens
            catch (Exception ex)
            {
                //Write the exception to the log

            }
        }
开发者ID:ManhHaHY,项目名称:ClowenEmulationOpenSourceProject,代码行数:52,代码来源:Rename.cs

示例15: GuildSetOnline

 public static byte[] GuildSetOnline(WorldMgr.guild c, int memberid)
 {
     PacketWriter Writer = new PacketWriter();
     Writer.Create(OperationCode.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:ManhHaHY,项目名称:ClowenEmulationOpenSourceProject,代码行数:15,代码来源:Packets.cs


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