Jump to content
MakeWebGames

Disable Refresh


Recommended Posts

Hello everyone, in hopes to stop all of the cheating going on in my game, I decided it's about time to disable refreshing. I've looked into this, and seen other games do it, but I haven't found any solid script or help for it yet. I imagine it would be a pretty simple javascript. I'm not too familiar with javascript, I have only used it a few times in my game so far. If someone could help me out with this I'd appreciate it very much. Auto refreshing has become a huge problem in many games, I think this could help a lot of people. If someone wants to throw it together and post it here as a free mod (I don't think it has been added yet) I'd gladly give them $5 for it.

Thanks,

Steve.

Link to comment
Share on other sites

Javascript or Ajax really isn't a good way, an user can turn that off..

Just an idea maybe someone can help with this..Using sessions

 

if(isset($_POST['stuff']))
{
if(isset($_SESSION['stop_refresh']))
{
	unset($_SESSION['stop_refresh']);
	echo 'Ok';
}
else
{
	echo 'no';
}
}
else
{
$_SESSION['stop_refresh'] = mt_rand(1,5000);
echo 'Your page stuff


 	<form action="PAGE" method="post">
 	<input type="text" name="stuff" value="Whatever" />
 	<input type="submit" value="Send" />
 	</form>';
}

 

I would think something along these lines would be best..

Link to comment
Share on other sites

Main areas for this type of cheating is areas in your game which can earn a little bit of money and exp where the player can load the same page to gain quickly. Quite common for the lowest crimes which although gains a small amount has less chance them getting jailed or put in the hospital. $10 refreshed all day can quite build up quite nicely.

Make sure you have your captcha set to a reasonable rate. Or change it to a click value. Or both! 8 minutes or 100 clicks for example.

Set a session routine as Alabama stated.

Its not cheating in a sense...just using a loophole in the game to gain quicker than you should but its a good thing to stop.

Link to comment
Share on other sites

Guest Drizzle

As for this, disabling refresh is not needed. If your worried about macro bots that do repeated tasks, use a captcha for every ( x ) amount of crimes done, times trained, etc. I suggest reCaptcha, as it isn't that hard to integrate and its much better than default mccodes one. As for attacking and opening a new page, make something to see if the user is attacking, and if they open a new tab while attacking, they lose their experience and health. Oh and a good idea is to create a mysql table in phpmyadmin that will update when a user fails a captcha, and if they fail too many times, they get fed jailed for a day

Link to comment
Share on other sites

Bah, the hell with CAPTCHAs. There are many bots that can read the MCCodes CAPTCHA.

Though, the attacking thingy you spoke about; there is a session defined when attacking(can be located in attack.php) and also a check to see if your on the actual attacking page(located in header.php).

In theory, opening any other page while attacking, would set the players experience points to zero, null - nada.

And you will never stop anyone who wants to browse in multiple tabs, or who wants to refresh their page.

The user is making use of the new web technologies, why don't you adapt your game to it as well?

Link to comment
Share on other sites

Trying to stop browser refresh is like trying to stop the mouse from leaving the window or the user from entering a url to navigate away from your page - it's impossible.

If you're trying to prevent refreshing, then your problem lies somewhere else (like in your code). Rewrite your features so refreshes are harmless. For example, refreshing a page after performing an action should only reload the result message, not the database update/insert.

Link to comment
Share on other sites

Guest Drizzle
Bah, the hell with CAPTCHAs. There are many bots that can read the MCCodes CAPTCHA.

Though, the attacking thingy you spoke about; there is a session defined when attacking(can be located in attack.php) and also a check to see if your on the actual attacking page(located in header.php).

In theory, opening any other page while attacking, would set the players experience points to zero, null - nada.

And you will never stop anyone who wants to browse in multiple tabs, or who wants to refresh their page.

The user is making use of the new web technologies, why don't you adapt your game to it as well?

I was talking about something like reCaptcha. McCodes Captcha sucks.

Link to comment
Share on other sites

Trying to stop browser refresh is like trying to stop the mouse from leaving the window or the user from entering a url to navigate away from your page - it's impossible.

If you're trying to prevent refreshing, then your problem lies somewhere else (like in your code). Rewrite your features so refreshes are harmless. For example, refreshing a page after performing an action should only reload the result message, not the database update/insert.

Excellent point Zeggy.

Link to comment
Share on other sites

Good points made, there are definitely other ways to go about this than disabling refresh I have added a basic captcha for now, will probably be changing it to reCaptcha as Drizzle suggested because it's by far the best I have seen.

Spudinski, I really don't mind my players using refresh, it's auto-refresh programs or addons that I am concerned about. In my game there are items for refilling brave/energy so people have their auto-refreshers going (doing both crimes and training the gym). Captcha only does so much because most of the time these people are still at their computer, they're just doing other things like watching a movie or whatever else they feel like doing which makes it very unfair for those players who actually sit there for hours at a time playing the game like it's meant to be played. But I have already decided on some changes I will be making to slow this down if not stop it completely. You're right, the game needs to adapt.

Link to comment
Share on other sites

I suppose while attacking, opening a new tab and going to buy health from the shop then going back to the attack tab but that's not exactly refreshing but yeah.
I have a attack.php for V1 that stop that. you would not be able to click attack and stop refill your health and then attack again... when you click attack on there profile it will ask you what you want to attack with and then it will run the whole attack with no stops. from step 1 right to the last step and it cant be stopped that I know of. I don't know much about this code it was on the game code that I got but Ill shear it with you guys. if you need more with it let me know what you need and ill look for it . If you email me Ill send it to you. Im having a bit of a problem posting the code on here.. it seems to want to run all together [email protected]

AGAIN this is for V1 so to use it on V2 you would need to convert it.

Link to comment
Share on other sites

How much will you pay for mod who is generating random number like this:

http://warp.izhr.com/t/rand1/

(refresh link, it will generate different number and color lines each time)

Need more details? :)

Well, awesome graphics maker of tc, it would be useless unless you sold it as a captcha.

http://makewebgames.io/index.php?page=RMarketplaceEntry&entryID=137

So i suggest about $5. :)

Link to comment
Share on other sites

I suppose while attacking, opening a new tab and going to buy health from the shop then going back to the attack tab but that's not exactly refreshing but yeah.

Simple fix to fix that, though most people don't think right to fix that. It's a simple fix for even new people.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...