public void LoadFromWiredObject(WiredLoader.WiredLoaderObject loadedData) { this.maxCountPerGame = loadedData.GetIntWithIndex(0); this.scoreToGive = loadedData.GetIntWithIndex(1); if (maxCountPerGame == -1) maxCountPerGame = 0; if (scoreToGive == -1) scoreToGive = 0; }
public void LoadFromWiredObject(WiredLoader.WiredLoaderObject loadedData) { this.timeout = loadedData.GetIntWithIndex(1, 20); }
public void LoadFromWiredObject(WiredLoader.WiredLoaderObject loadedData) { this.scoreLevel = loadedData.GetIntWithIndex(0); if(scoreLevel == -1) this.scoreLevel = 200; }
public void LoadFromWiredObject(WiredLoader.WiredLoaderObject loadedData) { this.items = loadedData.items; this.requiredCycles = loadedData.GetIntWithIndex(0, 0); foreach (RoomItem targetItem in items) { targetItem.OnUserWalksOffFurni += delegateFunction; } AttatchListenersToItems(); }
public void LoadFromWiredObject(WiredLoader.WiredLoaderObject loadedData) { this.items = loadedData.items; this.delay = loadedData.GetIntWithIndex(0, 20); AttatchListenersToItems(); }
public void LoadFurniture(int RoomId = 0) { if (RoomId == 0) { this._floorItems.Clear(); this._wallItems.Clear(); } using (IQueryAdapter queryreactor = ButterflyEnvironment.GetDatabaseManager().GetQueryReactor()) { queryreactor.SetQuery("SELECT items.id, items.user_id, items.room_id, items.base_item, items.extra_data, items.x, items.y, items.z, items.rot, items.wall_pos, items_limited.limited_number, items_limited.limited_stack FROM items LEFT JOIN items_limited ON (items_limited.item_id = items.id) WHERE items.room_id = @roomid"); queryreactor.AddParameter("roomid", (RoomId == 0) ? this.GetRoom.Id : RoomId); int itemID; int UserId; int baseID; string ExtraData; int x; int y; double z; sbyte n; string wallposs; int Limited; int LimitedTo; string wallCoord; foreach (DataRow dataRow in queryreactor.GetTable().Rows) { itemID = Convert.ToInt32(dataRow[0]); UserId = Convert.ToInt32(dataRow[1]); baseID = Convert.ToInt32(dataRow[3]); ExtraData = !DBNull.Value.Equals(dataRow[4]) ? (string)dataRow[4] : string.Empty; x = Convert.ToInt32(dataRow[5]); y = Convert.ToInt32(dataRow[6]); z = Convert.ToDouble(dataRow[7]); n = Convert.ToSByte(dataRow[8]); wallposs = !DBNull.Value.Equals(dataRow[9]) ? (string)(dataRow[9]) : string.Empty; Limited = !DBNull.Value.Equals(dataRow[10]) ? Convert.ToInt32(dataRow[10]) : 0; LimitedTo = !DBNull.Value.Equals(dataRow[11]) ? Convert.ToInt32(dataRow[11]) : 0; ItemData Data = null; ButterflyEnvironment.GetGame().GetItemManager().GetItem(baseID, out Data); if (Data == null) { continue; } if (Data.Type.ToString() == "i") { if (string.IsNullOrEmpty(wallposs)) { wallCoord = "w=0,0 l=0,0 l"; } else { wallCoord = wallposs;//WallPositionCheck(":" + wallposs.Split(':')[1]); } Item roomItem = new Item(itemID, this.GetRoom.Id, baseID, ExtraData, Limited, LimitedTo, 0, 0, 0.0, 0, wallCoord, this.GetRoom); if (!this._wallItems.ContainsKey(itemID)) { this._wallItems.TryAdd(itemID, roomItem); } if (roomItem.GetBaseItem().InteractionType == InteractionType.MOODLIGHT) { if (this.GetRoom.MoodlightData == null) { this.GetRoom.MoodlightData = new MoodlightData(roomItem.Id); } } } else //Is flooritem { Item roomItem = new Item(itemID, this.GetRoom.Id, baseID, ExtraData, Limited, LimitedTo, x, y, (double)z, n, "", this.GetRoom); if (!this._floorItems.ContainsKey(itemID)) { this._floorItems.TryAdd(itemID, roomItem); } } } if (RoomId == 0) { foreach (Item Item in _floorItems.Values) { if (WiredUtillity.TypeIsWired(Item.GetBaseItem().InteractionType)) { WiredLoader.LoadWiredItem(Item, this.GetRoom, queryreactor); } } } } }
public void LoadFromWiredObject(WiredLoader.WiredLoaderObject loadedData) { this.delay = loadedData.GetIntWithIndex(0); this.items = loadedData.items; foreach (RoomItem _item in items) { _item.itemTriggerEventHandler += delegateFunction; } this.AttatchListenersToItems(); }
public void LoadFromWiredObject(WiredLoader.WiredLoaderObject loadedData) { this.originalItemLocation = loadedData.originalPositionList; this.items = loadedData.items; this.delay = loadedData.GetIntWithIndex(0, 20); AttatchListenersToItems(); }
public void LoadFromWiredObject(WiredLoader.WiredLoaderObject loadedData) { this.message = loadedData.StringSettings[0]; }
internal void LoadFurniture() { //this.Items.Clear(); this.mFloorItems.Clear(); this.mWallItems.Clear(); DataTable Data; using (IQueryAdapter dbClient = PiciEnvironment.GetDatabaseManager().getQueryreactor()) { if (dbClient.dbType == Pici.Storage.Database.DatabaseType.MySQL) { dbClient.setQuery("CALL getroomitems(@roomid)"); dbClient.addParameter("roomid", room.RoomId); } else { dbClient.setQuery("EXECUTE getroomitems " + room.RoomId); } Data = dbClient.getTable(); uint itemID; decimal x; decimal y; sbyte n; uint baseID; string extradata; WallCoordinate wallCoord; foreach (DataRow dRow in Data.Rows) { itemID = Convert.ToUInt32(dRow[0]); x = Convert.ToDecimal(dRow[1]); y = Convert.ToDecimal(dRow[2]); n = Convert.ToSByte(dRow[3]); baseID = Convert.ToUInt32(dRow[4]); if (DBNull.Value.Equals(dRow[5])) { extradata = string.Empty; } else { extradata = (string)dRow[5]; } if (n > 6) // Is wallitem { wallCoord = new WallCoordinate((double)x, (double)y, n); RoomItem item = new RoomItem(itemID, room.RoomId, baseID, extradata, wallCoord, room); if (!mWallItems.ContainsKey(itemID)) { mWallItems.Inner.Add(itemID, item); } } else //Is flooritem { int coordX, coordY; TextHandling.Split((double)x, out coordX, out coordY); RoomItem item = new RoomItem(itemID, room.RoomId, baseID, extradata, coordX, coordY, (double)y, n, room); if (!mFloorItems.ContainsKey(itemID)) { mFloorItems.Inner.Add(itemID, item); } } } foreach (RoomItem Item in mFloorItems.Values) { if (Item.IsRoller) { mGotRollers = true; } else if (Item.GetBaseItem().InteractionType == Pici.HabboHotel.Items.InteractionType.dimmer) { if (room.MoodlightData == null) { room.MoodlightData = new MoodlightData(Item.Id); } } else if (WiredUtillity.TypeIsWired(Item.GetBaseItem().InteractionType)) { WiredLoader.LoadWiredItem(Item, room, dbClient); } if (WiredHandler.TypeIsWire(Item.GetBaseItem().InteractionType)) { room.GetWiredHandler().AddWire(Item, Item.Coordinate, Item.Rot, Item.GetBaseItem().InteractionType); } } } }
public void LoadFromWiredObject(WiredLoader.WiredLoaderObject loadedData) { this.triggerMessage = loadedData.StringSettings[0]; this.IsOwnerOnly = loadedData.GetBooleanWithIndex(1); }
public void LoadFromWiredObject(WiredLoader.WiredLoaderObject loadedData) { this.originalItemLocation = loadedData.originalPositionList; this.items = loadedData.items; checkState = loadedData.GetBooleanWithIndex(0); checkDirection = loadedData.GetBooleanWithIndex(1); checkPosition = loadedData.GetBooleanWithIndex(2); AttatchListenersToItems(); }
public void LoadFromWiredObject(WiredLoader.WiredLoaderObject loadedData) { this.cyclesRequired = loadedData.GetIntWithIndex(0); }
public void LoadFromWiredObject(WiredLoader.WiredLoaderObject loadedData) { this.items = loadedData.items; allItems = loadedData.GetBooleanWithIndex(0); AttatchListenersToItems(); }
public void LoadFromWiredObject(WiredLoader.WiredLoaderObject loadedData) { this.requiredCycles = loadedData.GetIntWithIndex(0); if (requiredCycles == -1) requiredCycles = 20; }
public void LoadFromWiredObject(WiredLoader.WiredLoaderObject loadedData) { this.isOneUser = loadedData.GetBooleanWithIndex(0); this.userName = loadedData.StringSettings[1]; }
internal void LoadFurniture() { //this.Items.Clear(); this.mFloorItems.Clear(); this.mWallItems.Clear(); DataTable Data; using (IQueryAdapter dbClient = FirewindEnvironment.GetDatabaseManager().getQueryreactor()) { dbClient.setQuery("CALL getroomitems(@roomid)"); dbClient.addParameter("roomid", room.RoomId); Data = dbClient.getTable(); uint itemID; decimal x; decimal y; sbyte n; uint baseID; int dataType; string extradata; WallCoordinate wallCoord; int extra; foreach (DataRow dRow in Data.Rows) { itemID = Convert.ToUInt32(dRow[0]); x = Convert.ToDecimal(dRow[1]); y = Convert.ToDecimal(dRow[2]); n = Convert.ToSByte(dRow[3]); baseID = Convert.ToUInt32(dRow[4]); IRoomItemData data; if (DBNull.Value.Equals(dRow[5])) { data = new StringData(""); extra = 0; } else { dataType = Convert.ToInt32(dRow[5]); extradata = (string)dRow[6]; extra = Convert.ToInt32(dRow[7]); switch (dataType) { case 0: data = new StringData(extradata); break; case 1: data = new MapStuffData(); break; case 2: data = new StringArrayStuffData(); break; case 3: data = new StringIntData(); break; default: data = new StringData(extradata); break; } try { data.Parse(extradata); } catch { Logging.LogException(string.Format("Error in furni data! Item ID: \"{0}\" and data: \"{1}\"", itemID, extradata.Replace(Convert.ToChar(1).ToString(), "[1]"))); dbClient.runFastQuery(string.Format("DELETE FROM items_extradata WHERE item_id = {0}", itemID)); } } if (FirewindEnvironment.GetGame().GetItemManager().GetItem(baseID).Type == 'i') // Is wallitem { wallCoord = new WallCoordinate((double)x, (double)y, n); RoomItem item = new RoomItem(itemID, room.RoomId, baseID, data, extra, wallCoord, room); if (!mWallItems.ContainsKey(itemID)) { mWallItems.Inner.Add(itemID, item); } } else //Is flooritem { int coordX, coordY; TextHandling.Split((double)x, out coordX, out coordY); RoomItem item = new RoomItem(itemID, room.RoomId, baseID, data, extra, coordX, coordY, (double)y, n, room); if (!mFloorItems.ContainsKey(itemID)) { mFloorItems.Inner.Add(itemID, item); } } } foreach (RoomItem Item in mFloorItems.Values) { if (Item.IsRoller) { mGotRollers = true; } else if (Item.GetBaseItem().InteractionType == Firewind.HabboHotel.Items.InteractionType.dimmer) { if (room.MoodlightData == null) { room.MoodlightData = new MoodlightData(Item.Id); } } else if (WiredUtillity.TypeIsWired(Item.GetBaseItem().InteractionType)) { WiredLoader.LoadWiredItem(Item, room, dbClient); room.GetWiredHandler().AddWire(Item, Item.Coordinate, Item.Rot, Item.GetBaseItem().InteractionType); } } } }
public void LoadFromWiredObject(WiredLoader.WiredLoaderObject loadedData) { }
public void LoadFromWiredObject(WiredLoader.WiredLoaderObject loadedData) { this.items = loadedData.items; AttatchListenersToItems(); }
public void LoadFromWiredObject(WiredLoader.WiredLoaderObject loadedData) { this.rotation = (RotationState)loadedData.GetIntWithIndex(0, 0); this.movement = (MovementState)loadedData.GetIntWithIndex(1, 0); this.delay = loadedData.GetIntWithIndex(3); this.items = loadedData.items; AttatchListenersToItems(); }