Esempio n. 1
0
        private void method_66(bool bool_13)
        {
            if (!this.bool_12)
            {
                this.bool_12 = true;
                if (bool_13)
                {
                    this.mGotRollers = false;
                    if (this.timer_0 != null)
                    {
                        this.bool_6 = true;
                        this.timer_0.Change(-1, -1);
                    }
                    this.method_64();
                    using (DatabaseClient @class = PhoenixEnvironment.GetDatabase().GetClient())
                    {
                        @class.ExecuteQuery(string.Concat(new object[]
						{
							"UPDATE user_pets SET room_id = 0 WHERE room_id = ",
							this.Id,
							" AND NOT user_id = ",
							PhoenixEnvironment.GetGame().GetClientManager().GetIdByName(this.Owner)
						}));
                    }
                    this.timer_0.Dispose();
                    this.timer_0 = null;
                    this.bool_9 = false;
                    if (this.Tags != null)
                    {
                        this.Tags.Clear();
                    }
                    this.Tags = null;
                    if (this.UserList != null)
                    {
                        Array.Clear(this.UserList, 0, this.UserList.Length);
                    }
                    this.UserList = null;
                    this.class29_0 = null;
                    if (this.UsersWithRights != null)
                    {
                        this.UsersWithRights.Clear();
                    }
                    this.class29_0 = null;
                    if (this.dictionary_0 != null)
                    {
                        this.dictionary_0.Clear();
                    }
                    this.dictionary_0 = null;
                    this.Wallpaper = null;
                    this.Floor = null;
                    this.Landscape = null;
                    if (this.mFloorItems != null)
                    {
                        this.mFloorItems.Clear();
                    }
                    this.mFloorItems = null;
                    if (this.mWallItems != null)
                    {
                        this.mWallItems.Clear();
                    }
                    this.mWallItems = null;
                    this.MoodlightData = null;
                    if (this.ActiveTrades != null)
                    {
                        this.ActiveTrades.Clear();
                    }
                    this.ActiveTrades = null;
                    if (this.musicController != null)
                    {
                        this.musicController.UnLinkRoomOutputItem();
                    }
                    this.musicController = null;
                }
            }
        }
Esempio n. 2
0
 public bool method_82(GameClient Session, RoomItem RoomItem_0, bool bool_13, string string_10)
 {
     if (bool_13)
     {
         RoomItem_0.Interactor.OnPlace(Session, RoomItem_0);
         string text = RoomItem_0.GetBaseItem().InteractionType.ToLower();
         if (text != null && text == "dimmer" && this.MoodlightData == null)
         {
             this.MoodlightData = new MoodlightData(RoomItem_0.Id);
             RoomItem_0.ExtraData = this.MoodlightData.method_7();
         }
         if (!this.mAddedItems.ContainsKey(RoomItem_0.Id))
         {
             this.mAddedItems.Add(RoomItem_0.Id, RoomItem_0);
             if (RoomItem_0.IsFloorItem)
             {
                 this.mFloorItems.Add(RoomItem_0.Id, RoomItem_0);
             }
             else
             {
                 if (!this.mWallItems.Contains(RoomItem_0.Id))
                 {
                     this.mWallItems.Add(RoomItem_0.Id, RoomItem_0);
                 }
             }
         }
         ServerMessage Message5_ = new ServerMessage(83u);
         RoomItem_0.Serialize(Message5_);
         this.SendMessage(Message5_, null);
     }
     else
     {
         if (!this.mMovedItems.Contains(RoomItem_0.Id))
         {
             this.mMovedItems.Add(RoomItem_0.Id, RoomItem_0);
         }
     }
     if (!bool_13)
     {
         RoomItem_0.string_7 = string_10;
         ServerMessage Message5_ = new ServerMessage(85u);
         RoomItem_0.Serialize(Message5_);
         this.SendMessage(Message5_, null);
     }
     return true;
 }
Esempio n. 3
0
 public void LoadFurniture()
 {
     this.mFloorItems.Clear();
     this.mWallItems.Clear();
     DataTable table;
     using (DatabaseClient client = PhoenixEnvironment.GetDatabase().GetClient())
     {
         table = client.ReadDataTable("SELECT Id, base_item, extra_data, x, y, z, rot, wall_pos FROM items WHERE room_id = '" + this.Id + "' ORDER BY room_id DESC");
     }
     if (table != null)
     {
         foreach (DataRow row in table.Rows)
         {
             RoomItem item = new RoomItem((uint)row["Id"], this.RoomId, (uint)row["base_item"], (string)row["extra_data"], (int)row["x"], (int)row["y"], (double)row["z"], (int)row["rot"], (string)row["wall_pos"], this);
             if (item.IsRoller)
             {
                 this.mGotRollers = true;
             }
             if (item.GetBaseItem().InteractionType.ToLower().Contains("wf_") || item.GetBaseItem().InteractionType.ToLower().Contains("fbgate"))
             {
                 DataRow row2;
                 using (DatabaseClient client2 = PhoenixEnvironment.GetDatabase().GetClient())
                 {
                     row2 = client2.ReadDataRow("SELECT extra1,extra2,extra3,extra4,extra5 FROM wired_items WHERE item_id = '" + item.Id + "'");
                 }
                 if (row2 != null)
                 {
                     item.Extra1 = (string)row2["extra1"];
                     item.Extra2 = (string)row2["extra2"];
                     item.Extra3 = (string)row2["extra3"];
                     item.Extra4 = (string)row2["extra4"];
                     item.Extra5 = (string)row2["extra5"];
                 }
             }
             switch (item.GetBaseItem().InteractionType.ToLower())
             {
                 case "dice":
                     if (item.ExtraData == "-1")
                     {
                         item.ExtraData = "0";
                     }
                     break;
                 case "fbgate":
                     if (item.ExtraData != "" && item.ExtraData.Contains(','))
                     {
                         item.Extra1 = item.ExtraData.Split(new char[] {	','	})[0];
                         item.Extra2 = item.ExtraData.Split(new char[] {	','	})[1];
                     }
                     break;
                 case "dimmer":
                     if (this.MoodlightData == null)
                     {
                         this.MoodlightData = new MoodlightData(item.Id);
                     }
                     break;
                 case "bb_patch":
                     this.bbTiles.Add(item);
                     if (item.ExtraData == "5")
                     {
                         this.bbrTiles.Add(item);
                     }
                     else if (item.ExtraData == "8")    
                     {    
                         this.bbgTiles.Add(item);
                     }
                     else if (item.ExtraData == "11")
                     {
                         this.bbbTiles.Add(item);
                     }
                     else if (item.ExtraData == "14")
                     {
                         this.bbyTiles.Add(item);
                     }
                     break;
                 case "blue_score":
                     this.BlueScoreboards.Add(item);
                     break;
                 case "green_score":
                     this.GreenScoreboards.Add(item);
                     break;
                 case "red_score":
                     this.RedScoreboards.Add(item);
                     break;
                 case "yellow_score":
                     this.YellowScoreboards.Add(item);
                     break;
                 case "stickiepole":
                     this.StickiePoles.Add(item);
                     break;
                 case "wf_trg_onsay":
                 case "wf_trg_enterroom":
                 case "wf_trg_furnistate":
                 case "wf_trg_onfurni":
                 case "wf_trg_offfurni":
                 case "wf_trg_gameend":
                 case "wf_trg_gamestart":
                 case "wf_trg_attime":
                 case "wf_trg_atscore":
                     if (!this.WF_Triggers.Contains(item))
                     {
                         this.WF_Triggers.Add(item);
                     }
                     break;
                 case "wf_trg_timer":
                     if (item.Extra1.Length <= 0)
                     {
                         item.Extra1 = "10";
                     }
                     if (!this.WF_Triggers.Contains(item))
                     {
                         this.WF_Triggers.Add(item);
                     }
                     item.TimerRunning = true;
                     item.ReqUpdate(1);
                     break;
                 case "wf_act_saymsg":
                 case "wf_act_moveuser":
                 case "wf_act_togglefurni":
                 case "wf_act_givepoints":
                 case "wf_act_moverotate":
                 case "wf_act_matchfurni":
                 case "wf_act_give_phx":
                     if (!this.WF_Effects.Contains(item))
                     {
                         this.WF_Effects.Add(item);
                     }
                     break;
                 case "wf_cnd_trggrer_on_frn":
                 case "wf_cnd_furnis_hv_avtrs":
                 case "wf_cnd_has_furni_on":
                 case "wf_cnd_phx":
                     if (!this.WF_Conditions.Contains(item))
                     {
                         this.WF_Conditions.Add(item);
                     }
                     break;
                 case "jukebox":
                     RoomMusicController roomMusicController = this.GetRoomMusicController();
                     roomMusicController.LinkRoomOutputItemIfNotAlreadyExits(item);
                     break;
             }
             if (this.mFloorItems.Contains(item.Id))
             {
                 this.mFloorItems.Remove(item.Id);
             }
             if (this.mWallItems.Contains(item.Id))
             {
                 this.mWallItems.Remove(item.Id);
             }
             if (item.IsFloorItem)
             {
                 this.mFloorItems.Add(item.Id, item);
             }
             else
             {
                 this.mWallItems.Add(item.Id, item);
             }
         }
     }
 }