-
Posts
2,142 -
Joined
-
Last visited
-
Days Won
148
Content Type
Profiles
Forums
Events
Everything posted by Magictallguy
-
Ah, I see. Thinking scalability now; a simple boolean flag for "in use" is fine if you only have 1 non-standard use for an item. But what if, in the future, you decide to add something else that could also make use of the "in use" boolean? I can see that getting confusing to manage and potentially giving unexpected/unwanted results with the conflict. So, to keep with logic, you'd just add another bool, right? How many booleans are you going to be ultimately adding until moving data to a separate table just makes more sense? I'm not knocking your approach, in fact I quite like it. I merely wish to point out a potential flaw to future designs
-
What about higher quantities? Your idea of setting a bool directly on inventory would work for single items, but quantities would be much harder to handle
-
Could add checkboxes to your creation form, along with relevant columns to the items table - select, on item creation, where the item can be listed (if at all)
-
No. Prepared Statements do not secure your data any more than a standard query would. It is on the developer (namely you) to use the functionality as intended. The most obvious difference (when coding) between PDO and, say, MySQLi is that using Prepared Statements negates the requirement for escaping data. Another benefit of PDO is that it isn't limited to the MySQL(i) driver; it can support 12 different DB drivers (at the time of writing) - which makes it highly adaptable and extensible. Use either properly and you should be good to go.
-
I believe last month's top player would disagree with your speculation
-
There's very little point in using prepared statements if you're not preparing them. I'm definitely against this method
-
All of these effects can be obtained through other methods available in game.
-
YourMafia. While credits can be purchased with USD, it is not a requirement. In fact, last month's top player was a non-donator. The only "unique" items available are vanity items, offering no bonus over anything else that can be obtained while playing without paying. It keeps itself afloat. You were saying?
-
Dayo pinned it 😕
-
Alright guys, gals, and everything in between! All together now! And 1.. 2.. 3.. Yay Sim! Go Sim for doing the thing! Where's the band?! Start the fanfare! Edit: Found the band https://music.youtube.com/watch?v=wA-NRyWoYII
-
Does "income from writing games for other people" count?
-
Started writing a response (good things, I promise), decided it'd be better via DM
-
I'm already writing them 🙂
-
Speaking in a broader sense than GL; Why pass 50+ arrays when you can pass 1 multi-dimensional array? Make it easier on yourself at runtime!
-
If you're manually passing 50+ arrays to something, you've missed the point of arrays
-
Reppin' that NPC energy man ;)
-
More information requested. Screenshot contains the result of a call to var_dump(), but no error message. Is `US_shotBy` a valid key?
-
Unless you're on PHP 7.4 and typesetting is standard
-
Player classes + player class-based locations? System factions (not gangs)?
-
On a semi-related note, I'm diggin' your console management
-
You've got a random closing {/if}, but I see no relative opening one
-
I don't know the engine that well, but those arrays have caught my attention. Humour me, change to public function constructModule() { //get user inventory first $rec = $this->db->prepare(" SELECT IV_id AS 'id', IV_quantity AS 'amount', IT_name as 'type', I_name AS name, I_rank as 'rank', ROUND(I_damage / 100, 2) as 'damage' FROM inventory JOIN items JOIN itemTypes WHERE IV_userID=:user AND I_id = IV_itemID AND IT_id = I_type "); $rec->bindParam(":user", $this->user->id); $rec->execute(); //$allItems = array(); $inv = $rec->fetchAll(PDO::FETCH_ASSOC); //get item types $types = $this->db->prepare(" SELECT IT_id AS 'id', IT_name as 'type' FROM itemTypes ORDER BY IT_id ASC "); $types->execute(); $allItems = array(); while($type = $types->fetchObject()) { $allItems["type"][] = $type->type; $items = $this->db->prepare(" SELECT I_id AS id, I_name AS name, I_rank as 'rank', ROUND(I_damage / 100, 2) as 'damage' FROM items WHERE I_type=:typeID "); $items->bindParam(":typeID", $type->id); $items->execute(); while($item = $items->fetchObject()) { $allItems["item"]["name"][] = $item->name; $allItems["item"]["id"][] = $item->id; } } $this->html .= $this->page->buildElement("blackMarket", array( "location" => $this->user->getLocation(), "inventory" => $inv, "itemType" => $allItems )); }
-
[GLV2][MOD][$10.00] Modified Crimes and Theft
Magictallguy replied to Sim's topic in Paid Modifications
Loving the middle-button "autostory" there -
Move event.preventDefault(); above return false So this // process the form $('form').submit(function(event) { // get the form data var form = $('#ajaxItem'); var post_url = $(this).attr("action"); // process the form $.ajax({ type : 'POST', url : post_url, data : formData, dataType : 'json', encode : true }) return false; // stop the form refrshing event.preventDefault(); }); becomes this // process the form $('form').submit(function(event) { // stop the form refrshing event.preventDefault(); // get the form data var form = $('#ajaxItem'); var post_url = $(this).attr("action"); // process the form $.ajax({ type : 'POST', url : post_url, data : formData, dataType : 'json', encode : true }) return false; });
-
Sure. Whaddaya want?