UCC Posted October 17, 2007 Share Posted October 17, 2007 This is a long shot question, I wasnt going to post but since I logged in to reply to Scarlet, I thought I would post this too. Does anyone know how to prevent users from playing a PHP game via tabbed Firefox browsing? The ability to refresh multiple tabs at the same time can create an unfair advantage. I dont think it is even possible to detect when users are doing this. Any ideas? Quote Link to comment Share on other sites More sharing options...
Isomerizer Posted October 17, 2007 Share Posted October 17, 2007 Re: Tabbed Browsing I've allways wanted to know how to prevent this too. Quote Link to comment Share on other sites More sharing options...
hamster01 Posted October 17, 2007 Share Posted October 17, 2007 Re: Tabbed Browsing Sessions, log the times. You can also use apache to disable more than one request. Quote Link to comment Share on other sites More sharing options...
c0rkscrew Posted October 19, 2007 Share Posted October 19, 2007 Re: Tabbed Browsing A great example of how to do this lies within the Legend Of The Green Dragon codes which can be downloaded via www.dragonprime.net (I think that's the url.) I've been meaning to dig into the codes and see what they do but I haven't had the time or desire to pick through it lately, but I intend to soon. You can't even refresh a page in LOGD if I remember correctly. Quote Link to comment Share on other sites More sharing options...
YoungGold Posted October 20, 2007 Share Posted October 20, 2007 Re: Tabbed Browsing AJAX and XML works good for this, You cannot open a tab at all, It will just show the XML of the page. Example is at: www.criminalfire.com yeh thats a good example. for those who cannot identify the the example it is you can view all pages in both tabs But as soon as you refresh it takes you back to logged in page Quote Link to comment Share on other sites More sharing options...
hamster01 Posted October 20, 2007 Share Posted October 20, 2007 Re: Tabbed Browsing AJAX and XML works good for this, You cannot open a tab at all, It will just show the XML of the page. Example is at: www.criminalfire.com And here is how you exploit it: var ajaxPost = function(page, data) { var ajax = new CustAjax(); try { var loader = document.getElementById('content'); loader.innerHTML = '<center>[img=images/loading3.gif]</center>'; } catch(error) {} ajax.doPost(page, handleContent, 'xml', data); return false; } Quote Link to comment Share on other sites More sharing options...
tearie2000 Posted October 25, 2007 Share Posted October 25, 2007 Re: Tabbed Browsing Probably dumb question.. but how do I impletment this into V1.1? Quote Link to comment Share on other sites More sharing options...
Godhand Posted January 27, 2008 Share Posted January 27, 2008 Re: Tabbed Browsing Another idea for how they can exploit it is using the top tab functions and click extremely fast before the page even loads for them though. The best way to avoid that is to make almost every page refresh before they can get the coding. I know that I've seen that on a game before. What that does is basically when they use an item it revamps to inventory.php but they can still hit the stop button Quote Link to comment Share on other sites More sharing options...
Floydian Posted January 29, 2008 Share Posted January 29, 2008 Re: Tabbed Browsing Why not just put in something that store that time when the last page was loaded, and if the next page is loaded within say one second of the last, have the script die in the header? if (!isset($_SESSION['time_of_last_page_load'])) { $_SESSION['time_of_last_page_load'] = time(); } else { if ($_SESSION['time_of_last_page_load'] == time()) { Echo "Pages cannot be loaded faster than one page per second." die; } $_SESSION['time_of_last_page_load'] = time(); } It would be super easy to modify that to increase that to two seconds if you wanted. Sure beats changing a bunch of stuff around in some complex way eh? :-) Quote Link to comment Share on other sites More sharing options...
Godhand Posted January 29, 2008 Share Posted January 29, 2008 Re: Tabbed Browsing Now that would also do it. Although I will say 3 page per second still is pushing it for some gamers (without tabs). For instance refreshing for the daily cron. Quote Link to comment Share on other sites More sharing options...
Floydian Posted January 29, 2008 Share Posted January 29, 2008 Re: Tabbed Browsing Although I understand the desire to prevent tabbed browsing, speaking just from a players point of view, if I were playing a game that all of the sudden prevented me from doing that, I would be sorely disappointed. I can think of numerous instances where I use multiple tabs, especially as staff. Doing investigations into multies could be hampered. Perhaps at least excluding staff from any restrictions should be considered. Quote Link to comment Share on other sites More sharing options...
Godhand Posted January 31, 2008 Share Posted January 31, 2008 Re: Tabbed Browsing maybe this will work if (!isset($_SESSION['time_of_last_page_load'])) { $_SESSION['time_of_last_page_load'] = time(); } else { if (!isset($_SESSION['time_of_last_page_load'])) { $_SESSION['time_of_last_page_load'] = time() AND $user_level>1; } else { if ($_SESSION['time_of_last_page_load'] == time()) { Echo "Pages cannot be loaded faster than one page per second." die; } } $_SESSION['time_of_last_page_load'] = time(); } just a thought. expanding the coding some :wink: I might have done it wrong but I believe something like that *should* work. Quote Link to comment Share on other sites More sharing options...
Floydian Posted January 31, 2008 Share Posted January 31, 2008 Re: Tabbed Browsing That'd be great for allowing staff to do their thing. The only thing that remains is the compromise: is it worth hampering your players from playing in a way that is comfortable with them (realizing of course not everyone surfs this way, but some do) and at the same time reducing server load, or is accepting more server load, and making the game more comfortable to those that do surf that way (within reason) the way to go? Personally, I put those kinds of restrictions only on the training page. But someone that likes to surf the forums by opening multiple forum topics in tabs isn't really creating a strain on the server, right? Quote Link to comment Share on other sites More sharing options...
Godhand Posted February 1, 2008 Share Posted February 1, 2008 Re: Tabbed Browsing Well then put it in gym.php and any other portion you don't want them opening more than one at a time. Ie- inventory.php, bank.php. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.