Jump to content
MakeWebGames

Floydian

Members
  • Posts

    900
  • Joined

  • Last visited

    Never

Everything posted by Floydian

  1. Re: The world mite end on Wednesday 10ths september 2008... lol We wouldn't have the electronic revolution if it weren't for people delving into the subatomic world. The computer Extermination relied on to post his last post is 99.99999% likely to be using transistors that are the direct result of advances in quantum mechanics :O Don't knock the sort of science that's going on at CERN in less you're prepared to forgo the future advances in technology that result in it.   If all that came of these sorts of things was abstract non useful information, governments and private entities would not be pouring billions of dollars into the research. Trust me, advances will come of this. I don't know when they will happen, but when we learn more about how every thing works, we gain the ability to make newer and better technologies. Ten years from now, I'm sure we'll have some fantastic new tech that we can't even imagine..... We're actually overdue, in my opinion for another major technological advancement.....   Just consider the internet. For those that remember the eighties, they remember how no one lived online unless they were a professor at a college shooting emails between colleagues. There was no MSN messenger, and there was no internet. We'll likely see something big, maybe not on the scale of the internet, but something that's still big in the next ten years and it'll likely be have some tie to quantum mechanics since miniaturization is still a hot topic and there's a much we can do to miniaturize still.
  2. Re: Sick & Tired     Cool ;) Nice looking site. Now you need to get some more ready made mods up there :P A quick suggestion: Something like TC's dog tags might be a neat addon for your attack script. O:
  3. Re: The world mite end on Wednesday 10ths september 2008... The science doesn't support that outcome. Hawking's theory of black hole evaporation states that the black holes that ---quote--- could happen ---end quote--- would evapirate before they had a chance to do any damage at all. The science is so solid on this that I'd be right there when they fire it up if I could. It's great for media stories and cable news in the US has carried the story, but only as a small blurb. There's no serious scientists that actually believe anything bad would happen.   The deal is, these blackholes, if they are created, would exist on the quantum scale. Hawking has demonstrated conclusively that as blackholes take in matter, they also evaporate, and the rate of evaporation at such a small scale would be greater than any mass the black hole could take in. To create a blackhole that would cause a threat, you'd likely have to clump together something a bit more sizable than two particles in a collider beam. I don't know how much it would take, but we can't do it, period.
  4. Re: Sick & Tired   So I wanted to go to your site, but it turns out your banner isn't clickable. :O:O   [ url= site link][ img]img link[ /img][ /url] anyways, if you decided to change it, you can wrap your image in a [ url] tag, set the ='s part to your link, toss in an image into the middle of the url tags, and bam. Done ;) I'll click on over and check ya out when ya get that sorted :P
  5. Floydian

    Cron Jobs

    Re: Cron Jobs I guess anyone that has a cpanel with cron jobs could throw a curl command into their cpanel. You'd be completely dependent on them to keep it going, and to not run it more or less than it should be.
  6. Re: An introduction to security When I code for myself, I always have E_ALL set. The biggest thing that comes up is undefined variables (for me at least). If you have POST, GET, or REQUEST vars on the page, you should check if they were submitted by using the isset() function.   if(!isset($_POST['......']) { // either put an error message and die, or set a default } else { $...... = $_POST['........']; }   The point of that bit of code is that any POST var is checked if it "isset" and if it is, store it in a local variable. Then you should only be using local variables after the POST, GET, or REQUEST arrays have been checked. It actually makes code easier to read as well.   mysql_query("update {$_POST['......']} set blah = '{$_POST['......']}' where foo = '{$_POST['......']}'"); or mysql_query("update $...... set blah = '$........' where foo = '$.........'");   Maybe it's just me though... :P (no this example isn't meant to convey secure db querying...., it's just an example of readability)
  7. Re: Need some help. while($n > $count)   Correct me if I'm wrong, but wouldn't $n be less than $count until it's been incremented? ;)
  8. Re: Help it's a unix command   from the command prompt (use ssh login) chown user_name path_to_file/filename.php   make sure you login as root, and you must have ssh access (sometimes called shell access) to do this. if you cannot change the owner of the file, you will have to edit the file yourself, not relying on the installer. I cannot help you with that bar doing it for you. good luck.
  9. Re: Account System without MySQL As rasmus lerdorf (creator of php) says: if the answer to your question is "eval" you are almost certainly asking the wrong question. ;)
  10. Re: Help lol no offence, but "it would take 5 minutes if you knew..." is, oh never mind, I won't say it.   You either don't have that file, or you don't have permission to open it (i.e., PHP doesn't have permission.)   You could try chown[ing] the file to "nobody" and see if that does it.
  11. Re: Random money amounts (big numbers) Thanks for the compliments Extermination ;) Thanks for the correction killah :mrgreen:
  12. Re: Random money amounts (big numbers)   I could be wrong but isn't the limit to an integer 2.1 billion anyway?   That's right. The idea here is that instead of putting numbers larger than 2.1 billion into the rand function, we put smaller numbers into it, i.e., 1 to 100, and then calculate a money amount. A random number of say 34 would amount to 34% of something. If you wanted a min and max range of money values, then 34% into that range is calculated with my range_to_value() function instead of using rand(min, max) which would fail with large numbers.
  13. Re: Random money amounts (big numbers) Thanks for the compliment Jaye1 ;)   EDIT: range_to_percent is dependent on another function which I didn't originally post, It's now posted along with the other function.   You might like the companion function of the range_to_value() function. It does the opposite which is takes a min and max value, and a percent. Then it returns the actual value in the range. For instance, range_to_percent(100, 200, 150) would give you a percent that represents where in the middle of the range from 100 to 200 that the number 150 is. Which is 50%.   function to_percent($min, $max) { return $percent = $min * 100 / $max; } // submit a numeric value, and find a percent of where in the range that number is. function range_to_percent($low, $high, $value) { $range = $high - $low; $target = to_percent($value - $low, $range); return $target; }   Sometimes I use these two range functions in combination. Say in your crime file you want to base pay out on stats. Suppose your crime exp is 500 and you want to base pay on crime exp. A min crime exp of 400 and a max crime exp of 1000. You would get a % of where in the middle your crime exp is in the range of 400 to 1000. And then you might have a min payout of 100 bucks and a max payout of 300 bucks. If your crime exp was at 400, you'd get 100 bucks, and if your crime exp was at or above 1000, you'd get 300 bucks. Please note that the range to percent function will return %'s less than 0 and greater than 100, so you might want to have an if block to compensate. I'll demonstrate:   $stat_percent = range_to_percent(400, 1000, 500); if ($stat_percent < 1) { $stat_percent = 1; } elseif ($stat_percent > 100) { $stat_percent = 100; } $payout = range_to_value(100, 300, $stat_percent);   And now you have a sweet, easy to code, sliding payout scale where you have min and max stat values and min and max payout values, and your payouts would be scaled to the payout. If you wanted to actually randomize the result, you could then do:   $payout *= rand(50,100) * 0.01;   That would make the final payout somewhere in the range of 50% to 100% of whatever they would have gotten. Alternatively, you could modify the percentage you ended up with, i.e., "$stat_percent" like this:   $stat_percent = range_to_percent(400, 1000, 500); if ($stat_percent < 1) { $stat_percent = 1; } elseif ($stat_percent > 100) { $stat_percent = 100; } $stat_percent = range_to_percent($stat_percent*0.5, $stat_percent, rand(1,100)); $payout = range_to_value(100, 300, $stat_percent);     This line here: $stat_percent = range_to_percent($stat_percent*0.5, $stat_percent, rand(1,100)); would take your percentage, and then come up with a randomized percentage somewhere in the range of: the half of that percentage and the full percentage. So, if your percentage had been 75, you would get a random percentage from 37.5 to 75. Of course that could be tightened up so that the randomized amount wouldn't swing as much as that would. Say instead of having a range that swings by 50%, you could do $stat_percent*0.9 which would give you a random swing in the 10% range.
  14. A lot of times, I see code that is designed to randomly choose an amount of money to give a user programmed like this:   $min = 100; $max = 200; $amount = rand($min, $max);   This pattern arises when you have min and max values stored in a database table like crimes perhaps. But this could apply to lots of things, even things that aren't money related. The problem arises when the amounts get into the billion range. At about 2.1 billion, rand starts to spit out negative numbers. PHP's rand function is based on integers which is in contrast to say javascript or mysqls float based rand functions.   Because of this, that code pattern will break down with large numbers. How do we compensate?   function range_to_value($low, $high, $percent) { $range = $high - $low; $target = $range * $percent * 0.01 + $low; return $target; }   This is a nifty little function that I use that has saved me time programming many a script... All it does is takes a min and max value, and then computes a value in the middle of that according to the percent passed into the function.   Instead of just figuring out the percent of the max value, the range begins at the min value and ends at the max value. Simply doing something like 200 * 0.5 (fifty percent of 200) results in 100, but suppose we want 50% in the middle of 100 and 200. Well, the answer is 150, and the way to do it is: function range_to_value($low, $high, $percent) { $range = $high - $low; $target = $range * $percent * 0.01 + $low; return $target; } $min = 100; $max = 200; $amount = range_to_value($min, $max, rand(1,100));   Now, I've set that up to generate a random percent, but that third parameter could be set to 50. Have fun with this! It will work with extremely large numbers. The only limitation is that the range, in this case a range of 100 numbers, is 100. If your range is 1bill to 2 bill, the range would be 1bill, but with this code, you only get 100 variations. So be that as it may, you still get results spread out over that range, but there are only ever going to be 100 different results.
  15. Re: help If you can reproduce the effect, i.e., you can reliably buy a house yourself, and get two at once, then try this: Disable all of your css stylesheets and any css embedded into the header. Then try to reproduce the effect. I know you're going to say: What does css have to do with it. Just try it. It might work. (I have seen css cause this before.)
  16. Re: Just a heads up to all game owners!   Thanks for the recommendation. In the interest of full disclosure, a price was offered for full exclusivity (which means I wouldn't resell) and a seperate offer for full exclusivity and resell rights. Both were declined ;) I just didn't want anyone to think there was shady business going on here. ;)
  17. Re: Regen I'd suggest lowering the amount they get per regen, instead of making the interval longer. But by all means, if you are set on making the interval longer, go for it. ;)
  18. Re: Regen It might not be a good idea to do that. I had regen set for every ten minutes in my game. And even though they would get twice the regen as they would at 5 minute intervals, people didn't like it.   In other words, even if you give them the same regen in 15 minutes, as they would have gotten in 3 five minute regens, your players are likely to not like it. The complaint will be: But we have to wait longer before we can do something. Trust me on this...
  19. Re: Secure all pages using globals or header Yes and no. For the sample site, I have an "express login" that allows anyone to login to the default account. That allows folks that don't care to go through the registration process to check it out. There's quite a few things in the admin panel that are "dissallowed" on the sample site as well, not the least of which is the ability to hook new staff modules into the game.
  20. Re: Secure all pages using globals or header My banner links to the site ;) Look for the Horizons Game Engine button.
  21. Re: Secure all pages using globals or header It will cost. $300 Think of it as mccodes version 1 million. It's that much better... (it's not based on mccodes at all, it's completely 100% original)
  22. Re: Copyright issues - torncity lol did I mention I'm selling a "rewrite" of something that is similiar but not the same as Torn Cities new organized gang crimes? None of their images are used, none of their html is used, I've never even done their organized crimes. All I know is someone explained to me kinda sorta how it works and I made something that's better and 100% secure.   mail me if you wanna buy it lol [me=Floydian]sticks finger in cheds face[/me]
  23. Re: Just a heads up to all game owners! lol did I mention I'm selling a "rewrite" of something that is similiar but not the same as Torn Cities new organized gang crimes? None of their images are used, none of their html is used, I've never even done their organized crimes. All I know is someone explained to me kinda sorta how it works and I made something that's better and 100% secure.   mail me if you wanna buy it lol [me=Floydian]sticks finger in cheds face[/me]
  24. Re: Secure all pages using globals or header The release will be in a week or two. It's 95% complete. It's mainly cosmetic appointments that need to be finished.
  25. Re: Secure all pages using globals or header That works for me. I'm not a big mccodes guy. I forget that mccodes uses authenticate along with login to handle logins instead of just one file. Well, there you go ;)
×
×
  • Create New...