本文整理汇总了C#中PacketWriter.WriteUInt32方法的典型用法代码示例。如果您正苦于以下问题:C# PacketWriter.WriteUInt32方法的具体用法?C# PacketWriter.WriteUInt32怎么用?C# PacketWriter.WriteUInt32使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PacketWriter
的用法示例。
在下文中一共展示了PacketWriter.WriteUInt32方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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();
}
示例2: Create
/// <summary>
/// The create.
/// </summary>
/// <param name="privategroupid">
/// </param>
/// <param name="playerid">
/// </param>
/// <returns>
/// </returns>
public static byte[] Create(uint privategroupid, uint playerid)
{
PacketWriter writer = new PacketWriter(55);
writer.WriteUInt32(privategroupid);
writer.WriteUInt32(playerid);
return writer.Finish();
}
示例3: Create
/// <summary>
/// The create.
/// </summary>
/// <param name="playerid">
/// </param>
/// <param name="online">
/// </param>
/// <param name="status">
/// </param>
/// <returns>
/// </returns>
public static byte[] Create(uint playerid, uint online, byte[] status)
{
PacketWriter writer = new PacketWriter(40);
writer.WriteUInt32(playerid);
writer.WriteUInt32(online);
writer.WriteBytes(status);
return writer.Finish();
}
示例4: Create
/// <summary>
/// The create.
/// </summary>
/// <param name="privategroupid">
/// </param>
/// <param name="playerid">
/// </param>
/// <param name="message">
/// </param>
/// <param name="blob">
/// </param>
/// <returns>
/// </returns>
public static byte[] Create(uint privategroupid, uint playerid, string message, string blob)
{
PacketWriter writer = new PacketWriter(57);
writer.WriteUInt32(privategroupid);
writer.WriteUInt32(playerid);
writer.WriteString(message);
writer.WriteString(blob);
return writer.Finish();
}
示例5: Create
/// <summary>
/// The create.
/// </summary>
/// <param name="playerid">
/// </param>
/// <param name="windowid">
/// </param>
/// <param name="messageid">
/// </param>
/// <param name="msgargs">
/// </param>
/// <returns>
/// </returns>
public static byte[] Create(uint playerid, uint windowid, uint messageid, string msgargs)
{
PacketWriter writer = new PacketWriter(37);
writer.WriteUInt32(playerid);
writer.WriteUInt32(windowid);
writer.WriteUInt32(messageid);
writer.WriteString(msgargs);
return writer.Finish();
}
示例6: 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();
}
示例7: CreateBuff
/// <summary>
/// Create 'BalanceInfo' packet
/// </summary>
/// <returns></returns>
public byte[] CreateBuff()
{
byte[] block = new byte[0x2D]; // Create our null byte array
PacketWriter PW = new PacketWriter(block); // Initialize the writer
PW.WriteByteArray(0, EngineUtils.PacketUtils.calcPacket(block.Length, 0x82F)); // Write the packet header
PW.WriteString(5, EngineEnum.PacketEnum.PacketCommand.success_0); // Writer the success string cmd
PW.WriteUInt32(29, (UInt32)_rupees); // Write the rupees number
PW.WriteUInt32(33, (UInt32)_coins); // Write the coins number
PW.WriteUInt32(37, (UInt32)_gpotatos); // Write the gpotatos number
PW.WriteUInt32(41, (UInt32)_trickpoints); // Write the trickpoints number
return block;
}
示例8: 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;
}
示例9: 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();
}
示例10: 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();
}
示例11: 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;
}
}
示例12: New
/// <summary>
/// The new.
/// </summary>
/// <param name="client">
/// </param>
/// <param name="id">
/// The id.
/// </param>
/// <returns>
/// </returns>
public static byte[] New(Client client, uint id)
{
Client tmpClient = (Client)client.Server.ConnectedClients[id];
PacketWriter writer = new PacketWriter(20);
writer.WriteUInt32(id);
writer.WriteString(tmpClient.Character.characterName);
return writer.Finish();
}
示例13: Create
/// <summary>
/// The create.
/// </summary>
/// <param name="channelid">
/// </param>
/// <param name="playerid">
/// </param>
/// <param name="message">
/// </param>
/// <param name="blob">
/// </param>
/// <returns>
/// </returns>
public static byte[] Create(byte[] channelid, uint playerid, string message, string blob)
{
PacketWriter writer = new PacketWriter(65);
writer.WriteBytes(channelid);
writer.WriteUInt32(playerid);
writer.WriteString(message);
writer.WriteString(blob);
return writer.Finish();
}
示例14: Create
/// <summary>
/// The create.
/// </summary>
/// <param name="channelid">
/// </param>
/// <param name="channelname">
/// </param>
/// <param name="flags">
/// </param>
/// <param name="otherdata">
/// </param>
/// <returns>
/// </returns>
public static byte[] Create(ulong channelid, string channelname, uint flags, byte[] otherdata)
{
PacketWriter writer = new PacketWriter(60);
writer.Write5of8(channelid);
writer.WriteString(channelname);
writer.WriteUInt32(flags);
writer.WriteBytes(otherdata);
return writer.Finish();
}
示例15: CreateBuff
// Still no multi channel handle
/// <summary>
/// Create 'ChannelList' buffer
/// </summary>
/// <returns></returns>
public byte[] CreateBuff()
{
byte[] block = new byte[0x40]; // Create our null byte array
PacketWriter PW = new PacketWriter(block); // Initialize the reader
PW.WriteByteArray(0, EngineUtils.PacketUtils.calcPacket(block.Length, 0x7D6)); // Write the packet header
PW.WriteString(5, EngineEnum.PacketEnum.PacketCommand.success_0); // Write the success string cmd
PW.WriteUInt16(29, 1); // I don't know yet what is this
PW.WriteUInt16(31, 1); // I don't know yet what is this
PW.WriteString(32, channelname); // Write channel name
PW.WriteUInt32(44, 5); // I don't know yet what is this - multichannel
PW.WriteUInt32(48, 6); // I don't know yet what is this - multichannel
PW.WriteUInt32(52, 7); // I don't know yet what is this - multichannel
PW.WriteUInt32(56, 9); // I don't know yet what is this - multichannel
PW.WriteUInt32(60, 10); // I don't know yet what is this - multichannel
if (channelname.Length > 11) // Channel name can't contains over 11 letters
{
Error.Invoke("Channel name is too long");
return null;
}
return block;
}