本文整理汇总了C#中NetworkMessage.GetOutfit方法的典型用法代码示例。如果您正苦于以下问题:C# NetworkMessage.GetOutfit方法的具体用法?C# NetworkMessage.GetOutfit怎么用?C# NetworkMessage.GetOutfit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NetworkMessage
的用法示例。
在下文中一共展示了NetworkMessage.GetOutfit方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ParseMessage
public override bool ParseMessage(NetworkMessage msg, PacketDestination destination)
{
int position = msg.Position;
if (msg.GetByte() != (byte)IncomingPacketType.OutfitWindow)
return false;
Destination = destination;
Type = IncomingPacketType.OutfitWindow;
Default = msg.GetOutfit();
byte count = msg.GetByte();
OutfitList = new List<AvalibleOutfit> { };
for (int i = 0; i < count; i++)
{
AvalibleOutfit outfit = new AvalibleOutfit();
outfit.Id = msg.GetUInt16();
outfit.Name = msg.GetString();
outfit.Addons = msg.GetByte();
OutfitList.Add(outfit);
}
return true;
}
示例2: ParseMessage
public override bool ParseMessage(NetworkMessage msg, PacketDestination destination)
{
if (msg.GetByte() != (byte)IncomingPacketType.TileAddThing)
return false;
Destination = destination;
Type = IncomingPacketType.TileAddThing;
Location = msg.GetLocation();
Stack = msg.GetByte();
ThingId = msg.GetUInt16();
if (ThingId == 0x0061 || ThingId == 0x0062)
{
Creature = new PacketCreature(Client);
if (ThingId == 0x0062)
{
Creature.Type = PacketCreatureType.Known;
Creature.Id = msg.GetUInt32();
}
else if (ThingId == 0x0061)
{
Creature.Type = PacketCreatureType.Unknown;
Creature.RemoveId = msg.GetUInt32();
Creature.Id = msg.GetUInt32();
Creature.Name = msg.GetString();
}
Creature.Health = msg.GetByte();
Creature.Direction = msg.GetByte();
Creature.Outfit = msg.GetOutfit();
Creature.LightLevel = msg.GetByte();
Creature.LightColor = msg.GetByte();
Creature.Speed = msg.GetUInt16();
Creature.Skull = (Constants.Skull)msg.GetByte();
Creature.PartyShield = (PartyShield)msg.GetByte();
}
else if (ThingId == 0x0063)
{
Creature = new PacketCreature(Client);
Creature.Type = PacketCreatureType.Turn;
Creature.Id = msg.GetUInt32();
Creature.Direction = msg.GetByte();
}
else
{
Item = new Pokemon.Objects.Item(Client, ThingId);
Item.Location = Pokemon.Objects.ItemLocation.FromLocation(Location);
if (Item.HasExtraByte)
Item.Count = msg.GetByte();
}
return true;
}
示例3: ParseMessage
public override bool ParseMessage(NetworkMessage msg, PacketDestination destination)
{
if (msg.GetByte() != (byte)OutgoingPacketType.SetOutfit)
return false;
Destination = destination;
Type = OutgoingPacketType.SetOutfit;
Outfit = msg.GetOutfit();
return true;
}
示例4: ParseMessage
public override bool ParseMessage(NetworkMessage msg, PacketDestination destination)
{
int position = msg.Position;
if (msg.GetByte() != (byte)IncomingPacketType.CreatureOutfit)
return false;
Destination = destination;
Type = IncomingPacketType.CreatureOutfit;
CreatureId = msg.GetUInt32();
Outfit = msg.GetOutfit();
return true;
}
示例5: ParseThing
protected bool ParseThing(NetworkMessage msg, Location pos, Tile tile, int n, NetworkMessage outMsg)
{
//get thing type
ushort thingId = msg.GetUInt16();
outMsg.AddUInt16(thingId);
PacketCreature c;
if (thingId == 0x0061 || thingId == 0x0062)
{
c = new PacketCreature(Client);
c.Location = pos;
//creatures
if (thingId == 0x0062) //creature is known
{
c.Type = PacketCreatureType.Known;
c.Id = msg.GetUInt32();
outMsg.AddUInt32(c.Id); //creatureid
}
else if (thingId == 0x0061)
{ //creature is not known
//perhaps we have to remove a known creature
c.RemoveId = msg.GetUInt32();
outMsg.AddUInt32(c.RemoveId);
//add a new creature
c.Type = PacketCreatureType.Unknown;
c.Id = msg.GetUInt32();
outMsg.AddUInt32(c.Id);
c.Name = msg.GetString();
outMsg.AddString(c.Name);
}
//read creature properties
c.Health = msg.GetByte();
outMsg.AddByte(c.Health);
c.Direction = msg.GetByte();
outMsg.AddByte(c.Direction);
c.Outfit = msg.GetOutfit();
outMsg.AddOutfit(c.Outfit);
c.LightLevel = msg.GetByte();
outMsg.AddByte(c.LightLevel);
c.LightColor = msg.GetByte();
outMsg.AddByte(c.LightColor);
c.Speed = msg.GetUInt16();
outMsg.AddUInt16(c.Speed);
c.Skull = (Constants.Skull)msg.GetByte();
outMsg.AddByte((byte)c.Skull);
c.PartyShield = (Constants.PartyShield)msg.GetByte();
outMsg.AddByte((byte)c.PartyShield);
creatures.Add(c);
return true;
}
else if (thingId == 0x0063)
{
//creature turn
c = new PacketCreature(Client);
c.Location = pos;
c.Type = PacketCreatureType.Turn;
c.Id = msg.GetUInt32();
outMsg.AddUInt32(c.Id);
c.Direction = msg.GetByte();
outMsg.AddByte(c.Direction);
creatures.Add(c);
return true;
}
else
{
//item
UInt16 itemId;
if (thingId == UInt16.MaxValue)
{
itemId = msg.GetUInt16();
outMsg.AddUInt16(itemId);
}
else
itemId = thingId;
Item item = new Item(Client, itemId, 0, "", ItemLocation.FromLocation(pos, (byte)n));
if (item.HasExtraByte)
{
item.Count = msg.GetByte();
outMsg.AddByte(item.Count);
}
//.........这里部分代码省略.........