// TODO: map debug public static void AddTileDescription(Connection connection, NetworkMessage message, Tile tile) { if (tile != null) { int count = 0; if (tile.Ground != null) { message.AddItem(tile.Ground); ++count; } foreach (Item item in tile.GetTopItems()) { message.AddItem(item); ++count; } foreach (Creature creature in tile.Creatures) { if (true)// (player->canSeeCreature(*cit)) { uint removeKnown; bool known = connection.IsCreatureKnown(creature.Id, out removeKnown); message.AddCreature(creature, known, removeKnown); count++; } } foreach (Item item in tile.GetDownItems()) { message.AddItem(item); ++count; } } }
public static void Add ( NetworkMessage message, byte containerIndex, Item item ) { message.AddByte((byte)ServerPacketType.ContainerAddItem); message.AddByte(containerIndex); message.AddItem(item); }
public static void Add( NetworkMessage message, Location location, byte stackPosition, Item item ) { message.AddByte((byte)ServerPacketType.TileAddThing); message.AddLocation(location); message.AddByte(stackPosition); message.AddItem(item); }
public static void Add( NetworkMessage message, byte containerIndex, byte containerPosition, Item item ) { message.AddByte((byte)ServerPacketType.ContainerUpdateItem); message.AddByte(containerIndex); message.AddByte(containerPosition); message.AddItem(item); }
public static void Add ( NetworkMessage message, Location location, byte stackPosition, Item item ) { message.AddByte((byte)ServerPacketType.TileAddThing); message.AddLocation(location); message.AddByte(stackPosition); message.AddItem(item); }
public static void Add ( NetworkMessage message, byte containerId, ushort containerSpriteId, string containerName, byte volume, bool hasParent, IEnumerable <Item> items ) { message.AddByte((byte)ServerPacketType.ContainerOpen); message.AddByte(containerId); message.AddUInt16(containerSpriteId); message.AddString(containerName); message.AddByte(volume); message.AddByte(Convert.ToByte(hasParent)); message.AddByte((byte)items.Count()); foreach (Item item in items) { message.AddItem(item); } }
// TODO: map debug public static void AddTileDescription(Connection connection, NetworkMessage message, Tile tile) { if (tile != null) { int count = 0; if (tile.Ground != null) { message.AddItem(tile.Ground); ++count; } foreach (Item item in tile.GetTopItems()) { message.AddItem(item); ++count; } foreach (Creature creature in tile.Creatures) { if (true)// (player->canSeeCreature(*cit)) { uint removeKnown; bool known = connection.IsCreatureKnown(creature.Id, out removeKnown); message.AddCreature(creature, known, removeKnown); count++; } } foreach (Item item in tile.GetDownItems()) { message.AddItem(item); ++count; } } }
public static void Add(NetworkMessage message, SlotType slot, Item item) { message.AddByte((byte)ServerPacketType.InventorySetSlot); message.AddByte((byte)slot); message.AddItem(item); }
public static void Add(NetworkMessage message, SlotType slot, Item item) { message.AddByte((byte)ServerPacketType.InventorySetSlot); message.AddByte((byte)slot); message.AddItem(item); }