public ShopItem(DataRow Row) { Security.SecurityCounter Counter = new SecurityCounter(-1); Id = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]); PageId = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]); InternalName = BrickEngine.GetConvertor().ObjectToString(Row[Counter.Next]); string ItemIds = BrickEngine.GetConvertor().ObjectToString(Row[Counter.Next]); InternalItemIds = new List<int>(); var Splitted = ItemIds.Split(',').ToList(); if (Splitted.Count <= 0 && ItemIds.Length >= 1) { InternalItemIds[0] = BrickEngine.GetConvertor().ObjectToInt32(ItemIds); } Splitted.ToList().ForEach(delegate(string Obj) { if (Obj.Length >= 1) { int i = BrickEngine.GetConvertor().ObjectToInt32(Obj); InternalItemIds.Add(i); } }); PurchaserScale = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]); Amount = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]); CreditsCost = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]); PixelsCost = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]); SpriteLayer = BrickEngine.GetConvertor().ObjectToString(Row[Counter.Next]); }
public AchievementCategory(DataRow Row) { SecurityCounter Counter = new SecurityCounter(-1); Id = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]); Name = BrickEngine.GetConvertor().ObjectToString(Row[Counter.Next]); OrderId = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]); }
public AchievementGoal(DataRow Row) { SecurityCounter Counter = new SecurityCounter(-1); Id = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]); AchievementId = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]); Level = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]); GoalAmount = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]); }
public QueryReactor(int DeliverId, string ConnectionString) { this.DeliverId = DeliverId; this.ConnectionString = ConnectionString; CurrentQuery = string.Empty; CommandLocker = new ReaderWriterLock(); Parameters = new List<MySqlParameter>(); ParameterCounter = new SecurityCounter(-1); }
public Achievement(DataRow Row) { SecurityCounter Counter = new SecurityCounter(-1); Id = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]); CategoryId = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]); BadgeBase = BrickEngine.GetConvertor().ObjectToString(Row[Counter.Next]); EnableLeveling = BrickEngine.GetConvertor().ObjectToBoolean(Row[Counter.Next]); PixelRewardBase = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]); ScoreRewardBase = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]); ExtraScore = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]); OrderId = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]); }
public Item(Dictionary<int, Object> Row) { SecurityCounter Counter = new SecurityCounter(-1); Id = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]); BaseId = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]); OwnerId = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]); RoomId = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]); int X = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]); int Y = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]); double Z = BrickEngine.GetConvertor().ObjectToDouble(Row[Counter.Next]); this.Point = new iPoint(X, Y, Z); Rotation = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]); WallPoint = BrickEngine.GetConvertor().ObjectToString(Row[Counter.Next]); ExtraData = BrickEngine.GetConvertor().ObjectToString(Row[Counter.Next]); InsideItemId = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]); }
public BaseItem(DataRow Row) { SecurityCounter Counter = new SecurityCounter(-1); Id = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]); InternalName = BrickEngine.GetConvertor().ObjectToString(Row[Counter.Next]); InternalType = BrickEngine.GetConvertor().ObjectToString(Row[Counter.Next]); LengthX = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]); LengthY = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]); LengthZ = BrickEngine.GetConvertor().ObjectToDouble(Row[Counter.Next]); SpriteId = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]); EnableStack = BrickEngine.GetConvertor().ObjectToBoolean(Row[Counter.Next]); EnableWalk = BrickEngine.GetConvertor().ObjectToBoolean(Row[Counter.Next]); EnableSit = BrickEngine.GetConvertor().ObjectToBoolean(Row[Counter.Next]); EnableTrade = BrickEngine.GetConvertor().ObjectToBoolean(Row[Counter.Next]); EnableAuction = BrickEngine.GetConvertor().ObjectToBoolean(Row[Counter.Next]); EnableRecycle = BrickEngine.GetConvertor().ObjectToBoolean(Row[Counter.Next]); EnableGift = BrickEngine.GetConvertor().ObjectToBoolean(Row[Counter.Next]); EnableInterventoryStack = BrickEngine.GetConvertor().ObjectToBoolean(Row[Counter.Next]); ExternalType = BrickEngine.GetConvertor().ObjectToString(Row[Counter.Next]); InteractorAmount = BrickEngine.GetConvertor().ObjectToInt32(Row[Counter.Next]); }
public void Prepare() { Vouchers = new Dictionary<string, short>(); DataTable Table = null; using (QueryReactor Reactor = BrickEngine.GetQueryReactor()) { Reactor.SetQuery("SELECT * FROM voucher_codes"); Table = Reactor.GetTable(); } if (Table != null) { foreach (DataRow Row in Table.Rows) { SecurityCounter Counter = new SecurityCounter(0); string DecodedVoucher = BrickEngine.GetConvertor().ObjectToString(Row[Counter.Next]); short CreditCode = BrickEngine.GetConvertor().ObjectToShort(Row[Counter.Next]); if (CreditCode < 0) { CreditCode = 0; } if (!Vouchers.ContainsKey(DecodedVoucher)) { Vouchers.Add(DecodedVoucher, CreditCode); } else { Vouchers[DecodedVoucher] = CreditCode; } } } BrickEngine.GetScreenWriter().ScretchLine("[" + Vouchers.Count + "] Voucher(s) cached.", IO.WriteType.Outgoing); }
public void LoadOffers() { Offers = new Dictionary<int, MarketOffer>(); DataTable Table = null; using (QueryReactor Reactor = BrickEngine.GetQueryReactor()) { Reactor.SetQuery("SELECT MAX(id) FROM marketplace_offers LIMIT 1"); OfferIdCounter = new SecurityCounter(Reactor.GetInt32()); } using (QueryReactor Reactor = BrickEngine.GetQueryReactor()) { Reactor.SetQuery("SELECT * FROM marketplace_offers"); Table = Reactor.GetTable(); } foreach (DataRow Row in Table.Rows) { MarketOffer Offer = new MarketOffer(Row); Offers.Add(Offer.Id, Offer); } BrickEngine.GetScreenWriter().ScretchLine("[" + Offers.Count + "] MarketplaceOffer(s) cached.", IO.WriteType.Outgoing); }
public void LoadDevelopments() { Developments = new Dictionary<int, MarketDevelopment>(); DataTable Table = null; using (QueryReactor Reactor = BrickEngine.GetQueryReactor()) { Reactor.SetQuery("SELECT MAX(id) FROM marketplace_development LIMIT 1"); DevelopmentIdCounter = new SecurityCounter(Reactor.GetInt32()); } using (QueryReactor Reactor = BrickEngine.GetQueryReactor()) { Reactor.SetQuery("SELECT * FROM marketplace_development"); Table = Reactor.GetTable(); } foreach (DataRow Row in Table.Rows) { MarketDevelopment Development = new MarketDevelopment(Row); Developments.Add(Development.Id, Development); } BrickEngine.GetScreenWriter().ScretchLine("[" + Developments.Count + "] Development(s) cached.", IO.WriteType.Outgoing); }
public void LoadPets() { Pets = new Dictionary<int, PetInfo>(); DataTable Table = null; using (QueryReactor Reactor = BrickEngine.GetQueryReactor()) { Reactor.SetQuery("SELECT MAX(id) FROM user_pets LIMIT 1"); int MaxId = Reactor.GetInt32(); if (MaxId <= 0) { MaxId += 1000000; } PetIdCounter = new SecurityCounter(MaxId); } using (QueryReactor Reactor = BrickEngine.GetQueryReactor()) { Reactor.SetQuery("SELECT * FROM user_pets"); Table = Reactor.GetTable(); } foreach (DataRow Row in Table.Rows) { PetInfo Pet = new PetInfo(Row); Pets.Add(Pet.Id, Pet); } BrickEngine.GetScreenWriter().ScretchLine(string.Format("[{0}] Pet(s) cached.", Pets.Count),IO.WriteType.Outgoing); }
public void Prepare() { LoadItems(); LoadItemUpdates(); using (QueryReactor Reactor = BrickEngine.GetQueryReactor()) { Reactor.SetQuery("SELECT MAX(id) FROM items LIMIT 1"); ItemIdCounter = new Security.SecurityCounter(Reactor.GetInt32()); } }
public int InsertItem(int HabboId, int BaseId, string ExtraData, int InsideBaseId) { SecurityCounter Counter = new SecurityCounter(-1); Dictionary<int, Object> Row = new Dictionary<int,object>(); if (string.IsNullOrEmpty(ExtraData)) { ExtraData = "0"; } Row[Counter.Next] = ItemIdCounter.Next; Row[Counter.Next] = BaseId; Row[Counter.Next] = HabboId; Row[Counter.Next] = 0; Row[Counter.Next] = -1; Row[Counter.Next] = -1; Row[Counter.Next] = 0.0; Row[Counter.Next] = 0; Row[Counter.Next] = string.Empty; Row[Counter.Next] = ExtraData; Row[Counter.Next] = InsideBaseId; Item Item = new Item(Row); Items.Add(Item.Id, Item); // Doing Item query using (QueryReactor Reactor = BrickEngine.GetQueryReactor()) { Reactor.SetQuery("INSERT INTO items (user_id, base_id, extra_data, inside_base_id) VALUES (@habboid, @baseid, @extradata, @inside)"); Reactor.AddParam("habboid", HabboId); Reactor.AddParam("baseid", BaseId); Reactor.AddParam("extradata", ExtraData); Reactor.AddParam("inside", InsideBaseId); Reactor.ExcuteQuery(); } int TabId = Item.GetBaseItem().InternalType.ToLower().Equals("s") ? 1 : 2; AddNewUpdate(Item.Id, TabId, HabboId); return Item.Id; }