示例#1
0
        public override void Add(NetworkMessage message)
        {
            message.AddByte(PacketType);

            message.AddLocation(Location);
            message.AddCreature(Creature, AsKnown, RemoveThisCreatureId);
        }
示例#2
0
        // 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,
            Location location,
            byte stackPosition,
            Creature creature,
            bool known,
            uint removeKnown
        )
        {
            message.AddByte((byte)ServerPacketType.TileAddThing);

            message.AddLocation(location);
            message.AddByte(stackPosition);
            message.AddCreature(creature, known, removeKnown);
        }