本文整理汇总了C#中Packet.WriteString方法的典型用法代码示例。如果您正苦于以下问题:C# Packet.WriteString方法的具体用法?C# Packet.WriteString怎么用?C# Packet.WriteString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Packet
的用法示例。
在下文中一共展示了Packet.WriteString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Write
public void Write(Packet packet)
{
packet.PutBit(IsLocal);
packet.PutBits(RealmNameActual.Length, 8);
packet.PutBits(RealmNameNormalized.Length, 8);
packet.FlushBits();
packet.WriteString(RealmNameActual);
packet.WriteString(RealmNameNormalized);
}
示例2: 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;
}
示例3: Write
public void Write(Packet packet)
{
packet.Write(TemplateSetID);
packet.Write(Classes.Count);
Classes.ForEach(c => c.Write(packet));
packet.PutBits(Name.Length, 7);
packet.PutBits(Description.Length, 10);
packet.FlushBits();
packet.WriteString(Name);
packet.WriteString(Description);
}
示例4: Encode
public Packet Encode()
{
Packet packet = new Packet();
packet.WriteString(this._uname);
packet.Encode(Msg.P_ACK_ROLE_RAND_NAME_OK);
return packet;
}
示例5: Encode
public Packet Encode()
{
Packet packet = new Packet();
packet.WriteUint(this._uid);
packet.WriteString(this._uname);
return packet;
}
示例6: Write
public void Write(Packet packet)
{
packet.Write(Status);
packet.PutBit(InfoProvided);
packet.PutBit(KeyProvided);
packet.PutBit(UrlProvided);
if (UrlProvided)
{
packet.PutBits(Url.Length, 8);
packet.FlushBits();
packet.WriteString(Url);
}
packet.FlushBits();
if (InfoProvided)
{
packet.Write(KeyVersion);
packet.Write(Revision);
}
if (KeyProvided)
packet.WriteBytes(KeyData);
}
示例7: Encode
public Packet Encode()
{
Packet packet = new Packet();
packet.WriteString(this._content);
packet.Encode(Msg.P_REQ_CHAT_GM);
return packet;
}
示例8: 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;
}
示例9: Encode
public Packet Encode()
{
Packet packet = new Packet();
packet.WriteBuffer(this._scene_rot_pos.GetBuffer());
packet.WriteBuffer(this._forward.GetBuffer());
packet.WriteString(this._ani_name);
packet.WriteShort(this._x_axis);
packet.Encode(Msg.P_REQ_SCENE_MOVE);
return packet;
}
示例10: MemberInsert
public static void MemberInsert(Packet packet, Player player)
{
string CharName = packet.ReadString(17);
int PlayerIndex = MainClass.Players.Find(CharName);
if (PlayerIndex != -1)
{
Packet Response = new Packet(0x7E03);
Response.WriteString(player.CharName, 17);
MainClass.Players[PlayerIndex].Sock.Send(Response);
}
}
示例11: PartyRequest
public static void PartyRequest(Packet packet, Player player)
{
string CharName = packet.ReadString(17);
byte Type = packet.ReadByte( );
int PlayerIndex = MainClass.Players.Find(CharName);
if (PlayerIndex != -1)
{
Packet Response = new Packet(0x0711);
Response.WriteString(player.CharName, 17);
Response.WriteByte(Type);
MainClass.Players[PlayerIndex].Sock.Send(Response);
}
}
示例12: Whisper
public static void Whisper(Packet packet, Player player)
{
string CharName = packet.ReadString(17);
byte Length = packet.ReadByte();
packet.ReadByte();
string Text = packet.ReadString(Length);
int PlayerIndex = MainClass.Players.Find(CharName);
if (PlayerIndex != -1)
{
Packet ToPacket = new Packet(0x0223);
ToPacket.WriteString(CharName, 17);
ToPacket.WriteByte(0);
ToPacket.WriteByte(1);
player.Sock.Send(ToPacket);
Packet FromPacket = new Packet(0x0224);
FromPacket.WriteString(player.CharName, 17);
FromPacket.WriteByte(0);
FromPacket.WriteByte(Length);
FromPacket.WriteString(Text, Length);
MainClass.Players[PlayerIndex].Sock.Send(FromPacket);
}
}
示例13: Encode
public Packet Encode()
{
Packet packet = new Packet();
packet.WriteUlong(this._u64);
packet.WriteString(this._strxx);
packet.WriteBuffer(this._msg_req.GetBuffer());
packet.WriteByte(msg_opt_flag);
if (this.msg_opt_flag == 1)
{
packet.WriteBuffer(this._msg_opt.GetBuffer());
}
ushort msg_rep_count = (ushort)this._msg_rep.Count;
packet.WriteUshort(msg_rep_count);
for (ushort i = 0; i < msg_rep_count; i++)
{
MsgTestPhp xxx = this._msg_rep[i];
packet.WriteBuffer(xxx.GetBuffer());
}
packet.Encode(Msg.P_ACK_TEST_PHP_OK);
return packet;
}
示例14: Write
public void Write(Packet packet)
{
InventoryItems.Initialize();
packet.Write(Guid);
packet.Write(ListPosition);
packet.Write(RaceID);
packet.Write(ClassID);
packet.Write(SexID);
packet.Write(SkinID);
packet.Write(FaceID);
packet.Write(HairStyle);
packet.Write(HairColor);
packet.Write(FacialHairStyle);
packet.Write(ExperienceLevel);
packet.Write(ZoneID);
packet.Write(MapID);
packet.Write(PreloadPos);
packet.Write(GuildGUID);
packet.Write(Flags);
packet.Write(Flags2);
packet.Write(Flags3);
packet.Write(PetCreatureDisplayID);
packet.Write(PetExperienceLevel);
packet.Write(PetCreatureFamilyID);
foreach (var professionID in ProfessionIDs)
packet.Write(professionID);
foreach (var inventoryItem in InventoryItems)
inventoryItem.Write(packet);
packet.PutBits(Name.Length, 6);
packet.PutBit(FirstLogin);
packet.PutBit(BoostInProgress);
packet.PutBits(0, 5);
packet.FlushBits();
packet.WriteString(Name);
}
示例15: Encode
public Packet Encode()
{
Packet packet = new Packet();
packet.WriteUint(this._uid);
packet.WriteUint(this._uuid);
packet.WriteUshort(this._sid);
packet.WriteUshort(this._cid);
packet.WriteString(this._os);
packet.WriteString(this._version);
packet.WriteString(this._uname);
packet.WriteString(this._source);
packet.WriteString(this._source_sub);
packet.WriteUint(this._login_time);
packet.Encode(Msg.P_REQ_ROLE_CREATE);
return packet;
}