本文整理汇总了C#中PacketWriter.WriteByte方法的典型用法代码示例。如果您正苦于以下问题:C# PacketWriter.WriteByte方法的具体用法?C# PacketWriter.WriteByte怎么用?C# PacketWriter.WriteByte使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PacketWriter
的用法示例。
在下文中一共展示了PacketWriter.WriteByte方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Serialize
public override void Serialize(PacketWriter pw, bool prefix)
{
base.Serialize(pw, prefix);
pw.WriteByte((byte)PacketType);
pw.WriteByte((byte)Region);
pw.WriteString(StartIP);
pw.WriteString(Filter);
}
示例2: WritePacket
public void WritePacket(PacketWriter writer)
{
writer.WriteInt64(UserID);
writer.WriteString(UserToken);
writer.WriteInt32(ClientMajorVersion);
writer.WriteInt32(ClientContentVersion);
writer.WriteInt32(ClientMinorVersion);
writer.WriteString(FingerprintHash);
writer.WriteString(Unknown1);
writer.WriteString(OpenUDID);
writer.WriteString(MacAddress);
writer.WriteString(DeviceModel);
writer.WriteInt32(LocaleKey);
writer.WriteString(Language);
writer.WriteString(AdvertisingGUID);
writer.WriteString(OSVersion);
writer.WriteByte(Unknown2);
writer.WriteString(Unknown3);
writer.WriteString(AndroidDeviceID);
writer.WriteString(FacebookDistributionID);
writer.WriteBoolean(IsAdvertisingTrackingEnabled);
writer.WriteString(VendorGUID);
writer.WriteInt32(Seed);
}
示例3: WritePacket
public void WritePacket(PacketWriter writer)
{
writer.WriteInt32(MessageType);
writer.WriteInt32(Unknown1);
writer.WriteUInt32(ServerTick);
writer.WriteByte(Unknown2);
switch (MessageType)
{
case 1:
break;
case 2:
writer.WriteInt64(UserID);
writer.WriteInt64(UserID2);
writer.WriteString(Username);
writer.WriteInt32(Unknown3);
writer.WriteInt32(Unknown4);
writer.WriteInt32((int)MemberStatus);
writer.WriteInt32((int)MessageTime.TotalSeconds);
writer.WriteString(Message);
break;
default:
break;
}
}
示例4: Serialize
public override void Serialize(PacketWriter writer, bool prefix)
{
base.Serialize (writer, prefix);
writer.WriteByte((byte)PlayerList.Length);
foreach (var player in PlayerList) {
player.Serialize(writer);
}
}
示例5: Create
/// <summary>
/// The create.
/// </summary>
/// <param name="channel">
/// </param>
/// <param name="playerid">
/// </param>
/// <param name="message">
/// </param>
/// <param name="blob">
/// </param>
/// <returns>
/// </returns>
public static byte[] Create(ChannelBase channel, uint playerid, string message, string blob)
{
PacketWriter writer = new PacketWriter(65);
writer.WriteByte((byte)channel.channelType);
writer.WriteUInt32(channel.ChannelId);
writer.WriteUInt32(playerid);
writer.WriteString(message);
writer.WriteString(blob);
return writer.Finish();
}
示例6: Create
/// <summary>
/// </summary>
/// <param name="channelType">
/// </param>
/// <param name="channelId">
/// </param>
/// <param name="channelName">
/// </param>
/// <param name="flags">
/// </param>
/// <param name="otherData">
/// </param>
/// <returns>
/// </returns>
public static byte[] Create(
ChannelType channelType,
uint channelId,
string channelName,
ChannelFlags flags,
byte[] otherData)
{
PacketWriter writer = new PacketWriter(60);
writer.WriteByte((byte)channelType);
writer.WriteUInt32(channelId);
writer.WriteString(channelName);
writer.WriteUInt32((UInt32)flags);
writer.WriteBytes(otherData);
return writer.Finish();
}
示例7: Create
/// <summary>
/// The create.
/// </summary>
/// <param name="playerid">
/// </param>
/// <param name="message">
/// </param>
/// <param name="chatType">
/// The chat Type.
/// </param>
/// <returns>
/// </returns>
public static byte[] Create(uint playerid, string message, byte chatType)
{
PacketWriter writer = new PacketWriter(34);
writer.WriteUInt32(playerid);
writer.WriteString(message);
// Blob start
// This blob is actually byte array,
// but we have only one byte to send with it
// so I didn't add array stuff
// and made it always one byte.
writer.WriteUInt16(1);
writer.WriteByte(chatType);
// Blob ends
return writer.Finish();
}
示例8: WritePacket
public void WritePacket(PacketWriter writer)
{
writer.WriteInt32(WarEntries.Count);
for (int i = 0; i < WarEntries.Count; i++)
{
var log = WarEntries[i];
writer.WriteInt64(log.HomeClanID);
writer.WriteString(log.HomeClanName);
writer.WriteInt32(log.HomeClanBadge);
writer.WriteInt32(log.HomeClanLevel);
writer.WriteInt64(log.EnemyClanID);
writer.WriteString(log.EnemyClanName);
writer.WriteInt32(log.EnemyClanBadge);
writer.WriteInt32(log.EnemyClanLevel);
writer.WriteInt32(log.HomeClanStarsWon);
writer.WriteInt32(log.EnemyClanStarsWon);
writer.WriteInt32((int)log.HomeClanPercentage * 20); // TODO: Find a more consistent solution.
writer.WriteInt32((int)log.EnemyClanPercentage * 20);
writer.WriteInt32(log.Unknown1);
writer.WriteInt32(log.Unknown2);
writer.WriteInt32(log.HomeAttacksUsed);
writer.WriteInt32(log.HomeClanPointsGained);
writer.WriteInt64(log.Unknown3);
writer.WriteInt32(log.WarSize);
writer.WriteInt32(log.WarResult);
writer.WriteInt32(log.Unknown4);
writer.WriteInt32(log.Unknown5);
writer.WriteInt32(log.Unknown6);
writer.WriteByte(log.Unknown7);
}
}
示例9: WriteCommand
public void WriteCommand(PacketWriter writer)
{
writer.WriteInt32(BuildingID);
writer.WriteByte(Unknown1);
writer.WriteInt32(Unknown2);
}
示例10: WritePacket
public void WritePacket(PacketWriter writer)
{
writer.WriteByte(Unknown1);
writer.WriteInt64(UserID);
}
示例11: Move
public void Move(int x, int y)
{
PacketWriter p = new PacketWriter((short)SendOps.MOVE_PLAYER);
p.WriteZero(9); //skipped in moopledev
p.WriteByte(1); //loop count
p.WriteByte(11); //Chair ;)
p.WriteShort((short)x);
p.WriteShort((short)y);
p.WriteShort(); //fh
p.WriteByte(4); //stance
p.WriteShort(10000); //duration
//no trail bc un parsed in moopledev
//X = x;
//Y = y;
MainGame.Instance.Socket.Send(p);
}
示例12: WritePacket
public void WritePacket(PacketWriter writer)
{
writer.WriteInt32((int)FailureReason);
if (Fingerprint != null)
writer.WriteString(Fingerprint.ToJson());
writer.WriteString(HostName);
writer.WriteString(RackcdnUrl);
writer.WriteString(iTunesUrl);
writer.WriteString(Unknown1);
writer.WriteString(Unknown2);
writer.WriteByte(Unknown3);
writer.WriteByteArray(CompressedFingerprintJson);
writer.WriteString(Unknown4);
}
示例13: WritePacket
public void WritePacket(PacketWriter writer)
{
writer.WriteInt32(ClanWarStage);
writer.WriteInt32(TimeLeftSeconds);
Home.Write(writer);
Enemy.Write(writer);
writer.WriteInt32(Unknown1);
writer.WriteInt32(Unknown2);
writer.WriteInt32(WarEventCount);
for (int i = 0; i < WarEventCount; i++)
{
var entry = WarEvents[i];
writer.WriteInt32(entry.Unknown1);
writer.WriteInt32(entry.Unknown2);
writer.WriteInt32(entry.ReplayID);
writer.WriteInt32(entry.TimeLeftSeconds);
writer.WriteInt64(entry.AttackerClanID);
writer.WriteInt64(entry.AttackerID);
writer.WriteInt64(entry.DefenderClanID);
writer.WriteInt64(entry.DefenderID);
writer.WriteString(entry.AttackerName);
writer.WriteString(entry.DefenderName);
writer.WriteInt32(entry.StarsWon);
writer.WriteInt32(entry.StarsEarned);
writer.WriteInt32(entry.Damage);
writer.WriteInt32(entry.Unknown3);
writer.WriteInt32(entry.Unknown4);
writer.WriteInt32(entry.Unknown5);
writer.WriteInt32(entry.Unknown6);
writer.WriteByte(entry.Unknown7);
writer.WriteInt32(entry.Unknown8);
writer.WriteInt32(entry.Unknown9);
writer.WriteInt32(entry.Unknown10);
writer.WriteInt32(entry.Unknown11);
}
}
示例14: Write
public void Write(PacketWriter writer)
{
writer.WriteInt64(ClanID);
writer.WriteString(ClanName);
writer.WriteInt32(ClanBadge);
writer.WriteInt32(ClanLevel);
writer.WriteInt32(PlayerCount);
for (int i = 0; i < PlayerCount; i++)
{
var player = Roster[i];
writer.WriteInt64(player.ClanID);
writer.WriteInt64(player.ID1);
writer.WriteInt64(player.ID2);
writer.WriteString(player.Name);
writer.WriteInt32(player.StarsGivenUp);
writer.WriteInt32(player.Damage);
writer.WriteInt32(player.Unknown1);
writer.WriteInt32(player.AttacksUsed);
writer.WriteInt32(player.TotalDefenses);
writer.WriteInt32(player.GoldGained);
writer.WriteInt32(player.ElixirGained);
writer.WriteInt32(player.DarkElixirGained);
writer.WriteInt32(player.GoldAvailable);
writer.WriteInt32(player.ElixirAvailable);
writer.WriteInt32(player.DarkElixirAvailable);
writer.WriteInt32(player.OffenseWeight);
writer.WriteInt32(player.DefenseWeight);
writer.WriteInt32(player.Unknown2);
writer.WriteInt32(player.TownHall);
writer.WriteByte(player.Unknown3);
writer.WriteInt32(player.Unknown4);
writer.WriteInt32(player.Unknown5);
writer.WriteInt32(player.Unknown6);
writer.WriteBoolean(player.IsBattleDay);
if (player.IsBattleDay)
{
writer.WriteInt32(player.Unknown7);
writer.WriteInt32(player.Unknown8);
writer.WriteBoolean(player.HasBeenAttacked);
if (player.HasBeenAttacked)
{
writer.WriteInt32(player.Unknown9);
writer.WriteInt32(player.BestAttackReplayID);
}
}
writer.WriteInt32(player.Unknown10);
writer.WriteInt32(player.ClanCastle);
writer.WriteInt32(player.TroopCapacity);
writer.WriteString(player.RequestMessage);
writer.WriteInt32(player.TroopCount);
int listIdx = 0;
int sizeJ = (int)player.TroopsInside[listIdx++];
writer.WriteInt32(sizeJ);
for (int j = 0; j < sizeJ; j++)
{
writer.WriteInt64(player.TroopsInside[listIdx++]);
int sizeK = (int)player.TroopsInside[listIdx++];
writer.WriteInt32(sizeK);
for (int k = 0; k < sizeK; k++)
writer.WriteInt64(player.TroopsInside[listIdx++]);
}
}
}