Esempio n. 1
0
 public GameItemHandler(Room room)
 {
     this.room = room;
     this.rnd = new Random();
     this.banzaiPyramids = new QueuedDictionary<uint, RoomItem>();
     this.banzaiTeleports = new QueuedDictionary<uint, RoomItem>();
 }
Esempio n. 2
0
 internal void Init(Int32 pBaseId, Int32 pRoomUserId, UInt32 pRoomId, RoomUser user, Room room)
 {
     this.BaseId = pBaseId;
     this.RoomUserId = pRoomUserId;
     this.RoomId = pRoomId;
     this.roomUser = user;
     this.room = room;
 }
Esempio n. 3
0
 internal void Destroy()
 {
     if (banzaiTeleports != null)
         banzaiTeleports.Destroy();
     if (banzaiPyramids != null)
         banzaiPyramids.Clear();
     banzaiPyramids = null;
     banzaiTeleports = null;
     room = null;
     rnd = null;
 }
Esempio n. 4
0
        public RoomUnitManager(Room room)
        {
            //this.RoomUserCounter = 0;
            this.room = room;
            this._unitList = new QueuedDictionary<int, RoomUnit>(new EventHandler(UnitList_onAdd), null, new EventHandler(UnitList_onRemove), null);

            this.usersByUserID = new Hashtable();
            this.primaryPrivateUserID = 0;
            this.secondaryPrivateUserID = 0;
            this.ToRemove = new List<RoomUser>(room.UsersMax);

            this.petCount = 0;
            this.userCount = 0;
        }
Esempio n. 5
0
        public GameMap(Room room)
        {
            this.room = room;
            this.DiagonalEnabled = true;
            this.mStaticModel = FirewindEnvironment.GetGame().GetRoomManager().GetModel(room.ModelName, room.RoomId);
            if (mStaticModel == null)
                throw new Exception("No modeldata found for roomID " + room.RoomId);
            this.mDynamicModel = new DynamicRoomModel(this.mStaticModel);

            this.mCoordinatedItems = new Hashtable();

            this.mGameMap = new byte[Model.MapSizeX, Model.MapSizeY];
            this.mItemHeightMap = new double[Model.MapSizeX, Model.MapSizeY];
            _unitMap = new Hashtable();
        }
Esempio n. 6
0
        internal static UInt32 GetTeleRoomId(UInt32 TeleId, Room pRoom)
        {
            if (pRoom.GetRoomItemHandler().GetItem(TeleId) != null)
                return pRoom.RoomId;

            using (IQueryAdapter dbClient = FirewindEnvironment.GetDatabaseManager().getQueryreactor())
            {
                dbClient.setQuery("SELECT room_id FROM items_rooms WHERE item_id = " + TeleId);
                DataRow Row = dbClient.getRow();

                if (Row == null)
                {
                    return 0;
                }

                return Convert.ToUInt32(Row[0]);
            }
        }
        internal static ChatMessage CreateMessage(string message, GameClient user, Room room)
        {
            int userID = user.GetHabbo().Id;
            string username = user.GetHabbo().Username;
            uint roomID = room.RoomId;
            string roomName = room.Name;
            DateTime timeSpoken = DateTime.Now;

            ChatMessage chatMessage = new ChatMessage(userID, username, roomID, roomName, message, timeSpoken);

            using (IQueryAdapter dbClient = FirewindEnvironment.GetDatabaseManager().getQueryreactor())
            {
                dbClient.setQuery("INSERT into `chatlogs`(`user_id`, `room_id`, `hour`, `minute`, `full_date`, `timestamp`, `message`, `user_name`) VALUES(" + userID + ", " + roomID + ", " + timeSpoken.Hour + ", " + timeSpoken.Minute + ", '" + timeSpoken.ToString() + "', " + FirewindEnvironment.GetUnixTimestamp() + ", @msg, '" + user.GetHabbo().Username + "');");
                dbClient.addParameter("msg", message);
                dbClient.runQuery();
            }

            return chatMessage;
        }
Esempio n. 8
0
        public RoomItemHandling(Room room)
        {
            this.room = room;

            this.mRemovedItems = new Hashtable();
            this.mMovedItems = new Hashtable();
            this.mAddedItems = new Hashtable();
            this.mRollers = new QueuedDictionary<uint,RoomItem>();

            this.mWallItems = new QueuedDictionary<uint, RoomItem>();
            this.mFloorItems = new QueuedDictionary<uint, RoomItem>();
            this.roomItemUpdateQueue = new Queue();
            this.mGotRollers = false;
            this.mRoolerCycle = 0;
            this.mRollerSpeed = 4;

            rollerItemsMoved = new List<uint>();
            rollerUsersMoved = new List<uint>();
            rollerMessages = new List<ServerMessage>();
        }
Esempio n. 9
0
        internal static UInt32 GetLinkedTele(UInt32 TeleId, Room pRoom)
        {
            //foreach (RoomItem Item in pRoom.FloorItems.Values)
            //{
            //    if (Item.Id == TeleId)
            //        return Item.Id;
            //}

            using (IQueryAdapter dbClient = FirewindEnvironment.GetDatabaseManager().getQueryreactor())
            {
                dbClient.setQuery("SELECT tele_two_id FROM items_tele_links WHERE tele_one_id = " + TeleId);
                DataRow Row = dbClient.getRow();

                if (Row == null)
                {
                    return 0;
                }

                return Convert.ToUInt32(Row[0]);
            }
        }
Esempio n. 10
0
        internal static bool IsTeleLinked(UInt32 TeleId, Room pRoom)
        {
            uint LinkId = GetLinkedTele(TeleId, pRoom);

            if (LinkId == 0)
            {
                return false;
            }

            RoomItem item = pRoom.GetRoomItemHandler().GetItem(LinkId);
            if (item != null && item.GetBaseItem().InteractionType == Firewind.HabboHotel.Items.InteractionType.teleport)
                return true;

            uint RoomId = GetTeleRoomId(LinkId, pRoom);

            if (RoomId == 0)
            {
                return false;
            }

            return true;
        }
Esempio n. 11
0
        internal void ForwardToRoom(int flatID)
        {
            if (FirewindEnvironment.ShutdownStarted)
            {
                Session.SendNotif(LanguageLocale.GetValue("shutdown.alert"));
                return;
            }

            if (Session.GetHabbo().IsTeleporting && Session.GetHabbo().TeleportingRoomID != flatID)
                return;

            Room room = FirewindEnvironment.GetGame().GetRoomManager().LoadRoom((uint)flatID);
            if (room == null)
            {
                // Don't actually think this message is used anymore
                Response.Init(Outgoing.NoSuchFlat);
                Response.AppendInt32(flatID); // flatId
                SendResponse();
                return;
            }

            ClearRoomLoading();
            if (Session.GetHabbo().InRoom)
            {
                Room oldRoom = FirewindEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

                if (oldRoom != null)
                {
                    oldRoom.GetRoomUserManager().RemoveUserFromRoom(Session, false, false);
                    Session.CurrentRoomUserID = -1;
                }
            }
            //QueuedServerMessage response = new QueuedServerMessage(Session.GetConnection());

            if (room.UsersNow >= room.UsersMax && !Session.GetHabbo().HasFuse("fuse_enter_full_rooms"))
            {
                if (!FirewindEnvironment.GetGame().GetRoleManager().RankHasRight(Session.GetHabbo().Rank, "fuse_enter_full_rooms"))
                {
                    // This room is full!!!!
                    Response.Init(Outgoing.RoomErrorToEnter);
                    Response.AppendInt32(1);
                    SendResponse();
                    //response.appendResponse(GetResponse());

                    Response.Init(Outgoing.OutOfRoom);
                    SendResponse();
                    //response.appendResponse(GetResponse());

                    //response.sendResponse();
                    return;
                }
            }

            if (!Session.GetHabbo().HasFuse("fuse_enter_any_room") && room.UserIsBanned(Session.GetHabbo().Id))
            {
                if (room.HasBanExpired(Session.GetHabbo().Id))
                {
                    room.RemoveBan(Session.GetHabbo().Id);
                }
                else
                {
                    // You are banned of this room!
                    Response.Init(Outgoing.RoomErrorToEnter);
                    Response.AppendInt32(4);
                    SendResponse();
                    //response.appendResponse(GetResponse());

                    Response.Init(Outgoing.OutOfRoom);
                    SendResponse();
                    //response.appendResponse(GetResponse());

                    //response.sendResponse();
                    return;
                }
            }

            Session.GetHabbo().LoadingRoom = (uint)flatID;
            CurrentLoadingRoom = room;

            Response.Init(Outgoing.PrepareRoomForUsers);
            SendResponse();
            //response.appendResponse(GetResponse());

            if (!Session.GetHabbo().HasFuse("fuse_enter_any_room") && !room.CheckRights(Session, true) && !Session.GetHabbo().IsTeleporting)
            {
                switch (room.State)
                {
                    case 1:
                        if (room.UserCount == 0)
                        {
                            // Aww nobody in da room!
                            Response.Init(Outgoing.DoorBellNoPerson);
                            SendResponse();
                            //response.appendResponse(GetResponse());
                        }
                        else
                        {
                            // Waiting for answer!
                            Response.Init(Outgoing.Doorbell);
                            Response.AppendStringWithBreak("");
                            SendResponse();
                            //response.appendResponse(GetResponse());

                            ServerMessage RingMessage = new ServerMessage(Outgoing.Doorbell);
                            RingMessage.AppendStringWithBreak(Session.GetHabbo().Username);
                            room.SendMessageToUsersWithRights(RingMessage);
                        }
                        //response.sendResponse();
                        return;

                    case 2:
                        //if (password.ToLower() != room.Password.ToLower())
                        {
                            // your password fail :( !

                            Response.Init(Outgoing.GenericError);
                            Response.AppendInt32(-100002); // can be 4009 if you want something like 'need.to.be.vip'
                            SendResponse();
                            //response.appendResponse(GetResponse());

                            Response.Init(Outgoing.OutOfRoom);
                            SendResponse();
                            //response.appendResponse(GetResponse());

                            //response.sendResponse();
                            return;
                        }
                        //break;
                }
            }
            Session.GetHabbo().LoadingChecksPassed = true;

            if (room.RoomData.Badge != null && room.RoomData.Badge != "")
            {
                Session.GetHabbo().GetBadgeComponent().GiveBadge(room.RoomData.Badge, true);
                Session.SendNotif(LanguageLocale.GetValue("user.badgereceived"));
            }

            //response.sendResponse();

            // Every check done, tell client to procceed
            Response.Init(Outgoing.RoomReady);
            Response.AppendStringWithBreak(room.ModelName); // if starts with "model_", roomCategory = 1
            Response.AppendUInt(room.RoomId); // flatId
            SendResponse();
        }
Esempio n. 12
0
 internal void UpdateUser(GameClient client)
 {
     this.client = client;
     if (client != null && client.GetHabbo() != null)
         currentRoom = client.GetHabbo().CurrentRoom;
 }
Esempio n. 13
0
        internal void GetGuestRoom()
        {
            int roomID = Request.ReadInt32();
            bool unk1 = Request.ReadBoolean(); // these 2 bools could have with forwarding to do
            bool unk2 = Request.ReadBoolean();

            //Logging.LogDebug(String.Format("p1: {0}, p2: {1}", unk1, unk2));
            if (!Session.GetHabbo().HasFuse("fuse_enter_any_room") && (Session.GetHabbo().LoadingRoom != roomID || CurrentLoadingRoom == null || !Session.GetHabbo().LoadingChecksPassed))
                return;

            Habbo targetHabbo = Session.GetHabbo();

            RoomData room = FirewindEnvironment.GetGame().GetRoomManager().GenerateRoomData((uint)roomID);

            if (CurrentLoadingRoom == null) // Happens with MOD-tool
            {
                CurrentLoadingRoom = FirewindEnvironment.GetGame().GetRoomManager().LoadRoom((uint)roomID);

                Response.Init(Outgoing.PrepareRoomForUsers);
                SendResponse();

                Response.Init(Outgoing.RoomReady);
                Response.AppendStringWithBreak(room.ModelName); // if starts with "model_", roomCategory = 1
                Response.AppendInt32(roomID); // flatId
                SendResponse();
                //return;
            }

            if (Session.GetHabbo().InRoom)
            {
                Room oldRoom = FirewindEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

                if (oldRoom != null)
                {
                    oldRoom.GetRoomUserManager().RemoveUserFromRoom(Session, false, false);
                    Session.CurrentRoomUserID = -1;
                }
            }

            if (room == null || CurrentLoadingRoom == null)
                return;

            Response.Init(Outgoing.GetGuestRoomResult);
            Response.AppendBoolean(true); // enterRoom
            room.Serialize(Response, false);
            Response.AppendBoolean(false); // roomForward
            Response.AppendString("");

            SendResponse();

            if (room.Wallpaper != "0.0")
            {
                Response.Init(Outgoing.RoomDecoration);
                Response.AppendStringWithBreak("wallpaper");
                Response.AppendStringWithBreak(room.Wallpaper);
                SendResponse();
            }

            if (room.Floor != "0.0")
            {
                Response.Init(Outgoing.RoomDecoration);
                Response.AppendStringWithBreak("floor");
                Response.AppendStringWithBreak(room.Floor);
                SendResponse();
            }

            Response.Init(Outgoing.RoomDecoration);
            Response.AppendStringWithBreak("landscape");
            Response.AppendStringWithBreak(room.Landscape);
            SendResponse();

            if (CurrentLoadingRoom.CheckRights(Session, true))
            {
                Response.Init(Outgoing.RoomRightsLevel);
                Response.AppendInt32(4);
                SendResponse();

                Response.Init(Outgoing.HasOwnerRights);
                SendResponse();
            }
            else if (CurrentLoadingRoom.CheckRights(Session))
            {
                Response.Init(Outgoing.RoomRightsLevel);
                Response.AppendInt32(1);
                SendResponse();
            }
            else
            {
                Response.Init(Outgoing.RoomRightsLevel);
                Response.AppendInt32(0);
                SendResponse();
            }

            Response.Init(Outgoing.ScoreMeter);
            Response.AppendInt32(room.Score);
            Response.AppendBoolean(!(Session.GetHabbo().RatedRooms.Contains(room.Id) || CurrentLoadingRoom.CheckRights(Session, true)));
            SendResponse();

            if (CurrentLoadingRoom.HasOngoingEvent)
            {
                //Session.SendMessage(Room.Event.Serialize(Session));
            }
            else
            {
                Response.Init(Outgoing.RoomEvent);
                Response.AppendStringWithBreak("-1");
                SendResponse();
            }

            Session.SendMessage(CurrentLoadingRoom.GetGameMap().Model.GetHeightmap());
            Session.SendMessage(CurrentLoadingRoom.GetGameMap().Model.SerializeRelativeHeightmap());

            QueuedServerMessage response = new QueuedServerMessage(Session.GetConnection());
            RoomItem[] floorItems = CurrentLoadingRoom.GetRoomItemHandler().mFloorItems.Values.ToArray();
            RoomItem[] wallItems = CurrentLoadingRoom.GetRoomItemHandler().mWallItems.Values.ToArray();

            Response.Init(Outgoing.Objects);
            Response.AppendInt32(1); // count of owners

            // serialize all owners
            Response.AppendInt32(CurrentLoadingRoom.OwnerId);
            Response.AppendString(CurrentLoadingRoom.Owner);

            // serialize items
            Response.AppendInt32(floorItems.Length);

            foreach (RoomItem Item in floorItems)
                Item.Serialize(Response, CurrentLoadingRoom.OwnerId);

            response.appendResponse(GetResponse());

            Response.Init(Outgoing.SerializeWallItems);
            Response.AppendInt32(1); // count of owners

            // serialize all owners
            Response.AppendInt32(CurrentLoadingRoom.OwnerId);
            Response.AppendString(CurrentLoadingRoom.Owner);

            // serialize items
            Response.AppendInt32(wallItems.Length);

            foreach (RoomItem Item in wallItems)
                Item.Serialize(Response, CurrentLoadingRoom.OwnerId);

            response.appendResponse(GetResponse());

            Array.Clear(floorItems, 0, floorItems.Length);
            Array.Clear(wallItems, 0, wallItems.Length);
            floorItems = null;
            wallItems = null;

            CurrentLoadingRoom.GetRoomUserManager().AddUserToRoom(Session, false);

            response.sendResponse();
            ClearRoomLoading();
        }
Esempio n. 14
0
        internal void Destroy()
        {
            _unitMap.Clear();
            mDynamicModel.Destroy();
            mCoordinatedItems.Clear();

            Array.Clear(mGameMap, 0, mGameMap.Length);
            Array.Clear(mUserItemEffect, 0, mUserItemEffect.Length);
            Array.Clear(mItemHeightMap, 0, mItemHeightMap.Length);

            _unitMap = null;
            mGameMap = null;
            mUserItemEffect = null;
            mItemHeightMap = null;
            mCoordinatedItems = null;
            mDynamicModel = null;
            room = null;
            mStaticModel = null;
        }
Esempio n. 15
0
        internal void UnloadRoom(Room Room)
        {
            if (Room == null)
            {
                return;
            }

            lock (roomsToRemoveQueue.SyncRoot)
            {
                roomsToRemoveQueue.Enqueue(Room.RoomId);
            }

            Room.Destroy();

               Logging.WriteLine("[RoomMgr] Unloaded room: \"" + Room.Name + "\" (ID: " + Room.RoomId + ")");
        }
Esempio n. 16
0
 internal void Destroy()
 {
     room = null;
     usersByUsername.Clear();
     usersByUsername = null;
     usersByUserID.Clear();
     usersByUserID = null;
     OnUserEnter = null;
     pets.Clear();
     pets = null;
     userlist.Destroy();
     userlist = null;
 }
Esempio n. 17
0
        internal Room LoadRoom(UInt32 Id)
        {
            if (IsRoomLoaded(Id))
            {
                return GetRoom(Id);
            }

            RoomData Data = GenerateRoomData(Id);

            if (Data == null)
                return null;

            Room Room = new Room(Data);

            //Room Room = new Room(Data.Id, Data.Name, Data.Description, Data.Type, Data.Owner, Data.Category, Data.State,
            //    Data.UsersMax, Data.ModelName, Data.CCTs, Data.Score, Data.Tags, Data.AllowPets, Data.AllowPetsEating,
            //    Data.AllowWalkthrough, Data.Hidewall, Data.Icon, Data.Password, Data.Wallpaper, Data.Floor, Data.Landscape, Data, Data.AllowRightsOverride);

            lock (roomsToAddQueue.SyncRoot)
            {
                roomsToAddQueue.Enqueue(Room);
            }

            //Room.InitBots();
            //Room.InitPets();

            //Logging.WriteLine("[RoomMgr] Loaded room: \"" + Room.Name + "\" (ID: " + Id + ")");

            return Room;
        }
Esempio n. 18
0
 internal void BroadcastCurrentSongData(Room Instance)
 {
     if (mSong != null)
         Instance.SendMessage(JukeboxComposer.ComposePlayingComposer(mSong.SongData.Id, mSongQueuePosition, 0));
     else
         Instance.SendMessage(JukeboxComposer.ComposePlayingComposer(0, 0, 0));
 }
Esempio n. 19
0
        internal void OnRoomUserAdd()
        {
            QueuedServerMessage response = new QueuedServerMessage(Session.GetConnection());

            List<RoomUser> UsersToDisplay = new List<RoomUser>();

            if (CurrentLoadingRoom == null)
                return;

            foreach (RoomUser User in CurrentLoadingRoom.GetRoomUserManager().UserList.Values)
            {
                if (User.IsSpectator)
                    continue;

                UsersToDisplay.Add(User);
            }

            Response.Init(Outgoing.SetRoomUser);
            Response.AppendInt32(UsersToDisplay.Count);

            foreach (RoomUser User in UsersToDisplay)
            {
                User.Serialize(Response);
            }
            response.appendResponse(GetResponse());

            Response.Init(Outgoing.ConfigureWallandFloor);
            GetResponse().AppendBoolean(CurrentLoadingRoom.Hidewall);
            GetResponse().AppendInt32(CurrentLoadingRoom.WallThickness);
            GetResponse().AppendInt32(CurrentLoadingRoom.FloorThickness);
            response.appendResponse(GetResponse());

            if (CurrentLoadingRoom.UsersWithRights.Count > 0/* && CurrentLoadingRoom.CheckRights(Session, true)*/)
            {
                GetResponse().Init(Outgoing.FlatControllerAdded);
                GetResponse().AppendUInt(CurrentLoadingRoom.RoomData.Id);
                GetResponse().AppendInt32(CurrentLoadingRoom.UsersWithRights.Count);
                foreach (uint i in CurrentLoadingRoom.UsersWithRights)
                {
                    Habbo xUser = FirewindEnvironment.getHabboForId(i);
                    GetResponse().AppendUInt(xUser.Id);
                    GetResponse().AppendString(xUser.Username);
                }
                response.appendResponse(GetResponse());

                foreach (uint i in CurrentLoadingRoom.UsersWithRights)
                {
                    Habbo xUser = FirewindEnvironment.getHabboForId(i);
                    GetResponse().Init(Outgoing.GivePowers);
                    GetResponse().AppendUInt(CurrentLoadingRoom.RoomId);
                    GetResponse().AppendUInt(xUser.Id);
                    GetResponse().AppendString(xUser.Username);
                    response.appendResponse(GetResponse());
                }
            }
            ServerMessage Updates = CurrentLoadingRoom.GetRoomUserManager().SerializeStatusUpdates(true);

            if (Updates != null)
            {
                //Session.SendMessage(Updates);
                response.appendResponse(Updates);
            }
            //return;
            foreach (RoomUser User in CurrentLoadingRoom.GetRoomUserManager().UserList.Values)
            {
                if (User.IsSpectator)
                    continue;

                if (User.IsDancing)
                {
                    Response.Init(Outgoing.Dance);
                    Response.AppendInt32(User.VirtualId);
                    Response.AppendInt32(User.DanceId);
                    response.appendResponse(GetResponse());
                }

                if (User.IsAsleep)
                {
                    Response.Init(Outgoing.IdleStatus);
                    Response.AppendInt32(User.VirtualId);
                    Response.AppendBoolean(true);
                    response.appendResponse(GetResponse());
                }

                if (User.CarryItemID > 0 && User.CarryTimer > 0)
                {
                    Response.Init(Outgoing.ApplyCarryItem);
                    Response.AppendInt32(User.VirtualId);
                    Response.AppendInt32(User.CarryTimer);
                    response.appendResponse(GetResponse());
                }

                if (!User.IsBot)
                {
                    try
                    {
                        if (User.GetClient() != null && User.GetClient().GetHabbo() != null && User.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent() != null && User.CurrentEffect >= 1)
                        {
                            Response.Init(Outgoing.ApplyEffects);
                            Response.AppendInt32(User.VirtualId);
                            Response.AppendInt32(User.CurrentEffect);
                            Response.AppendInt32(0);
                            response.appendResponse(GetResponse());
                        }
                    }
                    catch (Exception e) { Logging.HandleException(e, "Rooms.SendRoomData3"); }
                }
            }

            response.sendResponse();
            CurrentLoadingRoom = null;
        }
Esempio n. 20
0
        internal void Destroy()
        {
            mFloorItems.Clear();
            mWallItems.Clear();
            mRemovedItems.Clear();
            mMovedItems.Clear();
            mAddedItems.Clear();
            roomItemUpdateQueue.Clear();

            room = null;
            mFloorItems = null;
            mWallItems = null;
            mRemovedItems = null;
            mMovedItems = null;
            mAddedItems = null;
            mWallItems = null;
            roomItemUpdateQueue = null;
        }
Esempio n. 21
0
 internal void Destroy()
 {
     room = null;
     usersByUserID.Clear();
     usersByUserID = null;
     OnUserEnter = null;
     _unitList.Destroy();
     _unitList = null;
 }
Esempio n. 22
0
        internal void Fill(Room Room)
        {
            this.Id = Room.RoomId;
            this.Name = Room.Name;
            this.Description = Room.Description;
            this.Owner = Room.Owner;
            this.Category = Room.Category;
            this.State = Room.State;
            this.UsersNow = Room.UsersNow;
            this.UsersMax = Room.UsersMax;
            this.ModelName = Room.ModelName;
            this.Score = Room.Score;

            this.Tags = new List<string>();
            foreach (string tag in Room.Tags.ToArray())
                this.Tags.Add(tag);
            this.AllowPets = Room.AllowPets;
            this.AllowPetsEating = Room.AllowPetsEating;
            this.AllowWalkthrough = Room.AllowWalkthrough;
            this.Hidewall = Room.Hidewall;
            this.Password = Room.Password;
            this.Event = Room.Event;
            this.Wallpaper = Room.Wallpaper;
            this.Floor = Room.Floor;
            this.Landscape = Room.Landscape;
            this.FloorThickness = Room.FloorThickness;
            this.WallThickness = Room.WallThickness;
            this.GroupID = Room.Group != null ? Room.Group.ID : 0;

            mModel = FirewindEnvironment.GetGame().GetRoomManager().GetModel(ModelName, Id);
        }
Esempio n. 23
0
        public void Update(Room Instance)
        {
            if (mIsPlaying && (mSong == null || (TimePlaying >= (mSong.SongData.LengthSeconds + 1))))
            {
                if (mPlaylist.Count == 0)
                {
                    Stop();

                    mRoomOutputItem.data = new StringData("0");
                    mRoomOutputItem.UpdateState();
                }
                else
                {
                    SetNextSong();
                }

                mBroadcastNeeded = true;
            }

            if (mBroadcastNeeded)
            {
                BroadcastCurrentSongData(Instance);
                mBroadcastNeeded = false;
            }
        }