• What are you working on? v15
    5,001 replies, posted
All API access of my app now goes through a script on my server, which means I'm in control of what happens and compwhizzi's precious API isn't done any harm. Oh, and the server can send custom error messages! [img]http://gyazo.com/7f53e3bf06b951e17fd78e8fa4382cd2.png[/img] [php]$res = mysql_query( "SELECT id FROM beta_users WHERE uid = '" . $_GET["uid"] . "' LIMIT 1" ); if ( mysql_num_rows( $res ) == 0 ) die( "SERVERERROR:You are not in the beta!" );[/php] [sp]And yes, $_GET["uid"] is verified to be numeric in advance.[/sp]
[QUOTE=Overv;27595607][sp]And yes, $_GET["uid"] is verified to be numeric in advance.[/sp][/QUOTE] Wouldn't it make more sense to cast it to an integer or something?
[QUOTE=vepa;27596746]Wouldn't it make more sense to cast it to an integer or something?[/QUOTE] Would be pretty pointless as inserting it into the MySQL query requires it to be converted back to a string.
[media]http://www.youtube.com/watch?v=pH_q3KSB9YA&feature=player_embedded[/media]
Any ideas what I should do with my Mario when it's done? I am thinking of either making it SMB HD or adding multiplayer, but maybe someone has another idea? also how's my avatar except brutal
I'm streaming coding and other random shits. To watch, open windows media player, hit ctrl+u and type in [code]http://mmavipc.dyndns.org:15910[/code] I have a tinychat up for it [url]http://tinychat.com/mmavipcstream[/url] [editline]23rd January 2011[/editline] [QUOTE=Maurice;27597359]Any ideas what I should do with my Mario when it's done? I am thinking of either making it SMB HD or adding multiplayer, but maybe someone has another idea?[/QUOTE] multiplayer [editline]23rd January 2011[/editline] [editline]23rd January 2011[/editline] [editline]23rd January 2011[/editline] [editline]23rd January 2011[/editline] [editline]23rd January 2011[/editline] [editline]23rd January 2011[/editline] [editline]23rd January 2011[/editline] [editline]23rd January 2011[/editline] [editline]23rd January 2011[/editline] Stream going down
[QUOTE=mmavipc;27597400]I'm streaming coding and other random shits. To watch, open windows media player, hit ctrl+u and type in [code]http://mmavipc.dyndns.org:15910[/code] I have a tinychat up for it [url]http://tinychat.com/mmavipcstream[/url][/QUOTE] okay WE GET IT
I'm gonna code and you can't watch me because you don't care.
I care bby
[QUOTE=Maurice;27597359]Any ideas what I should do with my Mario when it's done? I am thinking of either making it SMB HD or adding multiplayer, but maybe someone has another idea? also how's my avatar except brutal[/QUOTE] You should make everything class based, keep it organized, release it as an engine for LOVE based platformers, add multiplayer stuff, and your avatar is great. [editline]22nd January 2011[/editline] What, things appearing in my quotes.
[QUOTE=deloc;27597544]okay WE GET IT[/QUOTE] I only post it when there's a new page && I start streaming Edit: Everyone always comments on the amount of toolbars I have. THERE'S ONLY 2 FUCKING NON-DEFAULT TOOLBARS
[QUOTE=mmavipc;27597784]I only post it when there's a new page [B]&&[/B] I start streaming[/QUOTE] That's so programmer.
[QUOTE=mmavipc;27597784]I only post it when there's a new page && I start streaming Edit: Everyone always comments on the amount of toolbars I have. THERE'S ONLY 2 FUCKING NON-DEFAULT TOOLBARS[/QUOTE] But that is so many little apps on it, why do you need them?
[QUOTE=vepa;27596746]Wouldn't it make more sense to cast it to an integer or something?[/QUOTE] Someone just helped me test it and it turned out there are also unique device identifiers that are alphanumeric. Means it is now verified using regex and not checked for being numeric anymore.
Made a quick mockup of what i want the main menu to look like in my game. [img_thumb]http://img534.imageshack.us/img534/4467/92368729.png[/img_thumb] The idea is to have the post-apocaliptic city in the background and then have a fire with smoke in the foreground (obv the fire and smoke would run on a particle system so it actually looks like fire) Im going for the kinda look that Source games have where their menu has a moving background Any thoughts or opinions?
[QUOTE=Richy19;27598089][img_thumb]http://img534.imageshack.us/img534/4467/92368729.png[/img_thumb] [/QUOTE] up there w/ andersonmat.
[QUOTE=Richy19;27598089]Made a quick mockup of what i want the main menu to look like in my game. [img_thumb]http://img534.imageshack.us/img534/4467/92368729.png[/img_thumb] The idea is to have the post-apocaliptic city in the background and then have a fire with smoke in the foreground (obv the fire and smoke would run on a particle system so it actually looks like fire) Im going for the kinda look that Source games have where their menu has a moving background Any thoughts or opinions?[/QUOTE] If you need any help with static images, I am bored and would do it
[QUOTE=BipolarPanda;27598138]If you need any help with static images, I am bored and would do it[/QUOTE] If your able to create a destroyed city at nightime (so dark) that would be great [editline]23rd January 2011[/editline] [QUOTE=deloc;27598134]up there w/ andersonmat.[/QUOTE] I dont get it
[QUOTE=Richy19;27598172]If your able to create a destroyed city at nightime (so dark) that would be great [editline]23rd January 2011[/editline] I dont get it[/QUOTE] That might take longer and more skill than i have, stuff like the gui is my thing though.
[code]Visual Leak Detector detected 1255 memory leaks.[/code] :gonk: teaching yourself sucks, but at least the lessons you learn are burnt in from several hours of fixing them.
[IMG]http://i55.tinypic.com/30mbbww.png[/IMG] I got bored and wrote a program that's basically just LuaInterface'ing C# Console library :S I guess it could make for some exciting lua-based text adventures. :downs:
You seem low on health
[QUOTE=Overv;27595607]All API access of my app now goes through a script on my server [/QUOTE] how trustworthy.
Got preliminary block support working in Fructose. The best part is, it doesn't require PHP 5.3's built-in closures!! :toot: Given this Ruby input: [img]http://ahb.me/1zbp[/img] It produces this PHP output: [url]http://codepad.org/enK6Pd8x[/url] [php] <?php include('libfructose.php'); $_stack = array(); $_lambda_objs = array(); class F_A extends F_Object { public static function F_new() { $obj = new F_A; $args = func_get_args(); if(method_exists($obj,'F_initialize')) call_user_func_array(array($obj,'F_initialize'), $args); return $obj; } public function F_foo($block) { $_stack = array(); if(!isset($_locals->self)) $_locals->self = $this; global $_lambda_objs; $_stack[] = $block(NULL); $_stack[] = $_locals->self; $_stack[] = array_pop($_stack)->F_puts(NULL, array_pop($_stack)); return array_pop($_stack); } public function F_bar($block) { $_stack = array(); if(!isset($_locals->self)) $_locals->self = $this; global $_lambda_objs; $_stack[] = F_String::__from_string('foobar'); $_locals->F_local = $_stack[count($_stack)-1]; $_stack[] = $_locals->self; $_lambda_objs_offset = count($_lambda_objs); $_lambda_objs[] = $_locals; $_stack[] = array_pop($_stack)->F_foo(create_function('',sprintf('global $_lambda_objs; $args = func_get_args(); $_locals = $_lambda_objs[%d]; array_unshift($args, $_locals); return call_user_func_array(array($_locals->self,"F___lambda_1"), $args);',$_lambda_objs_offset))); return array_pop($_stack); } public function F___lambda_1($_locals, $block) { $_stack = array(); if(!isset($_locals->self)) $_locals->self = $this; global $_lambda_objs; $_stack[] = $_locals->F_local; return array_pop($_stack); } } $_stack[] = F_A::F_new(NULL); $_stack[] = array_pop($_stack)->F_bar(NULL); [/php] It's pretty rough around the edges, and I'm not sure how well it'll hold up, but it works [b]perfectly[/b] for that little Hello World example, so I'm absolutely stoked!
[QUOTE=Overv;27595607][php]$res = mysql_query( "SELECT id FROM beta_users WHERE uid = '" . $_GET["uid"] . "' LIMIT 1" ); if ( mysql_num_rows( $res ) == 0 ) die( "SERVERERROR:You are not in the beta!" );[/php] [sp]And yes, $_GET["uid"] is verified to be numeric in advance.[/sp][/QUOTE] I know it's not web programming, but you should really use sanitise received data before you use it using mysql_real_escape_string. Although there isn't any real danger here because you can't run multiple mysql queries in PHP, it's bad practice.
[QUOTE=garry;27603332]I know it's not web programming, but you should really use sanitise received data before you use it using mysql_real_escape_string. Although there isn't any real danger here because you can't run multiple mysql queries in PHP, it's bad practice.[/QUOTE] There is real danger if sensitive data is stored in the database. Someone could fashion a UNION SELECT or JOIN to grab it out. Also, he should be using prepared statements, which something like PDO makes trivial.
[QUOTE=Venice Queen;27603712]There is real danger if sensitive data is stored in the database. Someone could fashion a UNION SELECT or JOIN to grab it out. Also, he should be using prepared statements, which something like PDO makes trivial.[/QUOTE] He just said he did that allready in the spoiler: And yes, $_GET["uid"] is verified to be numeric in advance.
MySQL paramaters are the shit. I dunno if PHP supports them though. C# example: [cpp] MySQLCommand command = new MySQLCommand("SELECT id FROM beta_users WHERE uid = @UserID LIMIT 1;", connection) command.Parameters.AddWithValue("@UserID", intUID); [/cpp] It just makes everything so much safer.
Been working on rewriting my space station game to be the same thing just well different. Instead of modules you place tiles and the place items inside the spaces you create to add working parts. Sort of hard to explain but yeah.
[img]http://i54.tinypic.com/261dijk.png[/img] - Made it a bit fancier. - Added option to place the window at 0,0 or not move it at all. - Can now resize it properly. - Loads and saves width/height properly. Download: [url=http://filesmelt.com/dl/Border_Remover1.rar]Here[/url] Should i give the user ability to choose which monitor he wants the window to be placed on?
Sorry, you need to Log In to post a reply to this thread.