本文整理汇总了C#中PacketWriter.WriteString方法的典型用法代码示例。如果您正苦于以下问题:C# PacketWriter.WriteString方法的具体用法?C# PacketWriter.WriteString怎么用?C# PacketWriter.WriteString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PacketWriter
的用法示例。
在下文中一共展示了PacketWriter.WriteString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WritePacket
public void WritePacket(PacketWriter writer)
{
writer.WriteInt32(SeasonEndsSeconds);
var count = LeagueMemberList.Count;
for (int i = 0; i < count; i++)
{
var leagueMember = LeagueMemberList[i];
writer.WriteInt64(leagueMember.UserID);
writer.WriteString(leagueMember.Username);
writer.WriteInt32(leagueMember.Rank);
writer.WriteInt32(leagueMember.Trophies);
writer.WriteInt32(leagueMember.LastRank);
writer.WriteInt32(leagueMember.Unknown3);
writer.WriteInt32(leagueMember.AttacksWon);
writer.WriteInt32(leagueMember.Unknown5);
writer.WriteInt32(leagueMember.DefensesWon);
writer.WriteInt32(leagueMember.Unknown7);
writer.WriteInt32(leagueMember.Unknown8);
writer.WriteInt32(leagueMember.Unknown9);
writer.WriteInt32(leagueMember.Unknown10);
writer.WriteInt32(leagueMember.Unknown11);
writer.WriteBoolean(leagueMember.HasClan);
if (leagueMember.HasClan)
{
writer.WriteInt64(leagueMember.ClanID);
writer.WriteString(leagueMember.ClanName);
writer.WriteInt32(leagueMember.Unknown12);
}
writer.WriteInt32(leagueMember.Unknown13);
writer.WriteInt32(leagueMember.Unknown14);
}
}
示例2: WritePacket
public void WritePacket(PacketWriter writer)
{
writer.WriteInt32(Unknown1);
writer.WriteInt32(Friends.Count);
for (int i = 0; i < Friends.Count; i++)
{
var friend = Friends[i];
writer.WriteInt64(friend.UserID1);
writer.WriteInt64(friend.UserID2);
writer.WriteString(friend.Username);
writer.WriteString(friend.FacebookID);
writer.WriteString(friend.Unknown3);
writer.WriteInt32(friend.Unknown4);
writer.WriteInt32(friend.Level);
writer.WriteInt32(friend.Unknown6);
writer.WriteInt32(friend.Trophies);
writer.WriteBoolean(friend.HasClan);
if (friend.HasClan)
{
writer.WriteInt64(friend.ClanID);
writer.WriteInt32(friend.ClanUnknown1);
writer.WriteString(friend.ClanName);
writer.WriteInt32(friend.ClanRole);
writer.WriteInt32(friend.ClanLevel);
}
}
}
示例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: WritePacket
public void WritePacket(PacketWriter writer)
{
writer.WriteInt32(RankList.Count);
for (int i = 0; i < RankList.Count; i++)
{
var memberInfo = RankList[i];
writer.WriteInt64(memberInfo.Unknown1);
writer.WriteString(memberInfo.Name);
writer.WriteInt32(memberInfo.Rank);
writer.WriteInt32(memberInfo.Trophies);
writer.WriteInt32(memberInfo.Unknown2);
writer.WriteInt32(memberInfo.Level);
writer.WriteInt32(memberInfo.AttacksWon);
writer.WriteInt32(memberInfo.AttacksLost);
writer.WriteInt32(memberInfo.DefencesWon);
writer.WriteInt32(memberInfo.DefencesLost);
writer.WriteInt32(memberInfo.Unknown3);
writer.WriteString(memberInfo.CountryCode);
writer.WriteInt64(memberInfo.Unknown4);
writer.WriteInt64(memberInfo.Unknown5);
if (memberInfo.Clan != null)
{
writer.WriteBoolean(true);
writer.WriteInt64(memberInfo.Clan.ID);
writer.WriteString(memberInfo.Clan.Name);
writer.WriteInt32(memberInfo.Clan.Badge);
}
}
}
示例5: Create
/// <summary>
/// The create.
/// </summary>
/// <param name="arg1">
/// </param>
/// <param name="msg">
/// </param>
/// <param name="blob">
/// </param>
/// <returns>
/// </returns>
public static byte[] Create(string arg1, string msg, string blob)
{
PacketWriter writer = new PacketWriter(35);
writer.WriteString(arg1);
writer.WriteString(msg);
writer.WriteString(blob);
return writer.Finish();
}
示例6: Create
// Tell
/// <summary>
/// The create.
/// </summary>
/// <param name="playerid">
/// </param>
/// <param name="message">
/// </param>
/// <param name="blob">
/// </param>
/// <returns>
/// </returns>
public static byte[] Create(uint playerid, string message, string blob)
{
PacketWriter writer = new PacketWriter(30);
writer.WriteUInt32(playerid);
writer.WriteString(message);
writer.WriteString(blob);
return writer.Finish();
}
示例7: Serialize
public override void Serialize(PacketWriter writer, bool prefix)
{
writer.WriteShort((short)ServerRules.Length);
foreach (var rule in ServerRules) {
writer.WriteString(rule.CVar);
writer.WriteString(rule.Value);
}
}
示例8: 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);
}
示例9: 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();
}
示例10: WritePacket
public void WritePacket(PacketWriter writer)
{
writer.WriteInt64(UserID);
writer.WriteInt64(UserID1);
writer.WriteString(UserToken);
writer.WriteString(FacebookID);
writer.WriteString(GameCenterID);
writer.WriteInt32(MajorVersion);
writer.WriteInt32(MinorVersion);
writer.WriteInt32(RevisionVersion);
writer.WriteString(ServerEnvironment);
writer.WriteInt32(LoginCount);
writer.WriteInt32((int)PlayTime.TotalSeconds);
writer.WriteInt32(Unknown1);
writer.WriteString(FacebookAppID);
writer.WriteString(DateTimeConverter.ToJavaTimestamp(DateLastPlayed).ToString()); // should round stuff?
writer.WriteString(DateTimeConverter.ToJavaTimestamp(DateJoined).ToString());
writer.WriteInt32(Unknown2);
writer.WriteString(GooglePlusID);
writer.WriteString(CountryCode);
}
示例11: CreateBuff
/// <summary>
/// Create 'PlayerCharacterList' packet
/// </summary>
/// <returns></returns>
public byte[] CreateBuff()
{
byte[] block = new byte[0x120]; // Create our null byte array
PacketWriter PW = new PacketWriter(block); // Initialize the writer
PW.WriteByteArray(0, EngineUtils.PacketUtils.calcPacket(block.Length, 0x90E)); // Write the packet header
PW.WriteString(5, EngineEnum.PacketEnum.PacketCommand.success_0); // Write the success string cmd
PW.WriteString(30, charname); // Write the character name, you can use some html code like: <#ff0000> and <glow>
PW.WriteInt32(73, lastlogin ? 1 : 0); // Push the player in the account creation tab
PW.WriteUInt32(75, 0); // I don't know yet what is it
PW.WriteUInt32(79, (UInt32)chartype); // Write the selected character
PW.WriteUInt32(83, 0); // I don't know yet what is it
return block;
}
示例12: Create
/// <summary>
/// The create.
/// </summary>
/// <param name="playerid">
/// </param>
/// <param name="playername">
/// </param>
/// <returns>
/// </returns>
public static byte[] Create(uint playerid, string playername)
{
PacketWriter writer = new PacketWriter(21);
writer.WriteUInt32(playerid);
writer.WriteString(playername);
return writer.Finish();
}
示例13: Create
/// <summary>
/// </summary>
/// <param name="username">
/// </param>
/// <returns>
/// </returns>
public static byte[] Create(string username)
{
PacketWriter writer = new PacketWriter(0x07);
IEnumerable<DBCharacter> chars = CharacterDao.Instance.GetAllForUser(username);
byte[] numberOfCharacters = BitConverter.GetBytes(IPAddress.HostToNetworkOrder((Int16)chars.Count()));
writer.WriteBytes(numberOfCharacters);
foreach (DBCharacter character in chars)
{
writer.WriteUInt32((UInt32)character.Id);
}
writer.WriteBytes(numberOfCharacters);
foreach (DBCharacter character in chars)
{
writer.WriteString(character.Name);
}
writer.WriteBytes(numberOfCharacters);
foreach (DBCharacter character in chars)
{
writer.WriteUInt32((UInt32)StatDao.Instance.GetById(50000, character.Id, 54).StatValue);
}
writer.WriteBytes(numberOfCharacters);
foreach (DBCharacter character in chars)
{
writer.WriteUInt32((uint)CharacterDao.Instance.IsOnline(character.Id));
}
return writer.Finish();
}
示例14: Create
/// <summary>
/// The new.
/// </summary>
/// <param name="client">
/// </param>
/// <param name="id">
/// The id.
/// </param>
/// <returns>
/// </returns>
public static byte[] Create(Client client, uint id)
{
PacketWriter writer = new PacketWriter(20);
writer.WriteUInt32(id);
writer.WriteString(client.Character.characterName);
return writer.Finish();
}
示例15: WriteCommand
public void WriteCommand(PacketWriter writer)
{
writer.WriteInt32(Unknown1);
writer.WriteBoolean(HashRequestMessage);
if (HashRequestMessage)
writer.WriteString(Message);
}