/* Thor Server 2.0 Project - Codenamed "Stockholm" Copyright 2008 - 2009 Joe Hegarty This file is part of The Thor Server 2.0 Project - Codenamed "Stockholm". The Thor Server 2.0 Project - Codenamed "Stockholm" is free software: you can redistribute it and/or modify it under the terms of the Microsoft Public License The Thor Server Project is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Microsoft Public License for more details. You should have received a copy of the Microsoft Public License along with The Thor Server Project. If not, see http://www.opensource.org/licenses/ms-pl.html */ using System; using StockholmLibrary.Net; using StockholmLibrary.Data; namespace StockholmLibrary.Game.Packets.Server { //------------------------------------ public class FlatInfoPacket : ServerPacket { private Room _room; //********************************************** public FlatInfoPacket(Room room) { _packetType = EServerPacket.FLATINFO; _room = room; } //********************************************** protected override void SerialiseBody() { WriteBoolWired(_room.SuperUsers); WriteIntWired(_room.RoomStatus); WriteIntWired(_room.RoomID); if (_room.ShowOwner != null && (bool)_room.ShowOwner) { WriteStringRaw(_room.User.Username); } WriteListDelimiter(); WriteStringRaw(_room.RoomModel.ModelName); WriteListDelimiter(); WriteStringRaw(_room.RoomName); WriteListDelimiter(); WriteStringRaw(_room.RoomDescription); WriteListDelimiter(); WriteBoolWired(_room.ShowOwner); WriteBoolWired(_room.RoomCategory.CanTrade); WriteIntWired(0); // TODO: Current Users WriteIntWired(_room.MaxGuests); } } }