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


C# PacketWriter.Word方法代码示例

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


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

示例1: FriendGroupManage

 public static byte[] FriendGroupManage(string type,string groupname, short groupid, int targetid)
 {
     PacketWriter Writer = new PacketWriter();
     switch (type)
     {
         case "ADD":
             Writer.Create(OperationCode.SERVER_FRIEND_GROUP);
             Writer.Byte(1);
             Writer.Text(groupname);
             Writer.Word(groupid);
             break;
         case "REMOVE":
             Writer.Create(OperationCode.SERVER_FRIEND_GROUP_REMOVE);
             Writer.Byte(1);
             Writer.Word(groupid);
             break;
         case "MOVE":
             Writer.Create(OperationCode.SERVER_FRIEND_GROUP_MANAGE_FRIEND);
             Writer.Byte(1);
             Writer.DWord(targetid);
             Writer.Word(groupid);
             break;
     }
     return Writer.GetBytes();
 }
开发者ID:ManhHaHY,项目名称:ClowenEmulationOpenSourceProject,代码行数:25,代码来源:FriendsPackets.cs

示例2: ServerListPacket

 public static byte[] ServerListPacket(int cliVersion)
 {
     //Create a new packet writer to create our packet
     PacketWriter W = new PacketWriter();
     //Write the opcode from server to client
     W.Create(Opcodes.SERVER.SERVER_SERVERLIST);
     //Structure of packet below
     W.Word(0x0201);
     W.Text("CLOWEN_DEV_PROJECT");
     W.Byte(0);
     //Repeat the following packet data below for each server in the list
     foreach (KeyValuePair<int, Definitions.Serverdef.ServerDetails> Gameservers in Definitions.Serverdef.Serverlist)
     {
         if (cliVersion == Definitions.Serverdef.SilkroadClientVersion)
         {
             W.Bool(true);
             W.Word(Gameservers.Value.id);
             W.Text(Gameservers.Value.name);
             W.Word(Gameservers.Value.usedSlots);
             W.Word(Gameservers.Value.maxSlots);
             W.Byte(Gameservers.Value.status);
         }
     }
     //Static 0 byte
     W.Byte(0);
     //Send the created packet back to the request (client).
     return W.GetBytes();
 }
开发者ID:ManhHaHY,项目名称:ClowenEmulationOpenSourceProject,代码行数:28,代码来源:Serverlist.cs

示例3: 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

示例4: _3

 public static byte[] _3()
 {
     PacketWriter Writer = new PacketWriter();
     Writer.Create(Opcodes.SERVER.SERVER_MAIN);
     Writer.Word(0x0101);
     Writer.Word(0x0500);
     Writer.Byte(0x60);
     return Writer.GetBytes();
 }
开发者ID:ManhHaHY,项目名称:ClowenEmulationOpenSourceProject,代码行数:9,代码来源:Connect.cs

示例5: _4

 public static byte[] _4()
 {
     PacketWriter Writer = new PacketWriter();
     Writer.Create(Opcodes.SERVER.SERVER_MAIN);
     Writer.Word(0x0300);
     Writer.Word(0x0200);
     Writer.Word(0x0200);
     return Writer.GetBytes();
 }
开发者ID:ManhHaHY,项目名称:ClowenEmulationOpenSourceProject,代码行数:9,代码来源:Connect.cs

示例6: LoadGame_5

 public static byte[] LoadGame_5()
 {
     PacketWriter Writer = new PacketWriter();
     Writer.Create(OperationCode.SERVER_PATCH);
     Writer.Word(0x0101);
     Writer.Word(0);
     Writer.Byte(0xA1);
     return Writer.GetBytes();
 }
开发者ID:ManhHaHY,项目名称:ClowenEmulationOpenSourceProject,代码行数:9,代码来源:LoginPackets.cs

示例7: FriendDecline

 public static byte[] FriendDecline(string name)
 {
     PacketWriter Writer = new PacketWriter();
     Writer.Create(OperationCode.SERVER_FRIEND_INVITE);
     Writer.Byte(2);
     Writer.Word(0x640B);
     Writer.Byte(0);
     Writer.Word(0x000B);
     Writer.Text(name);
     return Writer.GetBytes();
 }
开发者ID:ManhHaHY,项目名称:ClowenEmulationOpenSourceProject,代码行数:11,代码来源:FriendsPackets.cs

示例8: _2

 public static byte[] _2()
 {
     PacketWriter Writer = new PacketWriter();
     Writer.Create(Opcodes.SERVER.SERVER_MAIN);
     Writer.Word(0x0100);
     Writer.Word(0x0100);
     Writer.Byte(0x69);
     Writer.Byte(0x0C);
     Writer.DWord(0x00000005);
     Writer.Byte(0x02);
     return Writer.GetBytes();
 }
开发者ID:ManhHaHY,项目名称:ClowenEmulationOpenSourceProject,代码行数:12,代码来源:Connect.cs

示例9: LoadGame_2

 public static byte[] LoadGame_2()
 {
     PacketWriter Writer = new PacketWriter();
     Writer.Create(OperationCode.SERVER_PATCH);
     Writer.Word(0x0100);
     Writer.Word(0x0100);
     Writer.Byte(0x69);
     Writer.Byte(0x0C);
     Writer.DWord(0x00000005);
     Writer.Byte(0x02);
     return Writer.GetBytes();
 }
开发者ID:ManhHaHY,项目名称:ClowenEmulationOpenSourceProject,代码行数:12,代码来源:LoginPackets.cs

示例10: ConnectSucces

 public static byte[] ConnectSucces(string ip, short port, byte type)
 {
     PacketWriter Writer = new PacketWriter();
     Writer.Create(Opcodes.SERVER.SERVER_GATEWAY_LOGIN_RESPONSE);
     Writer.Byte(1);
     Writer.Byte(type);
     Writer.Byte(0);
     Writer.Word(0);
     Writer.Text(ip);
     Writer.Word(port);
     Writer.Byte(3);
     return Writer.GetBytes();
 }
开发者ID:ManhHaHY,项目名称:ClowenEmulationOpenSourceProject,代码行数:13,代码来源:Login.cs

示例11: NewsPacket

        public static byte[] NewsPacket()
        {
            PacketWriter Writer = new PacketWriter();

            Writer.Create(Opcodes.SERVER.SERVER_MAIN);
            Writer.Byte(0);
            Writer.Byte((byte)Definitions.Serverdef.News_List.Count);

            foreach (Definitions.Serverdef.NewsList n in Definitions.Serverdef.News_List)
            {
                Writer.Text(n.Title);
                Writer.Text(n.Article);
                Writer.Word(n.Year);
                Writer.Word(n.Month);
                Writer.Word(n.Day);
                Writer.Word(0); // Hour
                Writer.Word(0); // Minute
                Writer.Word(0); // Second
                Writer.Word(0); // MiliSecond
            }

            Writer.Word(0);

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

示例12: Arrow

 ////////////////////////////////////////////////////////////////////////////////////////////////////////////
 // Update arrow amount
 ////////////////////////////////////////////////////////////////////////////////////////////////////////////
 public static byte[] Arrow(short amount)
 {
     PacketWriter Writer = new PacketWriter();
     Writer.Create(OperationCode.SERVER_ARROW_UPDATE);
     Writer.Word(amount);
     return Writer.GetBytes();
 }
开发者ID:ManhHaHY,项目名称:ClowenEmulationOpenSourceProject,代码行数:10,代码来源:ItemActionPackets.cs

示例13: ConnectWrong

 public static byte[] ConnectWrong(ushort type)
 {
     PacketWriter Writer = new PacketWriter();
     Writer.Create(Opcodes.SERVER.SERVER_GATEWAY_LOGIN_RESPONSE);
     Writer.Word(type);
     return Writer.GetBytes();
 }
开发者ID:ManhHaHY,项目名称:ClowenEmulationOpenSourceProject,代码行数:7,代码来源:Login.cs

示例14: ActualVersion

 public static byte[] ActualVersion()
 {
     PacketWriter Writer = new PacketWriter();
     Writer.Create(Opcodes.SERVER.SERVER_MAIN);
     Writer.Word(0x100);
     return Writer.GetBytes();
 }
开发者ID:ManhHaHY,项目名称:ClowenEmulationOpenSourceProject,代码行数:7,代码来源:Connect.cs

示例15: TeleportStart

 public static byte[] TeleportStart()
 {
     PacketWriter Writer = new PacketWriter();
     Writer.Create(OperationCode.SERVER_TELEPORTSTART);
     Writer.Byte(2);
     Writer.Word(1);
     return Writer.GetBytes();
 }
开发者ID:ManhHaHY,项目名称:ClowenEmulationOpenSourceProject,代码行数:8,代码来源:TeleportPackets.cs


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