本文整理汇总了C#中FrameWork.PacketOut.WriteInt32方法的典型用法代码示例。如果您正苦于以下问题:C# PacketOut.WriteInt32方法的具体用法?C# PacketOut.WriteInt32怎么用?C# PacketOut.WriteInt32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FrameWork.PacketOut
的用法示例。
在下文中一共展示了PacketOut.WriteInt32方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BuildCharactersList
public static byte[] BuildCharactersList(int AccountId)
{
Log.Debug("BuildCharactersList", "AcocuntId = " + AccountId);
Character[] Chars = GetAccountChar(AccountId)._Chars;
int count = 0;
PacketOut Out = new PacketOut(0);
Out.Position = 0;
Character Char = null;
for (int k = 0; k < MAX_SLOT; ++k)
{
Char = Chars[k];
if (Char != null)
{
List<Character_items> Items = CharMgr.GetItemChar(Char.CharacterId);
/**** char slot start ****/
Out.FillString(Char.Name, 48); // name
Out.WriteByte(Char.Value[0].Level); // Level
Out.WriteByte(Char.Career); //career
Out.WriteByte(Char.Realm); // realm
Out.WriteByte(Char.Sex); // gender
Out.WriteUInt16R(Char.ModelId); //model id
Out.WriteUInt16R(Char.Value[0].ZoneId); // zone id
Out.Fill(0, 12); // unk
Character_items Item = null;
for (UInt16 SlotId = 14; SlotId < 30; ++SlotId)
{
Item = Items.Find(item => item != null && item.SlotId == SlotId);
if (Item == null)
{
Out.WriteInt32(0);
Out.WriteInt32(0);
}
else
{
Out.WriteInt32((int)Item.ModelId);
Out.WriteUInt16R(0); // primary dye
Out.WriteUInt16R(0); // secondary dye
}
}
Out.WriteUInt32(0x00); // 0x00000000
for (int i = 0; i < 4; i++)
{
Out.WriteUInt32(0xFF000000);
Out.WriteUInt32(0x00);
}
Out.WriteUInt32(0xFF000000);
//weapons
for (UInt16 SlotId = 10; SlotId < 13; ++SlotId)
{
Item = Items.Find(item => item != null && item.SlotId == SlotId);
if (Item == null)
Out.WriteUInt32(0);
else
{
Out.WriteUInt16R((ushort)Item.ModelId);
Out.WriteUInt16(0);
}
}
Out.Fill(0, 8);
Out.WriteUInt16(0xFF00);
Out.WriteByte(0);
Out.WriteByte(Char.Race); // char slot position
Out.WriteUInt16(0x00); //unk
/* //Traits [8 bytes]
Out.WriteByte(1); //face
Out.WriteByte(4); //jewel
Out.WriteByte(4); //scar
Out.WriteByte(0); //hair
Out.WriteByte(3); //hair color
Out.WriteByte(2); //skin color
Out.WriteByte(0); //eye color
Out.WriteByte(5); //metal color
*/
Out.Write(Char.bTraits, 0, Char.bTraits.Length);
Out.Fill(0, 14); //unk
count++;
}
}
for (int i = 0; i < (MAX_SLOT - count); ++i)
Out.Write(new byte[284], 0, 284);
return Out.ToArray();
}