本文整理汇总了C#中Packet.WriteByte方法的典型用法代码示例。如果您正苦于以下问题:C# Packet.WriteByte方法的具体用法?C# Packet.WriteByte怎么用?C# Packet.WriteByte使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Packet
的用法示例。
在下文中一共展示了Packet.WriteByte方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Encode
public Packet Encode()
{
Packet packet = new Packet();
packet.WriteByte(this._id_u8);
packet.WriteBuffer(this._role_base.GetBuffer());
ushort id_f32_count = (ushort)this._id_f32.Count;
packet.WriteUshort(id_f32_count);
for (ushort i = 0; i < id_f32_count; i++)
{
float xxx = this._id_f32[i];
packet.WriteFloat(xxx);
}
packet.WriteByte(id_op_u8_flag);
if (this.id_op_u8_flag == 1)
{
packet.WriteByte(this._id_op_u8);
}
packet.WriteByte(op_role_base_flag);
if (this.op_role_base_flag == 1)
{
packet.WriteBuffer(this._op_role_base.GetBuffer());
}
packet.Encode(Msg.P_REQ_TEST_SEND);
return packet;
}
示例2: InvalidPIC
public static Packet InvalidPIC()
{
Packet p = new Packet();
p.WriteShort((short)SendOpcodes.PIC_Error);
p.WriteByte(0x14);
p.WriteByte(0);
return p;
}
示例3: Cash_Shop_Categories
public static Packet Cash_Shop_Categories()
{
Packet p = new Packet();
p.WriteShort((short)SendOpcodes.Cash_Shop);
p.WriteByte(3);
p.WriteByte(1);
p.WriteByte(0);
return p;
}
示例4: Cash_Shop_Featured_Items
public static Packet Cash_Shop_Featured_Items()
{
Packet p = new Packet();
p.WriteShort((short)SendOpcodes.Cash_Shop);
p.WriteByte(8);
p.WriteByte(3);
p.WriteByte(0);
return p;
}
示例5: ChangeChannel
public static Packet ChangeChannel(Client pClient, ushort pPort)
{
Packet p = new Packet();
p.WriteShort((short)SendOpcodes.Channel_Change);
p.WriteByte(1);
p.WriteBytes(new byte[] { 8, 31, 99, 141 });
p.WriteUShort(pPort);
p.WriteByte(0);
return p;
}
示例6: ChangeSlot
public static void ChangeSlot(Packet packet, Player player)
{
uint ItmID1 = packet.ReadUInt( );
uint ItmID2 = packet.ReadUInt( );
byte Slot = packet.ReadByte( );
byte Check = packet.ReadByte( );
byte Error = 1;
if (Check == 0x01)
{
#region Parse
if (ItmID2 != 0)
{
CharItem Itm1 = player.CharData.GeneralItems.FindID(ItmID1);
CharItem Itm2 = player.CharData.GeneralItems.FindID(ItmID2);
if (Itm1.Slot == -1 || Itm2.Slot == -1)
{
Error = 0;
}
else
{
Itm1.Slot += Itm2.Slot;
Itm2.Slot = Itm1.Slot - Itm2.Slot;
Itm1.Slot -= Itm2.Slot;
}
}
else
{
CharItem Itm1 = player.CharData.GeneralItems.FindID(ItmID1);
if (Itm1.Slot == -1)
{
Error = 0;
}
else
{
Itm1.Slot = Slot;
}
}
#endregion
#region Response
Packet Response = new Packet(0x0454);
Response.WriteUInt(ItmID1);
Response.WriteUInt(ItmID2);
Response.WriteByte(Slot);
Response.WriteByte(1);
Response.WriteByte(Error);
player.Sock.Send(Response);
#endregion
}
}
示例7: AddMonsterStatus
public static void AddMonsterStatus(Packet pPacket, Mob pMob)
{
pPacket.WriteByte(0);
pPacket.WriteZero(40);
pPacket.WriteShort(5088);
pPacket.WriteShort(72);
pPacket.WriteZero(3);
pPacket.WriteByte(136);
for (int i = 0; i < 4; i++)
{
pPacket.WriteLong(0);
pPacket.WriteHexString("30 3B");
}
pPacket.WriteZero(7);
pPacket.WriteZero(12);
}
示例8: Expressing
public static void Expressing(Packet packet, Player player)
{
byte Type = packet.ReadByte( );
#region Response
Packet Response = new Packet(0x0230);
Response.WriteUInt(1); // Char ID ( if the char is the same it will be 1)
Response.WriteByte(Type);
player.Sock.Send(Response);
#endregion
#region Others
Packet Others = new Packet(0x0230);
Others.WriteUInt(player.ID);
Others.WriteByte(Type);
int MapIndex = Maps.MapsData.Find(player.CharData.Map);
if (MapIndex != -1)
{
foreach (Player x in Maps.MapsData[MapIndex].Players)
{
if (x.ID != player.ID)
x.Sock.Send(Others);
}
}
#endregion
}
示例9: Cash_Shop_Inventory
public static Packet Cash_Shop_Inventory(Client pClient)
{
Packet p = new Packet();
p.WriteShort((short)SendOpcodes.Cash_Shop_Opeartion);
p.WriteByte((byte)(Opeartion_Code + 3));
p.WriteByte(0);
p.WriteShort(0);
p.WriteInt(0);
p.WriteShort(16); // Slots
p.WriteShort(6);
p.WriteShort(0);
p.WriteShort(1);
return p;
}
示例10: SpawnMonster
public static Packet SpawnMonster(Mob pMob, int pSpawnType, int pLink, bool pAzwan)
{
Packet p = new Packet();
p.WriteShort((short)SendOpcodes.Monster_Spawn);
p.WriteInt(pMob.SpawnID);
p.WriteByte(1);
p.WriteInt(pMob.MobID);
MobPacketHelper.AddMonsterStatus(p, pMob);
p.WriteShort(pMob.Position.X);
p.WriteShort(pMob.Position.Y);
p.WriteByte(pMob.Stance); // Stance, TODO.
p.WriteShort(pMob.Foothold);
p.WriteShort(pMob.OriginalFoothold);
p.WriteByte((byte)pSpawnType);
if (pSpawnType == -3 || pSpawnType >= 0)
p.WriteInt(pLink);
p.WriteByte(0); // TODO: Carnival.
p.WriteInt(125);
p.WriteZero(16);
p.WriteByte(0);
p.WriteInt(-1);
p.WriteInt(0);
p.WriteInt(46);
p.WriteInt(0);
p.WriteByte(0);
p.WriteByte(0xFF);
return p;
}
示例11: Encode
public Packet Encode()
{
Packet packet = new Packet();
packet.WriteByte(this._channel);
packet.WriteUint(this._dest_uid);
packet.WriteString(this._content);
packet.Encode(Msg.P_REQ_CHAT_SEND);
return packet;
}
示例12: Encode
public Packet Encode()
{
Packet packet = new Packet();
packet.WriteByte(this._id_u8);
ushort id_f32_count = (ushort)this._id_f32.Count;
packet.WriteUshort(id_f32_count);
for (ushort i = 0; i < id_f32_count; i++)
{
float xxx = this._id_f32[i];
packet.WriteFloat(xxx);
}
packet.WriteByte(id_op_u8_flag);
if (this.id_op_u8_flag == 1)
{
packet.WriteByte(this._id_op_u8);
}
return packet;
}
示例13: CreateCharacterResult
public static Packet CreateCharacterResult(Character pCharacter, bool pValid)
{
Packet p = new Packet();
p.WriteShort((short)SendOpcodes.Create_Character_Result);
p.WriteByte((byte)(pValid ? 0 : 1));
HelpPacket.AddCharacterImage(p, pCharacter, false, false);
return p;
}
示例14: Encode
public Packet Encode()
{
Packet packet = new Packet();
packet.WriteByte(this._channel);
packet.WriteUint(this._uid);
packet.WriteString(this._uname);
packet.WriteString(this._content);
packet.Encode(Msg.P_ACK_CHAT_SEND_OK);
return packet;
}
示例15: Cash_Shop_Gifts
public static Packet Cash_Shop_Gifts(Client pClient)
{
Packet p = new Packet();
p.WriteShort((short)SendOpcodes.Cash_Shop_Opeartion);
p.WriteByte((byte)(Opeartion_Code + 6));
p.WriteShort(0); // Gifts size.
return p;
}